diff --git a/.gitbook/core-modules/wasm.md b/.gitbook/core-modules/wasm.md index 39e5debe6..1f085d820 100644 --- a/.gitbook/core-modules/wasm.md +++ b/.gitbook/core-modules/wasm.md @@ -41,9 +41,9 @@ console.log(txHash); ### MsgExecuteContract (funds example) -In some scenario, depending on the smart contract's function we have to transfer tokens to the smart contract, following cosmwasm convention we use the funds field to transfer tokens to the smart contract from the user's bank module. +In some scenarios, depending on the smart contract's function we have to transfer tokens to the smart contract, following cosmwasm convention, we use the funds field to transfer tokens to the smart contract from the user's bank module. -Below is an example of how we can send the MsgExecuteContract using an `test` contract function. +Below is an example of how we can send the `MsgExecuteContract` using an `test` contract function. ```ts import { @@ -82,32 +82,11 @@ console.log(txHash); ### MsgExecuteContractCompact -There are some compatibility issue parsing the funds array in the previous example with EIP712. -Since MsgExecuteContract can't be converted to EIP712 and then signed by ethereum wallets, we introduced MsgExecuteContractCompact which converts the funds into a string and therefore allows for EIP712 transformation. -Note that the MsgExecuteContract and MsgExecuteContractCompat underlying messages are the same. MsgExecuteContractCompat will just format for EIP712 compatibility. +There are some compatibility issues parsing the `funds` array and `msgs` object in the previous example with EIP712. Since `MsgExecuteContract` can't be properly converted to EIP712 and then signed by Ethereum wallets, we introduced `MsgExecuteContractCompact` which is fully compatible with EIP712. -An array of funds: +_**Note:**_ _`MsgExecuteContract` and `MsgExecuteContractCompat` underlying messages are the same. `MsgExecuteContractCompat` is just EIP712 compatible._ -```ts -const funds = [ - { - denom: denom1, - amount: new BigNumberInBase(1).toWei().toFixed(), - }, - { - denom: denom2, - amount: new BigNumberInBase(1).toWei().toFixed(), - }, -]; -``` - -will be presented as a string like this: - -```ts -const funds = "100000000000000000 denom1, 100000000000000000 denom2"; -``` - -Below is an example of how we can send the MsgExecuteContractCompact using an `test` contract function. +Below is an example of how we can send the `MsgExecuteContractCompact` using an `test` contract function. ```ts import {