diff --git a/changelog.md b/changelog.md index 207dcc1311..6d0da6ed99 100644 --- a/changelog.md +++ b/changelog.md @@ -11,6 +11,7 @@ * [2861](https://github.com/zeta-chain/node/pull/2861) - emit events from staking precompile * [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 +* [2904](https://github.com/zeta-chain/node/pull/2904) - authenticated zevm -> evm call ### Refactor diff --git a/cmd/zetae2e/local/v2.go b/cmd/zetae2e/local/v2.go index ce193bc32e..46369fa23b 100644 --- a/cmd/zetae2e/local/v2.go +++ b/cmd/zetae2e/local/v2.go @@ -20,7 +20,11 @@ func startV2Tests(eg *errgroup.Group, conf config.Config, deployerRunner *runner e2etests.TestV2ETHDepositAndCallName, e2etests.TestV2ETHWithdrawName, e2etests.TestV2ETHWithdrawAndCallName, + e2etests.TestV2ETHWithdrawAndAuthenticatedCallName, + e2etests.TestV2ETHWithdrawAndAuthenticatedCallThroughContractName, e2etests.TestV2ZEVMToEVMCallName, + e2etests.TestV2ZEVMToEVMAuthenticatedCallName, + e2etests.TestV2ZEVMToEVMAuthenticatedCallThroughContractName, e2etests.TestV2EVMToZEVMCallName, )) diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index 43ec9bc0e1..0090caa1f2 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -57303,6 +57303,8 @@ definitions: type: string tx_finalization_status: $ref: '#/definitions/crosschainTxFinalizationStatus' + is_arbitrary_call: + type: boolean crosschainOutboundTracker: type: object properties: diff --git a/docs/spec/crosschain/messages.md b/docs/spec/crosschain/messages.md index f2fba7cd1d..c8f46e3295 100644 --- a/docs/spec/crosschain/messages.md +++ b/docs/spec/crosschain/messages.md @@ -189,6 +189,7 @@ message MsgVoteInbound { uint64 event_index = 15; ProtocolContractVersion protocol_contract_version = 16; RevertOptions revert_options = 17; + bool is_arbitrary_call = 18; } ``` diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index dd9409e4cf..aaa42a262b 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -126,24 +126,28 @@ const ( /* V2 smart contract tests */ - TestV2ETHDepositName = "v2_eth_deposit" - TestV2ETHDepositAndCallName = "v2_eth_deposit_and_call" - TestV2ETHDepositAndCallRevertName = "v2_eth_deposit_and_call_revert" - TestV2ETHDepositAndCallRevertWithCallName = "v2_eth_deposit_and_call_revert_with_call" - TestV2ETHWithdrawName = "v2_eth_withdraw" - TestV2ETHWithdrawAndCallName = "v2_eth_withdraw_and_call" - TestV2ETHWithdrawAndCallRevertName = "v2_eth_withdraw_and_call_revert" - TestV2ETHWithdrawAndCallRevertWithCallName = "v2_eth_withdraw_and_call_revert_with_call" - TestV2ERC20DepositName = "v2_erc20_deposit" - TestV2ERC20DepositAndCallName = "v2_erc20_deposit_and_call" - TestV2ERC20DepositAndCallRevertName = "v2_erc20_deposit_and_call_revert" - TestV2ERC20DepositAndCallRevertWithCallName = "v2_erc20_deposit_and_call_revert_with_call" - TestV2ERC20WithdrawName = "v2_erc20_withdraw" - TestV2ERC20WithdrawAndCallName = "v2_erc20_withdraw_and_call" - TestV2ERC20WithdrawAndCallRevertName = "v2_erc20_withdraw_and_call_revert" - TestV2ERC20WithdrawAndCallRevertWithCallName = "v2_erc20_withdraw_and_call_revert_with_call" - TestV2ZEVMToEVMCallName = "v2_zevm_to_evm_call" - TestV2EVMToZEVMCallName = "v2_evm_to_zevm_call" + TestV2ETHDepositName = "v2_eth_deposit" + TestV2ETHDepositAndCallName = "v2_eth_deposit_and_call" + TestV2ETHDepositAndCallRevertName = "v2_eth_deposit_and_call_revert" + TestV2ETHDepositAndCallRevertWithCallName = "v2_eth_deposit_and_call_revert_with_call" + TestV2ETHWithdrawName = "v2_eth_withdraw" + TestV2ETHWithdrawAndCallName = "v2_eth_withdraw_and_call" + TestV2ETHWithdrawAndAuthenticatedCallName = "v2_eth_withdraw_and_authenticated_call" + TestV2ETHWithdrawAndAuthenticatedCallThroughContractName = "v2_eth_withdraw_and_authenticated_call_through_contract" + TestV2ETHWithdrawAndCallRevertName = "v2_eth_withdraw_and_call_revert" + TestV2ETHWithdrawAndCallRevertWithCallName = "v2_eth_withdraw_and_call_revert_with_call" + TestV2ERC20DepositName = "v2_erc20_deposit" + TestV2ERC20DepositAndCallName = "v2_erc20_deposit_and_call" + TestV2ERC20DepositAndCallRevertName = "v2_erc20_deposit_and_call_revert" + TestV2ERC20DepositAndCallRevertWithCallName = "v2_erc20_deposit_and_call_revert_with_call" + TestV2ERC20WithdrawName = "v2_erc20_withdraw" + TestV2ERC20WithdrawAndCallName = "v2_erc20_withdraw_and_call" + TestV2ERC20WithdrawAndCallRevertName = "v2_erc20_withdraw_and_call_revert" + TestV2ERC20WithdrawAndCallRevertWithCallName = "v2_erc20_withdraw_and_call_revert_with_call" + TestV2ZEVMToEVMCallName = "v2_zevm_to_evm_call" + TestV2ZEVMToEVMAuthenticatedCallName = "v2_zevm_to_evm_authenticated_call" + TestV2ZEVMToEVMAuthenticatedCallThroughContractName = "v2_zevm_to_evm_authenticated_call_through_contract" + TestV2EVMToZEVMCallName = "v2_evm_to_zevm_call" /* Operational tests @@ -738,6 +742,22 @@ var AllE2ETests = []runner.E2ETest{ }, TestV2ETHWithdrawAndCall, ), + runner.NewE2ETest( + TestV2ETHWithdrawAndAuthenticatedCallName, + "withdraw Ether from ZEVM and authenticated call a contract using V2 contract", + []runner.ArgDefinition{ + {Description: "amount in wei", DefaultValue: "100000"}, + }, + TestV2ETHWithdrawAndAuthenticatedCall, + ), + runner.NewE2ETest( + TestV2ETHWithdrawAndAuthenticatedCallThroughContractName, + "withdraw Ether from ZEVM and authenticated call a contract using V2 contract through intermediary contract", + []runner.ArgDefinition{ + {Description: "amount in wei", DefaultValue: "100000"}, + }, + TestV2ETHWithdrawAndAuthenticatedCallThroughContract, + ), runner.NewE2ETest( TestV2ETHWithdrawAndCallRevertName, "withdraw Ether from ZEVM and call a contract using V2 contract that reverts", @@ -824,6 +844,18 @@ var AllE2ETests = []runner.E2ETest{ []runner.ArgDefinition{}, TestV2ZEVMToEVMCall, ), + runner.NewE2ETest( + TestV2ZEVMToEVMAuthenticatedCallName, + "zevm -> evm call using V2 contract", + []runner.ArgDefinition{}, + TestV2ZEVMToEVMAuthenticatedCall, + ), + runner.NewE2ETest( + TestV2ZEVMToEVMAuthenticatedCallThroughContractName, + "zevm -> evm call using V2 contract through intermediary contract", + []runner.ArgDefinition{}, + TestV2ZEVMToEVMAuthenticatedCallThroughContract, + ), runner.NewE2ETest( TestV2EVMToZEVMCallName, "evm -> zevm call using V2 contract", diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_authenticated_call.go b/e2e/e2etests/test_v2_eth_withdraw_and_authenticated_call.go new file mode 100644 index 0000000000..74383fc294 --- /dev/null +++ b/e2e/e2etests/test_v2_eth_withdraw_and_authenticated_call.go @@ -0,0 +1,60 @@ +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" + + "github.com/zeta-chain/node/e2e/runner" + "github.com/zeta-chain/node/e2e/utils" + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" +) + +const payloadMessageAuthenticatedWithdrawETH = "this is a test ETH withdraw and authenticated call payload" + +func TestV2ETHWithdrawAndAuthenticatedCall(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, 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.V2ETHWithdrawAndAuthenticatedCall( + r.TestDAppV2EVMAddr, + amount, + []byte(payloadMessageAuthenticatedWithdrawETH), + 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, 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_authenticated_call_through_contract.go b/e2e/e2etests/test_v2_eth_withdraw_and_authenticated_call_through_contract.go new file mode 100644 index 0000000000..55c02bf1f8 --- /dev/null +++ b/e2e/e2etests/test_v2_eth_withdraw_and_authenticated_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" + testgatewayzevmcaller "github.com/zeta-chain/node/pkg/contracts/testgatewayzevmcaller" + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" +) + +const payloadMessageAuthenticatedWithdrawETHThroughContract = "this is a test ETH withdraw and authenticated call payload through contract" + +func TestV2ETHWithdrawAndAuthenticatedCallThroughContract(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 := testgatewayzevmcaller.DeployTestGatewayZEVMCaller( + 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), + testgatewayzevmcaller.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), + testgatewayzevmcaller.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_authenticated_call.go b/e2e/e2etests/test_v2_zevm_to_evm_authenticated_call.go new file mode 100644 index 0000000000..a9ac4a49f3 --- /dev/null +++ b/e2e/e2etests/test_v2_zevm_to_evm_authenticated_call.go @@ -0,0 +1,51 @@ +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" + + "github.com/zeta-chain/node/e2e/runner" + "github.com/zeta-chain/node/e2e/utils" + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" +) + +const payloadMessageEVMAuthenticatedCall = "this is a test EVM authenticated call payload" + +func TestV2ZEVMToEVMAuthenticatedCall(r *runner.E2ERunner, args []string) { + require.Len(r, args, 0) + + r.AssertTestDAppEVMCalled(false, payloadMessageEVMAuthenticatedCall, big.NewInt(0)) + + // necessary approval for fee payment + 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 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) + 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, 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_authenticated_call_through_contract.go b/e2e/e2etests/test_v2_zevm_to_evm_authenticated_call_through_contract.go new file mode 100644 index 0000000000..d991787810 --- /dev/null +++ b/e2e/e2etests/test_v2_zevm_to_evm_authenticated_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" + testgatewayzevmcaller "github.com/zeta-chain/node/pkg/contracts/testgatewayzevmcaller" + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" +) + +const payloadMessageEVMAuthenticatedCallThroughContract = "this is a test EVM authenticated call payload through contract" + +func TestV2ZEVMToEVMAuthenticatedCallThroughContract(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 := testgatewayzevmcaller.DeployTestGatewayZEVMCaller( + 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), + testgatewayzevmcaller.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), + testgatewayzevmcaller.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/e2etests/test_v2_zevm_to_evm_call.go b/e2e/e2etests/test_v2_zevm_to_evm_call.go index c38d328db8..d36c4f4f15 100644 --- a/e2e/e2etests/test_v2_zevm_to_evm_call.go +++ b/e2e/e2etests/test_v2_zevm_to_evm_call.go @@ -21,7 +21,7 @@ func TestV2ZEVMToEVMCall(r *runner.E2ERunner, args []string) { // Necessary approval for fee payment r.ApproveETHZRC20(r.GatewayZEVMAddr) - // perform the withdraw + // perform the call tx := r.V2ZEVMToEMVCall(r.TestDAppV2EVMAddr, r.EncodeSimpleCall(payloadMessageEVMCall), gatewayzevm.RevertOptions{ OnRevertGasLimit: big.NewInt(0), }) diff --git a/e2e/runner/v2_zevm.go b/e2e/runner/v2_zevm.go index 681696b195..eef2d3de0f 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" + + testgatewayzevmcaller "github.com/zeta-chain/node/pkg/contracts/testgatewayzevmcaller" ) var gasLimit = big.NewInt(1000000) @@ -50,6 +52,56 @@ func (r *E2ERunner) V2ETHWithdrawAndCall( return tx } +// V2ETHWithdrawAndCall calls WithdrawAndCall of Gateway with gas token on ZEVM using authenticated call +func (r *E2ERunner) V2ETHWithdrawAndAuthenticatedCall( + receiver ethcommon.Address, + amount *big.Int, + payload []byte, + revertOptions gatewayzevm.RevertOptions, +) *ethtypes.Transaction { + tx, err := r.GatewayZEVM.WithdrawAndCall2( + r.ZEVMAuth, + receiver.Bytes(), + amount, + r.ETHZRC20Addr, + payload, + gatewayzevm.CallOptions{ + IsArbitraryCall: false, + GasLimit: gasLimit, + }, + revertOptions, + ) + require.NoError(r, err) + + return tx +} + +// V2ETHWithdrawAndCall calls WithdrawAndCall of Gateway with gas token on ZEVM using authenticated call +// through contract +func (r *E2ERunner) V2ETHWithdrawAndAuthenticatedCallThroughContract( + gatewayZEVMCaller *testgatewayzevmcaller.TestGatewayZEVMCaller, + receiver ethcommon.Address, + amount *big.Int, + payload []byte, + revertOptions testgatewayzevmcaller.RevertOptions, +) *ethtypes.Transaction { + tx, err := gatewayZEVMCaller.WithdrawAndCallGatewayZEVM( + r.ZEVMAuth, + receiver.Bytes(), + amount, + r.ETHZRC20Addr, + payload, + testgatewayzevmcaller.CallOptions{ + IsArbitraryCall: false, + GasLimit: gasLimit, + }, + revertOptions, + ) + require.NoError(r, err) + + return tx +} + // V2ERC20Withdraw calls Withdraw of Gateway with erc20 token on ZEVM func (r *E2ERunner) V2ERC20Withdraw( receiver ethcommon.Address, @@ -103,7 +155,7 @@ func (r *E2ERunner) V2ZEVMToEMVCall( payload []byte, revertOptions gatewayzevm.RevertOptions, ) *ethtypes.Transaction { - tx, err := r.GatewayZEVM.Call( + tx, err := r.GatewayZEVM.Call0( r.ZEVMAuth, receiver.Bytes(), r.ETHZRC20Addr, @@ -115,3 +167,48 @@ func (r *E2ERunner) V2ZEVMToEMVCall( return tx } + +// V2ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM +func (r *E2ERunner) V2ZEVMToEMVAuthenticatedCall( + receiver ethcommon.Address, + payload []byte, + revertOptions gatewayzevm.RevertOptions, +) *ethtypes.Transaction { + tx, err := r.GatewayZEVM.Call( + r.ZEVMAuth, + receiver.Bytes(), + r.ETHZRC20Addr, + payload, + gatewayzevm.CallOptions{ + GasLimit: gasLimit, + IsArbitraryCall: false, + }, + revertOptions, + ) + require.NoError(r, err) + + return tx +} + +// V2ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM through contract +func (r *E2ERunner) V2ZEVMToEMVAuthenticatedCallThroughContract( + gatewayZEVMCaller *testgatewayzevmcaller.TestGatewayZEVMCaller, + receiver ethcommon.Address, + payload []byte, + revertOptions testgatewayzevmcaller.RevertOptions, +) *ethtypes.Transaction { + tx, err := gatewayZEVMCaller.CallGatewayZEVM( + r.ZEVMAuth, + receiver.Bytes(), + r.ETHZRC20Addr, + payload, + testgatewayzevmcaller.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/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/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.abi b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.abi new file mode 100644 index 0000000000..373cc949b7 --- /dev/null +++ b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.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/testgatewayzevmcaller/TestGatewayZEVMCaller.bin b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.bin new file mode 100644 index 0000000000..7c89d7c296 --- /dev/null +++ b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.bin @@ -0,0 +1 @@ +60806040523480156200001157600080fd5b50604051620011613803806200116183398181016040528101906200003791906200012a565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505062000171565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000f282620000c5565b9050919050565b6200010481620000e5565b81146200011057600080fd5b50565b6000815190506200012481620000f9565b92915050565b60008060408385031215620001445762000143620000c0565b5b6000620001548582860162000113565b9250506020620001678582860162000113565b9150509250929050565b610fe080620001816000396000f3fe60806040526004361061003f5760003560e01c806325859e62146100445780632c5d24ae1461006d57806362543ae714610077578063f66f4625146100a0575b600080fd5b34801561005057600080fd5b5061006b60048036038101906100669190610795565b6100c9565b005b61007561020d565b005b34801561008357600080fd5b5061009e6004803603810190610099919061089d565b610292565b005b3480156100ac57600080fd5b506100c760048036038101906100c29190610984565b6103d9565b005b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b815260040161012c929190610abf565b6020604051808303816000875af115801561014b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016f9190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306cb89838787878787876040518763ffffffff1660e01b81526004016101d396959493929190610e18565b600060405180830381600087803b1580156101ed57600080fd5b505af1158015610201573d6000803e3d6000fd5b50505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561027757600080fd5b505af115801561028b573d6000803e3d6000fd5b5050505050565b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b81526004016102f5929190610abf565b6020604051808303816000875af1158015610314573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103389190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637b15118b888888888888886040518863ffffffff1660e01b815260040161039e9796959493929190610e91565b600060405180830381600087803b1580156103b857600080fd5b505af11580156103cc573d6000803e3d6000fd5b5050505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886040518363ffffffff1660e01b8152600401610456929190610f09565b6020604051808303816000875af1158015610475573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104999190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632810ae63888888888888886040518863ffffffff1660e01b81526004016104ff9796959493929190610f32565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b5050505050505050505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105a182610558565b810181811067ffffffffffffffff821117156105c0576105bf610569565b5b80604052505050565b60006105d361053a565b90506105df8282610598565b919050565b600067ffffffffffffffff8211156105ff576105fe610569565b5b61060882610558565b9050602081019050919050565b82818337600083830152505050565b6000610637610632846105e4565b6105c9565b90508281526020810184848401111561065357610652610553565b5b61065e848285610615565b509392505050565b600082601f83011261067b5761067a61054e565b5b813561068b848260208601610624565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006106bf82610694565b9050919050565b6106cf816106b4565b81146106da57600080fd5b50565b6000813590506106ec816106c6565b92915050565b600080fd5b600080fd5b60008083601f8401126107125761071161054e565b5b8235905067ffffffffffffffff81111561072f5761072e6106f2565b5b60208301915083600182028301111561074b5761074a6106f7565b5b9250929050565b600080fd5b60006040828403121561076d5761076c610752565b5b81905092915050565b600060a0828403121561078c5761078b610752565b5b81905092915050565b60008060008060008060c087890312156107b2576107b1610544565b5b600087013567ffffffffffffffff8111156107d0576107cf610549565b5b6107dc89828a01610666565b96505060206107ed89828a016106dd565b955050604087013567ffffffffffffffff81111561080e5761080d610549565b5b61081a89828a016106fc565b9450945050606061082d89828a01610757565b92505060a087013567ffffffffffffffff81111561084e5761084d610549565b5b61085a89828a01610776565b9150509295509295509295565b6000819050919050565b61087a81610867565b811461088557600080fd5b50565b60008135905061089781610871565b92915050565b600080600080600080600060e0888a0312156108bc576108bb610544565b5b600088013567ffffffffffffffff8111156108da576108d9610549565b5b6108e68a828b01610666565b97505060206108f78a828b01610888565b96505060406109088a828b016106dd565b955050606088013567ffffffffffffffff81111561092957610928610549565b5b6109358a828b016106fc565b945094505060806109488a828b01610757565b92505060c088013567ffffffffffffffff81111561096957610968610549565b5b6109758a828b01610776565b91505092959891949750929550565b600080600080600080600060e0888a0312156109a3576109a2610544565b5b600088013567ffffffffffffffff8111156109c1576109c0610549565b5b6109cd8a828b01610666565b97505060206109de8a828b01610888565b96505060406109ef8a828b01610888565b955050606088013567ffffffffffffffff811115610a1057610a0f610549565b5b610a1c8a828b016106fc565b94509450506080610a2f8a828b01610757565b92505060c088013567ffffffffffffffff811115610a5057610a4f610549565b5b610a5c8a828b01610776565b91505092959891949750929550565b610a74816106b4565b82525050565b6000819050919050565b6000819050919050565b6000610aa9610aa4610a9f84610a7a565b610a84565b610867565b9050919050565b610ab981610a8e565b82525050565b6000604082019050610ad46000830185610a6b565b610ae16020830184610ab0565b9392505050565b60008115159050919050565b610afd81610ae8565b8114610b0857600080fd5b50565b600081519050610b1a81610af4565b92915050565b600060208284031215610b3657610b35610544565b5b6000610b4484828501610b0b565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610b87578082015181840152602081019050610b6c565b83811115610b96576000848401525b50505050565b6000610ba782610b4d565b610bb18185610b58565b9350610bc1818560208601610b69565b610bca81610558565b840191505092915050565b6000610be18385610b58565b9350610bee838584610615565b610bf783610558565b840190509392505050565b6000610c116020840184610888565b905092915050565b610c2281610867565b82525050565b600081359050610c3781610af4565b92915050565b6000610c4c6020840184610c28565b905092915050565b610c5d81610ae8565b82525050565b60408201610c746000830183610c02565b610c816000850182610c19565b50610c8f6020830183610c3d565b610c9c6020850182610c54565b50505050565b6000610cb160208401846106dd565b905092915050565b610cc2816106b4565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610cf457610cf3610cd2565b5b83810192508235915060208301925067ffffffffffffffff821115610d1c57610d1b610cc8565b5b600182023603841315610d3257610d31610ccd565b5b509250929050565b600082825260208201905092915050565b6000610d578385610d3a565b9350610d64838584610615565b610d6d83610558565b840190509392505050565b600060a08301610d8b6000840184610ca2565b610d986000860182610cb9565b50610da66020840184610c3d565b610db36020860182610c54565b50610dc16040840184610ca2565b610dce6040860182610cb9565b50610ddc6060840184610cd7565b8583036060870152610def838284610d4b565b92505050610e006080840184610c02565b610e0d6080860182610c19565b508091505092915050565b600060c0820190508181036000830152610e328189610b9c565b9050610e416020830188610a6b565b8181036040830152610e54818688610bd5565b9050610e636060830185610c63565b81810360a0830152610e758184610d78565b9050979650505050505050565b610e8b81610867565b82525050565b600060e0820190508181036000830152610eab818a610b9c565b9050610eba6020830189610e82565b610ec76040830188610a6b565b8181036060830152610eda818688610bd5565b9050610ee96080830185610c63565b81810360c0830152610efb8184610d78565b905098975050505050505050565b6000604082019050610f1e6000830185610a6b565b610f2b6020830184610e82565b9392505050565b600060e0820190508181036000830152610f4c818a610b9c565b9050610f5b6020830189610e82565b610f686040830188610e82565b8181036060830152610f7b818688610bd5565b9050610f8a6080830185610c63565b81810360c0830152610f9c8184610d78565b90509897505050505050505056fea26469706673582212208bce4e5eb92aaf90cbf3a7034ad19f03506d28b0b05ba0e958bddedd2cd46e4b64736f6c634300080a0033 diff --git a/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.go b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.go new file mode 100644 index 0000000000..67061e6482 --- /dev/null +++ b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.go @@ -0,0 +1,302 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package testgatewayzevmcaller + +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 +} + +// TestGatewayZEVMCallerMetaData contains all meta data concerning the TestGatewayZEVMCaller contract. +var TestGatewayZEVMCallerMetaData = &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: "0x60806040523480156200001157600080fd5b50604051620011613803806200116183398181016040528101906200003791906200012a565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505062000171565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000f282620000c5565b9050919050565b6200010481620000e5565b81146200011057600080fd5b50565b6000815190506200012481620000f9565b92915050565b60008060408385031215620001445762000143620000c0565b5b6000620001548582860162000113565b9250506020620001678582860162000113565b9150509250929050565b610fe080620001816000396000f3fe60806040526004361061003f5760003560e01c806325859e62146100445780632c5d24ae1461006d57806362543ae714610077578063f66f4625146100a0575b600080fd5b34801561005057600080fd5b5061006b60048036038101906100669190610795565b6100c9565b005b61007561020d565b005b34801561008357600080fd5b5061009e6004803603810190610099919061089d565b610292565b005b3480156100ac57600080fd5b506100c760048036038101906100c29190610984565b6103d9565b005b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b815260040161012c929190610abf565b6020604051808303816000875af115801561014b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016f9190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306cb89838787878787876040518763ffffffff1660e01b81526004016101d396959493929190610e18565b600060405180830381600087803b1580156101ed57600080fd5b505af1158015610201573d6000803e3d6000fd5b50505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561027757600080fd5b505af115801561028b573d6000803e3d6000fd5b5050505050565b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b81526004016102f5929190610abf565b6020604051808303816000875af1158015610314573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103389190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637b15118b888888888888886040518863ffffffff1660e01b815260040161039e9796959493929190610e91565b600060405180830381600087803b1580156103b857600080fd5b505af11580156103cc573d6000803e3d6000fd5b5050505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886040518363ffffffff1660e01b8152600401610456929190610f09565b6020604051808303816000875af1158015610475573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104999190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632810ae63888888888888886040518863ffffffff1660e01b81526004016104ff9796959493929190610f32565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b5050505050505050505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105a182610558565b810181811067ffffffffffffffff821117156105c0576105bf610569565b5b80604052505050565b60006105d361053a565b90506105df8282610598565b919050565b600067ffffffffffffffff8211156105ff576105fe610569565b5b61060882610558565b9050602081019050919050565b82818337600083830152505050565b6000610637610632846105e4565b6105c9565b90508281526020810184848401111561065357610652610553565b5b61065e848285610615565b509392505050565b600082601f83011261067b5761067a61054e565b5b813561068b848260208601610624565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006106bf82610694565b9050919050565b6106cf816106b4565b81146106da57600080fd5b50565b6000813590506106ec816106c6565b92915050565b600080fd5b600080fd5b60008083601f8401126107125761071161054e565b5b8235905067ffffffffffffffff81111561072f5761072e6106f2565b5b60208301915083600182028301111561074b5761074a6106f7565b5b9250929050565b600080fd5b60006040828403121561076d5761076c610752565b5b81905092915050565b600060a0828403121561078c5761078b610752565b5b81905092915050565b60008060008060008060c087890312156107b2576107b1610544565b5b600087013567ffffffffffffffff8111156107d0576107cf610549565b5b6107dc89828a01610666565b96505060206107ed89828a016106dd565b955050604087013567ffffffffffffffff81111561080e5761080d610549565b5b61081a89828a016106fc565b9450945050606061082d89828a01610757565b92505060a087013567ffffffffffffffff81111561084e5761084d610549565b5b61085a89828a01610776565b9150509295509295509295565b6000819050919050565b61087a81610867565b811461088557600080fd5b50565b60008135905061089781610871565b92915050565b600080600080600080600060e0888a0312156108bc576108bb610544565b5b600088013567ffffffffffffffff8111156108da576108d9610549565b5b6108e68a828b01610666565b97505060206108f78a828b01610888565b96505060406109088a828b016106dd565b955050606088013567ffffffffffffffff81111561092957610928610549565b5b6109358a828b016106fc565b945094505060806109488a828b01610757565b92505060c088013567ffffffffffffffff81111561096957610968610549565b5b6109758a828b01610776565b91505092959891949750929550565b600080600080600080600060e0888a0312156109a3576109a2610544565b5b600088013567ffffffffffffffff8111156109c1576109c0610549565b5b6109cd8a828b01610666565b97505060206109de8a828b01610888565b96505060406109ef8a828b01610888565b955050606088013567ffffffffffffffff811115610a1057610a0f610549565b5b610a1c8a828b016106fc565b94509450506080610a2f8a828b01610757565b92505060c088013567ffffffffffffffff811115610a5057610a4f610549565b5b610a5c8a828b01610776565b91505092959891949750929550565b610a74816106b4565b82525050565b6000819050919050565b6000819050919050565b6000610aa9610aa4610a9f84610a7a565b610a84565b610867565b9050919050565b610ab981610a8e565b82525050565b6000604082019050610ad46000830185610a6b565b610ae16020830184610ab0565b9392505050565b60008115159050919050565b610afd81610ae8565b8114610b0857600080fd5b50565b600081519050610b1a81610af4565b92915050565b600060208284031215610b3657610b35610544565b5b6000610b4484828501610b0b565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610b87578082015181840152602081019050610b6c565b83811115610b96576000848401525b50505050565b6000610ba782610b4d565b610bb18185610b58565b9350610bc1818560208601610b69565b610bca81610558565b840191505092915050565b6000610be18385610b58565b9350610bee838584610615565b610bf783610558565b840190509392505050565b6000610c116020840184610888565b905092915050565b610c2281610867565b82525050565b600081359050610c3781610af4565b92915050565b6000610c4c6020840184610c28565b905092915050565b610c5d81610ae8565b82525050565b60408201610c746000830183610c02565b610c816000850182610c19565b50610c8f6020830183610c3d565b610c9c6020850182610c54565b50505050565b6000610cb160208401846106dd565b905092915050565b610cc2816106b4565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610cf457610cf3610cd2565b5b83810192508235915060208301925067ffffffffffffffff821115610d1c57610d1b610cc8565b5b600182023603841315610d3257610d31610ccd565b5b509250929050565b600082825260208201905092915050565b6000610d578385610d3a565b9350610d64838584610615565b610d6d83610558565b840190509392505050565b600060a08301610d8b6000840184610ca2565b610d986000860182610cb9565b50610da66020840184610c3d565b610db36020860182610c54565b50610dc16040840184610ca2565b610dce6040860182610cb9565b50610ddc6060840184610cd7565b8583036060870152610def838284610d4b565b92505050610e006080840184610c02565b610e0d6080860182610c19565b508091505092915050565b600060c0820190508181036000830152610e328189610b9c565b9050610e416020830188610a6b565b8181036040830152610e54818688610bd5565b9050610e636060830185610c63565b81810360a0830152610e758184610d78565b9050979650505050505050565b610e8b81610867565b82525050565b600060e0820190508181036000830152610eab818a610b9c565b9050610eba6020830189610e82565b610ec76040830188610a6b565b8181036060830152610eda818688610bd5565b9050610ee96080830185610c63565b81810360c0830152610efb8184610d78565b905098975050505050505050565b6000604082019050610f1e6000830185610a6b565b610f2b6020830184610e82565b9392505050565b600060e0820190508181036000830152610f4c818a610b9c565b9050610f5b6020830189610e82565b610f686040830188610e82565b8181036060830152610f7b818688610bd5565b9050610f8a6080830185610c63565b81810360c0830152610f9c8184610d78565b90509897505050505050505056fea26469706673582212208bce4e5eb92aaf90cbf3a7034ad19f03506d28b0b05ba0e958bddedd2cd46e4b64736f6c634300080a0033", +} + +// TestGatewayZEVMCallerABI is the input ABI used to generate the binding from. +// Deprecated: Use TestGatewayZEVMCallerMetaData.ABI instead. +var TestGatewayZEVMCallerABI = TestGatewayZEVMCallerMetaData.ABI + +// TestGatewayZEVMCallerBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use TestGatewayZEVMCallerMetaData.Bin instead. +var TestGatewayZEVMCallerBin = TestGatewayZEVMCallerMetaData.Bin + +// DeployTestGatewayZEVMCaller deploys a new Ethereum contract, binding an instance of TestGatewayZEVMCaller to it. +func DeployTestGatewayZEVMCaller(auth *bind.TransactOpts, backend bind.ContractBackend, gatewayZEVMAddress common.Address, wzetaAddress common.Address) (common.Address, *types.Transaction, *TestGatewayZEVMCaller, error) { + parsed, err := TestGatewayZEVMCallerMetaData.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(TestGatewayZEVMCallerBin), backend, gatewayZEVMAddress, wzetaAddress) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &TestGatewayZEVMCaller{TestGatewayZEVMCallerCaller: TestGatewayZEVMCallerCaller{contract: contract}, TestGatewayZEVMCallerTransactor: TestGatewayZEVMCallerTransactor{contract: contract}, TestGatewayZEVMCallerFilterer: TestGatewayZEVMCallerFilterer{contract: contract}}, nil +} + +// TestGatewayZEVMCaller is an auto generated Go binding around an Ethereum contract. +type TestGatewayZEVMCaller struct { + TestGatewayZEVMCallerCaller // Read-only binding to the contract + TestGatewayZEVMCallerTransactor // Write-only binding to the contract + TestGatewayZEVMCallerFilterer // Log filterer for contract events +} + +// TestGatewayZEVMCallerCaller is an auto generated read-only Go binding around an Ethereum contract. +type TestGatewayZEVMCallerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TestGatewayZEVMCallerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TestGatewayZEVMCallerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TestGatewayZEVMCallerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TestGatewayZEVMCallerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TestGatewayZEVMCallerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TestGatewayZEVMCallerSession struct { + Contract *TestGatewayZEVMCaller // 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 +} + +// TestGatewayZEVMCallerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TestGatewayZEVMCallerCallerSession struct { + Contract *TestGatewayZEVMCallerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TestGatewayZEVMCallerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TestGatewayZEVMCallerTransactorSession struct { + Contract *TestGatewayZEVMCallerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TestGatewayZEVMCallerRaw is an auto generated low-level Go binding around an Ethereum contract. +type TestGatewayZEVMCallerRaw struct { + Contract *TestGatewayZEVMCaller // Generic contract binding to access the raw methods on +} + +// TestGatewayZEVMCallerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TestGatewayZEVMCallerCallerRaw struct { + Contract *TestGatewayZEVMCallerCaller // Generic read-only contract binding to access the raw methods on +} + +// TestGatewayZEVMCallerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TestGatewayZEVMCallerTransactorRaw struct { + Contract *TestGatewayZEVMCallerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTestGatewayZEVMCaller creates a new instance of TestGatewayZEVMCaller, bound to a specific deployed contract. +func NewTestGatewayZEVMCaller(address common.Address, backend bind.ContractBackend) (*TestGatewayZEVMCaller, error) { + contract, err := bindTestGatewayZEVMCaller(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TestGatewayZEVMCaller{TestGatewayZEVMCallerCaller: TestGatewayZEVMCallerCaller{contract: contract}, TestGatewayZEVMCallerTransactor: TestGatewayZEVMCallerTransactor{contract: contract}, TestGatewayZEVMCallerFilterer: TestGatewayZEVMCallerFilterer{contract: contract}}, nil +} + +// NewTestGatewayZEVMCallerCaller creates a new read-only instance of TestGatewayZEVMCaller, bound to a specific deployed contract. +func NewTestGatewayZEVMCallerCaller(address common.Address, caller bind.ContractCaller) (*TestGatewayZEVMCallerCaller, error) { + contract, err := bindTestGatewayZEVMCaller(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TestGatewayZEVMCallerCaller{contract: contract}, nil +} + +// NewTestGatewayZEVMCallerTransactor creates a new write-only instance of TestGatewayZEVMCaller, bound to a specific deployed contract. +func NewTestGatewayZEVMCallerTransactor(address common.Address, transactor bind.ContractTransactor) (*TestGatewayZEVMCallerTransactor, error) { + contract, err := bindTestGatewayZEVMCaller(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TestGatewayZEVMCallerTransactor{contract: contract}, nil +} + +// NewTestGatewayZEVMCallerFilterer creates a new log filterer instance of TestGatewayZEVMCaller, bound to a specific deployed contract. +func NewTestGatewayZEVMCallerFilterer(address common.Address, filterer bind.ContractFilterer) (*TestGatewayZEVMCallerFilterer, error) { + contract, err := bindTestGatewayZEVMCaller(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TestGatewayZEVMCallerFilterer{contract: contract}, nil +} + +// bindTestGatewayZEVMCaller binds a generic wrapper to an already deployed contract. +func bindTestGatewayZEVMCaller(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TestGatewayZEVMCallerMetaData.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TestGatewayZEVMCaller.Contract.TestGatewayZEVMCallerCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.TestGatewayZEVMCallerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TestGatewayZEVMCaller *TestGatewayZEVMCallerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.TestGatewayZEVMCallerTransactor.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactor) CallGatewayZEVM(opts *bind.TransactOpts, receiver []byte, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerSession) CallGatewayZEVM(receiver []byte, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.CallGatewayZEVM(&_TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactorSession) CallGatewayZEVM(receiver []byte, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.CallGatewayZEVM(&_TestGatewayZEVMCaller.TransactOpts, receiver, zrc20, message, callOptions, revertOptions) +} + +// DepositWZETA is a paid mutator transaction binding the contract method 0x2c5d24ae. +// +// Solidity: function depositWZETA() payable returns() +func (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactor) DepositWZETA(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.contract.Transact(opts, "depositWZETA") +} + +// DepositWZETA is a paid mutator transaction binding the contract method 0x2c5d24ae. +// +// Solidity: function depositWZETA() payable returns() +func (_TestGatewayZEVMCaller *TestGatewayZEVMCallerSession) DepositWZETA() (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.DepositWZETA(&_TestGatewayZEVMCaller.TransactOpts) +} + +// DepositWZETA is a paid mutator transaction binding the contract method 0x2c5d24ae. +// +// Solidity: function depositWZETA() payable returns() +func (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactorSession) DepositWZETA() (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.DepositWZETA(&_TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactor) WithdrawAndCallGatewayZEVM(opts *bind.TransactOpts, receiver []byte, amount *big.Int, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerSession) WithdrawAndCallGatewayZEVM(receiver []byte, amount *big.Int, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.WithdrawAndCallGatewayZEVM(&_TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactorSession) WithdrawAndCallGatewayZEVM(receiver []byte, amount *big.Int, zrc20 common.Address, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.WithdrawAndCallGatewayZEVM(&_TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactor) WithdrawAndCallGatewayZEVM0(opts *bind.TransactOpts, receiver []byte, amount *big.Int, chainId *big.Int, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerSession) WithdrawAndCallGatewayZEVM0(receiver []byte, amount *big.Int, chainId *big.Int, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.WithdrawAndCallGatewayZEVM0(&_TestGatewayZEVMCaller.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 (_TestGatewayZEVMCaller *TestGatewayZEVMCallerTransactorSession) WithdrawAndCallGatewayZEVM0(receiver []byte, amount *big.Int, chainId *big.Int, message []byte, callOptions CallOptions, revertOptions RevertOptions) (*types.Transaction, error) { + return _TestGatewayZEVMCaller.Contract.WithdrawAndCallGatewayZEVM0(&_TestGatewayZEVMCaller.TransactOpts, receiver, amount, chainId, message, callOptions, revertOptions) +} diff --git a/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.json b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.json new file mode 100644 index 0000000000..572161ad05 --- /dev/null +++ b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.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": "60806040523480156200001157600080fd5b50604051620011613803806200116183398181016040528101906200003791906200012a565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505062000171565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000f282620000c5565b9050919050565b6200010481620000e5565b81146200011057600080fd5b50565b6000815190506200012481620000f9565b92915050565b60008060408385031215620001445762000143620000c0565b5b6000620001548582860162000113565b9250506020620001678582860162000113565b9150509250929050565b610fe080620001816000396000f3fe60806040526004361061003f5760003560e01c806325859e62146100445780632c5d24ae1461006d57806362543ae714610077578063f66f4625146100a0575b600080fd5b34801561005057600080fd5b5061006b60048036038101906100669190610795565b6100c9565b005b61007561020d565b005b34801561008357600080fd5b5061009e6004803603810190610099919061089d565b610292565b005b3480156100ac57600080fd5b506100c760048036038101906100c29190610984565b6103d9565b005b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b815260040161012c929190610abf565b6020604051808303816000875af115801561014b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016f9190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306cb89838787878787876040518763ffffffff1660e01b81526004016101d396959493929190610e18565b600060405180830381600087803b1580156101ed57600080fd5b505af1158015610201573d6000803e3d6000fd5b50505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561027757600080fd5b505af115801561028b573d6000803e3d6000fd5b5050505050565b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006040518363ffffffff1660e01b81526004016102f5929190610abf565b6020604051808303816000875af1158015610314573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103389190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637b15118b888888888888886040518863ffffffff1660e01b815260040161039e9796959493929190610e91565b600060405180830381600087803b1580156103b857600080fd5b505af11580156103cc573d6000803e3d6000fd5b5050505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886040518363ffffffff1660e01b8152600401610456929190610f09565b6020604051808303816000875af1158015610475573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104999190610b20565b5060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632810ae63888888888888886040518863ffffffff1660e01b81526004016104ff9796959493929190610f32565b600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b5050505050505050505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105a182610558565b810181811067ffffffffffffffff821117156105c0576105bf610569565b5b80604052505050565b60006105d361053a565b90506105df8282610598565b919050565b600067ffffffffffffffff8211156105ff576105fe610569565b5b61060882610558565b9050602081019050919050565b82818337600083830152505050565b6000610637610632846105e4565b6105c9565b90508281526020810184848401111561065357610652610553565b5b61065e848285610615565b509392505050565b600082601f83011261067b5761067a61054e565b5b813561068b848260208601610624565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006106bf82610694565b9050919050565b6106cf816106b4565b81146106da57600080fd5b50565b6000813590506106ec816106c6565b92915050565b600080fd5b600080fd5b60008083601f8401126107125761071161054e565b5b8235905067ffffffffffffffff81111561072f5761072e6106f2565b5b60208301915083600182028301111561074b5761074a6106f7565b5b9250929050565b600080fd5b60006040828403121561076d5761076c610752565b5b81905092915050565b600060a0828403121561078c5761078b610752565b5b81905092915050565b60008060008060008060c087890312156107b2576107b1610544565b5b600087013567ffffffffffffffff8111156107d0576107cf610549565b5b6107dc89828a01610666565b96505060206107ed89828a016106dd565b955050604087013567ffffffffffffffff81111561080e5761080d610549565b5b61081a89828a016106fc565b9450945050606061082d89828a01610757565b92505060a087013567ffffffffffffffff81111561084e5761084d610549565b5b61085a89828a01610776565b9150509295509295509295565b6000819050919050565b61087a81610867565b811461088557600080fd5b50565b60008135905061089781610871565b92915050565b600080600080600080600060e0888a0312156108bc576108bb610544565b5b600088013567ffffffffffffffff8111156108da576108d9610549565b5b6108e68a828b01610666565b97505060206108f78a828b01610888565b96505060406109088a828b016106dd565b955050606088013567ffffffffffffffff81111561092957610928610549565b5b6109358a828b016106fc565b945094505060806109488a828b01610757565b92505060c088013567ffffffffffffffff81111561096957610968610549565b5b6109758a828b01610776565b91505092959891949750929550565b600080600080600080600060e0888a0312156109a3576109a2610544565b5b600088013567ffffffffffffffff8111156109c1576109c0610549565b5b6109cd8a828b01610666565b97505060206109de8a828b01610888565b96505060406109ef8a828b01610888565b955050606088013567ffffffffffffffff811115610a1057610a0f610549565b5b610a1c8a828b016106fc565b94509450506080610a2f8a828b01610757565b92505060c088013567ffffffffffffffff811115610a5057610a4f610549565b5b610a5c8a828b01610776565b91505092959891949750929550565b610a74816106b4565b82525050565b6000819050919050565b6000819050919050565b6000610aa9610aa4610a9f84610a7a565b610a84565b610867565b9050919050565b610ab981610a8e565b82525050565b6000604082019050610ad46000830185610a6b565b610ae16020830184610ab0565b9392505050565b60008115159050919050565b610afd81610ae8565b8114610b0857600080fd5b50565b600081519050610b1a81610af4565b92915050565b600060208284031215610b3657610b35610544565b5b6000610b4484828501610b0b565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610b87578082015181840152602081019050610b6c565b83811115610b96576000848401525b50505050565b6000610ba782610b4d565b610bb18185610b58565b9350610bc1818560208601610b69565b610bca81610558565b840191505092915050565b6000610be18385610b58565b9350610bee838584610615565b610bf783610558565b840190509392505050565b6000610c116020840184610888565b905092915050565b610c2281610867565b82525050565b600081359050610c3781610af4565b92915050565b6000610c4c6020840184610c28565b905092915050565b610c5d81610ae8565b82525050565b60408201610c746000830183610c02565b610c816000850182610c19565b50610c8f6020830183610c3d565b610c9c6020850182610c54565b50505050565b6000610cb160208401846106dd565b905092915050565b610cc2816106b4565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610cf457610cf3610cd2565b5b83810192508235915060208301925067ffffffffffffffff821115610d1c57610d1b610cc8565b5b600182023603841315610d3257610d31610ccd565b5b509250929050565b600082825260208201905092915050565b6000610d578385610d3a565b9350610d64838584610615565b610d6d83610558565b840190509392505050565b600060a08301610d8b6000840184610ca2565b610d986000860182610cb9565b50610da66020840184610c3d565b610db36020860182610c54565b50610dc16040840184610ca2565b610dce6040860182610cb9565b50610ddc6060840184610cd7565b8583036060870152610def838284610d4b565b92505050610e006080840184610c02565b610e0d6080860182610c19565b508091505092915050565b600060c0820190508181036000830152610e328189610b9c565b9050610e416020830188610a6b565b8181036040830152610e54818688610bd5565b9050610e636060830185610c63565b81810360a0830152610e758184610d78565b9050979650505050505050565b610e8b81610867565b82525050565b600060e0820190508181036000830152610eab818a610b9c565b9050610eba6020830189610e82565b610ec76040830188610a6b565b8181036060830152610eda818688610bd5565b9050610ee96080830185610c63565b81810360c0830152610efb8184610d78565b905098975050505050505050565b6000604082019050610f1e6000830185610a6b565b610f2b6020830184610e82565b9392505050565b600060e0820190508181036000830152610f4c818a610b9c565b9050610f5b6020830189610e82565b610f686040830188610e82565b8181036060830152610f7b818688610bd5565b9050610f8a6080830185610c63565b81810360c0830152610f9c8184610d78565b90509897505050505050505056fea26469706673582212208bce4e5eb92aaf90cbf3a7034ad19f03506d28b0b05ba0e958bddedd2cd46e4b64736f6c634300080a0033" +} diff --git a/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.sol b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.sol new file mode 100644 index 0000000000..5fc9382a0b --- /dev/null +++ b/pkg/contracts/testgatewayzevmcaller/TestGatewayZEVMCaller.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 TestGatewayZEVMCaller { + 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/testgatewayzevmcaller/bindings.go b/pkg/contracts/testgatewayzevmcaller/bindings.go new file mode 100644 index 0000000000..e413008777 --- /dev/null +++ b/pkg/contracts/testgatewayzevmcaller/bindings.go @@ -0,0 +1,8 @@ +//go:generate sh -c "solc TestGatewayZEVMCaller.sol --combined-json abi,bin | jq '.contracts.\"TestGatewayZEVMCaller.sol:TestGatewayZEVMCaller\"' > TestGatewayZEVMCaller.json" +//go:generate sh -c "cat TestGatewayZEVMCaller.json | jq .abi > TestGatewayZEVMCaller.abi" +//go:generate sh -c "cat TestGatewayZEVMCaller.json | jq .bin | tr -d '\"' > TestGatewayZEVMCaller.bin" +//go:generate sh -c "abigen --abi TestGatewayZEVMCaller.abi --bin TestGatewayZEVMCaller.bin --pkg testgatewayzevmcaller --type TestGatewayZEVMCaller --out TestGatewayZEVMCaller.go" + +package testgatewayzevmcaller + +var _ TestGatewayZEVMCaller diff --git a/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto b/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto index f8da0d0daa..4e2b559c0e 100644 --- a/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto +++ b/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto @@ -79,6 +79,7 @@ message OutboundParams { uint64 effective_gas_limit = 22; string tss_pubkey = 11; TxFinalizationStatus tx_finalization_status = 12; + bool is_arbitrary_call = 24; // not used. do not edit. reserved 13 to 19; diff --git a/proto/zetachain/zetacore/crosschain/tx.proto b/proto/zetachain/zetacore/crosschain/tx.proto index e5d310976d..c801528264 100644 --- a/proto/zetachain/zetacore/crosschain/tx.proto +++ b/proto/zetachain/zetacore/crosschain/tx.proto @@ -175,6 +175,8 @@ message MsgVoteInbound { // revert options provided by the sender RevertOptions revert_options = 17 [ (gogoproto.nullable) = false ]; + + bool is_arbitrary_call = 18; } message MsgVoteInboundResponse {} 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..0c72b99e14 100644 --- a/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts +++ b/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts @@ -294,6 +294,11 @@ export declare class OutboundParams extends Message { */ txFinalizationStatus: TxFinalizationStatus; + /** + * @generated from field: bool is_arbitrary_call = 24; + */ + isArbitraryCall: boolean; + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; diff --git a/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts b/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts index 657a772384..487c072988 100644 --- a/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts +++ b/typescript/zetachain/zetacore/crosschain/tx_pb.d.ts @@ -656,6 +656,11 @@ export declare class MsgVoteInbound extends Message { */ revertOptions?: RevertOptions; + /** + * @generated from field: bool is_arbitrary_call = 18; + */ + isArbitraryCall: boolean; + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; diff --git a/x/crosschain/client/cli/tx_vote_inbound.go b/x/crosschain/client/cli/tx_vote_inbound.go index 3c7fae37c0..befc316f01 100644 --- a/x/crosschain/client/cli/tx_vote_inbound.go +++ b/x/crosschain/client/cli/tx_vote_inbound.go @@ -83,6 +83,7 @@ func CmdVoteInbound() *cobra.Command { argsAsset, uint(argsEventIndex), protocolContractVersion, + true, // TODO: do we need to provide this as arg? ) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) diff --git a/x/crosschain/keeper/evm_hooks.go b/x/crosschain/keeper/evm_hooks.go index 5669c10fe7..e1a8cf3eeb 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, + true, // 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, + true, // not relevant for v1 ) cctx, err := k.ValidateInbound(ctx, msg, true) 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..8b06121c7d 100644 --- a/x/crosschain/types/cctx.go +++ b/x/crosschain/types/cctx.go @@ -241,6 +241,7 @@ func NewCCTX(ctx sdk.Context, msg MsgVoteInbound, tssPubkey string) (CrossChainT Amount: sdkmath.ZeroUint(), TssPubkey: tssPubkey, CoinType: msg.CoinType, + IsArbitraryCall: msg.IsArbitraryCall, } status := &Status{ Status: CctxStatus_PendingInbound, diff --git a/x/crosschain/types/cross_chain_tx.pb.go b/x/crosschain/types/cross_chain_tx.pb.go index a0fbdab126..bbc46b9687 100644 --- a/x/crosschain/types/cross_chain_tx.pb.go +++ b/x/crosschain/types/cross_chain_tx.pb.go @@ -293,6 +293,7 @@ type OutboundParams struct { EffectiveGasLimit uint64 `protobuf:"varint,22,opt,name=effective_gas_limit,json=effectiveGasLimit,proto3" json:"effective_gas_limit,omitempty"` TssPubkey string `protobuf:"bytes,11,opt,name=tss_pubkey,json=tssPubkey,proto3" json:"tss_pubkey,omitempty"` TxFinalizationStatus TxFinalizationStatus `protobuf:"varint,12,opt,name=tx_finalization_status,json=txFinalizationStatus,proto3,enum=zetachain.zetacore.crosschain.TxFinalizationStatus" json:"tx_finalization_status,omitempty"` + IsArbitraryCall bool `protobuf:"varint,24,opt,name=is_arbitrary_call,json=isArbitraryCall,proto3" json:"is_arbitrary_call,omitempty"` } func (m *OutboundParams) Reset() { *m = OutboundParams{} } @@ -426,6 +427,13 @@ func (m *OutboundParams) GetTxFinalizationStatus() TxFinalizationStatus { return TxFinalizationStatus_NotFinalized } +func (m *OutboundParams) GetIsArbitraryCall() bool { + if m != nil { + return m.IsArbitraryCall + } + return false +} + type Status struct { Status CctxStatus `protobuf:"varint,1,opt,name=status,proto3,enum=zetachain.zetacore.crosschain.CctxStatus" json:"status,omitempty"` StatusMessage string `protobuf:"bytes,2,opt,name=status_message,json=statusMessage,proto3" json:"status_message,omitempty"` @@ -691,88 +699,90 @@ func init() { } var fileDescriptor_d4c1966807fb5cb2 = []byte{ - // 1291 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6f, 0x13, 0xc7, - 0x17, 0xcf, 0x26, 0x8e, 0x63, 0x3f, 0xff, 0xc8, 0x32, 0x31, 0x61, 0xc9, 0x57, 0x98, 0x7c, 0xdd, - 0x02, 0x86, 0x36, 0xb6, 0x08, 0x52, 0x55, 0xf5, 0x96, 0x44, 0x04, 0xd2, 0x16, 0x12, 0x2d, 0x01, - 0x09, 0x0e, 0xdd, 0x8e, 0x77, 0x5f, 0xd6, 0xa3, 0xd8, 0x3b, 0xee, 0xce, 0x38, 0x72, 0x50, 0x6f, - 0x3d, 0x57, 0x6a, 0xff, 0x87, 0x1e, 0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61, 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, + // 1318 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x26, 0x8e, 0x63, 0x3f, 0xff, 0xc9, 0x66, 0xe2, 0xa6, 0xdb, 0xa0, 0xba, 0xc1, 0xd0, + 0xd6, 0x2d, 0xc4, 0x56, 0x53, 0x09, 0x21, 0x6e, 0x89, 0xd5, 0xb4, 0x01, 0xda, 0x44, 0xdb, 0xb4, + 0x52, 0x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, 0x41, 0x65, 0x9f, 0x24, 0x11, 0x4d, 0xba, + 0x26, 0xb7, 0x6e, 0x06, 0xad, 0xc0, 0x92, 0xc1, 0x6c, 0x66, 0x5c, 0x07, 0x2d, 0x43, 0xd9, 0xce, + 0x1e, 0xd2, 0x84, 0x44, 0xee, 0xbc, 0x84, 0xcc, 0x3a, 0xbd, 0xad, 0x9b, 0x45, 0x25, 0xc8, 0xeb, + 0x31, 0x89, 0xdc, 0x05, 0x54, 0x84, 0xc5, 0x2d, 0xfd, 0xa8, 0x70, 0x73, 0x6b, 0xd9, 0x9f, 0x7e, + 0xac, 0x39, 0xb7, 0xbf, 0x80, 0xea, 0x69, 0x2d, 0x17, 0xb9, 0x50, 0x7a, 0xc4, 0xc4, 0x8e, 0x7d, + 0x62, 0xb9, 0x19, 0x54, 0x86, 0xc2, 0x74, 0xea, 0x48, 0xe6, 0x7b, 0x23, 0x12, 0x0e, 0x25, 0xd9, + 0x9c, 0x21, 0x6b, 0xc1, 0xe5, 0x7f, 0xc8, 0x2c, 0xca, 0xc1, 0xdc, 0xd3, 0x3b, 0x6e, 0x46, 0xfd, + 0x6e, 0xba, 0x8e, 0x76, 0xd8, 0xbe, 0xff, 0xf2, 0x4d, 0xcd, 0x79, 0xf5, 0xa6, 0xe6, 0xfc, 0xfe, + 0xa6, 0xe6, 0xfc, 0xf0, 0xb6, 0x96, 0x79, 0xf5, 0xb6, 0x96, 0xf9, 0xf5, 0x6d, 0x2d, 0xf3, 0x7c, + 0xe3, 0x44, 0x25, 0xc9, 0xc4, 0x6e, 0xe8, 0x47, 0x7c, 0xc2, 0x22, 0xd2, 0x1a, 0x9d, 0xfc, 0xaf, + 0xa0, 0x8a, 0xaa, 0x93, 0x53, 0x07, 0x77, 0xf7, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x74, + 0x78, 0x46, 0x59, 0x0c, 0x00, 0x00, } func (m *InboundParams) Marshal() (dAtA []byte, err error) { @@ -921,6 +931,18 @@ func (m *OutboundParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.IsArbitraryCall { + i-- + if m.IsArbitraryCall { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc0 + } if len(m.GasPriorityFee) > 0 { i -= len(m.GasPriorityFee) copy(dAtA[i:], m.GasPriorityFee) @@ -1386,6 +1408,9 @@ func (m *OutboundParams) Size() (n int) { if l > 0 { n += 2 + l + sovCrossChainTx(uint64(l)) } + if m.IsArbitraryCall { + n += 3 + } return n } @@ -2352,6 +2377,26 @@ func (m *OutboundParams) Unmarshal(dAtA []byte) error { } m.GasPriorityFee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 24: + 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:]) diff --git a/x/crosschain/types/message_vote_inbound.go b/x/crosschain/types/message_vote_inbound.go index 8592b7e607..34b19c66fa 100644 --- a/x/crosschain/types/message_vote_inbound.go +++ b/x/crosschain/types/message_vote_inbound.go @@ -56,6 +56,7 @@ func NewMsgVoteInbound( asset string, eventIndex uint, protocolContractVersion ProtocolContractVersion, + isArbitraryCall bool, options ...InboundVoteOption, ) *MsgVoteInbound { msg := &MsgVoteInbound{ @@ -75,6 +76,7 @@ func NewMsgVoteInbound( EventIndex: uint64(eventIndex), ProtocolContractVersion: protocolContractVersion, RevertOptions: NewEmptyRevertOptions(), + IsArbitraryCall: isArbitraryCall, } for _, option := range options { diff --git a/x/crosschain/types/message_vote_inbound_test.go b/x/crosschain/types/message_vote_inbound_test.go index c7fbcbb531..24c3b0e905 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, }, diff --git a/x/crosschain/types/tx.pb.go b/x/crosschain/types/tx.pb.go index 6c75354214..85a9b833e5 100644 --- a/x/crosschain/types/tx.pb.go +++ b/x/crosschain/types/tx.pb.go @@ -1000,7 +1000,8 @@ type MsgVoteInbound struct { // protocol contract version to use for the cctx workflow ProtocolContractVersion ProtocolContractVersion `protobuf:"varint,16,opt,name=protocol_contract_version,json=protocolContractVersion,proto3,enum=zetachain.zetacore.crosschain.ProtocolContractVersion" json:"protocol_contract_version,omitempty"` // revert options provided by the sender - RevertOptions RevertOptions `protobuf:"bytes,17,opt,name=revert_options,json=revertOptions,proto3" json:"revert_options"` + RevertOptions RevertOptions `protobuf:"bytes,17,opt,name=revert_options,json=revertOptions,proto3" json:"revert_options"` + IsArbitraryCall bool `protobuf:"varint,18,opt,name=is_arbitrary_call,json=isArbitraryCall,proto3" json:"is_arbitrary_call,omitempty"` } func (m *MsgVoteInbound) Reset() { *m = MsgVoteInbound{} } @@ -1141,6 +1142,13 @@ func (m *MsgVoteInbound) GetRevertOptions() RevertOptions { return RevertOptions{} } +func (m *MsgVoteInbound) GetIsArbitraryCall() bool { + if m != nil { + return m.IsArbitraryCall + } + return false +} + type MsgVoteInboundResponse struct { } @@ -1706,119 +1714,121 @@ func init() { } var fileDescriptor_15f0860550897740 = []byte{ - // 1782 bytes of a gzipped FileDescriptorProto + // 1811 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, 0xb2, - 0x7c, 0xca, 0x98, 0xa0, 0xf1, 0x4e, 0xb1, 0xe9, 0x53, 0x4e, 0xd5, 0xad, 0x88, 0xaf, 0x18, 0xf2, - 0x15, 0xdf, 0xf1, 0x69, 0xab, 0x0e, 0x75, 0x28, 0x72, 0x96, 0x82, 0x27, 0x01, 0xd2, 0xbe, 0x35, - 0x40, 0x78, 0xf3, 0xd2, 0x29, 0x21, 0x89, 0xc9, 0x1f, 0xc9, 0xbb, 0x3b, 0x8c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 0x06, 0x64, 0x5d, 0x8b, 0x89, 0x93, + 0x26, 0x6d, 0xce, 0xb8, 0x16, 0x7b, 0x12, 0xae, 0x8b, 0x26, 0xac, 0x0f, 0xd9, 0x14, 0x59, 0x1c, + 0x5a, 0xf0, 0x62, 0xc0, 0x02, 0x61, 0xe1, 0xe2, 0x8b, 0x7e, 0x0b, 0x36, 0x01, 0x6c, 0x3b, 0xf6, + 0xa9, 0xcc, 0xca, 0x90, 0x22, 0xbc, 0xfa, 0x2f, 0x05, 0x6e, 0x0a, 0xb7, 0x3e, 0x6b, 0xf3, 0xab, + 0xe7, 0xdd, 0x1a, 0x2c, 0xf8, 0xd4, 0xb7, 0x09, 0x3a, 0x2b, 0x65, 0x88, 0x45, 0x7f, 0x36, 0xa6, + 0x06, 0xb2, 0xf1, 0xff, 0x93, 0x49, 0xdf, 0x87, 0xcd, 0x91, 0x26, 0xc7, 0x8e, 0xdd, 0x04, 0xf0, + 0x98, 0x19, 0x90, 0x26, 0xed, 0x10, 0x07, 0xad, 0xcf, 0x18, 0x59, 0x8f, 0x19, 0x82, 0x50, 0x24, + 0xa0, 0xd5, 0x98, 0x2b, 0x56, 0xff, 0x3b, 0xaf, 0x15, 0x8b, 0xb0, 0x35, 0x6e, 0x9b, 0x38, 0xe9, + 0xff, 0xac, 0xc0, 0x72, 0x8d, 0xb9, 0x5f, 0x50, 0x4e, 0x8e, 0x2c, 0x76, 0x12, 0x78, 0x36, 0x99, + 0x5b, 0x85, 0x56, 0x88, 0x8e, 0x54, 0xc0, 0x85, 0x7a, 0x17, 0x16, 0x5b, 0x81, 0x47, 0x03, 0x8f, + 0xf7, 0xcc, 0x33, 0x42, 0xd0, 0xcb, 0x29, 0x23, 0x17, 0xd1, 0x1e, 0x13, 0x64, 0x11, 0x61, 0xf0, + 0xdb, 0xcd, 0x3a, 0x09, 0x30, 0xc0, 0x29, 0x23, 0x87, 0xb4, 0xa7, 0x48, 0xfa, 0x61, 0x2a, 0xb3, + 0xb0, 0x92, 0x2e, 0xae, 0xc3, 0xed, 0x84, 0xa6, 0xb1, 0x15, 0x7f, 0x4a, 0xc7, 0x56, 0x44, 0x86, + 0x4e, 0xb0, 0x62, 0x03, 0x30, 0x7f, 0x45, 0xdc, 0x45, 0x42, 0x67, 0x42, 0x02, 0x86, 0xfd, 0x03, + 0xb8, 0x45, 0xeb, 0x8c, 0x04, 0x1d, 0xe2, 0x98, 0x54, 0xca, 0xea, 0xbf, 0x07, 0xd7, 0xa2, 0xaf, + 0xd1, 0x46, 0x88, 0xaa, 0x42, 0x61, 0x18, 0x25, 0xb3, 0x8b, 0x78, 0xee, 0x39, 0x97, 0x66, 0x6d, + 0x24, 0xd1, 0x87, 0x98, 0x6f, 0xc8, 0xa2, 0x7e, 0x04, 0xfa, 0xb0, 0x90, 0xf0, 0x68, 0xb7, 0x19, + 0x71, 0x34, 0x40, 0x01, 0xb7, 0x93, 0x02, 0x8e, 0x2c, 0xf6, 0x9c, 0x11, 0x47, 0xfd, 0x85, 0x02, + 0xf7, 0x87, 0xd1, 0xe4, 0xec, 0x8c, 0xd8, 0xdc, 0xeb, 0x10, 0x94, 0x23, 0x02, 0x94, 0xc3, 0xa2, + 0x57, 0x92, 0x45, 0x6f, 0x7b, 0x86, 0xa2, 0x77, 0xec, 0x73, 0xe3, 0x6e, 0x72, 0xe3, 0x4f, 0x23, + 0xd1, 0x71, 0xde, 0x9c, 0x4c, 0xd7, 0x40, 0x5c, 0x52, 0x8b, 0x68, 0xca, 0x44, 0x89, 0x78, 0x7b, + 0xa9, 0x14, 0xf2, 0x1d, 0xab, 0xd1, 0x26, 0x66, 0x40, 0x6c, 0xe2, 0x85, 0x67, 0x09, 0xaf, 0xc5, + 0xc3, 0xcf, 0x2e, 0x59, 0xb1, 0xff, 0xfd, 0xea, 0xce, 0xcd, 0x9e, 0xd5, 0x6c, 0xec, 0x17, 0x07, + 0xc5, 0x15, 0x8d, 0x25, 0x24, 0x18, 0x72, 0xad, 0x7e, 0x02, 0x69, 0xc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0xdb, 0x52, 0xa8, 0xbf, 0x57, 0xe0, 0xd6, 0x98, 0x7e, 0xe2, 0xc3, + 0x59, 0xa3, 0x9b, 0x44, 0xea, 0x3f, 0x98, 0x17, 0x19, 0xab, 0xf5, 0x95, 0x02, 0xda, 0xd8, 0x26, + 0x61, 0x7f, 0xe6, 0xa0, 0x0f, 0x61, 0xf5, 0xc3, 0xf9, 0xb1, 0xb1, 0x72, 0x7f, 0x51, 0x60, 0x73, + 0x72, 0x25, 0xfe, 0x78, 0x56, 0x07, 0x8c, 0x11, 0xa0, 0x1f, 0x5d, 0x51, 0x40, 0xa4, 0xeb, 0xe1, + 0xd1, 0xd7, 0xaf, 0x0b, 0xca, 0xcb, 0xd7, 0x05, 0xe5, 0x1f, 0xaf, 0x0b, 0xca, 0x6f, 0xde, 0x14, + 0xae, 0xbd, 0x7c, 0x53, 0xb8, 0xf6, 0xb7, 0x37, 0x85, 0x6b, 0x3f, 0xdd, 0xed, 0x6b, 0x64, 0xc2, + 0x2d, 0x76, 0xc5, 0xbf, 0x03, 0x7c, 0xea, 0x90, 0x72, 0x77, 0xe0, 0xbf, 0x26, 0x61, 0x4f, 0x53, + 0x4f, 0xe3, 0xe0, 0xf0, 0xf0, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x95, 0xe6, 0x43, 0x63, + 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3076,6 +3086,18 @@ func (m *MsgVoteInbound) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.IsArbitraryCall { + i-- + if m.IsArbitraryCall { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } { size, err := m.RevertOptions.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -3944,6 +3966,9 @@ func (m *MsgVoteInbound) Size() (n int) { } l = m.RevertOptions.Size() n += 2 + l + sovTx(uint64(l)) + if m.IsArbitraryCall { + n += 3 + } return n } @@ -6637,6 +6662,26 @@ func (m *MsgVoteInbound) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 18: + 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 ErrIntOverflowTx + } + 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 := skipTx(dAtA[iNdEx:]) 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/v2_sign.go b/zetaclient/chains/evm/signer/v2_sign.go index 9a3bf3ba89..3e9bd1daae 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.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/zetacore/tx.go b/zetaclient/zetacore/tx.go index 64379bad2a..5710ba2a6f 100644 --- a/zetaclient/zetacore/tx.go +++ b/zetaclient/zetacore/tx.go @@ -51,6 +51,7 @@ func GetInboundVoteMessage( asset, eventIndex, types.ProtocolContractVersion_V1, + true, // not relevant for v1 ) return msg }