From 1712cb0d51fd43db2107b89065787dad108fbfa0 Mon Sep 17 00:00:00 2001 From: skosito Date: Fri, 27 Sep 2024 12:38:40 +0100 Subject: [PATCH] feat: integrate authenticated calls smart contract functionality into protocol (#2904) * e2e tests and modifications for authenticated call * extend test with sender check and revert case * separate tests into separate files * cleanup * withdraw and call support and tests * bump protocol contracts * split tests into separate files * small cleanup * fmt * generate * lint * changelog * PR comments * fix case in proto * bump vote inbound gas limit in zetaclient * fix test * generate * fixing tests * call options non empty * generate * test fix * rename gateway caller * pr comments rename tests * PR comment * generate * tests * update tests fixes * tests fixes * fix * test fix --- changelog.md | 1 + cmd/zetae2e/local/v2.go | 4 + docs/cli/zetacored/cli.md | 2 +- docs/openapi/openapi.swagger.yaml | 11 + docs/spec/crosschain/messages.md | 1 + e2e/e2etests/e2etests.go | 34 +- ...test_v2_eth_withdraw_and_arbitrary_call.go | 40 ++ e2e/e2etests/test_v2_eth_withdraw_and_call.go | 30 +- ..._eth_withdraw_and_call_through_contract.go | 84 ++++ .../test_v2_zevm_to_evm_arbitrary_call.go | 36 ++ e2e/e2etests/test_v2_zevm_to_evm_call.go | 31 +- ...st_v2_zevm_to_evm_call_through_contract.go | 83 ++++ e2e/runner/logger.go | 1 + e2e/runner/v2_zevm.go | 99 +++- go.mod | 2 +- go.sum | 4 +- .../gatewayzevmcaller/GatewayZEVMCaller.abi | 251 ++++++++++ .../gatewayzevmcaller/GatewayZEVMCaller.bin | 1 + .../gatewayzevmcaller/GatewayZEVMCaller.go | 302 ++++++++++++ .../gatewayzevmcaller/GatewayZEVMCaller.json | 254 ++++++++++ .../gatewayzevmcaller/GatewayZEVMCaller.sol | 103 ++++ pkg/contracts/gatewayzevmcaller/bindings.go | 8 + pkg/contracts/testdappv2/TestDAppV2.abi | 76 +++ pkg/contracts/testdappv2/TestDAppV2.bin | 2 +- pkg/contracts/testdappv2/TestDAppV2.go | 113 ++++- pkg/contracts/testdappv2/TestDAppV2.json | 78 +++- pkg/contracts/testdappv2/TestDAppV2.sol | 20 + .../zetacore/crosschain/cross_chain_tx.proto | 8 + proto/zetachain/zetacore/crosschain/tx.proto | 3 + testutil/sample/crosschain.go | 40 +- .../crosschain/cross_chain_tx_pb.d.ts | 36 ++ .../zetachain/zetacore/crosschain/tx_pb.d.ts | 9 +- x/crosschain/client/cli/tx_vote_inbound.go | 8 +- x/crosschain/keeper/abci.go | 4 +- x/crosschain/keeper/abci_test.go | 54 ++- ...cctx_orchestrator_validate_inbound_test.go | 60 ++- .../cctx_orchestrator_validate_outbound.go | 2 +- x/crosschain/keeper/cctx_test.go | 14 +- x/crosschain/keeper/evm_hooks.go | 4 +- x/crosschain/keeper/gas_payment.go | 6 +- x/crosschain/keeper/gas_payment_test.go | 22 +- .../msg_server_migrate_tss_funds_test.go | 2 +- .../keeper/msg_server_vote_inbound_tx_test.go | 28 +- x/crosschain/keeper/v2_zevm_inbound.go | 19 +- x/crosschain/types/cctx.go | 32 +- x/crosschain/types/cctx_test.go | 40 +- x/crosschain/types/cmd_cctxs.go | 10 +- x/crosschain/types/cmd_cctxs_test.go | 15 +- x/crosschain/types/cross_chain_tx.pb.go | 440 ++++++++++++++---- x/crosschain/types/message_vote_inbound.go | 26 +- .../types/message_vote_inbound_test.go | 41 +- x/crosschain/types/tx.pb.go | 304 +++++++----- zetaclient/chains/bitcoin/signer/signer.go | 2 +- zetaclient/chains/evm/observer/v2_inbound.go | 2 + zetaclient/chains/evm/signer/gas.go | 6 +- zetaclient/chains/evm/signer/gas_test.go | 2 +- zetaclient/chains/evm/signer/outbound_data.go | 2 +- zetaclient/chains/evm/signer/v2_sign.go | 25 +- zetaclient/chains/evm/signer/v2_signer.go | 2 +- .../testdata/cctx/chain_1337_cctx_14.go | 24 +- zetaclient/testdata/cctx/chain_1_cctx_6270.go | 14 +- zetaclient/testdata/cctx/chain_1_cctx_7260.go | 14 +- zetaclient/testdata/cctx/chain_1_cctx_8014.go | 14 +- zetaclient/testdata/cctx/chain_1_cctx_9718.go | 14 +- ...c3b990e076e2a4bffeb616035b239b7d33843da.go | 16 +- ...e01cbdf59154fd793ea7a22c297f7c3a722c532.go | 16 +- ...71ffc40ca898e134525c42c2ae3cbc5725f9d76.go | 16 +- .../testdata/cctx/chain_56_cctx_68270.go | 14 +- .../testdata/cctx/chain_8332_cctx_148.go | 14 +- zetaclient/zetacore/constant.go | 2 +- zetaclient/zetacore/tx.go | 1 + 71 files changed, 2620 insertions(+), 478 deletions(-) create mode 100644 e2e/e2etests/test_v2_eth_withdraw_and_arbitrary_call.go create mode 100644 e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go create mode 100644 e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go create mode 100644 e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go create mode 100644 pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.abi create mode 100644 pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.bin create mode 100644 pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.go create mode 100644 pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.json create mode 100644 pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.sol create mode 100644 pkg/contracts/gatewayzevmcaller/bindings.go diff --git a/changelog.md b/changelog.md index ea6a525170..f7fa79185d 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,7 @@ * [2883](https://github.com/zeta-chain/node/pull/2883) - add chain static information for btc signet testnet * [2907](https://github.com/zeta-chain/node/pull/2907) - derive Bitcoin tss address by chain id and added more Signet static info * [2911](https://github.com/zeta-chain/node/pull/2911) - add chain static information for btc testnet4 +* [2904](https://github.com/zeta-chain/node/pull/2904) - integrate authenticated calls smart contract functionality into protocol ### Refactor diff --git a/cmd/zetae2e/local/v2.go b/cmd/zetae2e/local/v2.go index ce193bc32e..fa98ef6677 100644 --- a/cmd/zetae2e/local/v2.go +++ b/cmd/zetae2e/local/v2.go @@ -19,8 +19,12 @@ func startV2Tests(eg *errgroup.Group, conf config.Config, deployerRunner *runner e2etests.TestV2ETHDepositName, e2etests.TestV2ETHDepositAndCallName, e2etests.TestV2ETHWithdrawName, + e2etests.TestV2ETHWithdrawAndArbitraryCallName, e2etests.TestV2ETHWithdrawAndCallName, + e2etests.TestV2ETHWithdrawAndCallThroughContractName, + e2etests.TestV2ZEVMToEVMArbitraryCallName, e2etests.TestV2ZEVMToEVMCallName, + e2etests.TestV2ZEVMToEVMCallThroughContractName, e2etests.TestV2EVMToZEVMCallName, )) diff --git a/docs/cli/zetacored/cli.md b/docs/cli/zetacored/cli.md index a8719cf83f..36440f2704 100644 --- a/docs/cli/zetacored/cli.md +++ b/docs/cli/zetacored/cli.md @@ -9441,7 +9441,7 @@ zetacored tx crosschain vote-gas-price [chain] [price] [priorityFee] [blockNumbe Broadcast message to vote an inbound ``` -zetacored tx crosschain vote-inbound [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message] [inboundHash] [inBlockHeight] [coinType] [asset] [eventIndex] [protocolContractVersion] [flags] +zetacored tx crosschain vote-inbound [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message] [inboundHash] [inBlockHeight] [coinType] [asset] [eventIndex] [protocolContractVersion] [isArbitraryCall] [flags] ``` ### Options diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index 26c2c2cb9d..a8c0a2516e 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -57066,6 +57066,14 @@ definitions: - ERC20: ERC20 token - Cmd: no asset, used for admin command - NoAssetCall: no asset, used for contract call + crosschainCallOptions: + type: object + properties: + gas_limit: + type: string + format: uint64 + is_arbitrary_call: + type: boolean crosschainCctxStatus: type: string enum: @@ -57276,6 +57284,7 @@ definitions: gas_limit: type: string format: uint64 + title: Deprecated (v21), use CallOptions gas_price: type: string gas_priority_fee: @@ -57302,6 +57311,8 @@ definitions: type: string tx_finalization_status: $ref: '#/definitions/crosschainTxFinalizationStatus' + call_options: + $ref: '#/definitions/crosschainCallOptions' crosschainOutboundTracker: type: object properties: diff --git a/docs/spec/crosschain/messages.md b/docs/spec/crosschain/messages.md index f2fba7cd1d..c369443d27 100644 --- a/docs/spec/crosschain/messages.md +++ b/docs/spec/crosschain/messages.md @@ -189,6 +189,7 @@ message MsgVoteInbound { uint64 event_index = 15; ProtocolContractVersion protocol_contract_version = 16; RevertOptions revert_options = 17; + CallOptions call_options = 18; } ``` diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index dd9409e4cf..08314f9300 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -131,7 +131,9 @@ const ( TestV2ETHDepositAndCallRevertName = "v2_eth_deposit_and_call_revert" TestV2ETHDepositAndCallRevertWithCallName = "v2_eth_deposit_and_call_revert_with_call" TestV2ETHWithdrawName = "v2_eth_withdraw" + TestV2ETHWithdrawAndArbitraryCallName = "v2_eth_withdraw_and_arbitrary_call" TestV2ETHWithdrawAndCallName = "v2_eth_withdraw_and_call" + TestV2ETHWithdrawAndCallThroughContractName = "v2_eth_withdraw_and_call_through_contract" TestV2ETHWithdrawAndCallRevertName = "v2_eth_withdraw_and_call_revert" TestV2ETHWithdrawAndCallRevertWithCallName = "v2_eth_withdraw_and_call_revert_with_call" TestV2ERC20DepositName = "v2_erc20_deposit" @@ -142,7 +144,9 @@ const ( TestV2ERC20WithdrawAndCallName = "v2_erc20_withdraw_and_call" TestV2ERC20WithdrawAndCallRevertName = "v2_erc20_withdraw_and_call_revert" TestV2ERC20WithdrawAndCallRevertWithCallName = "v2_erc20_withdraw_and_call_revert_with_call" + TestV2ZEVMToEVMArbitraryCallName = "v2_zevm_to_evm_arbitrary_call" TestV2ZEVMToEVMCallName = "v2_zevm_to_evm_call" + TestV2ZEVMToEVMCallThroughContractName = "v2_zevm_to_evm_call_through_contract" TestV2EVMToZEVMCallName = "v2_evm_to_zevm_call" /* @@ -731,13 +735,29 @@ var AllE2ETests = []runner.E2ETest{ TestV2ETHWithdraw, ), runner.NewE2ETest( - TestV2ETHWithdrawAndCallName, + TestV2ETHWithdrawAndArbitraryCallName, "withdraw Ether from ZEVM and call a contract using V2 contract", []runner.ArgDefinition{ {Description: "amount in wei", DefaultValue: "100000"}, }, + TestV2ETHWithdrawAndArbitraryCall, + ), + runner.NewE2ETest( + TestV2ETHWithdrawAndCallName, + "withdraw Ether from ZEVM call a contract using V2 contract", + []runner.ArgDefinition{ + {Description: "amount in wei", DefaultValue: "100000"}, + }, TestV2ETHWithdrawAndCall, ), + runner.NewE2ETest( + TestV2ETHWithdrawAndCallThroughContractName, + "withdraw Ether from ZEVM call a contract using V2 contract through intermediary contract", + []runner.ArgDefinition{ + {Description: "amount in wei", DefaultValue: "100000"}, + }, + TestV2ETHWithdrawAndCallThroughContract, + ), runner.NewE2ETest( TestV2ETHWithdrawAndCallRevertName, "withdraw Ether from ZEVM and call a contract using V2 contract that reverts", @@ -818,12 +838,24 @@ var AllE2ETests = []runner.E2ETest{ }, TestV2ERC20WithdrawAndCallRevertWithCall, ), + runner.NewE2ETest( + TestV2ZEVMToEVMArbitraryCallName, + "zevm -> evm call using V2 contract", + []runner.ArgDefinition{}, + TestV2ZEVMToEVMArbitraryCall, + ), runner.NewE2ETest( TestV2ZEVMToEVMCallName, "zevm -> evm call using V2 contract", []runner.ArgDefinition{}, TestV2ZEVMToEVMCall, ), + runner.NewE2ETest( + TestV2ZEVMToEVMCallThroughContractName, + "zevm -> evm call using V2 contract through intermediary contract", + []runner.ArgDefinition{}, + TestV2ZEVMToEVMCallThroughContract, + ), runner.NewE2ETest( TestV2EVMToZEVMCallName, "evm -> zevm call using V2 contract", diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_arbitrary_call.go b/e2e/e2etests/test_v2_eth_withdraw_and_arbitrary_call.go new file mode 100644 index 0000000000..932034d963 --- /dev/null +++ b/e2e/e2etests/test_v2_eth_withdraw_and_arbitrary_call.go @@ -0,0 +1,40 @@ +package e2etests + +import ( + "math/big" + + "github.com/stretchr/testify/require" + "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" + + "github.com/zeta-chain/node/e2e/runner" + "github.com/zeta-chain/node/e2e/utils" + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" +) + +const payloadMessageWithdrawETH = "this is a test ETH withdraw and call payload" + +func TestV2ETHWithdrawAndArbitraryCall(r *runner.E2ERunner, args []string) { + require.Len(r, args, 1) + + amount, ok := big.NewInt(0).SetString(args[0], 10) + require.True(r, ok, "Invalid amount specified for TestV2ETHWithdrawAndCall") + + r.AssertTestDAppEVMCalled(false, payloadMessageWithdrawETH, amount) + + r.ApproveETHZRC20(r.GatewayZEVMAddr) + + // perform the withdraw + tx := r.V2ETHWithdrawAndCall( + r.TestDAppV2EVMAddr, + amount, + r.EncodeGasCall(payloadMessageWithdrawETH), + gatewayzevm.RevertOptions{OnRevertGasLimit: big.NewInt(0)}, + ) + + // wait for the cctx to be mined + cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) + r.Logger.CCTX(*cctx, "withdraw") + require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status) + + r.AssertTestDAppEVMCalled(true, payloadMessageWithdrawETH, amount) +} diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_call.go b/e2e/e2etests/test_v2_eth_withdraw_and_call.go index 40194c93ba..de0cadabcf 100644 --- a/e2e/e2etests/test_v2_eth_withdraw_and_call.go +++ b/e2e/e2etests/test_v2_eth_withdraw_and_call.go @@ -3,6 +3,7 @@ package e2etests import ( "math/big" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/stretchr/testify/require" "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" @@ -11,23 +12,34 @@ import ( crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" ) -const payloadMessageWithdrawETH = "this is a test ETH withdraw and call payload" +const payloadMessageAuthenticatedWithdrawETH = "this is a test ETH withdraw and authenticated call payload" func TestV2ETHWithdrawAndCall(r *runner.E2ERunner, args []string) { require.Len(r, args, 1) + previousGasLimit := r.ZEVMAuth.GasLimit + r.ZEVMAuth.GasLimit = 10000000 + defer func() { + r.ZEVMAuth.GasLimit = previousGasLimit + }() + amount, ok := big.NewInt(0).SetString(args[0], 10) require.True(r, ok, "Invalid amount specified for TestV2ETHWithdrawAndCall") - r.AssertTestDAppEVMCalled(false, payloadMessageWithdrawETH, amount) + r.AssertTestDAppEVMCalled(false, payloadMessageAuthenticatedWithdrawETH, amount) r.ApproveETHZRC20(r.GatewayZEVMAddr) + // set expected sender + tx, err := r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, r.ZEVMAuth.From) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) + // perform the withdraw - tx := r.V2ETHWithdrawAndCall( + tx = r.V2ETHWithdrawAndAuthenticatedCall( r.TestDAppV2EVMAddr, amount, - r.EncodeGasCall(payloadMessageWithdrawETH), + []byte(payloadMessageAuthenticatedWithdrawETH), gatewayzevm.RevertOptions{OnRevertGasLimit: big.NewInt(0)}, ) @@ -36,5 +48,13 @@ func TestV2ETHWithdrawAndCall(r *runner.E2ERunner, args []string) { r.Logger.CCTX(*cctx, "withdraw") require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status) - r.AssertTestDAppEVMCalled(true, payloadMessageWithdrawETH, amount) + r.AssertTestDAppEVMCalled(true, payloadMessageAuthenticatedWithdrawETH, amount) + + // check expected sender was used + senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage( + &bind.CallOpts{}, + []byte(payloadMessageAuthenticatedWithdrawETH), + ) + require.NoError(r, err) + require.Equal(r, r.ZEVMAuth.From, senderForMsg) } diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go b/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go new file mode 100644 index 0000000000..f2d4949032 --- /dev/null +++ b/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go @@ -0,0 +1,84 @@ +package e2etests + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/stretchr/testify/require" + + "github.com/zeta-chain/node/e2e/runner" + "github.com/zeta-chain/node/e2e/utils" + gatewayzevmcaller "github.com/zeta-chain/node/pkg/contracts/gatewayzevmcaller" + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" +) + +const payloadMessageAuthenticatedWithdrawETHThroughContract = "this is a test ETH withdraw and authenticated call payload through contract" + +func TestV2ETHWithdrawAndCallThroughContract(r *runner.E2ERunner, args []string) { + require.Len(r, args, 1) + + previousGasLimit := r.ZEVMAuth.GasLimit + r.ZEVMAuth.GasLimit = 10000000 + defer func() { + r.ZEVMAuth.GasLimit = previousGasLimit + }() + + amount, ok := big.NewInt(0).SetString(args[0], 10) + require.True(r, ok, "Invalid amount specified for TestV2ETHWithdrawAndCall") + + // deploy caller contract and send it gas zrc20 to pay gas fee + gatewayCallerAddr, tx, gatewayCaller, err := gatewayzevmcaller.DeployGatewayZEVMCaller( + r.ZEVMAuth, + r.ZEVMClient, + r.GatewayZEVMAddr, + r.WZetaAddr, + ) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + + tx, err = r.ETHZRC20.Transfer(r.ZEVMAuth, gatewayCallerAddr, big.NewInt(100000000000000000)) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + + // set expected sender + tx, err = r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, gatewayCallerAddr) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) + + // perform the authenticated call + tx = r.V2ETHWithdrawAndAuthenticatedCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr, + amount, + []byte(payloadMessageAuthenticatedWithdrawETHThroughContract), + gatewayzevmcaller.RevertOptions{OnRevertGasLimit: big.NewInt(0)}) + + utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) + r.Logger.CCTX(*cctx, "withdraw") + require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status) + + r.AssertTestDAppEVMCalled(true, payloadMessageAuthenticatedWithdrawETHThroughContract, amount) + + // check expected sender was used + senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage( + &bind.CallOpts{}, + []byte(payloadMessageAuthenticatedWithdrawETHThroughContract), + ) + require.NoError(r, err) + require.Equal(r, gatewayCallerAddr, senderForMsg) + + // set expected sender to wrong one + tx, err = r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, r.ZEVMAuth.From) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) + + // repeat authenticated call through contract, should revert because of wrong sender + tx = r.V2ETHWithdrawAndAuthenticatedCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr, + amount, + []byte(payloadMessageAuthenticatedWithdrawETHThroughContract), + gatewayzevmcaller.RevertOptions{OnRevertGasLimit: big.NewInt(0)}) + + utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + cctx = utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) + r.Logger.CCTX(*cctx, "withdraw") + require.Equal(r, crosschaintypes.CctxStatus_Reverted, cctx.CctxStatus.Status) +} diff --git a/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go b/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go new file mode 100644 index 0000000000..21104767f9 --- /dev/null +++ b/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go @@ -0,0 +1,36 @@ +package e2etests + +import ( + "math/big" + + "github.com/stretchr/testify/require" + "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" + + "github.com/zeta-chain/node/e2e/runner" + "github.com/zeta-chain/node/e2e/utils" + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" +) + +const payloadMessageEVMCall = "this is a test EVM call payload" + +func TestV2ZEVMToEVMArbitraryCall(r *runner.E2ERunner, args []string) { + require.Len(r, args, 0) + + r.AssertTestDAppEVMCalled(false, payloadMessageEVMCall, big.NewInt(0)) + + // Necessary approval for fee payment + r.ApproveETHZRC20(r.GatewayZEVMAddr) + + // perform the call + tx := r.V2ZEVMToEMVCall(r.TestDAppV2EVMAddr, r.EncodeSimpleCall(payloadMessageEVMCall), gatewayzevm.RevertOptions{ + OnRevertGasLimit: big.NewInt(0), + }) + + // wait for the cctx to be mined + cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) + r.Logger.CCTX(*cctx, "call") + require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status) + + // check the payload was received on the contract + r.AssertTestDAppEVMCalled(true, payloadMessageEVMCall, big.NewInt(0)) +} diff --git a/e2e/e2etests/test_v2_zevm_to_evm_call.go b/e2e/e2etests/test_v2_zevm_to_evm_call.go index c38d328db8..ba9d5fba6f 100644 --- a/e2e/e2etests/test_v2_zevm_to_evm_call.go +++ b/e2e/e2etests/test_v2_zevm_to_evm_call.go @@ -3,6 +3,7 @@ package e2etests import ( "math/big" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/stretchr/testify/require" "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" @@ -11,20 +12,29 @@ import ( crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" ) -const payloadMessageEVMCall = "this is a test EVM call payload" +const payloadMessageEVMAuthenticatedCall = "this is a test EVM authenticated call payload" func TestV2ZEVMToEVMCall(r *runner.E2ERunner, args []string) { require.Len(r, args, 0) - r.AssertTestDAppEVMCalled(false, payloadMessageEVMCall, big.NewInt(0)) + r.AssertTestDAppEVMCalled(false, payloadMessageEVMAuthenticatedCall, big.NewInt(0)) - // Necessary approval for fee payment + // necessary approval for fee payment r.ApproveETHZRC20(r.GatewayZEVMAddr) - // perform the withdraw - tx := r.V2ZEVMToEMVCall(r.TestDAppV2EVMAddr, r.EncodeSimpleCall(payloadMessageEVMCall), gatewayzevm.RevertOptions{ - OnRevertGasLimit: big.NewInt(0), - }) + // set expected sender + tx, err := r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, r.ZEVMAuth.From) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) + + // perform the authenticated call + tx = r.V2ZEVMToEMVAuthenticatedCall( + r.TestDAppV2EVMAddr, + []byte(payloadMessageEVMAuthenticatedCall), + gatewayzevm.RevertOptions{ + OnRevertGasLimit: big.NewInt(0), + }, + ) // wait for the cctx to be mined cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) @@ -32,5 +42,10 @@ func TestV2ZEVMToEVMCall(r *runner.E2ERunner, args []string) { require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status) // check the payload was received on the contract - r.AssertTestDAppEVMCalled(true, payloadMessageEVMCall, big.NewInt(0)) + r.AssertTestDAppEVMCalled(true, payloadMessageEVMAuthenticatedCall, big.NewInt(0)) + + // check expected sender was used + senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage(&bind.CallOpts{}, []byte(payloadMessageEVMAuthenticatedCall)) + require.NoError(r, err) + require.Equal(r, r.ZEVMAuth.From, senderForMsg) } diff --git a/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go b/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go new file mode 100644 index 0000000000..a46b9f09f9 --- /dev/null +++ b/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go @@ -0,0 +1,83 @@ +package e2etests + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/stretchr/testify/require" + + "github.com/zeta-chain/node/e2e/runner" + "github.com/zeta-chain/node/e2e/utils" + gatewayzevmcaller "github.com/zeta-chain/node/pkg/contracts/gatewayzevmcaller" + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" +) + +const payloadMessageEVMAuthenticatedCallThroughContract = "this is a test EVM authenticated call payload through contract" + +func TestV2ZEVMToEVMCallThroughContract(r *runner.E2ERunner, args []string) { + require.Len(r, args, 0) + + r.AssertTestDAppEVMCalled(false, payloadMessageEVMAuthenticatedCallThroughContract, big.NewInt(0)) + + // deploy caller contract and send it gas zrc20 to pay gas fee + gatewayCallerAddr, tx, gatewayCaller, err := gatewayzevmcaller.DeployGatewayZEVMCaller( + r.ZEVMAuth, + r.ZEVMClient, + r.GatewayZEVMAddr, + r.WZetaAddr, + ) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + + tx, err = r.ETHZRC20.Transfer(r.ZEVMAuth, gatewayCallerAddr, big.NewInt(100000000000000000)) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + + // set expected sender + tx, err = r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, gatewayCallerAddr) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) + + // perform the authenticated call + tx = r.V2ZEVMToEMVAuthenticatedCallThroughContract( + gatewayCaller, + r.TestDAppV2EVMAddr, + []byte(payloadMessageEVMAuthenticatedCallThroughContract), + gatewayzevmcaller.RevertOptions{ + OnRevertGasLimit: big.NewInt(0), + }, + ) + utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) + r.Logger.CCTX(*cctx, "call") + require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status) + + r.AssertTestDAppEVMCalled(true, payloadMessageEVMAuthenticatedCallThroughContract, big.NewInt(0)) + + // check expected sender was used + senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage( + &bind.CallOpts{}, + []byte(payloadMessageEVMAuthenticatedCallThroughContract), + ) + require.NoError(r, err) + require.Equal(r, gatewayCallerAddr, senderForMsg) + + // set expected sender to wrong one + tx, err = r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, r.ZEVMAuth.From) + require.NoError(r, err) + utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) + + // repeat authenticated call through contract, should revert because of wrong sender + tx = r.V2ZEVMToEMVAuthenticatedCallThroughContract( + gatewayCaller, + r.TestDAppV2EVMAddr, + []byte(payloadMessageEVMAuthenticatedCallThroughContract), + gatewayzevmcaller.RevertOptions{ + OnRevertGasLimit: big.NewInt(0), + }, + ) + utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + cctx = utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) + r.Logger.CCTX(*cctx, "call") + require.Equal(r, crosschaintypes.CctxStatus_Reverted, cctx.CctxStatus.Status) +} diff --git a/e2e/runner/logger.go b/e2e/runner/logger.go index 16b34836f4..24f9c8f7bc 100644 --- a/e2e/runner/logger.go +++ b/e2e/runner/logger.go @@ -153,6 +153,7 @@ func (l *Logger) CCTX(cctx crosschaintypes.CrossChainTx, name string) { l.Info(" TxHeight: %d", outTxParam.ObservedExternalHeight) l.Info(" BallotIndex: %s", outTxParam.BallotIndex) l.Info(" TSSNonce: %d", outTxParam.TssNonce) + l.Info(" CallOptions: %+v", outTxParam.CallOptions) l.Info(" GasLimit: %d", outTxParam.GasLimit) l.Info(" GasPrice: %s", outTxParam.GasPrice) l.Info(" GasUsed: %d", outTxParam.GasUsed) diff --git a/e2e/runner/v2_zevm.go b/e2e/runner/v2_zevm.go index 681696b195..4824884bd0 100644 --- a/e2e/runner/v2_zevm.go +++ b/e2e/runner/v2_zevm.go @@ -7,6 +7,8 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/require" "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" + + gatewayzevmcaller "github.com/zeta-chain/node/pkg/contracts/gatewayzevmcaller" ) var gasLimit = big.NewInt(1000000) @@ -50,6 +52,56 @@ func (r *E2ERunner) V2ETHWithdrawAndCall( return tx } +// V2ETHWithdrawAndCall calls WithdrawAndCall of Gateway with gas token on ZEVM using authenticated call +func (r *E2ERunner) V2ETHWithdrawAndAuthenticatedCall( + receiver ethcommon.Address, + amount *big.Int, + payload []byte, + revertOptions gatewayzevm.RevertOptions, +) *ethtypes.Transaction { + tx, err := r.GatewayZEVM.WithdrawAndCall2( + r.ZEVMAuth, + receiver.Bytes(), + amount, + r.ETHZRC20Addr, + payload, + gatewayzevm.CallOptions{ + IsArbitraryCall: false, + GasLimit: gasLimit, + }, + revertOptions, + ) + require.NoError(r, err) + + return tx +} + +// V2ETHWithdrawAndCall calls WithdrawAndCall of Gateway with gas token on ZEVM using authenticated call +// through contract +func (r *E2ERunner) V2ETHWithdrawAndAuthenticatedCallThroughContract( + gatewayZEVMCaller *gatewayzevmcaller.GatewayZEVMCaller, + receiver ethcommon.Address, + amount *big.Int, + payload []byte, + revertOptions gatewayzevmcaller.RevertOptions, +) *ethtypes.Transaction { + tx, err := gatewayZEVMCaller.WithdrawAndCallGatewayZEVM( + r.ZEVMAuth, + receiver.Bytes(), + amount, + r.ETHZRC20Addr, + payload, + gatewayzevmcaller.CallOptions{ + IsArbitraryCall: false, + GasLimit: gasLimit, + }, + revertOptions, + ) + require.NoError(r, err) + + return tx +} + // V2ERC20Withdraw calls Withdraw of Gateway with erc20 token on ZEVM func (r *E2ERunner) V2ERC20Withdraw( receiver ethcommon.Address, @@ -103,7 +155,7 @@ func (r *E2ERunner) V2ZEVMToEMVCall( payload []byte, revertOptions gatewayzevm.RevertOptions, ) *ethtypes.Transaction { - tx, err := r.GatewayZEVM.Call( + tx, err := r.GatewayZEVM.Call0( r.ZEVMAuth, receiver.Bytes(), r.ETHZRC20Addr, @@ -115,3 +167,48 @@ func (r *E2ERunner) V2ZEVMToEMVCall( return tx } + +// V2ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM +func (r *E2ERunner) V2ZEVMToEMVAuthenticatedCall( + receiver ethcommon.Address, + payload []byte, + revertOptions gatewayzevm.RevertOptions, +) *ethtypes.Transaction { + tx, err := r.GatewayZEVM.Call( + r.ZEVMAuth, + receiver.Bytes(), + r.ETHZRC20Addr, + payload, + gatewayzevm.CallOptions{ + GasLimit: gasLimit, + IsArbitraryCall: false, + }, + revertOptions, + ) + require.NoError(r, err) + + return tx +} + +// V2ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM through contract +func (r *E2ERunner) V2ZEVMToEMVAuthenticatedCallThroughContract( + gatewayZEVMCaller *gatewayzevmcaller.GatewayZEVMCaller, + receiver ethcommon.Address, + payload []byte, + revertOptions gatewayzevmcaller.RevertOptions, +) *ethtypes.Transaction { + tx, err := gatewayZEVMCaller.CallGatewayZEVM( + r.ZEVMAuth, + receiver.Bytes(), + r.ETHZRC20Addr, + payload, + gatewayzevmcaller.CallOptions{ + GasLimit: gasLimit, + IsArbitraryCall: false, + }, + revertOptions, + ) + require.NoError(r, err) + + return tx +} diff --git a/go.mod b/go.mod index ef1e1de174..17899e5ccb 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/zeta-chain/ethermint v0.0.0-20240909234716-2fad916e7179 github.com/zeta-chain/keystone/keys v0.0.0-20240826165841-3874f358c138 - github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20240819143729-b8229cd7b410 + github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20240920151810-cabe34920d52 gitlab.com/thorchain/tss/go-tss v1.6.5 go.nhat.io/grpcmock v0.25.0 golang.org/x/crypto v0.23.0 diff --git a/go.sum b/go.sum index e47729265c..972c2695ce 100644 --- a/go.sum +++ b/go.sum @@ -4182,8 +4182,8 @@ github.com/zeta-chain/go-tss v0.0.0-20240916173049-89fee4b0ae7f h1:XqUvw9a3EnDa2 github.com/zeta-chain/go-tss v0.0.0-20240916173049-89fee4b0ae7f/go.mod h1:B1FDE6kHs8hozKSX1/iXgCdvlFbS6+FeAupoBHDK0Cc= github.com/zeta-chain/keystone/keys v0.0.0-20240826165841-3874f358c138 h1:vck/FcIIpFOvpBUm0NO17jbEtmSz/W/a5Y4jRuSJl6I= github.com/zeta-chain/keystone/keys v0.0.0-20240826165841-3874f358c138/go.mod h1:U494OsZTWsU75hqoriZgMdSsgSGP1mUL1jX+wN/Aez8= -github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20240819143729-b8229cd7b410 h1:sBeVX63s/qmfT1KnIKj1Y2SK3PsFpAM/P49ODcD1CN8= -github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20240819143729-b8229cd7b410/go.mod h1:SjT7QirtJE8stnAe1SlNOanxtfSfijJm3MGJ+Ax7w7w= +github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20240920151810-cabe34920d52 h1:DlSY9awQteXVmvY0lPD4Or83iuL4P5KwSGky+n4mYio= +github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20240920151810-cabe34920d52/go.mod h1:SjT7QirtJE8stnAe1SlNOanxtfSfijJm3MGJ+Ax7w7w= github.com/zeta-chain/tss-lib v0.0.0-20240916163010-2e6b438bd901 h1:9whtN5fjYHfk4yXIuAsYP2EHxImwDWDVUOnZJ2pfL3w= github.com/zeta-chain/tss-lib v0.0.0-20240916163010-2e6b438bd901/go.mod h1:d2iTC62s9JwKiCMPhcDDXbIZmuzAyJ4lwso0H5QyRbk= github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= diff --git a/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.abi b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.abi new file mode 100644 index 0000000000..373cc949b7 --- /dev/null +++ b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.abi @@ -0,0 +1,251 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayZEVMAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "wzetaAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "address", + "name": "zrc20", + "type": "address" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isArbitraryCall", + "type": "bool" + } + ], + "internalType": "struct CallOptions", + "name": "callOptions", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "revertAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "callOnRevert", + "type": "bool" + }, + { + "internalType": "address", + "name": "abortAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "revertMessage", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "onRevertGasLimit", + "type": "uint256" + } + ], + "internalType": "struct RevertOptions", + "name": "revertOptions", + "type": "tuple" + } + ], + "name": "callGatewayZEVM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "depositWZETA", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "zrc20", + "type": "address" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isArbitraryCall", + "type": "bool" + } + ], + "internalType": "struct CallOptions", + "name": "callOptions", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "revertAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "callOnRevert", + "type": "bool" + }, + { + "internalType": "address", + "name": "abortAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "revertMessage", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "onRevertGasLimit", + "type": "uint256" + } + ], + "internalType": "struct RevertOptions", + "name": "revertOptions", + "type": "tuple" + } + ], + "name": "withdrawAndCallGatewayZEVM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isArbitraryCall", + "type": "bool" + } + ], + "internalType": "struct CallOptions", + "name": "callOptions", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "revertAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "callOnRevert", + "type": "bool" + }, + { + "internalType": "address", + "name": "abortAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "revertMessage", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "onRevertGasLimit", + "type": "uint256" + } + ], + "internalType": "struct RevertOptions", + "name": "revertOptions", + "type": "tuple" + } + ], + "name": "withdrawAndCallGatewayZEVM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.bin b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.bin new file mode 100644 index 0000000000..f0626b3dc0 --- /dev/null +++ b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.bin @@ -0,0 +1 @@ +60806040523480156200001157600080fd5b50604051620011613803806200116183398181016040528101906200003791906200012a565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505062000171565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000f282620000c5565b9050919050565b6200010481620000e5565b81146200011057600080fd5b50565b6000815190506200012481620000f9565b92915050565b60008060408385031215620001445762000143620000c0565b5b6000620001548582860162000113565b9250506020620001678582860162000113565b9150509250929050565b610fe080620001816000396000f3fe60806040526004361061003f5760003560e01c806325859e62146100445780632c5d24ae1461006d57806362543ae714610077578063f66f4625146100a0575b600080fd5b34801561005057600080fd5b5061006b60048036038101906100669190610795565b6100c9565b005b61007561020d565b005b34801561008357600080fd5b5061009e6004803603810190610099919061089d565b610292565b005b3480156100ac57600080fd5b506100c760048036038101906100c29190610984565b6103d9565b005b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b815260040161012c929190610abf565b6020604051808303816000875af115801561014b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016f9190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306cb89838787878787876040518763ffffffff1660e01b81526004016101d396959493929190610e18565b600060405180830381600087803b1580156101ed57600080fd5b505af1158015610201573d6000803e3d6000fd5b50505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561027757600080fd5b505af115801561028b573d6000803e3d6000fd5b5050505050565b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b81526004016102f5929190610abf565b6020604051808303816000875af1158015610314573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103389190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637b15118b888888888888886040518863ffffffff1660e01b815260040161039e9796959493929190610e91565b600060405180830381600087803b1580156103b857600080fd5b505af11580156103cc573d6000803e3d6000fd5b5050505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886040518363ffffffff1660e01b8152600401610456929190610f09565b6020604051808303816000875af1158015610475573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104999190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632810ae63888888888888886040518863ffffffff1660e01b81526004016104ff9796959493929190610f32565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b5050505050505050505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105a182610558565b810181811067ffffffffffffffff821117156105c0576105bf610569565b5b80604052505050565b60006105d361053a565b90506105df8282610598565b919050565b600067ffffffffffffffff8211156105ff576105fe610569565b5b61060882610558565b9050602081019050919050565b82818337600083830152505050565b6000610637610632846105e4565b6105c9565b90508281526020810184848401111561065357610652610553565b5b61065e848285610615565b509392505050565b600082601f83011261067b5761067a61054e565b5b813561068b848260208601610624565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006106bf82610694565b9050919050565b6106cf816106b4565b81146106da57600080fd5b50565b6000813590506106ec816106c6565b92915050565b600080fd5b600080fd5b60008083601f8401126107125761071161054e565b5b8235905067ffffffffffffffff81111561072f5761072e6106f2565b5b60208301915083600182028301111561074b5761074a6106f7565b5b9250929050565b600080fd5b60006040828403121561076d5761076c610752565b5b81905092915050565b600060a0828403121561078c5761078b610752565b5b81905092915050565b60008060008060008060c087890312156107b2576107b1610544565b5b600087013567ffffffffffffffff8111156107d0576107cf610549565b5b6107dc89828a01610666565b96505060206107ed89828a016106dd565b955050604087013567ffffffffffffffff81111561080e5761080d610549565b5b61081a89828a016106fc565b9450945050606061082d89828a01610757565b92505060a087013567ffffffffffffffff81111561084e5761084d610549565b5b61085a89828a01610776565b9150509295509295509295565b6000819050919050565b61087a81610867565b811461088557600080fd5b50565b60008135905061089781610871565b92915050565b600080600080600080600060e0888a0312156108bc576108bb610544565b5b600088013567ffffffffffffffff8111156108da576108d9610549565b5b6108e68a828b01610666565b97505060206108f78a828b01610888565b96505060406109088a828b016106dd565b955050606088013567ffffffffffffffff81111561092957610928610549565b5b6109358a828b016106fc565b945094505060806109488a828b01610757565b92505060c088013567ffffffffffffffff81111561096957610968610549565b5b6109758a828b01610776565b91505092959891949750929550565b600080600080600080600060e0888a0312156109a3576109a2610544565b5b600088013567ffffffffffffffff8111156109c1576109c0610549565b5b6109cd8a828b01610666565b97505060206109de8a828b01610888565b96505060406109ef8a828b01610888565b955050606088013567ffffffffffffffff811115610a1057610a0f610549565b5b610a1c8a828b016106fc565b94509450506080610a2f8a828b01610757565b92505060c088013567ffffffffffffffff811115610a5057610a4f610549565b5b610a5c8a828b01610776565b91505092959891949750929550565b610a74816106b4565b82525050565b6000819050919050565b6000819050919050565b6000610aa9610aa4610a9f84610a7a565b610a84565b610867565b9050919050565b610ab981610a8e565b82525050565b6000604082019050610ad46000830185610a6b565b610ae16020830184610ab0565b9392505050565b60008115159050919050565b610afd81610ae8565b8114610b0857600080fd5b50565b600081519050610b1a81610af4565b92915050565b600060208284031215610b3657610b35610544565b5b6000610b4484828501610b0b565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610b87578082015181840152602081019050610b6c565b83811115610b96576000848401525b50505050565b6000610ba782610b4d565b610bb18185610b58565b9350610bc1818560208601610b69565b610bca81610558565b840191505092915050565b6000610be18385610b58565b9350610bee838584610615565b610bf783610558565b840190509392505050565b6000610c116020840184610888565b905092915050565b610c2281610867565b82525050565b600081359050610c3781610af4565b92915050565b6000610c4c6020840184610c28565b905092915050565b610c5d81610ae8565b82525050565b60408201610c746000830183610c02565b610c816000850182610c19565b50610c8f6020830183610c3d565b610c9c6020850182610c54565b50505050565b6000610cb160208401846106dd565b905092915050565b610cc2816106b4565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610cf457610cf3610cd2565b5b83810192508235915060208301925067ffffffffffffffff821115610d1c57610d1b610cc8565b5b600182023603841315610d3257610d31610ccd565b5b509250929050565b600082825260208201905092915050565b6000610d578385610d3a565b9350610d64838584610615565b610d6d83610558565b840190509392505050565b600060a08301610d8b6000840184610ca2565b610d986000860182610cb9565b50610da66020840184610c3d565b610db36020860182610c54565b50610dc16040840184610ca2565b610dce6040860182610cb9565b50610ddc6060840184610cd7565b8583036060870152610def838284610d4b565b92505050610e006080840184610c02565b610e0d6080860182610c19565b508091505092915050565b600060c0820190508181036000830152610e328189610b9c565b9050610e416020830188610a6b565b8181036040830152610e54818688610bd5565b9050610e636060830185610c63565b81810360a0830152610e758184610d78565b9050979650505050505050565b610e8b81610867565b82525050565b600060e0820190508181036000830152610eab818a610b9c565b9050610eba6020830189610e82565b610ec76040830188610a6b565b8181036060830152610eda818688610bd5565b9050610ee96080830185610c63565b81810360c0830152610efb8184610d78565b905098975050505050505050565b6000604082019050610f1e6000830185610a6b565b610f2b6020830184610e82565b9392505050565b600060e0820190508181036000830152610f4c818a610b9c565b9050610f5b6020830189610e82565b610f686040830188610e82565b8181036060830152610f7b818688610bd5565b9050610f8a6080830185610c63565b81810360c0830152610f9c8184610d78565b90509897505050505050505056fea26469706673582212204b70dead8f68839447fc08bd73294d57367a484ba9b048960ffcc202a737ae5664736f6c634300080a0033 diff --git a/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.go b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.go new file mode 100644 index 0000000000..3411e3a9d1 --- /dev/null +++ b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.go @@ -0,0 +1,302 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package gatewayzevmcaller + +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 +) + +// CallOptions is an auto generated low-level Go binding around an user-defined struct. +type CallOptions struct { + GasLimit *big.Int + IsArbitraryCall bool +} + +// RevertOptions is an auto generated low-level Go binding around an user-defined struct. +type RevertOptions struct { + RevertAddress common.Address + CallOnRevert bool + AbortAddress common.Address + RevertMessage []byte + OnRevertGasLimit *big.Int +} + +// GatewayZEVMCallerMetaData contains all meta data concerning the GatewayZEVMCaller contract. +var GatewayZEVMCallerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gatewayZEVMAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"wzetaAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"zrc20\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isArbitraryCall\",\"type\":\"bool\"}],\"internalType\":\"structCallOptions\",\"name\":\"callOptions\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"revertAddress\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"callOnRevert\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"abortAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"revertMessage\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"onRevertGasLimit\",\"type\":\"uint256\"}],\"internalType\":\"structRevertOptions\",\"name\":\"revertOptions\",\"type\":\"tuple\"}],\"name\":\"callGatewayZEVM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositWZETA\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"zrc20\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isArbitraryCall\",\"type\":\"bool\"}],\"internalType\":\"structCallOptions\",\"name\":\"callOptions\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"revertAddress\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"callOnRevert\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"abortAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"revertMessage\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"onRevertGasLimit\",\"type\":\"uint256\"}],\"internalType\":\"structRevertOptions\",\"name\":\"revertOptions\",\"type\":\"tuple\"}],\"name\":\"withdrawAndCallGatewayZEVM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"receiver\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isArbitraryCall\",\"type\":\"bool\"}],\"internalType\":\"structCallOptions\",\"name\":\"callOptions\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"revertAddress\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"callOnRevert\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"abortAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"revertMessage\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"onRevertGasLimit\",\"type\":\"uint256\"}],\"internalType\":\"structRevertOptions\",\"name\":\"revertOptions\",\"type\":\"tuple\"}],\"name\":\"withdrawAndCallGatewayZEVM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60806040523480156200001157600080fd5b50604051620011613803806200116183398181016040528101906200003791906200012a565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505062000171565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000f282620000c5565b9050919050565b6200010481620000e5565b81146200011057600080fd5b50565b6000815190506200012481620000f9565b92915050565b60008060408385031215620001445762000143620000c0565b5b6000620001548582860162000113565b9250506020620001678582860162000113565b9150509250929050565b610fe080620001816000396000f3fe60806040526004361061003f5760003560e01c806325859e62146100445780632c5d24ae1461006d57806362543ae714610077578063f66f4625146100a0575b600080fd5b34801561005057600080fd5b5061006b60048036038101906100669190610795565b6100c9565b005b61007561020d565b005b34801561008357600080fd5b5061009e6004803603810190610099919061089d565b610292565b005b3480156100ac57600080fd5b506100c760048036038101906100c29190610984565b6103d9565b005b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b815260040161012c929190610abf565b6020604051808303816000875af115801561014b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016f9190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306cb89838787878787876040518763ffffffff1660e01b81526004016101d396959493929190610e18565b600060405180830381600087803b1580156101ed57600080fd5b505af1158015610201573d6000803e3d6000fd5b50505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561027757600080fd5b505af115801561028b573d6000803e3d6000fd5b5050505050565b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b81526004016102f5929190610abf565b6020604051808303816000875af1158015610314573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103389190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637b15118b888888888888886040518863ffffffff1660e01b815260040161039e9796959493929190610e91565b600060405180830381600087803b1580156103b857600080fd5b505af11580156103cc573d6000803e3d6000fd5b5050505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886040518363ffffffff1660e01b8152600401610456929190610f09565b6020604051808303816000875af1158015610475573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104999190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632810ae63888888888888886040518863ffffffff1660e01b81526004016104ff9796959493929190610f32565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b5050505050505050505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105a182610558565b810181811067ffffffffffffffff821117156105c0576105bf610569565b5b80604052505050565b60006105d361053a565b90506105df8282610598565b919050565b600067ffffffffffffffff8211156105ff576105fe610569565b5b61060882610558565b9050602081019050919050565b82818337600083830152505050565b6000610637610632846105e4565b6105c9565b90508281526020810184848401111561065357610652610553565b5b61065e848285610615565b509392505050565b600082601f83011261067b5761067a61054e565b5b813561068b848260208601610624565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006106bf82610694565b9050919050565b6106cf816106b4565b81146106da57600080fd5b50565b6000813590506106ec816106c6565b92915050565b600080fd5b600080fd5b60008083601f8401126107125761071161054e565b5b8235905067ffffffffffffffff81111561072f5761072e6106f2565b5b60208301915083600182028301111561074b5761074a6106f7565b5b9250929050565b600080fd5b60006040828403121561076d5761076c610752565b5b81905092915050565b600060a0828403121561078c5761078b610752565b5b81905092915050565b60008060008060008060c087890312156107b2576107b1610544565b5b600087013567ffffffffffffffff8111156107d0576107cf610549565b5b6107dc89828a01610666565b96505060206107ed89828a016106dd565b955050604087013567ffffffffffffffff81111561080e5761080d610549565b5b61081a89828a016106fc565b9450945050606061082d89828a01610757565b92505060a087013567ffffffffffffffff81111561084e5761084d610549565b5b61085a89828a01610776565b9150509295509295509295565b6000819050919050565b61087a81610867565b811461088557600080fd5b50565b60008135905061089781610871565b92915050565b600080600080600080600060e0888a0312156108bc576108bb610544565b5b600088013567ffffffffffffffff8111156108da576108d9610549565b5b6108e68a828b01610666565b97505060206108f78a828b01610888565b96505060406109088a828b016106dd565b955050606088013567ffffffffffffffff81111561092957610928610549565b5b6109358a828b016106fc565b945094505060806109488a828b01610757565b92505060c088013567ffffffffffffffff81111561096957610968610549565b5b6109758a828b01610776565b91505092959891949750929550565b600080600080600080600060e0888a0312156109a3576109a2610544565b5b600088013567ffffffffffffffff8111156109c1576109c0610549565b5b6109cd8a828b01610666565b97505060206109de8a828b01610888565b96505060406109ef8a828b01610888565b955050606088013567ffffffffffffffff811115610a1057610a0f610549565b5b610a1c8a828b016106fc565b94509450506080610a2f8a828b01610757565b92505060c088013567ffffffffffffffff811115610a5057610a4f610549565b5b610a5c8a828b01610776565b91505092959891949750929550565b610a74816106b4565b82525050565b6000819050919050565b6000819050919050565b6000610aa9610aa4610a9f84610a7a565b610a84565b610867565b9050919050565b610ab981610a8e565b82525050565b6000604082019050610ad46000830185610a6b565b610ae16020830184610ab0565b9392505050565b60008115159050919050565b610afd81610ae8565b8114610b0857600080fd5b50565b600081519050610b1a81610af4565b92915050565b600060208284031215610b3657610b35610544565b5b6000610b4484828501610b0b565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610b87578082015181840152602081019050610b6c565b83811115610b96576000848401525b50505050565b6000610ba782610b4d565b610bb18185610b58565b9350610bc1818560208601610b69565b610bca81610558565b840191505092915050565b6000610be18385610b58565b9350610bee838584610615565b610bf783610558565b840190509392505050565b6000610c116020840184610888565b905092915050565b610c2281610867565b82525050565b600081359050610c3781610af4565b92915050565b6000610c4c6020840184610c28565b905092915050565b610c5d81610ae8565b82525050565b60408201610c746000830183610c02565b610c816000850182610c19565b50610c8f6020830183610c3d565b610c9c6020850182610c54565b50505050565b6000610cb160208401846106dd565b905092915050565b610cc2816106b4565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610cf457610cf3610cd2565b5b83810192508235915060208301925067ffffffffffffffff821115610d1c57610d1b610cc8565b5b600182023603841315610d3257610d31610ccd565b5b509250929050565b600082825260208201905092915050565b6000610d578385610d3a565b9350610d64838584610615565b610d6d83610558565b840190509392505050565b600060a08301610d8b6000840184610ca2565b610d986000860182610cb9565b50610da66020840184610c3d565b610db36020860182610c54565b50610dc16040840184610ca2565b610dce6040860182610cb9565b50610ddc6060840184610cd7565b8583036060870152610def838284610d4b565b92505050610e006080840184610c02565b610e0d6080860182610c19565b508091505092915050565b600060c0820190508181036000830152610e328189610b9c565b9050610e416020830188610a6b565b8181036040830152610e54818688610bd5565b9050610e636060830185610c63565b81810360a0830152610e758184610d78565b9050979650505050505050565b610e8b81610867565b82525050565b600060e0820190508181036000830152610eab818a610b9c565b9050610eba6020830189610e82565b610ec76040830188610a6b565b8181036060830152610eda818688610bd5565b9050610ee96080830185610c63565b81810360c0830152610efb8184610d78565b905098975050505050505050565b6000604082019050610f1e6000830185610a6b565b610f2b6020830184610e82565b9392505050565b600060e0820190508181036000830152610f4c818a610b9c565b9050610f5b6020830189610e82565b610f686040830188610e82565b8181036060830152610f7b818688610bd5565b9050610f8a6080830185610c63565b81810360c0830152610f9c8184610d78565b90509897505050505050505056fea26469706673582212204b70dead8f68839447fc08bd73294d57367a484ba9b048960ffcc202a737ae5664736f6c634300080a0033", +} + +// GatewayZEVMCallerABI is the input ABI used to generate the binding from. +// Deprecated: Use GatewayZEVMCallerMetaData.ABI instead. +var GatewayZEVMCallerABI = GatewayZEVMCallerMetaData.ABI + +// GatewayZEVMCallerBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use GatewayZEVMCallerMetaData.Bin instead. +var GatewayZEVMCallerBin = GatewayZEVMCallerMetaData.Bin + +// DeployGatewayZEVMCaller deploys a new Ethereum contract, binding an instance of GatewayZEVMCaller to it. +func DeployGatewayZEVMCaller(auth *bind.TransactOpts, backend bind.ContractBackend, gatewayZEVMAddress common.Address, wzetaAddress common.Address) (common.Address, *types.Transaction, *GatewayZEVMCaller, error) { + parsed, err := GatewayZEVMCallerMetaData.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(GatewayZEVMCallerBin), backend, gatewayZEVMAddress, wzetaAddress) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &GatewayZEVMCaller{GatewayZEVMCallerCaller: GatewayZEVMCallerCaller{contract: contract}, GatewayZEVMCallerTransactor: GatewayZEVMCallerTransactor{contract: contract}, GatewayZEVMCallerFilterer: GatewayZEVMCallerFilterer{contract: contract}}, nil +} + +// GatewayZEVMCaller is an auto generated Go binding around an Ethereum contract. +type GatewayZEVMCaller struct { + GatewayZEVMCallerCaller // Read-only binding to the contract + GatewayZEVMCallerTransactor // Write-only binding to the contract + GatewayZEVMCallerFilterer // Log filterer for contract events +} + +// GatewayZEVMCallerCaller is an auto generated read-only Go binding around an Ethereum contract. +type GatewayZEVMCallerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GatewayZEVMCallerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type GatewayZEVMCallerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GatewayZEVMCallerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type GatewayZEVMCallerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GatewayZEVMCallerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type GatewayZEVMCallerSession struct { + Contract *GatewayZEVMCaller // 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 +} + +// GatewayZEVMCallerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type GatewayZEVMCallerCallerSession struct { + Contract *GatewayZEVMCallerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// GatewayZEVMCallerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type GatewayZEVMCallerTransactorSession struct { + Contract *GatewayZEVMCallerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// GatewayZEVMCallerRaw is an auto generated low-level Go binding around an Ethereum contract. +type GatewayZEVMCallerRaw struct { + Contract *GatewayZEVMCaller // Generic contract binding to access the raw methods on +} + +// GatewayZEVMCallerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type GatewayZEVMCallerCallerRaw struct { + Contract *GatewayZEVMCallerCaller // Generic read-only contract binding to access the raw methods on +} + +// GatewayZEVMCallerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type GatewayZEVMCallerTransactorRaw struct { + Contract *GatewayZEVMCallerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewGatewayZEVMCaller creates a new instance of GatewayZEVMCaller, bound to a specific deployed contract. +func NewGatewayZEVMCaller(address common.Address, backend bind.ContractBackend) (*GatewayZEVMCaller, error) { + contract, err := bindGatewayZEVMCaller(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &GatewayZEVMCaller{GatewayZEVMCallerCaller: GatewayZEVMCallerCaller{contract: contract}, GatewayZEVMCallerTransactor: GatewayZEVMCallerTransactor{contract: contract}, GatewayZEVMCallerFilterer: GatewayZEVMCallerFilterer{contract: contract}}, nil +} + +// NewGatewayZEVMCallerCaller creates a new read-only instance of GatewayZEVMCaller, bound to a specific deployed contract. +func NewGatewayZEVMCallerCaller(address common.Address, caller bind.ContractCaller) (*GatewayZEVMCallerCaller, error) { + contract, err := bindGatewayZEVMCaller(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &GatewayZEVMCallerCaller{contract: contract}, nil +} + +// NewGatewayZEVMCallerTransactor creates a new write-only instance of GatewayZEVMCaller, bound to a specific deployed contract. +func NewGatewayZEVMCallerTransactor(address common.Address, transactor bind.ContractTransactor) (*GatewayZEVMCallerTransactor, error) { + contract, err := bindGatewayZEVMCaller(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &GatewayZEVMCallerTransactor{contract: contract}, nil +} + +// NewGatewayZEVMCallerFilterer creates a new log filterer instance of GatewayZEVMCaller, bound to a specific deployed contract. +func NewGatewayZEVMCallerFilterer(address common.Address, filterer bind.ContractFilterer) (*GatewayZEVMCallerFilterer, error) { + contract, err := bindGatewayZEVMCaller(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &GatewayZEVMCallerFilterer{contract: contract}, nil +} + +// bindGatewayZEVMCaller binds a generic wrapper to an already deployed contract. +func bindGatewayZEVMCaller(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := GatewayZEVMCallerMetaData.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 (_GatewayZEVMCaller *GatewayZEVMCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _GatewayZEVMCaller.Contract.GatewayZEVMCallerCaller.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 (_GatewayZEVMCaller *GatewayZEVMCallerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.GatewayZEVMCallerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_GatewayZEVMCaller *GatewayZEVMCallerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.GatewayZEVMCallerTransactor.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 (_GatewayZEVMCaller *GatewayZEVMCallerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _GatewayZEVMCaller.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 (_GatewayZEVMCaller *GatewayZEVMCallerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_GatewayZEVMCaller *GatewayZEVMCallerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.contract.Transact(opts, method, params...) +} + +// CallGatewayZEVM is a paid mutator transaction binding the contract method 0x25859e62. +// +// Solidity: function callGatewayZEVM(bytes receiver, address zrc20, bytes message, (uint256,bool) callOptions, (address,bool,address,bytes,uint256) revertOptions) returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerTransactor) CallGatewayZEVM(opts *bind.TransactOpts, receiver []byte, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _GatewayZEVMCaller.contract.Transact(opts, "callGatewayZEVM", receiver, zrc20, message, callOptions, revertOptions) +} + +// CallGatewayZEVM is a paid mutator transaction binding the contract method 0x25859e62. +// +// Solidity: function callGatewayZEVM(bytes receiver, address zrc20, bytes message, (uint256,bool) callOptions, (address,bool,address,bytes,uint256) revertOptions) returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerSession) CallGatewayZEVM(receiver []byte, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.CallGatewayZEVM(&_GatewayZEVMCaller.TransactOpts, receiver, zrc20, message, callOptions, revertOptions) +} + +// CallGatewayZEVM is a paid mutator transaction binding the contract method 0x25859e62. +// +// Solidity: function callGatewayZEVM(bytes receiver, address zrc20, bytes message, (uint256,bool) callOptions, (address,bool,address,bytes,uint256) revertOptions) returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerTransactorSession) CallGatewayZEVM(receiver []byte, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.CallGatewayZEVM(&_GatewayZEVMCaller.TransactOpts, receiver, zrc20, message, callOptions, revertOptions) +} + +// DepositWZETA is a paid mutator transaction binding the contract method 0x2c5d24ae. +// +// Solidity: function depositWZETA() payable returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerTransactor) DepositWZETA(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GatewayZEVMCaller.contract.Transact(opts, "depositWZETA") +} + +// DepositWZETA is a paid mutator transaction binding the contract method 0x2c5d24ae. +// +// Solidity: function depositWZETA() payable returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerSession) DepositWZETA() (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.DepositWZETA(&_GatewayZEVMCaller.TransactOpts) +} + +// DepositWZETA is a paid mutator transaction binding the contract method 0x2c5d24ae. +// +// Solidity: function depositWZETA() payable returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerTransactorSession) DepositWZETA() (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.DepositWZETA(&_GatewayZEVMCaller.TransactOpts) +} + +// WithdrawAndCallGatewayZEVM is a paid mutator transaction binding the contract method 0x62543ae7. +// +// Solidity: function withdrawAndCallGatewayZEVM(bytes receiver, uint256 amount, address zrc20, bytes message, (uint256,bool) callOptions, (address,bool,address,bytes,uint256) revertOptions) returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerTransactor) WithdrawAndCallGatewayZEVM(opts *bind.TransactOpts, receiver []byte, amount *big.Int, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _GatewayZEVMCaller.contract.Transact(opts, "withdrawAndCallGatewayZEVM", receiver, amount, zrc20, message, callOptions, revertOptions) +} + +// WithdrawAndCallGatewayZEVM is a paid mutator transaction binding the contract method 0x62543ae7. +// +// Solidity: function withdrawAndCallGatewayZEVM(bytes receiver, uint256 amount, address zrc20, bytes message, (uint256,bool) callOptions, (address,bool,address,bytes,uint256) revertOptions) returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerSession) WithdrawAndCallGatewayZEVM(receiver []byte, amount *big.Int, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.WithdrawAndCallGatewayZEVM(&_GatewayZEVMCaller.TransactOpts, receiver, amount, zrc20, message, callOptions, revertOptions) +} + +// WithdrawAndCallGatewayZEVM is a paid mutator transaction binding the contract method 0x62543ae7. +// +// Solidity: function withdrawAndCallGatewayZEVM(bytes receiver, uint256 amount, address zrc20, bytes message, (uint256,bool) callOptions, (address,bool,address,bytes,uint256) revertOptions) returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerTransactorSession) WithdrawAndCallGatewayZEVM(receiver []byte, amount *big.Int, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.WithdrawAndCallGatewayZEVM(&_GatewayZEVMCaller.TransactOpts, receiver, amount, zrc20, message, callOptions, revertOptions) +} + +// WithdrawAndCallGatewayZEVM0 is a paid mutator transaction binding the contract method 0xf66f4625. +// +// Solidity: function withdrawAndCallGatewayZEVM(bytes receiver, uint256 amount, uint256 chainId, bytes message, (uint256,bool) callOptions, (address,bool,address,bytes,uint256) revertOptions) returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerTransactor) WithdrawAndCallGatewayZEVM0(opts *bind.TransactOpts, receiver []byte, amount *big.Int, chainId *big.Int, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _GatewayZEVMCaller.contract.Transact(opts, "withdrawAndCallGatewayZEVM0", receiver, amount, chainId, message, callOptions, revertOptions) +} + +// WithdrawAndCallGatewayZEVM0 is a paid mutator transaction binding the contract method 0xf66f4625. +// +// Solidity: function withdrawAndCallGatewayZEVM(bytes receiver, uint256 amount, uint256 chainId, bytes message, (uint256,bool) callOptions, (address,bool,address,bytes,uint256) revertOptions) returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerSession) WithdrawAndCallGatewayZEVM0(receiver []byte, amount *big.Int, chainId *big.Int, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.WithdrawAndCallGatewayZEVM0(&_GatewayZEVMCaller.TransactOpts, receiver, amount, chainId, message, callOptions, revertOptions) +} + +// WithdrawAndCallGatewayZEVM0 is a paid mutator transaction binding the contract method 0xf66f4625. +// +// Solidity: function withdrawAndCallGatewayZEVM(bytes receiver, uint256 amount, uint256 chainId, bytes message, (uint256,bool) callOptions, (address,bool,address,bytes,uint256) revertOptions) returns() +func (_GatewayZEVMCaller *GatewayZEVMCallerTransactorSession) WithdrawAndCallGatewayZEVM0(receiver []byte, amount *big.Int, chainId *big.Int, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _GatewayZEVMCaller.Contract.WithdrawAndCallGatewayZEVM0(&_GatewayZEVMCaller.TransactOpts, receiver, amount, chainId, message, callOptions, revertOptions) +} diff --git a/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.json b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.json new file mode 100644 index 0000000000..1ce09e97a9 --- /dev/null +++ b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.json @@ -0,0 +1,254 @@ +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayZEVMAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "wzetaAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "address", + "name": "zrc20", + "type": "address" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isArbitraryCall", + "type": "bool" + } + ], + "internalType": "struct CallOptions", + "name": "callOptions", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "revertAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "callOnRevert", + "type": "bool" + }, + { + "internalType": "address", + "name": "abortAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "revertMessage", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "onRevertGasLimit", + "type": "uint256" + } + ], + "internalType": "struct RevertOptions", + "name": "revertOptions", + "type": "tuple" + } + ], + "name": "callGatewayZEVM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "depositWZETA", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "zrc20", + "type": "address" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isArbitraryCall", + "type": "bool" + } + ], + "internalType": "struct CallOptions", + "name": "callOptions", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "revertAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "callOnRevert", + "type": "bool" + }, + { + "internalType": "address", + "name": "abortAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "revertMessage", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "onRevertGasLimit", + "type": "uint256" + } + ], + "internalType": "struct RevertOptions", + "name": "revertOptions", + "type": "tuple" + } + ], + "name": "withdrawAndCallGatewayZEVM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "receiver", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "gasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isArbitraryCall", + "type": "bool" + } + ], + "internalType": "struct CallOptions", + "name": "callOptions", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "revertAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "callOnRevert", + "type": "bool" + }, + { + "internalType": "address", + "name": "abortAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "revertMessage", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "onRevertGasLimit", + "type": "uint256" + } + ], + "internalType": "struct RevertOptions", + "name": "revertOptions", + "type": "tuple" + } + ], + "name": "withdrawAndCallGatewayZEVM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bin": "60806040523480156200001157600080fd5b50604051620011613803806200116183398181016040528101906200003791906200012a565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505062000171565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000f282620000c5565b9050919050565b6200010481620000e5565b81146200011057600080fd5b50565b6000815190506200012481620000f9565b92915050565b60008060408385031215620001445762000143620000c0565b5b6000620001548582860162000113565b9250506020620001678582860162000113565b9150509250929050565b610fe080620001816000396000f3fe60806040526004361061003f5760003560e01c806325859e62146100445780632c5d24ae1461006d57806362543ae714610077578063f66f4625146100a0575b600080fd5b34801561005057600080fd5b5061006b60048036038101906100669190610795565b6100c9565b005b61007561020d565b005b34801561008357600080fd5b5061009e6004803603810190610099919061089d565b610292565b005b3480156100ac57600080fd5b506100c760048036038101906100c29190610984565b6103d9565b005b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b815260040161012c929190610abf565b6020604051808303816000875af115801561014b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016f9190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306cb89838787878787876040518763ffffffff1660e01b81526004016101d396959493929190610e18565b600060405180830381600087803b1580156101ed57600080fd5b505af1158015610201573d6000803e3d6000fd5b50505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561027757600080fd5b505af115801561028b573d6000803e3d6000fd5b5050505050565b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b81526004016102f5929190610abf565b6020604051808303816000875af1158015610314573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103389190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637b15118b888888888888886040518863ffffffff1660e01b815260040161039e9796959493929190610e91565b600060405180830381600087803b1580156103b857600080fd5b505af11580156103cc573d6000803e3d6000fd5b5050505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886040518363ffffffff1660e01b8152600401610456929190610f09565b6020604051808303816000875af1158015610475573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104999190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632810ae63888888888888886040518863ffffffff1660e01b81526004016104ff9796959493929190610f32565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b5050505050505050505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105a182610558565b810181811067ffffffffffffffff821117156105c0576105bf610569565b5b80604052505050565b60006105d361053a565b90506105df8282610598565b919050565b600067ffffffffffffffff8211156105ff576105fe610569565b5b61060882610558565b9050602081019050919050565b82818337600083830152505050565b6000610637610632846105e4565b6105c9565b90508281526020810184848401111561065357610652610553565b5b61065e848285610615565b509392505050565b600082601f83011261067b5761067a61054e565b5b813561068b848260208601610624565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006106bf82610694565b9050919050565b6106cf816106b4565b81146106da57600080fd5b50565b6000813590506106ec816106c6565b92915050565b600080fd5b600080fd5b60008083601f8401126107125761071161054e565b5b8235905067ffffffffffffffff81111561072f5761072e6106f2565b5b60208301915083600182028301111561074b5761074a6106f7565b5b9250929050565b600080fd5b60006040828403121561076d5761076c610752565b5b81905092915050565b600060a0828403121561078c5761078b610752565b5b81905092915050565b60008060008060008060c087890312156107b2576107b1610544565b5b600087013567ffffffffffffffff8111156107d0576107cf610549565b5b6107dc89828a01610666565b96505060206107ed89828a016106dd565b955050604087013567ffffffffffffffff81111561080e5761080d610549565b5b61081a89828a016106fc565b9450945050606061082d89828a01610757565b92505060a087013567ffffffffffffffff81111561084e5761084d610549565b5b61085a89828a01610776565b9150509295509295509295565b6000819050919050565b61087a81610867565b811461088557600080fd5b50565b60008135905061089781610871565b92915050565b600080600080600080600060e0888a0312156108bc576108bb610544565b5b600088013567ffffffffffffffff8111156108da576108d9610549565b5b6108e68a828b01610666565b97505060206108f78a828b01610888565b96505060406109088a828b016106dd565b955050606088013567ffffffffffffffff81111561092957610928610549565b5b6109358a828b016106fc565b945094505060806109488a828b01610757565b92505060c088013567ffffffffffffffff81111561096957610968610549565b5b6109758a828b01610776565b91505092959891949750929550565b600080600080600080600060e0888a0312156109a3576109a2610544565b5b600088013567ffffffffffffffff8111156109c1576109c0610549565b5b6109cd8a828b01610666565b97505060206109de8a828b01610888565b96505060406109ef8a828b01610888565b955050606088013567ffffffffffffffff811115610a1057610a0f610549565b5b610a1c8a828b016106fc565b94509450506080610a2f8a828b01610757565b92505060c088013567ffffffffffffffff811115610a5057610a4f610549565b5b610a5c8a828b01610776565b91505092959891949750929550565b610a74816106b4565b82525050565b6000819050919050565b6000819050919050565b6000610aa9610aa4610a9f84610a7a565b610a84565b610867565b9050919050565b610ab981610a8e565b82525050565b6000604082019050610ad46000830185610a6b565b610ae16020830184610ab0565b9392505050565b60008115159050919050565b610afd81610ae8565b8114610b0857600080fd5b50565b600081519050610b1a81610af4565b92915050565b600060208284031215610b3657610b35610544565b5b6000610b4484828501610b0b565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610b87578082015181840152602081019050610b6c565b83811115610b96576000848401525b50505050565b6000610ba782610b4d565b610bb18185610b58565b9350610bc1818560208601610b69565b610bca81610558565b840191505092915050565b6000610be18385610b58565b9350610bee838584610615565b610bf783610558565b840190509392505050565b6000610c116020840184610888565b905092915050565b610c2281610867565b82525050565b600081359050610c3781610af4565b92915050565b6000610c4c6020840184610c28565b905092915050565b610c5d81610ae8565b82525050565b60408201610c746000830183610c02565b610c816000850182610c19565b50610c8f6020830183610c3d565b610c9c6020850182610c54565b50505050565b6000610cb160208401846106dd565b905092915050565b610cc2816106b4565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610cf457610cf3610cd2565b5b83810192508235915060208301925067ffffffffffffffff821115610d1c57610d1b610cc8565b5b600182023603841315610d3257610d31610ccd565b5b509250929050565b600082825260208201905092915050565b6000610d578385610d3a565b9350610d64838584610615565b610d6d83610558565b840190509392505050565b600060a08301610d8b6000840184610ca2565b610d986000860182610cb9565b50610da66020840184610c3d565b610db36020860182610c54565b50610dc16040840184610ca2565b610dce6040860182610cb9565b50610ddc6060840184610cd7565b8583036060870152610def838284610d4b565b92505050610e006080840184610c02565b610e0d6080860182610c19565b508091505092915050565b600060c0820190508181036000830152610e328189610b9c565b9050610e416020830188610a6b565b8181036040830152610e54818688610bd5565b9050610e636060830185610c63565b81810360a0830152610e758184610d78565b9050979650505050505050565b610e8b81610867565b82525050565b600060e0820190508181036000830152610eab818a610b9c565b9050610eba6020830189610e82565b610ec76040830188610a6b565b8181036060830152610eda818688610bd5565b9050610ee96080830185610c63565b81810360c0830152610efb8184610d78565b905098975050505050505050565b6000604082019050610f1e6000830185610a6b565b610f2b6020830184610e82565b9392505050565b600060e0820190508181036000830152610f4c818a610b9c565b9050610f5b6020830189610e82565b610f686040830188610e82565b8181036060830152610f7b818688610bd5565b9050610f8a6080830185610c63565b81810360c0830152610f9c8184610d78565b90509897505050505050505056fea26469706673582212204b70dead8f68839447fc08bd73294d57367a484ba9b048960ffcc202a737ae5664736f6c634300080a0033" +} diff --git a/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.sol b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.sol new file mode 100644 index 0000000000..e58a7197dd --- /dev/null +++ b/pkg/contracts/gatewayzevmcaller/GatewayZEVMCaller.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.10; + +struct CallOptions { + uint256 gasLimit; + bool isArbitraryCall; +} + +struct RevertOptions { + address revertAddress; + bool callOnRevert; + address abortAddress; + bytes revertMessage; + uint256 onRevertGasLimit; +} + +interface IGatewayZEVM { + function call( + bytes memory receiver, + address zrc20, + bytes calldata message, + CallOptions calldata callOptions, + RevertOptions calldata revertOptions + ) + external; + + function withdrawAndCall( + bytes memory receiver, + uint256 amount, + uint256 chainId, + bytes calldata message, + CallOptions calldata callOptions, + RevertOptions calldata revertOptions + ) + external; + + function withdrawAndCall( + bytes memory receiver, + uint256 amount, + address zrc20, + bytes calldata message, + CallOptions calldata callOptions, + RevertOptions calldata revertOptions + ) + external; +} + +interface IZRC20 { + function approve(address spender, uint256 amount) external returns (bool); +} + +interface WZETA { + function deposit() external payable; + function approve(address guy, uint256 wad) external returns (bool); +} + +contract GatewayZEVMCaller { + IGatewayZEVM private gatewayZEVM; + WZETA wzeta; + constructor(address gatewayZEVMAddress, address wzetaAddress) { + gatewayZEVM = IGatewayZEVM(gatewayZEVMAddress); + wzeta = WZETA(wzetaAddress); + } + + function callGatewayZEVM( + bytes memory receiver, + address zrc20, + bytes calldata message, + CallOptions calldata callOptions, + RevertOptions calldata revertOptions + ) external { + IZRC20(zrc20).approve(address(gatewayZEVM), 100000000000000000); + gatewayZEVM.call(receiver, zrc20, message, callOptions, revertOptions); + } + + function withdrawAndCallGatewayZEVM( + bytes memory receiver, + uint256 amount, + uint256 chainId, + bytes calldata message, + CallOptions calldata callOptions, + RevertOptions calldata revertOptions + ) external { + wzeta.approve(address(gatewayZEVM), amount); + gatewayZEVM.withdrawAndCall(receiver, amount, chainId, message, callOptions, revertOptions); + } + + function withdrawAndCallGatewayZEVM( + bytes memory receiver, + uint256 amount, + address zrc20, + bytes calldata message, + CallOptions calldata callOptions, + RevertOptions calldata revertOptions + ) external { + IZRC20(zrc20).approve(address(gatewayZEVM), 100000000000000000); + gatewayZEVM.withdrawAndCall(receiver, amount, zrc20, message, callOptions, revertOptions); + } + + function depositWZETA() external payable { + wzeta.deposit{value: msg.value}(); + } +} \ No newline at end of file diff --git a/pkg/contracts/gatewayzevmcaller/bindings.go b/pkg/contracts/gatewayzevmcaller/bindings.go new file mode 100644 index 0000000000..591004208d --- /dev/null +++ b/pkg/contracts/gatewayzevmcaller/bindings.go @@ -0,0 +1,8 @@ +//go:generate sh -c "solc GatewayZEVMCaller.sol --combined-json abi,bin | jq '.contracts.\"GatewayZEVMCaller.sol:GatewayZEVMCaller\"' > GatewayZEVMCaller.json" +//go:generate sh -c "cat GatewayZEVMCaller.json | jq .abi > GatewayZEVMCaller.abi" +//go:generate sh -c "cat GatewayZEVMCaller.json | jq .bin | tr -d '\"' > GatewayZEVMCaller.bin" +//go:generate sh -c "abigen --abi GatewayZEVMCaller.abi --bin GatewayZEVMCaller.bin --pkg gatewayzevmcaller --type GatewayZEVMCaller --out GatewayZEVMCaller.go" + +package gatewayzevmcaller + +var _ GatewayZEVMCaller diff --git a/pkg/contracts/testdappv2/TestDAppV2.abi b/pkg/contracts/testdappv2/TestDAppV2.abi index 568085dcc8..b57adc2484 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.abi +++ b/pkg/contracts/testdappv2/TestDAppV2.abi @@ -60,6 +60,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "expectedOnCallSender", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -111,6 +124,37 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "internalType": "struct TestDAppV2.MessageContext", + "name": "messageContext", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "onCall", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -186,6 +230,38 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "senderWithMessage", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_expectedOnCallSender", + "type": "address" + } + ], + "name": "setExpectedOnCallSender", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/pkg/contracts/testdappv2/TestDAppV2.bin b/pkg/contracts/testdappv2/TestDAppV2.bin index 2c35399c09..b8768f52b4 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.bin +++ b/pkg/contracts/testdappv2/TestDAppV2.bin @@ -1 +1 @@ -608060405234801561001057600080fd5b50610e3a806100206000396000f3fe60806040526004361061008a5760003560e01c8063a799911f11610059578063a799911f14610162578063c7a339a91461017e578063de43156e146101a7578063e2842ed7146101d0578063f592cbfb1461020d57610091565b806336e980a0146100965780634297a263146100bf578063660b9de0146100fc5780639291fe261461012557610091565b3661009157005b600080fd5b3480156100a257600080fd5b506100bd60048036038101906100b89190610900565b61024a565b005b3480156100cb57600080fd5b506100e660048036038101906100e19190610864565b610274565b6040516100f39190610b35565b60405180910390f35b34801561010857600080fd5b50610123600480360381019061011e9190610949565b61028c565b005b34801561013157600080fd5b5061014c60048036038101906101479190610900565b610347565b6040516101599190610b35565b60405180910390f35b61017c60048036038101906101779190610900565b61038a565b005b34801561018a57600080fd5b506101a560048036038101906101a09190610891565b6103b3565b005b3480156101b357600080fd5b506101ce60048036038101906101c99190610992565b610476565b005b3480156101dc57600080fd5b506101f760048036038101906101f29190610864565b61056f565b6040516102049190610b1a565b60405180910390f35b34801561021957600080fd5b50610234600480360381019061022f9190610900565b61058f565b6040516102419190610b1a565b60405180910390f35b610253816105de565b1561025d57600080fd5b61026681610634565b610271816000610688565b50565b60016020528060005260406000206000915090505481565b6102e781806040019061029f9190610b50565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610634565b6103448180604001906102fa9190610b50565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610688565b50565b6000600160008360405160200161035e9190610ab7565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b610393816105de565b1561039d57600080fd5b6103a681610634565b6103b08134610688565b50565b6103bc816105de565b156103c657600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161040393929190610ae3565b602060405180830381600087803b15801561041d57600080fd5b505af1158015610431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104559190610837565b61045e57600080fd5b61046781610634565b6104718183610688565b505050565b6104c382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506105de565b156104cd57600080fd5b61051a82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610634565b61056882828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610688565b5050505050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016105a59190610ab7565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b60006040516020016105ef90610ace565b60405160208183030381529060405280519060200120826040516020016106169190610ab7565b60405160208183030381529060405280519060200120149050919050565b60016000808360405160200161064a9190610ab7565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b80600160008460405160200161069e9190610ab7565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b60006106dd6106d884610bd8565b610bb3565b9050828152602081018484840111156106f9576106f8610d48565b5b610704848285610c83565b509392505050565b60008135905061071b81610d91565b92915050565b60008151905061073081610da8565b92915050565b60008135905061074581610dbf565b92915050565b60008083601f84011261076157610760610d2a565b5b8235905067ffffffffffffffff81111561077e5761077d610d25565b5b60208301915083600182028301111561079a57610799610d3e565b5b9250929050565b6000813590506107b081610dd6565b92915050565b600082601f8301126107cb576107ca610d2a565b5b81356107db8482602086016106ca565b91505092915050565b6000606082840312156107fa576107f9610d34565b5b81905092915050565b60006060828403121561081957610818610d34565b5b81905092915050565b60008135905061083181610ded565b92915050565b60006020828403121561084d5761084c610d52565b5b600061085b84828501610721565b91505092915050565b60006020828403121561087a57610879610d52565b5b600061088884828501610736565b91505092915050565b6000806000606084860312156108aa576108a9610d52565b5b60006108b8868287016107a1565b93505060206108c986828701610822565b925050604084013567ffffffffffffffff8111156108ea576108e9610d4d565b5b6108f6868287016107b6565b9150509250925092565b60006020828403121561091657610915610d52565b5b600082013567ffffffffffffffff81111561093457610933610d4d565b5b610940848285016107b6565b91505092915050565b60006020828403121561095f5761095e610d52565b5b600082013567ffffffffffffffff81111561097d5761097c610d4d565b5b610989848285016107e4565b91505092915050565b6000806000806000608086880312156109ae576109ad610d52565b5b600086013567ffffffffffffffff8111156109cc576109cb610d4d565b5b6109d888828901610803565b95505060206109e98882890161070c565b94505060406109fa88828901610822565b935050606086013567ffffffffffffffff811115610a1b57610a1a610d4d565b5b610a278882890161074b565b92509250509295509295909350565b610a3f81610c1f565b82525050565b610a4e81610c31565b82525050565b6000610a5f82610c09565b610a698185610c14565b9350610a79818560208601610c92565b80840191505092915050565b6000610a92600683610c14565b9150610a9d82610d68565b600682019050919050565b610ab181610c79565b82525050565b6000610ac38284610a54565b915081905092915050565b6000610ad982610a85565b9150819050919050565b6000606082019050610af86000830186610a36565b610b056020830185610a36565b610b126040830184610aa8565b949350505050565b6000602082019050610b2f6000830184610a45565b92915050565b6000602082019050610b4a6000830184610aa8565b92915050565b60008083356001602003843603038112610b6d57610b6c610d39565b5b80840192508235915067ffffffffffffffff821115610b8f57610b8e610d2f565b5b602083019250600182023603831315610bab57610baa610d43565b5b509250929050565b6000610bbd610bce565b9050610bc98282610cc5565b919050565b6000604051905090565b600067ffffffffffffffff821115610bf357610bf2610cf6565b5b610bfc82610d57565b9050602081019050919050565b600081519050919050565b600081905092915050565b6000610c2a82610c59565b9050919050565b60008115159050919050565b6000819050919050565b6000610c5282610c1f565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015610cb0578082015181840152602081019050610c95565b83811115610cbf576000848401525b50505050565b610cce82610d57565b810181811067ffffffffffffffff82111715610ced57610cec610cf6565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b610d9a81610c1f565b8114610da557600080fd5b50565b610db181610c31565b8114610dbc57600080fd5b50565b610dc881610c3d565b8114610dd357600080fd5b50565b610ddf81610c47565b8114610dea57600080fd5b50565b610df681610c79565b8114610e0157600080fd5b5056fea2646970667358221220d6765b67214e8cadf15b569ed63c4c4628bd833acf6926d71b9b6a6011fbb78064736f6c63430008070033 +608060405234801561001057600080fd5b5061147c806100206000396000f3fe6080604052600436106100c65760003560e01c8063a799911f1161007f578063de43156e11610059578063de43156e14610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063a799911f146101f9578063c234fecf14610215578063c7a339a91461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a77714610138578063660b9de014610163578063676cc0541461018c5780639291fe26146101bc576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610b78565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610bf7565b610371565b60405161012f9190610c3d565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a9190610c99565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190610cd8565b6103ad565b005b6101a660048036038101906101a19190610da0565b610468565b6040516101b39190610e88565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190610b78565b61061d565b6040516101f09190610c3d565b60405180910390f35b610213600480360381019061020e9190610b78565b610660565b005b34801561022157600080fd5b5061023c60048036038101906102379190610ed6565b610689565b005b34801561024a57600080fd5b5061026560048036038101906102609190610f6d565b6106cc565b005b34801561027357600080fd5b5061028e60048036038101906102899190610ffb565b610780565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610bf7565b610879565b6040516102c491906110ba565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610b78565b610899565b60405161030191906110ba565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190611176565b6108e9565b60405161033e9190610c99565b60405180910390f35b61035081610932565b1561035a57600080fd5b61036381610988565b61036e8160006109dc565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104088180604001906103c091906111ce565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610988565b61046581806040019061041b91906111ce565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006109dc565b50565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906104b49190610ed6565b73ffffffffffffffffffffffffffffffffffffffff161461050a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105019061128e565b60405180910390fd5b61055783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610988565b6105a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346109dc565b8360000160208101906105b89190610ed6565b600284846040516105ca9291906112de565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b60006003600083604051602001610634919061133e565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b61066981610932565b1561067357600080fd5b61067c81610988565b61068681346109dc565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6106d581610932565b156106df57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161071c93929190611355565b6020604051808303816000875af115801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f91906113b8565b61076857600080fd5b61077181610988565b61077b81836109dc565b505050565b6107cd82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610932565b156107d757600080fd5b61082482828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610988565b61087282828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846109dc565b5050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b600060016000836040516020016108b0919061133e565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161094390611431565b604051602081830303815290604052805190602001208260405160200161096a919061133e565b60405160208183030381529060405280519060200120149050919050565b60018060008360405160200161099e919061133e565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060036000846040516020016109f2919061133e565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a8582610a3c565b810181811067ffffffffffffffff82111715610aa457610aa3610a4d565b5b80604052505050565b6000610ab7610a1e565b9050610ac38282610a7c565b919050565b600067ffffffffffffffff821115610ae357610ae2610a4d565b5b610aec82610a3c565b9050602081019050919050565b82818337600083830152505050565b6000610b1b610b1684610ac8565b610aad565b905082815260208101848484011115610b3757610b36610a37565b5b610b42848285610af9565b509392505050565b600082601f830112610b5f57610b5e610a32565b5b8135610b6f848260208601610b08565b91505092915050565b600060208284031215610b8e57610b8d610a28565b5b600082013567ffffffffffffffff811115610bac57610bab610a2d565b5b610bb884828501610b4a565b91505092915050565b6000819050919050565b610bd481610bc1565b8114610bdf57600080fd5b50565b600081359050610bf181610bcb565b92915050565b600060208284031215610c0d57610c0c610a28565b5b6000610c1b84828501610be2565b91505092915050565b6000819050919050565b610c3781610c24565b82525050565b6000602082019050610c526000830184610c2e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610c8382610c58565b9050919050565b610c9381610c78565b82525050565b6000602082019050610cae6000830184610c8a565b92915050565b600080fd5b600060608284031215610ccf57610cce610cb4565b5b81905092915050565b600060208284031215610cee57610ced610a28565b5b600082013567ffffffffffffffff811115610d0c57610d0b610a2d565b5b610d1884828501610cb9565b91505092915050565b600060208284031215610d3757610d36610cb4565b5b81905092915050565b600080fd5b600080fd5b60008083601f840112610d6057610d5f610a32565b5b8235905067ffffffffffffffff811115610d7d57610d7c610d40565b5b602083019150836001820283011115610d9957610d98610d45565b5b9250929050565b600080600060408486031215610db957610db8610a28565b5b6000610dc786828701610d21565b935050602084013567ffffffffffffffff811115610de857610de7610a2d565b5b610df486828701610d4a565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b83811015610e3a578082015181840152602081019050610e1f565b83811115610e49576000848401525b50505050565b6000610e5a82610e00565b610e648185610e0b565b9350610e74818560208601610e1c565b610e7d81610a3c565b840191505092915050565b60006020820190508181036000830152610ea28184610e4f565b905092915050565b610eb381610c78565b8114610ebe57600080fd5b50565b600081359050610ed081610eaa565b92915050565b600060208284031215610eec57610eeb610a28565b5b6000610efa84828501610ec1565b91505092915050565b6000610f0e82610c78565b9050919050565b610f1e81610f03565b8114610f2957600080fd5b50565b600081359050610f3b81610f15565b92915050565b610f4a81610c24565b8114610f5557600080fd5b50565b600081359050610f6781610f41565b92915050565b600080600060608486031215610f8657610f85610a28565b5b6000610f9486828701610f2c565b9350506020610fa586828701610f58565b925050604084013567ffffffffffffffff811115610fc657610fc5610a2d565b5b610fd286828701610b4a565b9150509250925092565b600060608284031215610ff257610ff1610cb4565b5b81905092915050565b60008060008060006080868803121561101757611016610a28565b5b600086013567ffffffffffffffff81111561103557611034610a2d565b5b61104188828901610fdc565b955050602061105288828901610ec1565b945050604061106388828901610f58565b935050606086013567ffffffffffffffff81111561108457611083610a2d565b5b61109088828901610d4a565b92509250509295509295909350565b60008115159050919050565b6110b48161109f565b82525050565b60006020820190506110cf60008301846110ab565b92915050565b600067ffffffffffffffff8211156110f0576110ef610a4d565b5b6110f982610a3c565b9050602081019050919050565b6000611119611114846110d5565b610aad565b90508281526020810184848401111561113557611134610a37565b5b611140848285610af9565b509392505050565b600082601f83011261115d5761115c610a32565b5b813561116d848260208601611106565b91505092915050565b60006020828403121561118c5761118b610a28565b5b600082013567ffffffffffffffff8111156111aa576111a9610a2d565b5b6111b684828501611148565b91505092915050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126111eb576111ea6111bf565b5b80840192508235915067ffffffffffffffff82111561120d5761120c6111c4565b5b602083019250600182023603831315611229576112286111c9565b5b509250929050565b600082825260208201905092915050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b6000611278601683611231565b915061128382611242565b602082019050919050565b600060208201905081810360008301526112a78161126b565b9050919050565b600081905092915050565b60006112c583856112ae565b93506112d2838584610af9565b82840190509392505050565b60006112eb8284866112b9565b91508190509392505050565b600081519050919050565b600081905092915050565b6000611318826112f7565b6113228185611302565b9350611332818560208601610e1c565b80840191505092915050565b600061134a828461130d565b915081905092915050565b600060608201905061136a6000830186610c8a565b6113776020830185610c8a565b6113846040830184610c2e565b949350505050565b6113958161109f565b81146113a057600080fd5b50565b6000815190506113b28161138c565b92915050565b6000602082840312156113ce576113cd610a28565b5b60006113dc848285016113a3565b91505092915050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b600061141b600683611302565b9150611426826113e5565b600682019050919050565b600061143c8261140e565b915081905091905056fea264697066735822122046fb444f8c754142359339f5f1d728822414688169d0d22f23bd25c688c73fdf64736f6c634300080a0033 diff --git a/pkg/contracts/testdappv2/TestDAppV2.go b/pkg/contracts/testdappv2/TestDAppV2.go index 9afe3b5c9d..689014c847 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.go +++ b/pkg/contracts/testdappv2/TestDAppV2.go @@ -29,6 +29,11 @@ var ( _ = abi.ConvertType ) +// TestDAppV2MessageContext is an auto generated low-level Go binding around an user-defined struct. +type TestDAppV2MessageContext struct { + Sender common.Address +} + // TestDAppV2RevertContext is an auto generated low-level Go binding around an user-defined struct. type TestDAppV2RevertContext struct { Asset common.Address @@ -45,8 +50,8 @@ type TestDAppV2zContext struct { // TestDAppV2MetaData contains all meta data concerning the TestDAppV2 contract. var TestDAppV2MetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"amountWithMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"calledWithMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"erc20\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"erc20Call\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"gasCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"getAmountWithMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"getCalledWithMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"origin\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainID\",\"type\":\"uint256\"}],\"internalType\":\"structTestDAppV2.zContext\",\"name\":\"_context\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_zrc20\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"onCrossChainCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"revertMessage\",\"type\":\"bytes\"}],\"internalType\":\"structTestDAppV2.RevertContext\",\"name\":\"revertContext\",\"type\":\"tuple\"}],\"name\":\"onRevert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"simpleCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x608060405234801561001057600080fd5b50610e3a806100206000396000f3fe60806040526004361061008a5760003560e01c8063a799911f11610059578063a799911f14610162578063c7a339a91461017e578063de43156e146101a7578063e2842ed7146101d0578063f592cbfb1461020d57610091565b806336e980a0146100965780634297a263146100bf578063660b9de0146100fc5780639291fe261461012557610091565b3661009157005b600080fd5b3480156100a257600080fd5b506100bd60048036038101906100b89190610900565b61024a565b005b3480156100cb57600080fd5b506100e660048036038101906100e19190610864565b610274565b6040516100f39190610b35565b60405180910390f35b34801561010857600080fd5b50610123600480360381019061011e9190610949565b61028c565b005b34801561013157600080fd5b5061014c60048036038101906101479190610900565b610347565b6040516101599190610b35565b60405180910390f35b61017c60048036038101906101779190610900565b61038a565b005b34801561018a57600080fd5b506101a560048036038101906101a09190610891565b6103b3565b005b3480156101b357600080fd5b506101ce60048036038101906101c99190610992565b610476565b005b3480156101dc57600080fd5b506101f760048036038101906101f29190610864565b61056f565b6040516102049190610b1a565b60405180910390f35b34801561021957600080fd5b50610234600480360381019061022f9190610900565b61058f565b6040516102419190610b1a565b60405180910390f35b610253816105de565b1561025d57600080fd5b61026681610634565b610271816000610688565b50565b60016020528060005260406000206000915090505481565b6102e781806040019061029f9190610b50565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610634565b6103448180604001906102fa9190610b50565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610688565b50565b6000600160008360405160200161035e9190610ab7565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b610393816105de565b1561039d57600080fd5b6103a681610634565b6103b08134610688565b50565b6103bc816105de565b156103c657600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161040393929190610ae3565b602060405180830381600087803b15801561041d57600080fd5b505af1158015610431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104559190610837565b61045e57600080fd5b61046781610634565b6104718183610688565b505050565b6104c382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506105de565b156104cd57600080fd5b61051a82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610634565b61056882828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610688565b5050505050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016105a59190610ab7565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b60006040516020016105ef90610ace565b60405160208183030381529060405280519060200120826040516020016106169190610ab7565b60405160208183030381529060405280519060200120149050919050565b60016000808360405160200161064a9190610ab7565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b80600160008460405160200161069e9190610ab7565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b60006106dd6106d884610bd8565b610bb3565b9050828152602081018484840111156106f9576106f8610d48565b5b610704848285610c83565b509392505050565b60008135905061071b81610d91565b92915050565b60008151905061073081610da8565b92915050565b60008135905061074581610dbf565b92915050565b60008083601f84011261076157610760610d2a565b5b8235905067ffffffffffffffff81111561077e5761077d610d25565b5b60208301915083600182028301111561079a57610799610d3e565b5b9250929050565b6000813590506107b081610dd6565b92915050565b600082601f8301126107cb576107ca610d2a565b5b81356107db8482602086016106ca565b91505092915050565b6000606082840312156107fa576107f9610d34565b5b81905092915050565b60006060828403121561081957610818610d34565b5b81905092915050565b60008135905061083181610ded565b92915050565b60006020828403121561084d5761084c610d52565b5b600061085b84828501610721565b91505092915050565b60006020828403121561087a57610879610d52565b5b600061088884828501610736565b91505092915050565b6000806000606084860312156108aa576108a9610d52565b5b60006108b8868287016107a1565b93505060206108c986828701610822565b925050604084013567ffffffffffffffff8111156108ea576108e9610d4d565b5b6108f6868287016107b6565b9150509250925092565b60006020828403121561091657610915610d52565b5b600082013567ffffffffffffffff81111561093457610933610d4d565b5b610940848285016107b6565b91505092915050565b60006020828403121561095f5761095e610d52565b5b600082013567ffffffffffffffff81111561097d5761097c610d4d565b5b610989848285016107e4565b91505092915050565b6000806000806000608086880312156109ae576109ad610d52565b5b600086013567ffffffffffffffff8111156109cc576109cb610d4d565b5b6109d888828901610803565b95505060206109e98882890161070c565b94505060406109fa88828901610822565b935050606086013567ffffffffffffffff811115610a1b57610a1a610d4d565b5b610a278882890161074b565b92509250509295509295909350565b610a3f81610c1f565b82525050565b610a4e81610c31565b82525050565b6000610a5f82610c09565b610a698185610c14565b9350610a79818560208601610c92565b80840191505092915050565b6000610a92600683610c14565b9150610a9d82610d68565b600682019050919050565b610ab181610c79565b82525050565b6000610ac38284610a54565b915081905092915050565b6000610ad982610a85565b9150819050919050565b6000606082019050610af86000830186610a36565b610b056020830185610a36565b610b126040830184610aa8565b949350505050565b6000602082019050610b2f6000830184610a45565b92915050565b6000602082019050610b4a6000830184610aa8565b92915050565b60008083356001602003843603038112610b6d57610b6c610d39565b5b80840192508235915067ffffffffffffffff821115610b8f57610b8e610d2f565b5b602083019250600182023603831315610bab57610baa610d43565b5b509250929050565b6000610bbd610bce565b9050610bc98282610cc5565b919050565b6000604051905090565b600067ffffffffffffffff821115610bf357610bf2610cf6565b5b610bfc82610d57565b9050602081019050919050565b600081519050919050565b600081905092915050565b6000610c2a82610c59565b9050919050565b60008115159050919050565b6000819050919050565b6000610c5282610c1f565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015610cb0578082015181840152602081019050610c95565b83811115610cbf576000848401525b50505050565b610cce82610d57565b810181811067ffffffffffffffff82111715610ced57610cec610cf6565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b610d9a81610c1f565b8114610da557600080fd5b50565b610db181610c31565b8114610dbc57600080fd5b50565b610dc881610c3d565b8114610dd357600080fd5b50565b610ddf81610c47565b8114610dea57600080fd5b50565b610df681610c79565b8114610e0157600080fd5b5056fea2646970667358221220d6765b67214e8cadf15b569ed63c4c4628bd833acf6926d71b9b6a6011fbb78064736f6c63430008070033", + ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"amountWithMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"calledWithMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"erc20\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"erc20Call\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"expectedOnCallSender\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"gasCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"getAmountWithMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"getCalledWithMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"internalType\":\"structTestDAppV2.MessageContext\",\"name\":\"messageContext\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"onCall\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"origin\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainID\",\"type\":\"uint256\"}],\"internalType\":\"structTestDAppV2.zContext\",\"name\":\"_context\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_zrc20\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"onCrossChainCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"revertMessage\",\"type\":\"bytes\"}],\"internalType\":\"structTestDAppV2.RevertContext\",\"name\":\"revertContext\",\"type\":\"tuple\"}],\"name\":\"onRevert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"senderWithMessage\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_expectedOnCallSender\",\"type\":\"address\"}],\"name\":\"setExpectedOnCallSender\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"simpleCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x608060405234801561001057600080fd5b5061147c806100206000396000f3fe6080604052600436106100c65760003560e01c8063a799911f1161007f578063de43156e11610059578063de43156e14610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063a799911f146101f9578063c234fecf14610215578063c7a339a91461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a77714610138578063660b9de014610163578063676cc0541461018c5780639291fe26146101bc576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610b78565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610bf7565b610371565b60405161012f9190610c3d565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a9190610c99565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190610cd8565b6103ad565b005b6101a660048036038101906101a19190610da0565b610468565b6040516101b39190610e88565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190610b78565b61061d565b6040516101f09190610c3d565b60405180910390f35b610213600480360381019061020e9190610b78565b610660565b005b34801561022157600080fd5b5061023c60048036038101906102379190610ed6565b610689565b005b34801561024a57600080fd5b5061026560048036038101906102609190610f6d565b6106cc565b005b34801561027357600080fd5b5061028e60048036038101906102899190610ffb565b610780565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610bf7565b610879565b6040516102c491906110ba565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610b78565b610899565b60405161030191906110ba565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190611176565b6108e9565b60405161033e9190610c99565b60405180910390f35b61035081610932565b1561035a57600080fd5b61036381610988565b61036e8160006109dc565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104088180604001906103c091906111ce565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610988565b61046581806040019061041b91906111ce565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006109dc565b50565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906104b49190610ed6565b73ffffffffffffffffffffffffffffffffffffffff161461050a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105019061128e565b60405180910390fd5b61055783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610988565b6105a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346109dc565b8360000160208101906105b89190610ed6565b600284846040516105ca9291906112de565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b60006003600083604051602001610634919061133e565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b61066981610932565b1561067357600080fd5b61067c81610988565b61068681346109dc565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6106d581610932565b156106df57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161071c93929190611355565b6020604051808303816000875af115801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f91906113b8565b61076857600080fd5b61077181610988565b61077b81836109dc565b505050565b6107cd82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610932565b156107d757600080fd5b61082482828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610988565b61087282828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846109dc565b5050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b600060016000836040516020016108b0919061133e565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161094390611431565b604051602081830303815290604052805190602001208260405160200161096a919061133e565b60405160208183030381529060405280519060200120149050919050565b60018060008360405160200161099e919061133e565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060036000846040516020016109f2919061133e565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a8582610a3c565b810181811067ffffffffffffffff82111715610aa457610aa3610a4d565b5b80604052505050565b6000610ab7610a1e565b9050610ac38282610a7c565b919050565b600067ffffffffffffffff821115610ae357610ae2610a4d565b5b610aec82610a3c565b9050602081019050919050565b82818337600083830152505050565b6000610b1b610b1684610ac8565b610aad565b905082815260208101848484011115610b3757610b36610a37565b5b610b42848285610af9565b509392505050565b600082601f830112610b5f57610b5e610a32565b5b8135610b6f848260208601610b08565b91505092915050565b600060208284031215610b8e57610b8d610a28565b5b600082013567ffffffffffffffff811115610bac57610bab610a2d565b5b610bb884828501610b4a565b91505092915050565b6000819050919050565b610bd481610bc1565b8114610bdf57600080fd5b50565b600081359050610bf181610bcb565b92915050565b600060208284031215610c0d57610c0c610a28565b5b6000610c1b84828501610be2565b91505092915050565b6000819050919050565b610c3781610c24565b82525050565b6000602082019050610c526000830184610c2e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610c8382610c58565b9050919050565b610c9381610c78565b82525050565b6000602082019050610cae6000830184610c8a565b92915050565b600080fd5b600060608284031215610ccf57610cce610cb4565b5b81905092915050565b600060208284031215610cee57610ced610a28565b5b600082013567ffffffffffffffff811115610d0c57610d0b610a2d565b5b610d1884828501610cb9565b91505092915050565b600060208284031215610d3757610d36610cb4565b5b81905092915050565b600080fd5b600080fd5b60008083601f840112610d6057610d5f610a32565b5b8235905067ffffffffffffffff811115610d7d57610d7c610d40565b5b602083019150836001820283011115610d9957610d98610d45565b5b9250929050565b600080600060408486031215610db957610db8610a28565b5b6000610dc786828701610d21565b935050602084013567ffffffffffffffff811115610de857610de7610a2d565b5b610df486828701610d4a565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b83811015610e3a578082015181840152602081019050610e1f565b83811115610e49576000848401525b50505050565b6000610e5a82610e00565b610e648185610e0b565b9350610e74818560208601610e1c565b610e7d81610a3c565b840191505092915050565b60006020820190508181036000830152610ea28184610e4f565b905092915050565b610eb381610c78565b8114610ebe57600080fd5b50565b600081359050610ed081610eaa565b92915050565b600060208284031215610eec57610eeb610a28565b5b6000610efa84828501610ec1565b91505092915050565b6000610f0e82610c78565b9050919050565b610f1e81610f03565b8114610f2957600080fd5b50565b600081359050610f3b81610f15565b92915050565b610f4a81610c24565b8114610f5557600080fd5b50565b600081359050610f6781610f41565b92915050565b600080600060608486031215610f8657610f85610a28565b5b6000610f9486828701610f2c565b9350506020610fa586828701610f58565b925050604084013567ffffffffffffffff811115610fc657610fc5610a2d565b5b610fd286828701610b4a565b9150509250925092565b600060608284031215610ff257610ff1610cb4565b5b81905092915050565b60008060008060006080868803121561101757611016610a28565b5b600086013567ffffffffffffffff81111561103557611034610a2d565b5b61104188828901610fdc565b955050602061105288828901610ec1565b945050604061106388828901610f58565b935050606086013567ffffffffffffffff81111561108457611083610a2d565b5b61109088828901610d4a565b92509250509295509295909350565b60008115159050919050565b6110b48161109f565b82525050565b60006020820190506110cf60008301846110ab565b92915050565b600067ffffffffffffffff8211156110f0576110ef610a4d565b5b6110f982610a3c565b9050602081019050919050565b6000611119611114846110d5565b610aad565b90508281526020810184848401111561113557611134610a37565b5b611140848285610af9565b509392505050565b600082601f83011261115d5761115c610a32565b5b813561116d848260208601611106565b91505092915050565b60006020828403121561118c5761118b610a28565b5b600082013567ffffffffffffffff8111156111aa576111a9610a2d565b5b6111b684828501611148565b91505092915050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126111eb576111ea6111bf565b5b80840192508235915067ffffffffffffffff82111561120d5761120c6111c4565b5b602083019250600182023603831315611229576112286111c9565b5b509250929050565b600082825260208201905092915050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b6000611278601683611231565b915061128382611242565b602082019050919050565b600060208201905081810360008301526112a78161126b565b9050919050565b600081905092915050565b60006112c583856112ae565b93506112d2838584610af9565b82840190509392505050565b60006112eb8284866112b9565b91508190509392505050565b600081519050919050565b600081905092915050565b6000611318826112f7565b6113228185611302565b9350611332818560208601610e1c565b80840191505092915050565b600061134a828461130d565b915081905092915050565b600060608201905061136a6000830186610c8a565b6113776020830185610c8a565b6113846040830184610c2e565b949350505050565b6113958161109f565b81146113a057600080fd5b50565b6000815190506113b28161138c565b92915050565b6000602082840312156113ce576113cd610a28565b5b60006113dc848285016113a3565b91505092915050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b600061141b600683611302565b9150611426826113e5565b600682019050919050565b600061143c8261140e565b915081905091905056fea264697066735822122046fb444f8c754142359339f5f1d728822414688169d0d22f23bd25c688c73fdf64736f6c634300080a0033", } // TestDAppV2ABI is the input ABI used to generate the binding from. @@ -278,6 +283,37 @@ func (_TestDAppV2 *TestDAppV2CallerSession) CalledWithMessage(arg0 [32]byte) (bo return _TestDAppV2.Contract.CalledWithMessage(&_TestDAppV2.CallOpts, arg0) } +// ExpectedOnCallSender is a free data retrieval call binding the contract method 0x59f4a777. +// +// Solidity: function expectedOnCallSender() view returns(address) +func (_TestDAppV2 *TestDAppV2Caller) ExpectedOnCallSender(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TestDAppV2.contract.Call(opts, &out, "expectedOnCallSender") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ExpectedOnCallSender is a free data retrieval call binding the contract method 0x59f4a777. +// +// Solidity: function expectedOnCallSender() view returns(address) +func (_TestDAppV2 *TestDAppV2Session) ExpectedOnCallSender() (common.Address, error) { + return _TestDAppV2.Contract.ExpectedOnCallSender(&_TestDAppV2.CallOpts) +} + +// ExpectedOnCallSender is a free data retrieval call binding the contract method 0x59f4a777. +// +// Solidity: function expectedOnCallSender() view returns(address) +func (_TestDAppV2 *TestDAppV2CallerSession) ExpectedOnCallSender() (common.Address, error) { + return _TestDAppV2.Contract.ExpectedOnCallSender(&_TestDAppV2.CallOpts) +} + // GetAmountWithMessage is a free data retrieval call binding the contract method 0x9291fe26. // // Solidity: function getAmountWithMessage(string message) view returns(uint256) @@ -340,6 +376,37 @@ func (_TestDAppV2 *TestDAppV2CallerSession) GetCalledWithMessage(message string) return _TestDAppV2.Contract.GetCalledWithMessage(&_TestDAppV2.CallOpts, message) } +// SenderWithMessage is a free data retrieval call binding the contract method 0xf936ae85. +// +// Solidity: function senderWithMessage(bytes ) view returns(address) +func (_TestDAppV2 *TestDAppV2Caller) SenderWithMessage(opts *bind.CallOpts, arg0 []byte) (common.Address, error) { + var out []interface{} + err := _TestDAppV2.contract.Call(opts, &out, "senderWithMessage", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SenderWithMessage is a free data retrieval call binding the contract method 0xf936ae85. +// +// Solidity: function senderWithMessage(bytes ) view returns(address) +func (_TestDAppV2 *TestDAppV2Session) SenderWithMessage(arg0 []byte) (common.Address, error) { + return _TestDAppV2.Contract.SenderWithMessage(&_TestDAppV2.CallOpts, arg0) +} + +// SenderWithMessage is a free data retrieval call binding the contract method 0xf936ae85. +// +// Solidity: function senderWithMessage(bytes ) view returns(address) +func (_TestDAppV2 *TestDAppV2CallerSession) SenderWithMessage(arg0 []byte) (common.Address, error) { + return _TestDAppV2.Contract.SenderWithMessage(&_TestDAppV2.CallOpts, arg0) +} + // Erc20Call is a paid mutator transaction binding the contract method 0xc7a339a9. // // Solidity: function erc20Call(address erc20, uint256 amount, string message) returns() @@ -382,6 +449,27 @@ func (_TestDAppV2 *TestDAppV2TransactorSession) GasCall(message string) (*types. return _TestDAppV2.Contract.GasCall(&_TestDAppV2.TransactOpts, message) } +// OnCall is a paid mutator transaction binding the contract method 0x676cc054. +// +// Solidity: function onCall((address) messageContext, bytes message) payable returns(bytes) +func (_TestDAppV2 *TestDAppV2Transactor) OnCall(opts *bind.TransactOpts, messageContext TestDAppV2MessageContext, message []byte) (*types.Transaction, error) { + return _TestDAppV2.contract.Transact(opts, "onCall", messageContext, message) +} + +// OnCall is a paid mutator transaction binding the contract method 0x676cc054. +// +// Solidity: function onCall((address) messageContext, bytes message) payable returns(bytes) +func (_TestDAppV2 *TestDAppV2Session) OnCall(messageContext TestDAppV2MessageContext, message []byte) (*types.Transaction, error) { + return _TestDAppV2.Contract.OnCall(&_TestDAppV2.TransactOpts, messageContext, message) +} + +// OnCall is a paid mutator transaction binding the contract method 0x676cc054. +// +// Solidity: function onCall((address) messageContext, bytes message) payable returns(bytes) +func (_TestDAppV2 *TestDAppV2TransactorSession) OnCall(messageContext TestDAppV2MessageContext, message []byte) (*types.Transaction, error) { + return _TestDAppV2.Contract.OnCall(&_TestDAppV2.TransactOpts, messageContext, message) +} + // OnCrossChainCall is a paid mutator transaction binding the contract method 0xde43156e. // // Solidity: function onCrossChainCall((bytes,address,uint256) _context, address _zrc20, uint256 amount, bytes message) returns() @@ -424,6 +512,27 @@ func (_TestDAppV2 *TestDAppV2TransactorSession) OnRevert(revertContext TestDAppV return _TestDAppV2.Contract.OnRevert(&_TestDAppV2.TransactOpts, revertContext) } +// SetExpectedOnCallSender is a paid mutator transaction binding the contract method 0xc234fecf. +// +// Solidity: function setExpectedOnCallSender(address _expectedOnCallSender) returns() +func (_TestDAppV2 *TestDAppV2Transactor) SetExpectedOnCallSender(opts *bind.TransactOpts, _expectedOnCallSender common.Address) (*types.Transaction, error) { + return _TestDAppV2.contract.Transact(opts, "setExpectedOnCallSender", _expectedOnCallSender) +} + +// SetExpectedOnCallSender is a paid mutator transaction binding the contract method 0xc234fecf. +// +// Solidity: function setExpectedOnCallSender(address _expectedOnCallSender) returns() +func (_TestDAppV2 *TestDAppV2Session) SetExpectedOnCallSender(_expectedOnCallSender common.Address) (*types.Transaction, error) { + return _TestDAppV2.Contract.SetExpectedOnCallSender(&_TestDAppV2.TransactOpts, _expectedOnCallSender) +} + +// SetExpectedOnCallSender is a paid mutator transaction binding the contract method 0xc234fecf. +// +// Solidity: function setExpectedOnCallSender(address _expectedOnCallSender) returns() +func (_TestDAppV2 *TestDAppV2TransactorSession) SetExpectedOnCallSender(_expectedOnCallSender common.Address) (*types.Transaction, error) { + return _TestDAppV2.Contract.SetExpectedOnCallSender(&_TestDAppV2.TransactOpts, _expectedOnCallSender) +} + // SimpleCall is a paid mutator transaction binding the contract method 0x36e980a0. // // Solidity: function simpleCall(string message) returns() diff --git a/pkg/contracts/testdappv2/TestDAppV2.json b/pkg/contracts/testdappv2/TestDAppV2.json index bcac60c189..04cbd8756a 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.json +++ b/pkg/contracts/testdappv2/TestDAppV2.json @@ -61,6 +61,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "expectedOnCallSender", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -112,6 +125,37 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "internalType": "struct TestDAppV2.MessageContext", + "name": "messageContext", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "onCall", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -187,6 +231,38 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "senderWithMessage", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_expectedOnCallSender", + "type": "address" + } + ], + "name": "setExpectedOnCallSender", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -205,5 +281,5 @@ "type": "receive" } ], - "bin": "608060405234801561001057600080fd5b50610e3a806100206000396000f3fe60806040526004361061008a5760003560e01c8063a799911f11610059578063a799911f14610162578063c7a339a91461017e578063de43156e146101a7578063e2842ed7146101d0578063f592cbfb1461020d57610091565b806336e980a0146100965780634297a263146100bf578063660b9de0146100fc5780639291fe261461012557610091565b3661009157005b600080fd5b3480156100a257600080fd5b506100bd60048036038101906100b89190610900565b61024a565b005b3480156100cb57600080fd5b506100e660048036038101906100e19190610864565b610274565b6040516100f39190610b35565b60405180910390f35b34801561010857600080fd5b50610123600480360381019061011e9190610949565b61028c565b005b34801561013157600080fd5b5061014c60048036038101906101479190610900565b610347565b6040516101599190610b35565b60405180910390f35b61017c60048036038101906101779190610900565b61038a565b005b34801561018a57600080fd5b506101a560048036038101906101a09190610891565b6103b3565b005b3480156101b357600080fd5b506101ce60048036038101906101c99190610992565b610476565b005b3480156101dc57600080fd5b506101f760048036038101906101f29190610864565b61056f565b6040516102049190610b1a565b60405180910390f35b34801561021957600080fd5b50610234600480360381019061022f9190610900565b61058f565b6040516102419190610b1a565b60405180910390f35b610253816105de565b1561025d57600080fd5b61026681610634565b610271816000610688565b50565b60016020528060005260406000206000915090505481565b6102e781806040019061029f9190610b50565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610634565b6103448180604001906102fa9190610b50565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610688565b50565b6000600160008360405160200161035e9190610ab7565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b610393816105de565b1561039d57600080fd5b6103a681610634565b6103b08134610688565b50565b6103bc816105de565b156103c657600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161040393929190610ae3565b602060405180830381600087803b15801561041d57600080fd5b505af1158015610431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104559190610837565b61045e57600080fd5b61046781610634565b6104718183610688565b505050565b6104c382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506105de565b156104cd57600080fd5b61051a82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610634565b61056882828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610688565b5050505050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016105a59190610ab7565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b60006040516020016105ef90610ace565b60405160208183030381529060405280519060200120826040516020016106169190610ab7565b60405160208183030381529060405280519060200120149050919050565b60016000808360405160200161064a9190610ab7565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b80600160008460405160200161069e9190610ab7565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b60006106dd6106d884610bd8565b610bb3565b9050828152602081018484840111156106f9576106f8610d48565b5b610704848285610c83565b509392505050565b60008135905061071b81610d91565b92915050565b60008151905061073081610da8565b92915050565b60008135905061074581610dbf565b92915050565b60008083601f84011261076157610760610d2a565b5b8235905067ffffffffffffffff81111561077e5761077d610d25565b5b60208301915083600182028301111561079a57610799610d3e565b5b9250929050565b6000813590506107b081610dd6565b92915050565b600082601f8301126107cb576107ca610d2a565b5b81356107db8482602086016106ca565b91505092915050565b6000606082840312156107fa576107f9610d34565b5b81905092915050565b60006060828403121561081957610818610d34565b5b81905092915050565b60008135905061083181610ded565b92915050565b60006020828403121561084d5761084c610d52565b5b600061085b84828501610721565b91505092915050565b60006020828403121561087a57610879610d52565b5b600061088884828501610736565b91505092915050565b6000806000606084860312156108aa576108a9610d52565b5b60006108b8868287016107a1565b93505060206108c986828701610822565b925050604084013567ffffffffffffffff8111156108ea576108e9610d4d565b5b6108f6868287016107b6565b9150509250925092565b60006020828403121561091657610915610d52565b5b600082013567ffffffffffffffff81111561093457610933610d4d565b5b610940848285016107b6565b91505092915050565b60006020828403121561095f5761095e610d52565b5b600082013567ffffffffffffffff81111561097d5761097c610d4d565b5b610989848285016107e4565b91505092915050565b6000806000806000608086880312156109ae576109ad610d52565b5b600086013567ffffffffffffffff8111156109cc576109cb610d4d565b5b6109d888828901610803565b95505060206109e98882890161070c565b94505060406109fa88828901610822565b935050606086013567ffffffffffffffff811115610a1b57610a1a610d4d565b5b610a278882890161074b565b92509250509295509295909350565b610a3f81610c1f565b82525050565b610a4e81610c31565b82525050565b6000610a5f82610c09565b610a698185610c14565b9350610a79818560208601610c92565b80840191505092915050565b6000610a92600683610c14565b9150610a9d82610d68565b600682019050919050565b610ab181610c79565b82525050565b6000610ac38284610a54565b915081905092915050565b6000610ad982610a85565b9150819050919050565b6000606082019050610af86000830186610a36565b610b056020830185610a36565b610b126040830184610aa8565b949350505050565b6000602082019050610b2f6000830184610a45565b92915050565b6000602082019050610b4a6000830184610aa8565b92915050565b60008083356001602003843603038112610b6d57610b6c610d39565b5b80840192508235915067ffffffffffffffff821115610b8f57610b8e610d2f565b5b602083019250600182023603831315610bab57610baa610d43565b5b509250929050565b6000610bbd610bce565b9050610bc98282610cc5565b919050565b6000604051905090565b600067ffffffffffffffff821115610bf357610bf2610cf6565b5b610bfc82610d57565b9050602081019050919050565b600081519050919050565b600081905092915050565b6000610c2a82610c59565b9050919050565b60008115159050919050565b6000819050919050565b6000610c5282610c1f565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015610cb0578082015181840152602081019050610c95565b83811115610cbf576000848401525b50505050565b610cce82610d57565b810181811067ffffffffffffffff82111715610ced57610cec610cf6565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b610d9a81610c1f565b8114610da557600080fd5b50565b610db181610c31565b8114610dbc57600080fd5b50565b610dc881610c3d565b8114610dd357600080fd5b50565b610ddf81610c47565b8114610dea57600080fd5b50565b610df681610c79565b8114610e0157600080fd5b5056fea2646970667358221220d6765b67214e8cadf15b569ed63c4c4628bd833acf6926d71b9b6a6011fbb78064736f6c63430008070033" + "bin": "608060405234801561001057600080fd5b5061147c806100206000396000f3fe6080604052600436106100c65760003560e01c8063a799911f1161007f578063de43156e11610059578063de43156e14610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063a799911f146101f9578063c234fecf14610215578063c7a339a91461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a77714610138578063660b9de014610163578063676cc0541461018c5780639291fe26146101bc576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610b78565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610bf7565b610371565b60405161012f9190610c3d565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a9190610c99565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190610cd8565b6103ad565b005b6101a660048036038101906101a19190610da0565b610468565b6040516101b39190610e88565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190610b78565b61061d565b6040516101f09190610c3d565b60405180910390f35b610213600480360381019061020e9190610b78565b610660565b005b34801561022157600080fd5b5061023c60048036038101906102379190610ed6565b610689565b005b34801561024a57600080fd5b5061026560048036038101906102609190610f6d565b6106cc565b005b34801561027357600080fd5b5061028e60048036038101906102899190610ffb565b610780565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610bf7565b610879565b6040516102c491906110ba565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610b78565b610899565b60405161030191906110ba565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190611176565b6108e9565b60405161033e9190610c99565b60405180910390f35b61035081610932565b1561035a57600080fd5b61036381610988565b61036e8160006109dc565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104088180604001906103c091906111ce565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610988565b61046581806040019061041b91906111ce565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006109dc565b50565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906104b49190610ed6565b73ffffffffffffffffffffffffffffffffffffffff161461050a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105019061128e565b60405180910390fd5b61055783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610988565b6105a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346109dc565b8360000160208101906105b89190610ed6565b600284846040516105ca9291906112de565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b60006003600083604051602001610634919061133e565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b61066981610932565b1561067357600080fd5b61067c81610988565b61068681346109dc565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6106d581610932565b156106df57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161071c93929190611355565b6020604051808303816000875af115801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f91906113b8565b61076857600080fd5b61077181610988565b61077b81836109dc565b505050565b6107cd82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610932565b156107d757600080fd5b61082482828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610988565b61087282828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846109dc565b5050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b600060016000836040516020016108b0919061133e565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161094390611431565b604051602081830303815290604052805190602001208260405160200161096a919061133e565b60405160208183030381529060405280519060200120149050919050565b60018060008360405160200161099e919061133e565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060036000846040516020016109f2919061133e565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a8582610a3c565b810181811067ffffffffffffffff82111715610aa457610aa3610a4d565b5b80604052505050565b6000610ab7610a1e565b9050610ac38282610a7c565b919050565b600067ffffffffffffffff821115610ae357610ae2610a4d565b5b610aec82610a3c565b9050602081019050919050565b82818337600083830152505050565b6000610b1b610b1684610ac8565b610aad565b905082815260208101848484011115610b3757610b36610a37565b5b610b42848285610af9565b509392505050565b600082601f830112610b5f57610b5e610a32565b5b8135610b6f848260208601610b08565b91505092915050565b600060208284031215610b8e57610b8d610a28565b5b600082013567ffffffffffffffff811115610bac57610bab610a2d565b5b610bb884828501610b4a565b91505092915050565b6000819050919050565b610bd481610bc1565b8114610bdf57600080fd5b50565b600081359050610bf181610bcb565b92915050565b600060208284031215610c0d57610c0c610a28565b5b6000610c1b84828501610be2565b91505092915050565b6000819050919050565b610c3781610c24565b82525050565b6000602082019050610c526000830184610c2e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610c8382610c58565b9050919050565b610c9381610c78565b82525050565b6000602082019050610cae6000830184610c8a565b92915050565b600080fd5b600060608284031215610ccf57610cce610cb4565b5b81905092915050565b600060208284031215610cee57610ced610a28565b5b600082013567ffffffffffffffff811115610d0c57610d0b610a2d565b5b610d1884828501610cb9565b91505092915050565b600060208284031215610d3757610d36610cb4565b5b81905092915050565b600080fd5b600080fd5b60008083601f840112610d6057610d5f610a32565b5b8235905067ffffffffffffffff811115610d7d57610d7c610d40565b5b602083019150836001820283011115610d9957610d98610d45565b5b9250929050565b600080600060408486031215610db957610db8610a28565b5b6000610dc786828701610d21565b935050602084013567ffffffffffffffff811115610de857610de7610a2d565b5b610df486828701610d4a565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b83811015610e3a578082015181840152602081019050610e1f565b83811115610e49576000848401525b50505050565b6000610e5a82610e00565b610e648185610e0b565b9350610e74818560208601610e1c565b610e7d81610a3c565b840191505092915050565b60006020820190508181036000830152610ea28184610e4f565b905092915050565b610eb381610c78565b8114610ebe57600080fd5b50565b600081359050610ed081610eaa565b92915050565b600060208284031215610eec57610eeb610a28565b5b6000610efa84828501610ec1565b91505092915050565b6000610f0e82610c78565b9050919050565b610f1e81610f03565b8114610f2957600080fd5b50565b600081359050610f3b81610f15565b92915050565b610f4a81610c24565b8114610f5557600080fd5b50565b600081359050610f6781610f41565b92915050565b600080600060608486031215610f8657610f85610a28565b5b6000610f9486828701610f2c565b9350506020610fa586828701610f58565b925050604084013567ffffffffffffffff811115610fc657610fc5610a2d565b5b610fd286828701610b4a565b9150509250925092565b600060608284031215610ff257610ff1610cb4565b5b81905092915050565b60008060008060006080868803121561101757611016610a28565b5b600086013567ffffffffffffffff81111561103557611034610a2d565b5b61104188828901610fdc565b955050602061105288828901610ec1565b945050604061106388828901610f58565b935050606086013567ffffffffffffffff81111561108457611083610a2d565b5b61109088828901610d4a565b92509250509295509295909350565b60008115159050919050565b6110b48161109f565b82525050565b60006020820190506110cf60008301846110ab565b92915050565b600067ffffffffffffffff8211156110f0576110ef610a4d565b5b6110f982610a3c565b9050602081019050919050565b6000611119611114846110d5565b610aad565b90508281526020810184848401111561113557611134610a37565b5b611140848285610af9565b509392505050565b600082601f83011261115d5761115c610a32565b5b813561116d848260208601611106565b91505092915050565b60006020828403121561118c5761118b610a28565b5b600082013567ffffffffffffffff8111156111aa576111a9610a2d565b5b6111b684828501611148565b91505092915050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126111eb576111ea6111bf565b5b80840192508235915067ffffffffffffffff82111561120d5761120c6111c4565b5b602083019250600182023603831315611229576112286111c9565b5b509250929050565b600082825260208201905092915050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b6000611278601683611231565b915061128382611242565b602082019050919050565b600060208201905081810360008301526112a78161126b565b9050919050565b600081905092915050565b60006112c583856112ae565b93506112d2838584610af9565b82840190509392505050565b60006112eb8284866112b9565b91508190509392505050565b600081519050919050565b600081905092915050565b6000611318826112f7565b6113228185611302565b9350611332818560208601610e1c565b80840191505092915050565b600061134a828461130d565b915081905092915050565b600060608201905061136a6000830186610c8a565b6113776020830185610c8a565b6113846040830184610c2e565b949350505050565b6113958161109f565b81146113a057600080fd5b50565b6000815190506113b28161138c565b92915050565b6000602082840312156113ce576113cd610a28565b5b60006113dc848285016113a3565b91505092915050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b600061141b600683611302565b9150611426826113e5565b600682019050919050565b600061143c8261140e565b915081905091905056fea264697066735822122046fb444f8c754142359339f5f1d728822414688169d0d22f23bd25c688c73fdf64736f6c634300080a0033" } diff --git a/pkg/contracts/testdappv2/TestDAppV2.sol b/pkg/contracts/testdappv2/TestDAppV2.sol index 4ab39a05a0..431ccf417d 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.sol +++ b/pkg/contracts/testdappv2/TestDAppV2.sol @@ -22,8 +22,17 @@ contract TestDAppV2 { bytes revertMessage; } + /// @notice Message context passed to execute function. + /// @param sender Sender from omnichain contract. + struct MessageContext { + address sender; + } + + address public expectedOnCallSender; + // these structures allow to assess contract calls mapping(bytes32 => bool) public calledWithMessage; + mapping(bytes => address) public senderWithMessage; mapping(bytes32 => uint256) public amountWithMessage; function setCalledWithMessage(string memory message) internal { @@ -93,5 +102,16 @@ contract TestDAppV2 { setAmountWithMessage(string(revertContext.revertMessage), 0); } + function setExpectedOnCallSender(address _expectedOnCallSender) external { + expectedOnCallSender = _expectedOnCallSender; + } + + function onCall(MessageContext calldata messageContext, bytes calldata message) external payable returns (bytes memory) { + require(messageContext.sender == expectedOnCallSender, "unauthenticated sender"); + setCalledWithMessage(string(message)); + setAmountWithMessage(string(message), msg.value); + senderWithMessage[message] = messageContext.sender; + } + receive() external payable {} } \ No newline at end of file diff --git a/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto b/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto index f8da0d0daa..0ca1f56f7d 100644 --- a/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto +++ b/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto @@ -54,6 +54,11 @@ message ZetaAccounting { ]; } +message CallOptions { + uint64 gas_limit = 1; + bool is_arbitrary_call = 2; +} + message OutboundParams { string receiver = 1; int64 receiver_chainId = 2; @@ -63,6 +68,7 @@ message OutboundParams { (gogoproto.nullable) = false ]; uint64 tss_nonce = 5; + // Deprecated (v21), use CallOptions uint64 gas_limit = 6; string gas_price = 7; string gas_priority_fee = 23; @@ -80,6 +86,8 @@ message OutboundParams { string tss_pubkey = 11; TxFinalizationStatus tx_finalization_status = 12; + CallOptions call_options = 24; + // not used. do not edit. reserved 13 to 19; } diff --git a/proto/zetachain/zetacore/crosschain/tx.proto b/proto/zetachain/zetacore/crosschain/tx.proto index e5d310976d..59a449ddfc 100644 --- a/proto/zetachain/zetacore/crosschain/tx.proto +++ b/proto/zetachain/zetacore/crosschain/tx.proto @@ -163,6 +163,7 @@ message MsgVoteInbound { string message = 8; string inbound_hash = 9; uint64 inbound_block_height = 10; + // Deprecated (v21), use CallOptions uint64 gas_limit = 11; pkg.coin.CoinType coin_type = 12; string tx_origin = 13; @@ -175,6 +176,8 @@ message MsgVoteInbound { // revert options provided by the sender RevertOptions revert_options = 17 [ (gogoproto.nullable) = false ]; + + CallOptions call_options = 18; } message MsgVoteInboundResponse {} diff --git a/testutil/sample/crosschain.go b/testutil/sample/crosschain.go index defc1f217a..8f09271e23 100644 --- a/testutil/sample/crosschain.go +++ b/testutil/sample/crosschain.go @@ -148,12 +148,14 @@ func InboundParamsValidChainID(r *rand.Rand) *types.InboundParams { func OutboundParams(r *rand.Rand) *types.OutboundParams { return &types.OutboundParams{ - Receiver: EthAddress().String(), - ReceiverChainId: r.Int63(), - CoinType: coin.CoinType(r.Intn(100)), - Amount: math.NewUint(uint64(r.Int63())), - TssNonce: r.Uint64(), - GasLimit: r.Uint64(), + Receiver: EthAddress().String(), + ReceiverChainId: r.Int63(), + CoinType: coin.CoinType(r.Intn(100)), + Amount: math.NewUint(uint64(r.Int63())), + TssNonce: r.Uint64(), + CallOptions: &types.CallOptions{ + GasLimit: r.Uint64(), + }, GasPrice: math.NewUint(uint64(r.Int63())).String(), Hash: StringRandom(r, 32), BallotIndex: StringRandom(r, 32), @@ -165,11 +167,13 @@ func OutboundParams(r *rand.Rand) *types.OutboundParams { func OutboundParamsValidChainID(r *rand.Rand) *types.OutboundParams { return &types.OutboundParams{ - Receiver: EthAddress().String(), - ReceiverChainId: chains.Goerli.ChainId, - Amount: math.NewUint(uint64(r.Int63())), - TssNonce: r.Uint64(), - GasLimit: r.Uint64(), + Receiver: EthAddress().String(), + ReceiverChainId: chains.Goerli.ChainId, + Amount: math.NewUint(uint64(r.Int63())), + TssNonce: r.Uint64(), + CallOptions: &types.CallOptions{ + GasLimit: r.Uint64(), + }, GasPrice: math.NewUint(uint64(r.Int63())).String(), Hash: StringRandom(r, 32), BallotIndex: StringRandom(r, 32), @@ -279,12 +283,14 @@ func InboundVote(coinType coin.CoinType, from, to int64) types.MsgVoteInbound { Amount: UintInRange(10000000, 1000000000), Message: base64.StdEncoding.EncodeToString(Bytes()), InboundBlockHeight: Uint64InRange(1, 10000), - GasLimit: 1000000000, - InboundHash: Hash().String(), - CoinType: coinType, - TxOrigin: EthAddress().String(), - Asset: "", - EventIndex: EventIndex(), + CallOptions: &types.CallOptions{ + GasLimit: 1000000000, + }, + InboundHash: Hash().String(), + CoinType: coinType, + TxOrigin: EthAddress().String(), + Asset: "", + EventIndex: EventIndex(), } } diff --git a/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts b/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts index a0ab4b06ca..1ffa04eaca 100644 --- a/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts +++ b/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts @@ -207,6 +207,35 @@ export declare class ZetaAccounting extends Message { static equals(a: ZetaAccounting | PlainMessage | undefined, b: ZetaAccounting | PlainMessage | undefined): boolean; } +/** + * @generated from message zetachain.zetacore.crosschain.CallOptions + */ +export declare class CallOptions extends Message { + /** + * @generated from field: uint64 gas_limit = 1; + */ + gasLimit: bigint; + + /** + * @generated from field: bool is_arbitrary_call = 2; + */ + isArbitraryCall: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.CallOptions"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): CallOptions; + + static fromJson(jsonValue: JsonValue, options?: Partial): CallOptions; + + static fromJsonString(jsonString: string, options?: Partial): CallOptions; + + static equals(a: CallOptions | PlainMessage | undefined, b: CallOptions | PlainMessage | undefined): boolean; +} + /** * @generated from message zetachain.zetacore.crosschain.OutboundParams */ @@ -237,6 +266,8 @@ export declare class OutboundParams extends Message { tssNonce: bigint; /** + * Deprecated (v21), use CallOptions + * * @generated from field: uint64 gas_limit = 6; */ gasLimit: bigint; @@ -294,6 +325,11 @@ export declare class OutboundParams extends Message { */ txFinalizationStatus: TxFinalizationStatus; + /** + * @generated from field: zetachain.zetacore.crosschain.CallOptions call_options = 24; + */ + callOptions?: CallOptions; + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; diff --git a/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts b/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts index 657a772384..751371fa03 100644 --- a/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts +++ b/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts @@ -8,7 +8,7 @@ import { Message, proto3 } from "@bufbuild/protobuf"; import type { CoinType } from "../pkg/coin/coin_pb.js"; import type { Proof } from "../pkg/proofs/proofs_pb.js"; import type { ReceiveStatus } from "../pkg/chains/chains_pb.js"; -import type { ProtocolContractVersion, RevertOptions } from "./cross_chain_tx_pb.js"; +import type { CallOptions, ProtocolContractVersion, RevertOptions } from "./cross_chain_tx_pb.js"; import type { RateLimiterFlags } from "./rate_limiter_flags_pb.js"; /** @@ -616,6 +616,8 @@ export declare class MsgVoteInbound extends Message { inboundBlockHeight: bigint; /** + * Deprecated (v21), use CallOptions + * * @generated from field: uint64 gas_limit = 11; */ gasLimit: bigint; @@ -656,6 +658,11 @@ export declare class MsgVoteInbound extends Message { */ revertOptions?: RevertOptions; + /** + * @generated from field: zetachain.zetacore.crosschain.CallOptions call_options = 18; + */ + callOptions?: CallOptions; + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; diff --git a/x/crosschain/client/cli/tx_vote_inbound.go b/x/crosschain/client/cli/tx_vote_inbound.go index 3c7fae37c0..e4b8b9ecc9 100644 --- a/x/crosschain/client/cli/tx_vote_inbound.go +++ b/x/crosschain/client/cli/tx_vote_inbound.go @@ -17,7 +17,7 @@ import ( func CmdVoteInbound() *cobra.Command { cmd := &cobra.Command{ Use: "vote-inbound [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message" + - "] [inboundHash] [inBlockHeight] [coinType] [asset] [eventIndex] [protocolContractVersion]", + "] [inboundHash] [inBlockHeight] [coinType] [asset] [eventIndex] [protocolContractVersion] [isArbitraryCall]", Short: "Broadcast message to vote an inbound", Args: cobra.ExactArgs(13), RunE: func(cmd *cobra.Command, args []string) error { @@ -67,6 +67,11 @@ func CmdVoteInbound() *cobra.Command { return err } + isArbitraryCall, err := strconv.ParseBool(args[13]) + if err != nil { + return err + } + msg := types.NewMsgVoteInbound( clientCtx.GetFromAddress().String(), argsSender, @@ -83,6 +88,7 @@ func CmdVoteInbound() *cobra.Command { argsAsset, uint(argsEventIndex), protocolContractVersion, + isArbitraryCall, ) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) diff --git a/x/crosschain/keeper/abci.go b/x/crosschain/keeper/abci.go index c499f5fe05..03d13fb6d5 100644 --- a/x/crosschain/keeper/abci.go +++ b/x/crosschain/keeper/abci.go @@ -109,7 +109,7 @@ func CheckAndUpdateCctxGasPrice( flags observertypes.GasPriceIncreaseFlags, ) (math.Uint, math.Uint, error) { // skip if gas price or gas limit is not set - if cctx.GetCurrentOutboundParam().GasPrice == "" || cctx.GetCurrentOutboundParam().GasLimit == 0 { + if cctx.GetCurrentOutboundParam().GasPrice == "" || cctx.GetCurrentOutboundParam().CallOptions.GasLimit == 0 { return math.ZeroUint(), math.ZeroUint(), nil } @@ -159,7 +159,7 @@ func CheckAndUpdateCctxGasPrice( } // withdraw additional fees from the gas stability pool - gasLimit := math.NewUint(cctx.GetCurrentOutboundParam().GasLimit) + gasLimit := math.NewUint(cctx.GetCurrentOutboundParam().CallOptions.GasLimit) additionalFees := gasLimit.Mul(gasPriceIncrease) if err := k.fungibleKeeper.WithdrawFromGasStabilityPool(ctx, chainID, additionalFees.BigInt()); err != nil { return math.ZeroUint(), math.ZeroUint(), cosmoserrors.Wrap( diff --git a/x/crosschain/keeper/abci_test.go b/x/crosschain/keeper/abci_test.go index cee15a2777..32499e1827 100644 --- a/x/crosschain/keeper/abci_test.go +++ b/x/crosschain/keeper/abci_test.go @@ -134,8 +134,10 @@ func TestCheckAndUpdateCctxGasPrice(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: 42, - GasLimit: 1000, - GasPrice: "100", + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, + GasPrice: "100", }, }, }, @@ -159,8 +161,10 @@ func TestCheckAndUpdateCctxGasPrice(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: 42, - GasLimit: 1000, - GasPrice: "100", + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, + GasPrice: "100", }, }, }, @@ -188,8 +192,10 @@ func TestCheckAndUpdateCctxGasPrice(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: 42, - GasLimit: 1000, - GasPrice: "100", + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, + GasPrice: "100", }, }, }, @@ -217,8 +223,10 @@ func TestCheckAndUpdateCctxGasPrice(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: 42, - GasLimit: 1000, - GasPrice: "100", + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, + GasPrice: "100", }, }, }, @@ -245,8 +253,10 @@ func TestCheckAndUpdateCctxGasPrice(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: 42, - GasLimit: 100, - GasPrice: "", + CallOptions: &types.CallOptions{ + GasLimit: 100, + }, + GasPrice: "", }, }, }, @@ -268,8 +278,10 @@ func TestCheckAndUpdateCctxGasPrice(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: 42, - GasLimit: 0, - GasPrice: "100", + CallOptions: &types.CallOptions{ + GasLimit: 0, + }, + GasPrice: "100", }, }, }, @@ -291,8 +303,10 @@ func TestCheckAndUpdateCctxGasPrice(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: 42, - GasLimit: 0, - GasPrice: "100", + CallOptions: &types.CallOptions{ + GasLimit: 0, + }, + GasPrice: "100", }, }, }, @@ -314,8 +328,10 @@ func TestCheckAndUpdateCctxGasPrice(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: 42, - GasLimit: 1000, - GasPrice: "100", + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, + GasPrice: "100", }, }, }, @@ -336,8 +352,10 @@ func TestCheckAndUpdateCctxGasPrice(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: 42, - GasLimit: 1000, - GasPrice: "100", + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, + GasPrice: "100", }, }, }, diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_inbound_test.go b/x/crosschain/keeper/cctx_orchestrator_validate_inbound_test.go index af1521c988..492ef14db0 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_inbound_test.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_inbound_test.go @@ -78,11 +78,13 @@ func TestKeeper_ValidateInbound(t *testing.T) { Message: message, InboundHash: inboundHash.String(), InboundBlockHeight: inboundBlockHeight, - GasLimit: gasLimit, - CoinType: cointType, - TxOrigin: sender.String(), - Asset: asset, - EventIndex: eventIndex, + CallOptions: &types.CallOptions{ + GasLimit: gasLimit, + }, + CoinType: cointType, + TxOrigin: sender.String(), + Asset: asset, + EventIndex: eventIndex, } _, err := k.ValidateInbound(ctx, &msg, false) @@ -136,11 +138,13 @@ func TestKeeper_ValidateInbound(t *testing.T) { Message: message, InboundHash: inboundHash.String(), InboundBlockHeight: inboundBlockHeight, - GasLimit: gasLimit, - CoinType: cointType, - TxOrigin: sender.String(), - Asset: asset, - EventIndex: eventIndex, + CallOptions: &types.CallOptions{ + GasLimit: gasLimit, + }, + CoinType: cointType, + TxOrigin: sender.String(), + Asset: asset, + EventIndex: eventIndex, } _, err := k.ValidateInbound(ctx, &msg, false) @@ -203,11 +207,13 @@ func TestKeeper_ValidateInbound(t *testing.T) { Message: message, InboundHash: inboundHash.String(), InboundBlockHeight: inboundBlockHeight, - GasLimit: gasLimit, - CoinType: cointType, - TxOrigin: sender.String(), - Asset: asset, - EventIndex: eventIndex, + CallOptions: &types.CallOptions{ + GasLimit: gasLimit, + }, + CoinType: cointType, + TxOrigin: sender.String(), + Asset: asset, + EventIndex: eventIndex, } _, err := k.ValidateInbound(ctx, &msg, false) @@ -267,11 +273,13 @@ func TestKeeper_ValidateInbound(t *testing.T) { Message: message, InboundHash: inboundHash.String(), InboundBlockHeight: inboundBlockHeight, - GasLimit: gasLimit, - CoinType: cointType, - TxOrigin: sender.String(), - Asset: asset, - EventIndex: eventIndex, + CallOptions: &types.CallOptions{ + GasLimit: gasLimit, + }, + CoinType: cointType, + TxOrigin: sender.String(), + Asset: asset, + EventIndex: eventIndex, } _, err := k.ValidateInbound(ctx, &msg, false) @@ -329,11 +337,13 @@ func TestKeeper_ValidateInbound(t *testing.T) { Message: message, InboundHash: inboundHash.String(), InboundBlockHeight: inboundBlockHeight, - GasLimit: gasLimit, - CoinType: cointType, - TxOrigin: sender.String(), - Asset: asset, - EventIndex: eventIndex, + CallOptions: &types.CallOptions{ + GasLimit: gasLimit, + }, + CoinType: cointType, + TxOrigin: sender.String(), + Asset: asset, + EventIndex: eventIndex, } _, err := k.ValidateInbound(ctx, &msg, false) diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go index aec7eccb6e..d788e60fe0 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go @@ -171,7 +171,7 @@ func (k Keeper) processFailedOutboundOnExternalChain( } if gasLimit == 0 { // use same gas limit of outbound as a fallback -- should not happen - gasLimit = cctx.OutboundParams[0].GasLimit + gasLimit = cctx.OutboundParams[0].CallOptions.GasLimit } // create new OutboundParams for the revert diff --git a/x/crosschain/keeper/cctx_test.go b/x/crosschain/keeper/cctx_test.go index ef54e7151b..9b17f825d6 100644 --- a/x/crosschain/keeper/cctx_test.go +++ b/x/crosschain/keeper/cctx_test.go @@ -37,7 +37,7 @@ func createNCctxWithStatus( } items[i].ZetaFees = math.OneUint() items[i].InboundParams = &types.InboundParams{ObservedHash: fmt.Sprintf("%d", i), Amount: math.OneUint()} - items[i].OutboundParams = []*types.OutboundParams{{Amount: math.ZeroUint()}} + items[i].OutboundParams = []*types.OutboundParams{{Amount: math.ZeroUint(), CallOptions: &types.CallOptions{}}} items[i].RevertOptions = types.NewEmptyRevertOptions() keeper.SetCctxAndNonceToCctxAndInboundHashToCctx(ctx, items[i], tssPubkey) @@ -61,11 +61,13 @@ func createNCctx(keeper *keeper.Keeper, ctx sdk.Context, n int, tssPubkey string FinalizedZetaHeight: uint64(i), } items[i].OutboundParams = []*types.OutboundParams{{ - Receiver: fmt.Sprintf("%d", i), - ReceiverChainId: int64(i), - Hash: fmt.Sprintf("%d", i), - TssNonce: uint64(i), - GasLimit: uint64(i), + Receiver: fmt.Sprintf("%d", i), + ReceiverChainId: int64(i), + Hash: fmt.Sprintf("%d", i), + TssNonce: uint64(i), + CallOptions: &types.CallOptions{ + GasLimit: uint64(i), + }, GasPrice: fmt.Sprintf("%d", i), BallotIndex: fmt.Sprintf("%d", i), ObservedExternalHeight: uint64(i), diff --git a/x/crosschain/keeper/evm_hooks.go b/x/crosschain/keeper/evm_hooks.go index 5669c10fe7..c07cba213a 100644 --- a/x/crosschain/keeper/evm_hooks.go +++ b/x/crosschain/keeper/evm_hooks.go @@ -87,7 +87,7 @@ func (k Keeper) ProcessLogs( // run the processing for the v1 and the v2 protocol contracts for _, log := range logs { if !crypto.IsEmptyAddress(gatewayAddr) { - if err := k.ProcessZEVMInboundV2(ctx, log, gatewayAddr, emittingAddress, txOrigin); err != nil { + if err := k.ProcessZEVMInboundV2(ctx, log, gatewayAddr, txOrigin); err != nil { return errors.Wrap(err, "failed to process ZEVM inbound V2") } } @@ -206,6 +206,7 @@ func (k Keeper) ProcessZRC20WithdrawalEvent( foreignCoin.Asset, event.Raw.Index, types.ProtocolContractVersion_V1, + false, // not relevant for v1 ) cctx, err := k.ValidateInbound(ctx, msg, false) @@ -286,6 +287,7 @@ func (k Keeper) ProcessZetaSentEvent( "", event.Raw.Index, types.ProtocolContractVersion_V1, + false, // not relevant for v1 ) cctx, err := k.ValidateInbound(ctx, msg, true) diff --git a/x/crosschain/keeper/gas_payment.go b/x/crosschain/keeper/gas_payment.go index 63cbea0d4f..d0bd4921df 100644 --- a/x/crosschain/keeper/gas_payment.go +++ b/x/crosschain/keeper/gas_payment.go @@ -139,7 +139,7 @@ func (k Keeper) PayGasNativeAndUpdateCctx( // update cctx cctx.GetCurrentOutboundParam().Amount = newAmount - cctx.GetCurrentOutboundParam().GasLimit = gas.GasLimit.Uint64() + cctx.GetCurrentOutboundParam().CallOptions.GasLimit = gas.GasLimit.Uint64() cctx.GetCurrentOutboundParam().GasPrice = gas.GasPrice.String() cctx.GetCurrentOutboundParam().GasPriorityFee = gas.PriorityFee.String() @@ -296,7 +296,7 @@ func (k Keeper) PayGasInERC20AndUpdateCctx( // update cctx cctx.GetCurrentOutboundParam().Amount = newAmount - cctx.GetCurrentOutboundParam().GasLimit = gas.GasLimit.Uint64() + cctx.GetCurrentOutboundParam().CallOptions.GasLimit = gas.GasLimit.Uint64() cctx.GetCurrentOutboundParam().GasPrice = gas.GasPrice.String() cctx.GetCurrentOutboundParam().GasPriorityFee = gas.PriorityFee.String() @@ -362,7 +362,7 @@ func (k Keeper) PayGasInZetaAndUpdateCctx( } // get the gas fee in gas token - gasLimit := sdk.NewUint(cctx.GetCurrentOutboundParam().GasLimit) + gasLimit := sdk.NewUint(cctx.GetCurrentOutboundParam().CallOptions.GasLimit) outTxGasFee := gasLimit.Mul(gasPrice) // get the gas fee in Zeta using system uniswapv2 pool wzeta/gasZRC20 and adding the protocol fee diff --git a/x/crosschain/keeper/gas_payment_test.go b/x/crosschain/keeper/gas_payment_test.go index 3907268fd0..9f91ffc8d1 100644 --- a/x/crosschain/keeper/gas_payment_test.go +++ b/x/crosschain/keeper/gas_payment_test.go @@ -53,9 +53,11 @@ func TestKeeper_PayGasNativeAndUpdateCctx(t *testing.T) { { ReceiverChainId: chains.ZetaChainPrivnet.ChainId, CoinType: coin.CoinType_Gas, + CallOptions: &types.CallOptions{}, }, { ReceiverChainId: chainID, + CallOptions: &types.CallOptions{}, }, }, } @@ -65,7 +67,7 @@ func TestKeeper_PayGasNativeAndUpdateCctx(t *testing.T) { err = k.PayGasNativeAndUpdateCctx(ctx, chainID, &cctx, math.NewUint(inputAmount)) require.NoError(t, err) require.Equal(t, uint64(9999999999957000), cctx.GetCurrentOutboundParam().Amount.Uint64()) - require.Equal(t, uint64(21_000), cctx.GetCurrentOutboundParam().GasLimit) + require.Equal(t, uint64(21_000), cctx.GetCurrentOutboundParam().CallOptions.GasLimit) require.Equal(t, "2", cctx.GetCurrentOutboundParam().GasPrice) }) @@ -229,7 +231,7 @@ func TestKeeper_PayGasInERC20AndUpdateCctx(t *testing.T) { err = k.PayGasInERC20AndUpdateCctx(ctx, chainID, &cctx, math.NewUint(inputAmount), false) require.NoError(t, err) require.Equal(t, inputAmount-expectedInZRC20.Uint64(), cctx.GetCurrentOutboundParam().Amount.Uint64()) - require.Equal(t, uint64(21_000), cctx.GetCurrentOutboundParam().GasLimit) + require.Equal(t, uint64(21_000), cctx.GetCurrentOutboundParam().CallOptions.GasLimit) require.Equal(t, "2", cctx.GetCurrentOutboundParam().GasPrice) }) @@ -476,7 +478,9 @@ func TestKeeper_PayGasInZetaAndUpdateCctx(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: chainID, - GasLimit: 1000, + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, }, }, ZetaFees: math.NewUint(100), @@ -512,7 +516,9 @@ func TestKeeper_PayGasInZetaAndUpdateCctx(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: chainID, - GasLimit: 1000, + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, }, }, } @@ -582,7 +588,9 @@ func TestKeeper_PayGasInZetaAndUpdateCctx(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: chainID, - GasLimit: 1000, + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, }, }, } @@ -616,7 +624,9 @@ func TestKeeper_PayGasInZetaAndUpdateCctx(t *testing.T) { OutboundParams: []*types.OutboundParams{ { ReceiverChainId: chainID, - GasLimit: 1000, + CallOptions: &types.CallOptions{ + GasLimit: 1000, + }, }, }, ZetaFees: math.NewUint(100), diff --git a/x/crosschain/keeper/msg_server_migrate_tss_funds_test.go b/x/crosschain/keeper/msg_server_migrate_tss_funds_test.go index c88f05ab29..5ac59b0995 100644 --- a/x/crosschain/keeper/msg_server_migrate_tss_funds_test.go +++ b/x/crosschain/keeper/msg_server_migrate_tss_funds_test.go @@ -391,7 +391,7 @@ func TestMsgServer_MigrateTssFunds(t *testing.T) { index := hash.Hex() cctx, found := k.GetCrossChainTx(ctx, index) require.True(t, found) - feeCalculated := sdk.NewUint(cctx.GetCurrentOutboundParam().GasLimit). + feeCalculated := sdk.NewUint(cctx.GetCurrentOutboundParam().CallOptions.GasLimit). Mul(sdkmath.NewUintFromString(cctx.GetCurrentOutboundParam().GasPrice)). Add(sdkmath.NewUintFromString(crosschaintypes.TSSMigrationBufferAmountEVM)) require.Equal(t, cctx.GetCurrentOutboundParam().Amount.String(), amount.Sub(feeCalculated).String()) diff --git a/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go b/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go index 97263add19..e824a01707 100644 --- a/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go +++ b/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go @@ -126,12 +126,14 @@ func TestKeeper_VoteInbound(t *testing.T) { Amount: sdkmath.NewUintFromString("10000000"), Message: "", InboundBlockHeight: 1, - GasLimit: 1000000000, - InboundHash: "0x7a900ef978743f91f57ca47c6d1a1add75df4d3531da17671e9cf149e1aefe0b", - CoinType: 0, // zeta - TxOrigin: "0x954598965C2aCdA2885B037561526260764095B8", - Asset: "", - EventIndex: 1, + CallOptions: &types.CallOptions{ + GasLimit: 1000000000, + }, + InboundHash: "0x7a900ef978743f91f57ca47c6d1a1add75df4d3531da17671e9cf149e1aefe0b", + CoinType: 0, // zeta + TxOrigin: "0x954598965C2aCdA2885B037561526260764095B8", + Asset: "", + EventIndex: 1, } _, err := msgServer.VoteInbound( ctx, @@ -153,12 +155,14 @@ func TestKeeper_VoteInbound(t *testing.T) { Amount: sdkmath.NewUintFromString("10000000"), Message: "", InboundBlockHeight: 1, - GasLimit: 1000000001, // <---- Change here - InboundHash: "0x7a900ef978743f91f57ca47c6d1a1add75df4d3531da17671e9cf149e1aefe0b", - CoinType: 0, - TxOrigin: "0x954598965C2aCdA2885B037561526260764095B8", - Asset: "", - EventIndex: 1, + CallOptions: &types.CallOptions{ + GasLimit: 1000000001, // <---- Change here + }, + InboundHash: "0x7a900ef978743f91f57ca47c6d1a1add75df4d3531da17671e9cf149e1aefe0b", + CoinType: 0, + TxOrigin: "0x954598965C2aCdA2885B037561526260764095B8", + Asset: "", + EventIndex: 1, } _, err = msgServer.VoteInbound( diff --git a/x/crosschain/keeper/v2_zevm_inbound.go b/x/crosschain/keeper/v2_zevm_inbound.go index 040bdec883..9efc5e1e2e 100644 --- a/x/crosschain/keeper/v2_zevm_inbound.go +++ b/x/crosschain/keeper/v2_zevm_inbound.go @@ -26,8 +26,7 @@ import ( func (k Keeper) ProcessZEVMInboundV2( ctx sdk.Context, log *ethtypes.Log, - gatewayAddr, - from ethcommon.Address, + gatewayAddr ethcommon.Address, txOrigin string, ) error { // try to parse a withdrawal event from the log @@ -68,12 +67,12 @@ func (k Keeper) ProcessZEVMInboundV2( // create inbound object depending on the event type if withdrawalEvent != nil { - inbound, err = k.newWithdrawalInbound(ctx, from, txOrigin, foreignCoin, withdrawalEvent) + inbound, err = k.newWithdrawalInbound(ctx, txOrigin, foreignCoin, withdrawalEvent) if err != nil { return err } } else { - inbound, err = k.newCallInbound(ctx, from, txOrigin, foreignCoin, gatewayEvent) + inbound, err = k.newCallInbound(ctx, txOrigin, foreignCoin, gatewayEvent) if err != nil { return err } @@ -159,7 +158,6 @@ func (k Keeper) parseGatewayCallEvent( // https://github.com/zeta-chain/node/issues/2658 func (k Keeper) newWithdrawalInbound( ctx sdk.Context, - from ethcommon.Address, txOrigin string, foreignCoin fungibletypes.ForeignCoins, event *gatewayzevm.GatewayZEVMWithdrawn, @@ -183,7 +181,7 @@ func (k Keeper) newWithdrawalInbound( return nil, errors.Wrapf(err, "cannot encode address %v", event.Receiver) } - gasLimit := event.GasLimit.Uint64() + gasLimit := event.CallOptions.GasLimit.Uint64() if gasLimit == 0 { gasLimitQueried, err := k.fungibleKeeper.QueryGasLimit( ctx, @@ -197,7 +195,7 @@ func (k Keeper) newWithdrawalInbound( return types.NewMsgVoteInbound( "", - from.Hex(), + event.Sender.Hex(), senderChain.ChainId, txOrigin, toAddr, @@ -211,6 +209,7 @@ func (k Keeper) newWithdrawalInbound( foreignCoin.Asset, event.Raw.Index, types.ProtocolContractVersion_V2, + event.CallOptions.IsArbitraryCall, types.WithZEVMRevertOptions(event.RevertOptions), ), nil } @@ -221,7 +220,6 @@ func (k Keeper) newWithdrawalInbound( // https://github.com/zeta-chain/node/issues/2658 func (k Keeper) newCallInbound( ctx sdk.Context, - from ethcommon.Address, txOrigin string, foreignCoin fungibletypes.ForeignCoins, event *gatewayzevm.GatewayZEVMCalled, @@ -245,7 +243,7 @@ func (k Keeper) newCallInbound( return nil, errors.Wrapf(err, "cannot encode address %v", event.Receiver) } - gasLimit := event.GasLimit.Uint64() + gasLimit := event.CallOptions.GasLimit.Uint64() if gasLimit == 0 { gasLimitQueried, err := k.fungibleKeeper.QueryGasLimit( ctx, @@ -259,7 +257,7 @@ func (k Keeper) newCallInbound( return types.NewMsgVoteInbound( "", - from.Hex(), + event.Sender.Hex(), senderChain.ChainId, txOrigin, toAddr, @@ -273,6 +271,7 @@ func (k Keeper) newCallInbound( "", event.Raw.Index, types.ProtocolContractVersion_V2, + event.CallOptions.IsArbitraryCall, types.WithZEVMRevertOptions(event.RevertOptions), ), nil } diff --git a/x/crosschain/types/cctx.go b/x/crosschain/types/cctx.go index 90b398210d..0a235dffae 100644 --- a/x/crosschain/types/cctx.go +++ b/x/crosschain/types/cctx.go @@ -40,10 +40,19 @@ func (m CrossChainTx) GetEVMAbortAddress() ethcommon.Address { // OutboundParams[0] is the original outbound, if it reverts, then // OutboundParams[1] is the new outbound. func (m CrossChainTx) GetCurrentOutboundParam() *OutboundParams { + // TODO: Deprecated (V21) gasLimit should be removed and CallOptions should be mandatory + // this should never happen, but since it is optional, adding it just in case if len(m.OutboundParams) == 0 { - return &OutboundParams{} + return &OutboundParams{CallOptions: &CallOptions{}} } - return m.OutboundParams[len(m.OutboundParams)-1] + + outboundParams := m.OutboundParams[len(m.OutboundParams)-1] + if outboundParams.CallOptions == nil { + outboundParams.CallOptions = &CallOptions{ + GasLimit: outboundParams.GasLimit, + } + } + return outboundParams } // IsCurrentOutboundRevert returns true if the current outbound is the revert tx. @@ -120,8 +129,10 @@ func (m *CrossChainTx) AddRevertOutbound(gasLimit uint64) error { Receiver: revertReceiver, ReceiverChainId: m.InboundParams.SenderChainId, Amount: m.GetCurrentOutboundParam().Amount, - GasLimit: gasLimit, - TssPubkey: m.GetCurrentOutboundParam().TssPubkey, + CallOptions: &CallOptions{ + GasLimit: gasLimit, + }, + TssPubkey: m.GetCurrentOutboundParam().TssPubkey, } // The original outbound has been finalized, the new outbound is pending m.GetCurrentOutboundParam().TxFinalizationStatus = TxFinalizationStatus_Executed @@ -229,11 +240,14 @@ func NewCCTX(ctx sdk.Context, msg MsgVoteInbound, tssPubkey string) (CrossChainT } outboundParams := &OutboundParams{ - Receiver: msg.Receiver, - ReceiverChainId: msg.ReceiverChain, - Hash: "", - TssNonce: 0, - GasLimit: msg.GasLimit, + Receiver: msg.Receiver, + ReceiverChainId: msg.ReceiverChain, + Hash: "", + TssNonce: 0, + CallOptions: &CallOptions{ + IsArbitraryCall: msg.CallOptions.IsArbitraryCall, + GasLimit: msg.CallOptions.GasLimit, + }, GasPrice: "", GasPriorityFee: "", BallotIndex: "", diff --git a/x/crosschain/types/cctx_test.go b/x/crosschain/types/cctx_test.go index 6317161196..0f2f84ac7b 100644 --- a/x/crosschain/types/cctx_test.go +++ b/x/crosschain/types/cctx_test.go @@ -81,16 +81,18 @@ func Test_NewCCTX(t *testing.T) { cointType := coin.CoinType_ERC20 tss := sample.Tss() msg := types.MsgVoteInbound{ - Creator: creator, - Sender: sender.String(), - SenderChainId: senderChain.ChainId, - Receiver: receiver.String(), - ReceiverChain: receiverChain.ChainId, - Amount: amount, - Message: message, - InboundHash: inboundHash.String(), - InboundBlockHeight: inboundBlockHeight, - GasLimit: gasLimit, + Creator: creator, + Sender: sender.String(), + SenderChainId: senderChain.ChainId, + Receiver: receiver.String(), + ReceiverChain: receiverChain.ChainId, + Amount: amount, + Message: message, + InboundHash: inboundHash.String(), + InboundBlockHeight: inboundBlockHeight, + CallOptions: &types.CallOptions{ + GasLimit: gasLimit, + }, CoinType: cointType, TxOrigin: sender.String(), Asset: asset, @@ -107,7 +109,7 @@ func Test_NewCCTX(t *testing.T) { require.Equal(t, message, cctx.RelayedMessage) require.Equal(t, inboundHash.String(), cctx.GetInboundParams().ObservedHash) require.Equal(t, inboundBlockHeight, cctx.GetInboundParams().ObservedExternalHeight) - require.Equal(t, gasLimit, cctx.GetCurrentOutboundParam().GasLimit) + require.Equal(t, gasLimit, cctx.GetCurrentOutboundParam().CallOptions.GasLimit) require.Equal(t, asset, cctx.GetInboundParams().Asset) require.Equal(t, cointType, cctx.InboundParams.CoinType) require.Equal(t, uint64(0), cctx.GetCurrentOutboundParam().TssNonce) @@ -143,11 +145,13 @@ func Test_NewCCTX(t *testing.T) { Message: message, InboundHash: inboundHash.String(), InboundBlockHeight: inboundBlockHeight, - GasLimit: gasLimit, - CoinType: cointType, - TxOrigin: sender.String(), - Asset: asset, - EventIndex: eventIndex, + CallOptions: &types.CallOptions{ + GasLimit: gasLimit, + }, + CoinType: cointType, + TxOrigin: sender.String(), + Asset: asset, + EventIndex: eventIndex, } _, err := types.NewCCTX(ctx, msg, tss.TssPubkey) require.ErrorContains(t, err, "sender cannot be empty") @@ -184,7 +188,7 @@ func TestCrossChainTx_GetCurrentOutboundParam(t *testing.T) { cctx := sample.CrossChainTx(t, "foo") cctx.OutboundParams = []*types.OutboundParams{} - require.Equal(t, &types.OutboundParams{}, cctx.GetCurrentOutboundParam()) + require.Equal(t, &types.OutboundParams{CallOptions: &types.CallOptions{}}, cctx.GetCurrentOutboundParam()) cctx.OutboundParams = []*types.OutboundParams{sample.OutboundParams(r)} require.Equal(t, cctx.OutboundParams[0], cctx.GetCurrentOutboundParam()) @@ -291,7 +295,7 @@ func Test_SetRevertOutboundValues(t *testing.T) { require.Equal(t, cctx.GetCurrentOutboundParam().Receiver, cctx.InboundParams.Sender) require.Equal(t, cctx.GetCurrentOutboundParam().ReceiverChainId, cctx.InboundParams.SenderChainId) require.Equal(t, cctx.GetCurrentOutboundParam().Amount, cctx.OutboundParams[0].Amount) - require.Equal(t, cctx.GetCurrentOutboundParam().GasLimit, uint64(100)) + require.Equal(t, cctx.GetCurrentOutboundParam().CallOptions.GasLimit, uint64(100)) require.Equal(t, cctx.GetCurrentOutboundParam().TssPubkey, cctx.OutboundParams[0].TssPubkey) require.Equal(t, types.TxFinalizationStatus_Executed, cctx.OutboundParams[0].TxFinalizationStatus) }) diff --git a/x/crosschain/types/cmd_cctxs.go b/x/crosschain/types/cmd_cctxs.go index 71ecaaf384..c2f01a9f1e 100644 --- a/x/crosschain/types/cmd_cctxs.go +++ b/x/crosschain/types/cmd_cctxs.go @@ -298,10 +298,12 @@ func newCmdCCTX( ReceiverChainId: chainID, CoinType: coin.CoinType_Cmd, Amount: amount, - GasLimit: gasLimit, - GasPrice: medianGasPrice, - GasPriorityFee: priorityFee, - TssPubkey: tssPubKey, + CallOptions: &CallOptions{ + GasLimit: gasLimit, + }, + GasPrice: medianGasPrice, + GasPriorityFee: priorityFee, + TssPubkey: tssPubKey, }, }, } diff --git a/x/crosschain/types/cmd_cctxs_test.go b/x/crosschain/types/cmd_cctxs_test.go index 1712989000..e7d02b9786 100644 --- a/x/crosschain/types/cmd_cctxs_test.go +++ b/x/crosschain/types/cmd_cctxs_test.go @@ -1,8 +1,10 @@ package types_test import ( - sdkmath "cosmossdk.io/math" "fmt" + "testing" + + sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/require" "github.com/zeta-chain/node/pkg/chains" "github.com/zeta-chain/node/pkg/coin" @@ -10,7 +12,6 @@ import ( "github.com/zeta-chain/node/pkg/gas" "github.com/zeta-chain/node/testutil/sample" "github.com/zeta-chain/node/x/crosschain/types" - "testing" ) func TestMigrateERC20CustodyFundsCmdCCTX(t *testing.T) { @@ -93,7 +94,7 @@ func TestMigrateERC20CustodyFundsCmdCCTX(t *testing.T) { require.EqualValues(t, chainID, cctx.OutboundParams[0].ReceiverChainId) require.EqualValues(t, coin.CoinType_Cmd, cctx.OutboundParams[0].CoinType) require.EqualValues(t, sdkmath.NewUint(0), cctx.OutboundParams[0].Amount) - require.EqualValues(t, 100_000, cctx.OutboundParams[0].GasLimit) + require.EqualValues(t, 100_000, cctx.OutboundParams[0].CallOptions.GasLimit) require.EqualValues(t, gasPrice, cctx.OutboundParams[0].GasPrice) require.EqualValues(t, priorityFee, cctx.OutboundParams[0].GasPriorityFee) require.EqualValues(t, tssPubKey, cctx.OutboundParams[0].TssPubkey) @@ -222,7 +223,7 @@ func TestUpdateERC20CustodyPauseStatusCmdCCTX(t *testing.T) { require.EqualValues(t, chainID, cctx.OutboundParams[0].ReceiverChainId) require.EqualValues(t, coin.CoinType_Cmd, cctx.OutboundParams[0].CoinType) require.EqualValues(t, sdkmath.NewUint(0), cctx.OutboundParams[0].Amount) - require.EqualValues(t, 100_000, cctx.OutboundParams[0].GasLimit) + require.EqualValues(t, 100_000, cctx.OutboundParams[0].CallOptions.GasLimit) require.EqualValues(t, gasPrice, cctx.OutboundParams[0].GasPrice) require.EqualValues(t, priorityFee, cctx.OutboundParams[0].GasPriorityFee) require.EqualValues(t, tssPubKey, cctx.OutboundParams[0].TssPubkey) @@ -317,7 +318,7 @@ func TestWhitelistERC20CmdCCTX(t *testing.T) { require.EqualValues(t, chainID, cctx.OutboundParams[0].ReceiverChainId) require.EqualValues(t, coin.CoinType_Cmd, cctx.OutboundParams[0].CoinType) require.EqualValues(t, sdkmath.NewUint(0), cctx.OutboundParams[0].Amount) - require.EqualValues(t, 100_000, cctx.OutboundParams[0].GasLimit) + require.EqualValues(t, 100_000, cctx.OutboundParams[0].CallOptions.GasLimit) require.EqualValues(t, gasPrice, cctx.OutboundParams[0].GasPrice) require.EqualValues(t, priorityFee, cctx.OutboundParams[0].GasPriorityFee) require.EqualValues(t, tssPubKey, cctx.OutboundParams[0].TssPubkey) @@ -371,7 +372,7 @@ func TestMigrateFundCmdCCTX(t *testing.T) { require.EqualValues(t, chains.Ethereum.ChainId, cctx.OutboundParams[0].ReceiverChainId) require.EqualValues(t, coin.CoinType_Cmd, cctx.OutboundParams[0].CoinType) require.False(t, cctx.OutboundParams[0].Amount.IsZero()) - require.EqualValues(t, gas.EVMSend, cctx.OutboundParams[0].GasLimit) + require.EqualValues(t, gas.EVMSend, cctx.OutboundParams[0].CallOptions.GasLimit) require.NotEmpty(t, cctx.OutboundParams[0].GasPrice) require.NotEmpty(t, cctx.OutboundParams[0].GasPriorityFee) }) @@ -419,7 +420,7 @@ func TestMigrateFundCmdCCTX(t *testing.T) { require.EqualValues(t, chains.BitcoinMainnet.ChainId, cctx.OutboundParams[0].ReceiverChainId) require.EqualValues(t, coin.CoinType_Cmd, cctx.OutboundParams[0].CoinType) require.False(t, cctx.OutboundParams[0].Amount.IsZero()) - require.EqualValues(t, uint64(1_000_000), cctx.OutboundParams[0].GasLimit) + require.EqualValues(t, uint64(1_000_000), cctx.OutboundParams[0].CallOptions.GasLimit) require.NotEmpty(t, cctx.OutboundParams[0].GasPrice) require.NotEmpty(t, cctx.OutboundParams[0].GasPriorityFee) }) diff --git a/x/crosschain/types/cross_chain_tx.pb.go b/x/crosschain/types/cross_chain_tx.pb.go index a0fbdab126..842ba310ba 100644 --- a/x/crosschain/types/cross_chain_tx.pb.go +++ b/x/crosschain/types/cross_chain_tx.pb.go @@ -274,15 +274,68 @@ func (m *ZetaAccounting) XXX_DiscardUnknown() { var xxx_messageInfo_ZetaAccounting proto.InternalMessageInfo +type CallOptions struct { + GasLimit uint64 `protobuf:"varint,1,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + IsArbitraryCall bool `protobuf:"varint,2,opt,name=is_arbitrary_call,json=isArbitraryCall,proto3" json:"is_arbitrary_call,omitempty"` +} + +func (m *CallOptions) Reset() { *m = CallOptions{} } +func (m *CallOptions) String() string { return proto.CompactTextString(m) } +func (*CallOptions) ProtoMessage() {} +func (*CallOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_d4c1966807fb5cb2, []int{2} +} +func (m *CallOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CallOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CallOptions.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CallOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_CallOptions.Merge(m, src) +} +func (m *CallOptions) XXX_Size() int { + return m.Size() +} +func (m *CallOptions) XXX_DiscardUnknown() { + xxx_messageInfo_CallOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_CallOptions proto.InternalMessageInfo + +func (m *CallOptions) GetGasLimit() uint64 { + if m != nil { + return m.GasLimit + } + return 0 +} + +func (m *CallOptions) GetIsArbitraryCall() bool { + if m != nil { + return m.IsArbitraryCall + } + return false +} + type OutboundParams struct { Receiver string `protobuf:"bytes,1,opt,name=receiver,proto3" json:"receiver,omitempty"` ReceiverChainId int64 `protobuf:"varint,2,opt,name=receiver_chainId,json=receiverChainId,proto3" json:"receiver_chainId,omitempty"` CoinType coin.CoinType `protobuf:"varint,3,opt,name=coin_type,json=coinType,proto3,enum=zetachain.zetacore.pkg.coin.CoinType" json:"coin_type,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Uint `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Uint" json:"amount"` TssNonce uint64 `protobuf:"varint,5,opt,name=tss_nonce,json=tssNonce,proto3" json:"tss_nonce,omitempty"` - GasLimit uint64 `protobuf:"varint,6,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - GasPrice string `protobuf:"bytes,7,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` - GasPriorityFee string `protobuf:"bytes,23,opt,name=gas_priority_fee,json=gasPriorityFee,proto3" json:"gas_priority_fee,omitempty"` + // Deprecated (v21), use CallOptions + GasLimit uint64 `protobuf:"varint,6,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + GasPrice string `protobuf:"bytes,7,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` + GasPriorityFee string `protobuf:"bytes,23,opt,name=gas_priority_fee,json=gasPriorityFee,proto3" json:"gas_priority_fee,omitempty"` // the above are commands for zetaclients // the following fields are used when the outbound tx is mined Hash string `protobuf:"bytes,8,opt,name=hash,proto3" json:"hash,omitempty"` @@ -293,13 +346,14 @@ type OutboundParams struct { EffectiveGasLimit uint64 `protobuf:"varint,22,opt,name=effective_gas_limit,json=effectiveGasLimit,proto3" json:"effective_gas_limit,omitempty"` TssPubkey string `protobuf:"bytes,11,opt,name=tss_pubkey,json=tssPubkey,proto3" json:"tss_pubkey,omitempty"` TxFinalizationStatus TxFinalizationStatus `protobuf:"varint,12,opt,name=tx_finalization_status,json=txFinalizationStatus,proto3,enum=zetachain.zetacore.crosschain.TxFinalizationStatus" json:"tx_finalization_status,omitempty"` + CallOptions *CallOptions `protobuf:"bytes,24,opt,name=call_options,json=callOptions,proto3" json:"call_options,omitempty"` } func (m *OutboundParams) Reset() { *m = OutboundParams{} } func (m *OutboundParams) String() string { return proto.CompactTextString(m) } func (*OutboundParams) ProtoMessage() {} func (*OutboundParams) Descriptor() ([]byte, []int) { - return fileDescriptor_d4c1966807fb5cb2, []int{2} + return fileDescriptor_d4c1966807fb5cb2, []int{3} } func (m *OutboundParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -426,6 +480,13 @@ func (m *OutboundParams) GetTxFinalizationStatus() TxFinalizationStatus { return TxFinalizationStatus_NotFinalized } +func (m *OutboundParams) GetCallOptions() *CallOptions { + if m != nil { + return m.CallOptions + } + return nil +} + type Status struct { Status CctxStatus `protobuf:"varint,1,opt,name=status,proto3,enum=zetachain.zetacore.crosschain.CctxStatus" json:"status,omitempty"` StatusMessage string `protobuf:"bytes,2,opt,name=status_message,json=statusMessage,proto3" json:"status_message,omitempty"` @@ -439,7 +500,7 @@ func (m *Status) Reset() { *m = Status{} } func (m *Status) String() string { return proto.CompactTextString(m) } func (*Status) ProtoMessage() {} func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_d4c1966807fb5cb2, []int{3} + return fileDescriptor_d4c1966807fb5cb2, []int{4} } func (m *Status) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -516,7 +577,7 @@ func (m *RevertOptions) Reset() { *m = RevertOptions{} } func (m *RevertOptions) String() string { return proto.CompactTextString(m) } func (*RevertOptions) ProtoMessage() {} func (*RevertOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_d4c1966807fb5cb2, []int{4} + return fileDescriptor_d4c1966807fb5cb2, []int{5} } func (m *RevertOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -589,7 +650,7 @@ func (m *CrossChainTx) Reset() { *m = CrossChainTx{} } func (m *CrossChainTx) String() string { return proto.CompactTextString(m) } func (*CrossChainTx) ProtoMessage() {} func (*CrossChainTx) Descriptor() ([]byte, []int) { - return fileDescriptor_d4c1966807fb5cb2, []int{5} + return fileDescriptor_d4c1966807fb5cb2, []int{6} } func (m *CrossChainTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -680,6 +741,7 @@ func init() { proto.RegisterEnum("zetachain.zetacore.crosschain.ProtocolContractVersion", ProtocolContractVersion_name, ProtocolContractVersion_value) proto.RegisterType((*InboundParams)(nil), "zetachain.zetacore.crosschain.InboundParams") proto.RegisterType((*ZetaAccounting)(nil), "zetachain.zetacore.crosschain.ZetaAccounting") + proto.RegisterType((*CallOptions)(nil), "zetachain.zetacore.crosschain.CallOptions") proto.RegisterType((*OutboundParams)(nil), "zetachain.zetacore.crosschain.OutboundParams") proto.RegisterType((*Status)(nil), "zetachain.zetacore.crosschain.Status") proto.RegisterType((*RevertOptions)(nil), "zetachain.zetacore.crosschain.RevertOptions") @@ -691,88 +753,92 @@ func init() { } var fileDescriptor_d4c1966807fb5cb2 = []byte{ - // 1291 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6f, 0x13, 0xc7, - 0x17, 0xcf, 0x26, 0x8e, 0x63, 0x3f, 0xff, 0xc8, 0x32, 0x31, 0x61, 0xc9, 0x57, 0x98, 0x7c, 0xdd, - 0x02, 0x86, 0x36, 0xb6, 0x08, 0x52, 0x55, 0xf5, 0x96, 0x44, 0x04, 0xd2, 0x16, 0x12, 0x2d, 0x01, - 0x09, 0x0e, 0xdd, 0x8e, 0x77, 0x5f, 0xd6, 0xa3, 0xd8, 0x3b, 0xee, 0xce, 0x38, 0x72, 0x50, 0x6f, - 0x3d, 0x57, 0x6a, 0xff, 0x87, 0x1e, 0x7a, 0xec, 0x9f, 0xc1, 0x91, 0x63, 0xd5, 0x03, 0xaa, 0xe0, - 0x3f, 0xe8, 0xb9, 0x87, 0x6a, 0x7e, 0xac, 0x1d, 0xa3, 0x34, 0xa1, 0xb4, 0xa7, 0x9d, 0xf9, 0xbc, - 0x79, 0x9f, 0x37, 0xfb, 0xe6, 0xf3, 0xde, 0x0c, 0xac, 0x3f, 0x47, 0x49, 0xc3, 0x2e, 0x65, 0x49, - 0x5b, 0x8f, 0x78, 0x8a, 0xed, 0x30, 0xe5, 0x42, 0x18, 0x4c, 0x0f, 0x03, 0x3d, 0x0e, 0xe4, 0xa8, - 0x35, 0x48, 0xb9, 0xe4, 0xe4, 0xca, 0xd8, 0xa7, 0x95, 0xf9, 0xb4, 0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3b, 0x87, 0x78, - 0xac, 0xab, 0xaa, 0xe8, 0xab, 0xe3, 0xda, 0xd3, 0xc0, 0x19, 0x05, 0x58, 0xfe, 0x8f, 0x0b, 0xf0, - 0xf3, 0x5c, 0xa1, 0xe2, 0xd6, 0x1a, 0x7f, 0x3a, 0x90, 0x37, 0x00, 0xd9, 0x80, 0xbc, 0x8d, 0xe5, - 0xe8, 0x58, 0x37, 0xcf, 0x89, 0xb5, 0x15, 0xca, 0x91, 0x8d, 0x60, 0x1d, 0xc9, 0x35, 0xa8, 0x9a, - 0x51, 0xd0, 0x47, 0x21, 0x68, 0x8c, 0xba, 0x60, 0x8a, 0x7e, 0xc5, 0xa0, 0x0f, 0x0c, 0x48, 0x6e, - 0x43, 0xad, 0x47, 0x85, 0x7c, 0x3c, 0x88, 0xa8, 0xc4, 0x40, 0xb2, 0x3e, 0x0a, 0x49, 0xfb, 0x03, - 0x5d, 0x39, 0x73, 0xfe, 0xd2, 0xc4, 0xb6, 0x9f, 0x99, 0x48, 0x13, 0x16, 0x99, 0xd8, 0x50, 0x25, - 0xed, 0xe3, 0xc1, 0x30, 0x89, 0x30, 0xd2, 0x65, 0x52, 0xf0, 0xdf, 0x86, 0xc9, 0x47, 0x70, 0x21, - 0x4c, 0x91, 0xaa, 0x36, 0x32, 0x61, 0x9e, 0xd7, 0xcc, 0xae, 0x35, 0x8c, 0x69, 0x1b, 0xdf, 0xcd, - 0x42, 0xc5, 0xc7, 0x23, 0x4c, 0xe5, 0xee, 0x40, 0xe5, 0x46, 0xff, 0x42, 0xaa, 0x81, 0x80, 0x46, - 0x51, 0x8a, 0x42, 0xd8, 0xbe, 0x50, 0x31, 0xe8, 0x86, 0x01, 0xc9, 0x87, 0x50, 0x0d, 0x69, 0xaf, - 0x17, 0xf0, 0x24, 0x30, 0x06, 0xfd, 0xa7, 0x05, 0xbf, 0xac, 0xd0, 0xdd, 0xc4, 0x70, 0xaa, 0x5b, - 0x40, 0xb7, 0xa1, 0x31, 0x97, 0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, 0x5d, 0x77, 0x7e, 0x7f, 0x5d, 0x77, 0x7e, 0x78, 0x53, 0x9f, 0x79, 0xf9, 0xa6, 0x3e, 0xf3, - 0xeb, 0x9b, 0xfa, 0xcc, 0xb3, 0xb5, 0x13, 0x95, 0xa4, 0x12, 0xbb, 0x66, 0x1e, 0xe6, 0x09, 0x8f, - 0xb0, 0x3d, 0x3a, 0xf9, 0xfe, 0xd7, 0x45, 0xd5, 0xc9, 0xeb, 0x83, 0xbb, 0xf3, 0x57, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x9b, 0xa4, 0xfd, 0xc5, 0x2d, 0x0c, 0x00, 0x00, + // 1348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4d, 0x6f, 0x1b, 0x37, + 0x13, 0xf6, 0xda, 0xb2, 0x2c, 0x8d, 0x3e, 0xbc, 0xa6, 0x15, 0x67, 0xe3, 0x17, 0x51, 0xfc, 0xaa, + 0x75, 0xa2, 0xb8, 0xb5, 0x84, 0x28, 0x40, 0x51, 0xf4, 0x66, 0x1b, 0x71, 0xe2, 0xb6, 0x89, 0x8d, + 0x8d, 0x63, 0x20, 0x39, 0x74, 0x4b, 0xed, 0xd2, 0x12, 0xe1, 0xd5, 0x52, 0x5d, 0x52, 0x86, 0x14, + 0xf4, 0xd6, 0x73, 0x81, 0xfe, 0x88, 0x1e, 0x7a, 0xec, 0xcf, 0xc8, 0x31, 0xc7, 0xa2, 0x87, 0x20, + 0x48, 0xfe, 0x41, 0xcf, 0x3d, 0x14, 0xfc, 0x92, 0xac, 0xc0, 0xb5, 0xd3, 0xb4, 0x27, 0x71, 0x66, + 0x38, 0xcf, 0xcc, 0x0e, 0xe7, 0x19, 0x52, 0xd0, 0x7a, 0x4e, 0x04, 0x0e, 0xbb, 0x98, 0x26, 0x4d, + 0xb5, 0x62, 0x29, 0x69, 0x86, 0x29, 0xe3, 0x5c, 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x0a, 0xb0, 0xb0, 0xa5, 0xdf, 0x33, 0x6e, 0x76, 0x35, 0xf3, 0xcb, 0xcf, 0x55, + 0x67, 0xe3, 0x2b, 0xa8, 0x9c, 0x37, 0x95, 0x91, 0x0b, 0xc5, 0x47, 0x4c, 0xec, 0xda, 0xd7, 0x9d, + 0x3b, 0x83, 0x4a, 0x90, 0x9f, 0x88, 0x8e, 0x44, 0xbe, 0x37, 0x24, 0xe1, 0x40, 0x82, 0xcd, 0x1a, + 0xb0, 0x26, 0x5c, 0xfd, 0x9b, 0xca, 0xa2, 0x2c, 0xcc, 0x1e, 0xdd, 0x71, 0x67, 0xd4, 0x6f, 0xcb, + 0x75, 0xb4, 0xc3, 0xf6, 0xfd, 0x17, 0x6f, 0xaa, 0xce, 0xcb, 0x37, 0x55, 0xe7, 0xf5, 0x9b, 0xaa, + 0xf3, 0xd3, 0xdb, 0xea, 0xcc, 0xcb, 0xb7, 0xd5, 0x99, 0xdf, 0xde, 0x56, 0x67, 0x9e, 0x6d, 0x9e, + 0x61, 0x92, 0x2c, 0xec, 0xa6, 0xfe, 0xff, 0x90, 0xb0, 0x88, 0x34, 0x87, 0x67, 0xff, 0xa6, 0x28, + 0x52, 0xb5, 0xb3, 0xea, 0xe0, 0xee, 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0x94, 0x4b, 0x30, 0xb4, + 0xd4, 0x0c, 0x00, 0x00, } func (m *InboundParams) Marshal() (dAtA []byte, err error) { @@ -901,6 +967,44 @@ func (m *ZetaAccounting) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *CallOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CallOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CallOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsArbitraryCall { + i-- + if m.IsArbitraryCall { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.GasLimit != 0 { + i = encodeVarintCrossChainTx(dAtA, i, uint64(m.GasLimit)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *OutboundParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -921,6 +1025,20 @@ func (m *OutboundParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.CallOptions != nil { + { + size, err := m.CallOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrossChainTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } if len(m.GasPriorityFee) > 0 { i -= len(m.GasPriorityFee) copy(dAtA[i:], m.GasPriorityFee) @@ -1328,6 +1446,21 @@ func (m *ZetaAccounting) Size() (n int) { return n } +func (m *CallOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GasLimit != 0 { + n += 1 + sovCrossChainTx(uint64(m.GasLimit)) + } + if m.IsArbitraryCall { + n += 2 + } + return n +} + func (m *OutboundParams) Size() (n int) { if m == nil { return 0 @@ -1386,6 +1519,10 @@ func (m *OutboundParams) Size() (n int) { if l > 0 { n += 2 + l + sovCrossChainTx(uint64(l)) } + if m.CallOptions != nil { + l = m.CallOptions.Size() + n += 2 + l + sovCrossChainTx(uint64(l)) + } return n } @@ -1911,6 +2048,95 @@ func (m *ZetaAccounting) Unmarshal(dAtA []byte) error { } return nil } +func (m *CallOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrossChainTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CallOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CallOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) + } + m.GasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrossChainTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsArbitraryCall", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrossChainTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsArbitraryCall = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipCrossChainTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrossChainTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *OutboundParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2352,6 +2578,42 @@ func (m *OutboundParams) Unmarshal(dAtA []byte) error { } m.GasPriorityFee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrossChainTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrossChainTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrossChainTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CallOptions == nil { + m.CallOptions = &CallOptions{} + } + if err := m.CallOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCrossChainTx(dAtA[iNdEx:]) diff --git a/x/crosschain/types/message_vote_inbound.go b/x/crosschain/types/message_vote_inbound.go index 8592b7e607..c73c9a24d4 100644 --- a/x/crosschain/types/message_vote_inbound.go +++ b/x/crosschain/types/message_vote_inbound.go @@ -56,20 +56,24 @@ func NewMsgVoteInbound( asset string, eventIndex uint, protocolContractVersion ProtocolContractVersion, + isArbitraryCall bool, options ...InboundVoteOption, ) *MsgVoteInbound { msg := &MsgVoteInbound{ - Creator: creator, - Sender: sender, - SenderChainId: senderChain, - TxOrigin: txOrigin, - Receiver: receiver, - ReceiverChain: receiverChain, - Amount: amount, - Message: message, - InboundHash: inboundHash, - InboundBlockHeight: inboundBlockHeight, - GasLimit: gasLimit, + Creator: creator, + Sender: sender, + SenderChainId: senderChain, + TxOrigin: txOrigin, + Receiver: receiver, + ReceiverChain: receiverChain, + Amount: amount, + Message: message, + InboundHash: inboundHash, + InboundBlockHeight: inboundBlockHeight, + CallOptions: &CallOptions{ + GasLimit: gasLimit, + IsArbitraryCall: isArbitraryCall, + }, CoinType: coinType, Asset: asset, EventIndex: uint64(eventIndex), diff --git a/x/crosschain/types/message_vote_inbound_test.go b/x/crosschain/types/message_vote_inbound_test.go index c7fbcbb531..77631f20fd 100644 --- a/x/crosschain/types/message_vote_inbound_test.go +++ b/x/crosschain/types/message_vote_inbound_test.go @@ -1,12 +1,13 @@ package types_test import ( - "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayevm.sol" - "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" "math/big" "math/rand" "testing" + "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayevm.sol" + "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -36,6 +37,7 @@ func TestNewMsgVoteInbound(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, ) require.EqualValues(t, types.NewEmptyRevertOptions(), msg.RevertOptions) }) @@ -61,6 +63,7 @@ func TestNewMsgVoteInbound(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, types.WithZEVMRevertOptions(gatewayzevm.RevertOptions{ RevertAddress: revertAddress, CallOnRevert: true, @@ -94,6 +97,7 @@ func TestNewMsgVoteInbound(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, types.WithZEVMRevertOptions(gatewayzevm.RevertOptions{ RevertAddress: revertAddress, CallOnRevert: true, @@ -131,6 +135,7 @@ func TestNewMsgVoteInbound(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, types.WithEVMRevertOptions(gatewayevm.RevertOptions{ RevertAddress: revertAddress, CallOnRevert: true, @@ -163,6 +168,7 @@ func TestNewMsgVoteInbound(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, types.WithEVMRevertOptions(gatewayevm.RevertOptions{ RevertAddress: revertAddress, CallOnRevert: true, @@ -206,6 +212,7 @@ func TestMsgVoteInbound_ValidateBasic(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, ), }, { @@ -226,6 +233,7 @@ func TestMsgVoteInbound_ValidateBasic(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, ), err: sdkerrors.ErrInvalidAddress, }, @@ -247,6 +255,7 @@ func TestMsgVoteInbound_ValidateBasic(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, ), err: types.ErrInvalidChainID, }, @@ -268,6 +277,7 @@ func TestMsgVoteInbound_ValidateBasic(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, ), err: types.ErrInvalidChainID, }, @@ -289,6 +299,7 @@ func TestMsgVoteInbound_ValidateBasic(t *testing.T) { sample.String(), 42, types.ProtocolContractVersion_V1, + true, ), err: sdkerrors.ErrInvalidRequest, }, @@ -309,17 +320,19 @@ func TestMsgVoteInbound_Digest(t *testing.T) { r := rand.New(rand.NewSource(42)) msg := types.MsgVoteInbound{ - Creator: sample.AccAddress(), - Sender: sample.AccAddress(), - SenderChainId: 42, - TxOrigin: sample.String(), - Receiver: sample.String(), - ReceiverChain: 42, - Amount: math.NewUint(42), - Message: sample.String(), - InboundHash: sample.String(), - InboundBlockHeight: 42, - GasLimit: 42, + Creator: sample.AccAddress(), + Sender: sample.AccAddress(), + SenderChainId: 42, + TxOrigin: sample.String(), + Receiver: sample.String(), + ReceiverChain: 42, + Amount: math.NewUint(42), + Message: sample.String(), + InboundHash: sample.String(), + InboundBlockHeight: 42, + CallOptions: &types.CallOptions{ + GasLimit: 42, + }, CoinType: coin.CoinType_Zeta, Asset: sample.String(), EventIndex: 42, @@ -390,7 +403,7 @@ func TestMsgVoteInbound_Digest(t *testing.T) { // gas limit used msg = msg - msg.GasLimit = 43 + msg.CallOptions.GasLimit = 43 hash2 = msg.Digest() require.NotEqual(t, hash, hash2, "gas limit should change hash") diff --git a/x/crosschain/types/tx.pb.go b/x/crosschain/types/tx.pb.go index 6c75354214..7496f74404 100644 --- a/x/crosschain/types/tx.pb.go +++ b/x/crosschain/types/tx.pb.go @@ -988,19 +988,21 @@ type MsgVoteInbound struct { // string zeta_burnt = 6; Amount github_com_cosmos_cosmos_sdk_types.Uint `protobuf:"bytes,6,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Uint" json:"amount"` // string mMint = 7; - Message string `protobuf:"bytes,8,opt,name=message,proto3" json:"message,omitempty"` - InboundHash string `protobuf:"bytes,9,opt,name=inbound_hash,json=inboundHash,proto3" json:"inbound_hash,omitempty"` - InboundBlockHeight uint64 `protobuf:"varint,10,opt,name=inbound_block_height,json=inboundBlockHeight,proto3" json:"inbound_block_height,omitempty"` - GasLimit uint64 `protobuf:"varint,11,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - CoinType coin.CoinType `protobuf:"varint,12,opt,name=coin_type,json=coinType,proto3,enum=zetachain.zetacore.pkg.coin.CoinType" json:"coin_type,omitempty"` - TxOrigin string `protobuf:"bytes,13,opt,name=tx_origin,json=txOrigin,proto3" json:"tx_origin,omitempty"` - Asset string `protobuf:"bytes,14,opt,name=asset,proto3" json:"asset,omitempty"` + Message string `protobuf:"bytes,8,opt,name=message,proto3" json:"message,omitempty"` + InboundHash string `protobuf:"bytes,9,opt,name=inbound_hash,json=inboundHash,proto3" json:"inbound_hash,omitempty"` + InboundBlockHeight uint64 `protobuf:"varint,10,opt,name=inbound_block_height,json=inboundBlockHeight,proto3" json:"inbound_block_height,omitempty"` + // Deprecated (v21), use CallOptions + GasLimit uint64 `protobuf:"varint,11,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + CoinType coin.CoinType `protobuf:"varint,12,opt,name=coin_type,json=coinType,proto3,enum=zetachain.zetacore.pkg.coin.CoinType" json:"coin_type,omitempty"` + TxOrigin string `protobuf:"bytes,13,opt,name=tx_origin,json=txOrigin,proto3" json:"tx_origin,omitempty"` + Asset string `protobuf:"bytes,14,opt,name=asset,proto3" json:"asset,omitempty"` // event index of the sent asset in the observed tx EventIndex uint64 `protobuf:"varint,15,opt,name=event_index,json=eventIndex,proto3" json:"event_index,omitempty"` // protocol contract version to use for the cctx workflow ProtocolContractVersion ProtocolContractVersion `protobuf:"varint,16,opt,name=protocol_contract_version,json=protocolContractVersion,proto3,enum=zetachain.zetacore.crosschain.ProtocolContractVersion" json:"protocol_contract_version,omitempty"` // revert options provided by the sender RevertOptions RevertOptions `protobuf:"bytes,17,opt,name=revert_options,json=revertOptions,proto3" json:"revert_options"` + CallOptions *CallOptions `protobuf:"bytes,18,opt,name=call_options,json=callOptions,proto3" json:"call_options,omitempty"` } func (m *MsgVoteInbound) Reset() { *m = MsgVoteInbound{} } @@ -1141,6 +1143,13 @@ func (m *MsgVoteInbound) GetRevertOptions() RevertOptions { return RevertOptions{} } +func (m *MsgVoteInbound) GetCallOptions() *CallOptions { + if m != nil { + return m.CallOptions + } + return nil +} + type MsgVoteInboundResponse struct { } @@ -1706,119 +1715,120 @@ func init() { } var fileDescriptor_15f0860550897740 = []byte{ - // 1782 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x6f, 0xdb, 0xc8, - 0x15, 0x37, 0xd7, 0xb2, 0x2c, 0x3d, 0xd9, 0xb2, 0xcd, 0x75, 0x6c, 0x99, 0x5e, 0xcb, 0x8e, 0xd2, - 0xb8, 0x46, 0x11, 0x4b, 0xae, 0xb2, 0x4d, 0xb7, 0xde, 0xa2, 0xdb, 0x58, 0xbb, 0xf1, 0xba, 0x88, - 0x12, 0x83, 0xeb, 0x6c, 0x3f, 0x2e, 0x04, 0x45, 0x8e, 0x69, 0xc2, 0x12, 0x47, 0xe0, 0x8c, 0xb4, - 0x72, 0x50, 0xa0, 0x45, 0x81, 0x02, 0x3d, 0xb6, 0x45, 0x4f, 0x39, 0xf4, 0x56, 0xa0, 0xfd, 0x4f, - 0x72, 0x0c, 0x7a, 0x2a, 0x7a, 0x08, 0x8a, 0xe4, 0xd4, 0x5b, 0xdb, 0x6b, 0x2f, 0x05, 0xdf, 0x0c, - 0x19, 0x89, 0xfa, 0xb4, 0x8c, 0x62, 0x2f, 0x16, 0xe7, 0xf1, 0xfd, 0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0x6a, 0x64, 0x82, 0x2d, 0xf6, 0xc5, 0x27, 0x7e, 0x8f, 0xda, 0xa4, 0xd4, 0xe9, 0xf9, 0x4f, 0x48, - 0xd0, 0xd3, 0xd4, 0x92, 0x38, 0x0c, 0xdc, 0xff, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x52, - 0x23, 0x18, 0x37, 0x19, 0x00, 0x00, + // 1807 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0x4f, 0x6f, 0x23, 0x49, + 0x15, 0x4f, 0x6f, 0x1c, 0xc7, 0x7e, 0x4e, 0x9c, 0xa4, 0x37, 0x93, 0x38, 0x9d, 0x8d, 0x93, 0xf1, + 0x30, 0x21, 0x5a, 0x4d, 0xec, 0xe0, 0x59, 0x86, 0x25, 0x8b, 0x58, 0x26, 0xde, 0x9d, 0x6c, 0xd0, + 0x78, 0x26, 0xea, 0xcd, 0x2c, 0x7f, 0x2e, 0xad, 0x76, 0x77, 0xa5, 0xd3, 0x8a, 0xdd, 0x65, 0x75, + 0x95, 0xbd, 0xce, 0x08, 0x09, 0x84, 0x84, 0xc4, 0x11, 0x10, 0xa7, 0x3d, 0x70, 0x43, 0x82, 0x6f, + 0xc0, 0x47, 0xd8, 0xe3, 0x88, 0x13, 0xe2, 0x30, 0x42, 0x33, 0x5f, 0x00, 0xb8, 0x72, 0x41, 0xfd, + 0xaa, 0xba, 0x63, 0xb7, 0xff, 0xc6, 0x11, 0xe2, 0x92, 0xee, 0x7a, 0xfd, 0x7e, 0xef, 0x5f, 0xbd, + 0xaa, 0xf7, 0x9e, 0x03, 0xbb, 0x2f, 0x09, 0x37, 0xad, 0x0b, 0xd3, 0xf5, 0x4a, 0xf8, 0x46, 0x7d, + 0x52, 0xb2, 0x7c, 0xca, 0x98, 0xa0, 0xf1, 0x4e, 0xb1, 0xe9, 0x53, 0x4e, 0xd5, 0xad,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75, 0x7a, 0xfe, 0xb1, 0x12, 0xf4, 0x34, 0xb5, 0x24, 0xce, 0x16, + 0x0f, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x68, 0xfd, 0xc9, 0x86, 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3076,6 +3086,20 @@ func (m *MsgVoteInbound) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.CallOptions != nil { + { + size, err := m.CallOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } { size, err := m.RevertOptions.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -3944,6 +3968,10 @@ func (m *MsgVoteInbound) Size() (n int) { } l = m.RevertOptions.Size() n += 2 + l + sovTx(uint64(l)) + if m.CallOptions != nil { + l = m.CallOptions.Size() + n += 2 + l + sovTx(uint64(l)) + } return n } @@ -6637,6 +6665,42 @@ func (m *MsgVoteInbound) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CallOptions == nil { + m.CallOptions = &CallOptions{} + } + if err := m.CallOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/zetaclient/chains/bitcoin/signer/signer.go b/zetaclient/chains/bitcoin/signer/signer.go index 128b75b537..7e49d4d675 100644 --- a/zetaclient/chains/bitcoin/signer/signer.go +++ b/zetaclient/chains/bitcoin/signer/signer.go @@ -384,7 +384,7 @@ func (signer *Signer) TryProcessOutbound( } // get size limit and gas price - sizelimit := params.GasLimit + sizelimit := params.CallOptions.GasLimit gasprice, ok := new(big.Int).SetString(params.GasPrice, 10) if !ok || gasprice.Cmp(big.NewInt(0)) < 0 { logger.Error().Msgf("cannot convert gas price %s ", params.GasPrice) diff --git a/zetaclient/chains/evm/observer/v2_inbound.go b/zetaclient/chains/evm/observer/v2_inbound.go index 8259abf28b..246dda603a 100644 --- a/zetaclient/chains/evm/observer/v2_inbound.go +++ b/zetaclient/chains/evm/observer/v2_inbound.go @@ -191,6 +191,7 @@ func (ob *Observer) newDepositInboundVote(event *gatewayevm.GatewayEVMDeposited) event.Asset.Hex(), event.Raw.Index, types.ProtocolContractVersion_V2, + false, // currently not relevant since calls are not arbitrary types.WithEVMRevertOptions(event.RevertOptions), ) } @@ -325,6 +326,7 @@ func (ob *Observer) newCallInboundVote(event *gatewayevm.GatewayEVMCalled) types "", event.Raw.Index, types.ProtocolContractVersion_V2, + false, // currently not relevant since calls are not arbitrary types.WithEVMRevertOptions(event.RevertOptions), ) } diff --git a/zetaclient/chains/evm/signer/gas.go b/zetaclient/chains/evm/signer/gas.go index 932900f46c..540302b91c 100644 --- a/zetaclient/chains/evm/signer/gas.go +++ b/zetaclient/chains/evm/signer/gas.go @@ -64,20 +64,20 @@ func (g Gas) isLegacy() bool { func gasFromCCTX(cctx *types.CrossChainTx, logger zerolog.Logger) (Gas, error) { var ( params = cctx.GetCurrentOutboundParam() - limit = params.GasLimit + limit = params.CallOptions.GasLimit ) switch { case limit < minGasLimit: limit = minGasLimit logger.Warn(). - Uint64("cctx.initial_gas_limit", params.GasLimit). + Uint64("cctx.initial_gas_limit", params.CallOptions.GasLimit). Uint64("cctx.gas_limit", limit). Msgf("Gas limit is too low. Setting to the minimum (%d)", minGasLimit) case limit > maxGasLimit: limit = maxGasLimit logger.Warn(). - Uint64("cctx.initial_gas_limit", params.GasLimit). + Uint64("cctx.initial_gas_limit", params.CallOptions.GasLimit). Uint64("cctx.gas_limit", limit). Msgf("Gas limit is too high; Setting to the maximum (%d)", maxGasLimit) } diff --git a/zetaclient/chains/evm/signer/gas_test.go b/zetaclient/chains/evm/signer/gas_test.go index 5b75ad39bf..71bbf97b5d 100644 --- a/zetaclient/chains/evm/signer/gas_test.go +++ b/zetaclient/chains/evm/signer/gas_test.go @@ -14,7 +14,7 @@ func TestGasFromCCTX(t *testing.T) { makeCCTX := func(gasLimit uint64, price, priorityFee string) *types.CrossChainTx { cctx := getCCTX(t) - cctx.GetOutboundParams()[0].GasLimit = gasLimit + cctx.GetOutboundParams()[0].CallOptions.GasLimit = gasLimit cctx.GetOutboundParams()[0].GasPrice = price cctx.GetOutboundParams()[0].GasPriorityFee = priorityFee diff --git a/zetaclient/chains/evm/signer/outbound_data.go b/zetaclient/chains/evm/signer/outbound_data.go index 8315b89d94..0cc65c19e2 100644 --- a/zetaclient/chains/evm/signer/outbound_data.go +++ b/zetaclient/chains/evm/signer/outbound_data.go @@ -191,7 +191,7 @@ func getDestination(cctx *types.CrossChainTx, logger zerolog.Logger) (ethcommon. } func validateParams(params *types.OutboundParams) error { - if params == nil || params.GasLimit == 0 { + if params == nil || params.CallOptions.GasLimit == 0 { return errors.New("outboundParams is empty") } diff --git a/zetaclient/chains/evm/signer/v2_sign.go b/zetaclient/chains/evm/signer/v2_sign.go index 9a3bf3ba89..81702d2aba 100644 --- a/zetaclient/chains/evm/signer/v2_sign.go +++ b/zetaclient/chains/evm/signer/v2_sign.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" erc20custodyv2 "github.com/zeta-chain/protocol-contracts/v2/pkg/erc20custody.sol" @@ -16,15 +17,31 @@ import ( // function execute // address destination, // bytes calldata data -func (signer *Signer) signGatewayExecute(ctx context.Context, txData *OutboundData) (*ethtypes.Transaction, error) { +func (signer *Signer) signGatewayExecute( + ctx context.Context, + sender string, + txData *OutboundData, +) (*ethtypes.Transaction, error) { gatewayABI, err := gatewayevm.GatewayEVMMetaData.GetAbi() if err != nil { return nil, errors.Wrap(err, "unable to get GatewayEVMMetaData ABI") } - data, err := gatewayABI.Pack("execute", txData.to, txData.message) - if err != nil { - return nil, fmt.Errorf("execute pack error: %w", err) + var data []byte + + if txData.outboundParams.CallOptions.IsArbitraryCall { + data, err = gatewayABI.Pack("execute", txData.to, txData.message) + if err != nil { + return nil, fmt.Errorf("execute pack error: %w", err) + } + } else { + messageContext := gatewayevm.MessageContext{ + Sender: common.HexToAddress(sender), + } + data, err = gatewayABI.Pack("execute0", messageContext, txData.to, txData.message) + if err != nil { + return nil, fmt.Errorf("execute0 pack error: %w", err) + } } tx, _, _, err := signer.Sign( diff --git a/zetaclient/chains/evm/signer/v2_signer.go b/zetaclient/chains/evm/signer/v2_signer.go index 2de0ecc9d5..b3a06a19c2 100644 --- a/zetaclient/chains/evm/signer/v2_signer.go +++ b/zetaclient/chains/evm/signer/v2_signer.go @@ -27,7 +27,7 @@ func (signer *Signer) SignOutboundFromCCTXV2( case evm.OutboundTypeGasWithdrawAndCall, evm.OutboundTypeCall: // both gas withdraw and call and no-asset call uses gateway execute // no-asset call simply hash msg.value == 0 - return signer.signGatewayExecute(ctx, outboundData) + return signer.signGatewayExecute(ctx, cctx.InboundParams.Sender, outboundData) case evm.OutboundTypeGasWithdrawRevertAndCallOnRevert: return signer.signGatewayExecuteRevert(ctx, outboundData) case evm.OutboundTypeERC20WithdrawRevertAndCallOnRevert: diff --git a/zetaclient/testdata/cctx/chain_1337_cctx_14.go b/zetaclient/testdata/cctx/chain_1337_cctx_14.go index 634a0346a4..785c5496e9 100644 --- a/zetaclient/testdata/cctx/chain_1337_cctx_14.go +++ b/zetaclient/testdata/cctx/chain_1337_cctx_14.go @@ -30,11 +30,13 @@ var chain_1337_cctx_14 = &crosschaintypes.CrossChainTx{ }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "0xbff76e77d56b3c1202107f059425d56f0aef87ed", - ReceiverChainId: 1337, - Amount: sdkmath.NewUintFromString("7999999999995486459"), - TssNonce: 13, - GasLimit: 250000, + Receiver: "0xbff76e77d56b3c1202107f059425d56f0aef87ed", + ReceiverChainId: 1337, + Amount: sdkmath.NewUintFromString("7999999999995486459"), + TssNonce: 13, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 250000, + }, GasPrice: "18", Hash: "0x19f99459da6cb08f917f9b0ee2dac94a7be328371dff788ad46e64a24e8c06c9", ObservedExternalHeight: 187, @@ -45,11 +47,13 @@ var chain_1337_cctx_14 = &crosschaintypes.CrossChainTx{ TxFinalizationStatus: crosschaintypes.TxFinalizationStatus_Executed, }, { - Receiver: "0xBFF76e77D56B3C1202107f059425D56f0AEF87Ed", - ReceiverChainId: 1337, - Amount: sdkmath.NewUintFromString("5999999999990972918"), - TssNonce: 14, - GasLimit: 250000, + Receiver: "0xBFF76e77D56B3C1202107f059425D56f0AEF87Ed", + ReceiverChainId: 1337, + Amount: sdkmath.NewUintFromString("5999999999990972918"), + TssNonce: 14, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 250000, + }, GasPrice: "18", Hash: "0x1487e6a31dd430306667250b72bf15b8390b73108b69f3de5c1b2efe456036a7", BallotIndex: "0xc36c689fdaf09a9b80a614420cd4fea4fec15044790df60080cdefca0090a9dc", diff --git a/zetaclient/testdata/cctx/chain_1_cctx_6270.go b/zetaclient/testdata/cctx/chain_1_cctx_6270.go index 7692837803..fbfd4a8c0c 100644 --- a/zetaclient/testdata/cctx/chain_1_cctx_6270.go +++ b/zetaclient/testdata/cctx/chain_1_cctx_6270.go @@ -34,12 +34,14 @@ var chain_1_cctx_6270 = &crosschaintypes.CrossChainTx{ }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "0x18D0E2c38b4188D8Ae07008C3BeeB1c80748b41c", - ReceiverChainId: 1, - CoinType: coin.CoinType_Gas, - Amount: sdkmath.NewUint(9831832641427386), - TssNonce: 6270, - GasLimit: 21000, + Receiver: "0x18D0E2c38b4188D8Ae07008C3BeeB1c80748b41c", + ReceiverChainId: 1, + CoinType: coin.CoinType_Gas, + Amount: sdkmath.NewUint(9831832641427386), + TssNonce: 6270, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 21000, + }, GasPrice: "69197693654", Hash: "0x20104d41e042db754cf7908c5441914e581b498eedbca40979c9853f4b7f8460", BallotIndex: "0x346a1d00a4d26a2065fe1dc7d5af59a49ad6a8af25853ae2ec976c07349f48c1", diff --git a/zetaclient/testdata/cctx/chain_1_cctx_7260.go b/zetaclient/testdata/cctx/chain_1_cctx_7260.go index 7704acf0f7..777645a4b1 100644 --- a/zetaclient/testdata/cctx/chain_1_cctx_7260.go +++ b/zetaclient/testdata/cctx/chain_1_cctx_7260.go @@ -34,12 +34,14 @@ var chain_1_cctx_7260 = &crosschaintypes.CrossChainTx{ }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "0x8E62e3e6FbFF3E21F725395416A20EA4E2DeF015", - ReceiverChainId: 1, - CoinType: coin.CoinType_Gas, - Amount: sdkmath.NewUint(42635427434588308), - TssNonce: 7260, - GasLimit: 21000, + Receiver: "0x8E62e3e6FbFF3E21F725395416A20EA4E2DeF015", + ReceiverChainId: 1, + CoinType: coin.CoinType_Gas, + Amount: sdkmath.NewUint(42635427434588308), + TssNonce: 7260, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 21000, + }, GasPrice: "236882693686", Hash: "0xd13b593eb62b5500a00e288cc2fb2c8af1339025c0e6bc6183b8bef2ebbed0d3", BallotIndex: "0x96e2f6f6956a7617cce6385e42169621254172ec4ddb9d3b2d8740263861a456", diff --git a/zetaclient/testdata/cctx/chain_1_cctx_8014.go b/zetaclient/testdata/cctx/chain_1_cctx_8014.go index 2a4901d407..71f8912b81 100644 --- a/zetaclient/testdata/cctx/chain_1_cctx_8014.go +++ b/zetaclient/testdata/cctx/chain_1_cctx_8014.go @@ -34,12 +34,14 @@ var chain_1_cctx_8014 = &crosschaintypes.CrossChainTx{ }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "0x8d8D67A8B71c141492825CAE5112Ccd8581073f2", - ReceiverChainId: 1, - CoinType: coin.CoinType_ERC20, - Amount: sdkmath.NewUint(23726342442), - TssNonce: 8014, - GasLimit: 100000, + Receiver: "0x8d8D67A8B71c141492825CAE5112Ccd8581073f2", + ReceiverChainId: 1, + CoinType: coin.CoinType_ERC20, + Amount: sdkmath.NewUint(23726342442), + TssNonce: 8014, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 100000, + }, GasPrice: "58619665744", Hash: "0xd2eba7ac3da1b62800165414ea4bcaf69a3b0fb9b13a0fc32f4be11bfef79146", BallotIndex: "0x4213f2c335758301b8bbb09d9891949ed6ffeea5dd95e5d9eaa8d410baaa0884", diff --git a/zetaclient/testdata/cctx/chain_1_cctx_9718.go b/zetaclient/testdata/cctx/chain_1_cctx_9718.go index 526518f445..eb68fcf58a 100644 --- a/zetaclient/testdata/cctx/chain_1_cctx_9718.go +++ b/zetaclient/testdata/cctx/chain_1_cctx_9718.go @@ -34,12 +34,14 @@ var chain_1_cctx_9718 = &crosschaintypes.CrossChainTx{ }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "0x30735c88fa430f11499b0edcfcc25246fb9182e3", - ReceiverChainId: 1, - CoinType: coin.CoinType_Zeta, - Amount: sdkmath.NewUint(474493998697236392), - TssNonce: 9718, - GasLimit: 90000, + Receiver: "0x30735c88fa430f11499b0edcfcc25246fb9182e3", + ReceiverChainId: 1, + CoinType: coin.CoinType_Zeta, + Amount: sdkmath.NewUint(474493998697236392), + TssNonce: 9718, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 90000, + }, GasPrice: "112217884384", Hash: "0x81342051b8a85072d3e3771c1a57c7bdb5318e8caf37f5a687b7a91e50a7257f", BallotIndex: "0xff07eaa34ca02a08bca1558e5f6220cbfc734061f083622b24923e032f0c480f", diff --git a/zetaclient/testdata/cctx/chain_1_cctx_inbound_ERC20_0x4ea69a0e2ff36f7548ab75791c3b990e076e2a4bffeb616035b239b7d33843da.go b/zetaclient/testdata/cctx/chain_1_cctx_inbound_ERC20_0x4ea69a0e2ff36f7548ab75791c3b990e076e2a4bffeb616035b239b7d33843da.go index c59632355f..8fb1fb9cd9 100644 --- a/zetaclient/testdata/cctx/chain_1_cctx_inbound_ERC20_0x4ea69a0e2ff36f7548ab75791c3b990e076e2a4bffeb616035b239b7d33843da.go +++ b/zetaclient/testdata/cctx/chain_1_cctx_inbound_ERC20_0x4ea69a0e2ff36f7548ab75791c3b990e076e2a4bffeb616035b239b7d33843da.go @@ -28,18 +28,20 @@ var chain_1_cctx_inbound_ERC20_0x4ea69a0 = &crosschaintypes.CrossChainTx{ Amount: sdkmath.NewUintFromString("9992000000"), ObservedHash: "0x4ea69a0e2ff36f7548ab75791c3b990e076e2a4bffeb616035b239b7d33843da", ObservedExternalHeight: 19320188, - BallotIndex: "0xc3d0dab7b2a34e3bfa2430963ff776ef2357c41f3164a28ab5d6380d7a438938", + BallotIndex: "0x97101937e3927e124dffcaed1349af2599a8420ff34315288e96eac7f0033048", FinalizedZetaHeight: 1944675, TxFinalizationStatus: crosschaintypes.TxFinalizationStatus_Executed, }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "0x56bf8d4a6e7b59d2c0e40cba2409a4a30ab4fbe2", - ReceiverChainId: 7000, - CoinType: coin.CoinType_ERC20, - Amount: sdkmath.NewUintFromString("0"), - TssNonce: 0, - GasLimit: 1500000, + Receiver: "0x56bf8d4a6e7b59d2c0e40cba2409a4a30ab4fbe2", + ReceiverChainId: 7000, + CoinType: coin.CoinType_ERC20, + Amount: sdkmath.NewUintFromString("0"), + TssNonce: 0, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 1500000, + }, GasPrice: "", Hash: "0xf63eaa3e01af477673aa9e86fb634df15d30a00734dab7450cb0fc28dbc9d11b", BallotIndex: "", diff --git a/zetaclient/testdata/cctx/chain_1_cctx_inbound_Gas_0xeaec67d5dd5d85f27b21bef83e01cbdf59154fd793ea7a22c297f7c3a722c532.go b/zetaclient/testdata/cctx/chain_1_cctx_inbound_Gas_0xeaec67d5dd5d85f27b21bef83e01cbdf59154fd793ea7a22c297f7c3a722c532.go index 673ff70433..53a736b228 100644 --- a/zetaclient/testdata/cctx/chain_1_cctx_inbound_Gas_0xeaec67d5dd5d85f27b21bef83e01cbdf59154fd793ea7a22c297f7c3a722c532.go +++ b/zetaclient/testdata/cctx/chain_1_cctx_inbound_Gas_0xeaec67d5dd5d85f27b21bef83e01cbdf59154fd793ea7a22c297f7c3a722c532.go @@ -28,18 +28,20 @@ var chain_1_cctx_inbound_Gas_0xeaec67d = &crosschaintypes.CrossChainTx{ Amount: sdkmath.NewUintFromString("4000000000000000"), ObservedHash: "0xeaec67d5dd5d85f27b21bef83e01cbdf59154fd793ea7a22c297f7c3a722c532", ObservedExternalHeight: 19330473, - BallotIndex: "0x79f6a3da92d085b2f3c682a2eb1606ef89e53a7db4fdbbb397b3e0f54884cfb0", + BallotIndex: "0xdb5daf6a8471bc5a8f17c7e717dc6532719a89f082bd80694aebd654b7069609", FinalizedZetaHeight: 1965579, TxFinalizationStatus: crosschaintypes.TxFinalizationStatus_Executed, }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "0xF829fa7069680b8C37A8086b37d4a24697E5003b", - ReceiverChainId: 7000, - CoinType: coin.CoinType_Gas, - Amount: sdkmath.NewUint(0), - TssNonce: 0, - GasLimit: 90000, + Receiver: "0xF829fa7069680b8C37A8086b37d4a24697E5003b", + ReceiverChainId: 7000, + CoinType: coin.CoinType_Gas, + Amount: sdkmath.NewUint(0), + TssNonce: 0, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 90000, + }, GasPrice: "", Hash: "0x3b8c1dab5aa21ff90ddb569f2f962ff2d4aa8d914c9177900102e745955e6f35", BallotIndex: "", diff --git a/zetaclient/testdata/cctx/chain_1_cctx_inbound_Zeta_0xf3935200c80f98502d5edc7e871ffc40ca898e134525c42c2ae3cbc5725f9d76.go b/zetaclient/testdata/cctx/chain_1_cctx_inbound_Zeta_0xf3935200c80f98502d5edc7e871ffc40ca898e134525c42c2ae3cbc5725f9d76.go index 900fb63d24..7a39dcd3a7 100644 --- a/zetaclient/testdata/cctx/chain_1_cctx_inbound_Zeta_0xf3935200c80f98502d5edc7e871ffc40ca898e134525c42c2ae3cbc5725f9d76.go +++ b/zetaclient/testdata/cctx/chain_1_cctx_inbound_Zeta_0xf3935200c80f98502d5edc7e871ffc40ca898e134525c42c2ae3cbc5725f9d76.go @@ -28,18 +28,20 @@ var chain_1_cctx_inbound_Zeta_0xf393520 = &crosschaintypes.CrossChainTx{ Amount: sdkmath.NewUintFromString("20000000000000000000"), ObservedHash: "0xf3935200c80f98502d5edc7e871ffc40ca898e134525c42c2ae3cbc5725f9d76", ObservedExternalHeight: 19273702, - BallotIndex: "0xa4efd2d7293e1c2c557eb527c7ad7f2f8754cce413d3f72929a17e02b537b0af", + BallotIndex: "0x611f8fea15d26d318c06b04e41bcc16ef212048eddbbf62641c1e3e42b376009", FinalizedZetaHeight: 1851403, TxFinalizationStatus: crosschaintypes.TxFinalizationStatus_Executed, }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "0x2f993766e8e1ef9288b1f33f6aa244911a0a77a7", - ReceiverChainId: 7000, - CoinType: coin.CoinType_Zeta, - Amount: sdkmath.ZeroUint(), - TssNonce: 0, - GasLimit: 100000, + Receiver: "0x2f993766e8e1ef9288b1f33f6aa244911a0a77a7", + ReceiverChainId: 7000, + CoinType: coin.CoinType_Zeta, + Amount: sdkmath.ZeroUint(), + TssNonce: 0, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 100000, + }, GasPrice: "", Hash: "0x947434364da7c74d7e896a389aa8cb3122faf24bbcba64b141cb5acd7838209c", BallotIndex: "", diff --git a/zetaclient/testdata/cctx/chain_56_cctx_68270.go b/zetaclient/testdata/cctx/chain_56_cctx_68270.go index c74daef92a..3693774c9b 100644 --- a/zetaclient/testdata/cctx/chain_56_cctx_68270.go +++ b/zetaclient/testdata/cctx/chain_56_cctx_68270.go @@ -34,12 +34,14 @@ var chain_56_cctx_68270 = &crosschaintypes.CrossChainTx{ }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "0xb0C04e07A301927672A8A7a874DB6930576C90B8", - ReceiverChainId: 56, - CoinType: coin.CoinType_Gas, - Amount: sdkmath.NewUint(657177295293237048), - TssNonce: 68270, - GasLimit: 21000, + Receiver: "0xb0C04e07A301927672A8A7a874DB6930576C90B8", + ReceiverChainId: 56, + CoinType: coin.CoinType_Gas, + Amount: sdkmath.NewUint(657177295293237048), + TssNonce: 68270, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 21000, + }, GasPrice: "6000000000", Hash: "0xeb2b183ece6638688b9df9223180b13a67208cd744bbdadeab8de0482d7f4e3c", BallotIndex: "0xa4600c952934f797e162d637d70859a611757407908d96bc53e45a81c80b006b", diff --git a/zetaclient/testdata/cctx/chain_8332_cctx_148.go b/zetaclient/testdata/cctx/chain_8332_cctx_148.go index f69c76cf1e..7b084b9a28 100644 --- a/zetaclient/testdata/cctx/chain_8332_cctx_148.go +++ b/zetaclient/testdata/cctx/chain_8332_cctx_148.go @@ -34,12 +34,14 @@ var chain_8332_cctx_148 = &crosschaintypes.CrossChainTx{ }, OutboundParams: []*crosschaintypes.OutboundParams{ { - Receiver: "bc1qpsdlklfcmlcfgm77c43x65ddtrt7n0z57hsyjp", - ReceiverChainId: 8332, - CoinType: coin.CoinType_Gas, - Amount: sdkmath.NewUint(12000), - TssNonce: 148, - GasLimit: 254, + Receiver: "bc1qpsdlklfcmlcfgm77c43x65ddtrt7n0z57hsyjp", + ReceiverChainId: 8332, + CoinType: coin.CoinType_Gas, + Amount: sdkmath.NewUint(12000), + TssNonce: 148, + CallOptions: &crosschaintypes.CallOptions{ + GasLimit: 254, + }, GasPrice: "46", Hash: "030cd813443f7b70cc6d8a544d320c6d8465e4528fc0f3410b599dc0b26753a0", ObservedExternalHeight: 150, diff --git a/zetaclient/zetacore/constant.go b/zetaclient/zetacore/constant.go index a068db9a8b..1457dd0c58 100644 --- a/zetaclient/zetacore/constant.go +++ b/zetaclient/zetacore/constant.go @@ -19,7 +19,7 @@ const ( PostTSSGasLimit = 500_000 // PostVoteInboundExecutionGasLimit is the gas limit for voting on observed inbound tx and executing it - PostVoteInboundExecutionGasLimit = 6_500_000 + PostVoteInboundExecutionGasLimit = 7_000_000 // PostVoteInboundMessagePassingExecutionGasLimit is the gas limit for voting on, and executing ,observed inbound tx related to message passing (coin_type == zeta) PostVoteInboundMessagePassingExecutionGasLimit = 4_000_000 diff --git a/zetaclient/zetacore/tx.go b/zetaclient/zetacore/tx.go index 64379bad2a..bb7b106fd5 100644 --- a/zetaclient/zetacore/tx.go +++ b/zetaclient/zetacore/tx.go @@ -51,6 +51,7 @@ func GetInboundVoteMessage( asset, eventIndex, types.ProtocolContractVersion_V1, + false, // not relevant for v1 ) return msg }