From 7039dcc5d63d8d94506849435bee4ac1f273984f Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Thu, 15 Aug 2024 20:56:40 +0200 Subject: [PATCH] feat: implement `MsgUpdateERC20CustodyPauseStatus` to pause or unpause ERC20 Custody (#2681) * refactor cmd cctx creation * initialize migrate funds message * implement migrate message * zetaclient implementation * fix event * fix params * add e2e test * generate * changelog * zetaclient test * fix message test * initialize cctx test * cmd cctx type tests * message test * Update zetaclient/chains/evm/signer/admin_cmd.go Co-authored-by: skosito * tanmay comments * stefan comments * admin commands * make generate * initialize message * some message fixes * implement logic on ZetaClient * update pause status * add in authorization list * E2E test * add test in admin workflow * add event for pausing * changelogs * Update x/crosschain/types/cmd_cctxs.go Co-authored-by: skosito * Update x/crosschain/types/cmd_cctxs.go Co-authored-by: skosito * fix * remove rate limiter test --------- Co-authored-by: skosito --- changelog.md | 1 + cmd/zetae2e/local/local.go | 8 +- docs/openapi/openapi.swagger.yaml | 5 + docs/spec/crosschain/messages.md | 12 + e2e/e2etests/e2etests.go | 10 +- e2e/e2etests/test_pause_erc20_custody.go | 81 +++ pkg/constant/constant.go | 9 + .../zetacore/crosschain/events.proto | 6 + proto/zetachain/zetacore/crosschain/tx.proto | 14 + .../zetacore/crosschain/events_pb.d.ts | 34 + .../zetachain/zetacore/crosschain/tx_pb.d.ts | 61 ++ x/authority/types/authorization_list.go | 1 + x/authority/types/authorization_list_test.go | 1 + ...server_migrate_erc20_custody_funds_test.go | 2 + ...erver_update_erc20_custody_pause_status.go | 100 +++ ..._update_erc20_custody_pause_status_test.go | 322 +++++++++ x/crosschain/types/cmd_cctxs.go | 52 +- x/crosschain/types/cmd_cctxs_test.go | 129 ++++ x/crosschain/types/events.pb.go | 345 +++++++-- ...ssage_update_erc20_custody_pause_status.go | 53 ++ ..._update_erc20_custody_pause_status_test.go | 129 ++++ x/crosschain/types/tx.pb.go | 667 +++++++++++++++--- zetaclient/chains/evm/signer/signer_admin.go | 52 +- .../chains/evm/signer/signer_admin_test.go | 100 +++ 24 files changed, 2032 insertions(+), 162 deletions(-) create mode 100644 e2e/e2etests/test_pause_erc20_custody.go create mode 100644 x/crosschain/keeper/msg_server_update_erc20_custody_pause_status.go create mode 100644 x/crosschain/keeper/msg_server_update_erc20_custody_pause_status_test.go create mode 100644 x/crosschain/types/message_update_erc20_custody_pause_status.go create mode 100644 x/crosschain/types/message_update_erc20_custody_pause_status_test.go diff --git a/changelog.md b/changelog.md index f255139f81..e5cfb857b9 100644 --- a/changelog.md +++ b/changelog.md @@ -10,6 +10,7 @@ * [2634](https://github.com/zeta-chain/node/pull/2634) - add support for EIP-1559 gas fees * [2597](https://github.com/zeta-chain/node/pull/2597) - Add generic rpc metrics to zetaclient * [2538](https://github.com/zeta-chain/node/pull/2538) - add background worker routines to shutdown zetaclientd when needed for tss migration +* [2681](https://github.com/zeta-chain/node/pull/2681) - implement `MsgUpdateERC20CustodyPauseStatus` to pause or unpause ERC20 Custody contract (to be used for the migration process for smart contract V2) * [2644](https://github.com/zeta-chain/node/pull/2644) - add created_timestamp to cctx status ### Refactor diff --git a/cmd/zetae2e/local/local.go b/cmd/zetae2e/local/local.go index 521c53569e..2fdb61df17 100644 --- a/cmd/zetae2e/local/local.go +++ b/cmd/zetae2e/local/local.go @@ -296,14 +296,20 @@ func localE2ETest(cmd *cobra.Command, _ []string) { if testAdmin { eg.Go(adminTestRoutine(conf, deployerRunner, verbose, e2etests.TestWhitelistERC20Name, - e2etests.TestRateLimiterName, e2etests.TestPauseZRC20Name, e2etests.TestUpdateBytecodeZRC20Name, e2etests.TestUpdateBytecodeConnectorName, e2etests.TestDepositEtherLiquidityCapName, e2etests.TestCriticalAdminTransactionsName, + e2etests.TestPauseERC20CustodyName, e2etests.TestMigrateERC20CustodyFundsName, + // Test the rate limiter functionalities + // this test is currently incomplete and takes 10m to run + // TODO: define assertion, and make more optimized + // https://github.com/zeta-chain/node/issues/2090 + //e2etests.TestRateLimiterName, + // TestMigrateChainSupportName tests EVM chain migration. Currently this test doesn't work with Anvil because pre-EIP1559 txs are not supported // See issue below for details // TODO: renenable this test as per the issue below diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index 137c3d1205..5f431c557d 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -57242,6 +57242,11 @@ definitions: type: object crosschainMsgRemoveOutboundTrackerResponse: type: object + crosschainMsgUpdateERC20CustodyPauseStatusResponse: + type: object + properties: + cctx_index: + type: string crosschainMsgUpdateRateLimiterFlagsResponse: type: object crosschainMsgUpdateTssAddressResponse: diff --git a/docs/spec/crosschain/messages.md b/docs/spec/crosschain/messages.md index 0f032b2d34..0217520f62 100644 --- a/docs/spec/crosschain/messages.md +++ b/docs/spec/crosschain/messages.md @@ -286,3 +286,15 @@ message MsgMigrateERC20CustodyFunds { } ``` +## MsgUpdateERC20CustodyPauseStatus + +UpdateERC20CustodyPauseStatus creates a admin cmd cctx to update the pause status of the ERC20 custody contract + +```proto +message MsgUpdateERC20CustodyPauseStatus { + string creator = 1; + int64 chain_id = 2; + bool pause = 3; +} +``` + diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index 1115d7d6c2..7cf7b946ed 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -108,9 +108,9 @@ const ( TestUpdateBytecodeConnectorName = "update_bytecode_connector" TestRateLimiterName = "rate_limiter" TestCriticalAdminTransactionsName = "critical_admin_transactions" + TestPauseERC20CustodyName = "pause_erc20_custody" TestMigrateERC20CustodyFundsName = "migrate_erc20_custody_funds" - - TestMigrateTSSName = "migrate_TSS" + TestMigrateTSSName = "migrate_TSS" /* Special tests @@ -573,6 +573,12 @@ var AllE2ETests = []runner.E2ETest{ []runner.ArgDefinition{}, TestCriticalAdminTransactions, ), + runner.NewE2ETest( + TestPauseERC20CustodyName, + "pausing ERC20 custody on ZetaChain", + []runner.ArgDefinition{}, + TestPauseERC20Custody, + ), runner.NewE2ETest( TestMigrateERC20CustodyFundsName, "migrate ERC20 custody funds", diff --git a/e2e/e2etests/test_pause_erc20_custody.go b/e2e/e2etests/test_pause_erc20_custody.go new file mode 100644 index 0000000000..d39fbab512 --- /dev/null +++ b/e2e/e2etests/test_pause_erc20_custody.go @@ -0,0 +1,81 @@ +package e2etests + +import ( + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/stretchr/testify/require" + + "github.com/zeta-chain/zetacore/e2e/runner" + "github.com/zeta-chain/zetacore/e2e/txserver" + "github.com/zeta-chain/zetacore/e2e/utils" + crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types" +) + +// TestPauseERC20Custody tests the pausing and unpausing of ERC20 custody contracts on the EVM chain +func TestPauseERC20Custody(r *runner.E2ERunner, _ []string) { + // get EVM chain ID + chainID, err := r.EVMClient.ChainID(r.Ctx) + require.NoError(r, err) + + // check ERC20 custody contract is not paused + paused, err := r.ERC20Custody.Paused(&bind.CallOpts{}) + require.NoError(r, err) + require.False(r, paused) + + // Part 1: Pause ERC20 custody contract + + // send command for pausing ERC20 custody contract + msg := crosschaintypes.NewMsgUpdateERC20CustodyPauseStatus( + r.ZetaTxServer.MustGetAccountAddressFromName(utils.AdminPolicyName), + chainID.Int64(), + true, + ) + res, err := r.ZetaTxServer.BroadcastTx(utils.AdminPolicyName, msg) + require.NoError(r, err) + + // fetch cctx index from tx response + cctxIndex, err := txserver.FetchAttributeFromTxResponse(res, "cctx_index") + require.NoError(r, err) + + cctxRes, err := r.CctxClient.Cctx(r.Ctx, &crosschaintypes.QueryGetCctxRequest{Index: cctxIndex}) + require.NoError(r, err) + + cctx := cctxRes.CrossChainTx + r.Logger.CCTX(*cctx, "pausing") + + // wait for the cctx to be mined + r.WaitForMinedCCTXFromIndex(cctxIndex) + + // check ERC20 custody contract is paused + paused, err = r.ERC20Custody.Paused(&bind.CallOpts{}) + require.NoError(r, err) + require.True(r, paused) + + // Part 2: Unpause ERC20 custody contract + + // send command for unpausing ERC20 custody contract + msg = crosschaintypes.NewMsgUpdateERC20CustodyPauseStatus( + r.ZetaTxServer.MustGetAccountAddressFromName(utils.AdminPolicyName), + chainID.Int64(), + false, + ) + res, err = r.ZetaTxServer.BroadcastTx(utils.AdminPolicyName, msg) + require.NoError(r, err) + + // fetch cctx index from tx response + cctxIndex, err = txserver.FetchAttributeFromTxResponse(res, "cctx_index") + require.NoError(r, err) + + cctxRes, err = r.CctxClient.Cctx(r.Ctx, &crosschaintypes.QueryGetCctxRequest{Index: cctxIndex}) + require.NoError(r, err) + + cctx = cctxRes.CrossChainTx + r.Logger.CCTX(*cctx, "unpausing") + + // wait for the cctx to be mined + r.WaitForMinedCCTXFromIndex(cctxIndex) + + // check ERC20 custody contract is unpaused + paused, err = r.ERC20Custody.Paused(&bind.CallOpts{}) + require.NoError(r, err) + require.False(r, paused) +} diff --git a/pkg/constant/constant.go b/pkg/constant/constant.go index 57a922e5c0..9d524622ad 100644 --- a/pkg/constant/constant.go +++ b/pkg/constant/constant.go @@ -17,6 +17,9 @@ const ( // CmdMigrateERC20CustodyFunds is used for CCTX of type cmd to give the instruction to the TSS to transfer its funds on a new address CmdMigrateERC20CustodyFunds = "cmd_migrate_erc20_custody_funds" + // CmdUpdateERC20CustodyPauseStatus is used for CCTX of type cmd to give the instruction to the TSS to update the pause status of the ERC20 custody contract + CmdUpdateERC20CustodyPauseStatus = "cmd_update_erc20_custody_pause_status" + // CmdMigrateTssFunds is used for CCTX of type cmd to give the instruction to the TSS to transfer its funds on a new address CmdMigrateTssFunds = "cmd_migrate_tss_funds" @@ -28,4 +31,10 @@ const ( // The Solana protocol sets minimum rent exempt to 890880 lamports but we set it to 1_000_000 lamports (0.001 SOL) // The number 890880 comes from CLI command `solana rent 0` and has been verified on devnet gateway program SolanaWalletRentExempt = 1_000_000 + + // OptionPause is the argument used in CmdUpdateERC20CustodyPauseStatus to pause the ERC20 custody contract + OptionPause = "pause" + + // OptionUnpause is the argument used in CmdUpdateERC20CustodyPauseStatus to unpause the ERC20 custody contract + OptionUnpause = "unpause" ) diff --git a/proto/zetachain/zetacore/crosschain/events.proto b/proto/zetachain/zetacore/crosschain/events.proto index 5ec523d9e4..b39423fff4 100644 --- a/proto/zetachain/zetacore/crosschain/events.proto +++ b/proto/zetachain/zetacore/crosschain/events.proto @@ -75,3 +75,9 @@ message EventERC20CustodyFundsMigration { string amount = 3; string cctx_index = 4; } + +message EventERC20CustodyPausing { + int64 chain_id = 1; + bool pause = 2; + string cctx_index = 3; +} diff --git a/proto/zetachain/zetacore/crosschain/tx.proto b/proto/zetachain/zetacore/crosschain/tx.proto index 0cd0c8e1f5..e7a82a658f 100644 --- a/proto/zetachain/zetacore/crosschain/tx.proto +++ b/proto/zetachain/zetacore/crosschain/tx.proto @@ -36,6 +36,9 @@ service Msg { rpc MigrateERC20CustodyFunds(MsgMigrateERC20CustodyFunds) returns (MsgMigrateERC20CustodyFundsResponse); + + rpc UpdateERC20CustodyPauseStatus(MsgUpdateERC20CustodyPauseStatus) + returns (MsgUpdateERC20CustodyPauseStatusResponse); } message MsgMigrateTssFunds { @@ -204,3 +207,14 @@ message MsgMigrateERC20CustodyFunds { } message MsgMigrateERC20CustodyFundsResponse { string cctx_index = 1; } + +message MsgUpdateERC20CustodyPauseStatus { + string creator = 1; + int64 chain_id = 2; + + // pause or unpause + // true = pause, false = unpause + bool pause = 3; +} + +message MsgUpdateERC20CustodyPauseStatusResponse { string cctx_index = 1; } diff --git a/typescript/zetachain/zetacore/crosschain/events_pb.d.ts b/typescript/zetachain/zetacore/crosschain/events_pb.d.ts index c46555a9e3..83ad9499f6 100644 --- a/typescript/zetachain/zetacore/crosschain/events_pb.d.ts +++ b/typescript/zetachain/zetacore/crosschain/events_pb.d.ts @@ -393,3 +393,37 @@ export declare class EventERC20CustodyFundsMigration extends Message | undefined, b: EventERC20CustodyFundsMigration | PlainMessage | undefined): boolean; } +/** + * @generated from message zetachain.zetacore.crosschain.EventERC20CustodyPausing + */ +export declare class EventERC20CustodyPausing extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + /** + * @generated from field: bool pause = 2; + */ + pause: boolean; + + /** + * @generated from field: string cctx_index = 3; + */ + cctxIndex: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.EventERC20CustodyPausing"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventERC20CustodyPausing; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventERC20CustodyPausing; + + static fromJsonString(jsonString: string, options?: Partial): EventERC20CustodyPausing; + + static equals(a: EventERC20CustodyPausing | PlainMessage | undefined, b: EventERC20CustodyPausing | PlainMessage | undefined): boolean; +} + diff --git a/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts b/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts index 52d4b8aaa9..4069410e30 100644 --- a/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts +++ b/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts @@ -894,3 +894,64 @@ export declare class MsgMigrateERC20CustodyFundsResponse extends Message | undefined, b: MsgMigrateERC20CustodyFundsResponse | PlainMessage | undefined): boolean; } +/** + * @generated from message zetachain.zetacore.crosschain.MsgUpdateERC20CustodyPauseStatus + */ +export declare class MsgUpdateERC20CustodyPauseStatus extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * pause or unpause + * true = pause, false = unpause + * + * @generated from field: bool pause = 3; + */ + pause: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgUpdateERC20CustodyPauseStatus"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateERC20CustodyPauseStatus; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateERC20CustodyPauseStatus; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateERC20CustodyPauseStatus; + + static equals(a: MsgUpdateERC20CustodyPauseStatus | PlainMessage | undefined, b: MsgUpdateERC20CustodyPauseStatus | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgUpdateERC20CustodyPauseStatusResponse + */ +export declare class MsgUpdateERC20CustodyPauseStatusResponse extends Message { + /** + * @generated from field: string cctx_index = 1; + */ + cctxIndex: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgUpdateERC20CustodyPauseStatusResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateERC20CustodyPauseStatusResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateERC20CustodyPauseStatusResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateERC20CustodyPauseStatusResponse; + + static equals(a: MsgUpdateERC20CustodyPauseStatusResponse | PlainMessage | undefined, b: MsgUpdateERC20CustodyPauseStatusResponse | PlainMessage | undefined): boolean; +} + diff --git a/x/authority/types/authorization_list.go b/x/authority/types/authorization_list.go index 6d55a6770e..1437ed030c 100644 --- a/x/authority/types/authorization_list.go +++ b/x/authority/types/authorization_list.go @@ -23,6 +23,7 @@ var ( } // AdminPolicyMessages keeps track of the message URLs that can, by default, only be executed by admin policy address AdminPolicyMessages = []string{ + "/zetachain.zetacore.crosschain.MsgUpdateERC20CustodyPauseStatus", "/zetachain.zetacore.crosschain.MsgMigrateERC20CustodyFunds", "/zetachain.zetacore.crosschain.MsgMigrateTssFunds", "/zetachain.zetacore.crosschain.MsgUpdateTssAddress", diff --git a/x/authority/types/authorization_list_test.go b/x/authority/types/authorization_list_test.go index 2f45b3b2c4..4244e273fe 100644 --- a/x/authority/types/authorization_list_test.go +++ b/x/authority/types/authorization_list_test.go @@ -414,6 +414,7 @@ func TestDefaultAuthorizationsList(t *testing.T) { // AdminPolicyMessageList is a list of messages that can be authorized by the admin policy var AdminPolicyMessageList = []string{ + sdk.MsgTypeURL(&crosschaintypes.MsgUpdateERC20CustodyPauseStatus{}), sdk.MsgTypeURL(&crosschaintypes.MsgMigrateERC20CustodyFunds{}), sdk.MsgTypeURL(&crosschaintypes.MsgMigrateTssFunds{}), sdk.MsgTypeURL(&crosschaintypes.MsgUpdateTssAddress{}), diff --git a/x/crosschain/keeper/msg_server_migrate_erc20_custody_funds_test.go b/x/crosschain/keeper/msg_server_migrate_erc20_custody_funds_test.go index c68df89467..511ac5cdec 100644 --- a/x/crosschain/keeper/msg_server_migrate_erc20_custody_funds_test.go +++ b/x/crosschain/keeper/msg_server_migrate_erc20_custody_funds_test.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "github.com/zeta-chain/zetacore/pkg/coin" + "github.com/zeta-chain/zetacore/pkg/constant" testkeeper "github.com/zeta-chain/zetacore/testutil/keeper" "github.com/zeta-chain/zetacore/testutil/sample" authoritytypes "github.com/zeta-chain/zetacore/x/authority/types" @@ -58,6 +59,7 @@ func TestKeeper_MigrateERC20CustodyFunds(t *testing.T) { cctx, found := k.GetCrossChainTx(ctx, res.CctxIndex) require.True(t, found) require.Equal(t, coin.CoinType_Cmd, cctx.InboundParams.CoinType) + require.Contains(t, cctx.RelayedMessage, constant.CmdMigrateERC20CustodyFunds) require.Len(t, cctx.OutboundParams, 1) require.EqualValues( t, diff --git a/x/crosschain/keeper/msg_server_update_erc20_custody_pause_status.go b/x/crosschain/keeper/msg_server_update_erc20_custody_pause_status.go new file mode 100644 index 0000000000..4cda11f633 --- /dev/null +++ b/x/crosschain/keeper/msg_server_update_erc20_custody_pause_status.go @@ -0,0 +1,100 @@ +package keeper + +import ( + "context" + + errorsmod "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/crosschain/types" +) + +// UpdateERC20CustodyPauseStatus creates a admin cmd cctx to update the pause status of the ERC20 custody contract +func (k msgServer) UpdateERC20CustodyPauseStatus( + goCtx context.Context, + msg *types.MsgUpdateERC20CustodyPauseStatus, +) (*types.MsgUpdateERC20CustodyPauseStatusResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // check if authorized + err := k.GetAuthorityKeeper().CheckAuthorization(ctx, msg) + if err != nil { + return nil, errorsmod.Wrap(authoritytypes.ErrUnauthorized, err.Error()) + } + + // get the current TSS nonce allow to set a unique index for the CCTX + chainNonce, found := k.GetObserverKeeper().GetChainNonces(ctx, msg.ChainId) + if !found { + return nil, errorsmod.Wrap(types.ErrInvalidChainID, "cannot find current chain nonce") + } + currentNonce := chainNonce.Nonce + + // get the current TSS + tss, found := k.GetObserverKeeper().GetTSS(ctx) + if !found { + return nil, errorsmod.Wrap(types.ErrCannotFindTSSKeys, "cannot find current TSS") + } + + // get necessary parameters to create the cctx + params, found := k.zetaObserverKeeper.GetChainParamsByChainID(ctx, msg.ChainId) + if !found { + return nil, errorsmod.Wrapf(types.ErrInvalidChainID, "chain params not found for chain id (%d)", msg.ChainId) + } + medianGasPrice, priorityFee, isFound := k.GetMedianGasValues(ctx, msg.ChainId) + if !isFound { + return nil, errorsmod.Wrapf( + types.ErrUnableToGetGasPrice, + "median gas price not found for chain id (%d)", + msg.ChainId, + ) + } + + // overpays gas price by 2x + medianGasPrice = medianGasPrice.MulUint64(types.ERC20CustodyPausingGasMultiplierEVM) + priorityFee = priorityFee.MulUint64(types.ERC20CustodyPausingGasMultiplierEVM) + + // should not happen + if priorityFee.GT(medianGasPrice) { + return nil, errorsmod.Wrapf( + types.ErrInvalidGasAmount, + "priorityFee %s is greater than median gasPrice %s", + priorityFee.String(), + medianGasPrice.String(), + ) + } + + // create the CCTX that allows to sign the ERC20 custody pause status update + cctx := types.UpdateERC20CustodyPauseStatusCmdCCTX( + msg.Creator, + params.Erc20CustodyContractAddress, + msg.ChainId, + msg.Pause, + medianGasPrice.String(), + priorityFee.String(), + tss.TssPubkey, + currentNonce, + ) + + // save the cctx + err = k.SetObserverOutboundInfo(ctx, msg.ChainId, &cctx) + if err != nil { + return nil, err + } + k.SetCctxAndNonceToCctxAndInboundHashToCctx(ctx, cctx) + + err = ctx.EventManager().EmitTypedEvent( + &types.EventERC20CustodyPausing{ + ChainId: msg.ChainId, + Pause: msg.Pause, + CctxIndex: cctx.Index, + }, + ) + if err != nil { + return nil, errorsmod.Wrapf(err, "failed to emit event") + } + + return &types.MsgUpdateERC20CustodyPauseStatusResponse{ + CctxIndex: cctx.Index, + }, nil +} diff --git a/x/crosschain/keeper/msg_server_update_erc20_custody_pause_status_test.go b/x/crosschain/keeper/msg_server_update_erc20_custody_pause_status_test.go new file mode 100644 index 0000000000..a7b3db78bf --- /dev/null +++ b/x/crosschain/keeper/msg_server_update_erc20_custody_pause_status_test.go @@ -0,0 +1,322 @@ +package keeper_test + +import ( + "errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/pkg/coin" + "github.com/zeta-chain/zetacore/pkg/constant" + testkeeper "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/crosschain/keeper" + "github.com/zeta-chain/zetacore/x/crosschain/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" + "testing" +) + +func TestKeeper_UpdateERC20CustodyPauseStatus(t *testing.T) { + t.Run("can create CCTX to pause ERC20 custody pause status", func(t *testing.T) { + // ARRANGE + k, ctx, _, zk := testkeeper.CrosschainKeeperWithMocks(t, testkeeper.CrosschainMockOptions{ + UseAuthorityMock: true, + }) + + chainID := getValidEthChain().ChainId + msgServer := keeper.NewMsgServerImpl(*k) + tss := sample.Tss() + + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chainID, + Pause: true, + } + + // mock authority calls + authorityMock := testkeeper.GetCrosschainAuthorityMock(t, k) + testkeeper.MockCheckAuthorization(&authorityMock.Mock, &msg, nil) + + // set necessary values in observer + zk.ObserverKeeper.SetChainNonces(ctx, observertypes.ChainNonces{ChainId: chainID}) + zk.ObserverKeeper.SetPendingNonces(ctx, observertypes.PendingNonces{ChainId: chainID, Tss: tss.TssPubkey}) + zk.ObserverKeeper.SetTSS(ctx, tss) + zk.ObserverKeeper.SetChainParamsList(ctx, observertypes.ChainParamsList{ + ChainParams: []*observertypes.ChainParams{sample.ChainParamsSupported(chainID)}, + }) + k.SetGasPrice(ctx, sample.GasPriceWithChainID(t, chainID)) + medianGasPrice, priorityFee, isFound := k.GetMedianGasValues(ctx, msg.ChainId) + require.True(t, isFound) + + // ACT + res, err := msgServer.UpdateERC20CustodyPauseStatus(sdk.WrapSDKContext(ctx), &msg) + + // ASSERT + require.NoError(t, err) + + // check CCTX is created + cctx, found := k.GetCrossChainTx(ctx, res.CctxIndex) + require.True(t, found) + require.Equal(t, coin.CoinType_Cmd, cctx.InboundParams.CoinType) + require.Contains(t, cctx.RelayedMessage, constant.CmdUpdateERC20CustodyPauseStatus) + require.Len(t, cctx.OutboundParams, 1) + require.EqualValues( + t, + medianGasPrice.MulUint64(types.ERC20CustodyPausingGasMultiplierEVM).String(), + cctx.OutboundParams[0].GasPrice, + ) + require.EqualValues( + t, + priorityFee.MulUint64(types.ERC20CustodyPausingGasMultiplierEVM).String(), + cctx.OutboundParams[0].GasPriorityFee, + ) + }) + + t.Run("should fail if not authorized", func(t *testing.T) { + // ARRANGE + k, ctx, _, _ := testkeeper.CrosschainKeeperWithMocks(t, testkeeper.CrosschainMockOptions{ + UseAuthorityMock: true, + }) + + msgServer := keeper.NewMsgServerImpl(*k) + + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: getValidEthChain().ChainId, + Pause: true, + } + + // mock authority calls + authorityMock := testkeeper.GetCrosschainAuthorityMock(t, k) + testkeeper.MockCheckAuthorization(&authorityMock.Mock, &msg, errors.New("not authorized")) + + // ACT + _, err := msgServer.UpdateERC20CustodyPauseStatus(sdk.WrapSDKContext(ctx), &msg) + + // ASSERT + require.ErrorIs(t, err, authoritytypes.ErrUnauthorized) + }) + + t.Run("should fail if can't find chain nonces", func(t *testing.T) { + // ARRANGE + k, ctx, _, zk := testkeeper.CrosschainKeeperWithMocks(t, testkeeper.CrosschainMockOptions{ + UseAuthorityMock: true, + }) + + chainID := getValidEthChain().ChainId + msgServer := keeper.NewMsgServerImpl(*k) + tss := sample.Tss() + + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chainID, + Pause: true, + } + + // mock authority calls + authorityMock := testkeeper.GetCrosschainAuthorityMock(t, k) + testkeeper.MockCheckAuthorization(&authorityMock.Mock, &msg, nil) + + // set necessary values in observer + //zk.ObserverKeeper.SetChainNonces(ctx, observertypes.ChainNonces{ChainId: chainID}) // not set + zk.ObserverKeeper.SetPendingNonces(ctx, observertypes.PendingNonces{ChainId: chainID, Tss: tss.TssPubkey}) + zk.ObserverKeeper.SetTSS(ctx, tss) + zk.ObserverKeeper.SetChainParamsList(ctx, observertypes.ChainParamsList{ + ChainParams: []*observertypes.ChainParams{sample.ChainParamsSupported(chainID)}, + }) + k.SetGasPrice(ctx, sample.GasPriceWithChainID(t, chainID)) + + // ACT + _, err := msgServer.UpdateERC20CustodyPauseStatus(sdk.WrapSDKContext(ctx), &msg) + + // ASSERT + require.ErrorIs(t, err, types.ErrInvalidChainID) + }) + + t.Run("should fail if can't find current TSS", func(t *testing.T) { + // ARRANGE + k, ctx, _, zk := testkeeper.CrosschainKeeperWithMocks(t, testkeeper.CrosschainMockOptions{ + UseAuthorityMock: true, + }) + + chainID := getValidEthChain().ChainId + msgServer := keeper.NewMsgServerImpl(*k) + tss := sample.Tss() + + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chainID, + Pause: true, + } + + // mock authority calls + authorityMock := testkeeper.GetCrosschainAuthorityMock(t, k) + testkeeper.MockCheckAuthorization(&authorityMock.Mock, &msg, nil) + + // set necessary values in observer + zk.ObserverKeeper.SetChainNonces(ctx, observertypes.ChainNonces{ChainId: chainID}) + zk.ObserverKeeper.SetPendingNonces(ctx, observertypes.PendingNonces{ChainId: chainID, Tss: tss.TssPubkey}) + //zk.ObserverKeeper.SetTSS(ctx, tss) // not set + zk.ObserverKeeper.SetChainParamsList(ctx, observertypes.ChainParamsList{ + ChainParams: []*observertypes.ChainParams{sample.ChainParamsSupported(chainID)}, + }) + k.SetGasPrice(ctx, sample.GasPriceWithChainID(t, chainID)) + + // ACT + _, err := msgServer.UpdateERC20CustodyPauseStatus(sdk.WrapSDKContext(ctx), &msg) + + // ASSERT + require.ErrorIs(t, err, types.ErrCannotFindTSSKeys) + }) + + t.Run("should fail if can't find chain params", func(t *testing.T) { + // ARRANGE + k, ctx, _, zk := testkeeper.CrosschainKeeperWithMocks(t, testkeeper.CrosschainMockOptions{ + UseAuthorityMock: true, + }) + + chainID := getValidEthChain().ChainId + msgServer := keeper.NewMsgServerImpl(*k) + tss := sample.Tss() + + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chainID, + Pause: true, + } + + // mock authority calls + authorityMock := testkeeper.GetCrosschainAuthorityMock(t, k) + testkeeper.MockCheckAuthorization(&authorityMock.Mock, &msg, nil) + + // set necessary values in observer + zk.ObserverKeeper.SetChainNonces(ctx, observertypes.ChainNonces{ChainId: chainID}) + zk.ObserverKeeper.SetPendingNonces(ctx, observertypes.PendingNonces{ChainId: chainID, Tss: tss.TssPubkey}) + zk.ObserverKeeper.SetTSS(ctx, tss) + zk.ObserverKeeper.SetChainParamsList(ctx, observertypes.ChainParamsList{}) // not set + k.SetGasPrice(ctx, sample.GasPriceWithChainID(t, chainID)) + + // ACT + _, err := msgServer.UpdateERC20CustodyPauseStatus(sdk.WrapSDKContext(ctx), &msg) + + // ASSERT + require.ErrorIs(t, err, types.ErrInvalidChainID) + }) + + t.Run("should fail if can't find gas price", func(t *testing.T) { + // ARRANGE + k, ctx, _, zk := testkeeper.CrosschainKeeperWithMocks(t, testkeeper.CrosschainMockOptions{ + UseAuthorityMock: true, + }) + + chainID := getValidEthChain().ChainId + msgServer := keeper.NewMsgServerImpl(*k) + tss := sample.Tss() + + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chainID, + Pause: true, + } + + // mock authority calls + authorityMock := testkeeper.GetCrosschainAuthorityMock(t, k) + testkeeper.MockCheckAuthorization(&authorityMock.Mock, &msg, nil) + + // set necessary values in observer + zk.ObserverKeeper.SetChainNonces(ctx, observertypes.ChainNonces{ChainId: chainID}) + zk.ObserverKeeper.SetPendingNonces(ctx, observertypes.PendingNonces{ChainId: chainID, Tss: tss.TssPubkey}) + zk.ObserverKeeper.SetTSS(ctx, tss) + zk.ObserverKeeper.SetChainParamsList(ctx, observertypes.ChainParamsList{ + ChainParams: []*observertypes.ChainParams{sample.ChainParamsSupported(chainID)}, + }) + //k.SetGasPrice(ctx, sample.GasPriceWithChainID(t, chainID)) // not set + + // ACT + _, err := msgServer.UpdateERC20CustodyPauseStatus(sdk.WrapSDKContext(ctx), &msg) + + // ASSERT + require.ErrorIs(t, err, types.ErrUnableToGetGasPrice) + }) + + t.Run("should fail if priority fees higher than gas price", func(t *testing.T) { + // ARRANGE + k, ctx, _, zk := testkeeper.CrosschainKeeperWithMocks(t, testkeeper.CrosschainMockOptions{ + UseAuthorityMock: true, + }) + + chainID := getValidEthChain().ChainId + msgServer := keeper.NewMsgServerImpl(*k) + tss := sample.Tss() + + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chainID, + Pause: true, + } + + // mock authority calls + authorityMock := testkeeper.GetCrosschainAuthorityMock(t, k) + testkeeper.MockCheckAuthorization(&authorityMock.Mock, &msg, nil) + + // set necessary values in observer + zk.ObserverKeeper.SetChainNonces(ctx, observertypes.ChainNonces{ChainId: chainID}) + zk.ObserverKeeper.SetPendingNonces(ctx, observertypes.PendingNonces{ChainId: chainID, Tss: tss.TssPubkey}) + zk.ObserverKeeper.SetTSS(ctx, tss) + zk.ObserverKeeper.SetChainParamsList(ctx, observertypes.ChainParamsList{ + ChainParams: []*observertypes.ChainParams{sample.ChainParamsSupported(chainID)}, + }) + k.SetGasPrice(ctx, types.GasPrice{ + Creator: sample.AccAddress(), + ChainId: chainID, + Signers: []string{sample.AccAddress()}, + BlockNums: []uint64{42}, + Prices: []uint64{42}, + PriorityFees: []uint64{43}, + MedianIndex: 0, + }) + + // ACT + _, err := msgServer.UpdateERC20CustodyPauseStatus(sdk.WrapSDKContext(ctx), &msg) + + // ASSERT + require.ErrorIs(t, err, types.ErrInvalidGasAmount) + }) + + t.Run("should fail if can't set outbound info", func(t *testing.T) { + // ARRANGE + k, ctx, _, zk := testkeeper.CrosschainKeeperWithMocks(t, testkeeper.CrosschainMockOptions{ + UseAuthorityMock: true, + }) + + chainID := getValidEthChain().ChainId + msgServer := keeper.NewMsgServerImpl(*k) + tss := sample.Tss() + + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chainID, + Pause: true, + } + + // mock authority calls + authorityMock := testkeeper.GetCrosschainAuthorityMock(t, k) + testkeeper.MockCheckAuthorization(&authorityMock.Mock, &msg, nil) + + // set necessary values in observer + zk.ObserverKeeper.SetChainNonces(ctx, observertypes.ChainNonces{ChainId: chainID}) + zk.ObserverKeeper.SetPendingNonces(ctx, observertypes.PendingNonces{ChainId: chainID, Tss: tss.TssPubkey}) + zk.ObserverKeeper.SetTSS(ctx, tss) + zk.ObserverKeeper.SetChainParamsList(ctx, observertypes.ChainParamsList{ + ChainParams: []*observertypes.ChainParams{ + sample.ChainParams(chainID), + }, // set non supported chain params to fail + }) + k.SetGasPrice(ctx, sample.GasPriceWithChainID(t, chainID)) + + // ACT + _, err := msgServer.UpdateERC20CustodyPauseStatus(sdk.WrapSDKContext(ctx), &msg) + + // ASSERT + require.ErrorIs(t, err, observertypes.ErrSupportedChains) + }) +} diff --git a/x/crosschain/types/cmd_cctxs.go b/x/crosschain/types/cmd_cctxs.go index 51d4eaa9de..3f416c6d7d 100644 --- a/x/crosschain/types/cmd_cctxs.go +++ b/x/crosschain/types/cmd_cctxs.go @@ -29,6 +29,9 @@ const ( // ERC20CustodyWhitelistGasMultiplierEVM is multiplied to the median gas price to get the gas price for the erc20 custody whitelist ERC20CustodyWhitelistGasMultiplierEVM = 2 + + // ERC20CustodyPausingGasMultiplierEVM is multiplied to the median gas price to get the gas price for the erc20 custody pausing + ERC20CustodyPausingGasMultiplierEVM = 2 ) // MigrateERC20CustodyFundsCmdCCTX returns a CCTX allowing to migrate ERC20 custody funds @@ -44,7 +47,7 @@ func MigrateERC20CustodyFundsCmdCCTX( tssPubKey string, currentNonce uint64, ) CrossChainTx { - indexString := GetERC20CustodyMigrationCCTXIndexString(tssPubKey, currentNonce, erc20Address) + indexString := GetERC20CustodyMigrationCCTXIndexString(tssPubKey, currentNonce, chainID, erc20Address) hash := crypto.Keccak256Hash([]byte(indexString)) return newCmdCCTX( @@ -73,9 +76,54 @@ func MigrateERC20CustodyFundsCmdCCTX( func GetERC20CustodyMigrationCCTXIndexString( tssPubKey string, nonce uint64, + chainID int64, erc20Address string, ) string { - return fmt.Sprintf("%s-%d-%s", tssPubKey, nonce, erc20Address) + return fmt.Sprintf("%s-%s-%d-%d-%s", constant.CmdMigrateERC20CustodyFunds, tssPubKey, nonce, chainID, erc20Address) +} + +// UpdateERC20CustodyPauseStatusCmdCCTX returns a CCTX allowing to update the pause status of the ERC20 custody contract +func UpdateERC20CustodyPauseStatusCmdCCTX( + creator string, + custodyContractAddress string, + chainID int64, + pause bool, + gasPrice string, + priorityFee string, + tssPubKey string, + currentNonce uint64, +) CrossChainTx { + indexString := GetERC20CustodyPausingCmdCCTXIndexString(tssPubKey, currentNonce, chainID) + hash := crypto.Keccak256Hash([]byte(indexString)) + + params := constant.OptionUnpause + if pause { + params = constant.OptionPause + } + + return newCmdCCTX( + creator, + hash.Hex(), + fmt.Sprintf("%s:%s", constant.CmdUpdateERC20CustodyPauseStatus, params), + creator, + hash.Hex(), + custodyContractAddress, + chainID, + sdkmath.NewUint(0), + 100_000, + gasPrice, + priorityFee, + tssPubKey, + ) +} + +// GetERC20CustodyPausingCmdCCTXIndexString returns the index string of the CCTX for updating the pause status of the ERC20 custody contract +func GetERC20CustodyPausingCmdCCTXIndexString( + tssPubKey string, + nonce uint64, + chainID int64, +) string { + return fmt.Sprintf("%s-%s-%d-%d", constant.CmdUpdateERC20CustodyPauseStatus, tssPubKey, nonce, chainID) } // WhitelistERC20CmdCCTX returns a CCTX allowing to whitelist an ERC20 token on an external chain diff --git a/x/crosschain/types/cmd_cctxs_test.go b/x/crosschain/types/cmd_cctxs_test.go index d2a21300e2..56fc205048 100644 --- a/x/crosschain/types/cmd_cctxs_test.go +++ b/x/crosschain/types/cmd_cctxs_test.go @@ -110,35 +110,164 @@ func TestGetERC20CustodyMigrationCCTXIndexString(t *testing.T) { // ARRANGE tssPubKey := sample.PubKeyString() nonce := uint64(1) + chainID := int64(42) erc20Address := sample.EthAddress().String() // ACT index := types.GetERC20CustodyMigrationCCTXIndexString( tssPubKey, nonce, + chainID, erc20Address, ) indexDifferentTSSPubkey := types.GetERC20CustodyMigrationCCTXIndexString( sample.PubKeyString(), nonce, + chainID, erc20Address, ) indexDifferentNonce := types.GetERC20CustodyMigrationCCTXIndexString( tssPubKey, nonce+1, + chainID, erc20Address, ) indexDifferentERC20Address := types.GetERC20CustodyMigrationCCTXIndexString( tssPubKey, nonce, + chainID, sample.EthAddress().String(), ) + indexDifferentChainID := types.GetERC20CustodyMigrationCCTXIndexString( + tssPubKey, + nonce, + chainID+1, + erc20Address, + ) // ASSERT require.NotEmpty(t, index) require.NotEqual(t, index, indexDifferentTSSPubkey) require.NotEqual(t, index, indexDifferentNonce) require.NotEqual(t, index, indexDifferentERC20Address) + require.NotEqual(t, index, indexDifferentChainID) + }) +} + +func TestUpdateERC20CustodyPauseStatusCmdCCTX(t *testing.T) { + t.Run("returns a new CCTX to pause ERC20Custody", func(t *testing.T) { + // ARRANGE + creator := sample.AccAddress() + custodyContractAddress := sample.EthAddress().String() + chainID := int64(42) + gasPrice := "100000" + priorityFee := "100000" + tssPubKey := sample.PubKeyString() + currentNonce := uint64(1) + + // ACT + cctx := types.UpdateERC20CustodyPauseStatusCmdCCTX( + creator, + custodyContractAddress, + chainID, + true, + gasPrice, + priorityFee, + tssPubKey, + currentNonce, + ) + cctxDifferentNonce := types.UpdateERC20CustodyPauseStatusCmdCCTX( + creator, + custodyContractAddress, + chainID, + true, + gasPrice, + priorityFee, + tssPubKey, + currentNonce+1, + ) + cctxDifferentTSSPubkey := types.UpdateERC20CustodyPauseStatusCmdCCTX( + creator, + custodyContractAddress, + chainID, + true, + gasPrice, + priorityFee, + sample.PubKeyString(), + currentNonce, + ) + cctxDifferentChainID := types.UpdateERC20CustodyPauseStatusCmdCCTX( + creator, + custodyContractAddress, + chainID+1, + true, + gasPrice, + priorityFee, + tssPubKey, + currentNonce, + ) + + // ASSERT + require.NotEmpty(t, cctx.Index) + require.EqualValues(t, creator, cctx.Creator) + require.EqualValues(t, types.CctxStatus_PendingOutbound, cctx.CctxStatus.Status) + require.EqualValues(t, fmt.Sprintf("%s:%s", + constant.CmdUpdateERC20CustodyPauseStatus, + constant.OptionPause, + ), cctx.RelayedMessage) + require.EqualValues(t, creator, cctx.InboundParams.Sender) + require.EqualValues(t, coin.CoinType_Cmd, cctx.InboundParams.CoinType) + require.Len(t, cctx.OutboundParams, 1) + require.EqualValues(t, custodyContractAddress, cctx.OutboundParams[0].Receiver) + require.EqualValues(t, chainID, cctx.OutboundParams[0].ReceiverChainId) + require.EqualValues(t, coin.CoinType_Cmd, cctx.OutboundParams[0].CoinType) + require.EqualValues(t, sdkmath.NewUint(0), cctx.OutboundParams[0].Amount) + require.EqualValues(t, 100_000, cctx.OutboundParams[0].GasLimit) + require.EqualValues(t, gasPrice, cctx.OutboundParams[0].GasPrice) + require.EqualValues(t, priorityFee, cctx.OutboundParams[0].GasPriorityFee) + require.EqualValues(t, tssPubKey, cctx.OutboundParams[0].TssPubkey) + + // check erc20, TSS pubkey and nonce produce unique index + require.NotEqual(t, cctx.Index, cctxDifferentNonce.Index) + require.NotEqual(t, cctx.Index, cctxDifferentTSSPubkey.Index) + require.NotEqual(t, cctx.Index, cctxDifferentChainID.Index) + }) +} + +func TestGetERC20CustodyPausingCmdCCTXIndecString(t *testing.T) { + t.Run("returns the unique index string for the CCTX for updating ERC20 custody pause status", func(t *testing.T) { + // ARRANGE + tssPubKey := sample.PubKeyString() + nonce := uint64(1) + chainID := int64(42) + + // ACT + index := types.GetERC20CustodyPausingCmdCCTXIndexString( + tssPubKey, + nonce, + chainID, + ) + indexDifferentTSSPubkey := types.GetERC20CustodyPausingCmdCCTXIndexString( + sample.PubKeyString(), + nonce, + chainID, + ) + indexDifferentNonce := types.GetERC20CustodyPausingCmdCCTXIndexString( + tssPubKey, + nonce+1, + chainID, + ) + indexDifferentChainID := types.GetERC20CustodyPausingCmdCCTXIndexString( + tssPubKey, + nonce, + chainID+1, + ) + + // ASSERT + require.NotEmpty(t, index) + require.NotEqual(t, index, indexDifferentTSSPubkey) + require.NotEqual(t, index, indexDifferentNonce) + require.NotEqual(t, index, indexDifferentChainID) }) } diff --git a/x/crosschain/types/events.pb.go b/x/crosschain/types/events.pb.go index 133b88f884..05751c4336 100644 --- a/x/crosschain/types/events.pb.go +++ b/x/crosschain/types/events.pb.go @@ -687,6 +687,66 @@ func (m *EventERC20CustodyFundsMigration) GetCctxIndex() string { return "" } +type EventERC20CustodyPausing struct { + ChainId int64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Pause bool `protobuf:"varint,2,opt,name=pause,proto3" json:"pause,omitempty"` + CctxIndex string `protobuf:"bytes,3,opt,name=cctx_index,json=cctxIndex,proto3" json:"cctx_index,omitempty"` +} + +func (m *EventERC20CustodyPausing) Reset() { *m = EventERC20CustodyPausing{} } +func (m *EventERC20CustodyPausing) String() string { return proto.CompactTextString(m) } +func (*EventERC20CustodyPausing) ProtoMessage() {} +func (*EventERC20CustodyPausing) Descriptor() ([]byte, []int) { + return fileDescriptor_dd08b628129fa2e1, []int{8} +} +func (m *EventERC20CustodyPausing) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventERC20CustodyPausing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventERC20CustodyPausing.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 *EventERC20CustodyPausing) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventERC20CustodyPausing.Merge(m, src) +} +func (m *EventERC20CustodyPausing) XXX_Size() int { + return m.Size() +} +func (m *EventERC20CustodyPausing) XXX_DiscardUnknown() { + xxx_messageInfo_EventERC20CustodyPausing.DiscardUnknown(m) +} + +var xxx_messageInfo_EventERC20CustodyPausing proto.InternalMessageInfo + +func (m *EventERC20CustodyPausing) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *EventERC20CustodyPausing) GetPause() bool { + if m != nil { + return m.Pause + } + return false +} + +func (m *EventERC20CustodyPausing) GetCctxIndex() string { + if m != nil { + return m.CctxIndex + } + return "" +} + func init() { proto.RegisterType((*EventInboundFinalized)(nil), "zetachain.zetacore.crosschain.EventInboundFinalized") proto.RegisterType((*EventZrcWithdrawCreated)(nil), "zetachain.zetacore.crosschain.EventZrcWithdrawCreated") @@ -696,6 +756,7 @@ func init() { proto.RegisterType((*EventCCTXGasPriceIncreased)(nil), "zetachain.zetacore.crosschain.EventCCTXGasPriceIncreased") proto.RegisterType((*EventERC20Whitelist)(nil), "zetachain.zetacore.crosschain.EventERC20Whitelist") proto.RegisterType((*EventERC20CustodyFundsMigration)(nil), "zetachain.zetacore.crosschain.EventERC20CustodyFundsMigration") + proto.RegisterType((*EventERC20CustodyPausing)(nil), "zetachain.zetacore.crosschain.EventERC20CustodyPausing") } func init() { @@ -703,54 +764,57 @@ func init() { } var fileDescriptor_dd08b628129fa2e1 = []byte{ - // 752 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x95, 0x41, 0x4f, 0xdb, 0x48, - 0x14, 0xc7, 0x31, 0x24, 0x21, 0x19, 0x92, 0xec, 0xae, 0xc9, 0xee, 0x7a, 0x91, 0xc8, 0x42, 0x56, - 0xab, 0x5d, 0xad, 0xb6, 0x81, 0xd2, 0x4f, 0x50, 0x22, 0x28, 0xa8, 0x42, 0x54, 0x40, 0x45, 0xc5, - 0xc5, 0x9a, 0x78, 0x5e, 0xed, 0x51, 0x9d, 0x99, 0x68, 0x66, 0x4c, 0x12, 0x3e, 0x45, 0xd5, 0xef, - 0xd1, 0x4b, 0xa5, 0xde, 0xfa, 0x01, 0x7a, 0xe4, 0xd8, 0x63, 0x45, 0xbe, 0x48, 0x35, 0x33, 0x76, - 0x48, 0x1c, 0xd4, 0x1e, 0xaa, 0x56, 0xea, 0xcd, 0xf3, 0x7f, 0x6f, 0xde, 0xfb, 0xcd, 0xff, 0xd9, - 0x1e, 0xf4, 0xdf, 0x15, 0x28, 0x1c, 0x44, 0x98, 0xb2, 0x2d, 0xf3, 0xc4, 0x05, 0x6c, 0x05, 0x82, - 0x4b, 0x69, 0x35, 0xb8, 0x04, 0xa6, 0x64, 0xbb, 0x2f, 0xb8, 0xe2, 0xee, 0xfa, 0x24, 0xb7, 0x9d, - 0xe5, 0xb6, 0x6f, 0x73, 0xd7, 0x1a, 0x21, 0x0f, 0xb9, 0xc9, 0xdc, 0xd2, 0x4f, 0x76, 0x53, 0x6b, - 0xbc, 0x84, 0x7e, 0xdd, 0xd3, 0x55, 0x0e, 0x59, 0x97, 0x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3, 0xe6, 0xc2, 0xf5, - 0xb8, 0xb9, 0xf0, 0x61, 0xdc, 0x5c, 0xb8, 0xb8, 0x1f, 0x52, 0x15, 0x25, 0xdd, 0x76, 0xc0, 0x7b, - 0xe6, 0xfe, 0xbd, 0x97, 0xbb, 0x8a, 0x87, 0xd3, 0x97, 0xb1, 0x7e, 0x31, 0x65, 0xb7, 0x64, 0xee, - 0xd5, 0x07, 0x9f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x99, 0x3d, 0xe9, 0xec, 0xba, 0x07, 0x00, 0x00, + // 789 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x95, 0xcd, 0x6e, 0xeb, 0x44, + 0x14, 0xc7, 0xeb, 0x9b, 0xef, 0xb9, 0x49, 0x00, 0xdf, 0x00, 0xa6, 0x52, 0xc3, 0xbd, 0x41, 0x08, + 0x84, 0x20, 0x2d, 0xe5, 0x09, 0x68, 0xd4, 0xd2, 0x08, 0x55, 0xad, 0xd2, 0xa2, 0xa2, 0x6e, 0x46, + 0x13, 0xcf, 0xc1, 0x1e, 0x70, 0xc6, 0xd1, 0xcc, 0xb8, 0x49, 0xfa, 0x14, 0x88, 0xf7, 0x60, 0x83, + 0xc4, 0x8e, 0x07, 0x60, 0xd9, 0x25, 0x4b, 0xd4, 0xbc, 0x08, 0x9a, 0x0f, 0xa7, 0x89, 0x53, 0xc1, + 0x02, 0x81, 0x74, 0x77, 0x3e, 0xff, 0x73, 0x3c, 0xe7, 0x37, 0xff, 0xe3, 0xf1, 0xa0, 0x4f, 0xee, + 0x40, 0x91, 0x30, 0x26, 0x8c, 0xef, 0x9b, 0xa7, 0x54, 0xc0, 0x7e, 0x28, 0x52, 0x29, 0xad, 0x06, + 0xb7, 0xc0, 0x95, 0xec, 0x4f, 0x45, 0xaa, 0x52, 0x7f, 0x6f, 0x55, 0xdb, 0xcf, 0x6b, 0xfb, 0x8f, + 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xb6, 0xbb, 0x72, 0xc1, 0xf4, 0xde, 0xf7, 0xee, 0x9c, 0xaf, 0xe3, + 0x5e, 0x90, 0x4c, 0x32, 0x1e, 0xe9, 0xcb, 0xca, 0xfc, 0x59, 0x30, 0xa3, 0x06, 0xae, 0x34, 0xaa, + 0x99, 0x78, 0x48, 0xf5, 0x65, 0x35, 0x25, 0x99, 0x1b, 0x4f, 0x7d, 0x64, 0x83, 0x42, 0xaf, 0x52, + 0xa1, 0xd7, 0xd1, 0xd7, 0xbf, 0x3f, 0x74, 0xbd, 0xfb, 0x87, 0xae, 0xf7, 0xe7, 0x43, 0xd7, 0xfb, + 0x71, 0xd9, 0xdd, 0xb9, 0x5f, 0x76, 0x77, 0xfe, 0x58, 0x76, 0x77, 0x6e, 0x3e, 0x8f, 0x98, 0x8a, + 0xb3, 0x71, 0x3f, 0x4c, 0x27, 0xe6, 0xae, 0xff, 0xac, 0x70, 0xed, 0xcf, 0xd7, 0x2f, 0x7e, 0x7d, + 0x08, 0xe4, 0xb8, 0x6a, 0xee, 0xf0, 0x2f, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x0c, 0xc2, 0xaf, + 0xdb, 0x26, 0x08, 0x00, 0x00, } func (m *EventInboundFinalized) Marshal() (dAtA []byte, err error) { @@ -1266,6 +1330,51 @@ func (m *EventERC20CustodyFundsMigration) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } +func (m *EventERC20CustodyPausing) 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 *EventERC20CustodyPausing) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventERC20CustodyPausing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CctxIndex) > 0 { + i -= len(m.CctxIndex) + copy(dAtA[i:], m.CctxIndex) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CctxIndex))) + i-- + dAtA[i] = 0x1a + } + if m.Pause { + i-- + if m.Pause { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.ChainId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -1537,6 +1646,25 @@ func (m *EventERC20CustodyFundsMigration) Size() (n int) { return n } +func (m *EventERC20CustodyPausing) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovEvents(uint64(m.ChainId)) + } + if m.Pause { + n += 2 + } + l = len(m.CctxIndex) + 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 } @@ -3447,6 +3575,127 @@ func (m *EventERC20CustodyFundsMigration) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventERC20CustodyPausing) 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: EventERC20CustodyPausing: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventERC20CustodyPausing: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pause", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Pause = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CctxIndex", 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.CctxIndex = 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/crosschain/types/message_update_erc20_custody_pause_status.go b/x/crosschain/types/message_update_erc20_custody_pause_status.go new file mode 100644 index 0000000000..fd45fd30db --- /dev/null +++ b/x/crosschain/types/message_update_erc20_custody_pause_status.go @@ -0,0 +1,53 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeUpdateERC20CustodyPauseStatus = "UpdateERC20CustodyPauseStatus" + +var _ sdk.Msg = &MsgUpdateERC20CustodyPauseStatus{} + +func NewMsgUpdateERC20CustodyPauseStatus( + creator string, + chainID int64, + pause bool, +) *MsgUpdateERC20CustodyPauseStatus { + return &MsgUpdateERC20CustodyPauseStatus{ + Creator: creator, + ChainId: chainID, + Pause: pause, + } +} + +func (msg *MsgUpdateERC20CustodyPauseStatus) Route() string { + return RouterKey +} + +func (msg *MsgUpdateERC20CustodyPauseStatus) Type() string { + return TypeUpdateERC20CustodyPauseStatus +} + +func (msg *MsgUpdateERC20CustodyPauseStatus) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgUpdateERC20CustodyPauseStatus) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdateERC20CustodyPauseStatus) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + + return nil +} diff --git a/x/crosschain/types/message_update_erc20_custody_pause_status_test.go b/x/crosschain/types/message_update_erc20_custody_pause_status_test.go new file mode 100644 index 0000000000..26842b4e0b --- /dev/null +++ b/x/crosschain/types/message_update_erc20_custody_pause_status_test.go @@ -0,0 +1,129 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/zeta-chain/zetacore/pkg/chains" + "github.com/zeta-chain/zetacore/testutil/keeper" + "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/crosschain/types" +) + +func TestNewMsgUpdateERC20CustodyPauseStatus_ValidateBasic(t *testing.T) { + keeper.SetConfig(false) + tests := []struct { + name string + msg *types.MsgUpdateERC20CustodyPauseStatus + error bool + }{ + { + name: "invalid creator", + msg: types.NewMsgUpdateERC20CustodyPauseStatus( + "invalid address", + chains.DefaultChainsList()[0].ChainId, + true, + ), + error: true, + }, + { + name: "valid msg", + msg: types.NewMsgUpdateERC20CustodyPauseStatus( + sample.AccAddress(), + chains.DefaultChainsList()[0].ChainId, + true, + ), + }, + { + name: "valid msg with pause false", + msg: types.NewMsgUpdateERC20CustodyPauseStatus( + sample.AccAddress(), + chains.DefaultChainsList()[0].ChainId, + false, + ), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.error { + require.Error(t, err) + return + } else { + require.NoError(t, err) + } + }) + } +} + +func TestMsgUpdateERC20CustodyPauseStatus_GetSigners(t *testing.T) { + signer := sample.AccAddress() + tests := []struct { + name string + msg types.MsgUpdateERC20CustodyPauseStatus + panics bool + }{ + { + name: "valid signer", + msg: types.MsgUpdateERC20CustodyPauseStatus{ + Creator: signer, + ChainId: chains.DefaultChainsList()[0].ChainId, + Pause: true, + }, + panics: false, + }, + { + name: "invalid signer", + msg: types.MsgUpdateERC20CustodyPauseStatus{ + Creator: "invalid_address", + ChainId: chains.DefaultChainsList()[0].ChainId, + Pause: true, + }, + 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 TestMsgUpdateERC20CustodyPauseStatus_Type(t *testing.T) { + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chains.DefaultChainsList()[0].ChainId, + Pause: true, + } + require.Equal(t, types.TypeUpdateERC20CustodyPauseStatus, msg.Type()) +} + +func TestMsgUpdateERC20CustodyPauseStatus_Route(t *testing.T) { + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chains.DefaultChainsList()[0].ChainId, + Pause: true, + } + require.Equal(t, types.RouterKey, msg.Route()) +} + +func TestMsgUpdateERC20CustodyPauseStatus_GetSignBytes(t *testing.T) { + msg := types.MsgUpdateERC20CustodyPauseStatus{ + Creator: sample.AccAddress(), + ChainId: chains.DefaultChainsList()[0].ChainId, + Pause: true, + } + require.NotPanics(t, func() { + msg.GetSignBytes() + }) +} diff --git a/x/crosschain/types/tx.pb.go b/x/crosschain/types/tx.pb.go index 55be051cae..e5c9f99bab 100644 --- a/x/crosschain/types/tx.pb.go +++ b/x/crosschain/types/tx.pb.go @@ -1544,6 +1544,114 @@ func (m *MsgMigrateERC20CustodyFundsResponse) GetCctxIndex() string { return "" } +type MsgUpdateERC20CustodyPauseStatus struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + ChainId int64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // pause or unpause + // true = pause, false = unpause + Pause bool `protobuf:"varint,3,opt,name=pause,proto3" json:"pause,omitempty"` +} + +func (m *MsgUpdateERC20CustodyPauseStatus) Reset() { *m = MsgUpdateERC20CustodyPauseStatus{} } +func (m *MsgUpdateERC20CustodyPauseStatus) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateERC20CustodyPauseStatus) ProtoMessage() {} +func (*MsgUpdateERC20CustodyPauseStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_15f0860550897740, []int{26} +} +func (m *MsgUpdateERC20CustodyPauseStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateERC20CustodyPauseStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateERC20CustodyPauseStatus.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 *MsgUpdateERC20CustodyPauseStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateERC20CustodyPauseStatus.Merge(m, src) +} +func (m *MsgUpdateERC20CustodyPauseStatus) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateERC20CustodyPauseStatus) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateERC20CustodyPauseStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateERC20CustodyPauseStatus proto.InternalMessageInfo + +func (m *MsgUpdateERC20CustodyPauseStatus) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateERC20CustodyPauseStatus) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *MsgUpdateERC20CustodyPauseStatus) GetPause() bool { + if m != nil { + return m.Pause + } + return false +} + +type MsgUpdateERC20CustodyPauseStatusResponse struct { + CctxIndex string `protobuf:"bytes,1,opt,name=cctx_index,json=cctxIndex,proto3" json:"cctx_index,omitempty"` +} + +func (m *MsgUpdateERC20CustodyPauseStatusResponse) Reset() { + *m = MsgUpdateERC20CustodyPauseStatusResponse{} +} +func (m *MsgUpdateERC20CustodyPauseStatusResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateERC20CustodyPauseStatusResponse) ProtoMessage() {} +func (*MsgUpdateERC20CustodyPauseStatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15f0860550897740, []int{27} +} +func (m *MsgUpdateERC20CustodyPauseStatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateERC20CustodyPauseStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateERC20CustodyPauseStatusResponse.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 *MsgUpdateERC20CustodyPauseStatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateERC20CustodyPauseStatusResponse.Merge(m, src) +} +func (m *MsgUpdateERC20CustodyPauseStatusResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateERC20CustodyPauseStatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateERC20CustodyPauseStatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateERC20CustodyPauseStatusResponse proto.InternalMessageInfo + +func (m *MsgUpdateERC20CustodyPauseStatusResponse) GetCctxIndex() string { + if m != nil { + return m.CctxIndex + } + return "" +} + func init() { proto.RegisterType((*MsgMigrateTssFunds)(nil), "zetachain.zetacore.crosschain.MsgMigrateTssFunds") proto.RegisterType((*MsgMigrateTssFundsResponse)(nil), "zetachain.zetacore.crosschain.MsgMigrateTssFundsResponse") @@ -1571,6 +1679,8 @@ func init() { proto.RegisterType((*MsgUpdateRateLimiterFlagsResponse)(nil), "zetachain.zetacore.crosschain.MsgUpdateRateLimiterFlagsResponse") proto.RegisterType((*MsgMigrateERC20CustodyFunds)(nil), "zetachain.zetacore.crosschain.MsgMigrateERC20CustodyFunds") proto.RegisterType((*MsgMigrateERC20CustodyFundsResponse)(nil), "zetachain.zetacore.crosschain.MsgMigrateERC20CustodyFundsResponse") + proto.RegisterType((*MsgUpdateERC20CustodyPauseStatus)(nil), "zetachain.zetacore.crosschain.MsgUpdateERC20CustodyPauseStatus") + proto.RegisterType((*MsgUpdateERC20CustodyPauseStatusResponse)(nil), "zetachain.zetacore.crosschain.MsgUpdateERC20CustodyPauseStatusResponse") } func init() { @@ -1578,110 +1688,113 @@ func init() { } var fileDescriptor_15f0860550897740 = []byte{ - // 1638 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x5f, 0x6f, 0xdb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x51, - 0x11, 0xc1, 0xee, 0x5f, 0x4b, 0x30, 0xdb, 0xf1, 0xc9, 0xa5, 0x38, 0x58, 0x5c, 0x14, 0xa3, 0x6c, - 0x1c, 0x1d, 0x13, 0x28, 0xf1, 0x25, 0xcc, 0x44, 0x3f, 0x54, 0x5d, 0x1e, 0x2c, 0x2e, 0x02, 0x51, - 0xde, 0x3d, 0x32, 0xa4, 0x3d, 0x06, 0x91, 0x96, 0x3c, 0x44, 0x0c, 0xc2, 0x88, 0x61, 0x62, 0xd0, - 0xbd, 0x51, 0xb3, 0x12, 0xd4, 0xd9, 0xa6, 0xaf, 0x0c, 0x73, 0x7a, 0x23, 0xa0, 0x61, 0x4a, 0x50, - 0xcf, 0xc6, 0x2c, 0xff, 0x28, 0xc1, 0x7c, 0x8f, 0xae, 0x7c, 0x7d, 0xd8, 0xe8, 0x46, 0x91, 0xca, - 0x87, 0xa3, 0x22, 0x03, 0xb5, 0x9e, 0x49, 0x90, 0xe9, 0xd9, 0x6a, 0x37, 0x86, 0x0e, 0x7a, 0x07, - 0x56, 0xd9, 0x1c, 0x1d, 0xeb, 0x2b, 0xb7, 0xf9, 0xf1, 0xf3, 0x57, 0x59, 0xe9, 0xc5, 0xab, 0xac, - 0xf4, 0xe7, 0xab, 0xac, 0xf4, 0xdd, 0xeb, 0xec, 0xd8, 0x8b, 0xd7, 0xd9, 0xb1, 0xdf, 0x5f, 0x67, - 0xc7, 0x3e, 0xbf, 0xdc, 0xd6, 0x62, 0x3d, 0xe9, 0x97, 0x22, 0x5f, 0x71, 0x9b, 0xa1, 0x8f, 0xd4, - 0x5e, 0xc7, 0xad, 0xc4, 0xd9, 0xb7, 0xdb, 0x2b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x89, 0xad, - 0xbd, 0xf8, 0xd2, 0x16, 0x00, 0x00, + // 1689 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc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, 0x3e, 0xff, 0xa0, 0x76, 0xa3, 0x68, + 0x44, 0x26, 0x90, 0x6a, 0x45, 0x22, 0x97, 0x06, 0x53, 0x23, 0xd8, 0x95, 0xb7, 0x8f, 0xc4, 0x1e, + 0x18, 0xfd, 0x1c, 0xd2, 0x91, 0xcb, 0xff, 0x6a, 0x7f, 0x45, 0x61, 0x09, 0xe5, 0xfa, 0x51, 0x25, + 0x02, 0xeb, 0x5f, 0x49, 0x30, 0xdd, 0xf6, 0xb1, 0xa8, 0xd8, 0x5f, 0x5d, 0x54, 0x46, 0x59, 0x3b, + 0xba, 0x4c, 0xe0, 0xc4, 0x17, 0x30, 0x15, 0xfd, 0xc4, 0x76, 0xb9, 0xbf, 0xba, 0x88, 0x88, 0xf2, + 0xee, 0x91, 0x45, 0x5a, 0x6b, 0x10, 0x01, 0x13, 0x03, 0xd4, 0x20, 0x2c, 0x31, 0x48, 0x0d, 0x3a, + 0x43, 0x0c, 0x76, 0x04, 0xb5, 0x03, 0x8c, 0x2b, 0x83, 0xec, 0xde, 0x88, 0xd0, 0x20, 0x47, 0x50, + 0x57, 0x48, 0x21, 0xff, 0x20, 0xc1, 0x6c, 0x17, 0x3c, 0x71, 0x7d, 0xd0, 0xea, 0x46, 0x25, 0x95, + 0x0f, 0x86, 0x95, 0x0c, 0xdc, 0x7a, 0x26, 0x41, 0xa6, 0x2b, 0x48, 0x58, 0x1b, 0xb8, 0xe8, 0x6d, + 0xb2, 0xca, 0xfa, 0xf0, 0xb2, 0x81, 0x73, 0xbf, 0x48, 0xb0, 0xd0, 0x7b, 0x12, 0xdf, 0x1c, 0x34, + 0x01, 0x5d, 0x14, 0x28, 0x1b, 0xc7, 0x54, 0xe0, 0xfb, 0xba, 0xfe, 0xd1, 0xf3, 0x57, 0x59, 0xe9, + 0xc5, 0xab, 0xac, 0xf4, 0xc7, 0xab, 0xac, 0xf4, 0xed, 0xeb, 0xec, 0xc8, 0x8b, 0xd7, 0xd9, 0x91, + 0xdf, 0x5e, 0x67, 0x47, 0x3e, 0xbb, 0xdc, 0x02, 0x64, 0x3c, 0x13, 0x97, 0x22, 0xdf, 0xca, 0x9b, + 0xa1, 0x7f, 0x05, 0x78, 0xb8, 0xa6, 0x12, 0x67, 0x5f, 0xc8, 0xaf, 0xfc, 0x1b, 0x00, 0x00, 0xff, + 0xff, 0x00, 0xf4, 0xf1, 0x8e, 0x38, 0x18, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1709,6 +1822,7 @@ type MsgClient interface { RefundAbortedCCTX(ctx context.Context, in *MsgRefundAbortedCCTX, opts ...grpc.CallOption) (*MsgRefundAbortedCCTXResponse, error) UpdateRateLimiterFlags(ctx context.Context, in *MsgUpdateRateLimiterFlags, opts ...grpc.CallOption) (*MsgUpdateRateLimiterFlagsResponse, error) MigrateERC20CustodyFunds(ctx context.Context, in *MsgMigrateERC20CustodyFunds, opts ...grpc.CallOption) (*MsgMigrateERC20CustodyFundsResponse, error) + UpdateERC20CustodyPauseStatus(ctx context.Context, in *MsgUpdateERC20CustodyPauseStatus, opts ...grpc.CallOption) (*MsgUpdateERC20CustodyPauseStatusResponse, error) } type msgClient struct { @@ -1836,6 +1950,15 @@ func (c *msgClient) MigrateERC20CustodyFunds(ctx context.Context, in *MsgMigrate return out, nil } +func (c *msgClient) UpdateERC20CustodyPauseStatus(ctx context.Context, in *MsgUpdateERC20CustodyPauseStatus, opts ...grpc.CallOption) (*MsgUpdateERC20CustodyPauseStatusResponse, error) { + out := new(MsgUpdateERC20CustodyPauseStatusResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Msg/UpdateERC20CustodyPauseStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { AddOutboundTracker(context.Context, *MsgAddOutboundTracker) (*MsgAddOutboundTrackerResponse, error) @@ -1851,6 +1974,7 @@ type MsgServer interface { RefundAbortedCCTX(context.Context, *MsgRefundAbortedCCTX) (*MsgRefundAbortedCCTXResponse, error) UpdateRateLimiterFlags(context.Context, *MsgUpdateRateLimiterFlags) (*MsgUpdateRateLimiterFlagsResponse, error) MigrateERC20CustodyFunds(context.Context, *MsgMigrateERC20CustodyFunds) (*MsgMigrateERC20CustodyFundsResponse, error) + UpdateERC20CustodyPauseStatus(context.Context, *MsgUpdateERC20CustodyPauseStatus) (*MsgUpdateERC20CustodyPauseStatusResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1896,6 +2020,9 @@ func (*UnimplementedMsgServer) UpdateRateLimiterFlags(ctx context.Context, req * func (*UnimplementedMsgServer) MigrateERC20CustodyFunds(ctx context.Context, req *MsgMigrateERC20CustodyFunds) (*MsgMigrateERC20CustodyFundsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MigrateERC20CustodyFunds not implemented") } +func (*UnimplementedMsgServer) UpdateERC20CustodyPauseStatus(ctx context.Context, req *MsgUpdateERC20CustodyPauseStatus) (*MsgUpdateERC20CustodyPauseStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateERC20CustodyPauseStatus not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -2135,6 +2262,24 @@ func _Msg_MigrateERC20CustodyFunds_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Msg_UpdateERC20CustodyPauseStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateERC20CustodyPauseStatus) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateERC20CustodyPauseStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zetachain.zetacore.crosschain.Msg/UpdateERC20CustodyPauseStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateERC20CustodyPauseStatus(ctx, req.(*MsgUpdateERC20CustodyPauseStatus)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "zetachain.zetacore.crosschain.Msg", HandlerType: (*MsgServer)(nil), @@ -2191,6 +2336,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MigrateERC20CustodyFunds", Handler: _Msg_MigrateERC20CustodyFunds_Handler, }, + { + MethodName: "UpdateERC20CustodyPauseStatus", + Handler: _Msg_UpdateERC20CustodyPauseStatus_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "zetachain/zetacore/crosschain/tx.proto", @@ -3297,6 +3446,81 @@ func (m *MsgMigrateERC20CustodyFundsResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } +func (m *MsgUpdateERC20CustodyPauseStatus) 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 *MsgUpdateERC20CustodyPauseStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateERC20CustodyPauseStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pause { + i-- + if m.Pause { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.ChainId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + 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 *MsgUpdateERC20CustodyPauseStatusResponse) 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 *MsgUpdateERC20CustodyPauseStatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateERC20CustodyPauseStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CctxIndex) > 0 { + i -= len(m.CctxIndex) + copy(dAtA[i:], m.CctxIndex) + i = encodeVarintTx(dAtA, i, uint64(len(m.CctxIndex))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -3803,6 +4027,38 @@ func (m *MsgMigrateERC20CustodyFundsResponse) Size() (n int) { return n } +func (m *MsgUpdateERC20CustodyPauseStatus) 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)) + } + if m.ChainId != 0 { + n += 1 + sovTx(uint64(m.ChainId)) + } + if m.Pause { + n += 2 + } + return n +} + +func (m *MsgUpdateERC20CustodyPauseStatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CctxIndex) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7158,6 +7414,209 @@ func (m *MsgMigrateERC20CustodyFundsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateERC20CustodyPauseStatus) 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: MsgUpdateERC20CustodyPauseStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateERC20CustodyPauseStatus: 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pause", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Pause = bool(v != 0) + 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 *MsgUpdateERC20CustodyPauseStatusResponse) 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: MsgUpdateERC20CustodyPauseStatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateERC20CustodyPauseStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CctxIndex", 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.CctxIndex = 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/zetaclient/chains/evm/signer/signer_admin.go b/zetaclient/chains/evm/signer/signer_admin.go index b52e6a769b..09bf1aa378 100644 --- a/zetaclient/chains/evm/signer/signer_admin.go +++ b/zetaclient/chains/evm/signer/signer_admin.go @@ -13,11 +13,7 @@ import ( "github.com/zeta-chain/zetacore/pkg/constant" ) -// SignAdminTx signs a transaction based on the given command includes: -// -// cmd_whitelist_erc20 -// cmd_migrate_erc20_custody_funds -// cmd_migrate_tss_funds +// SignAdminTx signs a admin cmd transaction based on the given command func (signer *Signer) SignAdminTx( ctx context.Context, txData *OutboundData, @@ -29,6 +25,8 @@ func (signer *Signer) SignAdminTx( return signer.signWhitelistERC20Cmd(ctx, txData, params) case constant.CmdMigrateERC20CustodyFunds: return signer.signMigrateERC20CustodyFundsCmd(ctx, txData, params) + case constant.CmdUpdateERC20CustodyPauseStatus: + return signer.signUpdateERC20CustodyPauseStatusCmd(ctx, txData, params) case constant.CmdMigrateTssFunds: return signer.signMigrateTssFundsCmd(ctx, txData) } @@ -110,6 +108,50 @@ func (signer *Signer) signMigrateERC20CustodyFundsCmd( return tx, nil } +// signUpdateERC20CustodyPauseStatusCmd signs a update ERC20 custody pause status command +func (signer *Signer) signUpdateERC20CustodyPauseStatusCmd( + ctx context.Context, + txData *OutboundData, + params string, +) (*ethtypes.Transaction, error) { + custodyAbi, err := erc20custody.ERC20CustodyMetaData.GetAbi() + if err != nil { + return nil, err + } + + // select the action + // NOTE: we could directly do Pack(params) + // having this logic here is more explicit and restrict the possible values + var functionName string + switch params { + case constant.OptionPause: + functionName = "pause" + case constant.OptionUnpause: + functionName = "unpause" + default: + return nil, fmt.Errorf("signUpdateERC20CustodyPauseStatusCmd: invalid params %s", params) + } + + data, err := custodyAbi.Pack(functionName) + if err != nil { + return nil, fmt.Errorf("pause/unpause pack error: %w", err) + } + + tx, _, _, err := signer.Sign( + ctx, + data, + txData.to, + zeroValue, + txData.gas, + txData.outboundParams.TssNonce, + txData.height, + ) + if err != nil { + return nil, fmt.Errorf("signUpdateERC20CustodyPauseStatusCmd error: %w", err) + } + return tx, nil +} + // signMigrateTssFundsCmd signs a migrate TSS funds command func (signer *Signer) signMigrateTssFundsCmd(ctx context.Context, txData *OutboundData) (*ethtypes.Transaction, error) { tx, _, _, err := signer.Sign( diff --git a/zetaclient/chains/evm/signer/signer_admin_test.go b/zetaclient/chains/evm/signer/signer_admin_test.go index 820b521892..e1f45d168a 100644 --- a/zetaclient/chains/evm/signer/signer_admin_test.go +++ b/zetaclient/chains/evm/signer/signer_admin_test.go @@ -20,8 +20,10 @@ func TestSigner_SignAdminTx(t *testing.T) { // Setup txData struct cctx := getCCTX(t) + require.NoError(t, err) txData, skip, err := NewOutboundData(ctx, cctx, 123, zerolog.Logger{}) + require.False(t, skip) require.NoError(t, err) @@ -62,6 +64,22 @@ func TestSigner_SignAdminTx(t *testing.T) { verifyTxBodyBasics(t, tx, txData.to, txData.nonce, big.NewInt(0)) }) + t.Run("SignAdminTx CmdUpdateERC20CustodyPauseStatus", func(t *testing.T) { + cmd := constant.CmdUpdateERC20CustodyPauseStatus + params := constant.OptionPause + // Call SignAdminTx + tx, err := evmSigner.SignAdminTx(ctx, txData, cmd, params) + require.NoError(t, err) + + // Verify tx signature + tss := mocks.NewTSSMainnet() + verifyTxSignature(t, tx, tss.Pubkey(), evmSigner.EvmSigner()) + + // Verify tx body basics + // Note: Revert tx calls erc20 custody contract with 0 gas token + verifyTxBodyBasics(t, tx, txData.to, txData.nonce, big.NewInt(0)) + }) + t.Run("SignAdminTx CmdMigrateTssFunds", func(t *testing.T) { cmd := constant.CmdMigrateTssFunds // Call SignAdminTx @@ -91,6 +109,7 @@ func TestSigner_SignWhitelistERC20Cmd(t *testing.T) { require.NoError(t, err) txData, skip, err := NewOutboundData(ctx, cctx, 123, zerolog.Logger{}) + require.NoError(t, err) require.False(t, skip) @@ -139,6 +158,7 @@ func TestSigner_SignMigrateERC20CustodyFundsCmd(t *testing.T) { require.NoError(t, err) txData, skip, err := NewOutboundData(ctx, cctx, 123, zerolog.Logger{}) + require.NoError(t, err) require.False(t, skip) @@ -190,6 +210,84 @@ func TestSigner_SignMigrateERC20CustodyFundsCmd(t *testing.T) { }) } +func TestSigner_SignUpdateERC20CustodyPauseStatusCmd(t *testing.T) { + ctx := makeCtx(t) + + // Setup evm signer + tss := mocks.NewTSSMainnet() + evmSigner, err := getNewEvmSigner(tss) + require.NoError(t, err) + + // Setup txData struct + cctx := getCCTX(t) + + require.NoError(t, err) + txData, skip, err := NewOutboundData(ctx, cctx, 123, zerolog.Logger{}) + + require.False(t, skip) + require.NoError(t, err) + + t.Run("signUpdateERC20CustodyPauseStatusCmd - should successfully sign for pause", func(t *testing.T) { + // Call signWhitelistERC20Cmd + + params := constant.OptionPause + + tx, err := evmSigner.signUpdateERC20CustodyPauseStatusCmd(ctx, txData, params) + require.NoError(t, err) + require.NotNil(t, tx) + + // Verify tx signature + tss := mocks.NewTSSMainnet() + verifyTxSignature(t, tx, tss.Pubkey(), evmSigner.EvmSigner()) + + // Verify tx body basics + verifyTxBodyBasics(t, tx, txData.to, txData.nonce, zeroValue) + }) + + t.Run("signUpdateERC20CustodyPauseStatusCmd - should successfully sign for unpause", func(t *testing.T) { + // Call signWhitelistERC20Cmd + + params := constant.OptionUnpause + + tx, err := evmSigner.signUpdateERC20CustodyPauseStatusCmd(ctx, txData, params) + require.NoError(t, err) + require.NotNil(t, tx) + + // Verify tx signature + tss := mocks.NewTSSMainnet() + verifyTxSignature(t, tx, tss.Pubkey(), evmSigner.EvmSigner()) + + // Verify tx body basics + verifyTxBodyBasics(t, tx, txData.to, txData.nonce, zeroValue) + }) + + t.Run("signUpdateERC20CustodyPauseStatusCmd - should fail on invalid params", func(t *testing.T) { + params := "invalid" + + _, err := evmSigner.signUpdateERC20CustodyPauseStatusCmd(ctx, txData, params) + require.ErrorContains(t, err, "invalid params") + }) + + t.Run("signUpdateERC20CustodyPauseStatusCmd - should fail on empty params", func(t *testing.T) { + params := "" + + _, err := evmSigner.signUpdateERC20CustodyPauseStatusCmd(ctx, txData, params) + require.ErrorContains(t, err, "invalid params") + }) + + t.Run("signUpdateERC20CustodyPauseStatusCmd - should fail if keysign fails", func(t *testing.T) { + // Pause tss to make keysign fail + tss.Pause() + + params := constant.OptionPause + + // Call signWhitelistERC20Cmd + tx, err := evmSigner.signUpdateERC20CustodyPauseStatusCmd(ctx, txData, params) + require.ErrorContains(t, err, "tss is paused") + require.Nil(t, tx) + }) +} + func TestSigner_SignMigrateTssFundsCmd(t *testing.T) { ctx := makeCtx(t) @@ -200,8 +298,10 @@ func TestSigner_SignMigrateTssFundsCmd(t *testing.T) { // Setup txData struct cctx := getCCTX(t) + require.NoError(t, err) txData, skip, err := NewOutboundData(ctx, cctx, 123, zerolog.Logger{}) + require.False(t, skip) require.NoError(t, err)