Documentation
¶
Index ¶
- Constants
- Variables
- func DecodePrecompileCallToWasmInput(input []byte) (wasmAddr, calldata string, err error)
- func DecodePrecompileQueryToWasmInput(input []byte) (calldata string, err error)
- func EncodePrecompileCallToWasmOutput(response string) ([]byte, error)
- func EncodePrecompileQueryToWasmOutput(response string) ([]byte, error)
- func ErrMsgSendToEvm(str string) sdk.EnvelopedErr
- func GetEVMABIConfig(data []byte) (abi.ABI, abi.Event, abi.Event)
- func GetMethodByIdFromCallData(calldata []byte) (*abi.Method, error)
- func GetMintCW20Input(amount, recipient string) ([]byte, error)
- func GetMintERC20Input(callerAddr string, recipient common.Address, amount *big.Int) ([]byte, error)
- func GetMintERC20Output(data []byte) (bool, error)
- func GetPreCompileABI(data []byte) evm_types.ABI
- func GetWasmVMQueryRequest(requestData []byte) (*wasmvmtypes.QueryRequest, error)
- func RegisterInterface(registry interfacetypes.InterfaceRegistry)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- type MintCW20Method
- type MsgCallToEvm
- func (*MsgCallToEvm) Descriptor() ([]byte, []int)
- func (msg MsgCallToEvm) GetSignBytes() []byte
- func (msg MsgCallToEvm) GetSigners() []sdk.AccAddress
- func (m *MsgCallToEvm) Marshal() (dAtA []byte, err error)
- func (m *MsgCallToEvm) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCallToEvm) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgCallToEvm) ProtoMessage()
- func (m *MsgCallToEvm) Reset()
- func (msg MsgCallToEvm) Route() string
- func (m *MsgCallToEvm) Size() (n int)
- func (m *MsgCallToEvm) String() string
- func (msg MsgCallToEvm) Type() string
- func (m *MsgCallToEvm) Unmarshal(dAtA []byte) error
- func (msg MsgCallToEvm) ValidateBasic() error
- func (m *MsgCallToEvm) XXX_DiscardUnknown()
- func (m *MsgCallToEvm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCallToEvm) XXX_Merge(src proto.Message)
- func (m *MsgCallToEvm) XXX_Size() int
- func (m *MsgCallToEvm) XXX_Unmarshal(b []byte) error
- type MsgCallToEvmResponse
- func (*MsgCallToEvmResponse) Descriptor() ([]byte, []int)
- func (m *MsgCallToEvmResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgCallToEvmResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCallToEvmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgCallToEvmResponse) ProtoMessage()
- func (m *MsgCallToEvmResponse) Reset()
- func (m *MsgCallToEvmResponse) Size() (n int)
- func (m *MsgCallToEvmResponse) String() string
- func (m *MsgCallToEvmResponse) Unmarshal(dAtA []byte) error
- func (m *MsgCallToEvmResponse) XXX_DiscardUnknown()
- func (m *MsgCallToEvmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCallToEvmResponse) XXX_Merge(src proto.Message)
- func (m *MsgCallToEvmResponse) XXX_Size() int
- func (m *MsgCallToEvmResponse) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgSendToEvm
- func (*MsgSendToEvm) Descriptor() ([]byte, []int)
- func (msg MsgSendToEvm) GetSignBytes() []byte
- func (msg MsgSendToEvm) GetSigners() []sdk.AccAddress
- func (m *MsgSendToEvm) Marshal() (dAtA []byte, err error)
- func (m *MsgSendToEvm) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgSendToEvm) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgSendToEvm) ProtoMessage()
- func (m *MsgSendToEvm) Reset()
- func (msg MsgSendToEvm) Route() string
- func (m *MsgSendToEvm) Size() (n int)
- func (m *MsgSendToEvm) String() string
- func (msg MsgSendToEvm) Type() string
- func (m *MsgSendToEvm) Unmarshal(dAtA []byte) error
- func (msg MsgSendToEvm) ValidateBasic() error
- func (m *MsgSendToEvm) XXX_DiscardUnknown()
- func (m *MsgSendToEvm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgSendToEvm) XXX_Merge(src proto.Message)
- func (m *MsgSendToEvm) XXX_Size() int
- func (m *MsgSendToEvm) XXX_Unmarshal(b []byte) error
- type MsgSendToEvmResponse
- func (*MsgSendToEvmResponse) Descriptor() ([]byte, []int)
- func (m *MsgSendToEvmResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgSendToEvmResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgSendToEvmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgSendToEvmResponse) ProtoMessage()
- func (m *MsgSendToEvmResponse) Reset()
- func (m *MsgSendToEvmResponse) Size() (n int)
- func (m *MsgSendToEvmResponse) String() string
- func (m *MsgSendToEvmResponse) Unmarshal(dAtA []byte) error
- func (m *MsgSendToEvmResponse) XXX_DiscardUnknown()
- func (m *MsgSendToEvmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgSendToEvmResponse) XXX_Merge(src proto.Message)
- func (m *MsgSendToEvmResponse) XXX_Size() int
- func (m *MsgSendToEvmResponse) XXX_Unmarshal(b []byte) error
- type MsgServer
- type UnimplementedMsgServer
Constants ¶
View Source
const ( // ModuleName is the name of the contract module ModuleName = "vmbridge" // StoreKey is the string store representation StoreKey = ModuleName // TStoreKey is the string transient store representation TStoreKey = "transient_" + ModuleName // QuerierRoute is the querier route for the wasm module QuerierRoute = ModuleName // RouterKey is the msg router key for the wasm module RouterKey = ModuleName )
View Source
const ( PrecompileCallToWasm = "callToWasm" PrecompileQueryToWasm = "queryToWasm" )
View Source
const ( SendToWasmEventName = "__OKCSendToWasm" WasmCalledMethodName = "mintCW20" SendToEvmSubMsgName = "send-to-evm" EvmCalledMethodName = "mintERC20" CallToWasmEventName = "__OKCCallToWasm" WasmEvent2EvmMsgName = "call-to-wasm" )
Variables ¶
View Source
var ( // ErrChainConfigNotFound returns an error if the chain config cannot be found on the store. ErrChainConfigNotFound = sdkerrors.Register(ModuleName, 1, "chain configuration not found") ErrCallerOfEvmEmpty = sdkerrors.Register(ModuleName, 2, "the caller of evm can not be nil") ErrCannotCreate = sdkerrors.Register(ModuleName, 3, "create is not supprot for vmbridge") ErrIsNotWasmAddr = sdkerrors.Register(ModuleName, 4, "call wasm contract must use wasmaddress") ErrIsNotEvmAddr = sdkerrors.Register(ModuleName, 5, "call evm contract must use evmaddress") ErrAmountNegative = sdkerrors.Register(ModuleName, 6, "the amount can not negative") ErrEvmExecuteFailed = sdkerrors.Register(ModuleName, 7, "the evm execute") ErrVMBridgeEnable = sdkerrors.Register(ModuleName, 8, "the vmbridge is disable") ErrIsNotOKCAddr = sdkerrors.Register(ModuleName, 9, "the address prefix must be ex") ErrIsNotETHAddr = sdkerrors.Register(ModuleName, 10, "the address prefix must be 0x") )
View Source
var ( // SendToWasmEvent represent the signature of // `event __SendToWasm(string wasmAddr,string recipient, string amount)` SendToWasmEvent abi.Event // CallToWasmEvent represent the signature of // `event __OKCCallToWasm(string wasmAddr,uint256 value, string calldata)` CallToWasmEvent abi.Event EvmABI abi.ABI )
View Source
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
View Source
var (
PreCompileABI evm_types.ABI
)
Functions ¶
func DecodePrecompileCallToWasmInput ¶ added in v1.7.4
func DecodePrecompileQueryToWasmInput ¶ added in v1.7.4
func EncodePrecompileCallToWasmOutput ¶ added in v1.7.4
func EncodePrecompileQueryToWasmOutput ¶ added in v1.7.4
func ErrMsgSendToEvm ¶
func ErrMsgSendToEvm(str string) sdk.EnvelopedErr
func GetMethodByIdFromCallData ¶ added in v1.7.4
func GetMintCW20Input ¶
func GetMintERC20Input ¶
func GetMintERC20Output ¶
func GetPreCompileABI ¶ added in v1.7.4
func GetWasmVMQueryRequest ¶ added in v1.7.4
func GetWasmVMQueryRequest(requestData []byte) (*wasmvmtypes.QueryRequest, error)
func RegisterInterface ¶
func RegisterInterface(registry interfacetypes.InterfaceRegistry)
func RegisterMsgServer ¶
Types ¶
type MintCW20Method ¶
type MsgCallToEvm ¶ added in v1.7.0
type MsgCallToEvm struct { // Sender is the that actor that signed the messages Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender"` Evmaddr string `protobuf:"bytes,2,opt,name=evmaddr,proto3" json:"evmaddr"` Calldata string `protobuf:"bytes,3,opt,name=calldata,proto3" json:"calldata"` Value sdk.Int `protobuf:"bytes,4,opt,name=value,proto3,customtype=Int" json:"value"` }
MsgStoreCode submit Wasm code to the system
func (*MsgCallToEvm) Descriptor ¶ added in v1.7.0
func (*MsgCallToEvm) Descriptor() ([]byte, []int)
func (MsgCallToEvm) GetSignBytes ¶ added in v1.7.0
func (msg MsgCallToEvm) GetSignBytes() []byte
func (MsgCallToEvm) GetSigners ¶ added in v1.7.0
func (msg MsgCallToEvm) GetSigners() []sdk.AccAddress
func (*MsgCallToEvm) Marshal ¶ added in v1.7.0
func (m *MsgCallToEvm) Marshal() (dAtA []byte, err error)
func (*MsgCallToEvm) MarshalTo ¶ added in v1.7.0
func (m *MsgCallToEvm) MarshalTo(dAtA []byte) (int, error)
func (*MsgCallToEvm) MarshalToSizedBuffer ¶ added in v1.7.0
func (m *MsgCallToEvm) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCallToEvm) ProtoMessage ¶ added in v1.7.0
func (*MsgCallToEvm) ProtoMessage()
func (*MsgCallToEvm) Reset ¶ added in v1.7.0
func (m *MsgCallToEvm) Reset()
func (MsgCallToEvm) Route ¶ added in v1.7.0
func (msg MsgCallToEvm) Route() string
func (*MsgCallToEvm) Size ¶ added in v1.7.0
func (m *MsgCallToEvm) Size() (n int)
func (*MsgCallToEvm) String ¶ added in v1.7.0
func (m *MsgCallToEvm) String() string
func (MsgCallToEvm) Type ¶ added in v1.7.0
func (msg MsgCallToEvm) Type() string
func (*MsgCallToEvm) Unmarshal ¶ added in v1.7.0
func (m *MsgCallToEvm) Unmarshal(dAtA []byte) error
func (MsgCallToEvm) ValidateBasic ¶ added in v1.7.0
func (msg MsgCallToEvm) ValidateBasic() error
func (*MsgCallToEvm) XXX_DiscardUnknown ¶ added in v1.7.0
func (m *MsgCallToEvm) XXX_DiscardUnknown()
func (*MsgCallToEvm) XXX_Marshal ¶ added in v1.7.0
func (m *MsgCallToEvm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCallToEvm) XXX_Merge ¶ added in v1.7.0
func (m *MsgCallToEvm) XXX_Merge(src proto.Message)
func (*MsgCallToEvm) XXX_Size ¶ added in v1.7.0
func (m *MsgCallToEvm) XXX_Size() int
func (*MsgCallToEvm) XXX_Unmarshal ¶ added in v1.7.0
func (m *MsgCallToEvm) XXX_Unmarshal(b []byte) error
type MsgCallToEvmResponse ¶ added in v1.7.0
type MsgCallToEvmResponse struct { // CodeID is the reference to the stored WASM code Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response"` }
MsgStoreCodeResponse returns store result data.
func (*MsgCallToEvmResponse) Descriptor ¶ added in v1.7.0
func (*MsgCallToEvmResponse) Descriptor() ([]byte, []int)
func (*MsgCallToEvmResponse) Marshal ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) Marshal() (dAtA []byte, err error)
func (*MsgCallToEvmResponse) MarshalTo ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgCallToEvmResponse) MarshalToSizedBuffer ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCallToEvmResponse) ProtoMessage ¶ added in v1.7.0
func (*MsgCallToEvmResponse) ProtoMessage()
func (*MsgCallToEvmResponse) Reset ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) Reset()
func (*MsgCallToEvmResponse) Size ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) Size() (n int)
func (*MsgCallToEvmResponse) String ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) String() string
func (*MsgCallToEvmResponse) Unmarshal ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) Unmarshal(dAtA []byte) error
func (*MsgCallToEvmResponse) XXX_DiscardUnknown ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) XXX_DiscardUnknown()
func (*MsgCallToEvmResponse) XXX_Marshal ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCallToEvmResponse) XXX_Merge ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) XXX_Merge(src proto.Message)
func (*MsgCallToEvmResponse) XXX_Size ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) XXX_Size() int
func (*MsgCallToEvmResponse) XXX_Unmarshal ¶ added in v1.7.0
func (m *MsgCallToEvmResponse) XXX_Unmarshal(b []byte) error
type MsgClient ¶
type MsgClient interface { // SendToEvmEvent to exchange cw20 to erc20 SendToEvmEvent(ctx context.Context, in *MsgSendToEvm, opts ...grpc.CallOption) (*MsgSendToEvmResponse, error) // CallToEvmEvent to call to evm contract CallToEvmEvent(ctx context.Context, in *MsgCallToEvm, opts ...grpc.CallOption) (*MsgCallToEvmResponse, error) }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgSendToEvm ¶
type MsgSendToEvm struct { // Sender is the that actor that signed the messages Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender"` Contract string `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract"` Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient"` Amount sdk.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=Int" json:"amount"` }
MsgStoreCode submit Wasm code to the system
func (*MsgSendToEvm) Descriptor ¶
func (*MsgSendToEvm) Descriptor() ([]byte, []int)
func (MsgSendToEvm) GetSignBytes ¶
func (msg MsgSendToEvm) GetSignBytes() []byte
func (MsgSendToEvm) GetSigners ¶
func (msg MsgSendToEvm) GetSigners() []sdk.AccAddress
func (*MsgSendToEvm) Marshal ¶
func (m *MsgSendToEvm) Marshal() (dAtA []byte, err error)
func (*MsgSendToEvm) MarshalToSizedBuffer ¶
func (m *MsgSendToEvm) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgSendToEvm) ProtoMessage ¶
func (*MsgSendToEvm) ProtoMessage()
func (*MsgSendToEvm) Reset ¶
func (m *MsgSendToEvm) Reset()
func (MsgSendToEvm) Route ¶
func (msg MsgSendToEvm) Route() string
func (*MsgSendToEvm) Size ¶
func (m *MsgSendToEvm) Size() (n int)
func (*MsgSendToEvm) String ¶
func (m *MsgSendToEvm) String() string
func (MsgSendToEvm) Type ¶
func (msg MsgSendToEvm) Type() string
func (*MsgSendToEvm) Unmarshal ¶
func (m *MsgSendToEvm) Unmarshal(dAtA []byte) error
func (MsgSendToEvm) ValidateBasic ¶
func (msg MsgSendToEvm) ValidateBasic() error
func (*MsgSendToEvm) XXX_DiscardUnknown ¶
func (m *MsgSendToEvm) XXX_DiscardUnknown()
func (*MsgSendToEvm) XXX_Marshal ¶
func (m *MsgSendToEvm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgSendToEvm) XXX_Merge ¶
func (m *MsgSendToEvm) XXX_Merge(src proto.Message)
func (*MsgSendToEvm) XXX_Size ¶
func (m *MsgSendToEvm) XXX_Size() int
func (*MsgSendToEvm) XXX_Unmarshal ¶
func (m *MsgSendToEvm) XXX_Unmarshal(b []byte) error
type MsgSendToEvmResponse ¶
type MsgSendToEvmResponse struct { // CodeID is the reference to the stored WASM code Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` }
MsgStoreCodeResponse returns store result data.
func (*MsgSendToEvmResponse) Descriptor ¶
func (*MsgSendToEvmResponse) Descriptor() ([]byte, []int)
func (*MsgSendToEvmResponse) Marshal ¶
func (m *MsgSendToEvmResponse) Marshal() (dAtA []byte, err error)
func (*MsgSendToEvmResponse) MarshalTo ¶
func (m *MsgSendToEvmResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgSendToEvmResponse) MarshalToSizedBuffer ¶
func (m *MsgSendToEvmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgSendToEvmResponse) ProtoMessage ¶
func (*MsgSendToEvmResponse) ProtoMessage()
func (*MsgSendToEvmResponse) Reset ¶
func (m *MsgSendToEvmResponse) Reset()
func (*MsgSendToEvmResponse) Size ¶
func (m *MsgSendToEvmResponse) Size() (n int)
func (*MsgSendToEvmResponse) String ¶
func (m *MsgSendToEvmResponse) String() string
func (*MsgSendToEvmResponse) Unmarshal ¶
func (m *MsgSendToEvmResponse) Unmarshal(dAtA []byte) error
func (*MsgSendToEvmResponse) XXX_DiscardUnknown ¶
func (m *MsgSendToEvmResponse) XXX_DiscardUnknown()
func (*MsgSendToEvmResponse) XXX_Marshal ¶
func (m *MsgSendToEvmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgSendToEvmResponse) XXX_Merge ¶
func (m *MsgSendToEvmResponse) XXX_Merge(src proto.Message)
func (*MsgSendToEvmResponse) XXX_Size ¶
func (m *MsgSendToEvmResponse) XXX_Size() int
func (*MsgSendToEvmResponse) XXX_Unmarshal ¶
func (m *MsgSendToEvmResponse) XXX_Unmarshal(b []byte) error
type MsgServer ¶
type MsgServer interface { // SendToEvmEvent to exchange cw20 to erc20 SendToEvmEvent(context.Context, *MsgSendToEvm) (*MsgSendToEvmResponse, error) // CallToEvmEvent to call to evm contract CallToEvmEvent(context.Context, *MsgCallToEvm) (*MsgCallToEvmResponse, error) }
MsgServer is the server API for Msg service.
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) CallToEvmEvent ¶ added in v1.7.0
func (*UnimplementedMsgServer) CallToEvmEvent(ctx context.Context, req *MsgCallToEvm) (*MsgCallToEvmResponse, error)
func (*UnimplementedMsgServer) SendToEvmEvent ¶
func (*UnimplementedMsgServer) SendToEvmEvent(ctx context.Context, req *MsgSendToEvm) (*MsgSendToEvmResponse, error)
Click to show internal directories.
Click to hide internal directories.