The wasm module is the heart of interacting with the wasm smart contracts deployed on the injective chain, here you can find a list of smart contracts that are deployed on the Injective chain.
MsgExecuteContract (Transfer)
This message is used to execute contract function, below we will use the CW20 spec transfer message as an example.
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.
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 MsgExecuteContractCompat which is fully compatible with EIP712.
Note:MsgExecuteContract and MsgExecuteContractCompat underlying messages are the same. MsgExecuteContractCompat is just EIP712 compatible.
Below is an example of how we can send the MsgExecuteContractCompact using an test contract function.