From c725b57131da561605b26247ee956fb7b63c74d1 Mon Sep 17 00:00:00 2001 From: codchen Date: Fri, 17 May 2024 23:11:29 +0800 Subject: [PATCH] Add message type to associate CW contract address (#1681) * Add message type to associate CW contract address * fix test * bump sei-wasmd to fix ignite --------- Co-authored-by: Philip Su --- app/app.go | 2 +- contracts/test/CW20toERC20PointerTest.js | 3 +- contracts/test/lib.js | 7 + go.mod | 2 +- go.sum | 4 +- proto/evm/tx.proto | 8 + x/evm/client/cli/native_tx.go | 29 ++ x/evm/client/cli/tx.go | 1 + x/evm/handler.go | 3 + x/evm/keeper/address.go | 7 - x/evm/keeper/address_test.go | 10 - x/evm/keeper/keeper.go | 4 +- x/evm/keeper/msg_server.go | 20 + x/evm/keeper/msg_server_test.go | 37 ++ x/evm/types/codec.go | 1 + .../message_associate_contract_address.go | 49 ++ x/evm/types/message_register_pointer.go | 2 +- x/evm/types/tx.pb.go | 475 ++++++++++++++++-- 18 files changed, 592 insertions(+), 72 deletions(-) create mode 100644 x/evm/types/message_associate_contract_address.go diff --git a/app/app.go b/app/app.go index 0f99001b3..dc635a318 100644 --- a/app/app.go +++ b/app/app.go @@ -590,7 +590,7 @@ func New( app.EvmKeeper = *evmkeeper.NewKeeper(keys[evmtypes.StoreKey], memKeys[evmtypes.MemStoreKey], app.GetSubspace(evmtypes.ModuleName), app.BankKeeper, &app.AccountKeeper, &app.StakingKeeper, - app.TransferKeeper, wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper)) + app.TransferKeeper, wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper), &app.WasmKeeper) app.evmRPCConfig, err = evmrpc.ReadConfig(appOpts) if err != nil { panic(fmt.Sprintf("error reading EVM config due to %s", err)) diff --git a/contracts/test/CW20toERC20PointerTest.js b/contracts/test/CW20toERC20PointerTest.js index 123c5b674..19dac07a2 100644 --- a/contracts/test/CW20toERC20PointerTest.js +++ b/contracts/test/CW20toERC20PointerTest.js @@ -1,4 +1,4 @@ -const {getAdmin, queryWasm, executeWasm, deployEvmContract, setupSigners, deployErc20PointerForCw20, deployWasm, WASM, +const {getAdmin, queryWasm, executeWasm, associateWasm, deployEvmContract, setupSigners, deployErc20PointerForCw20, deployWasm, WASM, registerPointerForCw20 } = require("./lib") const { expect } = require("chai"); @@ -102,6 +102,7 @@ describe("CW20 to ERC20 Pointer", function () { }); it("transfer to contract address should succeed", async function() { + await associateWasm(cw20Pointer); const respBefore = await queryWasm(cw20Pointer, "balance", {address: admin.seiAddress}) const balanceBefore = respBefore.data.balance; diff --git a/contracts/test/lib.js b/contracts/test/lib.js index 2b078817e..312481180 100644 --- a/contracts/test/lib.js +++ b/contracts/test/lib.js @@ -349,6 +349,12 @@ async function executeWasm(contractAddress, msg, coins = "0usei") { return JSON.parse(output); } +async function associateWasm(contractAddress) { + const command = `seid tx evm associate-contract-address ${contractAddress} --from ${adminKeyName} --gas=5000000 --fees=1000000usei -y --broadcast-mode block -o json`; + const output = await execute(command); + return JSON.parse(output); +} + async function isDocker() { return new Promise((resolve, reject) => { exec("docker ps --filter 'name=sei-node-0' --format '{{.Names}}'", (error, stdout, stderr) => { @@ -427,6 +433,7 @@ module.exports = { isDocker, testAPIEnabled, incrementPointerVersion, + associateWasm, WASM, ABI, }; diff --git a/go.mod b/go.mod index ee08f9ab5..34a45f600 100644 --- a/go.mod +++ b/go.mod @@ -344,7 +344,7 @@ require ( ) replace ( - github.com/CosmWasm/wasmd => github.com/sei-protocol/sei-wasmd v0.1.4 + github.com/CosmWasm/wasmd => github.com/sei-protocol/sei-wasmd v0.1.5 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.13 github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.1.9 diff --git a/go.sum b/go.sum index ceb870bc5..681eda8d4 100644 --- a/go.sum +++ b/go.sum @@ -1359,8 +1359,8 @@ github.com/sei-protocol/sei-tendermint v0.3.3 h1:zH6xxrSRwHERaj/AcCR76U9daVY3Ub8 github.com/sei-protocol/sei-tendermint v0.3.3/go.mod h1:4LSlJdhl3nf3OmohliwRNUFLOB1XWlrmSodrIP7fLh4= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= -github.com/sei-protocol/sei-wasmd v0.1.4 h1:StDThZwOJvLebeK1zTot8pByPd4kdM3AsBaKxLpDQPQ= -github.com/sei-protocol/sei-wasmd v0.1.4/go.mod h1:tv+4SYNzpryEPU1dV44+JFB5dIqpDAEx32RngGFgDeI= +github.com/sei-protocol/sei-wasmd v0.1.5 h1:+yO7mihwVTG34DGr/bF1bRwszUfDeN1EnMBZEY67l3k= +github.com/sei-protocol/sei-wasmd v0.1.5/go.mod h1:vd2qO4GOslLnmlsoAk+zE4D8/OQC1AkTqDY8QBOV09U= github.com/sei-protocol/tm-db v0.0.4 h1:7Y4EU62Xzzg6wKAHEotm7SXQR0aPLcGhKHkh3qd0tnk= github.com/sei-protocol/tm-db v0.0.4/go.mod h1:PWsIWOTwdwC7Ow/GUvx8HgUJTO691pBuorIQD8JvwAs= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= diff --git a/proto/evm/tx.proto b/proto/evm/tx.proto index 03eaa8ce9..8b00a6690 100644 --- a/proto/evm/tx.proto +++ b/proto/evm/tx.proto @@ -12,6 +12,7 @@ service Msg { rpc EVMTransaction(MsgEVMTransaction) returns (MsgEVMTransactionResponse); rpc Send(MsgSend) returns (MsgSendResponse); rpc RegisterPointer(MsgRegisterPointer) returns (MsgRegisterPointerResponse); + rpc AssociateContractAddress(MsgAssociateContractAddress) returns (MsgAssociateContractAddressResponse); } message MsgEVMTransaction { @@ -65,3 +66,10 @@ message MsgRegisterPointer { message MsgRegisterPointerResponse { string pointer_address = 1; } + +message MsgAssociateContractAddress { + string sender = 1; + string address = 2; +} + +message MsgAssociateContractAddressResponse {} \ No newline at end of file diff --git a/x/evm/client/cli/native_tx.go b/x/evm/client/cli/native_tx.go index e37b2dc40..b08518455 100644 --- a/x/evm/client/cli/native_tx.go +++ b/x/evm/client/cli/native_tx.go @@ -148,3 +148,32 @@ func RegisterEvmPointerCmd() *cobra.Command { return cmd } + +func AssociateContractAddressCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "associate-contract-address [cw-address]", + Short: `Set address association for a CosmWasm contract.`, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + addr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + msg := types.NewMsgAssociateContractAddress(clientCtx.GetFromAddress(), addr) + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/evm/client/cli/tx.go b/x/evm/client/cli/tx.go index 42e4f7ffa..fd48a96f4 100644 --- a/x/evm/client/cli/tx.go +++ b/x/evm/client/cli/tx.go @@ -68,6 +68,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(NewAddERCNativePointerProposalTxCmd()) cmd.AddCommand(NewAddERCCW20PointerProposalTxCmd()) cmd.AddCommand(NewAddERCCW721PointerProposalTxCmd()) + cmd.AddCommand(AssociateContractAddressCmd()) return cmd } diff --git a/x/evm/handler.go b/x/evm/handler.go index 9cff2a1d2..03e4eaca8 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -27,6 +27,9 @@ func NewHandler(k *keeper.Keeper) sdk.Handler { case *types.MsgRegisterPointer: res, err := msgServer.RegisterPointer(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgAssociateContractAddress: + res, err := msgServer.AssociateContractAddress(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) diff --git a/x/evm/keeper/address.go b/x/evm/keeper/address.go index 5b67c9102..ac043e33c 100644 --- a/x/evm/keeper/address.go +++ b/x/evm/keeper/address.go @@ -1,7 +1,6 @@ package keeper import ( - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" @@ -29,12 +28,6 @@ func (k *Keeper) DeleteAddressMapping(ctx sdk.Context, seiAddress sdk.AccAddress } func (k *Keeper) GetEVMAddress(ctx sdk.Context, seiAddress sdk.AccAddress) (common.Address, bool) { - // CW address has a different length and should always be considered associated - // Note that this association is one-way since CW address is longer than EOA address - // and would need to be cropped. - if len(seiAddress) == wasmtypes.ContractAddrLen { - return common.BytesToAddress(seiAddress), true - } store := ctx.KVStore(k.storeKey) bz := store.Get(types.SeiAddressToEVMAddressKey(seiAddress)) addr := common.Address{} diff --git a/x/evm/keeper/address_test.go b/x/evm/keeper/address_test.go index 9e9142549..825dfb565 100644 --- a/x/evm/keeper/address_test.go +++ b/x/evm/keeper/address_test.go @@ -4,8 +4,6 @@ import ( "bytes" "testing" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - "github.com/ethereum/go-ethereum/common" "github.com/sei-protocol/sei-chain/testutil/keeper" "github.com/stretchr/testify/require" ) @@ -52,11 +50,3 @@ func TestGetAddressOrDefault(t *testing.T) { defaultSeiAddr := k.GetSeiAddressOrDefault(ctx, evmAddr) require.True(t, bytes.Equal(defaultSeiAddr, evmAddr[:])) } - -func TestGetEVMAddressForCW(t *testing.T) { - k, ctx := keeper.MockEVMKeeper() - cwAddr := wasmkeeper.BuildContractAddress(123, 456) - cwEvmAddr, associated := k.GetEVMAddress(ctx, cwAddr) - require.True(t, associated) - require.Equal(t, common.BytesToAddress(cwAddr), cwEvmAddr) -} diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index b019f9c09..6a03b6083 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -52,6 +52,7 @@ type Keeper struct { stakingKeeper *stakingkeeper.Keeper transferKeeper ibctransferkeeper.Keeper wasmKeeper *wasmkeeper.PermissionedKeeper + wasmViewKeeper *wasmkeeper.Keeper cachedFeeCollectorAddressMtx *sync.RWMutex cachedFeeCollectorAddress *common.Address @@ -115,7 +116,7 @@ func (ctx *ReplayChainContext) GetHeader(hash common.Hash, number uint64) *ethty func NewKeeper( storeKey sdk.StoreKey, memStoreKey sdk.StoreKey, paramstore paramtypes.Subspace, bankKeeper bankkeeper.Keeper, accountKeeper *authkeeper.AccountKeeper, stakingKeeper *stakingkeeper.Keeper, - transferKeeper ibctransferkeeper.Keeper, wasmKeeper *wasmkeeper.PermissionedKeeper) *Keeper { + transferKeeper ibctransferkeeper.Keeper, wasmKeeper *wasmkeeper.PermissionedKeeper, wasmViewKeeper *wasmkeeper.Keeper) *Keeper { if !paramstore.HasKeyTable() { paramstore = paramstore.WithKeyTable(types.ParamKeyTable()) } @@ -128,6 +129,7 @@ func NewKeeper( stakingKeeper: stakingKeeper, transferKeeper: transferKeeper, wasmKeeper: wasmKeeper, + wasmViewKeeper: wasmViewKeeper, pendingTxs: make(map[string][]*PendingTx), nonceMx: &sync.RWMutex{}, cachedFeeCollectorAddressMtx: &sync.RWMutex{}, diff --git a/x/evm/keeper/msg_server.go b/x/evm/keeper/msg_server.go index 234018cb3..9ccb8779a 100644 --- a/x/evm/keeper/msg_server.go +++ b/x/evm/keeper/msg_server.go @@ -3,6 +3,7 @@ package keeper import ( "context" "encoding/json" + "errors" "fmt" "math" "math/big" @@ -323,3 +324,22 @@ func (server msgServer) RegisterPointer(goCtx context.Context, msg *types.MsgReg } return &types.MsgRegisterPointerResponse{PointerAddress: pointerAddr.String()}, err } + +func (server msgServer) AssociateContractAddress(goCtx context.Context, msg *types.MsgAssociateContractAddress) (*types.MsgAssociateContractAddressResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + addr := sdk.MustAccAddressFromBech32(msg.Address) // already validated + // check if address is for a contract + if server.wasmViewKeeper.GetContractInfo(ctx, addr) == nil { + return nil, errors.New("no wasm contract found at the given address") + } + evmAddr := common.BytesToAddress(addr) + existingEvmAddr, ok := server.GetEVMAddress(ctx, addr) + if ok { + if existingEvmAddr.Cmp(evmAddr) != 0 { + ctx.Logger().Error(fmt.Sprintf("unexpected associated EVM address %s exists for contract %s: expecting %s", existingEvmAddr.Hex(), addr.String(), evmAddr.Hex())) + } + return nil, errors.New("contract already has an associated address") + } + server.SetAddressMapping(ctx, addr, evmAddr) + return &types.MsgAssociateContractAddressResponse{}, nil +} diff --git a/x/evm/keeper/msg_server_test.go b/x/evm/keeper/msg_server_test.go index e6609e9a7..3ca811cfb 100644 --- a/x/evm/keeper/msg_server_test.go +++ b/x/evm/keeper/msg_server_test.go @@ -671,3 +671,40 @@ func TestEvmError(t *testing.T) { require.Nil(t, err) require.Equal(t, receipt.VmError, res.EvmTxInfo.VmError) } + +func TestAssociateContractAddress(t *testing.T) { + k, ctx := testkeeper.MockEVMKeeper() + msgServer := keeper.NewMsgServerImpl(k) + dummySeiAddr, dummyEvmAddr := testkeeper.MockAddressPair() + res, err := msgServer.RegisterPointer(sdk.WrapSDKContext(ctx), &types.MsgRegisterPointer{ + Sender: dummySeiAddr.String(), + PointerType: types.PointerType_ERC20, + ErcAddress: dummyEvmAddr.Hex(), + }) + require.Nil(t, err) + _, err = msgServer.AssociateContractAddress(sdk.WrapSDKContext(ctx), &types.MsgAssociateContractAddress{ + Sender: dummySeiAddr.String(), + Address: res.PointerAddress, + }) + require.Nil(t, err) + associatedEvmAddr, found := k.GetEVMAddress(ctx, sdk.MustAccAddressFromBech32(res.PointerAddress)) + require.True(t, found) + require.Equal(t, common.BytesToAddress(sdk.MustAccAddressFromBech32(res.PointerAddress)), associatedEvmAddr) + associatedSeiAddr, found := k.GetSeiAddress(ctx, associatedEvmAddr) + require.True(t, found) + require.Equal(t, res.PointerAddress, associatedSeiAddr.String()) + // setting for an associated address would fail + _, err = msgServer.AssociateContractAddress(sdk.WrapSDKContext(ctx), &types.MsgAssociateContractAddress{ + Sender: dummySeiAddr.String(), + Address: res.PointerAddress, + }) + require.NotNil(t, err) + require.Contains(t, err.Error(), "contract already has an associated address") + // setting for a non-contract would fail + _, err = msgServer.AssociateContractAddress(sdk.WrapSDKContext(ctx), &types.MsgAssociateContractAddress{ + Sender: dummySeiAddr.String(), + Address: dummySeiAddr.String(), + }) + require.NotNil(t, err) + require.Contains(t, err.Error(), "no wasm contract found at the given address") +} diff --git a/x/evm/types/codec.go b/x/evm/types/codec.go index c5f6a2815..bba5d881e 100644 --- a/x/evm/types/codec.go +++ b/x/evm/types/codec.go @@ -42,6 +42,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgEVMTransaction{}, &MsgSend{}, &MsgRegisterPointer{}, + &MsgAssociateContractAddress{}, ) registry.RegisterInterface( "seiprotocol.seichain.evm.TxData", diff --git a/x/evm/types/message_associate_contract_address.go b/x/evm/types/message_associate_contract_address.go new file mode 100644 index 000000000..9f560964c --- /dev/null +++ b/x/evm/types/message_associate_contract_address.go @@ -0,0 +1,49 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgAssociateContractAddress = "evm_associate_contract_address" + +var ( + _ sdk.Msg = &MsgAssociateContractAddress{} +) + +func NewMsgAssociateContractAddress(sender sdk.AccAddress, addr sdk.AccAddress) *MsgAssociateContractAddress { + return &MsgAssociateContractAddress{Sender: sender.String(), Address: addr.String()} +} + +func (msg *MsgAssociateContractAddress) Route() string { + return RouterKey +} + +func (msg *MsgAssociateContractAddress) Type() string { + return TypeMsgAssociateContractAddress +} + +func (msg *MsgAssociateContractAddress) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgAssociateContractAddress) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +func (msg *MsgAssociateContractAddress) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + } + + if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { + return sdkerrors.ErrInvalidAddress + } + + return nil +} diff --git a/x/evm/types/message_register_pointer.go b/x/evm/types/message_register_pointer.go index 1f2c124c4..831f1a0ae 100644 --- a/x/evm/types/message_register_pointer.go +++ b/x/evm/types/message_register_pointer.go @@ -9,7 +9,7 @@ import ( const TypeMsgRegisterPointer = "evm_register_pointer" var ( - _ sdk.Msg = &MsgSend{} + _ sdk.Msg = &MsgRegisterPointer{} ) func NewMsgRegisterERC20Pointer(sender sdk.AccAddress, ercAddress common.Address) *MsgRegisterPointer { diff --git a/x/evm/types/tx.pb.go b/x/evm/types/tx.pb.go index d9989aee0..fedbdcfee 100644 --- a/x/evm/types/tx.pb.go +++ b/x/evm/types/tx.pb.go @@ -554,6 +554,94 @@ func (m *MsgRegisterPointerResponse) GetPointerAddress() string { return "" } +type MsgAssociateContractAddress struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgAssociateContractAddress) Reset() { *m = MsgAssociateContractAddress{} } +func (m *MsgAssociateContractAddress) String() string { return proto.CompactTextString(m) } +func (*MsgAssociateContractAddress) ProtoMessage() {} +func (*MsgAssociateContractAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_d72e73a3d1d93781, []int{10} +} +func (m *MsgAssociateContractAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAssociateContractAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAssociateContractAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAssociateContractAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAssociateContractAddress.Merge(m, src) +} +func (m *MsgAssociateContractAddress) XXX_Size() int { + return m.Size() +} +func (m *MsgAssociateContractAddress) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAssociateContractAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAssociateContractAddress proto.InternalMessageInfo + +func (m *MsgAssociateContractAddress) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgAssociateContractAddress) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgAssociateContractAddressResponse struct { +} + +func (m *MsgAssociateContractAddressResponse) Reset() { *m = MsgAssociateContractAddressResponse{} } +func (m *MsgAssociateContractAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAssociateContractAddressResponse) ProtoMessage() {} +func (*MsgAssociateContractAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d72e73a3d1d93781, []int{11} +} +func (m *MsgAssociateContractAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAssociateContractAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAssociateContractAddressResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAssociateContractAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAssociateContractAddressResponse.Merge(m, src) +} +func (m *MsgAssociateContractAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAssociateContractAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAssociateContractAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAssociateContractAddressResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgEVMTransaction)(nil), "seiprotocol.seichain.evm.MsgEVMTransaction") proto.RegisterType((*MsgEVMTransactionResponse)(nil), "seiprotocol.seichain.evm.MsgEVMTransactionResponse") @@ -565,59 +653,64 @@ func init() { proto.RegisterType((*MsgSendResponse)(nil), "seiprotocol.seichain.evm.MsgSendResponse") proto.RegisterType((*MsgRegisterPointer)(nil), "seiprotocol.seichain.evm.MsgRegisterPointer") proto.RegisterType((*MsgRegisterPointerResponse)(nil), "seiprotocol.seichain.evm.MsgRegisterPointerResponse") + proto.RegisterType((*MsgAssociateContractAddress)(nil), "seiprotocol.seichain.evm.MsgAssociateContractAddress") + proto.RegisterType((*MsgAssociateContractAddressResponse)(nil), "seiprotocol.seichain.evm.MsgAssociateContractAddressResponse") } func init() { proto.RegisterFile("evm/tx.proto", fileDescriptor_d72e73a3d1d93781) } var fileDescriptor_d72e73a3d1d93781 = []byte{ - // 744 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcd, 0x4e, 0xdb, 0x48, - 0x1c, 0xc0, 0xe3, 0x24, 0x10, 0x32, 0x89, 0x12, 0x61, 0xa1, 0x55, 0x12, 0xed, 0x26, 0xac, 0xb5, - 0x1f, 0xd9, 0x0f, 0xec, 0x25, 0xac, 0xb4, 0x87, 0xbd, 0x2c, 0x81, 0x68, 0xe1, 0x10, 0x69, 0xe5, - 0x05, 0x0e, 0xbd, 0x44, 0x13, 0xfb, 0x8f, 0x63, 0x35, 0x9e, 0x89, 0x66, 0xc6, 0x11, 0x79, 0x81, - 0x9e, 0xab, 0xaa, 0x52, 0xf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, 0xce, 0x99, 0x23, 0x49, 0x12, - 0x57, 0x7b, 0x5f, 0x7f, 0xdd, 0x79, 0x2c, 0xeb, 0x99, 0x81, 0xea, 0x77, 0xb0, 0x5c, 0xe0, 0x13, - 0x4a, 0x38, 0x98, 0x75, 0xb4, 0x16, 0x60, 0x3e, 0x88, 0x39, 0xf8, 0x0a, 0x31, 0xef, 0x16, 0x02, - 0xcc, 0x8f, 0x39, 0xf8, 0x52, 0x35, 0x8d, 0x06, 0xc0, 0x18, 0x65, 0x0a, 0xa8, 0xe8, 0x16, 0xa6, - 0x51, 0x4f, 0x5e, 0xcd, 0x16, 0x2a, 0x31, 0x10, 0x31, 0x23, 0x03, 0x55, 0x5b, 0x4e, 0xe2, 0xba, - 0x48, 0x8b, 0xf6, 0x65, 0x2d, 0x26, 0xca, 0x8f, 0x30, 0x1f, 0xd5, 0xf2, 0xca, 0x4f, 0x9d, 0xad, - 0x17, 0x06, 0x32, 0xfb, 0x3c, 0x38, 0x24, 0x02, 0x18, 0xc1, 0xe3, 0xde, 0x49, 0x7f, 0x0f, 0x8f, - 0xc7, 0xe6, 0x37, 0x68, 0x95, 0x03, 0xf1, 0x81, 0xa9, 0xfc, 0x45, 0x37, 0xb9, 0x99, 0xff, 0xa0, - 0x95, 0x29, 0x1e, 0xc7, 0xa0, 0x73, 0x77, 0x7f, 0xbd, 0xbc, 0x6a, 0xfd, 0xf4, 0x45, 0x33, 0x92, - 0xe9, 0xe8, 0xcf, 0x16, 0xf7, 0x9f, 0x3a, 0x62, 0x36, 0x01, 0x6e, 0x1f, 0x12, 0xe1, 0x6a, 0x47, - 0xb3, 0x82, 0xb2, 0x82, 0x2a, 0xb8, 0xa2, 0x9b, 0x15, 0x54, 0x42, 0x29, 0xdc, 0xbc, 0xc2, 0x55, - 0x67, 0xeb, 0x5b, 0xd4, 0xb8, 0xcb, 0x34, 0xef, 0x8e, 0xf5, 0xda, 0x58, 0x54, 0xef, 0xc3, 0x18, - 0x02, 0x2c, 0xe0,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, 0x58, 0x3d, 0xb5, 0x1f, 0x0b, 0x60, - 0xe9, 0xe3, 0xfa, 0x19, 0x55, 0xe7, 0x20, 0xb7, 0x9b, 0x5e, 0x49, 0xc4, 0x49, 0x98, 0xce, 0xbb, - 0x2c, 0xca, 0xf5, 0x79, 0x60, 0x32, 0x54, 0x59, 0xf8, 0x7d, 0xfc, 0xb6, 0x9c, 0xfa, 0xce, 0xa3, - 0x6e, 0xec, 0x3c, 0xc2, 0x38, 0x85, 0x3c, 0x42, 0x79, 0xbd, 0x1e, 0xf7, 0x3a, 0x4b, 0x93, 0xc6, - 0x2f, 0x5f, 0x35, 0x49, 0xa3, 0xc6, 0xa8, 0xba, 0x38, 0xae, 0xdf, 0xef, 0xf5, 0x5e, 0xb0, 0x6e, - 0xfc, 0xf9, 0x18, 0xeb, 0x79, 0xda, 0xee, 0xbf, 0xe7, 0xd7, 0x4d, 0xe3, 0xe2, 0xba, 0x69, 0x7c, - 0xbc, 0x6e, 0x1a, 0xcf, 0x6f, 0x9a, 0x99, 0x8b, 0x9b, 0x66, 0xe6, 0xfd, 0x4d, 0x33, 0xf3, 0x64, - 0xeb, 0xa1, 0x3f, 0x52, 0xb5, 0x93, 0xc3, 0x55, 0xa5, 0xdf, 0xf9, 0x14, 0x00, 0x00, 0xff, 0xff, - 0x51, 0x5e, 0xb8, 0x08, 0x5f, 0x06, 0x00, 0x00, + // 798 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xc0, 0xeb, 0x26, 0xdb, 0x6c, 0x5f, 0xaa, 0x46, 0x6b, 0xad, 0x90, 0x63, 0x20, 0x29, 0x86, + 0x85, 0xf0, 0xa7, 0x36, 0x9b, 0x05, 0x71, 0x40, 0x48, 0x34, 0x6d, 0xc4, 0xee, 0x21, 0x02, 0x99, + 0xee, 0x1e, 0xb8, 0x44, 0x13, 0xfb, 0xad, 0x63, 0x11, 0xcf, 0x44, 0x33, 0xe3, 0x68, 0xf3, 0x05, + 0x38, 0xaf, 0x10, 0x12, 0x7c, 0x06, 0x4e, 0x7c, 0x8c, 0x3d, 0xee, 0x11, 0xf6, 0x50, 0x50, 0xfb, + 0x45, 0xd0, 0xcc, 0xd8, 0x86, 0xa6, 0x4a, 0x68, 0x39, 0x79, 0xde, 0xdf, 0xf9, 0xbd, 0xf7, 0x66, + 0xc6, 0xb0, 0x87, 0x8b, 0x2c, 0x90, 0xcf, 0xfc, 0x39, 0x67, 0x92, 0xd9, 0x8e, 0xc0, 0x54, 0xaf, + 0x22, 0x36, 0xf3, 0x05, 0xa6, 0xd1, 0x94, 0xa4, 0xd4, 0xc7, 0x45, 0xe6, 0xb6, 0x13, 0xc6, 0x92, + 0x19, 0x06, 0xda, 0x3a, 0xc9, 0x9f, 0x06, 0x84, 0x2e, 0x4d, 0x90, 0x7b, 0x37, 0x61, 0x09, 0xd3, + 0xcb, 0x40, 0xad, 0x0a, 0x6d, 0x27, 0x62, 0x22, 0x63, 0x22, 0x98, 0x10, 0x81, 0xc1, 0xe2, 0xfe, + 0x04, 0x25, 0xb9, 0x1f, 0x44, 0x2c, 0xa5, 0x85, 0xbd, 0xa5, 0x36, 0x46, 0x9a, 0x67, 0xc2, 0x28, + 0xbc, 0x9f, 0x2c, 0xb8, 0x33, 0x12, 0xc9, 0xf0, 0xc9, 0xe8, 0x94, 0x13, 0x2a, 0x48, 0x24, 0x53, + 0x46, 0xed, 0x1e, 0xd4, 0x63, 0x22, 0x89, 0x63, 0x1d, 0x58, 0xbd, 0x66, 0xff, 0xae, 0x6f, 0x30, + 0xfc, 0x12, 0xc3, 0x3f, 0xa2, 0xcb, 0x50, 0x7b, 0xd8, 0x8f, 0xa1, 0x11, 0x23, 0x4f, 0x17, 0x18, + 0x3b, 0xdb, 0x07, 0x56, 0x6f, 0x6f, 0xf0, 0xf9, 0xab, 0xb3, 0xee, 0x67, 0x49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0xd1, 0xf6, 0x07, + 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x16, 0xf7, 0xdd, 0x7c, 0x6a, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -635,6 +728,7 @@ type MsgClient interface { EVMTransaction(ctx context.Context, in *MsgEVMTransaction, opts ...grpc.CallOption) (*MsgEVMTransactionResponse, error) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) RegisterPointer(ctx context.Context, in *MsgRegisterPointer, opts ...grpc.CallOption) (*MsgRegisterPointerResponse, error) + AssociateContractAddress(ctx context.Context, in *MsgAssociateContractAddress, opts ...grpc.CallOption) (*MsgAssociateContractAddressResponse, error) } type msgClient struct { @@ -672,11 +766,21 @@ func (c *msgClient) RegisterPointer(ctx context.Context, in *MsgRegisterPointer, return out, nil } +func (c *msgClient) AssociateContractAddress(ctx context.Context, in *MsgAssociateContractAddress, opts ...grpc.CallOption) (*MsgAssociateContractAddressResponse, error) { + out := new(MsgAssociateContractAddressResponse) + err := c.cc.Invoke(ctx, "/seiprotocol.seichain.evm.Msg/AssociateContractAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { EVMTransaction(context.Context, *MsgEVMTransaction) (*MsgEVMTransactionResponse, error) Send(context.Context, *MsgSend) (*MsgSendResponse, error) RegisterPointer(context.Context, *MsgRegisterPointer) (*MsgRegisterPointerResponse, error) + AssociateContractAddress(context.Context, *MsgAssociateContractAddress) (*MsgAssociateContractAddressResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -692,6 +796,9 @@ func (*UnimplementedMsgServer) Send(ctx context.Context, req *MsgSend) (*MsgSend func (*UnimplementedMsgServer) RegisterPointer(ctx context.Context, req *MsgRegisterPointer) (*MsgRegisterPointerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterPointer not implemented") } +func (*UnimplementedMsgServer) AssociateContractAddress(ctx context.Context, req *MsgAssociateContractAddress) (*MsgAssociateContractAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AssociateContractAddress not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -751,6 +858,24 @@ func _Msg_RegisterPointer_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_AssociateContractAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAssociateContractAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AssociateContractAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/seiprotocol.seichain.evm.Msg/AssociateContractAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AssociateContractAddress(ctx, req.(*MsgAssociateContractAddress)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "seiprotocol.seichain.evm.Msg", HandlerType: (*MsgServer)(nil), @@ -767,6 +892,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RegisterPointer", Handler: _Msg_RegisterPointer_Handler, }, + { + MethodName: "AssociateContractAddress", + Handler: _Msg_AssociateContractAddress_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "evm/tx.proto", @@ -1174,6 +1303,66 @@ func (m *MsgRegisterPointerResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgAssociateContractAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAssociateContractAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAssociateContractAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAssociateContractAddressResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAssociateContractAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAssociateContractAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1363,6 +1552,32 @@ func (m *MsgRegisterPointerResponse) Size() (n int) { return n } +func (m *MsgAssociateContractAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAssociateContractAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2568,6 +2783,170 @@ func (m *MsgRegisterPointerResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAssociateContractAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAssociateContractAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAssociateContractAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAssociateContractAddressResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAssociateContractAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAssociateContractAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0