memo
field on every ICS20 and ICS721 transfer packet as of IBC v3.4.0. Move hooks is an IBC middleware that parses an ICS20 transfer, and if the memo field is of a particular form, executes a Move contract call. We now detail the memo format for Move contract calls, and the execution guarantees provided.
MsgExecute
is defined here and other types are defined here as the following type:
Sender
: We cannot trust the sender of an IBC packet, the counter-party chain has full ability to lie about it. We cannot risk this sender being confused for a particular user or module address on Initia. So we replace the sender with an account to represent the sender prefixed by the channel and a Move module prefix. This is done by setting the sender to Bech32(Hash(Hash("ibc-move-hook-intermediary") + channelID/sender))
, where the channelId is the channel id on the local chain.ModuleAddress
: This field should be directly obtained from the ICS-20 packet metadataModuleName
: This field should be directly obtained from the ICS-20 packet metadataFunctionName
: This field should be directly obtained from the ICS-20 packet metadataTypeArgs
: This field should be directly obtained from the ICS-20 packet metadataArgs
: This field should be directly obtained from the ICS-20 packet metadata.memo
is not blankmemo
is valid JSONmemo
has at least one key, with value "move"
memo["move"]["message"]
has exactly five entries, "module_address"
, "module_name"
, "function_name"
, "type_args"
and "args"
receiver
== "" || receiver
== "module_address::module_name::function_name"
memo
is not blankmemo
is valid JSONmemo
has at least one key, with name “move”memo['move']['async_callback']['id']
: the async callback id is assigned from the contract. so later it will be passed as argument of ibc_ack and ibc_timeout.memo['move']['async_callback']['module_address']
: The address of module which defines the callback function.memo['move']['async_callback']['module_name']
: The name of module which defines the callback function.MsgExecuteMessages
in OPchild module.