diff --git a/changelog.md b/changelog.md index d00533e4c7..75320a7a2c 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,10 @@ ## Unreleased +### Features + +* [2578](https://github.com/zeta-chain/node/pull/2578) - Add Gateway address in protocol contract list + ## v19.0.0 ### Breaking Changes diff --git a/docs/cli/zetacored/zetacored_tx_fungible.md b/docs/cli/zetacored/zetacored_tx_fungible.md index 3a54cf4315..9e03fd6dd5 100644 --- a/docs/cli/zetacored/zetacored_tx_fungible.md +++ b/docs/cli/zetacored/zetacored_tx_fungible.md @@ -32,6 +32,7 @@ zetacored tx fungible [flags] * [zetacored tx fungible remove-foreign-coin](zetacored_tx_fungible_remove-foreign-coin.md) - Broadcast message RemoveForeignCoin * [zetacored tx fungible unpause-zrc20](zetacored_tx_fungible_unpause-zrc20.md) - Broadcast message UnpauseZRC20 * [zetacored tx fungible update-contract-bytecode](zetacored_tx_fungible_update-contract-bytecode.md) - Broadcast message UpdateContractBytecode +* [zetacored tx fungible update-gateway-contract](zetacored_tx_fungible_update-gateway-contract.md) - Broadcast message UpdateGatewayContract to update the gateway contract address * [zetacored tx fungible update-system-contract](zetacored_tx_fungible_update-system-contract.md) - Broadcast message UpdateSystemContract * [zetacored tx fungible update-zrc20-liquidity-cap](zetacored_tx_fungible_update-zrc20-liquidity-cap.md) - Broadcast message UpdateZRC20LiquidityCap * [zetacored tx fungible update-zrc20-withdraw-fee](zetacored_tx_fungible_update-zrc20-withdraw-fee.md) - Broadcast message UpdateZRC20WithdrawFee diff --git a/docs/cli/zetacored/zetacored_tx_fungible_update-gateway-contract.md b/docs/cli/zetacored/zetacored_tx_fungible_update-gateway-contract.md new file mode 100644 index 0000000000..d75877c440 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_fungible_update-gateway-contract.md @@ -0,0 +1,53 @@ +# tx fungible update-gateway-contract + +Broadcast message UpdateGatewayContract to update the gateway contract address + +``` +zetacored tx fungible update-gateway-contract [contract-address] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async) + --chain-id string The network chain ID + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-gateway-contract + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --log_no_color Disable colored logs + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx fungible](zetacored_tx_fungible.md) - fungible transactions subcommands + diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index 5315144edb..a91158997d 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -57653,6 +57653,8 @@ definitions: type: object fungibleMsgUpdateContractBytecodeResponse: type: object + fungibleMsgUpdateGatewayContractResponse: + type: object fungibleMsgUpdateSystemContractResponse: type: object fungibleMsgUpdateZRC20LiquidityCapResponse: @@ -57711,6 +57713,8 @@ definitions: type: string connector_zevm: type: string + gateway: + type: string googlerpcStatus: type: object properties: diff --git a/docs/spec/fungible/messages.md b/docs/spec/fungible/messages.md index ce845608e6..ce624844ea 100644 --- a/docs/spec/fungible/messages.md +++ b/docs/spec/fungible/messages.md @@ -140,3 +140,14 @@ message MsgUnpauseZRC20 { } ``` +## MsgUpdateGatewayContract + +UpdateGatewayContract updates the zevm gateway contract used by the ZetaChain protocol to read inbounds and process outbounds + +```proto +message MsgUpdateGatewayContract { + string creator = 1; + string new_gateway_contract_address = 2; +} +``` + diff --git a/proto/zetachain/zetacore/fungible/events.proto b/proto/zetachain/zetacore/fungible/events.proto index 41b78c635e..02a686aad8 100644 --- a/proto/zetachain/zetacore/fungible/events.proto +++ b/proto/zetachain/zetacore/fungible/events.proto @@ -67,3 +67,10 @@ message EventBytecodeUpdated { string old_bytecode_hash = 4; string signer = 5; } + +message EventGatewayContractUpdated { + string msg_type_url = 1; + string new_contract_address = 2; + string old_contract_address = 3; + string signer = 4; +} diff --git a/proto/zetachain/zetacore/fungible/system_contract.proto b/proto/zetachain/zetacore/fungible/system_contract.proto index 44d484700b..d9dca7f71a 100644 --- a/proto/zetachain/zetacore/fungible/system_contract.proto +++ b/proto/zetachain/zetacore/fungible/system_contract.proto @@ -8,4 +8,5 @@ option go_package = "github.com/zeta-chain/zetacore/x/fungible/types"; message SystemContract { string system_contract = 1; string connector_zevm = 2; + string gateway = 3; } diff --git a/proto/zetachain/zetacore/fungible/tx.proto b/proto/zetachain/zetacore/fungible/tx.proto index a73dcc2350..33ab8e7a7a 100644 --- a/proto/zetachain/zetacore/fungible/tx.proto +++ b/proto/zetachain/zetacore/fungible/tx.proto @@ -24,6 +24,8 @@ service Msg { returns (MsgUpdateZRC20LiquidityCapResponse); rpc PauseZRC20(MsgPauseZRC20) returns (MsgPauseZRC20Response); rpc UnpauseZRC20(MsgUnpauseZRC20) returns (MsgUnpauseZRC20Response); + rpc UpdateGatewayContract(MsgUpdateGatewayContract) + returns (MsgUpdateGatewayContractResponse); } message MsgDeploySystemContracts { string creator = 1; } @@ -109,4 +111,11 @@ message MsgUnpauseZRC20 { repeated string zrc20_addresses = 2; } -message MsgUnpauseZRC20Response {} \ No newline at end of file +message MsgUnpauseZRC20Response {} + +message MsgUpdateGatewayContract { + string creator = 1; + string new_gateway_contract_address = 2; +} + +message MsgUpdateGatewayContractResponse {} \ No newline at end of file diff --git a/typescript/zetachain/zetacore/fungible/events_pb.d.ts b/typescript/zetachain/zetacore/fungible/events_pb.d.ts index 2cfb7f648b..8fcfb85d18 100644 --- a/typescript/zetachain/zetacore/fungible/events_pb.d.ts +++ b/typescript/zetachain/zetacore/fungible/events_pb.d.ts @@ -340,3 +340,42 @@ export declare class EventBytecodeUpdated extends Message static equals(a: EventBytecodeUpdated | PlainMessage | undefined, b: EventBytecodeUpdated | PlainMessage | undefined): boolean; } +/** + * @generated from message zetachain.zetacore.fungible.EventGatewayContractUpdated + */ +export declare class EventGatewayContractUpdated extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string new_contract_address = 2; + */ + newContractAddress: string; + + /** + * @generated from field: string old_contract_address = 3; + */ + oldContractAddress: string; + + /** + * @generated from field: string signer = 4; + */ + signer: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.EventGatewayContractUpdated"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventGatewayContractUpdated; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventGatewayContractUpdated; + + static fromJsonString(jsonString: string, options?: Partial): EventGatewayContractUpdated; + + static equals(a: EventGatewayContractUpdated | PlainMessage | undefined, b: EventGatewayContractUpdated | PlainMessage | undefined): boolean; +} + diff --git a/typescript/zetachain/zetacore/fungible/system_contract_pb.d.ts b/typescript/zetachain/zetacore/fungible/system_contract_pb.d.ts index 1b7d89062f..4df1dc0815 100644 --- a/typescript/zetachain/zetacore/fungible/system_contract_pb.d.ts +++ b/typescript/zetachain/zetacore/fungible/system_contract_pb.d.ts @@ -20,6 +20,11 @@ export declare class SystemContract extends Message { */ connectorZevm: string; + /** + * @generated from field: string gateway = 3; + */ + gateway: string; + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; diff --git a/typescript/zetachain/zetacore/fungible/tx_pb.d.ts b/typescript/zetachain/zetacore/fungible/tx_pb.d.ts index 131f438020..3dd44cae9f 100644 --- a/typescript/zetachain/zetacore/fungible/tx_pb.d.ts +++ b/typescript/zetachain/zetacore/fungible/tx_pb.d.ts @@ -516,3 +516,51 @@ export declare class MsgUnpauseZRC20Response extends Message | undefined, b: MsgUnpauseZRC20Response | PlainMessage | undefined): boolean; } +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateGatewayContract + */ +export declare class MsgUpdateGatewayContract extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string new_gateway_contract_address = 2; + */ + newGatewayContractAddress: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateGatewayContract"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateGatewayContract; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateGatewayContract; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateGatewayContract; + + static equals(a: MsgUpdateGatewayContract | PlainMessage | undefined, b: MsgUpdateGatewayContract | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateGatewayContractResponse + */ +export declare class MsgUpdateGatewayContractResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateGatewayContractResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateGatewayContractResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateGatewayContractResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateGatewayContractResponse; + + static equals(a: MsgUpdateGatewayContractResponse | PlainMessage | undefined, b: MsgUpdateGatewayContractResponse | PlainMessage | undefined): boolean; +} + diff --git a/x/authority/types/authorization_list.go b/x/authority/types/authorization_list.go index d935839233..58f3d80063 100644 --- a/x/authority/types/authorization_list.go +++ b/x/authority/types/authorization_list.go @@ -28,6 +28,7 @@ var ( "/zetachain.zetacore.crosschain.MsgWhitelistERC20", "/zetachain.zetacore.fungible.MsgUpdateContractBytecode", "/zetachain.zetacore.fungible.MsgUpdateSystemContract", + "/zetachain.zetacore.fungible.MsgUpdateGatewayContract", "/zetachain.zetacore.fungible.MsgRemoveForeignCoin", "/zetachain.zetacore.fungible.MsgDeployFungibleCoinZRC20", "/zetachain.zetacore.observer.MsgUpdateObserver", diff --git a/x/authority/types/authorization_list_test.go b/x/authority/types/authorization_list_test.go index 0f4c896a50..2322caa798 100644 --- a/x/authority/types/authorization_list_test.go +++ b/x/authority/types/authorization_list_test.go @@ -420,6 +420,7 @@ func TestDefaultAuthorizationsList(t *testing.T) { sdk.MsgTypeURL(&fungibletypes.MsgDeployFungibleCoinZRC20{}), sdk.MsgTypeURL(&fungibletypes.MsgUpdateContractBytecode{}), sdk.MsgTypeURL(&fungibletypes.MsgUpdateSystemContract{}), + sdk.MsgTypeURL(&fungibletypes.MsgUpdateGatewayContract{}), sdk.MsgTypeURL(&fungibletypes.MsgRemoveForeignCoin{}), sdk.MsgTypeURL(&observertypes.MsgUpdateObserver{}), sdk.MsgTypeURL(&observertypes.MsgAddObserver{}), diff --git a/x/fungible/client/cli/tx.go b/x/fungible/client/cli/tx.go index 8d81382cc8..7e76661caf 100644 --- a/x/fungible/client/cli/tx.go +++ b/x/fungible/client/cli/tx.go @@ -29,6 +29,7 @@ func GetTxCmd() *cobra.Command { CmdPauseZRC20(), CmdUnpauseZRC20(), CmdUpdateZRC20WithdrawFee(), + CmdUpdateGatewayContract(), ) return cmd diff --git a/x/fungible/client/cli/tx_update_gateway_contract.go b/x/fungible/client/cli/tx_update_gateway_contract.go new file mode 100644 index 0000000000..8941199788 --- /dev/null +++ b/x/fungible/client/cli/tx_update_gateway_contract.go @@ -0,0 +1,35 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + + "github.com/zeta-chain/zetacore/x/fungible/types" +) + +func CmdUpdateGatewayContract() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-gateway-contract [contract-address]", + Short: "Broadcast message UpdateGatewayContract to update the gateway contract address", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUpdateGatewayContract(clientCtx.GetFromAddress().String(), args[0]) + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/fungible/keeper/msg_server_update_gateway_contract.go b/x/fungible/keeper/msg_server_update_gateway_contract.go new file mode 100644 index 0000000000..1fd3b95021 --- /dev/null +++ b/x/fungible/keeper/msg_server_update_gateway_contract.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "context" + + cosmoserrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + authoritytypes "github.com/zeta-chain/zetacore/x/authority/types" + "github.com/zeta-chain/zetacore/x/fungible/types" +) + +// UpdateGatewayContract updates the zevm gateway contract used by the ZetaChain protocol to read inbounds and process outbounds +func (k msgServer) UpdateGatewayContract( + goCtx context.Context, + msg *types.MsgUpdateGatewayContract, +) (*types.MsgUpdateGatewayContractResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + err := k.GetAuthorityKeeper().CheckAuthorization(ctx, msg) + if err != nil { + return nil, cosmoserrors.Wrap(authoritytypes.ErrUnauthorized, err.Error()) + } + + // The SystemContract state variable tracks the contract addresses used by the protocol + // This variable is planned to be renamed ProtocolContracts in the future: + // https://github.com/zeta-chain/node/issues/2576 + var protocolContracts types.SystemContract + protocolContracts, found := k.GetSystemContract(ctx) + if !found { + // protocolContracts has never been set before, set an empty structure + protocolContracts = types.SystemContract{} + } + oldGateway := protocolContracts.Gateway + + // update address and save + protocolContracts.Gateway = msg.NewGatewayContractAddress + k.SetSystemContract(ctx, protocolContracts) + + err = ctx.EventManager().EmitTypedEvent( + &types.EventGatewayContractUpdated{ + MsgTypeUrl: sdk.MsgTypeURL(&types.MsgUpdateGatewayContract{}), + NewContractAddress: msg.NewGatewayContractAddress, + OldContractAddress: oldGateway, + Signer: msg.Creator, + }, + ) + if err != nil { + k.Logger(ctx).Error("failed to emit event", "error", err.Error()) + return nil, cosmoserrors.Wrapf(types.ErrEmitEvent, "failed to emit event (%s)", err.Error()) + } + + return &types.MsgUpdateGatewayContractResponse{}, nil +} diff --git a/x/fungible/keeper/msg_server_update_gateway_contract_test.go b/x/fungible/keeper/msg_server_update_gateway_contract_test.go new file mode 100644 index 0000000000..70b0a1144c --- /dev/null +++ b/x/fungible/keeper/msg_server_update_gateway_contract_test.go @@ -0,0 +1,118 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + keepertest "github.com/zeta-chain/zetacore/testutil/keeper" + "github.com/zeta-chain/zetacore/testutil/sample" + authoritytypes "github.com/zeta-chain/zetacore/x/authority/types" + "github.com/zeta-chain/zetacore/x/fungible/keeper" + "github.com/zeta-chain/zetacore/x/fungible/types" +) + +func TestKeeper_UpdateGatewayContract(t *testing.T) { + t.Run("can update the gateway contract address stored in the module", func(t *testing.T) { + // ARRANGE + k, ctx, _, _ := keepertest.FungibleKeeperWithMocks(t, keepertest.FungibleMockOptions{ + UseAuthorityMock: true, + }) + + msgServer := keeper.NewMsgServerImpl(*k) + k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) + admin := sample.AccAddress() + + authorityMock := keepertest.GetFungibleAuthorityMock(t, k) + + systemContractAddr := sample.EthAddress() + connectorAddr := sample.EthAddress() + k.SetSystemContract(ctx, types.SystemContract{ + SystemContract: systemContractAddr.Hex(), + ConnectorZevm: connectorAddr.Hex(), + Gateway: sample.EthAddress().Hex(), + }) + + newGatewayAddr := sample.EthAddress() + + msg := types.NewMsgUpdateGatewayContract(admin, newGatewayAddr.Hex()) + keepertest.MockCheckAuthorization(&authorityMock.Mock, msg, nil) + + // ACT + _, err := msgServer.UpdateGatewayContract(ctx, msg) + + // ASSERT + require.NoError(t, err) + sc, found := k.GetSystemContract(ctx) + require.True(t, found) + + // gateway is updated + require.EqualValues(t, newGatewayAddr.Hex(), sc.Gateway) + + // system contract and connector remain the same + require.EqualValues(t, systemContractAddr.Hex(), sc.SystemContract) + require.EqualValues(t, connectorAddr.Hex(), sc.ConnectorZevm) + }) + + t.Run( + "can update and overwrite the gateway contract if system contract state variable not found", + func(t *testing.T) { + // ARRANGE + k, ctx, _, _ := keepertest.FungibleKeeperWithMocks(t, keepertest.FungibleMockOptions{ + UseAuthorityMock: true, + }) + + msgServer := keeper.NewMsgServerImpl(*k) + k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) + admin := sample.AccAddress() + + authorityMock := keepertest.GetFungibleAuthorityMock(t, k) + + newGatewayAddr := sample.EthAddress() + + _, found := k.GetSystemContract(ctx) + require.False(t, found) + + msg := types.NewMsgUpdateGatewayContract(admin, newGatewayAddr.Hex()) + keepertest.MockCheckAuthorization(&authorityMock.Mock, msg, nil) + + // ACT + _, err := msgServer.UpdateGatewayContract(ctx, msg) + + // ASSERT + require.NoError(t, err) + sc, found := k.GetSystemContract(ctx) + require.True(t, found) + + // gateway is updated + require.EqualValues(t, newGatewayAddr.Hex(), sc.Gateway) + + // system contract and connector are not updated + require.EqualValues(t, "", sc.SystemContract) + require.EqualValues(t, "", sc.ConnectorZevm) + }, + ) + + t.Run("should prevent update the gateway contract if not admin", func(t *testing.T) { + // ARRANGE + k, ctx, _, _ := keepertest.FungibleKeeperWithMocks(t, keepertest.FungibleMockOptions{ + UseAuthorityMock: true, + }) + + msgServer := keeper.NewMsgServerImpl(*k) + k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) + + admin := sample.AccAddress() + authorityMock := keepertest.GetFungibleAuthorityMock(t, k) + + msg := types.NewMsgUpdateSystemContract(admin, sample.EthAddress().Hex()) + keepertest.MockCheckAuthorization(&authorityMock.Mock, msg, authoritytypes.ErrUnauthorized) + + // ACT + _, err := msgServer.UpdateSystemContract(ctx, msg) + + // ASSERT + require.Error(t, err) + require.ErrorIs(t, err, authoritytypes.ErrUnauthorized) + }) + +} diff --git a/x/fungible/types/codec.go b/x/fungible/types/codec.go index fd31724336..29c2f831fd 100644 --- a/x/fungible/types/codec.go +++ b/x/fungible/types/codec.go @@ -17,6 +17,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUpdateZRC20LiquidityCap{}, "fungible/UpdateZRC20LiquidityCap", nil) cdc.RegisterConcrete(&MsgPauseZRC20{}, "fungible/PauseZRC20", nil) cdc.RegisterConcrete(&MsgUnpauseZRC20{}, "fungible/UnpauseZRC20", nil) + cdc.RegisterConcrete(&MsgUpdateGatewayContract{}, "fungible/UpdateGatewayContract", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -30,6 +31,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgUpdateZRC20LiquidityCap{}, &MsgPauseZRC20{}, &MsgUnpauseZRC20{}, + &MsgUpdateGatewayContract{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/fungible/types/events.pb.go b/x/fungible/types/events.pb.go index 41795a24b7..6e4d5784c0 100644 --- a/x/fungible/types/events.pb.go +++ b/x/fungible/types/events.pb.go @@ -596,6 +596,74 @@ func (m *EventBytecodeUpdated) GetSigner() string { return "" } +type EventGatewayContractUpdated struct { + MsgTypeUrl string `protobuf:"bytes,1,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` + NewContractAddress string `protobuf:"bytes,2,opt,name=new_contract_address,json=newContractAddress,proto3" json:"new_contract_address,omitempty"` + OldContractAddress string `protobuf:"bytes,3,opt,name=old_contract_address,json=oldContractAddress,proto3" json:"old_contract_address,omitempty"` + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *EventGatewayContractUpdated) Reset() { *m = EventGatewayContractUpdated{} } +func (m *EventGatewayContractUpdated) String() string { return proto.CompactTextString(m) } +func (*EventGatewayContractUpdated) ProtoMessage() {} +func (*EventGatewayContractUpdated) Descriptor() ([]byte, []int) { + return fileDescriptor_1e6611815bc2713b, []int{7} +} +func (m *EventGatewayContractUpdated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventGatewayContractUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventGatewayContractUpdated.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 *EventGatewayContractUpdated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventGatewayContractUpdated.Merge(m, src) +} +func (m *EventGatewayContractUpdated) XXX_Size() int { + return m.Size() +} +func (m *EventGatewayContractUpdated) XXX_DiscardUnknown() { + xxx_messageInfo_EventGatewayContractUpdated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventGatewayContractUpdated proto.InternalMessageInfo + +func (m *EventGatewayContractUpdated) GetMsgTypeUrl() string { + if m != nil { + return m.MsgTypeUrl + } + return "" +} + +func (m *EventGatewayContractUpdated) GetNewContractAddress() string { + if m != nil { + return m.NewContractAddress + } + return "" +} + +func (m *EventGatewayContractUpdated) GetOldContractAddress() string { + if m != nil { + return m.OldContractAddress + } + return "" +} + +func (m *EventGatewayContractUpdated) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + func init() { proto.RegisterType((*EventSystemContractUpdated)(nil), "zetachain.zetacore.fungible.EventSystemContractUpdated") proto.RegisterType((*EventZRC20Deployed)(nil), "zetachain.zetacore.fungible.EventZRC20Deployed") @@ -604,6 +672,7 @@ func init() { proto.RegisterType((*EventZRC20Unpaused)(nil), "zetachain.zetacore.fungible.EventZRC20Unpaused") proto.RegisterType((*EventSystemContractsDeployed)(nil), "zetachain.zetacore.fungible.EventSystemContractsDeployed") proto.RegisterType((*EventBytecodeUpdated)(nil), "zetachain.zetacore.fungible.EventBytecodeUpdated") + proto.RegisterType((*EventGatewayContractUpdated)(nil), "zetachain.zetacore.fungible.EventGatewayContractUpdated") } func init() { @@ -611,55 +680,55 @@ func init() { } var fileDescriptor_1e6611815bc2713b = []byte{ - // 754 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xdd, 0x4e, 0xdb, 0x48, - 0x14, 0xc6, 0x04, 0x02, 0x19, 0x7e, 0x12, 0x46, 0xd1, 0xca, 0x1b, 0x56, 0x11, 0xca, 0x2e, 0xbb, - 0x59, 0xb4, 0x9b, 0xa0, 0xf4, 0x09, 0x0a, 0x2d, 0x2d, 0x52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, 0x88, 0xc4, 0x07, 0x00, 0xf7, 0xff, 0xda, 0x77, 0x08, 0x57, 0x6a, - 0xaa, 0xf2, 0x73, 0x4d, 0xfd, 0x89, 0xd6, 0xce, 0x65, 0x1f, 0xb9, 0x27, 0x52, 0xa5, 0x57, 0xd5, - 0x66, 0xe6, 0x86, 0x2e, 0x6a, 0x48, 0xff, 0xc4, 0x9a, 0xbf, 0x75, 0x02, 0xa0, 0xb5, 0x5f, 0x67, - 0xbe, 0x53, 0x68, 0x4b, 0x22, 0xa5, 0x37, 0x4b, 0xc8, 0x6a, 0x8a, 0xa4, 0x10, 0x17, 0x91, 0x33, - 0x87, 0x2d, 0x15, 0x1d, 0x86, 0x3b, 0x68, 0x4d, 0xd6, 0x9a, 0x69, 0x9a, 0xaa, 0xbd, 0xc2, 0x7c, - 0xe7, 0x99, 0x96, 0x55, 0x62, 0x64, 0x95, 0xb2, 0xee, 0xb5, 0xe1, 0x0a, 0x85, 0x38, 0xc3, 0x74, - 0x26, 0xa8, 0x31, 0x53, 0xfe, 0x25, 0x99, 0xf0, 0x7b, 0xa9, 0xfd, 0x0f, 0xaa, 0x97, 0xe4, 0x00, - 0x39, 0x56, 0x15, 0x49, 0xbf, 0x28, 0x08, 0x14, 0x07, 0xa4, 0x52, 0x1a, 0x90, 0xb8, 0x38, 0x1f, - 0x47, 0x34, 0xfc, 0x65, 0x85, 0xdf, 0x67, 0x56, 0x2b, 0x5f, 0x2b, 0xfc, 0x01, 0x33, 0xfa, 0x1f, - 0xc2, 0x13, 0xea, 0xf1, 0x98, 0x84, 0xd6, 0x74, 0x60, 0x9d, 0x10, 0x5b, 0xb0, 0x28, 0xd1, 0xd7, - 0x4a, 0x43, 0xff, 0xf3, 0x66, 0x70, 0x90, 0xee, 0xcb, 0x71, 0x88, 0xa5, 0xc5, 0x34, 0x8f, 0x34, - 0xc0, 0x3b, 0x68, 0xa3, 0x90, 0x23, 0x62, 0x13, 0x91, 0xdf, 0x21, 0xf5, 0x3c, 0xc5, 0x50, 0x6d, - 0xe3, 0x6d, 0xb4, 0x6e, 0x33, 0x4a, 0x41, 0xe6, 0xb3, 0xce, 0x61, 0x1a, 0x68, 0x53, 0xad, 0xe5, - 0xbb, 0xc7, 0x30, 0x0d, 0xa4, 0x34, 0x5c, 0xf5, 0x94, 0x5f, 0x60, 0x99, 0xa5, 0x78, 0xa9, 0xd5, - 0xdb, 0x2c, 0xd5, 0xf9, 0x6c, 0xa0, 0xa6, 0x92, 0x66, 0x2f, 0x11, 0x60, 0x33, 0xe7, 0x01, 0xd3, - 0xf7, 0x2f, 0x6a, 0xdc, 0x72, 0xcf, 0xd6, 0xed, 0x6b, 0x57, 0xe6, 0x0e, 0xda, 0x90, 0xa6, 0x1c, - 0xe9, 0x1a, 0xd6, 0x98, 0xf0, 0xb1, 0xd6, 0xa6, 0x4e, 0x21, 0xce, 0x6a, 0x3f, 0x27, 0x7c, 0x2c, - 0xb1, 0xd2, 0xe4, 0x65, 0xac, 0x56, 0x89, 0xf9, 0x4e, 0x09, 0x3b, 0xeb, 0x6a, 0xb1, 0xd8, 0xd5, - 0xde, 0xe1, 0xa7, 0xcb, 0xb6, 0x71, 0x71, 0xd9, 0x36, 0xbe, 0x5e, 0xb6, 0x8d, 0x77, 0x57, 0xed, - 0xb9, 0x8b, 0xab, 0xf6, 0xdc, 0x97, 0xab, 0xf6, 0xdc, 0x71, 0xdf, 0xf5, 0xc4, 0x78, 0x32, 0xea, - 0xd9, 0x2c, 0x50, 0x4f, 0xd1, 0xff, 0xd7, 0x5e, 0xa5, 0xb3, 0xc2, 0x9b, 0x96, 0x84, 0xc0, 0x47, - 0x55, 0xf5, 0x32, 0x3d, 0xfa, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x55, 0x3b, 0x93, 0x8b, 0x46, 0x07, - 0x00, 0x00, + // 766 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0x4d, 0x6e, 0xd3, 0x40, + 0x14, 0xae, 0x9b, 0x36, 0x6d, 0xa6, 0x3f, 0x49, 0xad, 0x08, 0x99, 0x14, 0x45, 0x55, 0xa0, 0x10, + 0x2a, 0x48, 0xaa, 0x70, 0x02, 0x5a, 0x68, 0xa9, 0xc4, 0x02, 0x05, 0x0a, 0x52, 0x37, 0xd6, 0xc4, + 0x7e, 0x75, 0xac, 0xda, 0x33, 0x96, 0x67, 0x12, 0xd7, 0x3d, 0x05, 0x4b, 0x0e, 0xc1, 0x09, 0xe0, + 0x02, 0x2c, 0x2b, 0xb1, 0x61, 0x89, 0xda, 0x4b, 0xb0, 0x44, 0x33, 0x1e, 0x3b, 0x76, 0x69, 0xab, + 0x96, 0x05, 0x12, 0x9b, 0x68, 0xde, 0xe4, 0x9b, 0xf7, 0xbe, 0xf7, 0xf9, 0x7b, 0x33, 0xa8, 0x7d, + 0x02, 0x1c, 0x5b, 0x43, 0xec, 0x92, 0xae, 0x5c, 0xd1, 0x10, 0xba, 0x87, 0x23, 0xe2, 0xb8, 0x03, + 0x0f, 0xba, 0x30, 0x06, 0xc2, 0x59, 0x27, 0x08, 0x29, 0xa7, 0xfa, 0x6a, 0x86, 0xec, 0xa4, 0xc8, + 0x4e, 0x8a, 0x6c, 0x3c, 0xb8, 0x2e, 0x0d, 0x3f, 0x4e, 0x52, 0x34, 0xea, 0x0e, 0x75, 0xa8, 0x5c, + 0x76, 0xc5, 0x4a, 0xed, 0x3e, 0xbc, 0xe4, 0x6c, 0x70, 0xe4, 0x74, 0x2d, 0xea, 0x12, 0xf9, 0x93, + 0xe0, 0x5a, 0x5f, 0x34, 0xd4, 0x78, 0x29, 0x18, 0xbd, 0x8d, 0x19, 0x07, 0x7f, 0x9b, 0x12, 0x1e, + 0x62, 0x8b, 0xef, 0x07, 0x36, 0xe6, 0x60, 0xeb, 0x6b, 0x68, 0xd1, 0x67, 0x8e, 0xc9, 0xe3, 0x00, + 0xcc, 0x51, 0xe8, 0x19, 0xda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xa6, 0xe7, 0xfa, 0x2e, + 0x37, 0x2a, 0x49, 0x59, 0x07, 0xb3, 0xd7, 0x22, 0x6e, 0xfd, 0x9a, 0x46, 0xf7, 0x26, 0x72, 0x7d, + 0x70, 0xf9, 0xd0, 0x0e, 0x71, 0xb4, 0x03, 0x70, 0xf3, 0xaf, 0x7d, 0x8d, 0x70, 0x85, 0xa6, 0x4a, + 0x7f, 0xd7, 0xd4, 0x7d, 0xb4, 0x74, 0x22, 0xfa, 0xc8, 0x3c, 0x91, 0x28, 0xbd, 0x28, 0x37, 0x53, + 0x37, 0xb4, 0x51, 0x4d, 0xf8, 0x27, 0x52, 0xfc, 0xcd, 0x43, 0x00, 0xa5, 0xfd, 0x32, 0xf5, 0xec, + 0x5c, 0x5b, 0x02, 0x29, 0xbc, 0x59, 0x40, 0x96, 0x13, 0x24, 0x81, 0x28, 0x8f, 0x9c, 0x38, 0x6c, + 0x2e, 0xef, 0x30, 0xbd, 0x85, 0x96, 0x44, 0xad, 0x89, 0xa6, 0x89, 0xda, 0x0b, 0xd4, 0xb3, 0x77, + 0x95, 0xac, 0x02, 0x23, 0xaa, 0x14, 0x75, 0xaf, 0xf4, 0x17, 0x08, 0x44, 0x29, 0xa6, 0x35, 0x42, + 0xb5, 0x89, 0xf2, 0x6f, 0xf0, 0x88, 0xdd, 0x48, 0xed, 0x47, 0xa8, 0x5a, 0x90, 0x03, 0xc4, 0x58, + 0x95, 0x04, 0xfd, 0xbc, 0x20, 0x90, 0x1f, 0x90, 0x52, 0x61, 0x40, 0xa2, 0xfc, 0x7c, 0xec, 0x93, + 0xe0, 0x9f, 0x15, 0xfe, 0x94, 0x5a, 0xad, 0x78, 0xad, 0xb0, 0x5b, 0xcc, 0xe8, 0x13, 0xa4, 0x8f, + 0x88, 0xcb, 0x22, 0x1c, 0x98, 0xe3, 0x9e, 0x79, 0x88, 0x2d, 0x4e, 0xc3, 0x58, 0x5d, 0x2b, 0x35, + 0xf5, 0xcf, 0xfb, 0xde, 0x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c0, 0x06, 0x65, 0xf9, 0xae, 0x3e, + 0xfb, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x11, 0xe2, 0x57, 0x41, 0x04, 0x08, 0x00, 0x00, } func (m *EventSystemContractUpdated) Marshal() (dAtA []byte, err error) { @@ -1095,6 +1164,57 @@ func (m *EventBytecodeUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventGatewayContractUpdated) 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 *EventGatewayContractUpdated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventGatewayContractUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + if len(m.OldContractAddress) > 0 { + i -= len(m.OldContractAddress) + copy(dAtA[i:], m.OldContractAddress) + i = encodeVarintEvents(dAtA, i, uint64(len(m.OldContractAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.NewContractAddress) > 0 { + i -= len(m.NewContractAddress) + copy(dAtA[i:], m.NewContractAddress) + i = encodeVarintEvents(dAtA, i, uint64(len(m.NewContractAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.MsgTypeUrl) > 0 { + i -= len(m.MsgTypeUrl) + copy(dAtA[i:], m.MsgTypeUrl) + i = encodeVarintEvents(dAtA, i, uint64(len(m.MsgTypeUrl))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -1327,6 +1447,31 @@ func (m *EventBytecodeUpdated) Size() (n int) { return n } +func (m *EventGatewayContractUpdated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MsgTypeUrl) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.NewContractAddress) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.OldContractAddress) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2885,6 +3030,184 @@ func (m *EventBytecodeUpdated) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventGatewayContractUpdated) 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 ErrIntOverflowEvents + } + 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: EventGatewayContractUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventGatewayContractUpdated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OldContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvents(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/fungible/types/message_update_gateway_contract.go b/x/fungible/types/message_update_gateway_contract.go new file mode 100644 index 0000000000..d83d4d4da6 --- /dev/null +++ b/x/fungible/types/message_update_gateway_contract.go @@ -0,0 +1,57 @@ +package types + +import ( + cosmoserrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + ethcommon "github.com/ethereum/go-ethereum/common" +) + +const TypeMsgUpdateGatewayContract = "update_gateway_contract" + +var _ sdk.Msg = &MsgUpdateGatewayContract{} + +func NewMsgUpdateGatewayContract(creator string, gatewayContractAddr string) *MsgUpdateGatewayContract { + return &MsgUpdateGatewayContract{ + Creator: creator, + NewGatewayContractAddress: gatewayContractAddr, + } +} + +func (msg *MsgUpdateGatewayContract) Route() string { + return RouterKey +} + +func (msg *MsgUpdateGatewayContract) Type() string { + return TypeMsgUpdateGatewayContract +} + +func (msg *MsgUpdateGatewayContract) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgUpdateGatewayContract) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdateGatewayContract) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return cosmoserrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + // check if the system contract address is valid + if ethcommon.HexToAddress(msg.NewGatewayContractAddress) == (ethcommon.Address{}) { + return cosmoserrors.Wrapf( + sdkerrors.ErrInvalidAddress, + "invalid gateway contract address (%s)", + msg.NewGatewayContractAddress, + ) + } + + return nil +} diff --git a/x/fungible/types/message_update_gateway_contract_test.go b/x/fungible/types/message_update_gateway_contract_test.go new file mode 100644 index 0000000000..f1c143591d --- /dev/null +++ b/x/fungible/types/message_update_gateway_contract_test.go @@ -0,0 +1,105 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + + "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/fungible/types" +) + +func TestMsgUpdateGatewayContract_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg *types.MsgUpdateGatewayContract + err error + }{ + { + name: "invalid address", + msg: types.NewMsgUpdateGatewayContract("invalid_address", sample.EthAddress().String()), + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid new gateway contract address", + msg: types.NewMsgUpdateGatewayContract(sample.AccAddress(), "invalid_address"), + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid message", + msg: types.NewMsgUpdateGatewayContract(sample.AccAddress(), sample.EthAddress().String()), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} + +func TestMsgUpdateGatewayContract_GetSigners(t *testing.T) { + signer := sample.AccAddress() + tests := []struct { + name string + msg types.MsgUpdateGatewayContract + panics bool + }{ + { + name: "valid signer", + msg: types.MsgUpdateGatewayContract{ + Creator: signer, + }, + panics: false, + }, + { + name: "invalid signer", + msg: types.MsgUpdateGatewayContract{ + Creator: "invalid", + }, + panics: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if !tt.panics { + signers := tt.msg.GetSigners() + require.Equal(t, []sdk.AccAddress{sdk.MustAccAddressFromBech32(signer)}, signers) + } else { + require.Panics(t, func() { + tt.msg.GetSigners() + }) + } + }) + } +} + +func TestMsgUpdateGatewayContract_Type(t *testing.T) { + msg := types.MsgUpdateGatewayContract{ + Creator: sample.AccAddress(), + } + require.Equal(t, types.TypeMsgUpdateGatewayContract, msg.Type()) +} + +func TestMsgUpdateGatewayContract_Route(t *testing.T) { + msg := types.MsgUpdateGatewayContract{ + Creator: sample.AccAddress(), + } + require.Equal(t, types.RouterKey, msg.Route()) +} + +func TestMsgUpdateGatewayContract_GetSignBytes(t *testing.T) { + msg := types.MsgUpdateGatewayContract{ + Creator: sample.AccAddress(), + } + require.NotPanics(t, func() { + msg.GetSignBytes() + }) +} diff --git a/x/fungible/types/system_contract.pb.go b/x/fungible/types/system_contract.pb.go index ef828c5958..ef9c5ba15f 100644 --- a/x/fungible/types/system_contract.pb.go +++ b/x/fungible/types/system_contract.pb.go @@ -26,6 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type SystemContract struct { SystemContract string `protobuf:"bytes,1,opt,name=system_contract,json=systemContract,proto3" json:"system_contract,omitempty"` ConnectorZevm string `protobuf:"bytes,2,opt,name=connector_zevm,json=connectorZevm,proto3" json:"connector_zevm,omitempty"` + Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` } func (m *SystemContract) Reset() { *m = SystemContract{} } @@ -75,6 +76,13 @@ func (m *SystemContract) GetConnectorZevm() string { return "" } +func (m *SystemContract) GetGateway() string { + if m != nil { + return m.Gateway + } + return "" +} + func init() { proto.RegisterType((*SystemContract)(nil), "zetachain.zetacore.fungible.SystemContract") } @@ -84,21 +92,22 @@ func init() { } var fileDescriptor_98608b52bf5b9ddd = []byte{ - // 209 bytes of a gzipped FileDescriptorProto + // 226 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0xac, 0x4a, 0x2d, 0x49, 0x4c, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x07, 0xb3, 0xf2, 0x8b, 0x52, 0xf5, 0xd3, 0x4a, 0xf3, 0xd2, 0x33, 0x93, 0x72, 0x52, 0xf5, 0x8b, 0x2b, 0x8b, 0x4b, 0x52, 0x73, 0xe3, 0x93, 0xf3, 0xf3, 0x4a, 0x8a, 0x12, 0x93, 0x4b, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xa4, 0xe1, 0x5a, 0xf4, 0x60, 0x5a, 0xf4, 0x60, 0x5a, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xea, 0xf4, 0x41, 0x2c, 0x88, - 0x16, 0xa5, 0x04, 0x2e, 0xbe, 0x60, 0xb0, 0x59, 0xce, 0x50, 0xa3, 0x84, 0xd4, 0xb9, 0xf8, 0xd1, + 0x16, 0xa5, 0x2a, 0x2e, 0xbe, 0x60, 0xb0, 0x59, 0xce, 0x50, 0xa3, 0x84, 0xd4, 0xb9, 0xf8, 0xd1, 0x4c, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0xe2, 0x2b, 0x46, 0x55, 0xa8, 0xca, 0xc5, 0x97, 0x9c, 0x9f, 0x97, 0x97, 0x9a, 0x5c, 0x92, 0x5f, 0x14, 0x5f, 0x95, 0x5a, 0x96, 0x2b, 0xc1, 0x04, - 0x56, 0xc7, 0x0b, 0x17, 0x8d, 0x4a, 0x2d, 0xcb, 0x75, 0xf2, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, - 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, - 0xc6, 0x63, 0x39, 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, - 0xb0, 0x17, 0x75, 0xd1, 0x7c, 0x5b, 0x81, 0xf0, 0x6f, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, - 0xd8, 0xcd, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x75, 0x5d, 0xa7, 0x0c, 0x1b, 0x01, 0x00, - 0x00, + 0x56, 0xc7, 0x0b, 0x17, 0x8d, 0x4a, 0x2d, 0xcb, 0x15, 0x92, 0xe0, 0x62, 0x4f, 0x4f, 0x2c, 0x49, + 0x2d, 0x4f, 0xac, 0x94, 0x60, 0x06, 0xcb, 0xc3, 0xb8, 0x4e, 0x9e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, + 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, + 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9f, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, + 0x0b, 0xf6, 0xbc, 0x2e, 0x5a, 0x38, 0x54, 0x20, 0x42, 0xa2, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, + 0x0d, 0xec, 0x1b, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0x8e, 0xa4, 0xee, 0x35, 0x01, + 0x00, 0x00, } func (m *SystemContract) Marshal() (dAtA []byte, err error) { @@ -121,6 +130,13 @@ func (m *SystemContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Gateway) > 0 { + i -= len(m.Gateway) + copy(dAtA[i:], m.Gateway) + i = encodeVarintSystemContract(dAtA, i, uint64(len(m.Gateway))) + i-- + dAtA[i] = 0x1a + } if len(m.ConnectorZevm) > 0 { i -= len(m.ConnectorZevm) copy(dAtA[i:], m.ConnectorZevm) @@ -163,6 +179,10 @@ func (m *SystemContract) Size() (n int) { if l > 0 { n += 1 + l + sovSystemContract(uint64(l)) } + l = len(m.Gateway) + if l > 0 { + n += 1 + l + sovSystemContract(uint64(l)) + } return n } @@ -265,6 +285,38 @@ func (m *SystemContract) Unmarshal(dAtA []byte) error { } m.ConnectorZevm = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateway", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSystemContract + } + 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 ErrInvalidLengthSystemContract + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSystemContract + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Gateway = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSystemContract(dAtA[iNdEx:]) diff --git a/x/fungible/types/tx.pb.go b/x/fungible/types/tx.pb.go index 8409ef6f36..f5c3778af3 100644 --- a/x/fungible/types/tx.pb.go +++ b/x/fungible/types/tx.pb.go @@ -921,6 +921,94 @@ func (m *MsgUnpauseZRC20Response) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnpauseZRC20Response proto.InternalMessageInfo +type MsgUpdateGatewayContract struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + NewGatewayContractAddress string `protobuf:"bytes,2,opt,name=new_gateway_contract_address,json=newGatewayContractAddress,proto3" json:"new_gateway_contract_address,omitempty"` +} + +func (m *MsgUpdateGatewayContract) Reset() { *m = MsgUpdateGatewayContract{} } +func (m *MsgUpdateGatewayContract) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateGatewayContract) ProtoMessage() {} +func (*MsgUpdateGatewayContract) Descriptor() ([]byte, []int) { + return fileDescriptor_7bea9688d1d01113, []int{18} +} +func (m *MsgUpdateGatewayContract) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateGatewayContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateGatewayContract.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 *MsgUpdateGatewayContract) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateGatewayContract.Merge(m, src) +} +func (m *MsgUpdateGatewayContract) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateGatewayContract) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateGatewayContract.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateGatewayContract proto.InternalMessageInfo + +func (m *MsgUpdateGatewayContract) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateGatewayContract) GetNewGatewayContractAddress() string { + if m != nil { + return m.NewGatewayContractAddress + } + return "" +} + +type MsgUpdateGatewayContractResponse struct { +} + +func (m *MsgUpdateGatewayContractResponse) Reset() { *m = MsgUpdateGatewayContractResponse{} } +func (m *MsgUpdateGatewayContractResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateGatewayContractResponse) ProtoMessage() {} +func (*MsgUpdateGatewayContractResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7bea9688d1d01113, []int{19} +} +func (m *MsgUpdateGatewayContractResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateGatewayContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateGatewayContractResponse.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 *MsgUpdateGatewayContractResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateGatewayContractResponse.Merge(m, src) +} +func (m *MsgUpdateGatewayContractResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateGatewayContractResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateGatewayContractResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateGatewayContractResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgDeploySystemContracts)(nil), "zetachain.zetacore.fungible.MsgDeploySystemContracts") proto.RegisterType((*MsgDeploySystemContractsResponse)(nil), "zetachain.zetacore.fungible.MsgDeploySystemContractsResponse") @@ -940,6 +1028,8 @@ func init() { proto.RegisterType((*MsgPauseZRC20Response)(nil), "zetachain.zetacore.fungible.MsgPauseZRC20Response") proto.RegisterType((*MsgUnpauseZRC20)(nil), "zetachain.zetacore.fungible.MsgUnpauseZRC20") proto.RegisterType((*MsgUnpauseZRC20Response)(nil), "zetachain.zetacore.fungible.MsgUnpauseZRC20Response") + proto.RegisterType((*MsgUpdateGatewayContract)(nil), "zetachain.zetacore.fungible.MsgUpdateGatewayContract") + proto.RegisterType((*MsgUpdateGatewayContractResponse)(nil), "zetachain.zetacore.fungible.MsgUpdateGatewayContractResponse") } func init() { @@ -947,69 +1037,73 @@ func init() { } var fileDescriptor_7bea9688d1d01113 = []byte{ - // 992 bytes of a gzipped FileDescriptorProto + // 1047 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdd, 0x6e, 0xdb, 0x36, - 0x14, 0x8e, 0x92, 0xe6, 0xef, 0x2c, 0x4e, 0x32, 0xc2, 0x6d, 0x54, 0x65, 0x70, 0x5a, 0x35, 0x6b, - 0xb3, 0x62, 0xb5, 0x3a, 0x2f, 0x5b, 0x31, 0x60, 0xed, 0xb0, 0x78, 0xcd, 0x56, 0xa0, 0x06, 0x06, - 0x35, 0xe9, 0xb0, 0xdc, 0x08, 0x8c, 0xc4, 0xc8, 0x42, 0x6c, 0x52, 0x13, 0xe5, 0xb9, 0xee, 0xdd, - 0x80, 0x5d, 0x15, 0x18, 0x50, 0x60, 0x0f, 0xb0, 0x67, 0xd8, 0x5b, 0xf4, 0xb2, 0x97, 0x43, 0x31, - 0x14, 0x43, 0xf2, 0x22, 0x03, 0xa9, 0x9f, 0x4a, 0xb6, 0x15, 0x3b, 0x4e, 0x6f, 0x12, 0x91, 0xfe, - 0xce, 0xc7, 0x8f, 0x87, 0xe7, 0x3b, 0x94, 0x60, 0xf3, 0x39, 0x09, 0xb1, 0xdd, 0xc4, 0x1e, 0x35, - 0xe4, 0x13, 0x0b, 0x88, 0x71, 0xd4, 0xa1, 0xae, 0x77, 0xd8, 0x22, 0x46, 0xf8, 0xac, 0xea, 0x07, - 0x2c, 0x64, 0x68, 0x3d, 0x45, 0x55, 0x13, 0x54, 0x35, 0x41, 0x69, 0x65, 0x97, 0xb9, 0x4c, 0xe2, - 0x0c, 0xf1, 0x14, 0x85, 0x68, 0x37, 0x87, 0x10, 0xfb, 0xc7, 0xae, 0x61, 0x33, 0x8f, 0xca, 0x3f, - 0x11, 0x4e, 0xdf, 0x06, 0xb5, 0xc1, 0xdd, 0xef, 0x88, 0xdf, 0x62, 0xbd, 0x27, 0x3d, 0x1e, 0x92, - 0x76, 0x9d, 0xd1, 0x30, 0xc0, 0x76, 0xc8, 0x91, 0x0a, 0xf3, 0x76, 0x40, 0x70, 0xc8, 0x02, 0x55, - 0xb9, 0xa6, 0x6c, 0x2d, 0x9a, 0xc9, 0x50, 0xff, 0x57, 0x81, 0x6b, 0x45, 0x61, 0x26, 0xe1, 0x3e, - 0xa3, 0x9c, 0xa0, 0xdb, 0xb0, 0xda,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0xbc, + 0x1e, 0x77, 0x46, 0x71, 0x0e, 0x42, 0x69, 0x5f, 0x4f, 0x82, 0x92, 0x62, 0x5e, 0x29, 0x70, 0x29, + 0xc7, 0x3a, 0xbf, 0x1c, 0x8f, 0xb8, 0x17, 0xa7, 0xdd, 0x9f, 0x0c, 0x37, 0x40, 0x52, 0xdf, 0xfb, + 0xd6, 0x98, 0x92, 0x7a, 0x71, 0xe3, 0x4a, 0xca, 0x7b, 0xa7, 0x11, 0xc5, 0x9c, 0x67, 0xda, 0x77, + 0xcf, 0xc1, 0x9d, 0x06, 0x8e, 0x2e, 0xe6, 0x11, 0x9e, 0x8b, 0x9a, 0x00, 0x29, 0xc3, 0xbd, 0x39, + 0x8a, 0xee, 0x5d, 0xac, 0x56, 0x1d, 0x3f, 0x56, 0xae, 0x16, 0xc0, 0x52, 0xc6, 0x71, 0x3f, 0x1b, + 0x29, 0x3f, 0x15, 0xad, 0xed, 0x9c, 0x27, 0x5a, 0xae, 0xc9, 0x4d, 0x6d, 0xb0, 0xeb, 0xde, 0x19, + 0x2f, 0x79, 0x3d, 0xb0, 0xd1, 0xa6, 0x36, 0xd4, 0x6c, 0x77, 0x1f, 0xbf, 0x3e, 0x2d, 0x29, 0x6f, + 0x4e, 0x4b, 0xca, 0xbf, 0xa7, 0x25, 0xe5, 0xd5, 0x59, 0x69, 0xea, 0xcd, 0x59, 0x69, 0xea, 0xaf, + 0xb3, 0xd2, 0xd4, 0x61, 0x25, 0x75, 0xb9, 0x72, 0xe2, 0x5b, 0x3d, 0x1f, 0x5c, 0xcf, 0x53, 0xdf, + 0x72, 0xfc, 0xa6, 0x3d, 0x9a, 0x13, 0x1f, 0x5d, 0x5f, 0xfc, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x47, + 0x87, 0xc9, 0xcd, 0xf7, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1033,6 +1127,7 @@ type MsgClient interface { UpdateZRC20LiquidityCap(ctx context.Context, in *MsgUpdateZRC20LiquidityCap, opts ...grpc.CallOption) (*MsgUpdateZRC20LiquidityCapResponse, error) PauseZRC20(ctx context.Context, in *MsgPauseZRC20, opts ...grpc.CallOption) (*MsgPauseZRC20Response, error) UnpauseZRC20(ctx context.Context, in *MsgUnpauseZRC20, opts ...grpc.CallOption) (*MsgUnpauseZRC20Response, error) + UpdateGatewayContract(ctx context.Context, in *MsgUpdateGatewayContract, opts ...grpc.CallOption) (*MsgUpdateGatewayContractResponse, error) } type msgClient struct { @@ -1124,6 +1219,15 @@ func (c *msgClient) UnpauseZRC20(ctx context.Context, in *MsgUnpauseZRC20, opts return out, nil } +func (c *msgClient) UpdateGatewayContract(ctx context.Context, in *MsgUpdateGatewayContract, opts ...grpc.CallOption) (*MsgUpdateGatewayContractResponse, error) { + out := new(MsgUpdateGatewayContractResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.fungible.Msg/UpdateGatewayContract", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { DeploySystemContracts(context.Context, *MsgDeploySystemContracts) (*MsgDeploySystemContractsResponse, error) @@ -1135,6 +1239,7 @@ type MsgServer interface { UpdateZRC20LiquidityCap(context.Context, *MsgUpdateZRC20LiquidityCap) (*MsgUpdateZRC20LiquidityCapResponse, error) PauseZRC20(context.Context, *MsgPauseZRC20) (*MsgPauseZRC20Response, error) UnpauseZRC20(context.Context, *MsgUnpauseZRC20) (*MsgUnpauseZRC20Response, error) + UpdateGatewayContract(context.Context, *MsgUpdateGatewayContract) (*MsgUpdateGatewayContractResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1168,6 +1273,9 @@ func (*UnimplementedMsgServer) PauseZRC20(ctx context.Context, req *MsgPauseZRC2 func (*UnimplementedMsgServer) UnpauseZRC20(ctx context.Context, req *MsgUnpauseZRC20) (*MsgUnpauseZRC20Response, error) { return nil, status.Errorf(codes.Unimplemented, "method UnpauseZRC20 not implemented") } +func (*UnimplementedMsgServer) UpdateGatewayContract(ctx context.Context, req *MsgUpdateGatewayContract) (*MsgUpdateGatewayContractResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGatewayContract not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1335,6 +1443,24 @@ func _Msg_UnpauseZRC20_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_UpdateGatewayContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateGatewayContract) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateGatewayContract(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zetachain.zetacore.fungible.Msg/UpdateGatewayContract", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateGatewayContract(ctx, req.(*MsgUpdateGatewayContract)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "zetachain.zetacore.fungible.Msg", HandlerType: (*MsgServer)(nil), @@ -1375,6 +1501,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UnpauseZRC20", Handler: _Msg_UnpauseZRC20_Handler, }, + { + MethodName: "UpdateGatewayContract", + Handler: _Msg_UpdateGatewayContract_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "zetachain/zetacore/fungible/tx.proto", @@ -2030,6 +2160,66 @@ func (m *MsgUnpauseZRC20Response) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgUpdateGatewayContract) 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 *MsgUpdateGatewayContract) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateGatewayContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NewGatewayContractAddress) > 0 { + i -= len(m.NewGatewayContractAddress) + copy(dAtA[i:], m.NewGatewayContractAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewGatewayContractAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateGatewayContractResponse) 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 *MsgUpdateGatewayContractResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateGatewayContractResponse) 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 @@ -2329,6 +2519,32 @@ func (m *MsgUnpauseZRC20Response) Size() (n int) { return n } +func (m *MsgUpdateGatewayContract) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.NewGatewayContractAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateGatewayContractResponse) 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 } @@ -4245,6 +4461,170 @@ func (m *MsgUnpauseZRC20Response) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateGatewayContract) 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: MsgUpdateGatewayContract: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateGatewayContract: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewGatewayContractAddress", 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.NewGatewayContractAddress = 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 *MsgUpdateGatewayContractResponse) 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: MsgUpdateGatewayContractResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateGatewayContractResponse: 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