Move IBC hooks
Overview
Move Contract Execution Format
// HookData defines a wrapper for Move execute message
// and async callback.
type HookData struct {
// Message is a Move execute message which will be executed
// at `OnRecvPacket` of receiver chain.
Message movetypes.MsgExecute `json:"message"`
// AsyncCallback is a callback message which will be executed
// at `OnTimeoutPacket` and `OnAcknowledgementPacket` of
// sender chain.
AsyncCallback *AsyncCallback `json:"async_callback,omitempty"`
}
// AsyncCallback is data wrapper which is required
// when we implement async callback.
type AsyncCallback struct {
// callback id should be issued form the executor contract
Id uint64 `json:"id"`
ModuleAddress string `json:"module_address"`
ModuleName string `json:"module_name"`
}
type MsgExecute struct {
// Sender is the that actor that signed the messages
Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
// ModuleAddress is the address of the module deployer
ModuleAddress string `protobuf:"bytes,2,opt,name=module_address,json=moduleAddress,proto3" json:"module_address,omitempty"`
// ModuleName is the name of module to execute
ModuleName string `protobuf:"bytes,3,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty"`
// FunctionName is the name of a function to execute
FunctionName string `protobuf:"bytes,4,opt,name=function_name,json=functionName,proto3" json:"function_name,omitempty"`
// TypeArgs is the type arguments of a function to execute
// ex) "0x1::BasicCoin::Initia", "bool", "u8", "u64"
TypeArgs []string `protobuf:"bytes,5,rep,name=type_args,json=typeArgs,proto3" json:"type_args,omitempty"`
// Args is the arguments of a function to execute
// - number: little endian
// - string: base64 bytes
Args [][]byte `protobuf:"bytes,6,rep,name=args,proto3" json:"args,omitempty"`
}ICS20 Packet Structure
Execution Flow
Async Callback
Conclusion
Last updated