diff --git a/Makefile b/Makefile index b3fbf4009a..40053db864 100644 --- a/Makefile +++ b/Makefile @@ -299,12 +299,12 @@ start-v2-test: zetanode ifdef UPGRADE_TEST_FROM_SOURCE zetanode-upgrade: zetanode @echo "Building zetanode-upgrade from source" - $(DOCKER) build -t zetanode:old -f Dockerfile-localnet --target old-runtime-source --build-arg OLD_VERSION='release/v19' . + $(DOCKER) build -t zetanode:old -f Dockerfile-localnet --target old-runtime-source --build-arg OLD_VERSION='release/v20' . .PHONY: zetanode-upgrade else zetanode-upgrade: zetanode @echo "Building zetanode-upgrade from binaries" - $(DOCKER) build -t zetanode:old -f Dockerfile-localnet --target old-runtime --build-arg OLD_VERSION='https://github.com/zeta-chain/node/releases/download/v19.1.1' . + $(DOCKER) build -t zetanode:old -f Dockerfile-localnet --target old-runtime --build-arg OLD_VERSION='https://github.com/zeta-chain/node/releases/download/v20.0.2' . .PHONY: zetanode-upgrade endif diff --git a/changelog.md b/changelog.md index ba31057d0a..f70614ef20 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,7 @@ * [2870](https://github.com/zeta-chain/node/pull/2870) - support for multiple Bitcoin chains in the zetaclient * [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 +* [2904](https://github.com/zeta-chain/node/pull/2904) - integrate authenticated calls smart contract functionality into protocol ### Refactor diff --git a/cmd/zetae2e/local/local.go b/cmd/zetae2e/local/local.go index d84a4ba9a4..08ef0cc134 100644 --- a/cmd/zetae2e/local/local.go +++ b/cmd/zetae2e/local/local.go @@ -46,6 +46,7 @@ const ( flagTestV2Migration = "test-v2-migration" flagSkipTrackerCheck = "skip-tracker-check" flagSkipPrecompiles = "skip-precompiles" + flagUpgradeGateways = "upgrade-gateways" ) var ( @@ -83,6 +84,7 @@ func NewLocalCmd() *cobra.Command { cmd.Flags().Bool(flagTestV2Migration, false, "set to true to run tests for v2 contracts migration test") cmd.Flags().Bool(flagSkipTrackerCheck, false, "set to true to skip tracker check at the end of the tests") cmd.Flags().Bool(flagSkipPrecompiles, false, "set to true to skip stateful precompiled contracts test") + cmd.Flags().Bool(flagUpgradeGateways, false, "set to true to upgrade gateways during setup for ZEVM and EVM") return cmd } @@ -112,6 +114,7 @@ func localE2ETest(cmd *cobra.Command, _ []string) { testV2 = must(cmd.Flags().GetBool(flagTestV2)) testV2Migration = must(cmd.Flags().GetBool(flagTestV2Migration)) skipPrecompiles = must(cmd.Flags().GetBool(flagSkipPrecompiles)) + upgradeGateways = must(cmd.Flags().GetBool(flagUpgradeGateways)) ) logger := runner.NewLogger(verbose, color.FgWhite, "setup") @@ -407,6 +410,11 @@ func localE2ETest(cmd *cobra.Command, _ []string) { deployerRunner.UpdateChainParamsV2Contracts() } + // upgrade gateways + if upgradeGateways { + deployerRunner.UpgradeGateways() + } + if testV2 || testV2Migration { startV2Tests(&eg, conf, deployerRunner, verbose) } 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/contrib/localnet/orchestrator/start-zetae2e.sh b/contrib/localnet/orchestrator/start-zetae2e.sh index a054845739..4206b10610 100644 --- a/contrib/localnet/orchestrator/start-zetae2e.sh +++ b/contrib/localnet/orchestrator/start-zetae2e.sh @@ -268,9 +268,9 @@ if [ "$LOCALNET_MODE" == "upgrade" ]; then # When the upgrade height is greater than 100 for upgrade test, the Bitcoin tests have been run once, therefore the Bitcoin wallet is already set up # Use light flag to skip advanced tests if [ "$UPGRADE_HEIGHT" -lt 100 ]; then - zetae2e local $E2E_ARGS --skip-setup --config "$deployed_config_path" --light ${COMMON_ARGS} + zetae2e local $E2E_ARGS --skip-setup --config "$deployed_config_path" --light --upgrade-gateways ${COMMON_ARGS} else - zetae2e local $E2E_ARGS --skip-setup --config "$deployed_config_path" --skip-bitcoin-setup --light ${COMMON_ARGS} + zetae2e local $E2E_ARGS --skip-setup --config "$deployed_config_path" --skip-bitcoin-setup --light --test-v2 --upgrade-gateways ${COMMON_ARGS} fi ZETAE2E_EXIT_CODE=$? diff --git a/docs/cli/zetacored/cli.md b/docs/cli/zetacored/cli.md index a8719cf83f..6e8555c166 100644 --- a/docs/cli/zetacored/cli.md +++ b/docs/cli/zetacored/cli.md @@ -3345,10 +3345,45 @@ zetacored query emissions [flags] ### SEE ALSO * [zetacored query](#zetacored-query) - Querying subcommands +* [zetacored query emissions get-emmisons-factors](#zetacored-query-emissions-get-emmisons-factors) - Query GetEmmisonsFactors * [zetacored query emissions list-pool-addresses](#zetacored-query-emissions-list-pool-addresses) - Query list-pool-addresses * [zetacored query emissions params](#zetacored-query-emissions-params) - shows the parameters of the module * [zetacored query emissions show-available-emissions](#zetacored-query-emissions-show-available-emissions) - Query show-available-emissions +## zetacored query emissions get-emmisons-factors + +Query GetEmmisonsFactors + +``` +zetacored query emissions get-emmisons-factors [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for get-emmisons-factors + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --log_no_color Disable colored logs + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query emissions](#zetacored-query-emissions) - Querying commands for the emissions module + ## zetacored query emissions list-pool-addresses Query list-pool-addresses @@ -8174,7 +8209,6 @@ zetacored tx authority [flags] * [zetacored tx](#zetacored-tx) - Transactions subcommands * [zetacored tx authority add-authorization](#zetacored-tx-authority-add-authorization) - Add a new authorization or update the policy of an existing authorization. Policy type can be 0 for groupEmergency, 1 for groupOperational, 2 for groupAdmin. * [zetacored tx authority remove-authorization](#zetacored-tx-authority-remove-authorization) - removes an existing authorization -* [zetacored tx authority remove-chain-info](#zetacored-tx-authority-remove-chain-info) - Remove the chain info for the specified chain id * [zetacored tx authority update-chain-info](#zetacored-tx-authority-update-chain-info) - Update the chain info * [zetacored tx authority update-policies](#zetacored-tx-authority-update-policies) - Update policies to values provided in the JSON file. @@ -8284,59 +8318,6 @@ zetacored tx authority remove-authorization [msg-url] [flags] * [zetacored tx authority](#zetacored-tx-authority) - authority transactions subcommands -## zetacored tx authority remove-chain-info - -Remove the chain info for the specified chain id - -``` -zetacored tx authority remove-chain-info [chain-id] [flags] -``` - -### Options - -``` - -a, --account-number uint The account number of the signing account (offline mode only) - --aux Generate aux signer data instead of sending a tx - -b, --broadcast-mode string Transaction broadcasting mode (sync|async) - --chain-id string The network chain ID - --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) - --fee-granter string Fee granter grants fees for the transaction - --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer - --fees string Fees to pay along with transaction; eg: 10uatom - --from string Name or address of private key with which to sign - --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) - --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) - --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) - --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) - -h, --help help for remove-chain-info - --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) - --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used - --ledger Use a connected Ledger device - --node string [host]:[port] to tendermint rpc interface for this chain - --note string Note to add a description to the transaction (previously --memo) - --offline Offline mode (does not allow any online functionality) - -o, --output string Output format (text|json) - -s, --sequence uint The sequence number of the signing account (offline mode only) - --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature - --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height - --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator - -y, --yes Skip tx broadcasting prompt confirmation -``` - -### Options inherited from parent commands - -``` - --home string directory for config and data - --log_format string The logging format (json|plain) - --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) - --log_no_color Disable colored logs - --trace print out full stack trace on errors -``` - -### SEE ALSO - -* [zetacored tx authority](#zetacored-tx-authority) - authority transactions subcommands - ## zetacored tx authority update-chain-info Update the chain info diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index 43ec9bc0e1..da60920a41 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -57067,6 +57067,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: @@ -57274,9 +57282,8 @@ definitions: tss_nonce: type: string format: uint64 - gas_limit: - type: string - format: uint64 + call_options: + $ref: '#/definitions/crosschainCallOptions' gas_price: type: string gas_priority_fee: diff --git a/docs/spec/crosschain/messages.md b/docs/spec/crosschain/messages.md index f2fba7cd1d..d19ce116a5 100644 --- a/docs/spec/crosschain/messages.md +++ b/docs/spec/crosschain/messages.md @@ -182,7 +182,7 @@ message MsgVoteInbound { string message = 8; string inbound_hash = 9; uint64 inbound_block_height = 10; - uint64 gas_limit = 11; + CallOptions call_options = 11; pkg.coin.CoinType coin_type = 12; string tx_origin = 13; string asset = 14; 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..ea6bae643d 100644 --- a/e2e/runner/logger.go +++ b/e2e/runner/logger.go @@ -153,7 +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(" GasLimit: %d", outTxParam.GasLimit) + l.Info(" GasLimit: %d", outTxParam.CallOptions.GasLimit) l.Info(" GasPrice: %s", outTxParam.GasPrice) l.Info(" GasUsed: %d", outTxParam.GasUsed) l.Info(" EffectiveGasPrice: %s", outTxParam.EffectiveGasPrice.String()) diff --git a/e2e/runner/v2_gateway.go b/e2e/runner/v2_gateway.go new file mode 100644 index 0000000000..2bede9e3fe --- /dev/null +++ b/e2e/runner/v2_gateway.go @@ -0,0 +1,55 @@ +package runner + +import ( + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayevm.sol" + "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" + + "github.com/zeta-chain/node/e2e/utils" +) + +// UpgradeGateways upgrades the GatewayEVM and GatewayZEVM contracts +// It deploy new gateway contract implementation with the current imported artifacts and upgrade the gateway contract +func (r *E2ERunner) UpgradeGateways() { + r.UpgradeGatewayZEVM() + r.UpgradeGatewayEVM() +} + +// UpgradeGatewayZEVM upgrades the GatewayZEVM contract +func (r *E2ERunner) UpgradeGatewayZEVM() { + ensureTxReceipt := func(tx *ethtypes.Transaction, failMessage string) { + receipt := utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) + r.requireTxSuccessful(receipt, failMessage+" tx hash: "+tx.Hash().Hex()) + } + + r.Logger.Info("Upgrading Gateway ZEVM contract") + // Deploy the new gateway contract implementation + newImplementationAddress, txDeploy, _, err := gatewayzevm.DeployGatewayZEVM(r.ZEVMAuth, r.ZEVMClient) + require.NoError(r, err) + ensureTxReceipt(txDeploy, "New GatewayZEVM implementation deployment failed") + + // Upgrade + txUpgrade, err := r.GatewayZEVM.UpgradeToAndCall(r.ZEVMAuth, newImplementationAddress, []byte{}) + require.NoError(r, err) + ensureTxReceipt(txUpgrade, "GatewayZEVM upgrade failed") +} + +// UpgradeGatewayEVM upgrades the GatewayEVM contract +func (r *E2ERunner) UpgradeGatewayEVM() { + ensureTxReceipt := func(tx *ethtypes.Transaction, failMessage string) { + receipt := utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) + r.requireTxSuccessful(receipt, failMessage+" tx hash: "+tx.Hash().Hex()) + } + + r.Logger.Info("Upgrading Gateway EVM contract") + // Deploy the new gateway contract implementation + newImplementationAddress, txDeploy, _, err := gatewayevm.DeployGatewayEVM(r.EVMAuth, r.EVMClient) + require.NoError(r, err) + ensureTxReceipt(txDeploy, "New GatewayEVM implementation deployment failed") + + // Upgrade + txUpgrade, err := r.GatewayEVM.UpgradeToAndCall(r.EVMAuth, newImplementationAddress, []byte{}) + require.NoError(r, err) + ensureTxReceipt(txUpgrade, "GatewayEVM upgrade failed") +} diff --git a/e2e/runner/v2_setup_zeta.go b/e2e/runner/v2_setup_zevm.go similarity index 100% rename from e2e/runner/v2_setup_zeta.go rename to e2e/runner/v2_setup_zevm.go diff --git a/e2e/runner/v2_zevm.go b/e2e/runner/v2_zevm.go index 681696b195..a0f760ee90 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 } +// V2ETHWithdrawAndAuthenticatedCall 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 +} + +// V2ETHWithdrawAndAuthenticatedCallThroughContract 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 +} + +// V2ZEVMToEMVAuthenticatedCallThroughContract 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..46e03d494b 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,7 +68,7 @@ message OutboundParams { (gogoproto.nullable) = false ]; uint64 tss_nonce = 5; - uint64 gas_limit = 6; + CallOptions call_options = 6 [ (gogoproto.nullable) = false ]; string gas_price = 7; string gas_priority_fee = 23; // the above are commands for zetaclients diff --git a/proto/zetachain/zetacore/crosschain/tx.proto b/proto/zetachain/zetacore/crosschain/tx.proto index e5d310976d..bb7e5f40da 100644 --- a/proto/zetachain/zetacore/crosschain/tx.proto +++ b/proto/zetachain/zetacore/crosschain/tx.proto @@ -163,7 +163,7 @@ message MsgVoteInbound { string message = 8; string inbound_hash = 9; uint64 inbound_block_height = 10; - uint64 gas_limit = 11; + CallOptions call_options = 11 [ (gogoproto.nullable) = false ]; pkg.coin.CoinType coin_type = 12; string tx_origin = 13; string asset = 14; diff --git a/testutil/sample/crosschain.go b/testutil/sample/crosschain.go index defc1f217a..8f5ca1c82c 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..02a21edfc1 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,9 +266,9 @@ export declare class OutboundParams extends Message { tssNonce: bigint; /** - * @generated from field: uint64 gas_limit = 6; + * @generated from field: zetachain.zetacore.crosschain.CallOptions call_options = 6; */ - gasLimit: bigint; + callOptions?: CallOptions; /** * @generated from field: string gas_price = 7; diff --git a/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts b/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts index 657a772384..d0a8cee724 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,9 +616,9 @@ export declare class MsgVoteInbound extends Message { inboundBlockHeight: bigint; /** - * @generated from field: uint64 gas_limit = 11; + * @generated from field: zetachain.zetacore.crosschain.CallOptions call_options = 11; */ - gasLimit: bigint; + callOptions?: CallOptions; /** * @generated from field: zetachain.zetacore.pkg.coin.CoinType coin_type = 12; 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..db2c45347c 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..03e8d607db 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..09ebd700da 100644 --- a/x/crosschain/keeper/cctx_test.go +++ b/x/crosschain/keeper/cctx_test.go @@ -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..4c281320e0 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..97c24a6509 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..fc961e4f32 100644 --- a/x/crosschain/types/cctx.go +++ b/x/crosschain/types/cctx.go @@ -120,8 +120,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 +231,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..b1295c9537 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") @@ -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..d28e26a94c 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..c802ba4d22 100644 --- a/x/crosschain/types/cross_chain_tx.pb.go +++ b/x/crosschain/types/cross_chain_tx.pb.go @@ -274,13 +274,65 @@ 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"` + CallOptions CallOptions `protobuf:"bytes,6,opt,name=call_options,json=callOptions,proto3" json:"call_options"` 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 @@ -299,7 +351,7 @@ 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) @@ -356,11 +408,11 @@ func (m *OutboundParams) GetTssNonce() uint64 { return 0 } -func (m *OutboundParams) GetGasLimit() uint64 { +func (m *OutboundParams) GetCallOptions() CallOptions { if m != nil { - return m.GasLimit + return m.CallOptions } - return 0 + return CallOptions{} } func (m *OutboundParams) GetGasPrice() string { @@ -439,7 +491,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 +568,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 +641,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 +732,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 +744,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,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x68, 0xb1, 0x2c, 0x33, 0xae, - 0x43, 0x2e, 0x40, 0x25, 0x9b, 0x3d, 0x60, 0x09, 0x46, 0xee, 0x9c, 0x82, 0xec, 0x3a, 0x13, 0xd6, - 0xcd, 0x91, 0x32, 0x14, 0xcc, 0x18, 0x23, 0x77, 0x9e, 0x94, 0x60, 0x61, 0xc3, 0x3c, 0x14, 0xdc, - 0xfc, 0x4a, 0xee, 0xe7, 0x9f, 0xea, 0xce, 0xad, 0x2f, 0xa0, 0x76, 0x5a, 0x1b, 0x25, 0x2e, 0x94, - 0x1f, 0x72, 0xb9, 0x9d, 0x3d, 0x9b, 0xdc, 0x19, 0x52, 0x81, 0xe2, 0x64, 0xea, 0x28, 0xe6, 0xbb, - 0x23, 0x0c, 0x87, 0x8a, 0x6c, 0xd6, 0x92, 0xb5, 0xe1, 0xd2, 0xdf, 0x64, 0x96, 0xe4, 0x61, 0xf6, - 0xc9, 0x6d, 0x77, 0x46, 0x7f, 0xd7, 0x5d, 0xc7, 0x38, 0x6c, 0xde, 0x7b, 0xf1, 0xba, 0xee, 0xbc, - 0x7c, 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, + // 1345 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0x26, 0x8e, 0x63, 0x3f, 0xff, 0xc8, 0x66, 0xe2, 0xa6, 0xdb, 0x7c, 0x55, 0x37, 0x5f, + 0x43, 0x5a, 0x37, 0x10, 0x5b, 0x75, 0x25, 0x84, 0xb8, 0x25, 0x51, 0xd3, 0x06, 0x68, 0x13, 0x6d, + 0xd3, 0x48, 0xed, 0x81, 0x65, 0xbc, 0x3b, 0xb1, 0x47, 0x59, 0xef, 0x98, 0x9d, 0x71, 0x64, 0x57, + 0xdc, 0x38, 0x23, 0xf1, 0x47, 0x70, 0xe0, 0xc8, 0x9f, 0x51, 0x6e, 0x3d, 0x22, 0x0e, 0x15, 0x6a, + 0xff, 0x03, 0xce, 0x1c, 0xd0, 0xfc, 0xb2, 0x63, 0x08, 0x49, 0x29, 0x9c, 0x3c, 0xf3, 0x99, 0x79, + 0x9f, 0x37, 0xfb, 0xde, 0xfb, 0xbc, 0x19, 0x43, 0xeb, 0x39, 0x11, 0x38, 0xec, 0x62, 0x9a, 0x34, + 0xd5, 0x88, 0xa5, 0xa4, 0x19, 0xa6, 0x8c, 0x73, 0x8d, 0xa9, 0x61, 0xa0, 0xc6, 0x81, 0x18, 0x36, + 0xfa, 0x29, 0x13, 0x0c, 0x5d, 0x1f, 0xdb, 0x34, 0xac, 0x4d, 0x63, 0x62, 0xb3, 0x5a, 0xe9, 0xb0, + 0x0e, 0x53, 0x3b, 0x9b, 0x72, 0xa4, 0x8d, 0x56, 0x6f, 0x9e, 0xe3, 0xa8, 0x7f, 0xd2, 0x69, 0x86, + 0x4c, 0xba, 0x61, 0x34, 0xd1, 0xfb, 0x6a, 0x3f, 0x66, 0xa0, 0xb4, 0x97, 0xb4, 0xd9, 0x20, 0x89, + 0x0e, 0x70, 0x8a, 0x7b, 0x1c, 0xad, 0x40, 0x96, 0x93, 0x24, 0x22, 0xa9, 0xe7, 0xac, 0x39, 0xf5, + 0xbc, 0x6f, 0x66, 0xe8, 0x26, 0x2c, 0xea, 0x91, 0x39, 0x1f, 0x8d, 0xbc, 0xd9, 0x35, 0xa7, 0x3e, + 0xe7, 0x97, 0x34, 0xbc, 0x23, 0xd1, 0xbd, 0x08, 0xfd, 0x0f, 0xf2, 0x62, 0x18, 0xb0, 0x94, 0x76, + 0x68, 0xe2, 0xcd, 0x29, 0x8a, 0x9c, 0x18, 0xee, 0xab, 0x39, 0xda, 0x86, 0xbc, 0x74, 0x1e, 0x88, + 0x51, 0x9f, 0x78, 0x99, 0x35, 0xa7, 0x5e, 0x6e, 0xad, 0x37, 0xce, 0xf9, 0xbe, 0xfe, 0x49, 0xa7, + 0xa1, 0x4e, 0xb9, 0xc3, 0x68, 0x72, 0x38, 0xea, 0x13, 0x3f, 0x17, 0x9a, 0x11, 0xaa, 0xc0, 0x3c, + 0xe6, 0x9c, 0x08, 0x6f, 0x5e, 0x91, 0xeb, 0x09, 0xba, 0x0f, 0x59, 0xdc, 0x63, 0x83, 0x44, 0x78, + 0x59, 0x09, 0x6f, 0x37, 0x5f, 0xbc, 0xba, 0x31, 0xf3, 0xcb, 0xab, 0x1b, 0xb7, 0x3a, 0x54, 0x74, + 0x07, 0xed, 0x46, 0xc8, 0x7a, 0xcd, 0x90, 0xf1, 0x1e, 0xe3, 0xe6, 0x67, 0x93, 0x47, 0x27, 0x4d, + 0x79, 0x0e, 0xde, 0x78, 0x42, 0x13, 0xe1, 0x1b, 0x73, 0xf4, 0x1e, 0x94, 0x58, 0x9b, 0x93, 0xf4, + 0x94, 0x44, 0x41, 0x17, 0xf3, 0xae, 0xb7, 0xa0, 0xdc, 0x14, 0x2d, 0xf8, 0x00, 0xf3, 0x2e, 0xfa, + 0x18, 0xbc, 0xf1, 0x26, 0x32, 0x14, 0x24, 0x4d, 0x70, 0x1c, 0x74, 0x09, 0xed, 0x74, 0x85, 0x97, + 0x5b, 0x73, 0xea, 0x19, 0x7f, 0xc5, 0xae, 0xdf, 0x33, 0xcb, 0x0f, 0xd4, 0x2a, 0xfa, 0x3f, 0x14, + 0xdb, 0x38, 0x8e,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16, 0xc1, 0x9e, 0xd5, 0xc0, 0xa2, + 0xc5, 0xad, 0x0a, 0xa6, 0x0a, 0x7d, 0xee, 0xdd, 0x0a, 0x7d, 0x52, 0xd2, 0x99, 0x7f, 0x57, 0xd2, + 0x52, 0x92, 0x9c, 0x07, 0x09, 0x4b, 0x42, 0xa2, 0x54, 0x93, 0xf1, 0x73, 0x82, 0xf3, 0x47, 0x72, + 0x8e, 0x1e, 0x43, 0x51, 0x86, 0x28, 0x60, 0x3a, 0xb8, 0x4a, 0x3e, 0x85, 0xd6, 0xc6, 0x25, 0xf5, + 0x72, 0x26, 0x1d, 0xdb, 0x19, 0x79, 0x2e, 0xbf, 0x10, 0xfe, 0x35, 0x43, 0xfd, 0x94, 0x86, 0xc4, + 0x08, 0x48, 0x66, 0xe8, 0x40, 0xce, 0x51, 0x1d, 0x5c, 0xb3, 0xc8, 0x52, 0x2a, 0x46, 0xc1, 0x31, + 0x21, 0xde, 0x55, 0xb5, 0xa7, 0xac, 0xf7, 0x28, 0x78, 0x97, 0x10, 0x84, 0x20, 0xa3, 0x24, 0x98, + 0x53, 0xab, 0x6a, 0xfc, 0x36, 0x02, 0xba, 0x48, 0x9d, 0x70, 0xa1, 0x3a, 0xaf, 0x81, 0x3c, 0x66, + 0x30, 0xe0, 0x24, 0xf2, 0x2a, 0x6a, 0xe7, 0x42, 0x07, 0xf3, 0x27, 0x9c, 0x44, 0xe8, 0x0b, 0x58, + 0x26, 0xc7, 0xc7, 0x24, 0x14, 0xf4, 0x94, 0x04, 0x93, 0x8f, 0xbb, 0xa2, 0x52, 0xd3, 0x30, 0xa9, + 0xb9, 0xf9, 0x16, 0xa9, 0xd9, 0x93, 0x35, 0x3e, 0xa6, 0xba, 0x6f, 0xa3, 0xd2, 0xf8, 0x33, 0xbf, + 0x2e, 0xef, 0x15, 0x75, 0x8a, 0xa9, 0xfd, 0xba, 0xce, 0xaf, 0x03, 0xc8, 0xa4, 0xf6, 0x07, 0xed, + 0x13, 0x32, 0x52, 0x2a, 0xcf, 0xfb, 0x32, 0xcd, 0x07, 0x0a, 0xb8, 0xa0, 0x21, 0x14, 0xff, 0xe3, + 0x86, 0xf0, 0x69, 0x26, 0x57, 0x72, 0x2b, 0xb5, 0xdf, 0x1d, 0xc8, 0x6a, 0x00, 0x6d, 0x41, 0xd6, + 0xf8, 0x72, 0x94, 0xaf, 0xdb, 0x97, 0x15, 0x53, 0x28, 0x86, 0xc6, 0x83, 0x31, 0x44, 0xeb, 0x50, + 0xd6, 0xa3, 0xa0, 0x47, 0x38, 0xc7, 0x1d, 0xa2, 0x84, 0x96, 0xf7, 0x4b, 0x1a, 0x7d, 0xa8, 0x41, + 0x74, 0x07, 0x2a, 0x31, 0xe6, 0xe2, 0x49, 0x3f, 0xc2, 0x82, 0x04, 0x82, 0xf6, 0x08, 0x17, 0xb8, + 0xd7, 0x57, 0x8a, 0x9b, 0xf3, 0x97, 0x27, 0x6b, 0x87, 0x76, 0x09, 0xd5, 0x41, 0xb6, 0x01, 0xd9, + 0x62, 0x7c, 0x72, 0x3c, 0x48, 0x22, 0x12, 0x29, 0x79, 0xe9, 0xee, 0x70, 0x16, 0x46, 0x1f, 0xc0, + 0x52, 0x98, 0x12, 0x2c, 0xdb, 0xda, 0x84, 0x79, 0x5e, 0x31, 0xbb, 0x66, 0x61, 0x4c, 0x5b, 0xfb, + 0x66, 0x16, 0x4a, 0x3e, 0x39, 0x25, 0xa9, 0xb0, 0x1a, 0x58, 0x87, 0x72, 0xaa, 0x80, 0x00, 0x47, + 0x51, 0x4a, 0x38, 0x37, 0xfd, 0xa4, 0xa4, 0xd1, 0x2d, 0x0d, 0xa2, 0xf7, 0xa1, 0xac, 0xf5, 0x97, + 0x04, 0x7a, 0xc1, 0x34, 0x2b, 0xa5, 0xca, 0xfd, 0x44, 0x73, 0xca, 0x5b, 0x49, 0xb5, 0xc5, 0x31, + 0x97, 0xbe, 0x59, 0x8b, 0x0a, 0xb4, 0x54, 0x13, 0x8f, 0x36, 0x68, 0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 0xea, 0xcc, 0xb3, 0xcd, 0x33, 0x4a, 0x92, 0x81, + 0xdd, 0xd4, 0x7f, 0x14, 0x12, 0x16, 0x91, 0xe6, 0xf0, 0xec, 0xff, 0x11, 0x25, 0xaa, 0x76, 0x56, + 0x25, 0xee, 0xee, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x32, 0x58, 0x13, 0x23, 0xbd, 0x0c, 0x00, + 0x00, } func (m *InboundParams) Marshal() (dAtA []byte, err error) { @@ -901,6 +958,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) @@ -994,11 +1089,16 @@ func (m *OutboundParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a } - if m.GasLimit != 0 { - i = encodeVarintCrossChainTx(dAtA, i, uint64(m.GasLimit)) - i-- - dAtA[i] = 0x30 + { + size, err := m.CallOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrossChainTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 if m.TssNonce != 0 { i = encodeVarintCrossChainTx(dAtA, i, uint64(m.TssNonce)) i-- @@ -1328,6 +1428,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 @@ -1349,9 +1464,8 @@ func (m *OutboundParams) Size() (n int) { if m.TssNonce != 0 { n += 1 + sovCrossChainTx(uint64(m.TssNonce)) } - if m.GasLimit != 0 { - n += 1 + sovCrossChainTx(uint64(m.GasLimit)) - } + l = m.CallOptions.Size() + n += 1 + l + sovCrossChainTx(uint64(l)) l = len(m.GasPrice) if l > 0 { n += 1 + l + sovCrossChainTx(uint64(l)) @@ -1911,6 +2025,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 @@ -2064,10 +2267,10 @@ func (m *OutboundParams) Unmarshal(dAtA []byte) error { } } case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallOptions", wireType) } - m.GasLimit = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCrossChainTx @@ -2077,11 +2280,25 @@ func (m *OutboundParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.GasLimit |= uint64(b&0x7F) << shift + 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 err := m.CallOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) diff --git a/x/crosschain/types/message_vote_inbound.go b/x/crosschain/types/message_vote_inbound.go index 8592b7e607..897b8c98bf 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..a6e715d643 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..fc1b9d8fd7 100644 --- a/x/crosschain/types/tx.pb.go +++ b/x/crosschain/types/tx.pb.go @@ -991,7 +991,7 @@ type MsgVoteInbound struct { 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"` + CallOptions CallOptions `protobuf:"bytes,11,opt,name=call_options,json=callOptions,proto3" json:"call_options"` 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"` @@ -1092,11 +1092,11 @@ func (m *MsgVoteInbound) GetInboundBlockHeight() uint64 { return 0 } -func (m *MsgVoteInbound) GetGasLimit() uint64 { +func (m *MsgVoteInbound) GetCallOptions() CallOptions { if m != nil { - return m.GasLimit + return m.CallOptions } - return 0 + return CallOptions{} } func (m *MsgVoteInbound) GetCoinType() coin.CoinType { @@ -1706,119 +1706,120 @@ func init() { } var fileDescriptor_15f0860550897740 = []byte{ - // 1782 bytes of a gzipped FileDescriptorProto + // 1798 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, 0xde, 0xbc, 0xaf, 0x99, 0xf7, - 0x1e, 0x0d, 0xbb, 0xcf, 0x09, 0x37, 0xad, 0x0b, 0xd3, 0xf5, 0x4a, 0xf8, 0x44, 0x7d, 0x52, 0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0xc6, 0x6f, 0x4d, 0x16, 0x17, 0x83, 0x68, 0xdf, 0xbd, 0x36, 0xa4, 0x37, 0x06, 0xb1, 0x66, 0x62, + 0x8a, 0x18, 0xf4, 0x23, 0xa6, 0x89, 0xc1, 0xf0, 0x16, 0x03, 0x8f, 0xa0, 0xc1, 0x06, 0xe3, 0xe1, + 0x34, 0xd5, 0x1b, 0x03, 0x4d, 0x73, 0x04, 0x8d, 0x6c, 0x29, 0xd4, 0xdf, 0x2b, 0xb0, 0x3a, 0xa2, + 0x9f, 0xf8, 0x70, 0xda, 0xe8, 0xc6, 0x91, 0xda, 0x0f, 0x66, 0x45, 0x46, 0x6a, 0x7d, 0xa9, 0x40, + 0x7e, 0x64, 0x93, 0x70, 0x30, 0x75, 0xd0, 0x07, 0xb0, 0xda, 0xe1, 0xec, 0xd8, 0x48, 0xb9, 0xbf, + 0x28, 0xb0, 0x39, 0xfe, 0x26, 0xfe, 0x78, 0x5a, 0x07, 0x8c, 0x10, 0xa0, 0x1d, 0xdd, 0x50, 0x40, + 0xa8, 0xeb, 0xe1, 0xd1, 0x57, 0x6f, 0x0a, 0xca, 0xd7, 0x6f, 0x0a, 0xca, 0x3f, 0xde, 0x14, 0x94, + 0xdf, 0xbc, 0x2d, 0xdc, 0xfa, 0xfa, 0x6d, 0xe1, 0xd6, 0xdf, 0xde, 0x16, 0x6e, 0xfd, 0x74, 0xaf, + 0xa7, 0x91, 0x09, 0xb6, 0xd8, 0x13, 0xff, 0x1a, 0xf0, 0xa8, 0x4d, 0xca, 0xdd, 0xbe, 0xff, 0xa0, + 0x04, 0x3d, 0x4d, 0x3d, 0x89, 0xc3, 0xc0, 0xc3, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x07, 0x78, + 0x5b, 0x4b, 0x6f, 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3119,11 +3120,16 @@ func (m *MsgVoteInbound) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x60 } - if m.GasLimit != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.GasLimit)) - i-- - dAtA[i] = 0x58 + { + size, err := m.CallOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x5a if m.InboundBlockHeight != 0 { i = encodeVarintTx(dAtA, i, uint64(m.InboundBlockHeight)) i-- @@ -3922,9 +3928,8 @@ func (m *MsgVoteInbound) Size() (n int) { if m.InboundBlockHeight != 0 { n += 1 + sovTx(uint64(m.InboundBlockHeight)) } - if m.GasLimit != 0 { - n += 1 + sovTx(uint64(m.GasLimit)) - } + l = m.CallOptions.Size() + n += 1 + l + sovTx(uint64(l)) if m.CoinType != 0 { n += 1 + sovTx(uint64(m.CoinType)) } @@ -6465,10 +6470,10 @@ func (m *MsgVoteInbound) Unmarshal(dAtA []byte) error { } } case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallOptions", wireType) } - m.GasLimit = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6478,11 +6483,25 @@ func (m *MsgVoteInbound) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.GasLimit |= uint64(b&0x7F) << shift + 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 err := m.CallOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CoinType", wireType) 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..07bbe3c8ce 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..566e5137e9 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..14fa67c796 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..0829035147 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..b4fbbba3e7 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..6b2647ed72 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: "0xbeab1dbbc21156e2aac914a276f7e40d31c5c27047fafb163c85e3eedf5deb31", 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..9272910488 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: "0xb68c75e560539bcd78a9a89ae85d12b083625c7c3942ed9675e537e0865b1726", 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..8fc904e506 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: "0xfb4aa9c7769b059de5055d325c753ec8f6345ac558761570b4a8890f1c7d69a0", 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..a3d166114d 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..1527b77838 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 } diff --git a/zetaclient/zetacore/tx_test.go b/zetaclient/zetacore/tx_test.go index b58981f67b..e5162eece1 100644 --- a/zetaclient/zetacore/tx_test.go +++ b/zetaclient/zetacore/tx_test.go @@ -426,7 +426,7 @@ func TestZetacore_PostVoteInbound(t *testing.T) { expectedOutput := observertypes.QueryHasVotedResponse{HasVoted: false} input := observertypes.QueryHasVotedRequest{ - BallotIdentifier: "0xd204175fc8500bcea563049cce918fa55134bd2d415d3fe137144f55e572b5ff", + BallotIdentifier: "0x79967c1c93c668323c5f817ef54298c93b073b08a4b7681583fd45b8b1b31775", VoterAddress: address.String(), } method := "/zetachain.zetacore.observer.Query/HasVoted"