From 418c7e8e2fdab0e6b49cef2b2bad02fc5f31d68e Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Mon, 15 Apr 2024 09:51:02 +0200 Subject: [PATCH 1/2] refactor(`crosschain`): rename `GasPriceVoter` to `VoteGasPrice` (#2013) * recompile proto * rename files * rename all refererences * breaking change notice --- app/ante/ante.go | 2 +- app/ante/ante_test.go | 2 +- changelog.md | 4 + .../zetacored_zetacore0/config/genesis.json | 4 +- .../zetacored_zetacore1/config/genesis.json | 4 +- docs/cli/zetacored/zetacored_tx_crosschain.md | 2 +- ...zetacored_tx_crosschain_vote-gas-price.md} | 8 +- docs/openapi/openapi.swagger.yaml | 4 +- docs/spec/crosschain/messages.md | 6 +- proto/crosschain/tx.proto | 6 +- typescript/crosschain/tx_pb.d.ts | 32 +- x/crosschain/client/cli/cli_gas_price.go | 8 +- x/crosschain/client/cli/tx.go | 2 +- ..._voter.go => msg_server_vote_gas_price.go} | 6 +- ...t.go => msg_server_vote_gas_price_test.go} | 14 +- x/crosschain/types/authz.go | 2 +- x/crosschain/types/authz_test.go | 2 +- x/crosschain/types/codec.go | 4 +- ...ice_voter.go => message_vote_gas_price.go} | 16 +- ...test.go => message_vote_gas_price_test.go} | 30 +- x/crosschain/types/tx.pb.go | 306 +++++++++--------- zetaclient/zetabridge/tx.go | 2 +- 22 files changed, 235 insertions(+), 231 deletions(-) rename docs/cli/zetacored/{zetacored_tx_crosschain_gas-price-voter.md => zetacored_tx_crosschain_vote-gas-price.md} (93%) rename x/crosschain/keeper/{msg_server_gas_price_voter.go => msg_server_vote_gas_price.go} (91%) rename x/crosschain/keeper/{msg_server_gas_price_voter_test.go => msg_server_vote_gas_price_test.go} (93%) rename x/crosschain/types/{message_gas_price_voter.go => message_vote_gas_price.go} (66%) rename x/crosschain/types/{message_gas_price_voter_test.go => message_vote_gas_price_test.go} (75%) diff --git a/app/ante/ante.go b/app/ante/ante.go index ef38309429..562c6c0de2 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -168,7 +168,7 @@ func IsSystemTx(tx sdk.Tx, isAuthorizedSigner func(string) bool) bool { } } switch innerMsg.(type) { - case *cctxtypes.MsgGasPriceVoter, + case *cctxtypes.MsgVoteGasPrice, *cctxtypes.MsgVoteOnObservedInboundTx, *cctxtypes.MsgVoteOnObservedOutboundTx, *cctxtypes.MsgAddToOutTxTracker, diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index f013784285..d4a28f4466 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -32,7 +32,7 @@ func (mah *MockAnteHandler) AnteHandle(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.C func TestIsSystemTx(t *testing.T) { // system tx types: - // *cctxtypes.MsgGasPriceVoter, + // *cctxtypes.MsgVoteGasPrice, // *cctxtypes.MsgVoteOnObservedInboundTx, // *cctxtypes.MsgVoteOnObservedOutboundTx, // *cctxtypes.MsgAddToOutTxTracker, diff --git a/changelog.md b/changelog.md index c535451228..152ee00783 100644 --- a/changelog.md +++ b/changelog.md @@ -11,6 +11,9 @@ * `MsgCreateTSSVoter` message in the `crosschain` module has been moved to the `observer` module and renamed to `MsgVoteTSS`. * The structure of the message remains the same. +* `MsgGasPriceVoter` message in the `crosschain` module has been renamed to `MsgVoteGasPrice`. + * The structure of the message remains the same. + ### Refactor * [1511](https://github.com/zeta-chain/node/pull/1511) - move ballot voting logic from `crosschain` to `observer` @@ -26,6 +29,7 @@ * [1936](https://github.com/zeta-chain/node/pull/1936) - refactor common package into subpackages and rename to pkg * [1966](https://github.com/zeta-chain/node/pull/1966) - move TSS vote message from crosschain to observer * [1853](https://github.com/zeta-chain/node/pull/1853) - refactor vote inbound tx and vote outbound tx +* [2013](https://github.com/zeta-chain/node/pull/2013) - rename `GasPriceVoter` message to `VoteGasPrice` ### Features diff --git a/contrib/localnet/zetacored/zetacored_zetacore0/config/genesis.json b/contrib/localnet/zetacored/zetacored_zetacore0/config/genesis.json index 87916c2d09..ab30faef7a 100644 --- a/contrib/localnet/zetacored/zetacored_zetacore0/config/genesis.json +++ b/contrib/localnet/zetacored/zetacored_zetacore0/config/genesis.json @@ -675,7 +675,7 @@ "grantee": "zeta1syavy2npfyt9tcncdtsdzf7kny9lh777heefxk", "authorization": { "@type": "/cosmos.authz.v1beta1.GenericAuthorization", - "msg": "/zetachain.zetacore.crosschain.MsgGasPriceVoter" + "msg": "/zetachain.zetacore.crosschain.MsgVoteGasPrice" }, "expiration": null }, @@ -738,7 +738,7 @@ "grantee": "zeta1l7hypmqk2yc334vc6vmdwzp5sdefygj2w5yj50", "authorization": { "@type": "/cosmos.authz.v1beta1.GenericAuthorization", - "msg": "/zetachain.zetacore.crosschain.MsgGasPriceVoter" + "msg": "/zetachain.zetacore.crosschain.MsgVoteGasPrice" }, "expiration": null }, diff --git a/contrib/localnet/zetacored/zetacored_zetacore1/config/genesis.json b/contrib/localnet/zetacored/zetacored_zetacore1/config/genesis.json index 87916c2d09..ab30faef7a 100644 --- a/contrib/localnet/zetacored/zetacored_zetacore1/config/genesis.json +++ b/contrib/localnet/zetacored/zetacored_zetacore1/config/genesis.json @@ -675,7 +675,7 @@ "grantee": "zeta1syavy2npfyt9tcncdtsdzf7kny9lh777heefxk", "authorization": { "@type": "/cosmos.authz.v1beta1.GenericAuthorization", - "msg": "/zetachain.zetacore.crosschain.MsgGasPriceVoter" + "msg": "/zetachain.zetacore.crosschain.MsgVoteGasPrice" }, "expiration": null }, @@ -738,7 +738,7 @@ "grantee": "zeta1l7hypmqk2yc334vc6vmdwzp5sdefygj2w5yj50", "authorization": { "@type": "/cosmos.authz.v1beta1.GenericAuthorization", - "msg": "/zetachain.zetacore.crosschain.MsgGasPriceVoter" + "msg": "/zetachain.zetacore.crosschain.MsgVoteGasPrice" }, "expiration": null }, diff --git a/docs/cli/zetacored/zetacored_tx_crosschain.md b/docs/cli/zetacored/zetacored_tx_crosschain.md index 40582875aa..902172ce59 100644 --- a/docs/cli/zetacored/zetacored_tx_crosschain.md +++ b/docs/cli/zetacored/zetacored_tx_crosschain.md @@ -29,12 +29,12 @@ zetacored tx crosschain [flags] * [zetacored tx crosschain add-to-in-tx-tracker](zetacored_tx_crosschain_add-to-in-tx-tracker.md) - Add a in-tx-tracker Use 0:Zeta,1:Gas,2:ERC20 * [zetacored tx crosschain add-to-out-tx-tracker](zetacored_tx_crosschain_add-to-out-tx-tracker.md) - Add a out-tx-tracker -* [zetacored tx crosschain gas-price-voter](zetacored_tx_crosschain_gas-price-voter.md) - Broadcast message gasPriceVoter * [zetacored tx crosschain inbound-voter](zetacored_tx_crosschain_inbound-voter.md) - Broadcast message sendVoter * [zetacored tx crosschain migrate-tss-funds](zetacored_tx_crosschain_migrate-tss-funds.md) - Migrate TSS funds to the latest TSS address * [zetacored tx crosschain outbound-voter](zetacored_tx_crosschain_outbound-voter.md) - Broadcast message receiveConfirmation * [zetacored tx crosschain refund-aborted](zetacored_tx_crosschain_refund-aborted.md) - Refund an aborted tx , the refund address is optional, if not provided, the refund will be sent to the sender/tx origin of the cctx. * [zetacored tx crosschain remove-from-out-tx-tracker](zetacored_tx_crosschain_remove-from-out-tx-tracker.md) - Remove a out-tx-tracker * [zetacored tx crosschain update-tss-address](zetacored_tx_crosschain_update-tss-address.md) - Create a new TSSVoter +* [zetacored tx crosschain vote-gas-price](zetacored_tx_crosschain_vote-gas-price.md) - Broadcast message to vote gas price * [zetacored tx crosschain whitelist-erc20](zetacored_tx_crosschain_whitelist-erc20.md) - Add a new erc20 token to whitelist diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_gas-price-voter.md b/docs/cli/zetacored/zetacored_tx_crosschain_vote-gas-price.md similarity index 93% rename from docs/cli/zetacored/zetacored_tx_crosschain_gas-price-voter.md rename to docs/cli/zetacored/zetacored_tx_crosschain_vote-gas-price.md index e3804f9615..26387a22b5 100644 --- a/docs/cli/zetacored/zetacored_tx_crosschain_gas-price-voter.md +++ b/docs/cli/zetacored/zetacored_tx_crosschain_vote-gas-price.md @@ -1,9 +1,9 @@ -# tx crosschain gas-price-voter +# tx crosschain vote-gas-price -Broadcast message gasPriceVoter +Broadcast message to vote gas price ``` -zetacored tx crosschain gas-price-voter [chain] [price] [supply] [blockNumber] [flags] +zetacored tx crosschain vote-gas-price [chain] [price] [supply] [blockNumber] [flags] ``` ### Options @@ -21,7 +21,7 @@ zetacored tx crosschain gas-price-voter [chain] [price] [supply] [blockNumber] [ --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 gas-price-voter + -h, --help help for vote-gas-price --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 diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index c96ab5fa4f..1d1042551f 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -53681,8 +53681,6 @@ definitions: is_removed: type: boolean title: if the tx was removed from the tracker due to no pending cctx - crosschainMsgGasPriceVoterResponse: - type: object crosschainMsgMigrateTssFundsResponse: type: object crosschainMsgRefundAbortedCCTXResponse: @@ -53691,6 +53689,8 @@ definitions: type: object crosschainMsgUpdateTssAddressResponse: type: object + crosschainMsgVoteGasPriceResponse: + type: object crosschainMsgVoteOnObservedInboundTxResponse: type: object crosschainMsgVoteOnObservedOutboundTxResponse: diff --git a/docs/spec/crosschain/messages.md b/docs/spec/crosschain/messages.md index e64f4bb99a..0a57b8e883 100644 --- a/docs/spec/crosschain/messages.md +++ b/docs/spec/crosschain/messages.md @@ -52,16 +52,16 @@ message MsgRemoveFromOutTxTracker { } ``` -## MsgGasPriceVoter +## MsgVoteGasPrice -GasPriceVoter submits information about the connected chain's gas price at a specific block +VoteGasPrice submits information about the connected chain's gas price at a specific block height. Gas price submitted by each validator is recorded separately and a median index is updated. Only observer validators are authorized to broadcast this message. ```proto -message MsgGasPriceVoter { +message MsgVoteGasPrice { string creator = 1; int64 chain_id = 2; uint64 price = 3; diff --git a/proto/crosschain/tx.proto b/proto/crosschain/tx.proto index 7e668d6325..ab33e1e1bb 100644 --- a/proto/crosschain/tx.proto +++ b/proto/crosschain/tx.proto @@ -14,7 +14,7 @@ service Msg { rpc AddToInTxTracker(MsgAddToInTxTracker) returns (MsgAddToInTxTrackerResponse); rpc RemoveFromOutTxTracker(MsgRemoveFromOutTxTracker) returns (MsgRemoveFromOutTxTrackerResponse); - rpc GasPriceVoter(MsgGasPriceVoter) returns (MsgGasPriceVoterResponse); + rpc VoteGasPrice(MsgVoteGasPrice) returns (MsgVoteGasPriceResponse); rpc VoteOnObservedOutboundTx(MsgVoteOnObservedOutboundTx) returns (MsgVoteOnObservedOutboundTxResponse); rpc VoteOnObservedInboundTx(MsgVoteOnObservedInboundTx) returns (MsgVoteOnObservedInboundTxResponse); rpc WhitelistERC20(MsgWhitelistERC20) returns (MsgWhitelistERC20Response); @@ -91,7 +91,7 @@ message MsgRemoveFromOutTxTracker { message MsgRemoveFromOutTxTrackerResponse {} -message MsgGasPriceVoter { +message MsgVoteGasPrice { string creator = 1; int64 chain_id = 2; uint64 price = 3; @@ -99,7 +99,7 @@ message MsgGasPriceVoter { string supply = 5; } -message MsgGasPriceVoterResponse {} +message MsgVoteGasPriceResponse {} message MsgVoteOnObservedOutboundTx { string creator = 1; diff --git a/typescript/crosschain/tx_pb.d.ts b/typescript/crosschain/tx_pb.d.ts index eec35c2dc8..b7a76801dd 100644 --- a/typescript/crosschain/tx_pb.d.ts +++ b/typescript/crosschain/tx_pb.d.ts @@ -400,9 +400,9 @@ export declare class MsgRemoveFromOutTxTrackerResponse extends Message { +export declare class MsgVoteGasPrice extends Message { /** * @generated from field: string creator = 1; */ @@ -428,38 +428,38 @@ export declare class MsgGasPriceVoter extends Message { */ supply: string; - constructor(data?: PartialMessage); + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; - static readonly typeName = "zetachain.zetacore.crosschain.MsgGasPriceVoter"; + static readonly typeName = "zetachain.zetacore.crosschain.MsgVoteGasPrice"; static readonly fields: FieldList; - static fromBinary(bytes: Uint8Array, options?: Partial): MsgGasPriceVoter; + static fromBinary(bytes: Uint8Array, options?: Partial): MsgVoteGasPrice; - static fromJson(jsonValue: JsonValue, options?: Partial): MsgGasPriceVoter; + static fromJson(jsonValue: JsonValue, options?: Partial): MsgVoteGasPrice; - static fromJsonString(jsonString: string, options?: Partial): MsgGasPriceVoter; + static fromJsonString(jsonString: string, options?: Partial): MsgVoteGasPrice; - static equals(a: MsgGasPriceVoter | PlainMessage | undefined, b: MsgGasPriceVoter | PlainMessage | undefined): boolean; + static equals(a: MsgVoteGasPrice | PlainMessage | undefined, b: MsgVoteGasPrice | PlainMessage | undefined): boolean; } /** - * @generated from message zetachain.zetacore.crosschain.MsgGasPriceVoterResponse + * @generated from message zetachain.zetacore.crosschain.MsgVoteGasPriceResponse */ -export declare class MsgGasPriceVoterResponse extends Message { - constructor(data?: PartialMessage); +export declare class MsgVoteGasPriceResponse extends Message { + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; - static readonly typeName = "zetachain.zetacore.crosschain.MsgGasPriceVoterResponse"; + static readonly typeName = "zetachain.zetacore.crosschain.MsgVoteGasPriceResponse"; static readonly fields: FieldList; - static fromBinary(bytes: Uint8Array, options?: Partial): MsgGasPriceVoterResponse; + static fromBinary(bytes: Uint8Array, options?: Partial): MsgVoteGasPriceResponse; - static fromJson(jsonValue: JsonValue, options?: Partial): MsgGasPriceVoterResponse; + static fromJson(jsonValue: JsonValue, options?: Partial): MsgVoteGasPriceResponse; - static fromJsonString(jsonString: string, options?: Partial): MsgGasPriceVoterResponse; + static fromJsonString(jsonString: string, options?: Partial): MsgVoteGasPriceResponse; - static equals(a: MsgGasPriceVoterResponse | PlainMessage | undefined, b: MsgGasPriceVoterResponse | PlainMessage | undefined): boolean; + static equals(a: MsgVoteGasPriceResponse | PlainMessage | undefined, b: MsgVoteGasPriceResponse | PlainMessage | undefined): boolean; } /** diff --git a/x/crosschain/client/cli/cli_gas_price.go b/x/crosschain/client/cli/cli_gas_price.go index b46897b36c..1ad48ee8c0 100644 --- a/x/crosschain/client/cli/cli_gas_price.go +++ b/x/crosschain/client/cli/cli_gas_price.go @@ -74,10 +74,10 @@ func CmdShowGasPrice() *cobra.Command { // Transaction CLI ///////////////////////// -func CmdGasPriceVoter() *cobra.Command { +func CmdVoteGasPrice() *cobra.Command { cmd := &cobra.Command{ - Use: "gas-price-voter [chain] [price] [supply] [blockNumber]", - Short: "Broadcast message gasPriceVoter", + Use: "vote-gas-price [chain] [price] [supply] [blockNumber]", + Short: "Broadcast message to vote gas price", Args: cobra.ExactArgs(4), RunE: func(cmd *cobra.Command, args []string) error { argsChain, err := strconv.ParseInt(args[0], 10, 64) @@ -99,7 +99,7 @@ func CmdGasPriceVoter() *cobra.Command { return err } - msg := types.NewMsgGasPriceVoter(clientCtx.GetFromAddress().String(), argsChain, argsPrice, argsSupply, argsBlockNumber) + msg := types.NewMsgVoteGasPrice(clientCtx.GetFromAddress().String(), argsChain, argsPrice, argsSupply, argsBlockNumber) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, diff --git a/x/crosschain/client/cli/tx.go b/x/crosschain/client/cli/tx.go index c82c55f8fd..55bcabb31f 100644 --- a/x/crosschain/client/cli/tx.go +++ b/x/crosschain/client/cli/tx.go @@ -22,7 +22,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( CmdAddToWatchList(), - CmdGasPriceVoter(), + CmdVoteGasPrice(), CmdCCTXOutboundVoter(), CmdCCTXInboundVoter(), CmdRemoveFromWatchList(), diff --git a/x/crosschain/keeper/msg_server_gas_price_voter.go b/x/crosschain/keeper/msg_server_vote_gas_price.go similarity index 91% rename from x/crosschain/keeper/msg_server_gas_price_voter.go rename to x/crosschain/keeper/msg_server_vote_gas_price.go index 52532c206f..77df7eaf48 100644 --- a/x/crosschain/keeper/msg_server_gas_price_voter.go +++ b/x/crosschain/keeper/msg_server_vote_gas_price.go @@ -15,12 +15,12 @@ import ( observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) -// GasPriceVoter submits information about the connected chain's gas price at a specific block +// VoteGasPrice submits information about the connected chain's gas price at a specific block // height. Gas price submitted by each validator is recorded separately and a // median index is updated. // // Only observer validators are authorized to broadcast this message. -func (k msgServer) GasPriceVoter(goCtx context.Context, msg *types.MsgGasPriceVoter) (*types.MsgGasPriceVoterResponse, error) { +func (k msgServer) VoteGasPrice(goCtx context.Context, msg *types.MsgVoteGasPrice) (*types.MsgVoteGasPriceResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) chain := k.zetaObserverKeeper.GetSupportedChainFromChainID(ctx, msg.ChainId) @@ -78,7 +78,7 @@ func (k msgServer) GasPriceVoter(goCtx context.Context, msg *types.MsgGasPriceVo // reset the gas count k.ResetGasMeterAndConsumeGas(ctx, gasUsed) - return &types.MsgGasPriceVoterResponse{}, nil + return &types.MsgVoteGasPriceResponse{}, nil } type indexValue struct { diff --git a/x/crosschain/keeper/msg_server_gas_price_voter_test.go b/x/crosschain/keeper/msg_server_vote_gas_price_test.go similarity index 93% rename from x/crosschain/keeper/msg_server_gas_price_voter_test.go rename to x/crosschain/keeper/msg_server_vote_gas_price_test.go index 50c11dbaa9..85b5b26c46 100644 --- a/x/crosschain/keeper/msg_server_gas_price_voter_test.go +++ b/x/crosschain/keeper/msg_server_vote_gas_price_test.go @@ -13,7 +13,7 @@ import ( "github.com/zeta-chain/zetacore/x/crosschain/types" ) -func TestMsgServer_GasPriceVoter(t *testing.T) { +func TestMsgServer_VoteGasPrice(t *testing.T) { t.Run("should error if unsupported chain", func(t *testing.T) { k, ctx, _, _ := keepertest.CrosschainKeeperWithMocks(t, keepertest.CrosschainMockOptions{ UseObserverMock: true, @@ -24,7 +24,7 @@ func TestMsgServer_GasPriceVoter(t *testing.T) { msgServer := keeper.NewMsgServerImpl(*k) - res, err := msgServer.GasPriceVoter(ctx, &types.MsgGasPriceVoter{ + res, err := msgServer.VoteGasPrice(ctx, &types.MsgVoteGasPrice{ ChainId: 5, }) require.Error(t, err) @@ -42,7 +42,7 @@ func TestMsgServer_GasPriceVoter(t *testing.T) { msgServer := keeper.NewMsgServerImpl(*k) - res, err := msgServer.GasPriceVoter(ctx, &types.MsgGasPriceVoter{ + res, err := msgServer.VoteGasPrice(ctx, &types.MsgVoteGasPrice{ ChainId: 5, }) require.Error(t, err) @@ -65,7 +65,7 @@ func TestMsgServer_GasPriceVoter(t *testing.T) { fungibleMock.On("SetGasPrice", mock.Anything, mock.Anything, mock.Anything).Return(uint64(0), errors.New("err")) msgServer := keeper.NewMsgServerImpl(*k) - res, err := msgServer.GasPriceVoter(ctx, &types.MsgGasPriceVoter{ + res, err := msgServer.VoteGasPrice(ctx, &types.MsgVoteGasPrice{ ChainId: 5, }) require.Error(t, err) @@ -90,7 +90,7 @@ func TestMsgServer_GasPriceVoter(t *testing.T) { fungibleMock.On("SetGasPrice", mock.Anything, mock.Anything, mock.Anything).Return(uint64(1), nil) msgServer := keeper.NewMsgServerImpl(*k) creator := sample.AccAddress() - res, err := msgServer.GasPriceVoter(ctx, &types.MsgGasPriceVoter{ + res, err := msgServer.VoteGasPrice(ctx, &types.MsgVoteGasPrice{ Creator: creator, ChainId: 5, Price: 1, @@ -136,7 +136,7 @@ func TestMsgServer_GasPriceVoter(t *testing.T) { Prices: []uint64{1}, }) - res, err := msgServer.GasPriceVoter(ctx, &types.MsgGasPriceVoter{ + res, err := msgServer.VoteGasPrice(ctx, &types.MsgVoteGasPrice{ Creator: creator, ChainId: 5, BlockNumber: 2, @@ -181,7 +181,7 @@ func TestMsgServer_GasPriceVoter(t *testing.T) { Prices: []uint64{1}, }) - res, err := msgServer.GasPriceVoter(ctx, &types.MsgGasPriceVoter{ + res, err := msgServer.VoteGasPrice(ctx, &types.MsgVoteGasPrice{ Creator: creator, ChainId: 5, BlockNumber: 2, diff --git a/x/crosschain/types/authz.go b/x/crosschain/types/authz.go index 6ee58171ff..5df64a701a 100644 --- a/x/crosschain/types/authz.go +++ b/x/crosschain/types/authz.go @@ -8,7 +8,7 @@ import ( // GetAllAuthzZetaclientTxTypes returns all the authz types for required for zetaclient func GetAllAuthzZetaclientTxTypes() []string { return []string{ - sdk.MsgTypeURL(&MsgGasPriceVoter{}), + sdk.MsgTypeURL(&MsgVoteGasPrice{}), sdk.MsgTypeURL(&MsgVoteOnObservedInboundTx{}), sdk.MsgTypeURL(&MsgVoteOnObservedOutboundTx{}), sdk.MsgTypeURL(&MsgAddToOutTxTracker{}), diff --git a/x/crosschain/types/authz_test.go b/x/crosschain/types/authz_test.go index 7c615d7c6b..0ebd56f3b7 100644 --- a/x/crosschain/types/authz_test.go +++ b/x/crosschain/types/authz_test.go @@ -8,7 +8,7 @@ import ( ) func TestGetAllAuthzZetaclientTxTypes(t *testing.T) { - require.Equal(t, []string{"/zetachain.zetacore.crosschain.MsgGasPriceVoter", + require.Equal(t, []string{"/zetachain.zetacore.crosschain.MsgVoteGasPrice", "/zetachain.zetacore.crosschain.MsgVoteOnObservedInboundTx", "/zetachain.zetacore.crosschain.MsgVoteOnObservedOutboundTx", "/zetachain.zetacore.crosschain.MsgAddToOutTxTracker", diff --git a/x/crosschain/types/codec.go b/x/crosschain/types/codec.go index 7fcbc0cc0c..757cb73ad7 100644 --- a/x/crosschain/types/codec.go +++ b/x/crosschain/types/codec.go @@ -11,7 +11,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgAddToOutTxTracker{}, "crosschain/AddToOutTxTracker", nil) cdc.RegisterConcrete(&MsgAddToInTxTracker{}, "crosschain/AddToInTxTracker", nil) cdc.RegisterConcrete(&MsgRemoveFromOutTxTracker{}, "crosschain/RemoveFromOutTxTracker", nil) - cdc.RegisterConcrete(&MsgGasPriceVoter{}, "crosschain/GasPriceVoter", nil) + cdc.RegisterConcrete(&MsgVoteGasPrice{}, "crosschain/VoteGasPrice", nil) cdc.RegisterConcrete(&MsgVoteOnObservedOutboundTx{}, "crosschain/VoteOnObservedOutboundTx", nil) cdc.RegisterConcrete(&MsgVoteOnObservedInboundTx{}, "crosschain/VoteOnObservedInboundTx", nil) cdc.RegisterConcrete(&MsgWhitelistERC20{}, "crosschain/WhitelistERC20", nil) @@ -25,7 +25,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgAddToOutTxTracker{}, &MsgAddToInTxTracker{}, &MsgRemoveFromOutTxTracker{}, - &MsgGasPriceVoter{}, + &MsgVoteGasPrice{}, &MsgVoteOnObservedOutboundTx{}, &MsgVoteOnObservedInboundTx{}, &MsgWhitelistERC20{}, diff --git a/x/crosschain/types/message_gas_price_voter.go b/x/crosschain/types/message_vote_gas_price.go similarity index 66% rename from x/crosschain/types/message_gas_price_voter.go rename to x/crosschain/types/message_vote_gas_price.go index 89dc8030c4..31ae0479ea 100644 --- a/x/crosschain/types/message_gas_price_voter.go +++ b/x/crosschain/types/message_vote_gas_price.go @@ -7,10 +7,10 @@ import ( "github.com/zeta-chain/zetacore/pkg/authz" ) -var _ sdk.Msg = &MsgGasPriceVoter{} +var _ sdk.Msg = &MsgVoteGasPrice{} -func NewMsgGasPriceVoter(creator string, chain int64, price uint64, supply string, blockNumber uint64) *MsgGasPriceVoter { - return &MsgGasPriceVoter{ +func NewMsgVoteGasPrice(creator string, chain int64, price uint64, supply string, blockNumber uint64) *MsgVoteGasPrice { + return &MsgVoteGasPrice{ Creator: creator, ChainId: chain, Price: price, @@ -19,15 +19,15 @@ func NewMsgGasPriceVoter(creator string, chain int64, price uint64, supply strin } } -func (msg *MsgGasPriceVoter) Route() string { +func (msg *MsgVoteGasPrice) Route() string { return RouterKey } -func (msg *MsgGasPriceVoter) Type() string { +func (msg *MsgVoteGasPrice) Type() string { return authz.GasPriceVoter.String() } -func (msg *MsgGasPriceVoter) GetSigners() []sdk.AccAddress { +func (msg *MsgVoteGasPrice) GetSigners() []sdk.AccAddress { creator, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { panic(err) @@ -35,12 +35,12 @@ func (msg *MsgGasPriceVoter) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{creator} } -func (msg *MsgGasPriceVoter) GetSignBytes() []byte { +func (msg *MsgVoteGasPrice) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } -func (msg *MsgGasPriceVoter) ValidateBasic() error { +func (msg *MsgVoteGasPrice) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { return cosmoserrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) diff --git a/x/crosschain/types/message_gas_price_voter_test.go b/x/crosschain/types/message_vote_gas_price_test.go similarity index 75% rename from x/crosschain/types/message_gas_price_voter_test.go rename to x/crosschain/types/message_vote_gas_price_test.go index 10ce98a1bd..295d8b6342 100644 --- a/x/crosschain/types/message_gas_price_voter_test.go +++ b/x/crosschain/types/message_vote_gas_price_test.go @@ -11,15 +11,15 @@ import ( "github.com/zeta-chain/zetacore/x/crosschain/types" ) -func TestMsgGasPriceVoter_ValidateBasic(t *testing.T) { +func TestMsgVoteGasPrice_ValidateBasic(t *testing.T) { tests := []struct { name string - msg *types.MsgGasPriceVoter + msg *types.MsgVoteGasPrice err error }{ { name: "invalid address", - msg: types.NewMsgGasPriceVoter( + msg: types.NewMsgVoteGasPrice( "invalid", 1, 1, @@ -30,7 +30,7 @@ func TestMsgGasPriceVoter_ValidateBasic(t *testing.T) { }, { name: "invalid chain id", - msg: types.NewMsgGasPriceVoter( + msg: types.NewMsgVoteGasPrice( sample.AccAddress(), -1, 1, @@ -41,7 +41,7 @@ func TestMsgGasPriceVoter_ValidateBasic(t *testing.T) { }, { name: "valid address", - msg: types.NewMsgGasPriceVoter( + msg: types.NewMsgVoteGasPrice( sample.AccAddress(), 1, 1, @@ -62,23 +62,23 @@ func TestMsgGasPriceVoter_ValidateBasic(t *testing.T) { } } -func TestMsgGasPriceVoter_GetSigners(t *testing.T) { +func TestMsgVoteGasPrice_GetSigners(t *testing.T) { signer := sample.AccAddress() tests := []struct { name string - msg types.MsgGasPriceVoter + msg types.MsgVoteGasPrice panics bool }{ { name: "valid signer", - msg: types.MsgGasPriceVoter{ + msg: types.MsgVoteGasPrice{ Creator: signer, }, panics: false, }, { name: "invalid signer", - msg: types.MsgGasPriceVoter{ + msg: types.MsgVoteGasPrice{ Creator: "invalid", }, panics: true, @@ -99,22 +99,22 @@ func TestMsgGasPriceVoter_GetSigners(t *testing.T) { } } -func TestMsgGasPriceVoter_Type(t *testing.T) { - msg := types.MsgGasPriceVoter{ +func TestMsgVoteGasPricer_Type(t *testing.T) { + msg := types.MsgVoteGasPrice{ Creator: sample.AccAddress(), } require.Equal(t, authz.GasPriceVoter.String(), msg.Type()) } -func TestMsgGasPriceVoter_Route(t *testing.T) { - msg := types.MsgGasPriceVoter{ +func TestMsgVoteGasPrice_Route(t *testing.T) { + msg := types.MsgVoteGasPrice{ Creator: sample.AccAddress(), } require.Equal(t, types.RouterKey, msg.Route()) } -func TestMsgGasPriceVoter_GetSignBytes(t *testing.T) { - msg := types.MsgGasPriceVoter{ +func TestMsgVoteGasPrice_GetSignBytes(t *testing.T) { + msg := types.MsgVoteGasPrice{ Creator: sample.AccAddress(), } require.NotPanics(t, func() { diff --git a/x/crosschain/types/tx.pb.go b/x/crosschain/types/tx.pb.go index 076bcecaec..54c8aee125 100644 --- a/x/crosschain/types/tx.pb.go +++ b/x/crosschain/types/tx.pb.go @@ -714,7 +714,7 @@ func (m *MsgRemoveFromOutTxTrackerResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRemoveFromOutTxTrackerResponse proto.InternalMessageInfo -type MsgGasPriceVoter struct { +type MsgVoteGasPrice 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"` Price uint64 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` @@ -722,18 +722,18 @@ type MsgGasPriceVoter struct { Supply string `protobuf:"bytes,5,opt,name=supply,proto3" json:"supply,omitempty"` } -func (m *MsgGasPriceVoter) Reset() { *m = MsgGasPriceVoter{} } -func (m *MsgGasPriceVoter) String() string { return proto.CompactTextString(m) } -func (*MsgGasPriceVoter) ProtoMessage() {} -func (*MsgGasPriceVoter) Descriptor() ([]byte, []int) { +func (m *MsgVoteGasPrice) Reset() { *m = MsgVoteGasPrice{} } +func (m *MsgVoteGasPrice) String() string { return proto.CompactTextString(m) } +func (*MsgVoteGasPrice) ProtoMessage() {} +func (*MsgVoteGasPrice) Descriptor() ([]byte, []int) { return fileDescriptor_81d6d611190b7635, []int{12} } -func (m *MsgGasPriceVoter) XXX_Unmarshal(b []byte) error { +func (m *MsgVoteGasPrice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgGasPriceVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgVoteGasPrice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgGasPriceVoter.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgVoteGasPrice.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -743,68 +743,68 @@ func (m *MsgGasPriceVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *MsgGasPriceVoter) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgGasPriceVoter.Merge(m, src) +func (m *MsgVoteGasPrice) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteGasPrice.Merge(m, src) } -func (m *MsgGasPriceVoter) XXX_Size() int { +func (m *MsgVoteGasPrice) XXX_Size() int { return m.Size() } -func (m *MsgGasPriceVoter) XXX_DiscardUnknown() { - xxx_messageInfo_MsgGasPriceVoter.DiscardUnknown(m) +func (m *MsgVoteGasPrice) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteGasPrice.DiscardUnknown(m) } -var xxx_messageInfo_MsgGasPriceVoter proto.InternalMessageInfo +var xxx_messageInfo_MsgVoteGasPrice proto.InternalMessageInfo -func (m *MsgGasPriceVoter) GetCreator() string { +func (m *MsgVoteGasPrice) GetCreator() string { if m != nil { return m.Creator } return "" } -func (m *MsgGasPriceVoter) GetChainId() int64 { +func (m *MsgVoteGasPrice) GetChainId() int64 { if m != nil { return m.ChainId } return 0 } -func (m *MsgGasPriceVoter) GetPrice() uint64 { +func (m *MsgVoteGasPrice) GetPrice() uint64 { if m != nil { return m.Price } return 0 } -func (m *MsgGasPriceVoter) GetBlockNumber() uint64 { +func (m *MsgVoteGasPrice) GetBlockNumber() uint64 { if m != nil { return m.BlockNumber } return 0 } -func (m *MsgGasPriceVoter) GetSupply() string { +func (m *MsgVoteGasPrice) GetSupply() string { if m != nil { return m.Supply } return "" } -type MsgGasPriceVoterResponse struct { +type MsgVoteGasPriceResponse struct { } -func (m *MsgGasPriceVoterResponse) Reset() { *m = MsgGasPriceVoterResponse{} } -func (m *MsgGasPriceVoterResponse) String() string { return proto.CompactTextString(m) } -func (*MsgGasPriceVoterResponse) ProtoMessage() {} -func (*MsgGasPriceVoterResponse) Descriptor() ([]byte, []int) { +func (m *MsgVoteGasPriceResponse) Reset() { *m = MsgVoteGasPriceResponse{} } +func (m *MsgVoteGasPriceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVoteGasPriceResponse) ProtoMessage() {} +func (*MsgVoteGasPriceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_81d6d611190b7635, []int{13} } -func (m *MsgGasPriceVoterResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgVoteGasPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgGasPriceVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgVoteGasPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgGasPriceVoterResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgVoteGasPriceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -814,17 +814,17 @@ func (m *MsgGasPriceVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *MsgGasPriceVoterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgGasPriceVoterResponse.Merge(m, src) +func (m *MsgVoteGasPriceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteGasPriceResponse.Merge(m, src) } -func (m *MsgGasPriceVoterResponse) XXX_Size() int { +func (m *MsgVoteGasPriceResponse) XXX_Size() int { return m.Size() } -func (m *MsgGasPriceVoterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgGasPriceVoterResponse.DiscardUnknown(m) +func (m *MsgVoteGasPriceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteGasPriceResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgGasPriceVoterResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgVoteGasPriceResponse proto.InternalMessageInfo type MsgVoteOnObservedOutboundTx struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` @@ -1357,8 +1357,8 @@ func init() { proto.RegisterType((*MsgAddToOutTxTrackerResponse)(nil), "zetachain.zetacore.crosschain.MsgAddToOutTxTrackerResponse") proto.RegisterType((*MsgRemoveFromOutTxTracker)(nil), "zetachain.zetacore.crosschain.MsgRemoveFromOutTxTracker") proto.RegisterType((*MsgRemoveFromOutTxTrackerResponse)(nil), "zetachain.zetacore.crosschain.MsgRemoveFromOutTxTrackerResponse") - proto.RegisterType((*MsgGasPriceVoter)(nil), "zetachain.zetacore.crosschain.MsgGasPriceVoter") - proto.RegisterType((*MsgGasPriceVoterResponse)(nil), "zetachain.zetacore.crosschain.MsgGasPriceVoterResponse") + proto.RegisterType((*MsgVoteGasPrice)(nil), "zetachain.zetacore.crosschain.MsgVoteGasPrice") + proto.RegisterType((*MsgVoteGasPriceResponse)(nil), "zetachain.zetacore.crosschain.MsgVoteGasPriceResponse") proto.RegisterType((*MsgVoteOnObservedOutboundTx)(nil), "zetachain.zetacore.crosschain.MsgVoteOnObservedOutboundTx") proto.RegisterType((*MsgVoteOnObservedOutboundTxResponse)(nil), "zetachain.zetacore.crosschain.MsgVoteOnObservedOutboundTxResponse") proto.RegisterType((*MsgVoteOnObservedInboundTx)(nil), "zetachain.zetacore.crosschain.MsgVoteOnObservedInboundTx") @@ -1372,98 +1372,98 @@ func init() { func init() { proto.RegisterFile("crosschain/tx.proto", fileDescriptor_81d6d611190b7635) } var fileDescriptor_81d6d611190b7635 = []byte{ - // 1451 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x18, 0x5d, 0x6b, 0xdb, 0x56, - 0x3b, 0x7a, 0x93, 0x38, 0xf6, 0x93, 0xd8, 0x69, 0x95, 0xb4, 0x71, 0x95, 0xc6, 0x49, 0x95, 0xb7, - 0x7d, 0x03, 0x2f, 0xb5, 0x5b, 0x97, 0x97, 0xb7, 0xed, 0x36, 0x58, 0x12, 0xfa, 0x91, 0xad, 0x69, - 0x8a, 0xea, 0x6e, 0x63, 0x37, 0x42, 0x96, 0x4e, 0x64, 0x11, 0x5b, 0xc7, 0xe8, 0x1c, 0x05, 0x3b, - 0x0c, 0x36, 0x06, 0xbb, 0x1f, 0x63, 0xb0, 0xb1, 0x5f, 0xd4, 0xcb, 0xb2, 0x9b, 0x7d, 0x5c, 0x94, - 0xd1, 0xb2, 0xeb, 0xc1, 0x7e, 0xc1, 0xd0, 0x73, 0x8e, 0x15, 0xcb, 0x8e, 0x3f, 0x92, 0xd0, 0x1b, - 0x5b, 0xcf, 0x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x7c, - 0x6b, 0x88, 0x3b, 0xd6, 0x21, 0x4b, 0x02, 0xbb, 0x7c, 0xcb, 0xb4, 0x84, 0x67, 0x65, 0x04, 0xe6, + // 1452 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x18, 0x5d, 0x4f, 0xdb, 0x56, + 0x1b, 0xbf, 0x40, 0x48, 0x1e, 0x48, 0x78, 0x6b, 0x68, 0x09, 0xa6, 0x04, 0x6a, 0xde, 0xf6, 0x45, + 0x7a, 0xd5, 0xa4, 0x4d, 0xf5, 0x4e, 0x6d, 0xb7, 0x49, 0x03, 0xd4, 0x0f, 0xb6, 0x52, 0x2a, 0x37, + 0xdd, 0xa6, 0xdd, 0x58, 0x8e, 0x7d, 0x70, 0x2c, 0x12, 0x9f, 0xc8, 0xe7, 0x38, 0x0a, 0x68, 0xd2, + 0xa6, 0x49, 0xbb, 0x9f, 0xa6, 0x49, 0x95, 0xf6, 0x8b, 0x7a, 0x59, 0xed, 0x66, 0x1f, 0x17, 0xd5, + 0x44, 0x7f, 0xc0, 0xa4, 0xfd, 0x82, 0xc9, 0xcf, 0x39, 0x31, 0x71, 0x42, 0x3e, 0xa0, 0xea, 0x4d, + 0xe2, 0xe7, 0x39, 0xe7, 0xf9, 0xfe, 0xb4, 0x61, 0xc1, 0x0e, 0x28, 0x63, 0x76, 0xcd, 0xf2, 0xfc, + 0x12, 0x6f, 0x17, 0x9b, 0x01, 0xe5, 0x54, 0x5d, 0x3d, 0x26, 0xdc, 0x42, 0x5c, 0x11, 0x9f, 0x68, + 0x40, 0x8a, 0xa7, 0xf7, 0xb4, 0x45, 0x97, 0xba, 0x14, 0x6f, 0x96, 0xa2, 0x27, 0x41, 0xa4, 0x2d, + 0x35, 0x0f, 0xdd, 0x12, 0x5e, 0x60, 0xf2, 0x4f, 0x1e, 0x2c, 0xe0, 0x01, 0xf5, 0x7c, 0xfc, 0xe9, + 0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, 0x8b, 0xb9, 0x68, 0x09, 0x66, 0x78, 0xdb, 0xac, 0x59, 0xac, + 0x26, 0x7c, 0x64, 0xa4, 0x78, 0xfb, 0xb1, 0xc5, 0x6a, 0xea, 0xff, 0x20, 0x13, 0x85, 0xcb, 0x8c, + 0xbc, 0x91, 0x9f, 0x5a, 0x57, 0x36, 0x73, 0xe5, 0x5c, 0x11, 0x03, 0xb8, 0x43, 0x3d, 0xbf, 0x72, + 0xd4, 0x24, 0x46, 0xda, 0x96, 0x4f, 0xea, 0x06, 0x4c, 0x63, 0x10, 0xf3, 0xd3, 0xeb, 0xca, 0xe6, + 0x6c, 0x39, 0x5b, 0x94, 0x21, 0x7d, 0x16, 0xfd, 0x19, 0xe2, 0x2c, 0xb2, 0xba, 0x5a, 0xa7, 0xf6, + 0xa1, 0x90, 0x96, 0x12, 0x56, 0x23, 0x06, 0x05, 0x2e, 0x43, 0x9a, 0xb7, 0x4d, 0xcf, 0x77, 0x48, + 0x3b, 0x3f, 0x23, 0x94, 0xe4, 0xed, 0xdd, 0x08, 0x94, 0x0e, 0xe9, 0x35, 0x38, 0x76, 0xc8, 0x2f, + 0x0a, 0x5c, 0xda, 0x63, 0xee, 0x17, 0x35, 0x8f, 0x93, 0xba, 0xc7, 0xf8, 0x03, 0x63, 0xa7, 0x7c, + 0x6b, 0x88, 0x3b, 0x36, 0x20, 0x4b, 0x02, 0xbb, 0x7c, 0xcb, 0xb4, 0x84, 0x67, 0x65, 0x04, 0xe6, 0x10, 0xd9, 0x89, 0x5e, 0xb7, 0xcf, 0x26, 0x93, 0x3e, 0x53, 0x61, 0xca, 0xb7, 0x1a, 0xc2, 0x2b, - 0x19, 0x03, 0x9f, 0xd5, 0xcb, 0x90, 0x62, 0xed, 0x46, 0x95, 0xd6, 0xd1, 0x05, 0x19, 0x43, 0x42, - 0xaa, 0x06, 0x69, 0x87, 0xd8, 0x5e, 0xc3, 0xaa, 0x33, 0x34, 0x39, 0x6b, 0xc4, 0xb0, 0xba, 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29, 0xc6, 0x2d, 0x1e, - 0x8a, 0x5e, 0x99, 0x2b, 0x5f, 0x2a, 0xca, 0x4d, 0x42, 0xde, 0x78, 0x8e, 0x87, 0x86, 0xbc, 0xa4, - 0xae, 0xc2, 0xac, 0x30, 0x11, 0x6f, 0xc9, 0x26, 0x00, 0x88, 0xda, 0x8e, 0x30, 0xea, 0x0d, 0x98, - 0x17, 0x17, 0xa2, 0x71, 0x2b, 0x0a, 0x30, 0x8d, 0x96, 0x67, 0x11, 0x5d, 0x61, 0xec, 0x29, 0xf6, - 0xa9, 0xc4, 0xb0, 0xcb, 0x0c, 0x1f, 0x76, 0xfa, 0x75, 0x58, 0x1f, 0x92, 0xd8, 0x71, 0x01, 0x7c, - 0x35, 0x85, 0x4b, 0x43, 0xf2, 0xde, 0x8e, 0x3f, 0x3a, 0xff, 0xa3, 0x6a, 0x23, 0xbe, 0x43, 0x02, - 0x99, 0xfc, 0x12, 0x8a, 0x8c, 0x11, 0x4f, 0x66, 0xcf, 0x60, 0xca, 0x0a, 0xf4, 0xb6, 0x2c, 0x73, - 0x0d, 0xd2, 0xd2, 0xc1, 0x81, 0xec, 0xba, 0x31, 0xac, 0x5e, 0x87, 0x5c, 0xe7, 0x59, 0x3a, 0x6d, - 0x5a, 0xb0, 0xe8, 0x60, 0x85, 0xdf, 0x8e, 0x17, 0xa7, 0xd4, 0xb9, 0x16, 0xa7, 0xc8, 0xca, 0x06, + 0x19, 0x03, 0x9f, 0xd5, 0x2b, 0x90, 0x62, 0x47, 0x8d, 0x2a, 0xad, 0xa3, 0x0b, 0x32, 0x86, 0x84, + 0x54, 0x0d, 0xd2, 0x0e, 0xb1, 0xbd, 0x86, 0x55, 0x67, 0x68, 0x72, 0xd6, 0x88, 0x61, 0x75, 0x05, + 0x32, 0xae, 0xc5, 0xcc, 0xba, 0xd7, 0xf0, 0xb8, 0x34, 0x39, 0xed, 0x5a, 0xec, 0x49, 0x04, 0xeb, + 0x26, 0x2c, 0xf7, 0xd9, 0x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 0x87, 0x07, 0x02, 0x88, 0xd2, - 0x8f, 0x1c, 0x12, 0x9f, 0xcb, 0x19, 0x34, 0x8f, 0xe2, 0x01, 0x51, 0x62, 0x0c, 0xfd, 0x1b, 0xf4, - 0xc1, 0x19, 0x10, 0x27, 0xca, 0x13, 0xdc, 0x5e, 0x36, 0xab, 0x34, 0xe0, 0xcf, 0x79, 0x68, 0x1f, - 0x6c, 0x6f, 0x57, 0x3e, 0x1b, 0xbe, 0x3c, 0x0e, 0x1b, 0xeb, 0xcb, 0x38, 0xbb, 0x92, 0xdc, 0x62, - 0x51, 0x87, 0x38, 0xf2, 0x0d, 0xb2, 0x1f, 0xfa, 0x0e, 0x5e, 0x21, 0xce, 0xb9, 0xa4, 0x89, 0x7c, - 0x8a, 0xb8, 0xc5, 0x9b, 0x88, 0xe8, 0xc4, 0x59, 0x81, 0x95, 0xab, 0x88, 0x5e, 0xc0, 0x79, 0xdc, - 0x27, 0xb7, 0xa3, 0x57, 0xf9, 0xcf, 0x59, 0x98, 0xdc, 0x65, 0xae, 0xfa, 0x8d, 0x02, 0x17, 0xfb, - 0x17, 0x92, 0x3b, 0xc5, 0xa1, 0xef, 0x23, 0xc5, 0x93, 0x46, 0xbd, 0xf6, 0xde, 0x19, 0x88, 0xe2, - 0xfd, 0xe0, 0x6b, 0x05, 0x2e, 0xf4, 0xed, 0xd7, 0xe5, 0x31, 0x39, 0x76, 0xd1, 0x68, 0xf7, 0x4f, - 0x4f, 0x13, 0x2b, 0xf1, 0xbd, 0x02, 0x97, 0x07, 0xec, 0x20, 0x77, 0x47, 0xb3, 0x3d, 0x99, 0x52, - 0xfb, 0xf0, 0xac, 0x94, 0xb1, 0x5a, 0x6d, 0xc8, 0x26, 0x77, 0x91, 0xd2, 0x68, 0x96, 0x09, 0x02, - 0xed, 0xff, 0xa7, 0x24, 0x88, 0x45, 0xff, 0xa4, 0x40, 0x7e, 0xe0, 0x42, 0x31, 0x86, 0xab, 0x07, - 0xd1, 0x6a, 0x5b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 0xad, 0x88, 0xd8, 0xde, 0x14, 0x5f, 0xa3, 0x3a, 0x12, + 0x4a, 0xed, 0x52, 0xf7, 0x37, 0xaa, 0x68, 0xcb, 0xa8, 0xa6, 0xf0, 0x5b, 0xd1, 0x9d, 0x7f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x14, 0x36, 0x6f, 0x72, 0xbe, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1481,7 +1481,7 @@ type MsgClient interface { AddToOutTxTracker(ctx context.Context, in *MsgAddToOutTxTracker, opts ...grpc.CallOption) (*MsgAddToOutTxTrackerResponse, error) AddToInTxTracker(ctx context.Context, in *MsgAddToInTxTracker, opts ...grpc.CallOption) (*MsgAddToInTxTrackerResponse, error) RemoveFromOutTxTracker(ctx context.Context, in *MsgRemoveFromOutTxTracker, opts ...grpc.CallOption) (*MsgRemoveFromOutTxTrackerResponse, error) - GasPriceVoter(ctx context.Context, in *MsgGasPriceVoter, opts ...grpc.CallOption) (*MsgGasPriceVoterResponse, error) + VoteGasPrice(ctx context.Context, in *MsgVoteGasPrice, opts ...grpc.CallOption) (*MsgVoteGasPriceResponse, error) VoteOnObservedOutboundTx(ctx context.Context, in *MsgVoteOnObservedOutboundTx, opts ...grpc.CallOption) (*MsgVoteOnObservedOutboundTxResponse, error) VoteOnObservedInboundTx(ctx context.Context, in *MsgVoteOnObservedInboundTx, opts ...grpc.CallOption) (*MsgVoteOnObservedInboundTxResponse, error) WhitelistERC20(ctx context.Context, in *MsgWhitelistERC20, opts ...grpc.CallOption) (*MsgWhitelistERC20Response, error) @@ -1526,9 +1526,9 @@ func (c *msgClient) RemoveFromOutTxTracker(ctx context.Context, in *MsgRemoveFro return out, nil } -func (c *msgClient) GasPriceVoter(ctx context.Context, in *MsgGasPriceVoter, opts ...grpc.CallOption) (*MsgGasPriceVoterResponse, error) { - out := new(MsgGasPriceVoterResponse) - err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Msg/GasPriceVoter", in, out, opts...) +func (c *msgClient) VoteGasPrice(ctx context.Context, in *MsgVoteGasPrice, opts ...grpc.CallOption) (*MsgVoteGasPriceResponse, error) { + out := new(MsgVoteGasPriceResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Msg/VoteGasPrice", in, out, opts...) if err != nil { return nil, err } @@ -1603,7 +1603,7 @@ type MsgServer interface { AddToOutTxTracker(context.Context, *MsgAddToOutTxTracker) (*MsgAddToOutTxTrackerResponse, error) AddToInTxTracker(context.Context, *MsgAddToInTxTracker) (*MsgAddToInTxTrackerResponse, error) RemoveFromOutTxTracker(context.Context, *MsgRemoveFromOutTxTracker) (*MsgRemoveFromOutTxTrackerResponse, error) - GasPriceVoter(context.Context, *MsgGasPriceVoter) (*MsgGasPriceVoterResponse, error) + VoteGasPrice(context.Context, *MsgVoteGasPrice) (*MsgVoteGasPriceResponse, error) VoteOnObservedOutboundTx(context.Context, *MsgVoteOnObservedOutboundTx) (*MsgVoteOnObservedOutboundTxResponse, error) VoteOnObservedInboundTx(context.Context, *MsgVoteOnObservedInboundTx) (*MsgVoteOnObservedInboundTxResponse, error) WhitelistERC20(context.Context, *MsgWhitelistERC20) (*MsgWhitelistERC20Response, error) @@ -1626,8 +1626,8 @@ func (*UnimplementedMsgServer) AddToInTxTracker(ctx context.Context, req *MsgAdd func (*UnimplementedMsgServer) RemoveFromOutTxTracker(ctx context.Context, req *MsgRemoveFromOutTxTracker) (*MsgRemoveFromOutTxTrackerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveFromOutTxTracker not implemented") } -func (*UnimplementedMsgServer) GasPriceVoter(ctx context.Context, req *MsgGasPriceVoter) (*MsgGasPriceVoterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GasPriceVoter not implemented") +func (*UnimplementedMsgServer) VoteGasPrice(ctx context.Context, req *MsgVoteGasPrice) (*MsgVoteGasPriceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VoteGasPrice not implemented") } func (*UnimplementedMsgServer) VoteOnObservedOutboundTx(ctx context.Context, req *MsgVoteOnObservedOutboundTx) (*MsgVoteOnObservedOutboundTxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VoteOnObservedOutboundTx not implemented") @@ -1709,20 +1709,20 @@ func _Msg_RemoveFromOutTxTracker_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } -func _Msg_GasPriceVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgGasPriceVoter) +func _Msg_VoteGasPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVoteGasPrice) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).GasPriceVoter(ctx, in) + return srv.(MsgServer).VoteGasPrice(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/zetachain.zetacore.crosschain.Msg/GasPriceVoter", + FullMethod: "/zetachain.zetacore.crosschain.Msg/VoteGasPrice", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).GasPriceVoter(ctx, req.(*MsgGasPriceVoter)) + return srv.(MsgServer).VoteGasPrice(ctx, req.(*MsgVoteGasPrice)) } return interceptor(ctx, in, info, handler) } @@ -1870,8 +1870,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_RemoveFromOutTxTracker_Handler, }, { - MethodName: "GasPriceVoter", - Handler: _Msg_GasPriceVoter_Handler, + MethodName: "VoteGasPrice", + Handler: _Msg_VoteGasPrice_Handler, }, { MethodName: "VoteOnObservedOutboundTx", @@ -2398,7 +2398,7 @@ func (m *MsgRemoveFromOutTxTrackerResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *MsgGasPriceVoter) Marshal() (dAtA []byte, err error) { +func (m *MsgVoteGasPrice) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2408,12 +2408,12 @@ func (m *MsgGasPriceVoter) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgGasPriceVoter) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgVoteGasPrice) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgGasPriceVoter) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgVoteGasPrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2450,7 +2450,7 @@ func (m *MsgGasPriceVoter) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgGasPriceVoterResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgVoteGasPriceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2460,12 +2460,12 @@ func (m *MsgGasPriceVoterResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgGasPriceVoterResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgVoteGasPriceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgGasPriceVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgVoteGasPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3089,7 +3089,7 @@ func (m *MsgRemoveFromOutTxTrackerResponse) Size() (n int) { return n } -func (m *MsgGasPriceVoter) Size() (n int) { +func (m *MsgVoteGasPrice) Size() (n int) { if m == nil { return 0 } @@ -3115,7 +3115,7 @@ func (m *MsgGasPriceVoter) Size() (n int) { return n } -func (m *MsgGasPriceVoterResponse) Size() (n int) { +func (m *MsgVoteGasPriceResponse) Size() (n int) { if m == nil { return 0 } @@ -4773,7 +4773,7 @@ func (m *MsgRemoveFromOutTxTrackerResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgGasPriceVoter) Unmarshal(dAtA []byte) error { +func (m *MsgVoteGasPrice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4796,10 +4796,10 @@ func (m *MsgGasPriceVoter) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgGasPriceVoter: wiretype end group for non-group") + return fmt.Errorf("proto: MsgVoteGasPrice: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgGasPriceVoter: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgVoteGasPrice: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4944,7 +4944,7 @@ func (m *MsgGasPriceVoter) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgGasPriceVoterResponse) Unmarshal(dAtA []byte) error { +func (m *MsgVoteGasPriceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4967,10 +4967,10 @@ func (m *MsgGasPriceVoterResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgGasPriceVoterResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgVoteGasPriceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgGasPriceVoterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgVoteGasPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/zetaclient/zetabridge/tx.go b/zetaclient/zetabridge/tx.go index e7cbebd06a..da854a2386 100644 --- a/zetaclient/zetabridge/tx.go +++ b/zetaclient/zetabridge/tx.go @@ -53,7 +53,7 @@ func (b *ZetaCoreBridge) PostGasPrice(chain chains.Chain, gasPrice uint64, suppl // #nosec G701 always in range gasPrice = uint64(float64(gasPrice) * multiplier) signerAddress := b.keys.GetOperatorAddress().String() - msg := types.NewMsgGasPriceVoter(signerAddress, chain.ChainId, gasPrice, supply, blockNum) + msg := types.NewMsgVoteGasPrice(signerAddress, chain.ChainId, gasPrice, supply, blockNum) authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) if err != nil { From 58a1b2352ede05c379e26e47a5316e89b2d03715 Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Tue, 16 Apr 2024 11:58:29 +0200 Subject: [PATCH 2/2] test(e2e): add connector bytecode update admin test (#2008) * rename zrc20 bytecode update * connector test contract * e2e test * fix and improve test * changelog * remove withdraw test in admin test list --- changelog.md | 1 + cmd/zetae2e/local/local.go | 3 +- .../TestZetaConnectorZEVM.abi | 202 ++++++ .../TestZetaConnectorZEVM.bin | 1 + .../TestZetaConnectorZEVM.go | 662 ++++++++++++++++++ .../TestZetaConnectorZEVM.json | 205 ++++++ .../TestZetaConnectorZEVM.sol | 123 ++++ e2e/contracts/testconnectorzevm/bindings.go | 6 + e2e/e2etests/e2etests.go | 17 +- .../test_update_bytecode_connector.go | 70 ++ ...ecode.go => test_update_bytecode_zrc20.go} | 4 +- 11 files changed, 1286 insertions(+), 8 deletions(-) create mode 100644 e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.abi create mode 100644 e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.bin create mode 100644 e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.go create mode 100644 e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.json create mode 100644 e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.sol create mode 100644 e2e/contracts/testconnectorzevm/bindings.go create mode 100644 e2e/e2etests/test_update_bytecode_connector.go rename e2e/e2etests/{test_update_bytecode.go => test_update_bytecode_zrc20.go} (97%) diff --git a/changelog.md b/changelog.md index 152ee00783..c20413660e 100644 --- a/changelog.md +++ b/changelog.md @@ -64,6 +64,7 @@ * [1941](https://github.com/zeta-chain/node/pull/1941) - add unit tests for zetabridge package * [1985](https://github.com/zeta-chain/node/pull/1985) - improve fungible module coverage * [1992](https://github.com/zeta-chain/node/pull/1992) - remove setupKeeper from crosschain module +* [2008](https://github.com/zeta-chain/node/pull/2008) - add test for connector bytecode update ### Fixes diff --git a/cmd/zetae2e/local/local.go b/cmd/zetae2e/local/local.go index d3ddca09a7..817c52721c 100644 --- a/cmd/zetae2e/local/local.go +++ b/cmd/zetae2e/local/local.go @@ -287,7 +287,8 @@ func localE2ETest(cmd *cobra.Command, _ []string) { if testAdmin { eg.Go(adminTestRoutine(conf, deployerRunner, verbose, e2etests.TestPauseZRC20Name, - e2etests.TestUpdateBytecodeName, + e2etests.TestUpdateBytecodeZRC20Name, + e2etests.TestUpdateBytecodeConnectorName, e2etests.TestDepositEtherLiquidityCapName, // TestMigrateChainSupportName tests EVM chain migration. Currently this test doesn't work with Anvil because pre-EIP1559 txs are not supported diff --git a/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.abi b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.abi new file mode 100644 index 0000000000..e268708d01 --- /dev/null +++ b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.abi @@ -0,0 +1,202 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "wzeta_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "FailedZetaSent", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyFungibleModule", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyWZETA", + "type": "error" + }, + { + "inputs": [], + "name": "WZETATransferFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "wzeta_", + "type": "address" + } + ], + "name": "SetWZETA", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sourceTxOriginAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "zetaTxSenderAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "destinationChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "destinationAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "zetaValueAndGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "destinationGasLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "zetaParams", + "type": "bytes" + } + ], + "name": "ZetaSent", + "type": "event" + }, + { + "inputs": [], + "name": "FUNGIBLE_MODULE_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "foo", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "destinationChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "destinationAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "destinationGasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "zetaValueAndGas", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "zetaParams", + "type": "bytes" + } + ], + "internalType": "struct ZetaInterfaces.SendInput", + "name": "input", + "type": "tuple" + } + ], + "name": "send", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "wzeta_", + "type": "address" + } + ], + "name": "setWzetaAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "wzeta", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] diff --git a/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.bin b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.bin new file mode 100644 index 0000000000..ee9d42e7b5 --- /dev/null +++ b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.bin @@ -0,0 +1 @@ +608060405234801561001057600080fd5b50604051610b56380380610b56833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610a3f806101176000396000f3fe60806040526004361061004d5760003560e01c8062173d46146100de5780633ce4a5bc14610109578063c298557814610134578063eb3bacbd1461015f578063ec02690114610188576100d9565b366100d95760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100d7576040517f6e6b6de700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b600080fd5b3480156100ea57600080fd5b506100f36101b1565b604051610100919061061b565b60405180910390f35b34801561011557600080fd5b5061011e6101d5565b60405161012b919061061b565b60405180910390f35b34801561014057600080fd5b506101496101ed565b60405161015691906106c6565b60405180910390f35b34801561016b57600080fd5b506101866004803603810190610181919061071e565b61022a565b005b34801561019457600080fd5b506101af60048036038101906101aa919061076f565b61031d565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b73735b14bb79463307aacbed86daf3322b1e6226ab81565b60606040518060400160405280600381526020017f666f6f0000000000000000000000000000000000000000000000000000000000815250905090565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102a3576040517fea02b3f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f7325870b05f8f3412c318a35fc6a74feca51ea15811ec7a257676ca4db9d417681604051610312919061061b565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd333084608001356040518463ffffffff1660e01b815260040161037e939291906107d1565b6020604051808303816000875af115801561039d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c19190610840565b6103f7576040517fa8c6fd4a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d82608001356040518263ffffffff1660e01b8152600401610454919061086d565b600060405180830381600087803b15801561046e57600080fd5b505af1158015610482573d6000803e3d6000fd5b50505050600073735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff1682608001356040516104c4906108b9565b60006040518083038185875af1925050503d8060008114610501576040519150601f19603f3d011682016040523d82523d6000602084013e610506565b606091505b5050905080610541576040517fc7ffc47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600001353373ffffffffffffffffffffffffffffffffffffffff167f7ec1c94701e09b1652f3e1d307e60c4b9ebf99aff8c2079fd1d8c585e031c4e43285806020019061058f91906108dd565b876080013588604001358980606001906105a991906108dd565b8b8060a001906105b991906108dd565b6040516105ce9998979695949392919061098d565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610605826105da565b9050919050565b610615816105fa565b82525050565b6000602082019050610630600083018461060c565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610670578082015181840152602081019050610655565b60008484015250505050565b6000601f19601f8301169050919050565b600061069882610636565b6106a28185610641565b93506106b2818560208601610652565b6106bb8161067c565b840191505092915050565b600060208201905081810360008301526106e0818461068d565b905092915050565b600080fd5b600080fd5b6106fb816105fa565b811461070657600080fd5b50565b600081359050610718816106f2565b92915050565b600060208284031215610734576107336106e8565b5b600061074284828501610709565b91505092915050565b600080fd5b600060c082840312156107665761076561074b565b5b81905092915050565b600060208284031215610785576107846106e8565b5b600082013567ffffffffffffffff8111156107a3576107a26106ed565b5b6107af84828501610750565b91505092915050565b6000819050919050565b6107cb816107b8565b82525050565b60006060820190506107e6600083018661060c565b6107f3602083018561060c565b61080060408301846107c2565b949350505050565b60008115159050919050565b61081d81610808565b811461082857600080fd5b50565b60008151905061083a81610814565b92915050565b600060208284031215610856576108556106e8565b5b60006108648482850161082b565b91505092915050565b600060208201905061088260008301846107c2565b92915050565b600081905092915050565b50565b60006108a3600083610888565b91506108ae82610893565b600082019050919050565b60006108c482610896565b9150819050919050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126108fa576108f96108ce565b5b80840192508235915067ffffffffffffffff82111561091c5761091b6108d3565b5b602083019250600182023603831315610938576109376108d8565b5b509250929050565b600082825260208201905092915050565b82818337600083830152505050565b600061096c8385610940565b9350610979838584610951565b6109828361067c565b840190509392505050565b600060c0820190506109a2600083018c61060c565b81810360208301526109b5818a8c610960565b90506109c460408301896107c2565b6109d160608301886107c2565b81810360808301526109e4818688610960565b905081810360a08301526109f9818486610960565b90509a995050505050505050505056fea26469706673582212206647922040def2c6972690c7b621d67ba2619c6888ae0b5c33ce88c440cebffa64736f6c63430008170033 diff --git a/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.go b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.go new file mode 100644 index 0000000000..af4a0eb968 --- /dev/null +++ b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.go @@ -0,0 +1,662 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package testconnectorzevm + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// ZetaInterfacesSendInput is an auto generated low-level Go binding around an user-defined struct. +type ZetaInterfacesSendInput struct { + DestinationChainId *big.Int + DestinationAddress []byte + DestinationGasLimit *big.Int + Message []byte + ZetaValueAndGas *big.Int + ZetaParams []byte +} + +// TestZetaConnectorZEVMMetaData contains all meta data concerning the TestZetaConnectorZEVM contract. +var TestZetaConnectorZEVMMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"wzeta_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedZetaSent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyFungibleModule\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyWZETA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WZETATransferFailed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"wzeta_\",\"type\":\"address\"}],\"name\":\"SetWZETA\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sourceTxOriginAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"zetaTxSenderAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"destinationChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"destinationAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"zetaValueAndGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destinationGasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"zetaParams\",\"type\":\"bytes\"}],\"name\":\"ZetaSent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"FUNGIBLE_MODULE_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"foo\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"destinationChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"destinationAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"destinationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"zetaValueAndGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"zetaParams\",\"type\":\"bytes\"}],\"internalType\":\"structZetaInterfaces.SendInput\",\"name\":\"input\",\"type\":\"tuple\"}],\"name\":\"send\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"wzeta_\",\"type\":\"address\"}],\"name\":\"setWzetaAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wzeta\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x608060405234801561001057600080fd5b50604051610b56380380610b56833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610a3f806101176000396000f3fe60806040526004361061004d5760003560e01c8062173d46146100de5780633ce4a5bc14610109578063c298557814610134578063eb3bacbd1461015f578063ec02690114610188576100d9565b366100d95760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100d7576040517f6e6b6de700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b600080fd5b3480156100ea57600080fd5b506100f36101b1565b604051610100919061061b565b60405180910390f35b34801561011557600080fd5b5061011e6101d5565b60405161012b919061061b565b60405180910390f35b34801561014057600080fd5b506101496101ed565b60405161015691906106c6565b60405180910390f35b34801561016b57600080fd5b506101866004803603810190610181919061071e565b61022a565b005b34801561019457600080fd5b506101af60048036038101906101aa919061076f565b61031d565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b73735b14bb79463307aacbed86daf3322b1e6226ab81565b60606040518060400160405280600381526020017f666f6f0000000000000000000000000000000000000000000000000000000000815250905090565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102a3576040517fea02b3f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f7325870b05f8f3412c318a35fc6a74feca51ea15811ec7a257676ca4db9d417681604051610312919061061b565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd333084608001356040518463ffffffff1660e01b815260040161037e939291906107d1565b6020604051808303816000875af115801561039d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c19190610840565b6103f7576040517fa8c6fd4a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d82608001356040518263ffffffff1660e01b8152600401610454919061086d565b600060405180830381600087803b15801561046e57600080fd5b505af1158015610482573d6000803e3d6000fd5b50505050600073735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff1682608001356040516104c4906108b9565b60006040518083038185875af1925050503d8060008114610501576040519150601f19603f3d011682016040523d82523d6000602084013e610506565b606091505b5050905080610541576040517fc7ffc47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600001353373ffffffffffffffffffffffffffffffffffffffff167f7ec1c94701e09b1652f3e1d307e60c4b9ebf99aff8c2079fd1d8c585e031c4e43285806020019061058f91906108dd565b876080013588604001358980606001906105a991906108dd565b8b8060a001906105b991906108dd565b6040516105ce9998979695949392919061098d565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610605826105da565b9050919050565b610615816105fa565b82525050565b6000602082019050610630600083018461060c565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610670578082015181840152602081019050610655565b60008484015250505050565b6000601f19601f8301169050919050565b600061069882610636565b6106a28185610641565b93506106b2818560208601610652565b6106bb8161067c565b840191505092915050565b600060208201905081810360008301526106e0818461068d565b905092915050565b600080fd5b600080fd5b6106fb816105fa565b811461070657600080fd5b50565b600081359050610718816106f2565b92915050565b600060208284031215610734576107336106e8565b5b600061074284828501610709565b91505092915050565b600080fd5b600060c082840312156107665761076561074b565b5b81905092915050565b600060208284031215610785576107846106e8565b5b600082013567ffffffffffffffff8111156107a3576107a26106ed565b5b6107af84828501610750565b91505092915050565b6000819050919050565b6107cb816107b8565b82525050565b60006060820190506107e6600083018661060c565b6107f3602083018561060c565b61080060408301846107c2565b949350505050565b60008115159050919050565b61081d81610808565b811461082857600080fd5b50565b60008151905061083a81610814565b92915050565b600060208284031215610856576108556106e8565b5b60006108648482850161082b565b91505092915050565b600060208201905061088260008301846107c2565b92915050565b600081905092915050565b50565b60006108a3600083610888565b91506108ae82610893565b600082019050919050565b60006108c482610896565b9150819050919050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126108fa576108f96108ce565b5b80840192508235915067ffffffffffffffff82111561091c5761091b6108d3565b5b602083019250600182023603831315610938576109376108d8565b5b509250929050565b600082825260208201905092915050565b82818337600083830152505050565b600061096c8385610940565b9350610979838584610951565b6109828361067c565b840190509392505050565b600060c0820190506109a2600083018c61060c565b81810360208301526109b5818a8c610960565b90506109c460408301896107c2565b6109d160608301886107c2565b81810360808301526109e4818688610960565b905081810360a08301526109f9818486610960565b90509a995050505050505050505056fea26469706673582212206647922040def2c6972690c7b621d67ba2619c6888ae0b5c33ce88c440cebffa64736f6c63430008170033", +} + +// TestZetaConnectorZEVMABI is the input ABI used to generate the binding from. +// Deprecated: Use TestZetaConnectorZEVMMetaData.ABI instead. +var TestZetaConnectorZEVMABI = TestZetaConnectorZEVMMetaData.ABI + +// TestZetaConnectorZEVMBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use TestZetaConnectorZEVMMetaData.Bin instead. +var TestZetaConnectorZEVMBin = TestZetaConnectorZEVMMetaData.Bin + +// DeployTestZetaConnectorZEVM deploys a new Ethereum contract, binding an instance of TestZetaConnectorZEVM to it. +func DeployTestZetaConnectorZEVM(auth *bind.TransactOpts, backend bind.ContractBackend, wzeta_ common.Address) (common.Address, *types.Transaction, *TestZetaConnectorZEVM, error) { + parsed, err := TestZetaConnectorZEVMMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(TestZetaConnectorZEVMBin), backend, wzeta_) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &TestZetaConnectorZEVM{TestZetaConnectorZEVMCaller: TestZetaConnectorZEVMCaller{contract: contract}, TestZetaConnectorZEVMTransactor: TestZetaConnectorZEVMTransactor{contract: contract}, TestZetaConnectorZEVMFilterer: TestZetaConnectorZEVMFilterer{contract: contract}}, nil +} + +// TestZetaConnectorZEVM is an auto generated Go binding around an Ethereum contract. +type TestZetaConnectorZEVM struct { + TestZetaConnectorZEVMCaller // Read-only binding to the contract + TestZetaConnectorZEVMTransactor // Write-only binding to the contract + TestZetaConnectorZEVMFilterer // Log filterer for contract events +} + +// TestZetaConnectorZEVMCaller is an auto generated read-only Go binding around an Ethereum contract. +type TestZetaConnectorZEVMCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TestZetaConnectorZEVMTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TestZetaConnectorZEVMTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TestZetaConnectorZEVMFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TestZetaConnectorZEVMFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TestZetaConnectorZEVMSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TestZetaConnectorZEVMSession struct { + Contract *TestZetaConnectorZEVM // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TestZetaConnectorZEVMCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TestZetaConnectorZEVMCallerSession struct { + Contract *TestZetaConnectorZEVMCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TestZetaConnectorZEVMTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TestZetaConnectorZEVMTransactorSession struct { + Contract *TestZetaConnectorZEVMTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TestZetaConnectorZEVMRaw is an auto generated low-level Go binding around an Ethereum contract. +type TestZetaConnectorZEVMRaw struct { + Contract *TestZetaConnectorZEVM // Generic contract binding to access the raw methods on +} + +// TestZetaConnectorZEVMCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TestZetaConnectorZEVMCallerRaw struct { + Contract *TestZetaConnectorZEVMCaller // Generic read-only contract binding to access the raw methods on +} + +// TestZetaConnectorZEVMTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TestZetaConnectorZEVMTransactorRaw struct { + Contract *TestZetaConnectorZEVMTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTestZetaConnectorZEVM creates a new instance of TestZetaConnectorZEVM, bound to a specific deployed contract. +func NewTestZetaConnectorZEVM(address common.Address, backend bind.ContractBackend) (*TestZetaConnectorZEVM, error) { + contract, err := bindTestZetaConnectorZEVM(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TestZetaConnectorZEVM{TestZetaConnectorZEVMCaller: TestZetaConnectorZEVMCaller{contract: contract}, TestZetaConnectorZEVMTransactor: TestZetaConnectorZEVMTransactor{contract: contract}, TestZetaConnectorZEVMFilterer: TestZetaConnectorZEVMFilterer{contract: contract}}, nil +} + +// NewTestZetaConnectorZEVMCaller creates a new read-only instance of TestZetaConnectorZEVM, bound to a specific deployed contract. +func NewTestZetaConnectorZEVMCaller(address common.Address, caller bind.ContractCaller) (*TestZetaConnectorZEVMCaller, error) { + contract, err := bindTestZetaConnectorZEVM(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TestZetaConnectorZEVMCaller{contract: contract}, nil +} + +// NewTestZetaConnectorZEVMTransactor creates a new write-only instance of TestZetaConnectorZEVM, bound to a specific deployed contract. +func NewTestZetaConnectorZEVMTransactor(address common.Address, transactor bind.ContractTransactor) (*TestZetaConnectorZEVMTransactor, error) { + contract, err := bindTestZetaConnectorZEVM(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TestZetaConnectorZEVMTransactor{contract: contract}, nil +} + +// NewTestZetaConnectorZEVMFilterer creates a new log filterer instance of TestZetaConnectorZEVM, bound to a specific deployed contract. +func NewTestZetaConnectorZEVMFilterer(address common.Address, filterer bind.ContractFilterer) (*TestZetaConnectorZEVMFilterer, error) { + contract, err := bindTestZetaConnectorZEVM(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TestZetaConnectorZEVMFilterer{contract: contract}, nil +} + +// bindTestZetaConnectorZEVM binds a generic wrapper to an already deployed contract. +func bindTestZetaConnectorZEVM(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TestZetaConnectorZEVMMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TestZetaConnectorZEVM.Contract.TestZetaConnectorZEVMCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.TestZetaConnectorZEVMTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.TestZetaConnectorZEVMTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TestZetaConnectorZEVM.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.contract.Transact(opts, method, params...) +} + +// FUNGIBLEMODULEADDRESS is a free data retrieval call binding the contract method 0x3ce4a5bc. +// +// Solidity: function FUNGIBLE_MODULE_ADDRESS() view returns(address) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMCaller) FUNGIBLEMODULEADDRESS(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TestZetaConnectorZEVM.contract.Call(opts, &out, "FUNGIBLE_MODULE_ADDRESS") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// FUNGIBLEMODULEADDRESS is a free data retrieval call binding the contract method 0x3ce4a5bc. +// +// Solidity: function FUNGIBLE_MODULE_ADDRESS() view returns(address) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMSession) FUNGIBLEMODULEADDRESS() (common.Address, error) { + return _TestZetaConnectorZEVM.Contract.FUNGIBLEMODULEADDRESS(&_TestZetaConnectorZEVM.CallOpts) +} + +// FUNGIBLEMODULEADDRESS is a free data retrieval call binding the contract method 0x3ce4a5bc. +// +// Solidity: function FUNGIBLE_MODULE_ADDRESS() view returns(address) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMCallerSession) FUNGIBLEMODULEADDRESS() (common.Address, error) { + return _TestZetaConnectorZEVM.Contract.FUNGIBLEMODULEADDRESS(&_TestZetaConnectorZEVM.CallOpts) +} + +// Foo is a free data retrieval call binding the contract method 0xc2985578. +// +// Solidity: function foo() pure returns(string) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMCaller) Foo(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _TestZetaConnectorZEVM.contract.Call(opts, &out, "foo") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Foo is a free data retrieval call binding the contract method 0xc2985578. +// +// Solidity: function foo() pure returns(string) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMSession) Foo() (string, error) { + return _TestZetaConnectorZEVM.Contract.Foo(&_TestZetaConnectorZEVM.CallOpts) +} + +// Foo is a free data retrieval call binding the contract method 0xc2985578. +// +// Solidity: function foo() pure returns(string) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMCallerSession) Foo() (string, error) { + return _TestZetaConnectorZEVM.Contract.Foo(&_TestZetaConnectorZEVM.CallOpts) +} + +// Wzeta is a free data retrieval call binding the contract method 0x00173d46. +// +// Solidity: function wzeta() view returns(address) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMCaller) Wzeta(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TestZetaConnectorZEVM.contract.Call(opts, &out, "wzeta") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Wzeta is a free data retrieval call binding the contract method 0x00173d46. +// +// Solidity: function wzeta() view returns(address) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMSession) Wzeta() (common.Address, error) { + return _TestZetaConnectorZEVM.Contract.Wzeta(&_TestZetaConnectorZEVM.CallOpts) +} + +// Wzeta is a free data retrieval call binding the contract method 0x00173d46. +// +// Solidity: function wzeta() view returns(address) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMCallerSession) Wzeta() (common.Address, error) { + return _TestZetaConnectorZEVM.Contract.Wzeta(&_TestZetaConnectorZEVM.CallOpts) +} + +// Send is a paid mutator transaction binding the contract method 0xec026901. +// +// Solidity: function send((uint256,bytes,uint256,bytes,uint256,bytes) input) returns() +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMTransactor) Send(opts *bind.TransactOpts, input ZetaInterfacesSendInput) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.contract.Transact(opts, "send", input) +} + +// Send is a paid mutator transaction binding the contract method 0xec026901. +// +// Solidity: function send((uint256,bytes,uint256,bytes,uint256,bytes) input) returns() +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMSession) Send(input ZetaInterfacesSendInput) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.Send(&_TestZetaConnectorZEVM.TransactOpts, input) +} + +// Send is a paid mutator transaction binding the contract method 0xec026901. +// +// Solidity: function send((uint256,bytes,uint256,bytes,uint256,bytes) input) returns() +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMTransactorSession) Send(input ZetaInterfacesSendInput) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.Send(&_TestZetaConnectorZEVM.TransactOpts, input) +} + +// SetWzetaAddress is a paid mutator transaction binding the contract method 0xeb3bacbd. +// +// Solidity: function setWzetaAddress(address wzeta_) returns() +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMTransactor) SetWzetaAddress(opts *bind.TransactOpts, wzeta_ common.Address) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.contract.Transact(opts, "setWzetaAddress", wzeta_) +} + +// SetWzetaAddress is a paid mutator transaction binding the contract method 0xeb3bacbd. +// +// Solidity: function setWzetaAddress(address wzeta_) returns() +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMSession) SetWzetaAddress(wzeta_ common.Address) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.SetWzetaAddress(&_TestZetaConnectorZEVM.TransactOpts, wzeta_) +} + +// SetWzetaAddress is a paid mutator transaction binding the contract method 0xeb3bacbd. +// +// Solidity: function setWzetaAddress(address wzeta_) returns() +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMTransactorSession) SetWzetaAddress(wzeta_ common.Address) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.SetWzetaAddress(&_TestZetaConnectorZEVM.TransactOpts, wzeta_) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TestZetaConnectorZEVM.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMSession) Receive() (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.Receive(&_TestZetaConnectorZEVM.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMTransactorSession) Receive() (*types.Transaction, error) { + return _TestZetaConnectorZEVM.Contract.Receive(&_TestZetaConnectorZEVM.TransactOpts) +} + +// TestZetaConnectorZEVMSetWZETAIterator is returned from FilterSetWZETA and is used to iterate over the raw logs and unpacked data for SetWZETA events raised by the TestZetaConnectorZEVM contract. +type TestZetaConnectorZEVMSetWZETAIterator struct { + Event *TestZetaConnectorZEVMSetWZETA // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TestZetaConnectorZEVMSetWZETAIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TestZetaConnectorZEVMSetWZETA) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TestZetaConnectorZEVMSetWZETA) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TestZetaConnectorZEVMSetWZETAIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TestZetaConnectorZEVMSetWZETAIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TestZetaConnectorZEVMSetWZETA represents a SetWZETA event raised by the TestZetaConnectorZEVM contract. +type TestZetaConnectorZEVMSetWZETA struct { + Wzeta common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetWZETA is a free log retrieval operation binding the contract event 0x7325870b05f8f3412c318a35fc6a74feca51ea15811ec7a257676ca4db9d4176. +// +// Solidity: event SetWZETA(address wzeta_) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMFilterer) FilterSetWZETA(opts *bind.FilterOpts) (*TestZetaConnectorZEVMSetWZETAIterator, error) { + + logs, sub, err := _TestZetaConnectorZEVM.contract.FilterLogs(opts, "SetWZETA") + if err != nil { + return nil, err + } + return &TestZetaConnectorZEVMSetWZETAIterator{contract: _TestZetaConnectorZEVM.contract, event: "SetWZETA", logs: logs, sub: sub}, nil +} + +// WatchSetWZETA is a free log subscription operation binding the contract event 0x7325870b05f8f3412c318a35fc6a74feca51ea15811ec7a257676ca4db9d4176. +// +// Solidity: event SetWZETA(address wzeta_) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMFilterer) WatchSetWZETA(opts *bind.WatchOpts, sink chan<- *TestZetaConnectorZEVMSetWZETA) (event.Subscription, error) { + + logs, sub, err := _TestZetaConnectorZEVM.contract.WatchLogs(opts, "SetWZETA") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TestZetaConnectorZEVMSetWZETA) + if err := _TestZetaConnectorZEVM.contract.UnpackLog(event, "SetWZETA", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSetWZETA is a log parse operation binding the contract event 0x7325870b05f8f3412c318a35fc6a74feca51ea15811ec7a257676ca4db9d4176. +// +// Solidity: event SetWZETA(address wzeta_) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMFilterer) ParseSetWZETA(log types.Log) (*TestZetaConnectorZEVMSetWZETA, error) { + event := new(TestZetaConnectorZEVMSetWZETA) + if err := _TestZetaConnectorZEVM.contract.UnpackLog(event, "SetWZETA", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TestZetaConnectorZEVMZetaSentIterator is returned from FilterZetaSent and is used to iterate over the raw logs and unpacked data for ZetaSent events raised by the TestZetaConnectorZEVM contract. +type TestZetaConnectorZEVMZetaSentIterator struct { + Event *TestZetaConnectorZEVMZetaSent // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TestZetaConnectorZEVMZetaSentIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TestZetaConnectorZEVMZetaSent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TestZetaConnectorZEVMZetaSent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TestZetaConnectorZEVMZetaSentIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TestZetaConnectorZEVMZetaSentIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TestZetaConnectorZEVMZetaSent represents a ZetaSent event raised by the TestZetaConnectorZEVM contract. +type TestZetaConnectorZEVMZetaSent struct { + SourceTxOriginAddress common.Address + ZetaTxSenderAddress common.Address + DestinationChainId *big.Int + DestinationAddress []byte + ZetaValueAndGas *big.Int + DestinationGasLimit *big.Int + Message []byte + ZetaParams []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterZetaSent is a free log retrieval operation binding the contract event 0x7ec1c94701e09b1652f3e1d307e60c4b9ebf99aff8c2079fd1d8c585e031c4e4. +// +// Solidity: event ZetaSent(address sourceTxOriginAddress, address indexed zetaTxSenderAddress, uint256 indexed destinationChainId, bytes destinationAddress, uint256 zetaValueAndGas, uint256 destinationGasLimit, bytes message, bytes zetaParams) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMFilterer) FilterZetaSent(opts *bind.FilterOpts, zetaTxSenderAddress []common.Address, destinationChainId []*big.Int) (*TestZetaConnectorZEVMZetaSentIterator, error) { + + var zetaTxSenderAddressRule []interface{} + for _, zetaTxSenderAddressItem := range zetaTxSenderAddress { + zetaTxSenderAddressRule = append(zetaTxSenderAddressRule, zetaTxSenderAddressItem) + } + var destinationChainIdRule []interface{} + for _, destinationChainIdItem := range destinationChainId { + destinationChainIdRule = append(destinationChainIdRule, destinationChainIdItem) + } + + logs, sub, err := _TestZetaConnectorZEVM.contract.FilterLogs(opts, "ZetaSent", zetaTxSenderAddressRule, destinationChainIdRule) + if err != nil { + return nil, err + } + return &TestZetaConnectorZEVMZetaSentIterator{contract: _TestZetaConnectorZEVM.contract, event: "ZetaSent", logs: logs, sub: sub}, nil +} + +// WatchZetaSent is a free log subscription operation binding the contract event 0x7ec1c94701e09b1652f3e1d307e60c4b9ebf99aff8c2079fd1d8c585e031c4e4. +// +// Solidity: event ZetaSent(address sourceTxOriginAddress, address indexed zetaTxSenderAddress, uint256 indexed destinationChainId, bytes destinationAddress, uint256 zetaValueAndGas, uint256 destinationGasLimit, bytes message, bytes zetaParams) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMFilterer) WatchZetaSent(opts *bind.WatchOpts, sink chan<- *TestZetaConnectorZEVMZetaSent, zetaTxSenderAddress []common.Address, destinationChainId []*big.Int) (event.Subscription, error) { + + var zetaTxSenderAddressRule []interface{} + for _, zetaTxSenderAddressItem := range zetaTxSenderAddress { + zetaTxSenderAddressRule = append(zetaTxSenderAddressRule, zetaTxSenderAddressItem) + } + var destinationChainIdRule []interface{} + for _, destinationChainIdItem := range destinationChainId { + destinationChainIdRule = append(destinationChainIdRule, destinationChainIdItem) + } + + logs, sub, err := _TestZetaConnectorZEVM.contract.WatchLogs(opts, "ZetaSent", zetaTxSenderAddressRule, destinationChainIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TestZetaConnectorZEVMZetaSent) + if err := _TestZetaConnectorZEVM.contract.UnpackLog(event, "ZetaSent", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseZetaSent is a log parse operation binding the contract event 0x7ec1c94701e09b1652f3e1d307e60c4b9ebf99aff8c2079fd1d8c585e031c4e4. +// +// Solidity: event ZetaSent(address sourceTxOriginAddress, address indexed zetaTxSenderAddress, uint256 indexed destinationChainId, bytes destinationAddress, uint256 zetaValueAndGas, uint256 destinationGasLimit, bytes message, bytes zetaParams) +func (_TestZetaConnectorZEVM *TestZetaConnectorZEVMFilterer) ParseZetaSent(log types.Log) (*TestZetaConnectorZEVMZetaSent, error) { + event := new(TestZetaConnectorZEVMZetaSent) + if err := _TestZetaConnectorZEVM.contract.UnpackLog(event, "ZetaSent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.json b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.json new file mode 100644 index 0000000000..f8e2ec7acc --- /dev/null +++ b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.json @@ -0,0 +1,205 @@ +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "wzeta_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "FailedZetaSent", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyFungibleModule", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyWZETA", + "type": "error" + }, + { + "inputs": [], + "name": "WZETATransferFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "wzeta_", + "type": "address" + } + ], + "name": "SetWZETA", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sourceTxOriginAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "zetaTxSenderAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "destinationChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "destinationAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "zetaValueAndGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "destinationGasLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "zetaParams", + "type": "bytes" + } + ], + "name": "ZetaSent", + "type": "event" + }, + { + "inputs": [], + "name": "FUNGIBLE_MODULE_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "foo", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "destinationChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "destinationAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "destinationGasLimit", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "zetaValueAndGas", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "zetaParams", + "type": "bytes" + } + ], + "internalType": "struct ZetaInterfaces.SendInput", + "name": "input", + "type": "tuple" + } + ], + "name": "send", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "wzeta_", + "type": "address" + } + ], + "name": "setWzetaAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "wzeta", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bin": "608060405234801561001057600080fd5b50604051610b56380380610b56833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610a3f806101176000396000f3fe60806040526004361061004d5760003560e01c8062173d46146100de5780633ce4a5bc14610109578063c298557814610134578063eb3bacbd1461015f578063ec02690114610188576100d9565b366100d95760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100d7576040517f6e6b6de700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b600080fd5b3480156100ea57600080fd5b506100f36101b1565b604051610100919061061b565b60405180910390f35b34801561011557600080fd5b5061011e6101d5565b60405161012b919061061b565b60405180910390f35b34801561014057600080fd5b506101496101ed565b60405161015691906106c6565b60405180910390f35b34801561016b57600080fd5b506101866004803603810190610181919061071e565b61022a565b005b34801561019457600080fd5b506101af60048036038101906101aa919061076f565b61031d565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b73735b14bb79463307aacbed86daf3322b1e6226ab81565b60606040518060400160405280600381526020017f666f6f0000000000000000000000000000000000000000000000000000000000815250905090565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102a3576040517fea02b3f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f7325870b05f8f3412c318a35fc6a74feca51ea15811ec7a257676ca4db9d417681604051610312919061061b565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd333084608001356040518463ffffffff1660e01b815260040161037e939291906107d1565b6020604051808303816000875af115801561039d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c19190610840565b6103f7576040517fa8c6fd4a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d82608001356040518263ffffffff1660e01b8152600401610454919061086d565b600060405180830381600087803b15801561046e57600080fd5b505af1158015610482573d6000803e3d6000fd5b50505050600073735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff1682608001356040516104c4906108b9565b60006040518083038185875af1925050503d8060008114610501576040519150601f19603f3d011682016040523d82523d6000602084013e610506565b606091505b5050905080610541576040517fc7ffc47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600001353373ffffffffffffffffffffffffffffffffffffffff167f7ec1c94701e09b1652f3e1d307e60c4b9ebf99aff8c2079fd1d8c585e031c4e43285806020019061058f91906108dd565b876080013588604001358980606001906105a991906108dd565b8b8060a001906105b991906108dd565b6040516105ce9998979695949392919061098d565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610605826105da565b9050919050565b610615816105fa565b82525050565b6000602082019050610630600083018461060c565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610670578082015181840152602081019050610655565b60008484015250505050565b6000601f19601f8301169050919050565b600061069882610636565b6106a28185610641565b93506106b2818560208601610652565b6106bb8161067c565b840191505092915050565b600060208201905081810360008301526106e0818461068d565b905092915050565b600080fd5b600080fd5b6106fb816105fa565b811461070657600080fd5b50565b600081359050610718816106f2565b92915050565b600060208284031215610734576107336106e8565b5b600061074284828501610709565b91505092915050565b600080fd5b600060c082840312156107665761076561074b565b5b81905092915050565b600060208284031215610785576107846106e8565b5b600082013567ffffffffffffffff8111156107a3576107a26106ed565b5b6107af84828501610750565b91505092915050565b6000819050919050565b6107cb816107b8565b82525050565b60006060820190506107e6600083018661060c565b6107f3602083018561060c565b61080060408301846107c2565b949350505050565b60008115159050919050565b61081d81610808565b811461082857600080fd5b50565b60008151905061083a81610814565b92915050565b600060208284031215610856576108556106e8565b5b60006108648482850161082b565b91505092915050565b600060208201905061088260008301846107c2565b92915050565b600081905092915050565b50565b60006108a3600083610888565b91506108ae82610893565b600082019050919050565b60006108c482610896565b9150819050919050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126108fa576108f96108ce565b5b80840192508235915067ffffffffffffffff82111561091c5761091b6108d3565b5b602083019250600182023603831315610938576109376108d8565b5b509250929050565b600082825260208201905092915050565b82818337600083830152505050565b600061096c8385610940565b9350610979838584610951565b6109828361067c565b840190509392505050565b600060c0820190506109a2600083018c61060c565b81810360208301526109b5818a8c610960565b90506109c460408301896107c2565b6109d160608301886107c2565b81810360808301526109e4818688610960565b905081810360a08301526109f9818486610960565b90509a995050505050505050505056fea26469706673582212206647922040def2c6972690c7b621d67ba2619c6888ae0b5c33ce88c440cebffa64736f6c63430008170033" +} diff --git a/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.sol b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.sol new file mode 100644 index 0000000000..2f9f1b1a1c --- /dev/null +++ b/e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.sol @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface ZetaInterfaces { + /** + * @dev Use SendInput to interact with the Connector: connector.send(SendInput) + */ + struct SendInput { + /// @dev Chain id of the destination chain. More about chain ids https://docs.zetachain.com/learn/glossary#chain-id + uint256 destinationChainId; + /// @dev Address receiving the message on the destination chain (expressed in bytes since it can be non-EVM) + bytes destinationAddress; + /// @dev Gas limit for the destination chain's transaction + uint256 destinationGasLimit; + /// @dev An encoded, arbitrary message to be parsed by the destination contract + bytes message; + /// @dev ZETA to be sent cross-chain + ZetaChain gas fees + destination chain gas fees (expressed in ZETA) + uint256 zetaValueAndGas; + /// @dev Optional parameters for the ZetaChain protocol + bytes zetaParams; + } + + /** + * @dev Our Connector calls onZetaMessage with this struct as argument + */ + struct ZetaMessage { + bytes zetaTxSenderAddress; + uint256 sourceChainId; + address destinationAddress; + /// @dev Remaining ZETA from zetaValueAndGas after subtracting ZetaChain gas fees and destination gas fees + uint256 zetaValue; + bytes message; + } + + /** + * @dev Our Connector calls onZetaRevert with this struct as argument + */ + struct ZetaRevert { + address zetaTxSenderAddress; + uint256 sourceChainId; + bytes destinationAddress; + uint256 destinationChainId; + /// @dev Equals to: zetaValueAndGas - ZetaChain gas fees - destination chain gas fees - source chain revert tx gas fees + uint256 remainingZetaValue; + bytes message; + } +} + +interface WZETA { + function transferFrom(address src, address dst, uint wad) external returns (bool); + + function withdraw(uint wad) external; +} + +contract TestZetaConnectorZEVM is ZetaInterfaces { + /// @notice Contract custom errors. + error OnlyWZETA(); + error WZETATransferFailed(); + error OnlyFungibleModule(); + error FailedZetaSent(); + + /// @notice Fungible module address. + address public constant FUNGIBLE_MODULE_ADDRESS = payable(0x735b14BB79463307AAcBED86DAf3322B1e6226aB); + /// @notice WZETA token address. + address public wzeta; + + event ZetaSent( + address sourceTxOriginAddress, + address indexed zetaTxSenderAddress, + uint256 indexed destinationChainId, + bytes destinationAddress, + uint256 zetaValueAndGas, + uint256 destinationGasLimit, + bytes message, + bytes zetaParams + ); + event SetWZETA(address wzeta_); + + constructor(address wzeta_) { + wzeta = wzeta_; + } + + /// @dev Receive function to receive ZETA from WETH9.withdraw(). + receive() external payable { + if (msg.sender != wzeta) revert OnlyWZETA(); + } + + /** + * @dev Sends ZETA and bytes messages (to execute it) crosschain. + * @param input, SendInput struct, checkout above. + */ + function send(ZetaInterfaces.SendInput calldata input) external { + // Transfer wzeta to "fungible" module, which will be burnt by the protocol post processing via hooks. + if (!WZETA(wzeta).transferFrom(msg.sender, address(this), input.zetaValueAndGas)) revert WZETATransferFailed(); + WZETA(wzeta).withdraw(input.zetaValueAndGas); + (bool sent, ) = FUNGIBLE_MODULE_ADDRESS.call{value: input.zetaValueAndGas}(""); + if (!sent) revert FailedZetaSent(); + emit ZetaSent( + tx.origin, + msg.sender, + input.destinationChainId, + input.destinationAddress, + input.zetaValueAndGas, + input.destinationGasLimit, + input.message, + input.zetaParams + ); + } + + /** + * @dev Sends ZETA and bytes messages (to execute it) crosschain. + * @param wzeta_, new WZETA address. + */ + function setWzetaAddress(address wzeta_) external { + if (msg.sender != FUNGIBLE_MODULE_ADDRESS) revert OnlyFungibleModule(); + wzeta = wzeta_; + emit SetWZETA(wzeta_); + } + + function foo() external pure returns (string memory) { + return "foo"; + } +} \ No newline at end of file diff --git a/e2e/contracts/testconnectorzevm/bindings.go b/e2e/contracts/testconnectorzevm/bindings.go new file mode 100644 index 0000000000..11332c8440 --- /dev/null +++ b/e2e/contracts/testconnectorzevm/bindings.go @@ -0,0 +1,6 @@ +//go:generate sh -c "solc --evm-version paris TestZetaConnectorZEVM.sol --combined-json abi,bin | jq '.contracts.\"TestZetaConnectorZEVM.sol:TestZetaConnectorZEVM\"' > TestZetaConnectorZEVM.json" +//go:generate sh -c "cat TestZetaConnectorZEVM.json | jq .abi > TestZetaConnectorZEVM.abi" +//go:generate sh -c "cat TestZetaConnectorZEVM.json | jq .bin | tr -d '\"' > TestZetaConnectorZEVM.bin" +//go:generate sh -c "abigen --abi TestZetaConnectorZEVM.abi --bin TestZetaConnectorZEVM.bin --pkg testconnectorzevm --type TestZetaConnectorZEVM --out TestZetaConnectorZEVM.go" + +package testconnectorzevm diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index 404616535f..765194c425 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -49,9 +49,10 @@ const ( TestStressBTCDepositName = "stress_btc_deposit" // Admin test - TestMigrateChainSupportName = "migrate_chain_support" - TestPauseZRC20Name = "pause_zrc20" - TestUpdateBytecodeName = "update_bytecode" + TestMigrateChainSupportName = "migrate_chain_support" + TestPauseZRC20Name = "pause_zrc20" + TestUpdateBytecodeZRC20Name = "update_bytecode_zrc20" + TestUpdateBytecodeConnectorName = "update_bytecode_connector" ) // AllE2ETests is an ordered list of all e2e tests @@ -224,10 +225,10 @@ var AllE2ETests = []runner.E2ETest{ TestERC20DepositAndCallRefund, ), runner.NewE2ETest( - TestUpdateBytecodeName, + TestUpdateBytecodeZRC20Name, "update ZRC20 bytecode swap", []runner.ArgDefinition{}, - TestUpdateBytecode, + TestUpdateBytecodeZRC20, ), runner.NewE2ETest( TestEtherDepositAndCallName, @@ -365,4 +366,10 @@ var AllE2ETests = []runner.E2ETest{ []runner.ArgDefinition{}, TestMigrateChainSupport, ), + runner.NewE2ETest( + TestUpdateBytecodeConnectorName, + "update zevm connector bytecode", + []runner.ArgDefinition{}, + TestUpdateBytecodeConnector, + ), } diff --git a/e2e/e2etests/test_update_bytecode_connector.go b/e2e/e2etests/test_update_bytecode_connector.go new file mode 100644 index 0000000000..0770e80dc4 --- /dev/null +++ b/e2e/e2etests/test_update_bytecode_connector.go @@ -0,0 +1,70 @@ +package e2etests + +import ( + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/zeta-chain/zetacore/e2e/contracts/testconnectorzevm" + "github.com/zeta-chain/zetacore/e2e/runner" + "github.com/zeta-chain/zetacore/e2e/utils" + fungibletypes "github.com/zeta-chain/zetacore/x/fungible/types" +) + +// TestUpdateBytecodeConnector tests updating the bytecode of a connector and interact with it +func TestUpdateBytecodeConnector(r *runner.E2ERunner, _ []string) { + // Can withdraw 0.1ZETA + TestZetaWithdraw(r, []string{"10000000000000000000"}) + + // Deploy the test contract + newTestConnectorAddr, tx, _, err := testconnectorzevm.DeployTestZetaConnectorZEVM( + r.ZEVMAuth, + r.ZEVMClient, + r.WZetaAddr, + ) + if err != nil { + panic(err) + } + + // Wait for the contract to be deployed + receipt := utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + if receipt.Status != 1 { + panic("contract deployment failed") + } + + // Get the code hash of the new contract + codeHashRes, err := r.FungibleClient.CodeHash(r.Ctx, &fungibletypes.QueryCodeHashRequest{ + Address: newTestConnectorAddr.String(), + }) + if err != nil { + panic(err) + } + r.Logger.Info("New contract code hash: %s", codeHashRes.CodeHash) + + r.Logger.Info("Updating the bytecode of the Connector") + msg := fungibletypes.NewMsgUpdateContractBytecode( + r.ZetaTxServer.GetAccountAddress(0), + r.ConnectorZEVMAddr.Hex(), + codeHashRes.CodeHash, + ) + res, err := r.ZetaTxServer.BroadcastTx(utils.FungibleAdminName, msg) + if err != nil { + panic(err) + } + r.Logger.Info("Update connector bytecode tx hash: %s", res.TxHash) + + r.Logger.Info("Can interact with the new code of the contract") + testConnectorContract, err := testconnectorzevm.NewTestZetaConnectorZEVM(r.ConnectorZEVMAddr, r.ZEVMClient) + if err != nil { + panic(err) + } + + response, err := testConnectorContract.Foo(&bind.CallOpts{}) + if err != nil { + panic(err) + } + + if response != "foo" { + panic("unexpected response") + } + + // Can continue to interact with the connector: withdraw 0.1ZETA + TestZetaWithdraw(r, []string{"10000000000000000000"}) +} diff --git a/e2e/e2etests/test_update_bytecode.go b/e2e/e2etests/test_update_bytecode_zrc20.go similarity index 97% rename from e2e/e2etests/test_update_bytecode.go rename to e2e/e2etests/test_update_bytecode_zrc20.go index a36af1db7c..d5730415bf 100644 --- a/e2e/e2etests/test_update_bytecode.go +++ b/e2e/e2etests/test_update_bytecode_zrc20.go @@ -12,8 +12,8 @@ import ( fungibletypes "github.com/zeta-chain/zetacore/x/fungible/types" ) -// TestUpdateBytecode tests updating the bytecode of a zrc20 and interact with it -func TestUpdateBytecode(r *runner.E2ERunner, _ []string) { +// TestUpdateBytecodeZRC20 tests updating the bytecode of a zrc20 and interact with it +func TestUpdateBytecodeZRC20(r *runner.E2ERunner, _ []string) { // Random approval approved := sample.EthAddress() tx, err := r.ETHZRC20.Approve(r.ZEVMAuth, approved, big.NewInt(1e10))