From b59d188fa0f87f173ffda953160d88d8386ebb4e Mon Sep 17 00:00:00 2001 From: skosito Date: Wed, 16 Oct 2024 15:42:10 +0200 Subject: [PATCH 01/16] bump protocol contracts to use erc20 auth calls --- e2e/runner/v2_zevm.go | 14 +++++----- go.mod | 2 +- go.sum | 4 +-- zetaclient/chains/evm/signer/v2_sign.go | 33 ++++++++++++++--------- zetaclient/chains/evm/signer/v2_signer.go | 2 +- 5 files changed, 31 insertions(+), 24 deletions(-) diff --git a/e2e/runner/v2_zevm.go b/e2e/runner/v2_zevm.go index 4824884bd0..bb22cc06e0 100644 --- a/e2e/runner/v2_zevm.go +++ b/e2e/runner/v2_zevm.go @@ -38,13 +38,13 @@ func (r *E2ERunner) V2ETHWithdrawAndCall( payload []byte, revertOptions gatewayzevm.RevertOptions, ) *ethtypes.Transaction { - tx, err := r.GatewayZEVM.WithdrawAndCall( + tx, err := r.GatewayZEVM.WithdrawAndCall0( r.ZEVMAuth, receiver.Bytes(), amount, r.ETHZRC20Addr, payload, - gasLimit, + gatewayzevm.CallOptions{GasLimit: gasLimit, IsArbitraryCall: true}, revertOptions, ) require.NoError(r, err) @@ -59,7 +59,7 @@ func (r *E2ERunner) V2ETHWithdrawAndAuthenticatedCall( payload []byte, revertOptions gatewayzevm.RevertOptions, ) *ethtypes.Transaction { - tx, err := r.GatewayZEVM.WithdrawAndCall2( + tx, err := r.GatewayZEVM.WithdrawAndCall0( r.ZEVMAuth, receiver.Bytes(), amount, @@ -135,13 +135,13 @@ func (r *E2ERunner) V2ERC20WithdrawAndCall( r.ZEVMAuth.GasLimit = previousGasLimit }() - tx, err := r.GatewayZEVM.WithdrawAndCall( + tx, err := r.GatewayZEVM.WithdrawAndCall0( r.ZEVMAuth, receiver.Bytes(), amount, r.ERC20ZRC20Addr, payload, - gasLimit, + gatewayzevm.CallOptions{GasLimit: gasLimit, IsArbitraryCall: true}, revertOptions, ) require.NoError(r, err) @@ -155,12 +155,12 @@ func (r *E2ERunner) V2ZEVMToEMVCall( payload []byte, revertOptions gatewayzevm.RevertOptions, ) *ethtypes.Transaction { - tx, err := r.GatewayZEVM.Call0( + tx, err := r.GatewayZEVM.Call( r.ZEVMAuth, receiver.Bytes(), r.ETHZRC20Addr, payload, - gasLimit, + gatewayzevm.CallOptions{GasLimit: gasLimit, IsArbitraryCall: true}, revertOptions, ) require.NoError(r, err) diff --git a/go.mod b/go.mod index cb746a49bf..ac6aebe29b 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-20241010181243-044e22bdb7e7 github.com/zeta-chain/keystone/keys v0.0.0-20240826165841-3874f358c138 - github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241014093550-f7f6d9fd971a + github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241016132637-17f952da3262 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 8842365a96..f07fdbcdc4 100644 --- a/go.sum +++ b/go.sum @@ -4208,8 +4208,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.20241014093550-f7f6d9fd971a h1:xsup+oupCrBtZT/jEaBGcL3k6KUlXWR7iXw/3RHBIpU= -github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241014093550-f7f6d9fd971a/go.mod h1:SjT7QirtJE8stnAe1SlNOanxtfSfijJm3MGJ+Ax7w7w= +github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241016132637-17f952da3262 h1:5p2xnIBfBq3E4XfX+KRaSc6VreirKWFPskfk/8azUYM= +github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241016132637-17f952da3262/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/zetaclient/chains/evm/signer/v2_sign.go b/zetaclient/chains/evm/signer/v2_sign.go index 3a00a86c48..73d6c3ecf1 100644 --- a/zetaclient/chains/evm/signer/v2_sign.go +++ b/zetaclient/chains/evm/signer/v2_sign.go @@ -29,19 +29,17 @@ func (signer *Signer) signGatewayExecute( var data []byte + // only set sender if it's authenticated call + messageContext := gatewayevm.MessageContext{ + Sender: common.HexToAddress(sender), + } if txData.outboundParams.CallOptions.IsArbitraryCall { - data, err = gatewayABI.Pack("execute", txData.to, txData.message) - if err != nil { - return nil, fmt.Errorf("execute pack error: %w", err) - } - } else { - messageContext := gatewayevm.MessageContext{ - Sender: common.HexToAddress(sender), - } - data, err = gatewayABI.Pack("execute0", messageContext, txData.to, txData.message) - if err != nil { - return nil, fmt.Errorf("execute0 pack error: %w", err) - } + messageContext.Sender = common.Address{} + } + + data, err = gatewayABI.Pack("execute", messageContext, txData.to, txData.message) + if err != nil { + return nil, fmt.Errorf("execute pack error: %w", err) } tx, _, _, err := signer.Sign( @@ -148,6 +146,7 @@ func (signer *Signer) signERC20CustodyWithdraw( // bytes calldata data func (signer *Signer) signERC20CustodyWithdrawAndCall( ctx context.Context, + sender string, txData *OutboundData, ) (*ethtypes.Transaction, error) { erc20CustodyV2ABI, err := erc20custodyv2.ERC20CustodyMetaData.GetAbi() @@ -155,7 +154,15 @@ func (signer *Signer) signERC20CustodyWithdrawAndCall( return nil, errors.Wrap(err, "unable to get ERC20CustodyMetaData ABI") } - data, err := erc20CustodyV2ABI.Pack("withdrawAndCall", txData.to, txData.asset, txData.amount, txData.message) + // only set sender if it's authenticated call + messageContext := gatewayevm.MessageContext{ + Sender: common.HexToAddress(sender), + } + if txData.outboundParams.CallOptions.IsArbitraryCall { + messageContext.Sender = common.Address{} + } + + data, err := erc20CustodyV2ABI.Pack("withdrawAndCall", messageContext, txData.to, txData.asset, txData.amount, txData.message) if err != nil { return nil, fmt.Errorf("withdraw pack error: %w", err) } diff --git a/zetaclient/chains/evm/signer/v2_signer.go b/zetaclient/chains/evm/signer/v2_signer.go index e687454b3b..270c1aca12 100644 --- a/zetaclient/chains/evm/signer/v2_signer.go +++ b/zetaclient/chains/evm/signer/v2_signer.go @@ -23,7 +23,7 @@ func (signer *Signer) SignOutboundFromCCTXV2( case evm.OutboundTypeERC20Withdraw, evm.OutboundTypeERC20WithdrawRevert: return signer.signERC20CustodyWithdraw(ctx, outboundData) case evm.OutboundTypeERC20WithdrawAndCall: - return signer.signERC20CustodyWithdrawAndCall(ctx, outboundData) + return signer.signERC20CustodyWithdrawAndCall(ctx, cctx.InboundParams.Sender, outboundData) 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 From effbe08c05b0222748d426bedb9d8127519229ad Mon Sep 17 00:00:00 2001 From: skosito Date: Wed, 16 Oct 2024 21:26:07 +0200 Subject: [PATCH 02/16] bump protocol contracts and fix test dapp --- go.mod | 2 +- go.sum | 4 +- pkg/contracts/testdappv2/TestDAppV2.abi | 64 +++++++++++------------ pkg/contracts/testdappv2/TestDAppV2.bin | 2 +- pkg/contracts/testdappv2/TestDAppV2.go | 52 +++++++++---------- pkg/contracts/testdappv2/TestDAppV2.json | 66 ++++++++++++------------ pkg/contracts/testdappv2/TestDAppV2.sol | 2 +- 7 files changed, 96 insertions(+), 96 deletions(-) diff --git a/go.mod b/go.mod index ac6aebe29b..faa6709809 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-20241010181243-044e22bdb7e7 github.com/zeta-chain/keystone/keys v0.0.0-20240826165841-3874f358c138 - github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241016132637-17f952da3262 + github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241016134610-c70fec4d66a6 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 f07fdbcdc4..8f884485e3 100644 --- a/go.sum +++ b/go.sum @@ -4208,8 +4208,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.20241016132637-17f952da3262 h1:5p2xnIBfBq3E4XfX+KRaSc6VreirKWFPskfk/8azUYM= -github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241016132637-17f952da3262/go.mod h1:SjT7QirtJE8stnAe1SlNOanxtfSfijJm3MGJ+Ax7w7w= +github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241016134610-c70fec4d66a6 h1:9xfE77UtF316hcsX7H2/OjROWtxBZyk8k1sQN3exIVM= +github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241016134610-c70fec4d66a6/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 95618cf9db..319dda376c 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.abi +++ b/pkg/contracts/testdappv2/TestDAppV2.abi @@ -124,37 +124,6 @@ "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": [ { @@ -195,11 +164,42 @@ "type": "bytes" } ], - "name": "onCrossChainCall", + "name": "onCall", "outputs": [], "stateMutability": "nonpayable", "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": [ { diff --git a/pkg/contracts/testdappv2/TestDAppV2.bin b/pkg/contracts/testdappv2/TestDAppV2.bin index 1c087ef1b5..5254923745 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.bin +++ b/pkg/contracts/testdappv2/TestDAppV2.bin @@ -1 +1 @@ -608060405234801561001057600080fd5b5061150a806100206000396000f3fe6080604052600436106100c65760003560e01c8063c234fecf1161007f578063de43156e11610059578063de43156e14610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063c234fecf146101ec578063c7a339a914610215578063c9028a361461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a77714610138578063676cc054146101635780639291fe2614610193578063a799911f146101d0576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610de7565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610d02565b610371565b60405161012f9190611173565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a91906110c4565b60405180910390f35b61017d60048036038101906101789190610e30565b6103ad565b60405161018a9190611131565b60405180910390f35b34801561019f57600080fd5b506101ba60048036038101906101b59190610de7565b610562565b6040516101c79190611173565b60405180910390f35b6101ea60048036038101906101e59190610de7565b6105a5565b005b3480156101f857600080fd5b50610213600480360381019061020e9190610ca8565b6105ce565b005b34801561022157600080fd5b5061023c60048036038101906102379190610d78565b610611565b005b34801561024a57600080fd5b5061026560048036038101906102609190610e90565b6106d4565b005b34801561027357600080fd5b5061028e60048036038101906102899190610ed9565b61080e565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610d02565b610907565b6040516102c49190611116565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610de7565b610927565b6040516103019190611116565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190610d2f565b610977565b60405161033e91906110c4565b60405180910390f35b610350816109c0565b1561035a57600080fd5b61036381610a16565b61036e816000610a6a565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906103f99190610ca8565b73ffffffffffffffffffffffffffffffffffffffff161461044f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044690611153565b60405180910390fd5b61049c83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b6104ea83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505034610a6a565b8360000160208101906104fd9190610ca8565b6002848460405161050f92919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060036000836040516020016105799190611098565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105ae816109c0565b156105b857600080fd5b6105c181610a16565b6105cb8134610a6a565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61061a816109c0565b1561062457600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610661939291906110df565b602060405180830381600087803b15801561067b57600080fd5b505af115801561068f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b39190610cd5565b6106bc57600080fd5b6106c581610a16565b6106cf8183610a6a565b505050565b61072f8180606001906106e7919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61078c818060600190610742919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610a6a565b80600001602081019061079f9190610ca8565b60028280606001906107b1919061118e565b6040516107bf92919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61085b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506109c0565b1561086557600080fd5b6108b282828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61090082828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a6a565b5050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161093e9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016109d1906110af565b60405160208183030381529060405280519060200120826040516020016109f89190611098565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610a2c9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610a809190611098565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000610abf610aba84611216565b6111f1565b905082815260208101848484011115610adb57610ada6113ef565b5b610ae684828561132a565b509392505050565b6000610b01610afc84611247565b6111f1565b905082815260208101848484011115610b1d57610b1c6113ef565b5b610b2884828561132a565b509392505050565b600081359050610b3f81611461565b92915050565b600081519050610b5481611478565b92915050565b600081359050610b698161148f565b92915050565b60008083601f840112610b8557610b846113d1565b5b8235905067ffffffffffffffff811115610ba257610ba16113cc565b5b602083019150836001820283011115610bbe57610bbd6113e5565b5b9250929050565b600082601f830112610bda57610bd96113d1565b5b8135610bea848260208601610aac565b91505092915050565b600081359050610c02816114a6565b92915050565b600082601f830112610c1d57610c1c6113d1565b5b8135610c2d848260208601610aee565b91505092915050565b600060208284031215610c4c57610c4b6113db565b5b81905092915050565b600060808284031215610c6b57610c6a6113db565b5b81905092915050565b600060608284031215610c8a57610c896113db565b5b81905092915050565b600081359050610ca2816114bd565b92915050565b600060208284031215610cbe57610cbd6113f9565b5b6000610ccc84828501610b30565b91505092915050565b600060208284031215610ceb57610cea6113f9565b5b6000610cf984828501610b45565b91505092915050565b600060208284031215610d1857610d176113f9565b5b6000610d2684828501610b5a565b91505092915050565b600060208284031215610d4557610d446113f9565b5b600082013567ffffffffffffffff811115610d6357610d626113f4565b5b610d6f84828501610bc5565b91505092915050565b600080600060608486031215610d9157610d906113f9565b5b6000610d9f86828701610bf3565b9350506020610db086828701610c93565b925050604084013567ffffffffffffffff811115610dd157610dd06113f4565b5b610ddd86828701610c08565b9150509250925092565b600060208284031215610dfd57610dfc6113f9565b5b600082013567ffffffffffffffff811115610e1b57610e1a6113f4565b5b610e2784828501610c08565b91505092915050565b600080600060408486031215610e4957610e486113f9565b5b6000610e5786828701610c36565b935050602084013567ffffffffffffffff811115610e7857610e776113f4565b5b610e8486828701610b6f565b92509250509250925092565b600060208284031215610ea657610ea56113f9565b5b600082013567ffffffffffffffff811115610ec457610ec36113f4565b5b610ed084828501610c55565b91505092915050565b600080600080600060808688031215610ef557610ef46113f9565b5b600086013567ffffffffffffffff811115610f1357610f126113f4565b5b610f1f88828901610c74565b9550506020610f3088828901610b30565b9450506040610f4188828901610c93565b935050606086013567ffffffffffffffff811115610f6257610f616113f4565b5b610f6e88828901610b6f565b92509250509295509295909350565b610f86816112c6565b82525050565b610f95816112d8565b82525050565b6000610fa7838561129f565b9350610fb483858461132a565b82840190509392505050565b6000610fcb82611278565b610fd5818561128e565b9350610fe5818560208601611339565b610fee816113fe565b840191505092915050565b600061100482611283565b61100e81856112bb565b935061101e818560208601611339565b80840191505092915050565b60006110376016836112aa565b91506110428261140f565b602082019050919050565b600061105a6006836112bb565b915061106582611438565b600682019050919050565b61107981611320565b82525050565b600061108c828486610f9b565b91508190509392505050565b60006110a48284610ff9565b915081905092915050565b60006110ba8261104d565b9150819050919050565b60006020820190506110d96000830184610f7d565b92915050565b60006060820190506110f46000830186610f7d565b6111016020830185610f7d565b61110e6040830184611070565b949350505050565b600060208201905061112b6000830184610f8c565b92915050565b6000602082019050818103600083015261114b8184610fc0565b905092915050565b6000602082019050818103600083015261116c8161102a565b9050919050565b60006020820190506111886000830184611070565b92915050565b600080833560016020038436030381126111ab576111aa6113e0565b5b80840192508235915067ffffffffffffffff8211156111cd576111cc6113d6565b5b6020830192506001820236038313156111e9576111e86113ea565b5b509250929050565b60006111fb61120c565b9050611207828261136c565b919050565b6000604051905090565b600067ffffffffffffffff8211156112315761123061139d565b5b61123a826113fe565b9050602081019050919050565b600067ffffffffffffffff8211156112625761126161139d565b5b61126b826113fe565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006112d182611300565b9050919050565b60008115159050919050565b6000819050919050565b60006112f9826112c6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561135757808201518184015260208101905061133c565b83811115611366576000848401525b50505050565b611375826113fe565b810181811067ffffffffffffffff821117156113945761139361139d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61146a816112c6565b811461147557600080fd5b50565b611481816112d8565b811461148c57600080fd5b50565b611498816112e4565b81146114a357600080fd5b50565b6114af816112ee565b81146114ba57600080fd5b50565b6114c681611320565b81146114d157600080fd5b5056fea2646970667358221220da9e50cb7b79ace99166ed06c9234f984bc9599fca79796389af6656411f73f964736f6c63430008070033 +608060405234801561001057600080fd5b5061150a806100206000396000f3fe6080604052600436106100c65760003560e01c8063a799911f1161007f578063c9028a3611610059578063c9028a3614610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063a799911f146101f9578063c234fecf14610215578063c7a339a91461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a777146101385780635bcfd61614610163578063676cc0541461018c5780639291fe26146101bc576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610de7565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610d02565b610371565b60405161012f9190611173565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a91906110c4565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190610ed9565b6103ad565b005b6101a660048036038101906101a19190610e30565b6104a6565b6040516101b39190611131565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190610de7565b61065b565b6040516101f09190611173565b60405180910390f35b610213600480360381019061020e9190610de7565b61069e565b005b34801561022157600080fd5b5061023c60048036038101906102379190610ca8565b6106c7565b005b34801561024a57600080fd5b5061026560048036038101906102609190610d78565b61070a565b005b34801561027357600080fd5b5061028e60048036038101906102899190610e90565b6107cd565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610d02565b610907565b6040516102c49190611116565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610de7565b610927565b6040516103019190611116565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190610d2f565b610977565b60405161033e91906110c4565b60405180910390f35b610350816109c0565b1561035a57600080fd5b61036381610a16565b61036e816000610a6a565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103fa82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506109c0565b1561040457600080fd5b61045182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61049f82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a6a565b5050505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906104f29190610ca8565b73ffffffffffffffffffffffffffffffffffffffff1614610548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053f90611153565b60405180910390fd5b61059583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b6105e383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505034610a6a565b8360000160208101906105f69190610ca8565b6002848460405161060892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060036000836040516020016106729190611098565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6106a7816109c0565b156106b157600080fd5b6106ba81610a16565b6106c48134610a6a565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610713816109c0565b1561071d57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161075a939291906110df565b602060405180830381600087803b15801561077457600080fd5b505af1158015610788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190610cd5565b6107b557600080fd5b6107be81610a16565b6107c88183610a6a565b505050565b6108288180606001906107e0919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61088581806060019061083b919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610a6a565b8060000160208101906108989190610ca8565b60028280606001906108aa919061118e565b6040516108b892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161093e9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016109d1906110af565b60405160208183030381529060405280519060200120826040516020016109f89190611098565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610a2c9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610a809190611098565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000610abf610aba84611216565b6111f1565b905082815260208101848484011115610adb57610ada6113ef565b5b610ae684828561132a565b509392505050565b6000610b01610afc84611247565b6111f1565b905082815260208101848484011115610b1d57610b1c6113ef565b5b610b2884828561132a565b509392505050565b600081359050610b3f81611461565b92915050565b600081519050610b5481611478565b92915050565b600081359050610b698161148f565b92915050565b60008083601f840112610b8557610b846113d1565b5b8235905067ffffffffffffffff811115610ba257610ba16113cc565b5b602083019150836001820283011115610bbe57610bbd6113e5565b5b9250929050565b600082601f830112610bda57610bd96113d1565b5b8135610bea848260208601610aac565b91505092915050565b600081359050610c02816114a6565b92915050565b600082601f830112610c1d57610c1c6113d1565b5b8135610c2d848260208601610aee565b91505092915050565b600060208284031215610c4c57610c4b6113db565b5b81905092915050565b600060808284031215610c6b57610c6a6113db565b5b81905092915050565b600060608284031215610c8a57610c896113db565b5b81905092915050565b600081359050610ca2816114bd565b92915050565b600060208284031215610cbe57610cbd6113f9565b5b6000610ccc84828501610b30565b91505092915050565b600060208284031215610ceb57610cea6113f9565b5b6000610cf984828501610b45565b91505092915050565b600060208284031215610d1857610d176113f9565b5b6000610d2684828501610b5a565b91505092915050565b600060208284031215610d4557610d446113f9565b5b600082013567ffffffffffffffff811115610d6357610d626113f4565b5b610d6f84828501610bc5565b91505092915050565b600080600060608486031215610d9157610d906113f9565b5b6000610d9f86828701610bf3565b9350506020610db086828701610c93565b925050604084013567ffffffffffffffff811115610dd157610dd06113f4565b5b610ddd86828701610c08565b9150509250925092565b600060208284031215610dfd57610dfc6113f9565b5b600082013567ffffffffffffffff811115610e1b57610e1a6113f4565b5b610e2784828501610c08565b91505092915050565b600080600060408486031215610e4957610e486113f9565b5b6000610e5786828701610c36565b935050602084013567ffffffffffffffff811115610e7857610e776113f4565b5b610e8486828701610b6f565b92509250509250925092565b600060208284031215610ea657610ea56113f9565b5b600082013567ffffffffffffffff811115610ec457610ec36113f4565b5b610ed084828501610c55565b91505092915050565b600080600080600060808688031215610ef557610ef46113f9565b5b600086013567ffffffffffffffff811115610f1357610f126113f4565b5b610f1f88828901610c74565b9550506020610f3088828901610b30565b9450506040610f4188828901610c93565b935050606086013567ffffffffffffffff811115610f6257610f616113f4565b5b610f6e88828901610b6f565b92509250509295509295909350565b610f86816112c6565b82525050565b610f95816112d8565b82525050565b6000610fa7838561129f565b9350610fb483858461132a565b82840190509392505050565b6000610fcb82611278565b610fd5818561128e565b9350610fe5818560208601611339565b610fee816113fe565b840191505092915050565b600061100482611283565b61100e81856112bb565b935061101e818560208601611339565b80840191505092915050565b60006110376016836112aa565b91506110428261140f565b602082019050919050565b600061105a6006836112bb565b915061106582611438565b600682019050919050565b61107981611320565b82525050565b600061108c828486610f9b565b91508190509392505050565b60006110a48284610ff9565b915081905092915050565b60006110ba8261104d565b9150819050919050565b60006020820190506110d96000830184610f7d565b92915050565b60006060820190506110f46000830186610f7d565b6111016020830185610f7d565b61110e6040830184611070565b949350505050565b600060208201905061112b6000830184610f8c565b92915050565b6000602082019050818103600083015261114b8184610fc0565b905092915050565b6000602082019050818103600083015261116c8161102a565b9050919050565b60006020820190506111886000830184611070565b92915050565b600080833560016020038436030381126111ab576111aa6113e0565b5b80840192508235915067ffffffffffffffff8211156111cd576111cc6113d6565b5b6020830192506001820236038313156111e9576111e86113ea565b5b509250929050565b60006111fb61120c565b9050611207828261136c565b919050565b6000604051905090565b600067ffffffffffffffff8211156112315761123061139d565b5b61123a826113fe565b9050602081019050919050565b600067ffffffffffffffff8211156112625761126161139d565b5b61126b826113fe565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006112d182611300565b9050919050565b60008115159050919050565b6000819050919050565b60006112f9826112c6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561135757808201518184015260208101905061133c565b83811115611366576000848401525b50505050565b611375826113fe565b810181811067ffffffffffffffff821117156113945761139361139d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61146a816112c6565b811461147557600080fd5b50565b611481816112d8565b811461148c57600080fd5b50565b611498816112e4565b81146114a357600080fd5b50565b6114af816112ee565b81146114ba57600080fd5b50565b6114c681611320565b81146114d157600080fd5b5056fea2646970667358221220f3098dec1315d0cad1405fecc08983ea60d8ccb240a10da773012d554f5948f264736f6c63430008070033 diff --git a/pkg/contracts/testdappv2/TestDAppV2.go b/pkg/contracts/testdappv2/TestDAppV2.go index 5c32fe96f8..aeec5a7531 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.go +++ b/pkg/contracts/testdappv2/TestDAppV2.go @@ -51,8 +51,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\":[],\"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\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"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: "0x608060405234801561001057600080fd5b5061150a806100206000396000f3fe6080604052600436106100c65760003560e01c8063c234fecf1161007f578063de43156e11610059578063de43156e14610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063c234fecf146101ec578063c7a339a914610215578063c9028a361461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a77714610138578063676cc054146101635780639291fe2614610193578063a799911f146101d0576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610de7565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610d02565b610371565b60405161012f9190611173565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a91906110c4565b60405180910390f35b61017d60048036038101906101789190610e30565b6103ad565b60405161018a9190611131565b60405180910390f35b34801561019f57600080fd5b506101ba60048036038101906101b59190610de7565b610562565b6040516101c79190611173565b60405180910390f35b6101ea60048036038101906101e59190610de7565b6105a5565b005b3480156101f857600080fd5b50610213600480360381019061020e9190610ca8565b6105ce565b005b34801561022157600080fd5b5061023c60048036038101906102379190610d78565b610611565b005b34801561024a57600080fd5b5061026560048036038101906102609190610e90565b6106d4565b005b34801561027357600080fd5b5061028e60048036038101906102899190610ed9565b61080e565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610d02565b610907565b6040516102c49190611116565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610de7565b610927565b6040516103019190611116565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190610d2f565b610977565b60405161033e91906110c4565b60405180910390f35b610350816109c0565b1561035a57600080fd5b61036381610a16565b61036e816000610a6a565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906103f99190610ca8565b73ffffffffffffffffffffffffffffffffffffffff161461044f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044690611153565b60405180910390fd5b61049c83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b6104ea83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505034610a6a565b8360000160208101906104fd9190610ca8565b6002848460405161050f92919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060036000836040516020016105799190611098565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105ae816109c0565b156105b857600080fd5b6105c181610a16565b6105cb8134610a6a565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61061a816109c0565b1561062457600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610661939291906110df565b602060405180830381600087803b15801561067b57600080fd5b505af115801561068f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b39190610cd5565b6106bc57600080fd5b6106c581610a16565b6106cf8183610a6a565b505050565b61072f8180606001906106e7919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61078c818060600190610742919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610a6a565b80600001602081019061079f9190610ca8565b60028280606001906107b1919061118e565b6040516107bf92919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61085b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506109c0565b1561086557600080fd5b6108b282828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61090082828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a6a565b5050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161093e9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016109d1906110af565b60405160208183030381529060405280519060200120826040516020016109f89190611098565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610a2c9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610a809190611098565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000610abf610aba84611216565b6111f1565b905082815260208101848484011115610adb57610ada6113ef565b5b610ae684828561132a565b509392505050565b6000610b01610afc84611247565b6111f1565b905082815260208101848484011115610b1d57610b1c6113ef565b5b610b2884828561132a565b509392505050565b600081359050610b3f81611461565b92915050565b600081519050610b5481611478565b92915050565b600081359050610b698161148f565b92915050565b60008083601f840112610b8557610b846113d1565b5b8235905067ffffffffffffffff811115610ba257610ba16113cc565b5b602083019150836001820283011115610bbe57610bbd6113e5565b5b9250929050565b600082601f830112610bda57610bd96113d1565b5b8135610bea848260208601610aac565b91505092915050565b600081359050610c02816114a6565b92915050565b600082601f830112610c1d57610c1c6113d1565b5b8135610c2d848260208601610aee565b91505092915050565b600060208284031215610c4c57610c4b6113db565b5b81905092915050565b600060808284031215610c6b57610c6a6113db565b5b81905092915050565b600060608284031215610c8a57610c896113db565b5b81905092915050565b600081359050610ca2816114bd565b92915050565b600060208284031215610cbe57610cbd6113f9565b5b6000610ccc84828501610b30565b91505092915050565b600060208284031215610ceb57610cea6113f9565b5b6000610cf984828501610b45565b91505092915050565b600060208284031215610d1857610d176113f9565b5b6000610d2684828501610b5a565b91505092915050565b600060208284031215610d4557610d446113f9565b5b600082013567ffffffffffffffff811115610d6357610d626113f4565b5b610d6f84828501610bc5565b91505092915050565b600080600060608486031215610d9157610d906113f9565b5b6000610d9f86828701610bf3565b9350506020610db086828701610c93565b925050604084013567ffffffffffffffff811115610dd157610dd06113f4565b5b610ddd86828701610c08565b9150509250925092565b600060208284031215610dfd57610dfc6113f9565b5b600082013567ffffffffffffffff811115610e1b57610e1a6113f4565b5b610e2784828501610c08565b91505092915050565b600080600060408486031215610e4957610e486113f9565b5b6000610e5786828701610c36565b935050602084013567ffffffffffffffff811115610e7857610e776113f4565b5b610e8486828701610b6f565b92509250509250925092565b600060208284031215610ea657610ea56113f9565b5b600082013567ffffffffffffffff811115610ec457610ec36113f4565b5b610ed084828501610c55565b91505092915050565b600080600080600060808688031215610ef557610ef46113f9565b5b600086013567ffffffffffffffff811115610f1357610f126113f4565b5b610f1f88828901610c74565b9550506020610f3088828901610b30565b9450506040610f4188828901610c93565b935050606086013567ffffffffffffffff811115610f6257610f616113f4565b5b610f6e88828901610b6f565b92509250509295509295909350565b610f86816112c6565b82525050565b610f95816112d8565b82525050565b6000610fa7838561129f565b9350610fb483858461132a565b82840190509392505050565b6000610fcb82611278565b610fd5818561128e565b9350610fe5818560208601611339565b610fee816113fe565b840191505092915050565b600061100482611283565b61100e81856112bb565b935061101e818560208601611339565b80840191505092915050565b60006110376016836112aa565b91506110428261140f565b602082019050919050565b600061105a6006836112bb565b915061106582611438565b600682019050919050565b61107981611320565b82525050565b600061108c828486610f9b565b91508190509392505050565b60006110a48284610ff9565b915081905092915050565b60006110ba8261104d565b9150819050919050565b60006020820190506110d96000830184610f7d565b92915050565b60006060820190506110f46000830186610f7d565b6111016020830185610f7d565b61110e6040830184611070565b949350505050565b600060208201905061112b6000830184610f8c565b92915050565b6000602082019050818103600083015261114b8184610fc0565b905092915050565b6000602082019050818103600083015261116c8161102a565b9050919050565b60006020820190506111886000830184611070565b92915050565b600080833560016020038436030381126111ab576111aa6113e0565b5b80840192508235915067ffffffffffffffff8211156111cd576111cc6113d6565b5b6020830192506001820236038313156111e9576111e86113ea565b5b509250929050565b60006111fb61120c565b9050611207828261136c565b919050565b6000604051905090565b600067ffffffffffffffff8211156112315761123061139d565b5b61123a826113fe565b9050602081019050919050565b600067ffffffffffffffff8211156112625761126161139d565b5b61126b826113fe565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006112d182611300565b9050919050565b60008115159050919050565b6000819050919050565b60006112f9826112c6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561135757808201518184015260208101905061133c565b83811115611366576000848401525b50505050565b611375826113fe565b810181811067ffffffffffffffff821117156113945761139361139d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61146a816112c6565b811461147557600080fd5b50565b611481816112d8565b811461148c57600080fd5b50565b611498816112e4565b81146114a357600080fd5b50565b6114af816112ee565b81146114ba57600080fd5b50565b6114c681611320565b81146114d157600080fd5b5056fea2646970667358221220da9e50cb7b79ace99166ed06c9234f984bc9599fca79796389af6656411f73f964736f6c63430008070033", + 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\":\"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\":\"onCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"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: "0x608060405234801561001057600080fd5b5061150a806100206000396000f3fe6080604052600436106100c65760003560e01c8063a799911f1161007f578063c9028a3611610059578063c9028a3614610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063a799911f146101f9578063c234fecf14610215578063c7a339a91461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a777146101385780635bcfd61614610163578063676cc0541461018c5780639291fe26146101bc576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610de7565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610d02565b610371565b60405161012f9190611173565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a91906110c4565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190610ed9565b6103ad565b005b6101a660048036038101906101a19190610e30565b6104a6565b6040516101b39190611131565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190610de7565b61065b565b6040516101f09190611173565b60405180910390f35b610213600480360381019061020e9190610de7565b61069e565b005b34801561022157600080fd5b5061023c60048036038101906102379190610ca8565b6106c7565b005b34801561024a57600080fd5b5061026560048036038101906102609190610d78565b61070a565b005b34801561027357600080fd5b5061028e60048036038101906102899190610e90565b6107cd565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610d02565b610907565b6040516102c49190611116565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610de7565b610927565b6040516103019190611116565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190610d2f565b610977565b60405161033e91906110c4565b60405180910390f35b610350816109c0565b1561035a57600080fd5b61036381610a16565b61036e816000610a6a565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103fa82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506109c0565b1561040457600080fd5b61045182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61049f82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a6a565b5050505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906104f29190610ca8565b73ffffffffffffffffffffffffffffffffffffffff1614610548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053f90611153565b60405180910390fd5b61059583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b6105e383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505034610a6a565b8360000160208101906105f69190610ca8565b6002848460405161060892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060036000836040516020016106729190611098565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6106a7816109c0565b156106b157600080fd5b6106ba81610a16565b6106c48134610a6a565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610713816109c0565b1561071d57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161075a939291906110df565b602060405180830381600087803b15801561077457600080fd5b505af1158015610788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190610cd5565b6107b557600080fd5b6107be81610a16565b6107c88183610a6a565b505050565b6108288180606001906107e0919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61088581806060019061083b919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610a6a565b8060000160208101906108989190610ca8565b60028280606001906108aa919061118e565b6040516108b892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161093e9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016109d1906110af565b60405160208183030381529060405280519060200120826040516020016109f89190611098565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610a2c9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610a809190611098565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000610abf610aba84611216565b6111f1565b905082815260208101848484011115610adb57610ada6113ef565b5b610ae684828561132a565b509392505050565b6000610b01610afc84611247565b6111f1565b905082815260208101848484011115610b1d57610b1c6113ef565b5b610b2884828561132a565b509392505050565b600081359050610b3f81611461565b92915050565b600081519050610b5481611478565b92915050565b600081359050610b698161148f565b92915050565b60008083601f840112610b8557610b846113d1565b5b8235905067ffffffffffffffff811115610ba257610ba16113cc565b5b602083019150836001820283011115610bbe57610bbd6113e5565b5b9250929050565b600082601f830112610bda57610bd96113d1565b5b8135610bea848260208601610aac565b91505092915050565b600081359050610c02816114a6565b92915050565b600082601f830112610c1d57610c1c6113d1565b5b8135610c2d848260208601610aee565b91505092915050565b600060208284031215610c4c57610c4b6113db565b5b81905092915050565b600060808284031215610c6b57610c6a6113db565b5b81905092915050565b600060608284031215610c8a57610c896113db565b5b81905092915050565b600081359050610ca2816114bd565b92915050565b600060208284031215610cbe57610cbd6113f9565b5b6000610ccc84828501610b30565b91505092915050565b600060208284031215610ceb57610cea6113f9565b5b6000610cf984828501610b45565b91505092915050565b600060208284031215610d1857610d176113f9565b5b6000610d2684828501610b5a565b91505092915050565b600060208284031215610d4557610d446113f9565b5b600082013567ffffffffffffffff811115610d6357610d626113f4565b5b610d6f84828501610bc5565b91505092915050565b600080600060608486031215610d9157610d906113f9565b5b6000610d9f86828701610bf3565b9350506020610db086828701610c93565b925050604084013567ffffffffffffffff811115610dd157610dd06113f4565b5b610ddd86828701610c08565b9150509250925092565b600060208284031215610dfd57610dfc6113f9565b5b600082013567ffffffffffffffff811115610e1b57610e1a6113f4565b5b610e2784828501610c08565b91505092915050565b600080600060408486031215610e4957610e486113f9565b5b6000610e5786828701610c36565b935050602084013567ffffffffffffffff811115610e7857610e776113f4565b5b610e8486828701610b6f565b92509250509250925092565b600060208284031215610ea657610ea56113f9565b5b600082013567ffffffffffffffff811115610ec457610ec36113f4565b5b610ed084828501610c55565b91505092915050565b600080600080600060808688031215610ef557610ef46113f9565b5b600086013567ffffffffffffffff811115610f1357610f126113f4565b5b610f1f88828901610c74565b9550506020610f3088828901610b30565b9450506040610f4188828901610c93565b935050606086013567ffffffffffffffff811115610f6257610f616113f4565b5b610f6e88828901610b6f565b92509250509295509295909350565b610f86816112c6565b82525050565b610f95816112d8565b82525050565b6000610fa7838561129f565b9350610fb483858461132a565b82840190509392505050565b6000610fcb82611278565b610fd5818561128e565b9350610fe5818560208601611339565b610fee816113fe565b840191505092915050565b600061100482611283565b61100e81856112bb565b935061101e818560208601611339565b80840191505092915050565b60006110376016836112aa565b91506110428261140f565b602082019050919050565b600061105a6006836112bb565b915061106582611438565b600682019050919050565b61107981611320565b82525050565b600061108c828486610f9b565b91508190509392505050565b60006110a48284610ff9565b915081905092915050565b60006110ba8261104d565b9150819050919050565b60006020820190506110d96000830184610f7d565b92915050565b60006060820190506110f46000830186610f7d565b6111016020830185610f7d565b61110e6040830184611070565b949350505050565b600060208201905061112b6000830184610f8c565b92915050565b6000602082019050818103600083015261114b8184610fc0565b905092915050565b6000602082019050818103600083015261116c8161102a565b9050919050565b60006020820190506111886000830184611070565b92915050565b600080833560016020038436030381126111ab576111aa6113e0565b5b80840192508235915067ffffffffffffffff8211156111cd576111cc6113d6565b5b6020830192506001820236038313156111e9576111e86113ea565b5b509250929050565b60006111fb61120c565b9050611207828261136c565b919050565b6000604051905090565b600067ffffffffffffffff8211156112315761123061139d565b5b61123a826113fe565b9050602081019050919050565b600067ffffffffffffffff8211156112625761126161139d565b5b61126b826113fe565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006112d182611300565b9050919050565b60008115159050919050565b6000819050919050565b60006112f9826112c6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561135757808201518184015260208101905061133c565b83811115611366576000848401525b50505050565b611375826113fe565b810181811067ffffffffffffffff821117156113945761139361139d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61146a816112c6565b811461147557600080fd5b50565b611481816112d8565b811461148c57600080fd5b50565b611498816112e4565b81146114a357600080fd5b50565b6114af816112ee565b81146114ba57600080fd5b50565b6114c681611320565b81146114d157600080fd5b5056fea2646970667358221220f3098dec1315d0cad1405fecc08983ea60d8ccb240a10da773012d554f5948f264736f6c63430008070033", } // TestDAppV2ABI is the input ABI used to generate the binding from. @@ -450,46 +450,46 @@ 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. +// OnCall is a paid mutator transaction binding the contract method 0x5bcfd616. // -// 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) +// Solidity: function onCall((bytes,address,uint256) _context, address _zrc20, uint256 amount, bytes message) returns() +func (_TestDAppV2 *TestDAppV2Transactor) OnCall(opts *bind.TransactOpts, _context TestDAppV2zContext, _zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) { + return _TestDAppV2.contract.Transact(opts, "onCall", _context, _zrc20, amount, message) } -// OnCall is a paid mutator transaction binding the contract method 0x676cc054. +// OnCall is a paid mutator transaction binding the contract method 0x5bcfd616. // -// 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) +// Solidity: function onCall((bytes,address,uint256) _context, address _zrc20, uint256 amount, bytes message) returns() +func (_TestDAppV2 *TestDAppV2Session) OnCall(_context TestDAppV2zContext, _zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) { + return _TestDAppV2.Contract.OnCall(&_TestDAppV2.TransactOpts, _context, _zrc20, amount, message) } -// OnCall is a paid mutator transaction binding the contract method 0x676cc054. +// OnCall is a paid mutator transaction binding the contract method 0x5bcfd616. // -// 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) +// Solidity: function onCall((bytes,address,uint256) _context, address _zrc20, uint256 amount, bytes message) returns() +func (_TestDAppV2 *TestDAppV2TransactorSession) OnCall(_context TestDAppV2zContext, _zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) { + return _TestDAppV2.Contract.OnCall(&_TestDAppV2.TransactOpts, _context, _zrc20, amount, message) } -// OnCrossChainCall is a paid mutator transaction binding the contract method 0xde43156e. +// OnCall0 is a paid mutator transaction binding the contract method 0x676cc054. // -// Solidity: function onCrossChainCall((bytes,address,uint256) _context, address _zrc20, uint256 amount, bytes message) returns() -func (_TestDAppV2 *TestDAppV2Transactor) OnCrossChainCall(opts *bind.TransactOpts, _context TestDAppV2zContext, _zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) { - return _TestDAppV2.contract.Transact(opts, "onCrossChainCall", _context, _zrc20, amount, message) +// Solidity: function onCall((address) messageContext, bytes message) payable returns(bytes) +func (_TestDAppV2 *TestDAppV2Transactor) OnCall0(opts *bind.TransactOpts, messageContext TestDAppV2MessageContext, message []byte) (*types.Transaction, error) { + return _TestDAppV2.contract.Transact(opts, "onCall0", messageContext, message) } -// OnCrossChainCall is a paid mutator transaction binding the contract method 0xde43156e. +// OnCall0 is a paid mutator transaction binding the contract method 0x676cc054. // -// Solidity: function onCrossChainCall((bytes,address,uint256) _context, address _zrc20, uint256 amount, bytes message) returns() -func (_TestDAppV2 *TestDAppV2Session) OnCrossChainCall(_context TestDAppV2zContext, _zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) { - return _TestDAppV2.Contract.OnCrossChainCall(&_TestDAppV2.TransactOpts, _context, _zrc20, amount, message) +// Solidity: function onCall((address) messageContext, bytes message) payable returns(bytes) +func (_TestDAppV2 *TestDAppV2Session) OnCall0(messageContext TestDAppV2MessageContext, message []byte) (*types.Transaction, error) { + return _TestDAppV2.Contract.OnCall0(&_TestDAppV2.TransactOpts, messageContext, message) } -// OnCrossChainCall is a paid mutator transaction binding the contract method 0xde43156e. +// OnCall0 is a paid mutator transaction binding the contract method 0x676cc054. // -// Solidity: function onCrossChainCall((bytes,address,uint256) _context, address _zrc20, uint256 amount, bytes message) returns() -func (_TestDAppV2 *TestDAppV2TransactorSession) OnCrossChainCall(_context TestDAppV2zContext, _zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) { - return _TestDAppV2.Contract.OnCrossChainCall(&_TestDAppV2.TransactOpts, _context, _zrc20, amount, message) +// Solidity: function onCall((address) messageContext, bytes message) payable returns(bytes) +func (_TestDAppV2 *TestDAppV2TransactorSession) OnCall0(messageContext TestDAppV2MessageContext, message []byte) (*types.Transaction, error) { + return _TestDAppV2.Contract.OnCall0(&_TestDAppV2.TransactOpts, messageContext, message) } // OnRevert is a paid mutator transaction binding the contract method 0xc9028a36. diff --git a/pkg/contracts/testdappv2/TestDAppV2.json b/pkg/contracts/testdappv2/TestDAppV2.json index 632521fa63..cb9bcfeb79 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.json +++ b/pkg/contracts/testdappv2/TestDAppV2.json @@ -125,37 +125,6 @@ "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": [ { @@ -196,11 +165,42 @@ "type": "bytes" } ], - "name": "onCrossChainCall", + "name": "onCall", "outputs": [], "stateMutability": "nonpayable", "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": [ { @@ -286,5 +286,5 @@ "type": "receive" } ], - "bin": "608060405234801561001057600080fd5b5061150a806100206000396000f3fe6080604052600436106100c65760003560e01c8063c234fecf1161007f578063de43156e11610059578063de43156e14610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063c234fecf146101ec578063c7a339a914610215578063c9028a361461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a77714610138578063676cc054146101635780639291fe2614610193578063a799911f146101d0576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610de7565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610d02565b610371565b60405161012f9190611173565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a91906110c4565b60405180910390f35b61017d60048036038101906101789190610e30565b6103ad565b60405161018a9190611131565b60405180910390f35b34801561019f57600080fd5b506101ba60048036038101906101b59190610de7565b610562565b6040516101c79190611173565b60405180910390f35b6101ea60048036038101906101e59190610de7565b6105a5565b005b3480156101f857600080fd5b50610213600480360381019061020e9190610ca8565b6105ce565b005b34801561022157600080fd5b5061023c60048036038101906102379190610d78565b610611565b005b34801561024a57600080fd5b5061026560048036038101906102609190610e90565b6106d4565b005b34801561027357600080fd5b5061028e60048036038101906102899190610ed9565b61080e565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610d02565b610907565b6040516102c49190611116565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610de7565b610927565b6040516103019190611116565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190610d2f565b610977565b60405161033e91906110c4565b60405180910390f35b610350816109c0565b1561035a57600080fd5b61036381610a16565b61036e816000610a6a565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906103f99190610ca8565b73ffffffffffffffffffffffffffffffffffffffff161461044f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044690611153565b60405180910390fd5b61049c83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b6104ea83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505034610a6a565b8360000160208101906104fd9190610ca8565b6002848460405161050f92919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060036000836040516020016105799190611098565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105ae816109c0565b156105b857600080fd5b6105c181610a16565b6105cb8134610a6a565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61061a816109c0565b1561062457600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610661939291906110df565b602060405180830381600087803b15801561067b57600080fd5b505af115801561068f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b39190610cd5565b6106bc57600080fd5b6106c581610a16565b6106cf8183610a6a565b505050565b61072f8180606001906106e7919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61078c818060600190610742919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610a6a565b80600001602081019061079f9190610ca8565b60028280606001906107b1919061118e565b6040516107bf92919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61085b82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506109c0565b1561086557600080fd5b6108b282828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61090082828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a6a565b5050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161093e9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016109d1906110af565b60405160208183030381529060405280519060200120826040516020016109f89190611098565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610a2c9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610a809190611098565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000610abf610aba84611216565b6111f1565b905082815260208101848484011115610adb57610ada6113ef565b5b610ae684828561132a565b509392505050565b6000610b01610afc84611247565b6111f1565b905082815260208101848484011115610b1d57610b1c6113ef565b5b610b2884828561132a565b509392505050565b600081359050610b3f81611461565b92915050565b600081519050610b5481611478565b92915050565b600081359050610b698161148f565b92915050565b60008083601f840112610b8557610b846113d1565b5b8235905067ffffffffffffffff811115610ba257610ba16113cc565b5b602083019150836001820283011115610bbe57610bbd6113e5565b5b9250929050565b600082601f830112610bda57610bd96113d1565b5b8135610bea848260208601610aac565b91505092915050565b600081359050610c02816114a6565b92915050565b600082601f830112610c1d57610c1c6113d1565b5b8135610c2d848260208601610aee565b91505092915050565b600060208284031215610c4c57610c4b6113db565b5b81905092915050565b600060808284031215610c6b57610c6a6113db565b5b81905092915050565b600060608284031215610c8a57610c896113db565b5b81905092915050565b600081359050610ca2816114bd565b92915050565b600060208284031215610cbe57610cbd6113f9565b5b6000610ccc84828501610b30565b91505092915050565b600060208284031215610ceb57610cea6113f9565b5b6000610cf984828501610b45565b91505092915050565b600060208284031215610d1857610d176113f9565b5b6000610d2684828501610b5a565b91505092915050565b600060208284031215610d4557610d446113f9565b5b600082013567ffffffffffffffff811115610d6357610d626113f4565b5b610d6f84828501610bc5565b91505092915050565b600080600060608486031215610d9157610d906113f9565b5b6000610d9f86828701610bf3565b9350506020610db086828701610c93565b925050604084013567ffffffffffffffff811115610dd157610dd06113f4565b5b610ddd86828701610c08565b9150509250925092565b600060208284031215610dfd57610dfc6113f9565b5b600082013567ffffffffffffffff811115610e1b57610e1a6113f4565b5b610e2784828501610c08565b91505092915050565b600080600060408486031215610e4957610e486113f9565b5b6000610e5786828701610c36565b935050602084013567ffffffffffffffff811115610e7857610e776113f4565b5b610e8486828701610b6f565b92509250509250925092565b600060208284031215610ea657610ea56113f9565b5b600082013567ffffffffffffffff811115610ec457610ec36113f4565b5b610ed084828501610c55565b91505092915050565b600080600080600060808688031215610ef557610ef46113f9565b5b600086013567ffffffffffffffff811115610f1357610f126113f4565b5b610f1f88828901610c74565b9550506020610f3088828901610b30565b9450506040610f4188828901610c93565b935050606086013567ffffffffffffffff811115610f6257610f616113f4565b5b610f6e88828901610b6f565b92509250509295509295909350565b610f86816112c6565b82525050565b610f95816112d8565b82525050565b6000610fa7838561129f565b9350610fb483858461132a565b82840190509392505050565b6000610fcb82611278565b610fd5818561128e565b9350610fe5818560208601611339565b610fee816113fe565b840191505092915050565b600061100482611283565b61100e81856112bb565b935061101e818560208601611339565b80840191505092915050565b60006110376016836112aa565b91506110428261140f565b602082019050919050565b600061105a6006836112bb565b915061106582611438565b600682019050919050565b61107981611320565b82525050565b600061108c828486610f9b565b91508190509392505050565b60006110a48284610ff9565b915081905092915050565b60006110ba8261104d565b9150819050919050565b60006020820190506110d96000830184610f7d565b92915050565b60006060820190506110f46000830186610f7d565b6111016020830185610f7d565b61110e6040830184611070565b949350505050565b600060208201905061112b6000830184610f8c565b92915050565b6000602082019050818103600083015261114b8184610fc0565b905092915050565b6000602082019050818103600083015261116c8161102a565b9050919050565b60006020820190506111886000830184611070565b92915050565b600080833560016020038436030381126111ab576111aa6113e0565b5b80840192508235915067ffffffffffffffff8211156111cd576111cc6113d6565b5b6020830192506001820236038313156111e9576111e86113ea565b5b509250929050565b60006111fb61120c565b9050611207828261136c565b919050565b6000604051905090565b600067ffffffffffffffff8211156112315761123061139d565b5b61123a826113fe565b9050602081019050919050565b600067ffffffffffffffff8211156112625761126161139d565b5b61126b826113fe565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006112d182611300565b9050919050565b60008115159050919050565b6000819050919050565b60006112f9826112c6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561135757808201518184015260208101905061133c565b83811115611366576000848401525b50505050565b611375826113fe565b810181811067ffffffffffffffff821117156113945761139361139d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61146a816112c6565b811461147557600080fd5b50565b611481816112d8565b811461148c57600080fd5b50565b611498816112e4565b81146114a357600080fd5b50565b6114af816112ee565b81146114ba57600080fd5b50565b6114c681611320565b81146114d157600080fd5b5056fea2646970667358221220da9e50cb7b79ace99166ed06c9234f984bc9599fca79796389af6656411f73f964736f6c63430008070033" + "bin": "608060405234801561001057600080fd5b5061150a806100206000396000f3fe6080604052600436106100c65760003560e01c8063a799911f1161007f578063c9028a3611610059578063c9028a3614610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063a799911f146101f9578063c234fecf14610215578063c7a339a91461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a777146101385780635bcfd61614610163578063676cc0541461018c5780639291fe26146101bc576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610de7565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610d02565b610371565b60405161012f9190611173565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a91906110c4565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190610ed9565b6103ad565b005b6101a660048036038101906101a19190610e30565b6104a6565b6040516101b39190611131565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190610de7565b61065b565b6040516101f09190611173565b60405180910390f35b610213600480360381019061020e9190610de7565b61069e565b005b34801561022157600080fd5b5061023c60048036038101906102379190610ca8565b6106c7565b005b34801561024a57600080fd5b5061026560048036038101906102609190610d78565b61070a565b005b34801561027357600080fd5b5061028e60048036038101906102899190610e90565b6107cd565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610d02565b610907565b6040516102c49190611116565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610de7565b610927565b6040516103019190611116565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190610d2f565b610977565b60405161033e91906110c4565b60405180910390f35b610350816109c0565b1561035a57600080fd5b61036381610a16565b61036e816000610a6a565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103fa82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506109c0565b1561040457600080fd5b61045182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61049f82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a6a565b5050505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906104f29190610ca8565b73ffffffffffffffffffffffffffffffffffffffff1614610548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053f90611153565b60405180910390fd5b61059583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b6105e383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505034610a6a565b8360000160208101906105f69190610ca8565b6002848460405161060892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060036000836040516020016106729190611098565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6106a7816109c0565b156106b157600080fd5b6106ba81610a16565b6106c48134610a6a565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610713816109c0565b1561071d57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161075a939291906110df565b602060405180830381600087803b15801561077457600080fd5b505af1158015610788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190610cd5565b6107b557600080fd5b6107be81610a16565b6107c88183610a6a565b505050565b6108288180606001906107e0919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61088581806060019061083b919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610a6a565b8060000160208101906108989190610ca8565b60028280606001906108aa919061118e565b6040516108b892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161093e9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016109d1906110af565b60405160208183030381529060405280519060200120826040516020016109f89190611098565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610a2c9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610a809190611098565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000610abf610aba84611216565b6111f1565b905082815260208101848484011115610adb57610ada6113ef565b5b610ae684828561132a565b509392505050565b6000610b01610afc84611247565b6111f1565b905082815260208101848484011115610b1d57610b1c6113ef565b5b610b2884828561132a565b509392505050565b600081359050610b3f81611461565b92915050565b600081519050610b5481611478565b92915050565b600081359050610b698161148f565b92915050565b60008083601f840112610b8557610b846113d1565b5b8235905067ffffffffffffffff811115610ba257610ba16113cc565b5b602083019150836001820283011115610bbe57610bbd6113e5565b5b9250929050565b600082601f830112610bda57610bd96113d1565b5b8135610bea848260208601610aac565b91505092915050565b600081359050610c02816114a6565b92915050565b600082601f830112610c1d57610c1c6113d1565b5b8135610c2d848260208601610aee565b91505092915050565b600060208284031215610c4c57610c4b6113db565b5b81905092915050565b600060808284031215610c6b57610c6a6113db565b5b81905092915050565b600060608284031215610c8a57610c896113db565b5b81905092915050565b600081359050610ca2816114bd565b92915050565b600060208284031215610cbe57610cbd6113f9565b5b6000610ccc84828501610b30565b91505092915050565b600060208284031215610ceb57610cea6113f9565b5b6000610cf984828501610b45565b91505092915050565b600060208284031215610d1857610d176113f9565b5b6000610d2684828501610b5a565b91505092915050565b600060208284031215610d4557610d446113f9565b5b600082013567ffffffffffffffff811115610d6357610d626113f4565b5b610d6f84828501610bc5565b91505092915050565b600080600060608486031215610d9157610d906113f9565b5b6000610d9f86828701610bf3565b9350506020610db086828701610c93565b925050604084013567ffffffffffffffff811115610dd157610dd06113f4565b5b610ddd86828701610c08565b9150509250925092565b600060208284031215610dfd57610dfc6113f9565b5b600082013567ffffffffffffffff811115610e1b57610e1a6113f4565b5b610e2784828501610c08565b91505092915050565b600080600060408486031215610e4957610e486113f9565b5b6000610e5786828701610c36565b935050602084013567ffffffffffffffff811115610e7857610e776113f4565b5b610e8486828701610b6f565b92509250509250925092565b600060208284031215610ea657610ea56113f9565b5b600082013567ffffffffffffffff811115610ec457610ec36113f4565b5b610ed084828501610c55565b91505092915050565b600080600080600060808688031215610ef557610ef46113f9565b5b600086013567ffffffffffffffff811115610f1357610f126113f4565b5b610f1f88828901610c74565b9550506020610f3088828901610b30565b9450506040610f4188828901610c93565b935050606086013567ffffffffffffffff811115610f6257610f616113f4565b5b610f6e88828901610b6f565b92509250509295509295909350565b610f86816112c6565b82525050565b610f95816112d8565b82525050565b6000610fa7838561129f565b9350610fb483858461132a565b82840190509392505050565b6000610fcb82611278565b610fd5818561128e565b9350610fe5818560208601611339565b610fee816113fe565b840191505092915050565b600061100482611283565b61100e81856112bb565b935061101e818560208601611339565b80840191505092915050565b60006110376016836112aa565b91506110428261140f565b602082019050919050565b600061105a6006836112bb565b915061106582611438565b600682019050919050565b61107981611320565b82525050565b600061108c828486610f9b565b91508190509392505050565b60006110a48284610ff9565b915081905092915050565b60006110ba8261104d565b9150819050919050565b60006020820190506110d96000830184610f7d565b92915050565b60006060820190506110f46000830186610f7d565b6111016020830185610f7d565b61110e6040830184611070565b949350505050565b600060208201905061112b6000830184610f8c565b92915050565b6000602082019050818103600083015261114b8184610fc0565b905092915050565b6000602082019050818103600083015261116c8161102a565b9050919050565b60006020820190506111886000830184611070565b92915050565b600080833560016020038436030381126111ab576111aa6113e0565b5b80840192508235915067ffffffffffffffff8211156111cd576111cc6113d6565b5b6020830192506001820236038313156111e9576111e86113ea565b5b509250929050565b60006111fb61120c565b9050611207828261136c565b919050565b6000604051905090565b600067ffffffffffffffff8211156112315761123061139d565b5b61123a826113fe565b9050602081019050919050565b600067ffffffffffffffff8211156112625761126161139d565b5b61126b826113fe565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006112d182611300565b9050919050565b60008115159050919050565b6000819050919050565b60006112f9826112c6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561135757808201518184015260208101905061133c565b83811115611366576000848401525b50505050565b611375826113fe565b810181811067ffffffffffffffff821117156113945761139361139d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61146a816112c6565b811461147557600080fd5b50565b611481816112d8565b811461148c57600080fd5b50565b611498816112e4565b81146114a357600080fd5b50565b6114af816112ee565b81146114ba57600080fd5b50565b6114c681611320565b81146114d157600080fd5b5056fea2646970667358221220f3098dec1315d0cad1405fecc08983ea60d8ccb240a10da773012d554f5948f264736f6c63430008070033" } diff --git a/pkg/contracts/testdappv2/TestDAppV2.sol b/pkg/contracts/testdappv2/TestDAppV2.sol index 7919d13b5d..3d9d3ca5fc 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.sol +++ b/pkg/contracts/testdappv2/TestDAppV2.sol @@ -53,7 +53,7 @@ contract TestDAppV2 { } // Universal contract interface - function onCrossChainCall( + function onCall( zContext calldata _context, address _zrc20, uint256 amount, From 98afcefb803f9c55a506b82f7ab1629415795cfc Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 17:18:28 +0200 Subject: [PATCH 03/16] rename current test to arbitrary call --- cmd/zetae2e/local/v2.go | 2 +- e2e/e2etests/e2etests.go | 8 ++--- ...t_v2_erc20_withdraw_and_arbitrary_call.go} | 2 +- e2e/runner/v2_zevm.go | 29 +++++++++++++++++++ 4 files changed, 35 insertions(+), 6 deletions(-) rename e2e/e2etests/{test_v2_erc20_withdraw_and_call.go => test_v2_erc20_withdraw_and_arbitrary_call.go} (94%) diff --git a/cmd/zetae2e/local/v2.go b/cmd/zetae2e/local/v2.go index fa98ef6677..95c78a35e0 100644 --- a/cmd/zetae2e/local/v2.go +++ b/cmd/zetae2e/local/v2.go @@ -34,7 +34,7 @@ func startV2Tests(eg *errgroup.Group, conf config.Config, deployerRunner *runner e2etests.TestV2ERC20DepositName, e2etests.TestV2ERC20DepositAndCallName, e2etests.TestV2ERC20WithdrawName, - e2etests.TestV2ERC20WithdrawAndCallName, + e2etests.TestV2ERC20WithdrawAndArbitraryCallName, )) // Test revert cases for gas token workflow diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index 2d6eea998f..ca00ef301a 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -143,7 +143,7 @@ const ( 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" + TestV2ERC20WithdrawAndArbitraryCallName = "v2_erc20_withdraw_and_arbitrary_call" TestV2ERC20WithdrawAndCallRevertName = "v2_erc20_withdraw_and_call_revert" TestV2ERC20WithdrawAndCallRevertWithCallName = "v2_erc20_withdraw_and_call_revert_with_call" TestV2ZEVMToEVMArbitraryCallName = "v2_zevm_to_evm_arbitrary_call" @@ -835,12 +835,12 @@ var AllE2ETests = []runner.E2ETest{ TestV2ERC20Withdraw, ), runner.NewE2ETest( - TestV2ERC20WithdrawAndCallName, - "withdraw ERC20 from ZEVM and call a contract using V2 contract", + TestV2ERC20WithdrawAndArbitraryCallName, + "withdraw ERC20 from ZEVM and arbitrary call a contract using V2 contract", []runner.ArgDefinition{ {Description: "amount", DefaultValue: "1000"}, }, - TestV2ERC20WithdrawAndCall, + TestV2ERC20WithdrawAndArbitraryCall, ), runner.NewE2ETest( TestV2ERC20WithdrawAndCallRevertName, diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go b/e2e/e2etests/test_v2_erc20_withdraw_and_arbitrary_call.go similarity index 94% rename from e2e/e2etests/test_v2_erc20_withdraw_and_call.go rename to e2e/e2etests/test_v2_erc20_withdraw_and_arbitrary_call.go index 6773e84f17..6e4d48da91 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_arbitrary_call.go @@ -13,7 +13,7 @@ import ( const payloadMessageWithdrawERC20 = "this is a test ERC20 withdraw and call payload" -func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, args []string) { +func TestV2ERC20WithdrawAndArbitraryCall(r *runner.E2ERunner, args []string) { require.Len(r, args, 1) amount, ok := big.NewInt(0).SetString(args[0], 10) diff --git a/e2e/runner/v2_zevm.go b/e2e/runner/v2_zevm.go index bb22cc06e0..76dcc53f7a 100644 --- a/e2e/runner/v2_zevm.go +++ b/e2e/runner/v2_zevm.go @@ -149,6 +149,35 @@ func (r *E2ERunner) V2ERC20WithdrawAndCall( return tx } +// V2ERC20WithdrawAndCall calls authenticated WithdrawAndCall of Gateway with erc20 token on ZEVM +func (r *E2ERunner) V2ERC20WithdrawAndAuthenticatedCall( + receiver ethcommon.Address, + amount *big.Int, + payload []byte, + revertOptions gatewayzevm.RevertOptions, +) *ethtypes.Transaction { + // this function take more gas than default 500k + // so we need to increase the gas limit + previousGasLimit := r.ZEVMAuth.GasLimit + r.ZEVMAuth.GasLimit = 10000000 + defer func() { + r.ZEVMAuth.GasLimit = previousGasLimit + }() + + tx, err := r.GatewayZEVM.WithdrawAndCall0( + r.ZEVMAuth, + receiver.Bytes(), + amount, + r.ERC20ZRC20Addr, + payload, + gatewayzevm.CallOptions{GasLimit: gasLimit, IsArbitraryCall: false}, + revertOptions, + ) + require.NoError(r, err) + + return tx +} + // V2ZEVMToEMVCall calls Call of Gateway on ZEVM func (r *E2ERunner) V2ZEVMToEMVCall( receiver ethcommon.Address, From dbe4ab34f6b65c1a517883121ed3953c7abc781d Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 17:24:38 +0200 Subject: [PATCH 04/16] rename existing tests --- ...st_v2_erc20_withdraw_and_arbitrary_call.go | 2 +- .../test_v2_erc20_withdraw_and_call_revert.go | 2 +- ...rc20_withdraw_and_call_revert_with_call.go | 2 +- ...test_v2_eth_withdraw_and_arbitrary_call.go | 2 +- e2e/e2etests/test_v2_eth_withdraw_and_call.go | 2 +- .../test_v2_eth_withdraw_and_call_revert.go | 2 +- ..._eth_withdraw_and_call_revert_with_call.go | 2 +- ..._eth_withdraw_and_call_through_contract.go | 4 +-- .../test_v2_zevm_to_evm_arbitrary_call.go | 2 +- e2e/e2etests/test_v2_zevm_to_evm_call.go | 2 +- ...st_v2_zevm_to_evm_call_through_contract.go | 4 +-- e2e/runner/v2_zevm.go | 28 +++++++++---------- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_arbitrary_call.go b/e2e/e2etests/test_v2_erc20_withdraw_and_arbitrary_call.go index 6e4d48da91..ca48f4be8b 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_arbitrary_call.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_arbitrary_call.go @@ -25,7 +25,7 @@ func TestV2ERC20WithdrawAndArbitraryCall(r *runner.E2ERunner, args []string) { r.ApproveETHZRC20(r.GatewayZEVMAddr) // perform the withdraw - tx := r.V2ERC20WithdrawAndCall( + tx := r.V2ERC20WithdrawAndArbitraryCall( r.TestDAppV2EVMAddr, amount, r.EncodeERC20Call(r.ERC20Addr, amount, payloadMessageWithdrawERC20), diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call_revert.go b/e2e/e2etests/test_v2_erc20_withdraw_and_call_revert.go index 8454d09710..8ca60a238b 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_call_revert.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_call_revert.go @@ -29,7 +29,7 @@ func TestV2ERC20WithdrawAndCallRevert(r *runner.E2ERunner, args []string) { require.EqualValues(r, int64(0), balance.Int64()) // perform the withdraw - tx := r.V2ERC20WithdrawAndCall( + tx := r.V2ERC20WithdrawAndArbitraryCall( r.TestDAppV2EVMAddr, amount, r.EncodeERC20CallRevert(r.ERC20Addr, amount), diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call_revert_with_call.go b/e2e/e2etests/test_v2_erc20_withdraw_and_call_revert_with_call.go index 45bab52ae6..fb3b3201ff 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_call_revert_with_call.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_call_revert_with_call.go @@ -26,7 +26,7 @@ func TestV2ERC20WithdrawAndCallRevertWithCall(r *runner.E2ERunner, args []string r.ApproveETHZRC20(r.GatewayZEVMAddr) // perform the withdraw - tx := r.V2ERC20WithdrawAndCall( + tx := r.V2ERC20WithdrawAndArbitraryCall( r.TestDAppV2EVMAddr, amount, r.EncodeERC20CallRevert(r.ERC20Addr, amount), diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_arbitrary_call.go b/e2e/e2etests/test_v2_eth_withdraw_and_arbitrary_call.go index 932034d963..b290e33fcb 100644 --- a/e2e/e2etests/test_v2_eth_withdraw_and_arbitrary_call.go +++ b/e2e/e2etests/test_v2_eth_withdraw_and_arbitrary_call.go @@ -24,7 +24,7 @@ func TestV2ETHWithdrawAndArbitraryCall(r *runner.E2ERunner, args []string) { r.ApproveETHZRC20(r.GatewayZEVMAddr) // perform the withdraw - tx := r.V2ETHWithdrawAndCall( + tx := r.V2ETHWithdrawAndArbitraryCall( r.TestDAppV2EVMAddr, amount, r.EncodeGasCall(payloadMessageWithdrawETH), diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_call.go b/e2e/e2etests/test_v2_eth_withdraw_and_call.go index de0cadabcf..42a835d75c 100644 --- a/e2e/e2etests/test_v2_eth_withdraw_and_call.go +++ b/e2e/e2etests/test_v2_eth_withdraw_and_call.go @@ -36,7 +36,7 @@ func TestV2ETHWithdrawAndCall(r *runner.E2ERunner, args []string) { utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) // perform the withdraw - tx = r.V2ETHWithdrawAndAuthenticatedCall( + tx = r.V2ETHWithdrawAndCall( r.TestDAppV2EVMAddr, amount, []byte(payloadMessageAuthenticatedWithdrawETH), diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_call_revert.go b/e2e/e2etests/test_v2_eth_withdraw_and_call_revert.go index 6df64c9a69..b34819e998 100644 --- a/e2e/e2etests/test_v2_eth_withdraw_and_call_revert.go +++ b/e2e/e2etests/test_v2_eth_withdraw_and_call_revert.go @@ -28,7 +28,7 @@ func TestV2ETHWithdrawAndCallRevert(r *runner.E2ERunner, args []string) { require.EqualValues(r, int64(0), balance.Int64()) // perform the withdraw - tx := r.V2ETHWithdrawAndCall(r.TestDAppV2EVMAddr, amount, r.EncodeGasCall("revert"), gatewayzevm.RevertOptions{ + tx := r.V2ETHWithdrawAndArbitraryCall(r.TestDAppV2EVMAddr, amount, r.EncodeGasCall("revert"), gatewayzevm.RevertOptions{ RevertAddress: revertAddress, OnRevertGasLimit: big.NewInt(0), }) diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_call_revert_with_call.go b/e2e/e2etests/test_v2_eth_withdraw_and_call_revert_with_call.go index f4d31d5d14..f613ebffc2 100644 --- a/e2e/e2etests/test_v2_eth_withdraw_and_call_revert_with_call.go +++ b/e2e/e2etests/test_v2_eth_withdraw_and_call_revert_with_call.go @@ -25,7 +25,7 @@ func TestV2ETHWithdrawAndCallRevertWithCall(r *runner.E2ERunner, args []string) r.ApproveETHZRC20(r.GatewayZEVMAddr) // perform the withdraw - tx := r.V2ETHWithdrawAndCall( + tx := r.V2ETHWithdrawAndArbitraryCall( r.TestDAppV2EVMAddr, amount, r.EncodeGasCall("revert"), diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go b/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go index f2d4949032..0e0e0462f3 100644 --- a/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go +++ b/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go @@ -46,7 +46,7 @@ func TestV2ETHWithdrawAndCallThroughContract(r *runner.E2ERunner, args []string) utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) // perform the authenticated call - tx = r.V2ETHWithdrawAndAuthenticatedCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr, + tx = r.V2ETHWithdrawAndCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr, amount, []byte(payloadMessageAuthenticatedWithdrawETHThroughContract), gatewayzevmcaller.RevertOptions{OnRevertGasLimit: big.NewInt(0)}) @@ -72,7 +72,7 @@ func TestV2ETHWithdrawAndCallThroughContract(r *runner.E2ERunner, args []string) 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, + tx = r.V2ETHWithdrawAndCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr, amount, []byte(payloadMessageAuthenticatedWithdrawETHThroughContract), gatewayzevmcaller.RevertOptions{OnRevertGasLimit: big.NewInt(0)}) diff --git a/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go b/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go index 21104767f9..eb032154f8 100644 --- a/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go +++ b/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go @@ -22,7 +22,7 @@ func TestV2ZEVMToEVMArbitraryCall(r *runner.E2ERunner, args []string) { r.ApproveETHZRC20(r.GatewayZEVMAddr) // perform the call - tx := r.V2ZEVMToEMVCall(r.TestDAppV2EVMAddr, r.EncodeSimpleCall(payloadMessageEVMCall), gatewayzevm.RevertOptions{ + tx := r.V2ZEVMToEMVArbitraryCall(r.TestDAppV2EVMAddr, r.EncodeSimpleCall(payloadMessageEVMCall), gatewayzevm.RevertOptions{ OnRevertGasLimit: big.NewInt(0), }) diff --git a/e2e/e2etests/test_v2_zevm_to_evm_call.go b/e2e/e2etests/test_v2_zevm_to_evm_call.go index ba9d5fba6f..e6ddb593a7 100644 --- a/e2e/e2etests/test_v2_zevm_to_evm_call.go +++ b/e2e/e2etests/test_v2_zevm_to_evm_call.go @@ -28,7 +28,7 @@ func TestV2ZEVMToEVMCall(r *runner.E2ERunner, args []string) { utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) // perform the authenticated call - tx = r.V2ZEVMToEMVAuthenticatedCall( + tx = r.V2ZEVMToEMVCall( r.TestDAppV2EVMAddr, []byte(payloadMessageEVMAuthenticatedCall), gatewayzevm.RevertOptions{ diff --git a/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go b/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go index a46b9f09f9..856586495e 100644 --- a/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go +++ b/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go @@ -39,7 +39,7 @@ func TestV2ZEVMToEVMCallThroughContract(r *runner.E2ERunner, args []string) { utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) // perform the authenticated call - tx = r.V2ZEVMToEMVAuthenticatedCallThroughContract( + tx = r.V2ZEVMToEMVCallThroughContract( gatewayCaller, r.TestDAppV2EVMAddr, []byte(payloadMessageEVMAuthenticatedCallThroughContract), @@ -68,7 +68,7 @@ func TestV2ZEVMToEVMCallThroughContract(r *runner.E2ERunner, args []string) { 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( + tx = r.V2ZEVMToEMVCallThroughContract( gatewayCaller, r.TestDAppV2EVMAddr, []byte(payloadMessageEVMAuthenticatedCallThroughContract), diff --git a/e2e/runner/v2_zevm.go b/e2e/runner/v2_zevm.go index 76dcc53f7a..5153f2c823 100644 --- a/e2e/runner/v2_zevm.go +++ b/e2e/runner/v2_zevm.go @@ -31,8 +31,8 @@ func (r *E2ERunner) V2ETHWithdraw( return tx } -// V2ETHWithdrawAndCall calls WithdrawAndCall of Gateway with gas token on ZEVM -func (r *E2ERunner) V2ETHWithdrawAndCall( +// V2ETHWithdrawAndCall calls WithdrawAndCall of Gateway with gas token on ZEVM using arbitrary call +func (r *E2ERunner) V2ETHWithdrawAndArbitraryCall( receiver ethcommon.Address, amount *big.Int, payload []byte, @@ -53,7 +53,7 @@ func (r *E2ERunner) V2ETHWithdrawAndCall( } // V2ETHWithdrawAndCall calls WithdrawAndCall of Gateway with gas token on ZEVM using authenticated call -func (r *E2ERunner) V2ETHWithdrawAndAuthenticatedCall( +func (r *E2ERunner) V2ETHWithdrawAndCall( receiver ethcommon.Address, amount *big.Int, payload []byte, @@ -78,7 +78,7 @@ func (r *E2ERunner) V2ETHWithdrawAndAuthenticatedCall( // V2ETHWithdrawAndCall calls WithdrawAndCall of Gateway with gas token on ZEVM using authenticated call // through contract -func (r *E2ERunner) V2ETHWithdrawAndAuthenticatedCallThroughContract( +func (r *E2ERunner) V2ETHWithdrawAndCallThroughContract( gatewayZEVMCaller *gatewayzevmcaller.GatewayZEVMCaller, receiver ethcommon.Address, amount *big.Int, @@ -120,8 +120,8 @@ func (r *E2ERunner) V2ERC20Withdraw( return tx } -// V2ERC20WithdrawAndCall calls WithdrawAndCall of Gateway with erc20 token on ZEVM -func (r *E2ERunner) V2ERC20WithdrawAndCall( +// V2ERC20WithdrawAndCall calls WithdrawAndCall of Gateway with erc20 token on ZEVM using arbitrary call +func (r *E2ERunner) V2ERC20WithdrawAndArbitraryCall( receiver ethcommon.Address, amount *big.Int, payload []byte, @@ -149,8 +149,8 @@ func (r *E2ERunner) V2ERC20WithdrawAndCall( return tx } -// V2ERC20WithdrawAndCall calls authenticated WithdrawAndCall of Gateway with erc20 token on ZEVM -func (r *E2ERunner) V2ERC20WithdrawAndAuthenticatedCall( +// V2ERC20WithdrawAndCall calls WithdrawAndCall of Gateway with erc20 token on ZEVM using authenticated call +func (r *E2ERunner) V2ERC20WithdrawAndCall( receiver ethcommon.Address, amount *big.Int, payload []byte, @@ -178,8 +178,8 @@ func (r *E2ERunner) V2ERC20WithdrawAndAuthenticatedCall( return tx } -// V2ZEVMToEMVCall calls Call of Gateway on ZEVM -func (r *E2ERunner) V2ZEVMToEMVCall( +// V2ZEVMToEMVCall calls Call of Gateway on ZEVM using arbitrary call +func (r *E2ERunner) V2ZEVMToEMVArbitraryCall( receiver ethcommon.Address, payload []byte, revertOptions gatewayzevm.RevertOptions, @@ -197,8 +197,8 @@ func (r *E2ERunner) V2ZEVMToEMVCall( return tx } -// V2ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM -func (r *E2ERunner) V2ZEVMToEMVAuthenticatedCall( +// V2ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM using authenticated call +func (r *E2ERunner) V2ZEVMToEMVCall( receiver ethcommon.Address, payload []byte, revertOptions gatewayzevm.RevertOptions, @@ -219,8 +219,8 @@ func (r *E2ERunner) V2ZEVMToEMVAuthenticatedCall( return tx } -// V2ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM through contract -func (r *E2ERunner) V2ZEVMToEMVAuthenticatedCallThroughContract( +// V2ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM through contract using authenticated call +func (r *E2ERunner) V2ZEVMToEMVCallThroughContract( gatewayZEVMCaller *gatewayzevmcaller.GatewayZEVMCaller, receiver ethcommon.Address, payload []byte, From e0a6e42b053b8150aa82cba85ae06d19372abfb8 Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 18:17:36 +0200 Subject: [PATCH 05/16] e2e test wip --- cmd/zetae2e/local/v2.go | 1 + e2e/e2etests/e2etests.go | 9 +++ .../test_v2_erc20_withdraw_and_call.go | 55 +++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 e2e/e2etests/test_v2_erc20_withdraw_and_call.go diff --git a/cmd/zetae2e/local/v2.go b/cmd/zetae2e/local/v2.go index 95c78a35e0..3ef5ff880a 100644 --- a/cmd/zetae2e/local/v2.go +++ b/cmd/zetae2e/local/v2.go @@ -35,6 +35,7 @@ func startV2Tests(eg *errgroup.Group, conf config.Config, deployerRunner *runner e2etests.TestV2ERC20DepositAndCallName, e2etests.TestV2ERC20WithdrawName, e2etests.TestV2ERC20WithdrawAndArbitraryCallName, + e2etests.TestV2ERC20WithdrawAndCallName, )) // Test revert cases for gas token workflow diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index ca00ef301a..5143506a35 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -144,6 +144,7 @@ const ( TestV2ERC20DepositAndCallRevertWithCallName = "v2_erc20_deposit_and_call_revert_with_call" TestV2ERC20WithdrawName = "v2_erc20_withdraw" TestV2ERC20WithdrawAndArbitraryCallName = "v2_erc20_withdraw_and_arbitrary_call" + TestV2ERC20WithdrawAndCallName = "v2_erc20_withdraw_and_call" TestV2ERC20WithdrawAndCallRevertName = "v2_erc20_withdraw_and_call_revert" TestV2ERC20WithdrawAndCallRevertWithCallName = "v2_erc20_withdraw_and_call_revert_with_call" TestV2ZEVMToEVMArbitraryCallName = "v2_zevm_to_evm_arbitrary_call" @@ -842,6 +843,14 @@ var AllE2ETests = []runner.E2ETest{ }, TestV2ERC20WithdrawAndArbitraryCall, ), + runner.NewE2ETest( + TestV2ERC20WithdrawAndCallName, + "withdraw ERC20 from ZEVM and authenticated call a contract using V2 contract", + []runner.ArgDefinition{ + {Description: "amount", DefaultValue: "1000"}, + }, + TestV2ERC20WithdrawAndCall, + ), runner.NewE2ETest( TestV2ERC20WithdrawAndCallRevertName, "withdraw ERC20 from ZEVM and call a contract using V2 contract that reverts", diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go new file mode 100644 index 0000000000..b8cd7b1cd9 --- /dev/null +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go @@ -0,0 +1,55 @@ +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 payloadMessageWithdrawAuthenticatedCallERC20 = "this is a test ERC20 withdraw and authenticated call payload" + +func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, args []string) { + require.Len(r, args, 1) + + amount, ok := big.NewInt(0).SetString(args[0], 10) + require.True(r, ok, "Invalid amount specified for TestV2ERC20WithdrawAndCall") + + r.AssertTestDAppEVMCalled(false, payloadMessageWithdrawAuthenticatedCallERC20, amount) + + r.ApproveERC20ZRC20(r.GatewayZEVMAddr) + 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.V2ERC20WithdrawAndCall( + r.TestDAppV2EVMAddr, + amount, + r.EncodeERC20Call(r.ERC20Addr, amount, payloadMessageWithdrawAuthenticatedCallERC20), + 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, payloadMessageWithdrawAuthenticatedCallERC20, 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) +} From d84585a49f8115197e1584874eb1469f2e550a8d Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 19:09:09 +0200 Subject: [PATCH 06/16] new test fix --- e2e/e2etests/e2etests.go | 4 +--- e2e/e2etests/test_v2_erc20_withdraw_and_call.go | 15 ++++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index 5143506a35..de51d6a26b 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -846,9 +846,7 @@ var AllE2ETests = []runner.E2ETest{ runner.NewE2ETest( TestV2ERC20WithdrawAndCallName, "withdraw ERC20 from ZEVM and authenticated call a contract using V2 contract", - []runner.ArgDefinition{ - {Description: "amount", DefaultValue: "1000"}, - }, + []runner.ArgDefinition{}, TestV2ERC20WithdrawAndCall, ), runner.NewE2ETest( diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go index b8cd7b1cd9..f1a74e9ea7 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go @@ -14,11 +14,16 @@ import ( const payloadMessageWithdrawAuthenticatedCallERC20 = "this is a test ERC20 withdraw and authenticated call payload" -func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, args []string) { - require.Len(r, args, 1) +func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, _ []string) { + 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 TestV2ERC20WithdrawAndCall") + // called with 0 amount since onCall implementation is for TestDappV2 is simple and generic without decoding the payload and amount handling for erc20 + // and purpose of test is to verify that onCall is called with correct sender and payload + amount := big.NewInt(0) r.AssertTestDAppEVMCalled(false, payloadMessageWithdrawAuthenticatedCallERC20, amount) @@ -34,7 +39,7 @@ func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, args []string) { tx = r.V2ERC20WithdrawAndCall( r.TestDAppV2EVMAddr, amount, - r.EncodeERC20Call(r.ERC20Addr, amount, payloadMessageWithdrawAuthenticatedCallERC20), + []byte(payloadMessageWithdrawAuthenticatedCallERC20), gatewayzevm.RevertOptions{OnRevertGasLimit: big.NewInt(0)}, ) From 8974b5b809ee453569169c813ef53154d15c7b62 Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 19:43:47 +0200 Subject: [PATCH 07/16] fix test --- e2e/contracts/teststaking/TestStaking.abi | 344 ----------------- e2e/contracts/teststaking/TestStaking.bin | 1 - e2e/contracts/teststaking/TestStaking.json | 347 ------------------ .../test_v2_erc20_withdraw_and_call.go | 7 +- e2e/e2etests/test_v2_eth_withdraw_and_call.go | 7 +- ..._eth_withdraw_and_call_through_contract.go | 21 -- e2e/e2etests/test_v2_zevm_to_evm_call.go | 7 +- ...st_v2_zevm_to_evm_call_through_contract.go | 24 -- pkg/contracts/testdappv2/TestDAppV2.abi | 26 -- pkg/contracts/testdappv2/TestDAppV2.bin | 2 +- pkg/contracts/testdappv2/TestDAppV2.go | 56 +-- pkg/contracts/testdappv2/TestDAppV2.json | 28 +- pkg/contracts/testdappv2/TestDAppV2.sol | 7 - 13 files changed, 7 insertions(+), 870 deletions(-) diff --git a/e2e/contracts/teststaking/TestStaking.abi b/e2e/contracts/teststaking/TestStaking.abi index 5c793c4c7f..e69de29bb2 100644 --- a/e2e/contracts/teststaking/TestStaking.abi +++ b/e2e/contracts/teststaking/TestStaking.abi @@ -1,344 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "_wzeta", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "validatorSrc", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "validatorDst", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MoveStake", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Stake", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Unstake", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "counter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositWZETA", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getAllValidators", - "outputs": [ - { - "components": [ - { - "internalType": "string", - "name": "operatorAddress", - "type": "string" - }, - { - "internalType": "string", - "name": "consensusPubKey", - "type": "string" - }, - { - "internalType": "bool", - "name": "jailed", - "type": "bool" - }, - { - "internalType": "enum BondStatus", - "name": "bondStatus", - "type": "uint8" - } - ], - "internalType": "struct Validator[]", - "name": "validators", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - } - ], - "name": "getShares", - "outputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validatorSrc", - "type": "string" - }, - { - "internalType": "string", - "name": "validatorDst", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "moveStake", - "outputs": [ - { - "internalType": "int64", - "name": "completionTime", - "type": "int64" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "stake", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "stakeAndRevert", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "stakeWithStateUpdate", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "unstake", - "outputs": [ - { - "internalType": "int64", - "name": "completionTime", - "type": "int64" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "withdrawWZETA", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } -] diff --git a/e2e/contracts/teststaking/TestStaking.bin b/e2e/contracts/teststaking/TestStaking.bin index 14751519ee..e69de29bb2 100644 --- a/e2e/contracts/teststaking/TestStaking.bin +++ b/e2e/contracts/teststaking/TestStaking.bin @@ -1 +0,0 @@ -608060405260666000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006003553480156200005757600080fd5b506040516200192d3803806200192d83398181016040528101906200007d919062000170565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050620001a2565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000138826200010b565b9050919050565b6200014a816200012b565b81146200015657600080fd5b50565b6000815190506200016a816200013f565b92915050565b60006020828403121562000189576200018862000106565b5b6000620001998482850162000159565b91505092915050565b61177b80620001b26000396000f3fe6080604052600436106100955760003560e01c806390b8436f1161005957806390b8436f1461018a5780639a0fb673146101c7578063bca8f527146101f0578063d11a93d01461022d578063f3513a371461026a5761009c565b80630d1b3daf1461009e5780632c5d24ae146100db57806357c6ea3e146100e557806361bc221a146101225780636be8916c1461014d5761009c565b3661009c57005b005b3480156100aa57600080fd5b506100c560048036038101906100c09190610d08565b610295565b6040516100d29190610d7d565b60405180910390f35b6100e361033c565b005b3480156100f157600080fd5b5061010c60048036038101906101079190610dc4565b61041b565b6040516101199190610e4f565b60405180910390f35b34801561012e57600080fd5b50610137610520565b6040516101449190610d7d565b60405180910390f35b34801561015957600080fd5b50610174600480360381019061016f9190610dc4565b610526565b6040516101819190610e85565b60405180910390f35b34801561019657600080fd5b506101b160048036038101906101ac9190610dc4565b61065c565b6040516101be9190610e85565b60405180910390f35b3480156101d357600080fd5b506101ee60048036038101906101e99190610ea0565b610761565b005b3480156101fc57600080fd5b5061021760048036038101906102129190610dc4565b61084b565b6040516102249190610e85565b60405180910390f35b34801561023957600080fd5b50610254600480360381019061024f9190610ecd565b6109ad565b6040516102619190610e4f565b60405180910390f35b34801561027657600080fd5b5061027f610ab5565b60405161028c91906111a6565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630d1b3daf84846040518363ffffffff1660e01b81526004016102f3929190611221565b602060405180830381865afa158015610310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103349190611266565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461039657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561040057600080fd5b505af1158015610414573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461047757600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357c6ea3e8585856040518463ffffffff1660e01b81526004016104d493929190611293565b6020604051808303816000875af11580156104f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051791906112fd565b90509392505050565b60035481565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461058257600080fd5b60016003546105919190611359565b60038190555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8686866040518463ffffffff1660e01b81526004016105f793929190611293565b6020604051808303816000875af1158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a91906113db565b9050600160035461064b9190611359565b600381905550809150509392505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106b857600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8585856040518463ffffffff1660e01b815260040161071593929190611293565b6020604051808303816000875af1158015610734573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075891906113db565b90509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107bb57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b81526004016108169190610d7d565b600060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108a757600080fd5b60016003546108b69190611359565b60038190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8585856040518463ffffffff1660e01b815260040161091993929190611293565b6020604051808303816000875af1158015610938573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095c91906113db565b50600160035461096c9190611359565b6003819055506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a490611454565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0957600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d11a93d0868686866040518563ffffffff1660e01b8152600401610a689493929190611474565b6020604051808303816000875af1158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906112fd565b9050949350505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3513a376040518163ffffffff1660e01b8152600401600060405180830381865afa158015610b22573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610b4b91906116fc565b905090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b8f82610b64565b9050919050565b610b9f81610b84565b8114610baa57600080fd5b50565b600081359050610bbc81610b96565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610c1582610bcc565b810181811067ffffffffffffffff82111715610c3457610c33610bdd565b5b80604052505050565b6000610c47610b50565b9050610c538282610c0c565b919050565b600067ffffffffffffffff821115610c7357610c72610bdd565b5b610c7c82610bcc565b9050602081019050919050565b82818337600083830152505050565b6000610cab610ca684610c58565b610c3d565b905082815260208101848484011115610cc757610cc6610bc7565b5b610cd2848285610c89565b509392505050565b600082601f830112610cef57610cee610bc2565b5b8135610cff848260208601610c98565b91505092915050565b60008060408385031215610d1f57610d1e610b5a565b5b6000610d2d85828601610bad565b925050602083013567ffffffffffffffff811115610d4e57610d4d610b5f565b5b610d5a85828601610cda565b9150509250929050565b6000819050919050565b610d7781610d64565b82525050565b6000602082019050610d926000830184610d6e565b92915050565b610da181610d64565b8114610dac57600080fd5b50565b600081359050610dbe81610d98565b92915050565b600080600060608486031215610ddd57610ddc610b5a565b5b6000610deb86828701610bad565b935050602084013567ffffffffffffffff811115610e0c57610e0b610b5f565b5b610e1886828701610cda565b9250506040610e2986828701610daf565b9150509250925092565b60008160070b9050919050565b610e4981610e33565b82525050565b6000602082019050610e646000830184610e40565b92915050565b60008115159050919050565b610e7f81610e6a565b82525050565b6000602082019050610e9a6000830184610e76565b92915050565b600060208284031215610eb657610eb5610b5a565b5b6000610ec484828501610daf565b91505092915050565b60008060008060808587031215610ee757610ee6610b5a565b5b6000610ef587828801610bad565b945050602085013567ffffffffffffffff811115610f1657610f15610b5f565b5b610f2287828801610cda565b935050604085013567ffffffffffffffff811115610f4357610f42610b5f565b5b610f4f87828801610cda565b9250506060610f6087828801610daf565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610fd2578082015181840152602081019050610fb7565b83811115610fe1576000848401525b50505050565b6000610ff282610f98565b610ffc8185610fa3565b935061100c818560208601610fb4565b61101581610bcc565b840191505092915050565b61102981610e6a565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061106f5761106e61102f565b5b50565b60008190506110808261105e565b919050565b600061109082611072565b9050919050565b6110a081611085565b82525050565b600060808301600083015184820360008601526110c38282610fe7565b915050602083015184820360208601526110dd8282610fe7565b91505060408301516110f26040860182611020565b5060608301516111056060860182611097565b508091505092915050565b600061111c83836110a6565b905092915050565b6000602082019050919050565b600061113c82610f6c565b6111468185610f77565b93508360208202850161115885610f88565b8060005b8581101561119457848403895281516111758582611110565b945061118083611124565b925060208a0199505060018101905061115c565b50829750879550505050505092915050565b600060208201905081810360008301526111c08184611131565b905092915050565b6111d181610b84565b82525050565b600082825260208201905092915050565b60006111f382610f98565b6111fd81856111d7565b935061120d818560208601610fb4565b61121681610bcc565b840191505092915050565b600060408201905061123660008301856111c8565b818103602083015261124881846111e8565b90509392505050565b60008151905061126081610d98565b92915050565b60006020828403121561127c5761127b610b5a565b5b600061128a84828501611251565b91505092915050565b60006060820190506112a860008301866111c8565b81810360208301526112ba81856111e8565b90506112c96040830184610d6e565b949350505050565b6112da81610e33565b81146112e557600080fd5b50565b6000815190506112f7816112d1565b92915050565b60006020828403121561131357611312610b5a565b5b6000611321848285016112e8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061136482610d64565b915061136f83610d64565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156113a4576113a361132a565b5b828201905092915050565b6113b881610e6a565b81146113c357600080fd5b50565b6000815190506113d5816113af565b92915050565b6000602082840312156113f1576113f0610b5a565b5b60006113ff848285016113c6565b91505092915050565b7f7465737472657665727400000000000000000000000000000000000000000000600082015250565b600061143e600a836111d7565b915061144982611408565b602082019050919050565b6000602082019050818103600083015261146d81611431565b9050919050565b600060808201905061148960008301876111c8565b818103602083015261149b81866111e8565b905081810360408301526114af81856111e8565b90506114be6060830184610d6e565b95945050505050565b600067ffffffffffffffff8211156114e2576114e1610bdd565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600061151561151084610c58565b610c3d565b90508281526020810184848401111561153157611530610bc7565b5b61153c848285610fb4565b509392505050565b600082601f83011261155957611558610bc2565b5b8151611569848260208601611502565b91505092915050565b6004811061157f57600080fd5b50565b60008151905061159181611572565b92915050565b6000608082840312156115ad576115ac6114f8565b5b6115b76080610c3d565b9050600082015167ffffffffffffffff8111156115d7576115d66114fd565b5b6115e384828501611544565b600083015250602082015167ffffffffffffffff811115611607576116066114fd565b5b61161384828501611544565b6020830152506040611627848285016113c6565b604083015250606061163b84828501611582565b60608301525092915050565b600061165a611655846114c7565b610c3d565b9050808382526020820190506020840283018581111561167d5761167c6114f3565b5b835b818110156116c457805167ffffffffffffffff8111156116a2576116a1610bc2565b5b8086016116af8982611597565b8552602085019450505060208101905061167f565b5050509392505050565b600082601f8301126116e3576116e2610bc2565b5b81516116f3848260208601611647565b91505092915050565b60006020828403121561171257611711610b5a565b5b600082015167ffffffffffffffff8111156117305761172f610b5f565b5b61173c848285016116ce565b9150509291505056fea26469706673582212201d48926082b046ce0a5b741a926eefe8bb0873c1d992ea4a6c4210a133dbaae764736f6c634300080a0033 diff --git a/e2e/contracts/teststaking/TestStaking.json b/e2e/contracts/teststaking/TestStaking.json index 6fde4261f5..e69de29bb2 100644 --- a/e2e/contracts/teststaking/TestStaking.json +++ b/e2e/contracts/teststaking/TestStaking.json @@ -1,347 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_wzeta", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "validatorSrc", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "validatorDst", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "MoveStake", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Stake", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "validator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Unstake", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "counter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositWZETA", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getAllValidators", - "outputs": [ - { - "components": [ - { - "internalType": "string", - "name": "operatorAddress", - "type": "string" - }, - { - "internalType": "string", - "name": "consensusPubKey", - "type": "string" - }, - { - "internalType": "bool", - "name": "jailed", - "type": "bool" - }, - { - "internalType": "enum BondStatus", - "name": "bondStatus", - "type": "uint8" - } - ], - "internalType": "struct Validator[]", - "name": "validators", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - } - ], - "name": "getShares", - "outputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validatorSrc", - "type": "string" - }, - { - "internalType": "string", - "name": "validatorDst", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "moveStake", - "outputs": [ - { - "internalType": "int64", - "name": "completionTime", - "type": "int64" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "stake", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "stakeAndRevert", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "stakeWithStateUpdate", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "staker", - "type": "address" - }, - { - "internalType": "string", - "name": "validator", - "type": "string" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "unstake", - "outputs": [ - { - "internalType": "int64", - "name": "completionTime", - "type": "int64" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "withdrawWZETA", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "bin": "608060405260666000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006003553480156200005757600080fd5b506040516200192d3803806200192d83398181016040528101906200007d919062000170565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050620001a2565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000138826200010b565b9050919050565b6200014a816200012b565b81146200015657600080fd5b50565b6000815190506200016a816200013f565b92915050565b60006020828403121562000189576200018862000106565b5b6000620001998482850162000159565b91505092915050565b61177b80620001b26000396000f3fe6080604052600436106100955760003560e01c806390b8436f1161005957806390b8436f1461018a5780639a0fb673146101c7578063bca8f527146101f0578063d11a93d01461022d578063f3513a371461026a5761009c565b80630d1b3daf1461009e5780632c5d24ae146100db57806357c6ea3e146100e557806361bc221a146101225780636be8916c1461014d5761009c565b3661009c57005b005b3480156100aa57600080fd5b506100c560048036038101906100c09190610d08565b610295565b6040516100d29190610d7d565b60405180910390f35b6100e361033c565b005b3480156100f157600080fd5b5061010c60048036038101906101079190610dc4565b61041b565b6040516101199190610e4f565b60405180910390f35b34801561012e57600080fd5b50610137610520565b6040516101449190610d7d565b60405180910390f35b34801561015957600080fd5b50610174600480360381019061016f9190610dc4565b610526565b6040516101819190610e85565b60405180910390f35b34801561019657600080fd5b506101b160048036038101906101ac9190610dc4565b61065c565b6040516101be9190610e85565b60405180910390f35b3480156101d357600080fd5b506101ee60048036038101906101e99190610ea0565b610761565b005b3480156101fc57600080fd5b5061021760048036038101906102129190610dc4565b61084b565b6040516102249190610e85565b60405180910390f35b34801561023957600080fd5b50610254600480360381019061024f9190610ecd565b6109ad565b6040516102619190610e4f565b60405180910390f35b34801561027657600080fd5b5061027f610ab5565b60405161028c91906111a6565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630d1b3daf84846040518363ffffffff1660e01b81526004016102f3929190611221565b602060405180830381865afa158015610310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103349190611266565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461039657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561040057600080fd5b505af1158015610414573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461047757600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357c6ea3e8585856040518463ffffffff1660e01b81526004016104d493929190611293565b6020604051808303816000875af11580156104f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051791906112fd565b90509392505050565b60035481565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461058257600080fd5b60016003546105919190611359565b60038190555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8686866040518463ffffffff1660e01b81526004016105f793929190611293565b6020604051808303816000875af1158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a91906113db565b9050600160035461064b9190611359565b600381905550809150509392505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106b857600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8585856040518463ffffffff1660e01b815260040161071593929190611293565b6020604051808303816000875af1158015610734573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075891906113db565b90509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107bb57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b81526004016108169190610d7d565b600060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108a757600080fd5b60016003546108b69190611359565b60038190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8585856040518463ffffffff1660e01b815260040161091993929190611293565b6020604051808303816000875af1158015610938573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095c91906113db565b50600160035461096c9190611359565b6003819055506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a490611454565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0957600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d11a93d0868686866040518563ffffffff1660e01b8152600401610a689493929190611474565b6020604051808303816000875af1158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906112fd565b9050949350505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3513a376040518163ffffffff1660e01b8152600401600060405180830381865afa158015610b22573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610b4b91906116fc565b905090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b8f82610b64565b9050919050565b610b9f81610b84565b8114610baa57600080fd5b50565b600081359050610bbc81610b96565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610c1582610bcc565b810181811067ffffffffffffffff82111715610c3457610c33610bdd565b5b80604052505050565b6000610c47610b50565b9050610c538282610c0c565b919050565b600067ffffffffffffffff821115610c7357610c72610bdd565b5b610c7c82610bcc565b9050602081019050919050565b82818337600083830152505050565b6000610cab610ca684610c58565b610c3d565b905082815260208101848484011115610cc757610cc6610bc7565b5b610cd2848285610c89565b509392505050565b600082601f830112610cef57610cee610bc2565b5b8135610cff848260208601610c98565b91505092915050565b60008060408385031215610d1f57610d1e610b5a565b5b6000610d2d85828601610bad565b925050602083013567ffffffffffffffff811115610d4e57610d4d610b5f565b5b610d5a85828601610cda565b9150509250929050565b6000819050919050565b610d7781610d64565b82525050565b6000602082019050610d926000830184610d6e565b92915050565b610da181610d64565b8114610dac57600080fd5b50565b600081359050610dbe81610d98565b92915050565b600080600060608486031215610ddd57610ddc610b5a565b5b6000610deb86828701610bad565b935050602084013567ffffffffffffffff811115610e0c57610e0b610b5f565b5b610e1886828701610cda565b9250506040610e2986828701610daf565b9150509250925092565b60008160070b9050919050565b610e4981610e33565b82525050565b6000602082019050610e646000830184610e40565b92915050565b60008115159050919050565b610e7f81610e6a565b82525050565b6000602082019050610e9a6000830184610e76565b92915050565b600060208284031215610eb657610eb5610b5a565b5b6000610ec484828501610daf565b91505092915050565b60008060008060808587031215610ee757610ee6610b5a565b5b6000610ef587828801610bad565b945050602085013567ffffffffffffffff811115610f1657610f15610b5f565b5b610f2287828801610cda565b935050604085013567ffffffffffffffff811115610f4357610f42610b5f565b5b610f4f87828801610cda565b9250506060610f6087828801610daf565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610fd2578082015181840152602081019050610fb7565b83811115610fe1576000848401525b50505050565b6000610ff282610f98565b610ffc8185610fa3565b935061100c818560208601610fb4565b61101581610bcc565b840191505092915050565b61102981610e6a565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061106f5761106e61102f565b5b50565b60008190506110808261105e565b919050565b600061109082611072565b9050919050565b6110a081611085565b82525050565b600060808301600083015184820360008601526110c38282610fe7565b915050602083015184820360208601526110dd8282610fe7565b91505060408301516110f26040860182611020565b5060608301516111056060860182611097565b508091505092915050565b600061111c83836110a6565b905092915050565b6000602082019050919050565b600061113c82610f6c565b6111468185610f77565b93508360208202850161115885610f88565b8060005b8581101561119457848403895281516111758582611110565b945061118083611124565b925060208a0199505060018101905061115c565b50829750879550505050505092915050565b600060208201905081810360008301526111c08184611131565b905092915050565b6111d181610b84565b82525050565b600082825260208201905092915050565b60006111f382610f98565b6111fd81856111d7565b935061120d818560208601610fb4565b61121681610bcc565b840191505092915050565b600060408201905061123660008301856111c8565b818103602083015261124881846111e8565b90509392505050565b60008151905061126081610d98565b92915050565b60006020828403121561127c5761127b610b5a565b5b600061128a84828501611251565b91505092915050565b60006060820190506112a860008301866111c8565b81810360208301526112ba81856111e8565b90506112c96040830184610d6e565b949350505050565b6112da81610e33565b81146112e557600080fd5b50565b6000815190506112f7816112d1565b92915050565b60006020828403121561131357611312610b5a565b5b6000611321848285016112e8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061136482610d64565b915061136f83610d64565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156113a4576113a361132a565b5b828201905092915050565b6113b881610e6a565b81146113c357600080fd5b50565b6000815190506113d5816113af565b92915050565b6000602082840312156113f1576113f0610b5a565b5b60006113ff848285016113c6565b91505092915050565b7f7465737472657665727400000000000000000000000000000000000000000000600082015250565b600061143e600a836111d7565b915061144982611408565b602082019050919050565b6000602082019050818103600083015261146d81611431565b9050919050565b600060808201905061148960008301876111c8565b818103602083015261149b81866111e8565b905081810360408301526114af81856111e8565b90506114be6060830184610d6e565b95945050505050565b600067ffffffffffffffff8211156114e2576114e1610bdd565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600061151561151084610c58565b610c3d565b90508281526020810184848401111561153157611530610bc7565b5b61153c848285610fb4565b509392505050565b600082601f83011261155957611558610bc2565b5b8151611569848260208601611502565b91505092915050565b6004811061157f57600080fd5b50565b60008151905061159181611572565b92915050565b6000608082840312156115ad576115ac6114f8565b5b6115b76080610c3d565b9050600082015167ffffffffffffffff8111156115d7576115d66114fd565b5b6115e384828501611544565b600083015250602082015167ffffffffffffffff811115611607576116066114fd565b5b61161384828501611544565b6020830152506040611627848285016113c6565b604083015250606061163b84828501611582565b60608301525092915050565b600061165a611655846114c7565b610c3d565b9050808382526020820190506020840283018581111561167d5761167c6114f3565b5b835b818110156116c457805167ffffffffffffffff8111156116a2576116a1610bc2565b5b8086016116af8982611597565b8552602085019450505060208101905061167f565b5050509392505050565b600082601f8301126116e3576116e2610bc2565b5b81516116f3848260208601611647565b91505092915050565b60006020828403121561171257611711610b5a565b5b600082015167ffffffffffffffff8111156117305761172f610b5f565b5b61173c848285016116ce565b9150509291505056fea26469706673582212201d48926082b046ce0a5b741a926eefe8bb0873c1d992ea4a6c4210a133dbaae764736f6c634300080a0033" -} diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go index f1a74e9ea7..ac33db13c6 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go @@ -30,13 +30,8 @@ func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, _ []string) { r.ApproveERC20ZRC20(r.GatewayZEVMAddr) 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.V2ERC20WithdrawAndCall( + tx := r.V2ERC20WithdrawAndCall( r.TestDAppV2EVMAddr, amount, []byte(payloadMessageWithdrawAuthenticatedCallERC20), diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_call.go b/e2e/e2etests/test_v2_eth_withdraw_and_call.go index 42a835d75c..bffd037e72 100644 --- a/e2e/e2etests/test_v2_eth_withdraw_and_call.go +++ b/e2e/e2etests/test_v2_eth_withdraw_and_call.go @@ -30,13 +30,8 @@ func TestV2ETHWithdrawAndCall(r *runner.E2ERunner, args []string) { r.ApproveETHZRC20(r.GatewayZEVMAddr) - // set expected sender - tx, err := r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, r.ZEVMAuth.From) - require.NoError(r, err) - utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout) - // perform the withdraw - tx = r.V2ETHWithdrawAndCall( + tx := r.V2ETHWithdrawAndCall( r.TestDAppV2EVMAddr, amount, []byte(payloadMessageAuthenticatedWithdrawETH), diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go b/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go index 0e0e0462f3..28c36ee69d 100644 --- a/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go +++ b/e2e/e2etests/test_v2_eth_withdraw_and_call_through_contract.go @@ -40,11 +40,6 @@ func TestV2ETHWithdrawAndCallThroughContract(r *runner.E2ERunner, args []string) 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.V2ETHWithdrawAndCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr, amount, @@ -65,20 +60,4 @@ func TestV2ETHWithdrawAndCallThroughContract(r *runner.E2ERunner, args []string) ) 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.V2ETHWithdrawAndCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr, - amount, - []byte(payloadMessageAuthenticatedWithdrawETHThroughContract), - gatewayzevmcaller.RevertOptions{OnRevertGasLimit: big.NewInt(0)}) - - utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) - cctx = utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) - r.Logger.CCTX(*cctx, "withdraw") - require.Equal(r, crosschaintypes.CctxStatus_Reverted, cctx.CctxStatus.Status) } diff --git a/e2e/e2etests/test_v2_zevm_to_evm_call.go b/e2e/e2etests/test_v2_zevm_to_evm_call.go index e6ddb593a7..9641778e3c 100644 --- a/e2e/e2etests/test_v2_zevm_to_evm_call.go +++ b/e2e/e2etests/test_v2_zevm_to_evm_call.go @@ -22,13 +22,8 @@ func TestV2ZEVMToEVMCall(r *runner.E2ERunner, args []string) { // 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.V2ZEVMToEMVCall( + tx := r.V2ZEVMToEMVCall( r.TestDAppV2EVMAddr, []byte(payloadMessageEVMAuthenticatedCall), gatewayzevm.RevertOptions{ diff --git a/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go b/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go index 856586495e..7ff9158365 100644 --- a/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go +++ b/e2e/e2etests/test_v2_zevm_to_evm_call_through_contract.go @@ -33,11 +33,6 @@ func TestV2ZEVMToEVMCallThroughContract(r *runner.E2ERunner, args []string) { 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.V2ZEVMToEMVCallThroughContract( gatewayCaller, @@ -61,23 +56,4 @@ func TestV2ZEVMToEVMCallThroughContract(r *runner.E2ERunner, args []string) { ) 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.V2ZEVMToEMVCallThroughContract( - gatewayCaller, - r.TestDAppV2EVMAddr, - []byte(payloadMessageEVMAuthenticatedCallThroughContract), - gatewayzevmcaller.RevertOptions{ - OnRevertGasLimit: big.NewInt(0), - }, - ) - utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout) - cctx = utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) - r.Logger.CCTX(*cctx, "call") - require.Equal(r, crosschaintypes.CctxStatus_Reverted, cctx.CctxStatus.Status) } diff --git a/pkg/contracts/testdappv2/TestDAppV2.abi b/pkg/contracts/testdappv2/TestDAppV2.abi index 319dda376c..c2846866a1 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.abi +++ b/pkg/contracts/testdappv2/TestDAppV2.abi @@ -60,19 +60,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "expectedOnCallSender", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -254,19 +241,6 @@ "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 5254923745..dd0765c4be 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.bin +++ b/pkg/contracts/testdappv2/TestDAppV2.bin @@ -1 +1 @@ -608060405234801561001057600080fd5b5061150a806100206000396000f3fe6080604052600436106100c65760003560e01c8063a799911f1161007f578063c9028a3611610059578063c9028a3614610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063a799911f146101f9578063c234fecf14610215578063c7a339a91461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a777146101385780635bcfd61614610163578063676cc0541461018c5780639291fe26146101bc576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610de7565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610d02565b610371565b60405161012f9190611173565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a91906110c4565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190610ed9565b6103ad565b005b6101a660048036038101906101a19190610e30565b6104a6565b6040516101b39190611131565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190610de7565b61065b565b6040516101f09190611173565b60405180910390f35b610213600480360381019061020e9190610de7565b61069e565b005b34801561022157600080fd5b5061023c60048036038101906102379190610ca8565b6106c7565b005b34801561024a57600080fd5b5061026560048036038101906102609190610d78565b61070a565b005b34801561027357600080fd5b5061028e60048036038101906102899190610e90565b6107cd565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610d02565b610907565b6040516102c49190611116565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610de7565b610927565b6040516103019190611116565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190610d2f565b610977565b60405161033e91906110c4565b60405180910390f35b610350816109c0565b1561035a57600080fd5b61036381610a16565b61036e816000610a6a565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103fa82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506109c0565b1561040457600080fd5b61045182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61049f82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a6a565b5050505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906104f29190610ca8565b73ffffffffffffffffffffffffffffffffffffffff1614610548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053f90611153565b60405180910390fd5b61059583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b6105e383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505034610a6a565b8360000160208101906105f69190610ca8565b6002848460405161060892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060036000836040516020016106729190611098565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6106a7816109c0565b156106b157600080fd5b6106ba81610a16565b6106c48134610a6a565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610713816109c0565b1561071d57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161075a939291906110df565b602060405180830381600087803b15801561077457600080fd5b505af1158015610788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190610cd5565b6107b557600080fd5b6107be81610a16565b6107c88183610a6a565b505050565b6108288180606001906107e0919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61088581806060019061083b919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610a6a565b8060000160208101906108989190610ca8565b60028280606001906108aa919061118e565b6040516108b892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161093e9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016109d1906110af565b60405160208183030381529060405280519060200120826040516020016109f89190611098565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610a2c9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610a809190611098565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000610abf610aba84611216565b6111f1565b905082815260208101848484011115610adb57610ada6113ef565b5b610ae684828561132a565b509392505050565b6000610b01610afc84611247565b6111f1565b905082815260208101848484011115610b1d57610b1c6113ef565b5b610b2884828561132a565b509392505050565b600081359050610b3f81611461565b92915050565b600081519050610b5481611478565b92915050565b600081359050610b698161148f565b92915050565b60008083601f840112610b8557610b846113d1565b5b8235905067ffffffffffffffff811115610ba257610ba16113cc565b5b602083019150836001820283011115610bbe57610bbd6113e5565b5b9250929050565b600082601f830112610bda57610bd96113d1565b5b8135610bea848260208601610aac565b91505092915050565b600081359050610c02816114a6565b92915050565b600082601f830112610c1d57610c1c6113d1565b5b8135610c2d848260208601610aee565b91505092915050565b600060208284031215610c4c57610c4b6113db565b5b81905092915050565b600060808284031215610c6b57610c6a6113db565b5b81905092915050565b600060608284031215610c8a57610c896113db565b5b81905092915050565b600081359050610ca2816114bd565b92915050565b600060208284031215610cbe57610cbd6113f9565b5b6000610ccc84828501610b30565b91505092915050565b600060208284031215610ceb57610cea6113f9565b5b6000610cf984828501610b45565b91505092915050565b600060208284031215610d1857610d176113f9565b5b6000610d2684828501610b5a565b91505092915050565b600060208284031215610d4557610d446113f9565b5b600082013567ffffffffffffffff811115610d6357610d626113f4565b5b610d6f84828501610bc5565b91505092915050565b600080600060608486031215610d9157610d906113f9565b5b6000610d9f86828701610bf3565b9350506020610db086828701610c93565b925050604084013567ffffffffffffffff811115610dd157610dd06113f4565b5b610ddd86828701610c08565b9150509250925092565b600060208284031215610dfd57610dfc6113f9565b5b600082013567ffffffffffffffff811115610e1b57610e1a6113f4565b5b610e2784828501610c08565b91505092915050565b600080600060408486031215610e4957610e486113f9565b5b6000610e5786828701610c36565b935050602084013567ffffffffffffffff811115610e7857610e776113f4565b5b610e8486828701610b6f565b92509250509250925092565b600060208284031215610ea657610ea56113f9565b5b600082013567ffffffffffffffff811115610ec457610ec36113f4565b5b610ed084828501610c55565b91505092915050565b600080600080600060808688031215610ef557610ef46113f9565b5b600086013567ffffffffffffffff811115610f1357610f126113f4565b5b610f1f88828901610c74565b9550506020610f3088828901610b30565b9450506040610f4188828901610c93565b935050606086013567ffffffffffffffff811115610f6257610f616113f4565b5b610f6e88828901610b6f565b92509250509295509295909350565b610f86816112c6565b82525050565b610f95816112d8565b82525050565b6000610fa7838561129f565b9350610fb483858461132a565b82840190509392505050565b6000610fcb82611278565b610fd5818561128e565b9350610fe5818560208601611339565b610fee816113fe565b840191505092915050565b600061100482611283565b61100e81856112bb565b935061101e818560208601611339565b80840191505092915050565b60006110376016836112aa565b91506110428261140f565b602082019050919050565b600061105a6006836112bb565b915061106582611438565b600682019050919050565b61107981611320565b82525050565b600061108c828486610f9b565b91508190509392505050565b60006110a48284610ff9565b915081905092915050565b60006110ba8261104d565b9150819050919050565b60006020820190506110d96000830184610f7d565b92915050565b60006060820190506110f46000830186610f7d565b6111016020830185610f7d565b61110e6040830184611070565b949350505050565b600060208201905061112b6000830184610f8c565b92915050565b6000602082019050818103600083015261114b8184610fc0565b905092915050565b6000602082019050818103600083015261116c8161102a565b9050919050565b60006020820190506111886000830184611070565b92915050565b600080833560016020038436030381126111ab576111aa6113e0565b5b80840192508235915067ffffffffffffffff8211156111cd576111cc6113d6565b5b6020830192506001820236038313156111e9576111e86113ea565b5b509250929050565b60006111fb61120c565b9050611207828261136c565b919050565b6000604051905090565b600067ffffffffffffffff8211156112315761123061139d565b5b61123a826113fe565b9050602081019050919050565b600067ffffffffffffffff8211156112625761126161139d565b5b61126b826113fe565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006112d182611300565b9050919050565b60008115159050919050565b6000819050919050565b60006112f9826112c6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561135757808201518184015260208101905061133c565b83811115611366576000848401525b50505050565b611375826113fe565b810181811067ffffffffffffffff821117156113945761139361139d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61146a816112c6565b811461147557600080fd5b50565b611481816112d8565b811461148c57600080fd5b50565b611498816112e4565b81146114a357600080fd5b50565b6114af816112ee565b81146114ba57600080fd5b50565b6114c681611320565b81146114d157600080fd5b5056fea2646970667358221220f3098dec1315d0cad1405fecc08983ea60d8ccb240a10da773012d554f5948f264736f6c63430008070033 +608060405234801561001057600080fd5b5061130b806100206000396000f3fe6080604052600436106100a05760003560e01c8063a799911f11610064578063a799911f146101a8578063c7a339a9146101c4578063c9028a36146101ed578063e2842ed714610216578063f592cbfb14610253578063f936ae8514610290576100a7565b806336e980a0146100ac5780634297a263146100d55780635bcfd61614610112578063676cc0541461013b5780639291fe261461016b576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100d360048036038101906100ce9190610c65565b6102cd565b005b3480156100e157600080fd5b506100fc60048036038101906100f79190610b80565b6102f7565b6040516101099190610fae565b60405180910390f35b34801561011e57600080fd5b5061013960048036038101906101349190610d57565b61030f565b005b61015560048036038101906101509190610cae565b610408565b6040516101629190610f8c565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d9190610c65565b61051d565b60405161019f9190610fae565b60405180910390f35b6101c260048036038101906101bd9190610c65565b610560565b005b3480156101d057600080fd5b506101eb60048036038101906101e69190610bf6565b610589565b005b3480156101f957600080fd5b50610214600480360381019061020f9190610d0e565b61064c565b005b34801561022257600080fd5b5061023d60048036038101906102389190610b80565b610786565b60405161024a9190610f71565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190610c65565b6107a6565b6040516102879190610f71565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190610bad565b6107f5565b6040516102c49190610f1f565b60405180910390f35b6102d68161083e565b156102e057600080fd5b6102e981610894565b6102f48160006108e8565b50565b60026020528060005260406000206000915090505481565b61035c82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061083e565b1561036657600080fd5b6103b382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b61040182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846108e8565b5050505050565b606061045783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6104a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346108e8565b8360000160208101906104b89190610b26565b600184846040516104ca929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060026000836040516020016105349190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105698161083e565b1561057357600080fd5b61057c81610894565b61058681346108e8565b50565b6105928161083e565b1561059c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105d993929190610f3a565b602060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b9190610b53565b61063457600080fd5b61063d81610894565b61064781836108e8565b505050565b6106a781806060019061065f9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6107048180606001906106ba9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006108e8565b8060000160208101906107179190610b26565b60018280606001906107299190610fc9565b604051610737929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016107bc9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161084f90610f0a565b60405160208183030381529060405280519060200120826040516020016108769190610ef3565b60405160208183030381529060405280519060200120149050919050565b6001600080836040516020016108aa9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060026000846040516020016108fe9190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b600061093d61093884611051565b61102c565b90508281526020810184848401111561095957610958611219565b5b610964848285611154565b509392505050565b600061097f61097a84611082565b61102c565b90508281526020810184848401111561099b5761099a611219565b5b6109a6848285611154565b509392505050565b6000813590506109bd81611262565b92915050565b6000815190506109d281611279565b92915050565b6000813590506109e781611290565b92915050565b60008083601f840112610a0357610a026111fb565b5b8235905067ffffffffffffffff811115610a2057610a1f6111f6565b5b602083019150836001820283011115610a3c57610a3b61120f565b5b9250929050565b600082601f830112610a5857610a576111fb565b5b8135610a6884826020860161092a565b91505092915050565b600081359050610a80816112a7565b92915050565b600082601f830112610a9b57610a9a6111fb565b5b8135610aab84826020860161096c565b91505092915050565b600060208284031215610aca57610ac9611205565b5b81905092915050565b600060808284031215610ae957610ae8611205565b5b81905092915050565b600060608284031215610b0857610b07611205565b5b81905092915050565b600081359050610b20816112be565b92915050565b600060208284031215610b3c57610b3b611223565b5b6000610b4a848285016109ae565b91505092915050565b600060208284031215610b6957610b68611223565b5b6000610b77848285016109c3565b91505092915050565b600060208284031215610b9657610b95611223565b5b6000610ba4848285016109d8565b91505092915050565b600060208284031215610bc357610bc2611223565b5b600082013567ffffffffffffffff811115610be157610be061121e565b5b610bed84828501610a43565b91505092915050565b600080600060608486031215610c0f57610c0e611223565b5b6000610c1d86828701610a71565b9350506020610c2e86828701610b11565b925050604084013567ffffffffffffffff811115610c4f57610c4e61121e565b5b610c5b86828701610a86565b9150509250925092565b600060208284031215610c7b57610c7a611223565b5b600082013567ffffffffffffffff811115610c9957610c9861121e565b5b610ca584828501610a86565b91505092915050565b600080600060408486031215610cc757610cc6611223565b5b6000610cd586828701610ab4565b935050602084013567ffffffffffffffff811115610cf657610cf561121e565b5b610d02868287016109ed565b92509250509250925092565b600060208284031215610d2457610d23611223565b5b600082013567ffffffffffffffff811115610d4257610d4161121e565b5b610d4e84828501610ad3565b91505092915050565b600080600080600060808688031215610d7357610d72611223565b5b600086013567ffffffffffffffff811115610d9157610d9061121e565b5b610d9d88828901610af2565b9550506020610dae888289016109ae565b9450506040610dbf88828901610b11565b935050606086013567ffffffffffffffff811115610de057610ddf61121e565b5b610dec888289016109ed565b92509250509295509295909350565b610e04816110f0565b82525050565b610e1381611102565b82525050565b6000610e2583856110da565b9350610e32838584611154565b82840190509392505050565b6000610e49826110b3565b610e5381856110c9565b9350610e63818560208601611163565b610e6c81611228565b840191505092915050565b6000610e82826110be565b610e8c81856110e5565b9350610e9c818560208601611163565b80840191505092915050565b6000610eb56006836110e5565b9150610ec082611239565b600682019050919050565b610ed48161114a565b82525050565b6000610ee7828486610e19565b91508190509392505050565b6000610eff8284610e77565b915081905092915050565b6000610f1582610ea8565b9150819050919050565b6000602082019050610f346000830184610dfb565b92915050565b6000606082019050610f4f6000830186610dfb565b610f5c6020830185610dfb565b610f696040830184610ecb565b949350505050565b6000602082019050610f866000830184610e0a565b92915050565b60006020820190508181036000830152610fa68184610e3e565b905092915050565b6000602082019050610fc36000830184610ecb565b92915050565b60008083356001602003843603038112610fe657610fe561120a565b5b80840192508235915067ffffffffffffffff82111561100857611007611200565b5b60208301925060018202360383131561102457611023611214565b5b509250929050565b6000611036611047565b90506110428282611196565b919050565b6000604051905090565b600067ffffffffffffffff82111561106c5761106b6111c7565b5b61107582611228565b9050602081019050919050565b600067ffffffffffffffff82111561109d5761109c6111c7565b5b6110a682611228565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b60006110fb8261112a565b9050919050565b60008115159050919050565b6000819050919050565b6000611123826110f0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611181578082015181840152602081019050611166565b83811115611190576000848401525b50505050565b61119f82611228565b810181811067ffffffffffffffff821117156111be576111bd6111c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61126b816110f0565b811461127657600080fd5b50565b61128281611102565b811461128d57600080fd5b50565b6112998161110e565b81146112a457600080fd5b50565b6112b081611118565b81146112bb57600080fd5b50565b6112c78161114a565b81146112d257600080fd5b5056fea2646970667358221220a288f2c4d965e7b02806d9d463d92916aa7690d64f540ee49223fe69640316ef64736f6c63430008070033 diff --git a/pkg/contracts/testdappv2/TestDAppV2.go b/pkg/contracts/testdappv2/TestDAppV2.go index aeec5a7531..fd7a77aa31 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.go +++ b/pkg/contracts/testdappv2/TestDAppV2.go @@ -51,8 +51,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\":[],\"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\":\"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\":\"onCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"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: "0x608060405234801561001057600080fd5b5061150a806100206000396000f3fe6080604052600436106100c65760003560e01c8063a799911f1161007f578063c9028a3611610059578063c9028a3614610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063a799911f146101f9578063c234fecf14610215578063c7a339a91461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a777146101385780635bcfd61614610163578063676cc0541461018c5780639291fe26146101bc576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610de7565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610d02565b610371565b60405161012f9190611173565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a91906110c4565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190610ed9565b6103ad565b005b6101a660048036038101906101a19190610e30565b6104a6565b6040516101b39190611131565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190610de7565b61065b565b6040516101f09190611173565b60405180910390f35b610213600480360381019061020e9190610de7565b61069e565b005b34801561022157600080fd5b5061023c60048036038101906102379190610ca8565b6106c7565b005b34801561024a57600080fd5b5061026560048036038101906102609190610d78565b61070a565b005b34801561027357600080fd5b5061028e60048036038101906102899190610e90565b6107cd565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610d02565b610907565b6040516102c49190611116565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610de7565b610927565b6040516103019190611116565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190610d2f565b610977565b60405161033e91906110c4565b60405180910390f35b610350816109c0565b1561035a57600080fd5b61036381610a16565b61036e816000610a6a565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103fa82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506109c0565b1561040457600080fd5b61045182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61049f82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a6a565b5050505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906104f29190610ca8565b73ffffffffffffffffffffffffffffffffffffffff1614610548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053f90611153565b60405180910390fd5b61059583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b6105e383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505034610a6a565b8360000160208101906105f69190610ca8565b6002848460405161060892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060036000836040516020016106729190611098565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6106a7816109c0565b156106b157600080fd5b6106ba81610a16565b6106c48134610a6a565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610713816109c0565b1561071d57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161075a939291906110df565b602060405180830381600087803b15801561077457600080fd5b505af1158015610788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190610cd5565b6107b557600080fd5b6107be81610a16565b6107c88183610a6a565b505050565b6108288180606001906107e0919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61088581806060019061083b919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610a6a565b8060000160208101906108989190610ca8565b60028280606001906108aa919061118e565b6040516108b892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161093e9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016109d1906110af565b60405160208183030381529060405280519060200120826040516020016109f89190611098565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610a2c9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610a809190611098565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000610abf610aba84611216565b6111f1565b905082815260208101848484011115610adb57610ada6113ef565b5b610ae684828561132a565b509392505050565b6000610b01610afc84611247565b6111f1565b905082815260208101848484011115610b1d57610b1c6113ef565b5b610b2884828561132a565b509392505050565b600081359050610b3f81611461565b92915050565b600081519050610b5481611478565b92915050565b600081359050610b698161148f565b92915050565b60008083601f840112610b8557610b846113d1565b5b8235905067ffffffffffffffff811115610ba257610ba16113cc565b5b602083019150836001820283011115610bbe57610bbd6113e5565b5b9250929050565b600082601f830112610bda57610bd96113d1565b5b8135610bea848260208601610aac565b91505092915050565b600081359050610c02816114a6565b92915050565b600082601f830112610c1d57610c1c6113d1565b5b8135610c2d848260208601610aee565b91505092915050565b600060208284031215610c4c57610c4b6113db565b5b81905092915050565b600060808284031215610c6b57610c6a6113db565b5b81905092915050565b600060608284031215610c8a57610c896113db565b5b81905092915050565b600081359050610ca2816114bd565b92915050565b600060208284031215610cbe57610cbd6113f9565b5b6000610ccc84828501610b30565b91505092915050565b600060208284031215610ceb57610cea6113f9565b5b6000610cf984828501610b45565b91505092915050565b600060208284031215610d1857610d176113f9565b5b6000610d2684828501610b5a565b91505092915050565b600060208284031215610d4557610d446113f9565b5b600082013567ffffffffffffffff811115610d6357610d626113f4565b5b610d6f84828501610bc5565b91505092915050565b600080600060608486031215610d9157610d906113f9565b5b6000610d9f86828701610bf3565b9350506020610db086828701610c93565b925050604084013567ffffffffffffffff811115610dd157610dd06113f4565b5b610ddd86828701610c08565b9150509250925092565b600060208284031215610dfd57610dfc6113f9565b5b600082013567ffffffffffffffff811115610e1b57610e1a6113f4565b5b610e2784828501610c08565b91505092915050565b600080600060408486031215610e4957610e486113f9565b5b6000610e5786828701610c36565b935050602084013567ffffffffffffffff811115610e7857610e776113f4565b5b610e8486828701610b6f565b92509250509250925092565b600060208284031215610ea657610ea56113f9565b5b600082013567ffffffffffffffff811115610ec457610ec36113f4565b5b610ed084828501610c55565b91505092915050565b600080600080600060808688031215610ef557610ef46113f9565b5b600086013567ffffffffffffffff811115610f1357610f126113f4565b5b610f1f88828901610c74565b9550506020610f3088828901610b30565b9450506040610f4188828901610c93565b935050606086013567ffffffffffffffff811115610f6257610f616113f4565b5b610f6e88828901610b6f565b92509250509295509295909350565b610f86816112c6565b82525050565b610f95816112d8565b82525050565b6000610fa7838561129f565b9350610fb483858461132a565b82840190509392505050565b6000610fcb82611278565b610fd5818561128e565b9350610fe5818560208601611339565b610fee816113fe565b840191505092915050565b600061100482611283565b61100e81856112bb565b935061101e818560208601611339565b80840191505092915050565b60006110376016836112aa565b91506110428261140f565b602082019050919050565b600061105a6006836112bb565b915061106582611438565b600682019050919050565b61107981611320565b82525050565b600061108c828486610f9b565b91508190509392505050565b60006110a48284610ff9565b915081905092915050565b60006110ba8261104d565b9150819050919050565b60006020820190506110d96000830184610f7d565b92915050565b60006060820190506110f46000830186610f7d565b6111016020830185610f7d565b61110e6040830184611070565b949350505050565b600060208201905061112b6000830184610f8c565b92915050565b6000602082019050818103600083015261114b8184610fc0565b905092915050565b6000602082019050818103600083015261116c8161102a565b9050919050565b60006020820190506111886000830184611070565b92915050565b600080833560016020038436030381126111ab576111aa6113e0565b5b80840192508235915067ffffffffffffffff8211156111cd576111cc6113d6565b5b6020830192506001820236038313156111e9576111e86113ea565b5b509250929050565b60006111fb61120c565b9050611207828261136c565b919050565b6000604051905090565b600067ffffffffffffffff8211156112315761123061139d565b5b61123a826113fe565b9050602081019050919050565b600067ffffffffffffffff8211156112625761126161139d565b5b61126b826113fe565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006112d182611300565b9050919050565b60008115159050919050565b6000819050919050565b60006112f9826112c6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561135757808201518184015260208101905061133c565b83811115611366576000848401525b50505050565b611375826113fe565b810181811067ffffffffffffffff821117156113945761139361139d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61146a816112c6565b811461147557600080fd5b50565b611481816112d8565b811461148c57600080fd5b50565b611498816112e4565b81146114a357600080fd5b50565b6114af816112ee565b81146114ba57600080fd5b50565b6114c681611320565b81146114d157600080fd5b5056fea2646970667358221220f3098dec1315d0cad1405fecc08983ea60d8ccb240a10da773012d554f5948f264736f6c63430008070033", + 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\":\"onCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"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\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"simpleCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Bin: "0x608060405234801561001057600080fd5b5061130b806100206000396000f3fe6080604052600436106100a05760003560e01c8063a799911f11610064578063a799911f146101a8578063c7a339a9146101c4578063c9028a36146101ed578063e2842ed714610216578063f592cbfb14610253578063f936ae8514610290576100a7565b806336e980a0146100ac5780634297a263146100d55780635bcfd61614610112578063676cc0541461013b5780639291fe261461016b576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100d360048036038101906100ce9190610c65565b6102cd565b005b3480156100e157600080fd5b506100fc60048036038101906100f79190610b80565b6102f7565b6040516101099190610fae565b60405180910390f35b34801561011e57600080fd5b5061013960048036038101906101349190610d57565b61030f565b005b61015560048036038101906101509190610cae565b610408565b6040516101629190610f8c565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d9190610c65565b61051d565b60405161019f9190610fae565b60405180910390f35b6101c260048036038101906101bd9190610c65565b610560565b005b3480156101d057600080fd5b506101eb60048036038101906101e69190610bf6565b610589565b005b3480156101f957600080fd5b50610214600480360381019061020f9190610d0e565b61064c565b005b34801561022257600080fd5b5061023d60048036038101906102389190610b80565b610786565b60405161024a9190610f71565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190610c65565b6107a6565b6040516102879190610f71565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190610bad565b6107f5565b6040516102c49190610f1f565b60405180910390f35b6102d68161083e565b156102e057600080fd5b6102e981610894565b6102f48160006108e8565b50565b60026020528060005260406000206000915090505481565b61035c82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061083e565b1561036657600080fd5b6103b382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b61040182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846108e8565b5050505050565b606061045783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6104a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346108e8565b8360000160208101906104b89190610b26565b600184846040516104ca929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060026000836040516020016105349190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105698161083e565b1561057357600080fd5b61057c81610894565b61058681346108e8565b50565b6105928161083e565b1561059c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105d993929190610f3a565b602060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b9190610b53565b61063457600080fd5b61063d81610894565b61064781836108e8565b505050565b6106a781806060019061065f9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6107048180606001906106ba9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006108e8565b8060000160208101906107179190610b26565b60018280606001906107299190610fc9565b604051610737929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016107bc9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161084f90610f0a565b60405160208183030381529060405280519060200120826040516020016108769190610ef3565b60405160208183030381529060405280519060200120149050919050565b6001600080836040516020016108aa9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060026000846040516020016108fe9190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b600061093d61093884611051565b61102c565b90508281526020810184848401111561095957610958611219565b5b610964848285611154565b509392505050565b600061097f61097a84611082565b61102c565b90508281526020810184848401111561099b5761099a611219565b5b6109a6848285611154565b509392505050565b6000813590506109bd81611262565b92915050565b6000815190506109d281611279565b92915050565b6000813590506109e781611290565b92915050565b60008083601f840112610a0357610a026111fb565b5b8235905067ffffffffffffffff811115610a2057610a1f6111f6565b5b602083019150836001820283011115610a3c57610a3b61120f565b5b9250929050565b600082601f830112610a5857610a576111fb565b5b8135610a6884826020860161092a565b91505092915050565b600081359050610a80816112a7565b92915050565b600082601f830112610a9b57610a9a6111fb565b5b8135610aab84826020860161096c565b91505092915050565b600060208284031215610aca57610ac9611205565b5b81905092915050565b600060808284031215610ae957610ae8611205565b5b81905092915050565b600060608284031215610b0857610b07611205565b5b81905092915050565b600081359050610b20816112be565b92915050565b600060208284031215610b3c57610b3b611223565b5b6000610b4a848285016109ae565b91505092915050565b600060208284031215610b6957610b68611223565b5b6000610b77848285016109c3565b91505092915050565b600060208284031215610b9657610b95611223565b5b6000610ba4848285016109d8565b91505092915050565b600060208284031215610bc357610bc2611223565b5b600082013567ffffffffffffffff811115610be157610be061121e565b5b610bed84828501610a43565b91505092915050565b600080600060608486031215610c0f57610c0e611223565b5b6000610c1d86828701610a71565b9350506020610c2e86828701610b11565b925050604084013567ffffffffffffffff811115610c4f57610c4e61121e565b5b610c5b86828701610a86565b9150509250925092565b600060208284031215610c7b57610c7a611223565b5b600082013567ffffffffffffffff811115610c9957610c9861121e565b5b610ca584828501610a86565b91505092915050565b600080600060408486031215610cc757610cc6611223565b5b6000610cd586828701610ab4565b935050602084013567ffffffffffffffff811115610cf657610cf561121e565b5b610d02868287016109ed565b92509250509250925092565b600060208284031215610d2457610d23611223565b5b600082013567ffffffffffffffff811115610d4257610d4161121e565b5b610d4e84828501610ad3565b91505092915050565b600080600080600060808688031215610d7357610d72611223565b5b600086013567ffffffffffffffff811115610d9157610d9061121e565b5b610d9d88828901610af2565b9550506020610dae888289016109ae565b9450506040610dbf88828901610b11565b935050606086013567ffffffffffffffff811115610de057610ddf61121e565b5b610dec888289016109ed565b92509250509295509295909350565b610e04816110f0565b82525050565b610e1381611102565b82525050565b6000610e2583856110da565b9350610e32838584611154565b82840190509392505050565b6000610e49826110b3565b610e5381856110c9565b9350610e63818560208601611163565b610e6c81611228565b840191505092915050565b6000610e82826110be565b610e8c81856110e5565b9350610e9c818560208601611163565b80840191505092915050565b6000610eb56006836110e5565b9150610ec082611239565b600682019050919050565b610ed48161114a565b82525050565b6000610ee7828486610e19565b91508190509392505050565b6000610eff8284610e77565b915081905092915050565b6000610f1582610ea8565b9150819050919050565b6000602082019050610f346000830184610dfb565b92915050565b6000606082019050610f4f6000830186610dfb565b610f5c6020830185610dfb565b610f696040830184610ecb565b949350505050565b6000602082019050610f866000830184610e0a565b92915050565b60006020820190508181036000830152610fa68184610e3e565b905092915050565b6000602082019050610fc36000830184610ecb565b92915050565b60008083356001602003843603038112610fe657610fe561120a565b5b80840192508235915067ffffffffffffffff82111561100857611007611200565b5b60208301925060018202360383131561102457611023611214565b5b509250929050565b6000611036611047565b90506110428282611196565b919050565b6000604051905090565b600067ffffffffffffffff82111561106c5761106b6111c7565b5b61107582611228565b9050602081019050919050565b600067ffffffffffffffff82111561109d5761109c6111c7565b5b6110a682611228565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b60006110fb8261112a565b9050919050565b60008115159050919050565b6000819050919050565b6000611123826110f0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611181578082015181840152602081019050611166565b83811115611190576000848401525b50505050565b61119f82611228565b810181811067ffffffffffffffff821117156111be576111bd6111c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61126b816110f0565b811461127657600080fd5b50565b61128281611102565b811461128d57600080fd5b50565b6112998161110e565b81146112a457600080fd5b50565b6112b081611118565b81146112bb57600080fd5b50565b6112c78161114a565b81146112d257600080fd5b5056fea2646970667358221220a288f2c4d965e7b02806d9d463d92916aa7690d64f540ee49223fe69640316ef64736f6c63430008070033", } // TestDAppV2ABI is the input ABI used to generate the binding from. @@ -284,37 +284,6 @@ 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) @@ -513,27 +482,6 @@ 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 cb9bcfeb79..479b3e150c 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.json +++ b/pkg/contracts/testdappv2/TestDAppV2.json @@ -61,19 +61,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "expectedOnCallSender", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -255,19 +242,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "_expectedOnCallSender", - "type": "address" - } - ], - "name": "setExpectedOnCallSender", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -286,5 +260,5 @@ "type": "receive" } ], - "bin": "608060405234801561001057600080fd5b5061150a806100206000396000f3fe6080604052600436106100c65760003560e01c8063a799911f1161007f578063c9028a3611610059578063c9028a3614610267578063e2842ed714610290578063f592cbfb146102cd578063f936ae851461030a576100cd565b8063a799911f146101f9578063c234fecf14610215578063c7a339a91461023e576100cd565b806336e980a0146100d25780634297a263146100fb57806359f4a777146101385780635bcfd61614610163578063676cc0541461018c5780639291fe26146101bc576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610de7565b610347565b005b34801561010757600080fd5b50610122600480360381019061011d9190610d02565b610371565b60405161012f9190611173565b60405180910390f35b34801561014457600080fd5b5061014d610389565b60405161015a91906110c4565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190610ed9565b6103ad565b005b6101a660048036038101906101a19190610e30565b6104a6565b6040516101b39190611131565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190610de7565b61065b565b6040516101f09190611173565b60405180910390f35b610213600480360381019061020e9190610de7565b61069e565b005b34801561022157600080fd5b5061023c60048036038101906102379190610ca8565b6106c7565b005b34801561024a57600080fd5b5061026560048036038101906102609190610d78565b61070a565b005b34801561027357600080fd5b5061028e60048036038101906102899190610e90565b6107cd565b005b34801561029c57600080fd5b506102b760048036038101906102b29190610d02565b610907565b6040516102c49190611116565b60405180910390f35b3480156102d957600080fd5b506102f460048036038101906102ef9190610de7565b610927565b6040516103019190611116565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190610d2f565b610977565b60405161033e91906110c4565b60405180910390f35b610350816109c0565b1561035a57600080fd5b61036381610a16565b61036e816000610a6a565b50565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103fa82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506109c0565b1561040457600080fd5b61045182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61049f82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a6a565b5050505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460000160208101906104f29190610ca8565b73ffffffffffffffffffffffffffffffffffffffff1614610548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053f90611153565b60405180910390fd5b61059583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b6105e383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505034610a6a565b8360000160208101906105f69190610ca8565b6002848460405161060892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060036000836040516020016106729190611098565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6106a7816109c0565b156106b157600080fd5b6106ba81610a16565b6106c48134610a6a565b50565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610713816109c0565b1561071d57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b815260040161075a939291906110df565b602060405180830381600087803b15801561077457600080fd5b505af1158015610788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190610cd5565b6107b557600080fd5b6107be81610a16565b6107c88183610a6a565b505050565b6108288180606001906107e0919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610a16565b61088581806060019061083b919061118e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610a6a565b8060000160208101906108989190610ca8565b60028280606001906108aa919061118e565b6040516108b892919061107f565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161093e9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016109d1906110af565b60405160208183030381529060405280519060200120826040516020016109f89190611098565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610a2c9190611098565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610a809190611098565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b6000610abf610aba84611216565b6111f1565b905082815260208101848484011115610adb57610ada6113ef565b5b610ae684828561132a565b509392505050565b6000610b01610afc84611247565b6111f1565b905082815260208101848484011115610b1d57610b1c6113ef565b5b610b2884828561132a565b509392505050565b600081359050610b3f81611461565b92915050565b600081519050610b5481611478565b92915050565b600081359050610b698161148f565b92915050565b60008083601f840112610b8557610b846113d1565b5b8235905067ffffffffffffffff811115610ba257610ba16113cc565b5b602083019150836001820283011115610bbe57610bbd6113e5565b5b9250929050565b600082601f830112610bda57610bd96113d1565b5b8135610bea848260208601610aac565b91505092915050565b600081359050610c02816114a6565b92915050565b600082601f830112610c1d57610c1c6113d1565b5b8135610c2d848260208601610aee565b91505092915050565b600060208284031215610c4c57610c4b6113db565b5b81905092915050565b600060808284031215610c6b57610c6a6113db565b5b81905092915050565b600060608284031215610c8a57610c896113db565b5b81905092915050565b600081359050610ca2816114bd565b92915050565b600060208284031215610cbe57610cbd6113f9565b5b6000610ccc84828501610b30565b91505092915050565b600060208284031215610ceb57610cea6113f9565b5b6000610cf984828501610b45565b91505092915050565b600060208284031215610d1857610d176113f9565b5b6000610d2684828501610b5a565b91505092915050565b600060208284031215610d4557610d446113f9565b5b600082013567ffffffffffffffff811115610d6357610d626113f4565b5b610d6f84828501610bc5565b91505092915050565b600080600060608486031215610d9157610d906113f9565b5b6000610d9f86828701610bf3565b9350506020610db086828701610c93565b925050604084013567ffffffffffffffff811115610dd157610dd06113f4565b5b610ddd86828701610c08565b9150509250925092565b600060208284031215610dfd57610dfc6113f9565b5b600082013567ffffffffffffffff811115610e1b57610e1a6113f4565b5b610e2784828501610c08565b91505092915050565b600080600060408486031215610e4957610e486113f9565b5b6000610e5786828701610c36565b935050602084013567ffffffffffffffff811115610e7857610e776113f4565b5b610e8486828701610b6f565b92509250509250925092565b600060208284031215610ea657610ea56113f9565b5b600082013567ffffffffffffffff811115610ec457610ec36113f4565b5b610ed084828501610c55565b91505092915050565b600080600080600060808688031215610ef557610ef46113f9565b5b600086013567ffffffffffffffff811115610f1357610f126113f4565b5b610f1f88828901610c74565b9550506020610f3088828901610b30565b9450506040610f4188828901610c93565b935050606086013567ffffffffffffffff811115610f6257610f616113f4565b5b610f6e88828901610b6f565b92509250509295509295909350565b610f86816112c6565b82525050565b610f95816112d8565b82525050565b6000610fa7838561129f565b9350610fb483858461132a565b82840190509392505050565b6000610fcb82611278565b610fd5818561128e565b9350610fe5818560208601611339565b610fee816113fe565b840191505092915050565b600061100482611283565b61100e81856112bb565b935061101e818560208601611339565b80840191505092915050565b60006110376016836112aa565b91506110428261140f565b602082019050919050565b600061105a6006836112bb565b915061106582611438565b600682019050919050565b61107981611320565b82525050565b600061108c828486610f9b565b91508190509392505050565b60006110a48284610ff9565b915081905092915050565b60006110ba8261104d565b9150819050919050565b60006020820190506110d96000830184610f7d565b92915050565b60006060820190506110f46000830186610f7d565b6111016020830185610f7d565b61110e6040830184611070565b949350505050565b600060208201905061112b6000830184610f8c565b92915050565b6000602082019050818103600083015261114b8184610fc0565b905092915050565b6000602082019050818103600083015261116c8161102a565b9050919050565b60006020820190506111886000830184611070565b92915050565b600080833560016020038436030381126111ab576111aa6113e0565b5b80840192508235915067ffffffffffffffff8211156111cd576111cc6113d6565b5b6020830192506001820236038313156111e9576111e86113ea565b5b509250929050565b60006111fb61120c565b9050611207828261136c565b919050565b6000604051905090565b600067ffffffffffffffff8211156112315761123061139d565b5b61123a826113fe565b9050602081019050919050565b600067ffffffffffffffff8211156112625761126161139d565b5b61126b826113fe565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006112d182611300565b9050919050565b60008115159050919050565b6000819050919050565b60006112f9826112c6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561135757808201518184015260208101905061133c565b83811115611366576000848401525b50505050565b611375826113fe565b810181811067ffffffffffffffff821117156113945761139361139d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f756e61757468656e746963617465642073656e64657200000000000000000000600082015250565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61146a816112c6565b811461147557600080fd5b50565b611481816112d8565b811461148c57600080fd5b50565b611498816112e4565b81146114a357600080fd5b50565b6114af816112ee565b81146114ba57600080fd5b50565b6114c681611320565b81146114d157600080fd5b5056fea2646970667358221220f3098dec1315d0cad1405fecc08983ea60d8ccb240a10da773012d554f5948f264736f6c63430008070033" + "bin": "608060405234801561001057600080fd5b5061130b806100206000396000f3fe6080604052600436106100a05760003560e01c8063a799911f11610064578063a799911f146101a8578063c7a339a9146101c4578063c9028a36146101ed578063e2842ed714610216578063f592cbfb14610253578063f936ae8514610290576100a7565b806336e980a0146100ac5780634297a263146100d55780635bcfd61614610112578063676cc0541461013b5780639291fe261461016b576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100d360048036038101906100ce9190610c65565b6102cd565b005b3480156100e157600080fd5b506100fc60048036038101906100f79190610b80565b6102f7565b6040516101099190610fae565b60405180910390f35b34801561011e57600080fd5b5061013960048036038101906101349190610d57565b61030f565b005b61015560048036038101906101509190610cae565b610408565b6040516101629190610f8c565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d9190610c65565b61051d565b60405161019f9190610fae565b60405180910390f35b6101c260048036038101906101bd9190610c65565b610560565b005b3480156101d057600080fd5b506101eb60048036038101906101e69190610bf6565b610589565b005b3480156101f957600080fd5b50610214600480360381019061020f9190610d0e565b61064c565b005b34801561022257600080fd5b5061023d60048036038101906102389190610b80565b610786565b60405161024a9190610f71565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190610c65565b6107a6565b6040516102879190610f71565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190610bad565b6107f5565b6040516102c49190610f1f565b60405180910390f35b6102d68161083e565b156102e057600080fd5b6102e981610894565b6102f48160006108e8565b50565b60026020528060005260406000206000915090505481565b61035c82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061083e565b1561036657600080fd5b6103b382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b61040182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846108e8565b5050505050565b606061045783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6104a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346108e8565b8360000160208101906104b89190610b26565b600184846040516104ca929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060026000836040516020016105349190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105698161083e565b1561057357600080fd5b61057c81610894565b61058681346108e8565b50565b6105928161083e565b1561059c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105d993929190610f3a565b602060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b9190610b53565b61063457600080fd5b61063d81610894565b61064781836108e8565b505050565b6106a781806060019061065f9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6107048180606001906106ba9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006108e8565b8060000160208101906107179190610b26565b60018280606001906107299190610fc9565b604051610737929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016107bc9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161084f90610f0a565b60405160208183030381529060405280519060200120826040516020016108769190610ef3565b60405160208183030381529060405280519060200120149050919050565b6001600080836040516020016108aa9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060026000846040516020016108fe9190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b600061093d61093884611051565b61102c565b90508281526020810184848401111561095957610958611219565b5b610964848285611154565b509392505050565b600061097f61097a84611082565b61102c565b90508281526020810184848401111561099b5761099a611219565b5b6109a6848285611154565b509392505050565b6000813590506109bd81611262565b92915050565b6000815190506109d281611279565b92915050565b6000813590506109e781611290565b92915050565b60008083601f840112610a0357610a026111fb565b5b8235905067ffffffffffffffff811115610a2057610a1f6111f6565b5b602083019150836001820283011115610a3c57610a3b61120f565b5b9250929050565b600082601f830112610a5857610a576111fb565b5b8135610a6884826020860161092a565b91505092915050565b600081359050610a80816112a7565b92915050565b600082601f830112610a9b57610a9a6111fb565b5b8135610aab84826020860161096c565b91505092915050565b600060208284031215610aca57610ac9611205565b5b81905092915050565b600060808284031215610ae957610ae8611205565b5b81905092915050565b600060608284031215610b0857610b07611205565b5b81905092915050565b600081359050610b20816112be565b92915050565b600060208284031215610b3c57610b3b611223565b5b6000610b4a848285016109ae565b91505092915050565b600060208284031215610b6957610b68611223565b5b6000610b77848285016109c3565b91505092915050565b600060208284031215610b9657610b95611223565b5b6000610ba4848285016109d8565b91505092915050565b600060208284031215610bc357610bc2611223565b5b600082013567ffffffffffffffff811115610be157610be061121e565b5b610bed84828501610a43565b91505092915050565b600080600060608486031215610c0f57610c0e611223565b5b6000610c1d86828701610a71565b9350506020610c2e86828701610b11565b925050604084013567ffffffffffffffff811115610c4f57610c4e61121e565b5b610c5b86828701610a86565b9150509250925092565b600060208284031215610c7b57610c7a611223565b5b600082013567ffffffffffffffff811115610c9957610c9861121e565b5b610ca584828501610a86565b91505092915050565b600080600060408486031215610cc757610cc6611223565b5b6000610cd586828701610ab4565b935050602084013567ffffffffffffffff811115610cf657610cf561121e565b5b610d02868287016109ed565b92509250509250925092565b600060208284031215610d2457610d23611223565b5b600082013567ffffffffffffffff811115610d4257610d4161121e565b5b610d4e84828501610ad3565b91505092915050565b600080600080600060808688031215610d7357610d72611223565b5b600086013567ffffffffffffffff811115610d9157610d9061121e565b5b610d9d88828901610af2565b9550506020610dae888289016109ae565b9450506040610dbf88828901610b11565b935050606086013567ffffffffffffffff811115610de057610ddf61121e565b5b610dec888289016109ed565b92509250509295509295909350565b610e04816110f0565b82525050565b610e1381611102565b82525050565b6000610e2583856110da565b9350610e32838584611154565b82840190509392505050565b6000610e49826110b3565b610e5381856110c9565b9350610e63818560208601611163565b610e6c81611228565b840191505092915050565b6000610e82826110be565b610e8c81856110e5565b9350610e9c818560208601611163565b80840191505092915050565b6000610eb56006836110e5565b9150610ec082611239565b600682019050919050565b610ed48161114a565b82525050565b6000610ee7828486610e19565b91508190509392505050565b6000610eff8284610e77565b915081905092915050565b6000610f1582610ea8565b9150819050919050565b6000602082019050610f346000830184610dfb565b92915050565b6000606082019050610f4f6000830186610dfb565b610f5c6020830185610dfb565b610f696040830184610ecb565b949350505050565b6000602082019050610f866000830184610e0a565b92915050565b60006020820190508181036000830152610fa68184610e3e565b905092915050565b6000602082019050610fc36000830184610ecb565b92915050565b60008083356001602003843603038112610fe657610fe561120a565b5b80840192508235915067ffffffffffffffff82111561100857611007611200565b5b60208301925060018202360383131561102457611023611214565b5b509250929050565b6000611036611047565b90506110428282611196565b919050565b6000604051905090565b600067ffffffffffffffff82111561106c5761106b6111c7565b5b61107582611228565b9050602081019050919050565b600067ffffffffffffffff82111561109d5761109c6111c7565b5b6110a682611228565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b60006110fb8261112a565b9050919050565b60008115159050919050565b6000819050919050565b6000611123826110f0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611181578082015181840152602081019050611166565b83811115611190576000848401525b50505050565b61119f82611228565b810181811067ffffffffffffffff821117156111be576111bd6111c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61126b816110f0565b811461127657600080fd5b50565b61128281611102565b811461128d57600080fd5b50565b6112998161110e565b81146112a457600080fd5b50565b6112b081611118565b81146112bb57600080fd5b50565b6112c78161114a565b81146112d257600080fd5b5056fea2646970667358221220a288f2c4d965e7b02806d9d463d92916aa7690d64f540ee49223fe69640316ef64736f6c63430008070033" } diff --git a/pkg/contracts/testdappv2/TestDAppV2.sol b/pkg/contracts/testdappv2/TestDAppV2.sol index 3d9d3ca5fc..4b3c3bdf33 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.sol +++ b/pkg/contracts/testdappv2/TestDAppV2.sol @@ -30,8 +30,6 @@ contract TestDAppV2 { address sender; } - address public expectedOnCallSender; - // these structures allow to assess contract calls mapping(bytes32 => bool) public calledWithMessage; mapping(bytes => address) public senderWithMessage; @@ -105,12 +103,7 @@ contract TestDAppV2 { senderWithMessage[revertContext.revertMessage] = revertContext.sender; } - 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; From dfe9a5d640c57a2082db3e480d7f706b5fdf39af Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 19:44:34 +0200 Subject: [PATCH 08/16] fix --- e2e/e2etests/test_v2_erc20_withdraw_and_call.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go index ac33db13c6..7c0f549305 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go @@ -48,7 +48,7 @@ func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, _ []string) { // check expected sender was used senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage( &bind.CallOpts{}, - []byte(payloadMessageAuthenticatedWithdrawETH), + []byte(payloadMessageWithdrawAuthenticatedCallERC20), ) require.NoError(r, err) require.Equal(r, r.ZEVMAuth.From, senderForMsg) From f003f72c8e767c998622f369c0caeb2bfda2c3ae Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 19:46:57 +0200 Subject: [PATCH 09/16] PR comment --- zetaclient/chains/evm/signer/v2_sign.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zetaclient/chains/evm/signer/v2_sign.go b/zetaclient/chains/evm/signer/v2_sign.go index 73d6c3ecf1..20793180e2 100644 --- a/zetaclient/chains/evm/signer/v2_sign.go +++ b/zetaclient/chains/evm/signer/v2_sign.go @@ -29,7 +29,8 @@ func (signer *Signer) signGatewayExecute( var data []byte - // only set sender if it's authenticated call + // if sender is provided in messageContext call is authenticated and target is Callable.onCall + // otherwise, call is arbitrary messageContext := gatewayevm.MessageContext{ Sender: common.HexToAddress(sender), } @@ -154,7 +155,8 @@ func (signer *Signer) signERC20CustodyWithdrawAndCall( return nil, errors.Wrap(err, "unable to get ERC20CustodyMetaData ABI") } - // only set sender if it's authenticated call + // if sender is provided in messageContext call is authenticated and target is Callable.onCall + // otherwise, call is arbitrary messageContext := gatewayevm.MessageContext{ Sender: common.HexToAddress(sender), } From 079485292976c9cd087f6ee4ccdca1ff4c812c26 Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 19:47:55 +0200 Subject: [PATCH 10/16] revert staking abi change --- e2e/contracts/teststaking/TestStaking.abi | 344 ++++++++++++++++++++ e2e/contracts/teststaking/TestStaking.bin | 1 + e2e/contracts/teststaking/TestStaking.json | 347 +++++++++++++++++++++ 3 files changed, 692 insertions(+) diff --git a/e2e/contracts/teststaking/TestStaking.abi b/e2e/contracts/teststaking/TestStaking.abi index e69de29bb2..5c793c4c7f 100644 --- a/e2e/contracts/teststaking/TestStaking.abi +++ b/e2e/contracts/teststaking/TestStaking.abi @@ -0,0 +1,344 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_wzeta", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "validatorSrc", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "validatorDst", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MoveStake", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Stake", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Unstake", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "counter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositWZETA", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllValidators", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "operatorAddress", + "type": "string" + }, + { + "internalType": "string", + "name": "consensusPubKey", + "type": "string" + }, + { + "internalType": "bool", + "name": "jailed", + "type": "bool" + }, + { + "internalType": "enum BondStatus", + "name": "bondStatus", + "type": "uint8" + } + ], + "internalType": "struct Validator[]", + "name": "validators", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + } + ], + "name": "getShares", + "outputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validatorSrc", + "type": "string" + }, + { + "internalType": "string", + "name": "validatorDst", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "moveStake", + "outputs": [ + { + "internalType": "int64", + "name": "completionTime", + "type": "int64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stakeAndRevert", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stakeWithStateUpdate", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [ + { + "internalType": "int64", + "name": "completionTime", + "type": "int64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "withdrawWZETA", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] diff --git a/e2e/contracts/teststaking/TestStaking.bin b/e2e/contracts/teststaking/TestStaking.bin index e69de29bb2..14751519ee 100644 --- a/e2e/contracts/teststaking/TestStaking.bin +++ b/e2e/contracts/teststaking/TestStaking.bin @@ -0,0 +1 @@ +608060405260666000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006003553480156200005757600080fd5b506040516200192d3803806200192d83398181016040528101906200007d919062000170565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050620001a2565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000138826200010b565b9050919050565b6200014a816200012b565b81146200015657600080fd5b50565b6000815190506200016a816200013f565b92915050565b60006020828403121562000189576200018862000106565b5b6000620001998482850162000159565b91505092915050565b61177b80620001b26000396000f3fe6080604052600436106100955760003560e01c806390b8436f1161005957806390b8436f1461018a5780639a0fb673146101c7578063bca8f527146101f0578063d11a93d01461022d578063f3513a371461026a5761009c565b80630d1b3daf1461009e5780632c5d24ae146100db57806357c6ea3e146100e557806361bc221a146101225780636be8916c1461014d5761009c565b3661009c57005b005b3480156100aa57600080fd5b506100c560048036038101906100c09190610d08565b610295565b6040516100d29190610d7d565b60405180910390f35b6100e361033c565b005b3480156100f157600080fd5b5061010c60048036038101906101079190610dc4565b61041b565b6040516101199190610e4f565b60405180910390f35b34801561012e57600080fd5b50610137610520565b6040516101449190610d7d565b60405180910390f35b34801561015957600080fd5b50610174600480360381019061016f9190610dc4565b610526565b6040516101819190610e85565b60405180910390f35b34801561019657600080fd5b506101b160048036038101906101ac9190610dc4565b61065c565b6040516101be9190610e85565b60405180910390f35b3480156101d357600080fd5b506101ee60048036038101906101e99190610ea0565b610761565b005b3480156101fc57600080fd5b5061021760048036038101906102129190610dc4565b61084b565b6040516102249190610e85565b60405180910390f35b34801561023957600080fd5b50610254600480360381019061024f9190610ecd565b6109ad565b6040516102619190610e4f565b60405180910390f35b34801561027657600080fd5b5061027f610ab5565b60405161028c91906111a6565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630d1b3daf84846040518363ffffffff1660e01b81526004016102f3929190611221565b602060405180830381865afa158015610310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103349190611266565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461039657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561040057600080fd5b505af1158015610414573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461047757600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357c6ea3e8585856040518463ffffffff1660e01b81526004016104d493929190611293565b6020604051808303816000875af11580156104f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051791906112fd565b90509392505050565b60035481565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461058257600080fd5b60016003546105919190611359565b60038190555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8686866040518463ffffffff1660e01b81526004016105f793929190611293565b6020604051808303816000875af1158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a91906113db565b9050600160035461064b9190611359565b600381905550809150509392505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106b857600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8585856040518463ffffffff1660e01b815260040161071593929190611293565b6020604051808303816000875af1158015610734573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075891906113db565b90509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107bb57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b81526004016108169190610d7d565b600060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108a757600080fd5b60016003546108b69190611359565b60038190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8585856040518463ffffffff1660e01b815260040161091993929190611293565b6020604051808303816000875af1158015610938573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095c91906113db565b50600160035461096c9190611359565b6003819055506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a490611454565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0957600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d11a93d0868686866040518563ffffffff1660e01b8152600401610a689493929190611474565b6020604051808303816000875af1158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906112fd565b9050949350505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3513a376040518163ffffffff1660e01b8152600401600060405180830381865afa158015610b22573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610b4b91906116fc565b905090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b8f82610b64565b9050919050565b610b9f81610b84565b8114610baa57600080fd5b50565b600081359050610bbc81610b96565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610c1582610bcc565b810181811067ffffffffffffffff82111715610c3457610c33610bdd565b5b80604052505050565b6000610c47610b50565b9050610c538282610c0c565b919050565b600067ffffffffffffffff821115610c7357610c72610bdd565b5b610c7c82610bcc565b9050602081019050919050565b82818337600083830152505050565b6000610cab610ca684610c58565b610c3d565b905082815260208101848484011115610cc757610cc6610bc7565b5b610cd2848285610c89565b509392505050565b600082601f830112610cef57610cee610bc2565b5b8135610cff848260208601610c98565b91505092915050565b60008060408385031215610d1f57610d1e610b5a565b5b6000610d2d85828601610bad565b925050602083013567ffffffffffffffff811115610d4e57610d4d610b5f565b5b610d5a85828601610cda565b9150509250929050565b6000819050919050565b610d7781610d64565b82525050565b6000602082019050610d926000830184610d6e565b92915050565b610da181610d64565b8114610dac57600080fd5b50565b600081359050610dbe81610d98565b92915050565b600080600060608486031215610ddd57610ddc610b5a565b5b6000610deb86828701610bad565b935050602084013567ffffffffffffffff811115610e0c57610e0b610b5f565b5b610e1886828701610cda565b9250506040610e2986828701610daf565b9150509250925092565b60008160070b9050919050565b610e4981610e33565b82525050565b6000602082019050610e646000830184610e40565b92915050565b60008115159050919050565b610e7f81610e6a565b82525050565b6000602082019050610e9a6000830184610e76565b92915050565b600060208284031215610eb657610eb5610b5a565b5b6000610ec484828501610daf565b91505092915050565b60008060008060808587031215610ee757610ee6610b5a565b5b6000610ef587828801610bad565b945050602085013567ffffffffffffffff811115610f1657610f15610b5f565b5b610f2287828801610cda565b935050604085013567ffffffffffffffff811115610f4357610f42610b5f565b5b610f4f87828801610cda565b9250506060610f6087828801610daf565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610fd2578082015181840152602081019050610fb7565b83811115610fe1576000848401525b50505050565b6000610ff282610f98565b610ffc8185610fa3565b935061100c818560208601610fb4565b61101581610bcc565b840191505092915050565b61102981610e6a565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061106f5761106e61102f565b5b50565b60008190506110808261105e565b919050565b600061109082611072565b9050919050565b6110a081611085565b82525050565b600060808301600083015184820360008601526110c38282610fe7565b915050602083015184820360208601526110dd8282610fe7565b91505060408301516110f26040860182611020565b5060608301516111056060860182611097565b508091505092915050565b600061111c83836110a6565b905092915050565b6000602082019050919050565b600061113c82610f6c565b6111468185610f77565b93508360208202850161115885610f88565b8060005b8581101561119457848403895281516111758582611110565b945061118083611124565b925060208a0199505060018101905061115c565b50829750879550505050505092915050565b600060208201905081810360008301526111c08184611131565b905092915050565b6111d181610b84565b82525050565b600082825260208201905092915050565b60006111f382610f98565b6111fd81856111d7565b935061120d818560208601610fb4565b61121681610bcc565b840191505092915050565b600060408201905061123660008301856111c8565b818103602083015261124881846111e8565b90509392505050565b60008151905061126081610d98565b92915050565b60006020828403121561127c5761127b610b5a565b5b600061128a84828501611251565b91505092915050565b60006060820190506112a860008301866111c8565b81810360208301526112ba81856111e8565b90506112c96040830184610d6e565b949350505050565b6112da81610e33565b81146112e557600080fd5b50565b6000815190506112f7816112d1565b92915050565b60006020828403121561131357611312610b5a565b5b6000611321848285016112e8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061136482610d64565b915061136f83610d64565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156113a4576113a361132a565b5b828201905092915050565b6113b881610e6a565b81146113c357600080fd5b50565b6000815190506113d5816113af565b92915050565b6000602082840312156113f1576113f0610b5a565b5b60006113ff848285016113c6565b91505092915050565b7f7465737472657665727400000000000000000000000000000000000000000000600082015250565b600061143e600a836111d7565b915061144982611408565b602082019050919050565b6000602082019050818103600083015261146d81611431565b9050919050565b600060808201905061148960008301876111c8565b818103602083015261149b81866111e8565b905081810360408301526114af81856111e8565b90506114be6060830184610d6e565b95945050505050565b600067ffffffffffffffff8211156114e2576114e1610bdd565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600061151561151084610c58565b610c3d565b90508281526020810184848401111561153157611530610bc7565b5b61153c848285610fb4565b509392505050565b600082601f83011261155957611558610bc2565b5b8151611569848260208601611502565b91505092915050565b6004811061157f57600080fd5b50565b60008151905061159181611572565b92915050565b6000608082840312156115ad576115ac6114f8565b5b6115b76080610c3d565b9050600082015167ffffffffffffffff8111156115d7576115d66114fd565b5b6115e384828501611544565b600083015250602082015167ffffffffffffffff811115611607576116066114fd565b5b61161384828501611544565b6020830152506040611627848285016113c6565b604083015250606061163b84828501611582565b60608301525092915050565b600061165a611655846114c7565b610c3d565b9050808382526020820190506020840283018581111561167d5761167c6114f3565b5b835b818110156116c457805167ffffffffffffffff8111156116a2576116a1610bc2565b5b8086016116af8982611597565b8552602085019450505060208101905061167f565b5050509392505050565b600082601f8301126116e3576116e2610bc2565b5b81516116f3848260208601611647565b91505092915050565b60006020828403121561171257611711610b5a565b5b600082015167ffffffffffffffff8111156117305761172f610b5f565b5b61173c848285016116ce565b9150509291505056fea26469706673582212201d48926082b046ce0a5b741a926eefe8bb0873c1d992ea4a6c4210a133dbaae764736f6c634300080a0033 diff --git a/e2e/contracts/teststaking/TestStaking.json b/e2e/contracts/teststaking/TestStaking.json index e69de29bb2..6fde4261f5 100644 --- a/e2e/contracts/teststaking/TestStaking.json +++ b/e2e/contracts/teststaking/TestStaking.json @@ -0,0 +1,347 @@ +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_wzeta", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "validatorSrc", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "validatorDst", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MoveStake", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Stake", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "validator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Unstake", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "counter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositWZETA", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllValidators", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "operatorAddress", + "type": "string" + }, + { + "internalType": "string", + "name": "consensusPubKey", + "type": "string" + }, + { + "internalType": "bool", + "name": "jailed", + "type": "bool" + }, + { + "internalType": "enum BondStatus", + "name": "bondStatus", + "type": "uint8" + } + ], + "internalType": "struct Validator[]", + "name": "validators", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + } + ], + "name": "getShares", + "outputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validatorSrc", + "type": "string" + }, + { + "internalType": "string", + "name": "validatorDst", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "moveStake", + "outputs": [ + { + "internalType": "int64", + "name": "completionTime", + "type": "int64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stakeAndRevert", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stakeWithStateUpdate", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "string", + "name": "validator", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [ + { + "internalType": "int64", + "name": "completionTime", + "type": "int64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "withdrawWZETA", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bin": "608060405260666000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006003553480156200005757600080fd5b506040516200192d3803806200192d83398181016040528101906200007d919062000170565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050620001a2565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000138826200010b565b9050919050565b6200014a816200012b565b81146200015657600080fd5b50565b6000815190506200016a816200013f565b92915050565b60006020828403121562000189576200018862000106565b5b6000620001998482850162000159565b91505092915050565b61177b80620001b26000396000f3fe6080604052600436106100955760003560e01c806390b8436f1161005957806390b8436f1461018a5780639a0fb673146101c7578063bca8f527146101f0578063d11a93d01461022d578063f3513a371461026a5761009c565b80630d1b3daf1461009e5780632c5d24ae146100db57806357c6ea3e146100e557806361bc221a146101225780636be8916c1461014d5761009c565b3661009c57005b005b3480156100aa57600080fd5b506100c560048036038101906100c09190610d08565b610295565b6040516100d29190610d7d565b60405180910390f35b6100e361033c565b005b3480156100f157600080fd5b5061010c60048036038101906101079190610dc4565b61041b565b6040516101199190610e4f565b60405180910390f35b34801561012e57600080fd5b50610137610520565b6040516101449190610d7d565b60405180910390f35b34801561015957600080fd5b50610174600480360381019061016f9190610dc4565b610526565b6040516101819190610e85565b60405180910390f35b34801561019657600080fd5b506101b160048036038101906101ac9190610dc4565b61065c565b6040516101be9190610e85565b60405180910390f35b3480156101d357600080fd5b506101ee60048036038101906101e99190610ea0565b610761565b005b3480156101fc57600080fd5b5061021760048036038101906102129190610dc4565b61084b565b6040516102249190610e85565b60405180910390f35b34801561023957600080fd5b50610254600480360381019061024f9190610ecd565b6109ad565b6040516102619190610e4f565b60405180910390f35b34801561027657600080fd5b5061027f610ab5565b60405161028c91906111a6565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630d1b3daf84846040518363ffffffff1660e01b81526004016102f3929190611221565b602060405180830381865afa158015610310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103349190611266565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461039657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561040057600080fd5b505af1158015610414573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461047757600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357c6ea3e8585856040518463ffffffff1660e01b81526004016104d493929190611293565b6020604051808303816000875af11580156104f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051791906112fd565b90509392505050565b60035481565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461058257600080fd5b60016003546105919190611359565b60038190555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8686866040518463ffffffff1660e01b81526004016105f793929190611293565b6020604051808303816000875af1158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a91906113db565b9050600160035461064b9190611359565b600381905550809150509392505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106b857600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8585856040518463ffffffff1660e01b815260040161071593929190611293565b6020604051808303816000875af1158015610734573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075891906113db565b90509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107bb57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b81526004016108169190610d7d565b600060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108a757600080fd5b60016003546108b69190611359565b60038190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166390b8436f8585856040518463ffffffff1660e01b815260040161091993929190611293565b6020604051808303816000875af1158015610938573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095c91906113db565b50600160035461096c9190611359565b6003819055506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a490611454565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0957600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d11a93d0868686866040518563ffffffff1660e01b8152600401610a689493929190611474565b6020604051808303816000875af1158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906112fd565b9050949350505050565b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3513a376040518163ffffffff1660e01b8152600401600060405180830381865afa158015610b22573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610b4b91906116fc565b905090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b8f82610b64565b9050919050565b610b9f81610b84565b8114610baa57600080fd5b50565b600081359050610bbc81610b96565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610c1582610bcc565b810181811067ffffffffffffffff82111715610c3457610c33610bdd565b5b80604052505050565b6000610c47610b50565b9050610c538282610c0c565b919050565b600067ffffffffffffffff821115610c7357610c72610bdd565b5b610c7c82610bcc565b9050602081019050919050565b82818337600083830152505050565b6000610cab610ca684610c58565b610c3d565b905082815260208101848484011115610cc757610cc6610bc7565b5b610cd2848285610c89565b509392505050565b600082601f830112610cef57610cee610bc2565b5b8135610cff848260208601610c98565b91505092915050565b60008060408385031215610d1f57610d1e610b5a565b5b6000610d2d85828601610bad565b925050602083013567ffffffffffffffff811115610d4e57610d4d610b5f565b5b610d5a85828601610cda565b9150509250929050565b6000819050919050565b610d7781610d64565b82525050565b6000602082019050610d926000830184610d6e565b92915050565b610da181610d64565b8114610dac57600080fd5b50565b600081359050610dbe81610d98565b92915050565b600080600060608486031215610ddd57610ddc610b5a565b5b6000610deb86828701610bad565b935050602084013567ffffffffffffffff811115610e0c57610e0b610b5f565b5b610e1886828701610cda565b9250506040610e2986828701610daf565b9150509250925092565b60008160070b9050919050565b610e4981610e33565b82525050565b6000602082019050610e646000830184610e40565b92915050565b60008115159050919050565b610e7f81610e6a565b82525050565b6000602082019050610e9a6000830184610e76565b92915050565b600060208284031215610eb657610eb5610b5a565b5b6000610ec484828501610daf565b91505092915050565b60008060008060808587031215610ee757610ee6610b5a565b5b6000610ef587828801610bad565b945050602085013567ffffffffffffffff811115610f1657610f15610b5f565b5b610f2287828801610cda565b935050604085013567ffffffffffffffff811115610f4357610f42610b5f565b5b610f4f87828801610cda565b9250506060610f6087828801610daf565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610fd2578082015181840152602081019050610fb7565b83811115610fe1576000848401525b50505050565b6000610ff282610f98565b610ffc8185610fa3565b935061100c818560208601610fb4565b61101581610bcc565b840191505092915050565b61102981610e6a565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061106f5761106e61102f565b5b50565b60008190506110808261105e565b919050565b600061109082611072565b9050919050565b6110a081611085565b82525050565b600060808301600083015184820360008601526110c38282610fe7565b915050602083015184820360208601526110dd8282610fe7565b91505060408301516110f26040860182611020565b5060608301516111056060860182611097565b508091505092915050565b600061111c83836110a6565b905092915050565b6000602082019050919050565b600061113c82610f6c565b6111468185610f77565b93508360208202850161115885610f88565b8060005b8581101561119457848403895281516111758582611110565b945061118083611124565b925060208a0199505060018101905061115c565b50829750879550505050505092915050565b600060208201905081810360008301526111c08184611131565b905092915050565b6111d181610b84565b82525050565b600082825260208201905092915050565b60006111f382610f98565b6111fd81856111d7565b935061120d818560208601610fb4565b61121681610bcc565b840191505092915050565b600060408201905061123660008301856111c8565b818103602083015261124881846111e8565b90509392505050565b60008151905061126081610d98565b92915050565b60006020828403121561127c5761127b610b5a565b5b600061128a84828501611251565b91505092915050565b60006060820190506112a860008301866111c8565b81810360208301526112ba81856111e8565b90506112c96040830184610d6e565b949350505050565b6112da81610e33565b81146112e557600080fd5b50565b6000815190506112f7816112d1565b92915050565b60006020828403121561131357611312610b5a565b5b6000611321848285016112e8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061136482610d64565b915061136f83610d64565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156113a4576113a361132a565b5b828201905092915050565b6113b881610e6a565b81146113c357600080fd5b50565b6000815190506113d5816113af565b92915050565b6000602082840312156113f1576113f0610b5a565b5b60006113ff848285016113c6565b91505092915050565b7f7465737472657665727400000000000000000000000000000000000000000000600082015250565b600061143e600a836111d7565b915061144982611408565b602082019050919050565b6000602082019050818103600083015261146d81611431565b9050919050565b600060808201905061148960008301876111c8565b818103602083015261149b81866111e8565b905081810360408301526114af81856111e8565b90506114be6060830184610d6e565b95945050505050565b600067ffffffffffffffff8211156114e2576114e1610bdd565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600061151561151084610c58565b610c3d565b90508281526020810184848401111561153157611530610bc7565b5b61153c848285610fb4565b509392505050565b600082601f83011261155957611558610bc2565b5b8151611569848260208601611502565b91505092915050565b6004811061157f57600080fd5b50565b60008151905061159181611572565b92915050565b6000608082840312156115ad576115ac6114f8565b5b6115b76080610c3d565b9050600082015167ffffffffffffffff8111156115d7576115d66114fd565b5b6115e384828501611544565b600083015250602082015167ffffffffffffffff811115611607576116066114fd565b5b61161384828501611544565b6020830152506040611627848285016113c6565b604083015250606061163b84828501611582565b60608301525092915050565b600061165a611655846114c7565b610c3d565b9050808382526020820190506020840283018581111561167d5761167c6114f3565b5b835b818110156116c457805167ffffffffffffffff8111156116a2576116a1610bc2565b5b8086016116af8982611597565b8552602085019450505060208101905061167f565b5050509392505050565b600082601f8301126116e3576116e2610bc2565b5b81516116f3848260208601611647565b91505092915050565b60006020828403121561171257611711610b5a565b5b600082015167ffffffffffffffff8111156117305761172f610b5f565b5b61173c848285016116ce565b9150509291505056fea26469706673582212201d48926082b046ce0a5b741a926eefe8bb0873c1d992ea4a6c4210a133dbaae764736f6c634300080a0033" +} From 3c44bb03a3eb839bfddca01f5f6750ebb682c60f Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 19:49:42 +0200 Subject: [PATCH 11/16] fmt --- .../test_v2_eth_withdraw_and_call_revert.go | 13 +++++++++---- e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go | 10 +++++++--- zetaclient/chains/evm/signer/v2_sign.go | 9 ++++++++- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/e2e/e2etests/test_v2_eth_withdraw_and_call_revert.go b/e2e/e2etests/test_v2_eth_withdraw_and_call_revert.go index b34819e998..bfa0172e7b 100644 --- a/e2e/e2etests/test_v2_eth_withdraw_and_call_revert.go +++ b/e2e/e2etests/test_v2_eth_withdraw_and_call_revert.go @@ -28,10 +28,15 @@ func TestV2ETHWithdrawAndCallRevert(r *runner.E2ERunner, args []string) { require.EqualValues(r, int64(0), balance.Int64()) // perform the withdraw - tx := r.V2ETHWithdrawAndArbitraryCall(r.TestDAppV2EVMAddr, amount, r.EncodeGasCall("revert"), gatewayzevm.RevertOptions{ - RevertAddress: revertAddress, - OnRevertGasLimit: big.NewInt(0), - }) + tx := r.V2ETHWithdrawAndArbitraryCall( + r.TestDAppV2EVMAddr, + amount, + r.EncodeGasCall("revert"), + gatewayzevm.RevertOptions{ + RevertAddress: revertAddress, + 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) diff --git a/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go b/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go index eb032154f8..4b722fc4ae 100644 --- a/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go +++ b/e2e/e2etests/test_v2_zevm_to_evm_arbitrary_call.go @@ -22,9 +22,13 @@ func TestV2ZEVMToEVMArbitraryCall(r *runner.E2ERunner, args []string) { r.ApproveETHZRC20(r.GatewayZEVMAddr) // perform the call - tx := r.V2ZEVMToEMVArbitraryCall(r.TestDAppV2EVMAddr, r.EncodeSimpleCall(payloadMessageEVMCall), gatewayzevm.RevertOptions{ - OnRevertGasLimit: big.NewInt(0), - }) + tx := r.V2ZEVMToEMVArbitraryCall( + r.TestDAppV2EVMAddr, + r.EncodeSimpleCall(payloadMessageEVMCall), + gatewayzevm.RevertOptions{ + OnRevertGasLimit: big.NewInt(0), + }, + ) // wait for the cctx to be mined cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) diff --git a/zetaclient/chains/evm/signer/v2_sign.go b/zetaclient/chains/evm/signer/v2_sign.go index 20793180e2..318e93b30a 100644 --- a/zetaclient/chains/evm/signer/v2_sign.go +++ b/zetaclient/chains/evm/signer/v2_sign.go @@ -164,7 +164,14 @@ func (signer *Signer) signERC20CustodyWithdrawAndCall( messageContext.Sender = common.Address{} } - data, err := erc20CustodyV2ABI.Pack("withdrawAndCall", messageContext, txData.to, txData.asset, txData.amount, txData.message) + data, err := erc20CustodyV2ABI.Pack( + "withdrawAndCall", + messageContext, + txData.to, + txData.asset, + txData.amount, + txData.message, + ) if err != nil { return nil, fmt.Errorf("withdraw pack error: %w", err) } From e59716c1cd03b6fc60b398400e936718fc9003b9 Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 19:52:18 +0200 Subject: [PATCH 12/16] changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 3f8206a9f1..94cfcbb2a4 100644 --- a/changelog.md +++ b/changelog.md @@ -19,6 +19,7 @@ * [2957](https://github.com/zeta-chain/node/pull/2957) - enable Bitcoin inscription support on testnet * [2896](https://github.com/zeta-chain/node/pull/2896) - add TON inbound observation * [2987](https://github.com/zeta-chain/node/pull/2987) - add non-EVM standard inbound memo package +* [3012](https://github.com/zeta-chain/node/pull/3012) - integrate authenticated calls erc20 smart contract functionality into protocol ### Refactor From d7fb759c764226e09914637586bad48c1620b09a Mon Sep 17 00:00:00 2001 From: skosito Date: Thu, 17 Oct 2024 20:28:17 +0200 Subject: [PATCH 13/16] fix test --- e2e/e2etests/test_v2_erc20_withdraw_and_call.go | 8 ++++---- pkg/contracts/testdappv2/TestDAppV2.bin | 2 +- pkg/contracts/testdappv2/TestDAppV2.go | 2 +- pkg/contracts/testdappv2/TestDAppV2.json | 2 +- pkg/contracts/testdappv2/TestDAppV2.sol | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go index 7c0f549305..4596ba12da 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go @@ -21,9 +21,9 @@ func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, _ []string) { r.ZEVMAuth.GasLimit = previousGasLimit }() - // called with 0 amount since onCall implementation is for TestDappV2 is simple and generic without decoding the payload and amount handling for erc20 - // and purpose of test is to verify that onCall is called with correct sender and payload - amount := big.NewInt(0) + // called with fixed amount without arg since onCall implementation is for TestDappV2 is simple and generic + // without decoding the payload and amount handling for erc20, purpose of test is to verify correct sender and payload are used + amount := big.NewInt(10000) r.AssertTestDAppEVMCalled(false, payloadMessageWithdrawAuthenticatedCallERC20, amount) @@ -43,7 +43,7 @@ func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, _ []string) { r.Logger.CCTX(*cctx, "withdraw") require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status) - r.AssertTestDAppEVMCalled(true, payloadMessageWithdrawAuthenticatedCallERC20, amount) + r.AssertTestDAppEVMCalled(true, payloadMessageWithdrawAuthenticatedCallERC20, big.NewInt(0)) // check expected sender was used senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage( diff --git a/pkg/contracts/testdappv2/TestDAppV2.bin b/pkg/contracts/testdappv2/TestDAppV2.bin index dd0765c4be..d5b99ed321 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.bin +++ b/pkg/contracts/testdappv2/TestDAppV2.bin @@ -1 +1 @@ -608060405234801561001057600080fd5b5061130b806100206000396000f3fe6080604052600436106100a05760003560e01c8063a799911f11610064578063a799911f146101a8578063c7a339a9146101c4578063c9028a36146101ed578063e2842ed714610216578063f592cbfb14610253578063f936ae8514610290576100a7565b806336e980a0146100ac5780634297a263146100d55780635bcfd61614610112578063676cc0541461013b5780639291fe261461016b576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100d360048036038101906100ce9190610c65565b6102cd565b005b3480156100e157600080fd5b506100fc60048036038101906100f79190610b80565b6102f7565b6040516101099190610fae565b60405180910390f35b34801561011e57600080fd5b5061013960048036038101906101349190610d57565b61030f565b005b61015560048036038101906101509190610cae565b610408565b6040516101629190610f8c565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d9190610c65565b61051d565b60405161019f9190610fae565b60405180910390f35b6101c260048036038101906101bd9190610c65565b610560565b005b3480156101d057600080fd5b506101eb60048036038101906101e69190610bf6565b610589565b005b3480156101f957600080fd5b50610214600480360381019061020f9190610d0e565b61064c565b005b34801561022257600080fd5b5061023d60048036038101906102389190610b80565b610786565b60405161024a9190610f71565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190610c65565b6107a6565b6040516102879190610f71565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190610bad565b6107f5565b6040516102c49190610f1f565b60405180910390f35b6102d68161083e565b156102e057600080fd5b6102e981610894565b6102f48160006108e8565b50565b60026020528060005260406000206000915090505481565b61035c82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061083e565b1561036657600080fd5b6103b382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b61040182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846108e8565b5050505050565b606061045783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6104a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346108e8565b8360000160208101906104b89190610b26565b600184846040516104ca929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060026000836040516020016105349190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105698161083e565b1561057357600080fd5b61057c81610894565b61058681346108e8565b50565b6105928161083e565b1561059c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105d993929190610f3a565b602060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b9190610b53565b61063457600080fd5b61063d81610894565b61064781836108e8565b505050565b6106a781806060019061065f9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6107048180606001906106ba9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006108e8565b8060000160208101906107179190610b26565b60018280606001906107299190610fc9565b604051610737929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016107bc9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161084f90610f0a565b60405160208183030381529060405280519060200120826040516020016108769190610ef3565b60405160208183030381529060405280519060200120149050919050565b6001600080836040516020016108aa9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060026000846040516020016108fe9190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b600061093d61093884611051565b61102c565b90508281526020810184848401111561095957610958611219565b5b610964848285611154565b509392505050565b600061097f61097a84611082565b61102c565b90508281526020810184848401111561099b5761099a611219565b5b6109a6848285611154565b509392505050565b6000813590506109bd81611262565b92915050565b6000815190506109d281611279565b92915050565b6000813590506109e781611290565b92915050565b60008083601f840112610a0357610a026111fb565b5b8235905067ffffffffffffffff811115610a2057610a1f6111f6565b5b602083019150836001820283011115610a3c57610a3b61120f565b5b9250929050565b600082601f830112610a5857610a576111fb565b5b8135610a6884826020860161092a565b91505092915050565b600081359050610a80816112a7565b92915050565b600082601f830112610a9b57610a9a6111fb565b5b8135610aab84826020860161096c565b91505092915050565b600060208284031215610aca57610ac9611205565b5b81905092915050565b600060808284031215610ae957610ae8611205565b5b81905092915050565b600060608284031215610b0857610b07611205565b5b81905092915050565b600081359050610b20816112be565b92915050565b600060208284031215610b3c57610b3b611223565b5b6000610b4a848285016109ae565b91505092915050565b600060208284031215610b6957610b68611223565b5b6000610b77848285016109c3565b91505092915050565b600060208284031215610b9657610b95611223565b5b6000610ba4848285016109d8565b91505092915050565b600060208284031215610bc357610bc2611223565b5b600082013567ffffffffffffffff811115610be157610be061121e565b5b610bed84828501610a43565b91505092915050565b600080600060608486031215610c0f57610c0e611223565b5b6000610c1d86828701610a71565b9350506020610c2e86828701610b11565b925050604084013567ffffffffffffffff811115610c4f57610c4e61121e565b5b610c5b86828701610a86565b9150509250925092565b600060208284031215610c7b57610c7a611223565b5b600082013567ffffffffffffffff811115610c9957610c9861121e565b5b610ca584828501610a86565b91505092915050565b600080600060408486031215610cc757610cc6611223565b5b6000610cd586828701610ab4565b935050602084013567ffffffffffffffff811115610cf657610cf561121e565b5b610d02868287016109ed565b92509250509250925092565b600060208284031215610d2457610d23611223565b5b600082013567ffffffffffffffff811115610d4257610d4161121e565b5b610d4e84828501610ad3565b91505092915050565b600080600080600060808688031215610d7357610d72611223565b5b600086013567ffffffffffffffff811115610d9157610d9061121e565b5b610d9d88828901610af2565b9550506020610dae888289016109ae565b9450506040610dbf88828901610b11565b935050606086013567ffffffffffffffff811115610de057610ddf61121e565b5b610dec888289016109ed565b92509250509295509295909350565b610e04816110f0565b82525050565b610e1381611102565b82525050565b6000610e2583856110da565b9350610e32838584611154565b82840190509392505050565b6000610e49826110b3565b610e5381856110c9565b9350610e63818560208601611163565b610e6c81611228565b840191505092915050565b6000610e82826110be565b610e8c81856110e5565b9350610e9c818560208601611163565b80840191505092915050565b6000610eb56006836110e5565b9150610ec082611239565b600682019050919050565b610ed48161114a565b82525050565b6000610ee7828486610e19565b91508190509392505050565b6000610eff8284610e77565b915081905092915050565b6000610f1582610ea8565b9150819050919050565b6000602082019050610f346000830184610dfb565b92915050565b6000606082019050610f4f6000830186610dfb565b610f5c6020830185610dfb565b610f696040830184610ecb565b949350505050565b6000602082019050610f866000830184610e0a565b92915050565b60006020820190508181036000830152610fa68184610e3e565b905092915050565b6000602082019050610fc36000830184610ecb565b92915050565b60008083356001602003843603038112610fe657610fe561120a565b5b80840192508235915067ffffffffffffffff82111561100857611007611200565b5b60208301925060018202360383131561102457611023611214565b5b509250929050565b6000611036611047565b90506110428282611196565b919050565b6000604051905090565b600067ffffffffffffffff82111561106c5761106b6111c7565b5b61107582611228565b9050602081019050919050565b600067ffffffffffffffff82111561109d5761109c6111c7565b5b6110a682611228565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b60006110fb8261112a565b9050919050565b60008115159050919050565b6000819050919050565b6000611123826110f0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611181578082015181840152602081019050611166565b83811115611190576000848401525b50505050565b61119f82611228565b810181811067ffffffffffffffff821117156111be576111bd6111c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61126b816110f0565b811461127657600080fd5b50565b61128281611102565b811461128d57600080fd5b50565b6112998161110e565b81146112a457600080fd5b50565b6112b081611118565b81146112bb57600080fd5b50565b6112c78161114a565b81146112d257600080fd5b5056fea2646970667358221220a288f2c4d965e7b02806d9d463d92916aa7690d64f540ee49223fe69640316ef64736f6c63430008070033 +608060405234801561001057600080fd5b5061130b806100206000396000f3fe6080604052600436106100a05760003560e01c8063a799911f11610064578063a799911f146101a8578063c7a339a9146101c4578063c9028a36146101ed578063e2842ed714610216578063f592cbfb14610253578063f936ae8514610290576100a7565b806336e980a0146100ac5780634297a263146100d55780635bcfd61614610112578063676cc0541461013b5780639291fe261461016b576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100d360048036038101906100ce9190610c65565b6102cd565b005b3480156100e157600080fd5b506100fc60048036038101906100f79190610b80565b6102f7565b6040516101099190610fae565b60405180910390f35b34801561011e57600080fd5b5061013960048036038101906101349190610d57565b61030f565b005b61015560048036038101906101509190610cae565b610408565b6040516101629190610f8c565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d9190610c65565b61051d565b60405161019f9190610fae565b60405180910390f35b6101c260048036038101906101bd9190610c65565b610560565b005b3480156101d057600080fd5b506101eb60048036038101906101e69190610bf6565b610589565b005b3480156101f957600080fd5b50610214600480360381019061020f9190610d0e565b61064c565b005b34801561022257600080fd5b5061023d60048036038101906102389190610b80565b610786565b60405161024a9190610f71565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190610c65565b6107a6565b6040516102879190610f71565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190610bad565b6107f5565b6040516102c49190610f1f565b60405180910390f35b6102d68161083e565b156102e057600080fd5b6102e981610894565b6102f48160006108e8565b50565b60026020528060005260406000206000915090505481565b61035c82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061083e565b1561036657600080fd5b6103b382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b61040182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846108e8565b5050505050565b606061045783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6104a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346108e8565b8360000160208101906104b89190610b26565b600184846040516104ca929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060026000836040516020016105349190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105698161083e565b1561057357600080fd5b61057c81610894565b61058681346108e8565b50565b6105928161083e565b1561059c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105d993929190610f3a565b602060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b9190610b53565b61063457600080fd5b61063d81610894565b61064781836108e8565b505050565b6106a781806060019061065f9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6107048180606001906106ba9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006108e8565b8060000160208101906107179190610b26565b60018280606001906107299190610fc9565b604051610737929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016107bc9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161084f90610f0a565b60405160208183030381529060405280519060200120826040516020016108769190610ef3565b60405160208183030381529060405280519060200120149050919050565b6001600080836040516020016108aa9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060026000846040516020016108fe9190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b600061093d61093884611051565b61102c565b90508281526020810184848401111561095957610958611219565b5b610964848285611154565b509392505050565b600061097f61097a84611082565b61102c565b90508281526020810184848401111561099b5761099a611219565b5b6109a6848285611154565b509392505050565b6000813590506109bd81611262565b92915050565b6000815190506109d281611279565b92915050565b6000813590506109e781611290565b92915050565b60008083601f840112610a0357610a026111fb565b5b8235905067ffffffffffffffff811115610a2057610a1f6111f6565b5b602083019150836001820283011115610a3c57610a3b61120f565b5b9250929050565b600082601f830112610a5857610a576111fb565b5b8135610a6884826020860161092a565b91505092915050565b600081359050610a80816112a7565b92915050565b600082601f830112610a9b57610a9a6111fb565b5b8135610aab84826020860161096c565b91505092915050565b600060208284031215610aca57610ac9611205565b5b81905092915050565b600060808284031215610ae957610ae8611205565b5b81905092915050565b600060608284031215610b0857610b07611205565b5b81905092915050565b600081359050610b20816112be565b92915050565b600060208284031215610b3c57610b3b611223565b5b6000610b4a848285016109ae565b91505092915050565b600060208284031215610b6957610b68611223565b5b6000610b77848285016109c3565b91505092915050565b600060208284031215610b9657610b95611223565b5b6000610ba4848285016109d8565b91505092915050565b600060208284031215610bc357610bc2611223565b5b600082013567ffffffffffffffff811115610be157610be061121e565b5b610bed84828501610a43565b91505092915050565b600080600060608486031215610c0f57610c0e611223565b5b6000610c1d86828701610a71565b9350506020610c2e86828701610b11565b925050604084013567ffffffffffffffff811115610c4f57610c4e61121e565b5b610c5b86828701610a86565b9150509250925092565b600060208284031215610c7b57610c7a611223565b5b600082013567ffffffffffffffff811115610c9957610c9861121e565b5b610ca584828501610a86565b91505092915050565b600080600060408486031215610cc757610cc6611223565b5b6000610cd586828701610ab4565b935050602084013567ffffffffffffffff811115610cf657610cf561121e565b5b610d02868287016109ed565b92509250509250925092565b600060208284031215610d2457610d23611223565b5b600082013567ffffffffffffffff811115610d4257610d4161121e565b5b610d4e84828501610ad3565b91505092915050565b600080600080600060808688031215610d7357610d72611223565b5b600086013567ffffffffffffffff811115610d9157610d9061121e565b5b610d9d88828901610af2565b9550506020610dae888289016109ae565b9450506040610dbf88828901610b11565b935050606086013567ffffffffffffffff811115610de057610ddf61121e565b5b610dec888289016109ed565b92509250509295509295909350565b610e04816110f0565b82525050565b610e1381611102565b82525050565b6000610e2583856110da565b9350610e32838584611154565b82840190509392505050565b6000610e49826110b3565b610e5381856110c9565b9350610e63818560208601611163565b610e6c81611228565b840191505092915050565b6000610e82826110be565b610e8c81856110e5565b9350610e9c818560208601611163565b80840191505092915050565b6000610eb56006836110e5565b9150610ec082611239565b600682019050919050565b610ed48161114a565b82525050565b6000610ee7828486610e19565b91508190509392505050565b6000610eff8284610e77565b915081905092915050565b6000610f1582610ea8565b9150819050919050565b6000602082019050610f346000830184610dfb565b92915050565b6000606082019050610f4f6000830186610dfb565b610f5c6020830185610dfb565b610f696040830184610ecb565b949350505050565b6000602082019050610f866000830184610e0a565b92915050565b60006020820190508181036000830152610fa68184610e3e565b905092915050565b6000602082019050610fc36000830184610ecb565b92915050565b60008083356001602003843603038112610fe657610fe561120a565b5b80840192508235915067ffffffffffffffff82111561100857611007611200565b5b60208301925060018202360383131561102457611023611214565b5b509250929050565b6000611036611047565b90506110428282611196565b919050565b6000604051905090565b600067ffffffffffffffff82111561106c5761106b6111c7565b5b61107582611228565b9050602081019050919050565b600067ffffffffffffffff82111561109d5761109c6111c7565b5b6110a682611228565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b60006110fb8261112a565b9050919050565b60008115159050919050565b6000819050919050565b6000611123826110f0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611181578082015181840152602081019050611166565b83811115611190576000848401525b50505050565b61119f82611228565b810181811067ffffffffffffffff821117156111be576111bd6111c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61126b816110f0565b811461127657600080fd5b50565b61128281611102565b811461128d57600080fd5b50565b6112998161110e565b81146112a457600080fd5b50565b6112b081611118565b81146112bb57600080fd5b50565b6112c78161114a565b81146112d257600080fd5b5056fea26469706673582212201f295f137d0ea146883fdaa6858baa14e4c467a843ff4e7829fd9df0d4c2aede64736f6c63430008070033 diff --git a/pkg/contracts/testdappv2/TestDAppV2.go b/pkg/contracts/testdappv2/TestDAppV2.go index fd7a77aa31..967c261e60 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.go +++ b/pkg/contracts/testdappv2/TestDAppV2.go @@ -52,7 +52,7 @@ 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\":\"onCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"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\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"simpleCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x608060405234801561001057600080fd5b5061130b806100206000396000f3fe6080604052600436106100a05760003560e01c8063a799911f11610064578063a799911f146101a8578063c7a339a9146101c4578063c9028a36146101ed578063e2842ed714610216578063f592cbfb14610253578063f936ae8514610290576100a7565b806336e980a0146100ac5780634297a263146100d55780635bcfd61614610112578063676cc0541461013b5780639291fe261461016b576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100d360048036038101906100ce9190610c65565b6102cd565b005b3480156100e157600080fd5b506100fc60048036038101906100f79190610b80565b6102f7565b6040516101099190610fae565b60405180910390f35b34801561011e57600080fd5b5061013960048036038101906101349190610d57565b61030f565b005b61015560048036038101906101509190610cae565b610408565b6040516101629190610f8c565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d9190610c65565b61051d565b60405161019f9190610fae565b60405180910390f35b6101c260048036038101906101bd9190610c65565b610560565b005b3480156101d057600080fd5b506101eb60048036038101906101e69190610bf6565b610589565b005b3480156101f957600080fd5b50610214600480360381019061020f9190610d0e565b61064c565b005b34801561022257600080fd5b5061023d60048036038101906102389190610b80565b610786565b60405161024a9190610f71565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190610c65565b6107a6565b6040516102879190610f71565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190610bad565b6107f5565b6040516102c49190610f1f565b60405180910390f35b6102d68161083e565b156102e057600080fd5b6102e981610894565b6102f48160006108e8565b50565b60026020528060005260406000206000915090505481565b61035c82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061083e565b1561036657600080fd5b6103b382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b61040182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846108e8565b5050505050565b606061045783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6104a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346108e8565b8360000160208101906104b89190610b26565b600184846040516104ca929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060026000836040516020016105349190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105698161083e565b1561057357600080fd5b61057c81610894565b61058681346108e8565b50565b6105928161083e565b1561059c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105d993929190610f3a565b602060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b9190610b53565b61063457600080fd5b61063d81610894565b61064781836108e8565b505050565b6106a781806060019061065f9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6107048180606001906106ba9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006108e8565b8060000160208101906107179190610b26565b60018280606001906107299190610fc9565b604051610737929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016107bc9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161084f90610f0a565b60405160208183030381529060405280519060200120826040516020016108769190610ef3565b60405160208183030381529060405280519060200120149050919050565b6001600080836040516020016108aa9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060026000846040516020016108fe9190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b600061093d61093884611051565b61102c565b90508281526020810184848401111561095957610958611219565b5b610964848285611154565b509392505050565b600061097f61097a84611082565b61102c565b90508281526020810184848401111561099b5761099a611219565b5b6109a6848285611154565b509392505050565b6000813590506109bd81611262565b92915050565b6000815190506109d281611279565b92915050565b6000813590506109e781611290565b92915050565b60008083601f840112610a0357610a026111fb565b5b8235905067ffffffffffffffff811115610a2057610a1f6111f6565b5b602083019150836001820283011115610a3c57610a3b61120f565b5b9250929050565b600082601f830112610a5857610a576111fb565b5b8135610a6884826020860161092a565b91505092915050565b600081359050610a80816112a7565b92915050565b600082601f830112610a9b57610a9a6111fb565b5b8135610aab84826020860161096c565b91505092915050565b600060208284031215610aca57610ac9611205565b5b81905092915050565b600060808284031215610ae957610ae8611205565b5b81905092915050565b600060608284031215610b0857610b07611205565b5b81905092915050565b600081359050610b20816112be565b92915050565b600060208284031215610b3c57610b3b611223565b5b6000610b4a848285016109ae565b91505092915050565b600060208284031215610b6957610b68611223565b5b6000610b77848285016109c3565b91505092915050565b600060208284031215610b9657610b95611223565b5b6000610ba4848285016109d8565b91505092915050565b600060208284031215610bc357610bc2611223565b5b600082013567ffffffffffffffff811115610be157610be061121e565b5b610bed84828501610a43565b91505092915050565b600080600060608486031215610c0f57610c0e611223565b5b6000610c1d86828701610a71565b9350506020610c2e86828701610b11565b925050604084013567ffffffffffffffff811115610c4f57610c4e61121e565b5b610c5b86828701610a86565b9150509250925092565b600060208284031215610c7b57610c7a611223565b5b600082013567ffffffffffffffff811115610c9957610c9861121e565b5b610ca584828501610a86565b91505092915050565b600080600060408486031215610cc757610cc6611223565b5b6000610cd586828701610ab4565b935050602084013567ffffffffffffffff811115610cf657610cf561121e565b5b610d02868287016109ed565b92509250509250925092565b600060208284031215610d2457610d23611223565b5b600082013567ffffffffffffffff811115610d4257610d4161121e565b5b610d4e84828501610ad3565b91505092915050565b600080600080600060808688031215610d7357610d72611223565b5b600086013567ffffffffffffffff811115610d9157610d9061121e565b5b610d9d88828901610af2565b9550506020610dae888289016109ae565b9450506040610dbf88828901610b11565b935050606086013567ffffffffffffffff811115610de057610ddf61121e565b5b610dec888289016109ed565b92509250509295509295909350565b610e04816110f0565b82525050565b610e1381611102565b82525050565b6000610e2583856110da565b9350610e32838584611154565b82840190509392505050565b6000610e49826110b3565b610e5381856110c9565b9350610e63818560208601611163565b610e6c81611228565b840191505092915050565b6000610e82826110be565b610e8c81856110e5565b9350610e9c818560208601611163565b80840191505092915050565b6000610eb56006836110e5565b9150610ec082611239565b600682019050919050565b610ed48161114a565b82525050565b6000610ee7828486610e19565b91508190509392505050565b6000610eff8284610e77565b915081905092915050565b6000610f1582610ea8565b9150819050919050565b6000602082019050610f346000830184610dfb565b92915050565b6000606082019050610f4f6000830186610dfb565b610f5c6020830185610dfb565b610f696040830184610ecb565b949350505050565b6000602082019050610f866000830184610e0a565b92915050565b60006020820190508181036000830152610fa68184610e3e565b905092915050565b6000602082019050610fc36000830184610ecb565b92915050565b60008083356001602003843603038112610fe657610fe561120a565b5b80840192508235915067ffffffffffffffff82111561100857611007611200565b5b60208301925060018202360383131561102457611023611214565b5b509250929050565b6000611036611047565b90506110428282611196565b919050565b6000604051905090565b600067ffffffffffffffff82111561106c5761106b6111c7565b5b61107582611228565b9050602081019050919050565b600067ffffffffffffffff82111561109d5761109c6111c7565b5b6110a682611228565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b60006110fb8261112a565b9050919050565b60008115159050919050565b6000819050919050565b6000611123826110f0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611181578082015181840152602081019050611166565b83811115611190576000848401525b50505050565b61119f82611228565b810181811067ffffffffffffffff821117156111be576111bd6111c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61126b816110f0565b811461127657600080fd5b50565b61128281611102565b811461128d57600080fd5b50565b6112998161110e565b81146112a457600080fd5b50565b6112b081611118565b81146112bb57600080fd5b50565b6112c78161114a565b81146112d257600080fd5b5056fea2646970667358221220a288f2c4d965e7b02806d9d463d92916aa7690d64f540ee49223fe69640316ef64736f6c63430008070033", + Bin: "0x608060405234801561001057600080fd5b5061130b806100206000396000f3fe6080604052600436106100a05760003560e01c8063a799911f11610064578063a799911f146101a8578063c7a339a9146101c4578063c9028a36146101ed578063e2842ed714610216578063f592cbfb14610253578063f936ae8514610290576100a7565b806336e980a0146100ac5780634297a263146100d55780635bcfd61614610112578063676cc0541461013b5780639291fe261461016b576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100d360048036038101906100ce9190610c65565b6102cd565b005b3480156100e157600080fd5b506100fc60048036038101906100f79190610b80565b6102f7565b6040516101099190610fae565b60405180910390f35b34801561011e57600080fd5b5061013960048036038101906101349190610d57565b61030f565b005b61015560048036038101906101509190610cae565b610408565b6040516101629190610f8c565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d9190610c65565b61051d565b60405161019f9190610fae565b60405180910390f35b6101c260048036038101906101bd9190610c65565b610560565b005b3480156101d057600080fd5b506101eb60048036038101906101e69190610bf6565b610589565b005b3480156101f957600080fd5b50610214600480360381019061020f9190610d0e565b61064c565b005b34801561022257600080fd5b5061023d60048036038101906102389190610b80565b610786565b60405161024a9190610f71565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190610c65565b6107a6565b6040516102879190610f71565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190610bad565b6107f5565b6040516102c49190610f1f565b60405180910390f35b6102d68161083e565b156102e057600080fd5b6102e981610894565b6102f48160006108e8565b50565b60026020528060005260406000206000915090505481565b61035c82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061083e565b1561036657600080fd5b6103b382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b61040182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846108e8565b5050505050565b606061045783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6104a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346108e8565b8360000160208101906104b89190610b26565b600184846040516104ca929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060026000836040516020016105349190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105698161083e565b1561057357600080fd5b61057c81610894565b61058681346108e8565b50565b6105928161083e565b1561059c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105d993929190610f3a565b602060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b9190610b53565b61063457600080fd5b61063d81610894565b61064781836108e8565b505050565b6106a781806060019061065f9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6107048180606001906106ba9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006108e8565b8060000160208101906107179190610b26565b60018280606001906107299190610fc9565b604051610737929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016107bc9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161084f90610f0a565b60405160208183030381529060405280519060200120826040516020016108769190610ef3565b60405160208183030381529060405280519060200120149050919050565b6001600080836040516020016108aa9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060026000846040516020016108fe9190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b600061093d61093884611051565b61102c565b90508281526020810184848401111561095957610958611219565b5b610964848285611154565b509392505050565b600061097f61097a84611082565b61102c565b90508281526020810184848401111561099b5761099a611219565b5b6109a6848285611154565b509392505050565b6000813590506109bd81611262565b92915050565b6000815190506109d281611279565b92915050565b6000813590506109e781611290565b92915050565b60008083601f840112610a0357610a026111fb565b5b8235905067ffffffffffffffff811115610a2057610a1f6111f6565b5b602083019150836001820283011115610a3c57610a3b61120f565b5b9250929050565b600082601f830112610a5857610a576111fb565b5b8135610a6884826020860161092a565b91505092915050565b600081359050610a80816112a7565b92915050565b600082601f830112610a9b57610a9a6111fb565b5b8135610aab84826020860161096c565b91505092915050565b600060208284031215610aca57610ac9611205565b5b81905092915050565b600060808284031215610ae957610ae8611205565b5b81905092915050565b600060608284031215610b0857610b07611205565b5b81905092915050565b600081359050610b20816112be565b92915050565b600060208284031215610b3c57610b3b611223565b5b6000610b4a848285016109ae565b91505092915050565b600060208284031215610b6957610b68611223565b5b6000610b77848285016109c3565b91505092915050565b600060208284031215610b9657610b95611223565b5b6000610ba4848285016109d8565b91505092915050565b600060208284031215610bc357610bc2611223565b5b600082013567ffffffffffffffff811115610be157610be061121e565b5b610bed84828501610a43565b91505092915050565b600080600060608486031215610c0f57610c0e611223565b5b6000610c1d86828701610a71565b9350506020610c2e86828701610b11565b925050604084013567ffffffffffffffff811115610c4f57610c4e61121e565b5b610c5b86828701610a86565b9150509250925092565b600060208284031215610c7b57610c7a611223565b5b600082013567ffffffffffffffff811115610c9957610c9861121e565b5b610ca584828501610a86565b91505092915050565b600080600060408486031215610cc757610cc6611223565b5b6000610cd586828701610ab4565b935050602084013567ffffffffffffffff811115610cf657610cf561121e565b5b610d02868287016109ed565b92509250509250925092565b600060208284031215610d2457610d23611223565b5b600082013567ffffffffffffffff811115610d4257610d4161121e565b5b610d4e84828501610ad3565b91505092915050565b600080600080600060808688031215610d7357610d72611223565b5b600086013567ffffffffffffffff811115610d9157610d9061121e565b5b610d9d88828901610af2565b9550506020610dae888289016109ae565b9450506040610dbf88828901610b11565b935050606086013567ffffffffffffffff811115610de057610ddf61121e565b5b610dec888289016109ed565b92509250509295509295909350565b610e04816110f0565b82525050565b610e1381611102565b82525050565b6000610e2583856110da565b9350610e32838584611154565b82840190509392505050565b6000610e49826110b3565b610e5381856110c9565b9350610e63818560208601611163565b610e6c81611228565b840191505092915050565b6000610e82826110be565b610e8c81856110e5565b9350610e9c818560208601611163565b80840191505092915050565b6000610eb56006836110e5565b9150610ec082611239565b600682019050919050565b610ed48161114a565b82525050565b6000610ee7828486610e19565b91508190509392505050565b6000610eff8284610e77565b915081905092915050565b6000610f1582610ea8565b9150819050919050565b6000602082019050610f346000830184610dfb565b92915050565b6000606082019050610f4f6000830186610dfb565b610f5c6020830185610dfb565b610f696040830184610ecb565b949350505050565b6000602082019050610f866000830184610e0a565b92915050565b60006020820190508181036000830152610fa68184610e3e565b905092915050565b6000602082019050610fc36000830184610ecb565b92915050565b60008083356001602003843603038112610fe657610fe561120a565b5b80840192508235915067ffffffffffffffff82111561100857611007611200565b5b60208301925060018202360383131561102457611023611214565b5b509250929050565b6000611036611047565b90506110428282611196565b919050565b6000604051905090565b600067ffffffffffffffff82111561106c5761106b6111c7565b5b61107582611228565b9050602081019050919050565b600067ffffffffffffffff82111561109d5761109c6111c7565b5b6110a682611228565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b60006110fb8261112a565b9050919050565b60008115159050919050565b6000819050919050565b6000611123826110f0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611181578082015181840152602081019050611166565b83811115611190576000848401525b50505050565b61119f82611228565b810181811067ffffffffffffffff821117156111be576111bd6111c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61126b816110f0565b811461127657600080fd5b50565b61128281611102565b811461128d57600080fd5b50565b6112998161110e565b81146112a457600080fd5b50565b6112b081611118565b81146112bb57600080fd5b50565b6112c78161114a565b81146112d257600080fd5b5056fea26469706673582212201f295f137d0ea146883fdaa6858baa14e4c467a843ff4e7829fd9df0d4c2aede64736f6c63430008070033", } // TestDAppV2ABI is the input ABI used to generate the binding from. diff --git a/pkg/contracts/testdappv2/TestDAppV2.json b/pkg/contracts/testdappv2/TestDAppV2.json index 479b3e150c..2ea4bd665d 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.json +++ b/pkg/contracts/testdappv2/TestDAppV2.json @@ -260,5 +260,5 @@ "type": "receive" } ], - "bin": "608060405234801561001057600080fd5b5061130b806100206000396000f3fe6080604052600436106100a05760003560e01c8063a799911f11610064578063a799911f146101a8578063c7a339a9146101c4578063c9028a36146101ed578063e2842ed714610216578063f592cbfb14610253578063f936ae8514610290576100a7565b806336e980a0146100ac5780634297a263146100d55780635bcfd61614610112578063676cc0541461013b5780639291fe261461016b576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100d360048036038101906100ce9190610c65565b6102cd565b005b3480156100e157600080fd5b506100fc60048036038101906100f79190610b80565b6102f7565b6040516101099190610fae565b60405180910390f35b34801561011e57600080fd5b5061013960048036038101906101349190610d57565b61030f565b005b61015560048036038101906101509190610cae565b610408565b6040516101629190610f8c565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d9190610c65565b61051d565b60405161019f9190610fae565b60405180910390f35b6101c260048036038101906101bd9190610c65565b610560565b005b3480156101d057600080fd5b506101eb60048036038101906101e69190610bf6565b610589565b005b3480156101f957600080fd5b50610214600480360381019061020f9190610d0e565b61064c565b005b34801561022257600080fd5b5061023d60048036038101906102389190610b80565b610786565b60405161024a9190610f71565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190610c65565b6107a6565b6040516102879190610f71565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190610bad565b6107f5565b6040516102c49190610f1f565b60405180910390f35b6102d68161083e565b156102e057600080fd5b6102e981610894565b6102f48160006108e8565b50565b60026020528060005260406000206000915090505481565b61035c82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061083e565b1561036657600080fd5b6103b382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b61040182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846108e8565b5050505050565b606061045783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6104a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346108e8565b8360000160208101906104b89190610b26565b600184846040516104ca929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060026000836040516020016105349190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105698161083e565b1561057357600080fd5b61057c81610894565b61058681346108e8565b50565b6105928161083e565b1561059c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105d993929190610f3a565b602060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b9190610b53565b61063457600080fd5b61063d81610894565b61064781836108e8565b505050565b6106a781806060019061065f9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6107048180606001906106ba9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006108e8565b8060000160208101906107179190610b26565b60018280606001906107299190610fc9565b604051610737929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016107bc9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161084f90610f0a565b60405160208183030381529060405280519060200120826040516020016108769190610ef3565b60405160208183030381529060405280519060200120149050919050565b6001600080836040516020016108aa9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060026000846040516020016108fe9190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b600061093d61093884611051565b61102c565b90508281526020810184848401111561095957610958611219565b5b610964848285611154565b509392505050565b600061097f61097a84611082565b61102c565b90508281526020810184848401111561099b5761099a611219565b5b6109a6848285611154565b509392505050565b6000813590506109bd81611262565b92915050565b6000815190506109d281611279565b92915050565b6000813590506109e781611290565b92915050565b60008083601f840112610a0357610a026111fb565b5b8235905067ffffffffffffffff811115610a2057610a1f6111f6565b5b602083019150836001820283011115610a3c57610a3b61120f565b5b9250929050565b600082601f830112610a5857610a576111fb565b5b8135610a6884826020860161092a565b91505092915050565b600081359050610a80816112a7565b92915050565b600082601f830112610a9b57610a9a6111fb565b5b8135610aab84826020860161096c565b91505092915050565b600060208284031215610aca57610ac9611205565b5b81905092915050565b600060808284031215610ae957610ae8611205565b5b81905092915050565b600060608284031215610b0857610b07611205565b5b81905092915050565b600081359050610b20816112be565b92915050565b600060208284031215610b3c57610b3b611223565b5b6000610b4a848285016109ae565b91505092915050565b600060208284031215610b6957610b68611223565b5b6000610b77848285016109c3565b91505092915050565b600060208284031215610b9657610b95611223565b5b6000610ba4848285016109d8565b91505092915050565b600060208284031215610bc357610bc2611223565b5b600082013567ffffffffffffffff811115610be157610be061121e565b5b610bed84828501610a43565b91505092915050565b600080600060608486031215610c0f57610c0e611223565b5b6000610c1d86828701610a71565b9350506020610c2e86828701610b11565b925050604084013567ffffffffffffffff811115610c4f57610c4e61121e565b5b610c5b86828701610a86565b9150509250925092565b600060208284031215610c7b57610c7a611223565b5b600082013567ffffffffffffffff811115610c9957610c9861121e565b5b610ca584828501610a86565b91505092915050565b600080600060408486031215610cc757610cc6611223565b5b6000610cd586828701610ab4565b935050602084013567ffffffffffffffff811115610cf657610cf561121e565b5b610d02868287016109ed565b92509250509250925092565b600060208284031215610d2457610d23611223565b5b600082013567ffffffffffffffff811115610d4257610d4161121e565b5b610d4e84828501610ad3565b91505092915050565b600080600080600060808688031215610d7357610d72611223565b5b600086013567ffffffffffffffff811115610d9157610d9061121e565b5b610d9d88828901610af2565b9550506020610dae888289016109ae565b9450506040610dbf88828901610b11565b935050606086013567ffffffffffffffff811115610de057610ddf61121e565b5b610dec888289016109ed565b92509250509295509295909350565b610e04816110f0565b82525050565b610e1381611102565b82525050565b6000610e2583856110da565b9350610e32838584611154565b82840190509392505050565b6000610e49826110b3565b610e5381856110c9565b9350610e63818560208601611163565b610e6c81611228565b840191505092915050565b6000610e82826110be565b610e8c81856110e5565b9350610e9c818560208601611163565b80840191505092915050565b6000610eb56006836110e5565b9150610ec082611239565b600682019050919050565b610ed48161114a565b82525050565b6000610ee7828486610e19565b91508190509392505050565b6000610eff8284610e77565b915081905092915050565b6000610f1582610ea8565b9150819050919050565b6000602082019050610f346000830184610dfb565b92915050565b6000606082019050610f4f6000830186610dfb565b610f5c6020830185610dfb565b610f696040830184610ecb565b949350505050565b6000602082019050610f866000830184610e0a565b92915050565b60006020820190508181036000830152610fa68184610e3e565b905092915050565b6000602082019050610fc36000830184610ecb565b92915050565b60008083356001602003843603038112610fe657610fe561120a565b5b80840192508235915067ffffffffffffffff82111561100857611007611200565b5b60208301925060018202360383131561102457611023611214565b5b509250929050565b6000611036611047565b90506110428282611196565b919050565b6000604051905090565b600067ffffffffffffffff82111561106c5761106b6111c7565b5b61107582611228565b9050602081019050919050565b600067ffffffffffffffff82111561109d5761109c6111c7565b5b6110a682611228565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b60006110fb8261112a565b9050919050565b60008115159050919050565b6000819050919050565b6000611123826110f0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611181578082015181840152602081019050611166565b83811115611190576000848401525b50505050565b61119f82611228565b810181811067ffffffffffffffff821117156111be576111bd6111c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61126b816110f0565b811461127657600080fd5b50565b61128281611102565b811461128d57600080fd5b50565b6112998161110e565b81146112a457600080fd5b50565b6112b081611118565b81146112bb57600080fd5b50565b6112c78161114a565b81146112d257600080fd5b5056fea2646970667358221220a288f2c4d965e7b02806d9d463d92916aa7690d64f540ee49223fe69640316ef64736f6c63430008070033" + "bin": "608060405234801561001057600080fd5b5061130b806100206000396000f3fe6080604052600436106100a05760003560e01c8063a799911f11610064578063a799911f146101a8578063c7a339a9146101c4578063c9028a36146101ed578063e2842ed714610216578063f592cbfb14610253578063f936ae8514610290576100a7565b806336e980a0146100ac5780634297a263146100d55780635bcfd61614610112578063676cc0541461013b5780639291fe261461016b576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100d360048036038101906100ce9190610c65565b6102cd565b005b3480156100e157600080fd5b506100fc60048036038101906100f79190610b80565b6102f7565b6040516101099190610fae565b60405180910390f35b34801561011e57600080fd5b5061013960048036038101906101349190610d57565b61030f565b005b61015560048036038101906101509190610cae565b610408565b6040516101629190610f8c565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d9190610c65565b61051d565b60405161019f9190610fae565b60405180910390f35b6101c260048036038101906101bd9190610c65565b610560565b005b3480156101d057600080fd5b506101eb60048036038101906101e69190610bf6565b610589565b005b3480156101f957600080fd5b50610214600480360381019061020f9190610d0e565b61064c565b005b34801561022257600080fd5b5061023d60048036038101906102389190610b80565b610786565b60405161024a9190610f71565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190610c65565b6107a6565b6040516102879190610f71565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b29190610bad565b6107f5565b6040516102c49190610f1f565b60405180910390f35b6102d68161083e565b156102e057600080fd5b6102e981610894565b6102f48160006108e8565b50565b60026020528060005260406000206000915090505481565b61035c82828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061083e565b1561036657600080fd5b6103b382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b61040182828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050846108e8565b5050505050565b606061045783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6104a583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050346108e8565b8360000160208101906104b89190610b26565b600184846040516104ca929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509392505050565b600060026000836040516020016105349190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b6105698161083e565b1561057357600080fd5b61057c81610894565b61058681346108e8565b50565b6105928161083e565b1561059c57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016105d993929190610f3a565b602060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b9190610b53565b61063457600080fd5b61063d81610894565b61064781836108e8565b505050565b6106a781806060019061065f9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610894565b6107048180606001906106ba9190610fc9565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006108e8565b8060000160208101906107179190610b26565b60018280606001906107299190610fc9565b604051610737929190610eda565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000836040516020016107bc9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6001818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060405160200161084f90610f0a565b60405160208183030381529060405280519060200120826040516020016108769190610ef3565b60405160208183030381529060405280519060200120149050919050565b6001600080836040516020016108aa9190610ef3565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b8060026000846040516020016108fe9190610ef3565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b600061093d61093884611051565b61102c565b90508281526020810184848401111561095957610958611219565b5b610964848285611154565b509392505050565b600061097f61097a84611082565b61102c565b90508281526020810184848401111561099b5761099a611219565b5b6109a6848285611154565b509392505050565b6000813590506109bd81611262565b92915050565b6000815190506109d281611279565b92915050565b6000813590506109e781611290565b92915050565b60008083601f840112610a0357610a026111fb565b5b8235905067ffffffffffffffff811115610a2057610a1f6111f6565b5b602083019150836001820283011115610a3c57610a3b61120f565b5b9250929050565b600082601f830112610a5857610a576111fb565b5b8135610a6884826020860161092a565b91505092915050565b600081359050610a80816112a7565b92915050565b600082601f830112610a9b57610a9a6111fb565b5b8135610aab84826020860161096c565b91505092915050565b600060208284031215610aca57610ac9611205565b5b81905092915050565b600060808284031215610ae957610ae8611205565b5b81905092915050565b600060608284031215610b0857610b07611205565b5b81905092915050565b600081359050610b20816112be565b92915050565b600060208284031215610b3c57610b3b611223565b5b6000610b4a848285016109ae565b91505092915050565b600060208284031215610b6957610b68611223565b5b6000610b77848285016109c3565b91505092915050565b600060208284031215610b9657610b95611223565b5b6000610ba4848285016109d8565b91505092915050565b600060208284031215610bc357610bc2611223565b5b600082013567ffffffffffffffff811115610be157610be061121e565b5b610bed84828501610a43565b91505092915050565b600080600060608486031215610c0f57610c0e611223565b5b6000610c1d86828701610a71565b9350506020610c2e86828701610b11565b925050604084013567ffffffffffffffff811115610c4f57610c4e61121e565b5b610c5b86828701610a86565b9150509250925092565b600060208284031215610c7b57610c7a611223565b5b600082013567ffffffffffffffff811115610c9957610c9861121e565b5b610ca584828501610a86565b91505092915050565b600080600060408486031215610cc757610cc6611223565b5b6000610cd586828701610ab4565b935050602084013567ffffffffffffffff811115610cf657610cf561121e565b5b610d02868287016109ed565b92509250509250925092565b600060208284031215610d2457610d23611223565b5b600082013567ffffffffffffffff811115610d4257610d4161121e565b5b610d4e84828501610ad3565b91505092915050565b600080600080600060808688031215610d7357610d72611223565b5b600086013567ffffffffffffffff811115610d9157610d9061121e565b5b610d9d88828901610af2565b9550506020610dae888289016109ae565b9450506040610dbf88828901610b11565b935050606086013567ffffffffffffffff811115610de057610ddf61121e565b5b610dec888289016109ed565b92509250509295509295909350565b610e04816110f0565b82525050565b610e1381611102565b82525050565b6000610e2583856110da565b9350610e32838584611154565b82840190509392505050565b6000610e49826110b3565b610e5381856110c9565b9350610e63818560208601611163565b610e6c81611228565b840191505092915050565b6000610e82826110be565b610e8c81856110e5565b9350610e9c818560208601611163565b80840191505092915050565b6000610eb56006836110e5565b9150610ec082611239565b600682019050919050565b610ed48161114a565b82525050565b6000610ee7828486610e19565b91508190509392505050565b6000610eff8284610e77565b915081905092915050565b6000610f1582610ea8565b9150819050919050565b6000602082019050610f346000830184610dfb565b92915050565b6000606082019050610f4f6000830186610dfb565b610f5c6020830185610dfb565b610f696040830184610ecb565b949350505050565b6000602082019050610f866000830184610e0a565b92915050565b60006020820190508181036000830152610fa68184610e3e565b905092915050565b6000602082019050610fc36000830184610ecb565b92915050565b60008083356001602003843603038112610fe657610fe561120a565b5b80840192508235915067ffffffffffffffff82111561100857611007611200565b5b60208301925060018202360383131561102457611023611214565b5b509250929050565b6000611036611047565b90506110428282611196565b919050565b6000604051905090565b600067ffffffffffffffff82111561106c5761106b6111c7565b5b61107582611228565b9050602081019050919050565b600067ffffffffffffffff82111561109d5761109c6111c7565b5b6110a682611228565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b60006110fb8261112a565b9050919050565b60008115159050919050565b6000819050919050565b6000611123826110f0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611181578082015181840152602081019050611166565b83811115611190576000848401525b50505050565b61119f82611228565b810181811067ffffffffffffffff821117156111be576111bd6111c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b61126b816110f0565b811461127657600080fd5b50565b61128281611102565b811461128d57600080fd5b50565b6112998161110e565b81146112a457600080fd5b50565b6112b081611118565b81146112bb57600080fd5b50565b6112c78161114a565b81146112d257600080fd5b5056fea26469706673582212201f295f137d0ea146883fdaa6858baa14e4c467a843ff4e7829fd9df0d4c2aede64736f6c63430008070033" } diff --git a/pkg/contracts/testdappv2/TestDAppV2.sol b/pkg/contracts/testdappv2/TestDAppV2.sol index 4b3c3bdf33..c460c87025 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.sol +++ b/pkg/contracts/testdappv2/TestDAppV2.sol @@ -103,6 +103,7 @@ contract TestDAppV2 { senderWithMessage[revertContext.revertMessage] = revertContext.sender; } + // Callable interface function onCall(MessageContext calldata messageContext, bytes calldata message) external payable returns (bytes memory) { setCalledWithMessage(string(message)); setAmountWithMessage(string(message), msg.value); From cba43938eeea1ccbb86064b1e3238666a719d46c Mon Sep 17 00:00:00 2001 From: skosito Date: Fri, 18 Oct 2024 01:09:41 +0200 Subject: [PATCH 14/16] PR comment --- zetaclient/chains/evm/signer/outbound_data.go | 28 +++++++++++++++++-- zetaclient/chains/evm/signer/v2_sign.go | 26 ++++++----------- zetaclient/chains/evm/signer/v2_signer.go | 4 +-- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/zetaclient/chains/evm/signer/outbound_data.go b/zetaclient/chains/evm/signer/outbound_data.go index 0cc65c19e2..4030d6b5bf 100644 --- a/zetaclient/chains/evm/signer/outbound_data.go +++ b/zetaclient/chains/evm/signer/outbound_data.go @@ -10,6 +10,7 @@ import ( ethcommon "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" "github.com/rs/zerolog" + "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayevm.sol" "github.com/zeta-chain/node/pkg/coin" "github.com/zeta-chain/node/x/crosschain/types" @@ -42,6 +43,9 @@ type OutboundData struct { // revertOptions field contains data detailing the revert options revertOptions types.RevertOptions + + // callOptions field determinenes if call is arbitrary or authenticated and contains gasLimit + callOptions *types.CallOptions } // NewOutboundData creates OutboundData from the given CCTX. @@ -67,14 +71,16 @@ func NewOutboundData( } var ( - to ethcommon.Address - toChainID *big.Int + to ethcommon.Address + toChainID *big.Int + callOptions *types.CallOptions ) // in protocol contract v2, receiver is always set in the outbound if cctx.ProtocolContractVersion == types.ProtocolContractVersion_V2 { to = ethcommon.HexToAddress(cctx.GetCurrentOutboundParam().Receiver) toChainID = big.NewInt(cctx.GetCurrentOutboundParam().ReceiverChainId) + callOptions = cctx.GetCurrentOutboundParam().CallOptions } else { // recipient + destination chain var skip bool @@ -140,9 +146,27 @@ func NewOutboundData( outboundParams: outboundParams, revertOptions: cctx.RevertOptions, + + callOptions: callOptions, }, false, nil } +func (o OutboundData) MessageContext() (gatewayevm.MessageContext, error) { + if o.callOptions == nil { + return gatewayevm.MessageContext{}, errors.New("call options not found") + } + // if sender is provided in messageContext call is authenticated and target is Callable.onCall + // otherwise, call is arbitrary + messageContext := gatewayevm.MessageContext{ + Sender: o.sender, + } + if o.callOptions.IsArbitraryCall { + messageContext.Sender = ethcommon.Address{} + } + + return messageContext, nil +} + func getCCTXIndex(cctx *types.CrossChainTx) ([32]byte, error) { // `0x` + `64 chars`. Two chars ranging `00...FF` represent one byte (64 chars = 32 bytes) if len(cctx.Index) != (2 + 64) { diff --git a/zetaclient/chains/evm/signer/v2_sign.go b/zetaclient/chains/evm/signer/v2_sign.go index 318e93b30a..443f304785 100644 --- a/zetaclient/chains/evm/signer/v2_sign.go +++ b/zetaclient/chains/evm/signer/v2_sign.go @@ -19,7 +19,6 @@ import ( // bytes calldata data func (signer *Signer) signGatewayExecute( ctx context.Context, - sender string, txData *OutboundData, ) (*ethtypes.Transaction, error) { gatewayABI, err := gatewayevm.GatewayEVMMetaData.GetAbi() @@ -27,17 +26,13 @@ func (signer *Signer) signGatewayExecute( return nil, errors.Wrap(err, "unable to get GatewayEVMMetaData ABI") } - var data []byte - - // if sender is provided in messageContext call is authenticated and target is Callable.onCall - // otherwise, call is arbitrary - messageContext := gatewayevm.MessageContext{ - Sender: common.HexToAddress(sender), - } - if txData.outboundParams.CallOptions.IsArbitraryCall { - messageContext.Sender = common.Address{} + messageContext, err := txData.MessageContext() + if err != nil { + return nil, err } + var data []byte + data, err = gatewayABI.Pack("execute", messageContext, txData.to, txData.message) if err != nil { return nil, fmt.Errorf("execute pack error: %w", err) @@ -147,7 +142,6 @@ func (signer *Signer) signERC20CustodyWithdraw( // bytes calldata data func (signer *Signer) signERC20CustodyWithdrawAndCall( ctx context.Context, - sender string, txData *OutboundData, ) (*ethtypes.Transaction, error) { erc20CustodyV2ABI, err := erc20custodyv2.ERC20CustodyMetaData.GetAbi() @@ -155,13 +149,9 @@ func (signer *Signer) signERC20CustodyWithdrawAndCall( return nil, errors.Wrap(err, "unable to get ERC20CustodyMetaData ABI") } - // if sender is provided in messageContext call is authenticated and target is Callable.onCall - // otherwise, call is arbitrary - messageContext := gatewayevm.MessageContext{ - Sender: common.HexToAddress(sender), - } - if txData.outboundParams.CallOptions.IsArbitraryCall { - messageContext.Sender = common.Address{} + messageContext, err := txData.MessageContext() + if err != nil { + return nil, err } data, err := erc20CustodyV2ABI.Pack( diff --git a/zetaclient/chains/evm/signer/v2_signer.go b/zetaclient/chains/evm/signer/v2_signer.go index 270c1aca12..664663cf0f 100644 --- a/zetaclient/chains/evm/signer/v2_signer.go +++ b/zetaclient/chains/evm/signer/v2_signer.go @@ -23,11 +23,11 @@ func (signer *Signer) SignOutboundFromCCTXV2( case evm.OutboundTypeERC20Withdraw, evm.OutboundTypeERC20WithdrawRevert: return signer.signERC20CustodyWithdraw(ctx, outboundData) case evm.OutboundTypeERC20WithdrawAndCall: - return signer.signERC20CustodyWithdrawAndCall(ctx, cctx.InboundParams.Sender, outboundData) + return signer.signERC20CustodyWithdrawAndCall(ctx, outboundData) 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, cctx.InboundParams.Sender, outboundData) + return signer.signGatewayExecute(ctx, outboundData) case evm.OutboundTypeGasWithdrawRevertAndCallOnRevert: return signer.signGatewayExecuteRevert(ctx, cctx.InboundParams.Sender, outboundData) case evm.OutboundTypeERC20WithdrawRevertAndCallOnRevert: From 57bfc5f06c5dc4f899c8e454aef68c9dda8e724a Mon Sep 17 00:00:00 2001 From: skosito Date: Fri, 18 Oct 2024 11:31:00 +0200 Subject: [PATCH 15/16] PR comment --- zetaclient/chains/evm/signer/outbound_data.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zetaclient/chains/evm/signer/outbound_data.go b/zetaclient/chains/evm/signer/outbound_data.go index 4030d6b5bf..0ed58c620a 100644 --- a/zetaclient/chains/evm/signer/outbound_data.go +++ b/zetaclient/chains/evm/signer/outbound_data.go @@ -45,7 +45,7 @@ type OutboundData struct { revertOptions types.RevertOptions // callOptions field determinenes if call is arbitrary or authenticated and contains gasLimit - callOptions *types.CallOptions + callOptions types.CallOptions } // NewOutboundData creates OutboundData from the given CCTX. @@ -147,12 +147,12 @@ func NewOutboundData( revertOptions: cctx.RevertOptions, - callOptions: callOptions, + callOptions: *callOptions, }, false, nil } func (o OutboundData) MessageContext() (gatewayevm.MessageContext, error) { - if o.callOptions == nil { + if o.callOptions == (types.CallOptions{}) { return gatewayevm.MessageContext{}, errors.New("call options not found") } // if sender is provided in messageContext call is authenticated and target is Callable.onCall From a2aecd08c9b0fc13d34e848ee417a7412257c3b6 Mon Sep 17 00:00:00 2001 From: skosito Date: Fri, 18 Oct 2024 12:05:40 +0200 Subject: [PATCH 16/16] fix test --- zetaclient/chains/evm/signer/outbound_data.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zetaclient/chains/evm/signer/outbound_data.go b/zetaclient/chains/evm/signer/outbound_data.go index 0ed58c620a..200ae1f70b 100644 --- a/zetaclient/chains/evm/signer/outbound_data.go +++ b/zetaclient/chains/evm/signer/outbound_data.go @@ -73,14 +73,14 @@ func NewOutboundData( var ( to ethcommon.Address toChainID *big.Int - callOptions *types.CallOptions + callOptions types.CallOptions ) // in protocol contract v2, receiver is always set in the outbound if cctx.ProtocolContractVersion == types.ProtocolContractVersion_V2 { to = ethcommon.HexToAddress(cctx.GetCurrentOutboundParam().Receiver) toChainID = big.NewInt(cctx.GetCurrentOutboundParam().ReceiverChainId) - callOptions = cctx.GetCurrentOutboundParam().CallOptions + callOptions = *cctx.GetCurrentOutboundParam().CallOptions } else { // recipient + destination chain var skip bool @@ -147,7 +147,7 @@ func NewOutboundData( revertOptions: cctx.RevertOptions, - callOptions: *callOptions, + callOptions: callOptions, }, false, nil }