From 9514ddd9fab4b8c50e717137f9e27a94c4afe346 Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Fri, 26 Jul 2024 11:55:21 +0300 Subject: [PATCH] - integrated the merged eth contracts --- bridges/ethMultiversX/bridgeExecutor.go | 4 +- bridges/ethMultiversX/bridgeExecutor_test.go | 20 +- bridges/ethMultiversX/interface.go | 2 +- clients/ethereum/client.go | 15 +- clients/ethereum/client_test.go | 17 +- clients/ethereum/contract/Bridge.go | 14 +- clients/ethereum/contract/ERC20Safe.go | 181 ++++- clients/ethereum/contract/SCExecProxy.go | 657 ------------------ cmd/bridge/config/config.toml | 1 - config/config.go | 1 - docker/docker-compose.yml | 2 +- factory/ethMultiversXBridgeComponents.go | 2 - .../relayers/ethToMultiversX_test.go | 13 +- .../slowTests/framework/bridgeComponents.go | 2 - .../slowTests/framework/ethereumHandler.go | 32 +- .../slowTests/framework/multiversxHandler.go | 2 +- .../relayers/slowTests/framework/testSetup.go | 1 - .../testdata/contracts/eth/Bridge.abi.json | 4 +- .../testdata/contracts/eth/ERC20Safe.abi.json | 57 +- .../testdata/contracts/eth/ERC20Safe.hex | 2 +- .../contracts/eth/SCExecProxy.abi.json | 195 ------ .../testdata/contracts/eth/SCExecProxy.hex | 1 - testsCommon/bridge/ethereumClientStub.go | 6 +- 23 files changed, 284 insertions(+), 947 deletions(-) delete mode 100644 clients/ethereum/contract/SCExecProxy.go delete mode 100644 integrationTests/relayers/slowTests/testdata/contracts/eth/SCExecProxy.abi.json delete mode 100644 integrationTests/relayers/slowTests/testdata/contracts/eth/SCExecProxy.hex diff --git a/bridges/ethMultiversX/bridgeExecutor.go b/bridges/ethMultiversX/bridgeExecutor.go index 04b93573..701401ae 100644 --- a/bridges/ethMultiversX/bridgeExecutor.go +++ b/bridges/ethMultiversX/bridgeExecutor.go @@ -478,9 +478,9 @@ func (executor *bridgeExecutor) addBatchSCMetadata(ctx context.Context, transfer return transfers, nil } -func (executor *bridgeExecutor) addMetadataToTransfer(transfer *clients.DepositTransfer, events []*contract.SCExecProxyERC20SCDeposit) *clients.DepositTransfer { +func (executor *bridgeExecutor) addMetadataToTransfer(transfer *clients.DepositTransfer, events []*contract.ERC20SafeERC20SCDeposit) *clients.DepositTransfer { for _, event := range events { - if event.DepositNonce == transfer.Nonce { + if event.DepositNonce.Uint64() == transfer.Nonce { transfer.Data = []byte(event.CallData) var err error transfer.DisplayableData, err = ConvertToDisplayableData(transfer.Data) diff --git a/bridges/ethMultiversX/bridgeExecutor_test.go b/bridges/ethMultiversX/bridgeExecutor_test.go index 7d310011..76707cf0 100644 --- a/bridges/ethMultiversX/bridgeExecutor_test.go +++ b/bridges/ethMultiversX/bridgeExecutor_test.go @@ -358,8 +358,8 @@ func TestEthToMultiversXBridgeExecutor_GetAndStoreBatchFromEthereum(t *testing.T assert.Equal(t, providedNonce, nonce) return expectedBatch, false, nil }, - GetBatchSCMetadataCalled: func(ctx context.Context, nonce uint64) ([]*contract.SCExecProxyERC20SCDeposit, error) { - return make([]*contract.SCExecProxyERC20SCDeposit, 0), nil + GetBatchSCMetadataCalled: func(ctx context.Context, nonce uint64) ([]*contract.ERC20SafeERC20SCDeposit, error) { + return make([]*contract.ERC20SafeERC20SCDeposit, 0), nil }, } executor, _ := NewBridgeExecutor(args) @@ -386,8 +386,8 @@ func TestEthToMultiversXBridgeExecutor_GetAndStoreBatchFromEthereum(t *testing.T assert.Equal(t, providedNonce, nonce) return expectedBatch, true, nil }, - GetBatchSCMetadataCalled: func(ctx context.Context, nonce uint64) ([]*contract.SCExecProxyERC20SCDeposit, error) { - return make([]*contract.SCExecProxyERC20SCDeposit, 0), nil + GetBatchSCMetadataCalled: func(ctx context.Context, nonce uint64) ([]*contract.ERC20SafeERC20SCDeposit, error) { + return make([]*contract.ERC20SafeERC20SCDeposit, 0), nil }, } executor, _ := NewBridgeExecutor(args) @@ -415,9 +415,9 @@ func TestEthToMultiversXBridgeExecutor_GetAndStoreBatchFromEthereum(t *testing.T assert.Equal(t, providedNonce, nonce) return expectedBatch, true, nil }, - GetBatchSCMetadataCalled: func(ctx context.Context, nonce uint64) ([]*contract.SCExecProxyERC20SCDeposit, error) { - return []*contract.SCExecProxyERC20SCDeposit{{ - DepositNonce: depositNonce, + GetBatchSCMetadataCalled: func(ctx context.Context, nonce uint64) ([]*contract.ERC20SafeERC20SCDeposit, error) { + return []*contract.ERC20SafeERC20SCDeposit{{ + DepositNonce: big.NewInt(0).SetUint64(depositNonce), CallData: depositData, }}, nil }, @@ -447,9 +447,9 @@ func TestEthToMultiversXBridgeExecutor_GetAndStoreBatchFromEthereum(t *testing.T assert.Equal(t, providedNonce, nonce) return expectedBatch, true, nil }, - GetBatchSCMetadataCalled: func(ctx context.Context, nonce uint64) ([]*contract.SCExecProxyERC20SCDeposit, error) { - return []*contract.SCExecProxyERC20SCDeposit{{ - DepositNonce: depositNonce, + GetBatchSCMetadataCalled: func(ctx context.Context, nonce uint64) ([]*contract.ERC20SafeERC20SCDeposit, error) { + return []*contract.ERC20SafeERC20SCDeposit{{ + DepositNonce: big.NewInt(0).SetUint64(depositNonce), CallData: depositData, }}, nil }, diff --git a/bridges/ethMultiversX/interface.go b/bridges/ethMultiversX/interface.go index 68b09600..8ebcaeed 100644 --- a/bridges/ethMultiversX/interface.go +++ b/bridges/ethMultiversX/interface.go @@ -53,7 +53,7 @@ type EthereumClient interface { GetTransactionsStatuses(ctx context.Context, batchId uint64) ([]byte, error) GetQuorumSize(ctx context.Context) (*big.Int, error) IsQuorumReached(ctx context.Context, msgHash common.Hash) (bool, error) - GetBatchSCMetadata(ctx context.Context, nonce uint64) ([]*contract.SCExecProxyERC20SCDeposit, error) + GetBatchSCMetadata(ctx context.Context, nonce uint64) ([]*contract.ERC20SafeERC20SCDeposit, error) CheckClientAvailability(ctx context.Context) error CheckRequiredBalance(ctx context.Context, erc20Address common.Address, value *big.Int) error TotalBalances(ctx context.Context, token common.Address) (*big.Int, error) diff --git a/clients/ethereum/client.go b/clients/ethereum/client.go index 45e40d39..ae9fccca 100644 --- a/clients/ethereum/client.go +++ b/clients/ethereum/client.go @@ -38,7 +38,6 @@ type ArgsEthereumClient struct { TokensMapper TokensMapper SignatureHolder SignaturesHolder SafeContractAddress common.Address - SCExecProxyAddress common.Address GasHandler GasHandler TransferGasLimitBase uint64 TransferGasLimitForEach uint64 @@ -56,7 +55,6 @@ type client struct { tokensMapper TokensMapper signatureHolder SignaturesHolder safeContractAddress common.Address - scExecProxyAddress common.Address gasHandler GasHandler transferGasLimitBase uint64 transferGasLimitForEach uint64 @@ -91,7 +89,6 @@ func NewEthereumClient(args ArgsEthereumClient) (*client, error) { tokensMapper: args.TokensMapper, signatureHolder: args.SignatureHolder, safeContractAddress: args.SafeContractAddress, - scExecProxyAddress: args.SCExecProxyAddress, gasHandler: args.GasHandler, transferGasLimitBase: args.TransferGasLimitBase, transferGasLimitForEach: args.TransferGasLimitForEach, @@ -204,14 +201,14 @@ func (c *client) GetBatch(ctx context.Context, nonce uint64) (*clients.TransferB } // GetBatchSCMetadata returns the emitted logs in a batch that hold metadata for SC execution on MVX -func (c *client) GetBatchSCMetadata(ctx context.Context, nonce uint64) ([]*contract.SCExecProxyERC20SCDeposit, error) { - scExecAbi, err := contract.SCExecProxyMetaData.GetAbi() +func (c *client) GetBatchSCMetadata(ctx context.Context, nonce uint64) ([]*contract.ERC20SafeERC20SCDeposit, error) { + scExecAbi, err := contract.ERC20SafeMetaData.GetAbi() if err != nil { return nil, err } query := ethereum.FilterQuery{ - Addresses: []common.Address{c.scExecProxyAddress}, + Addresses: []common.Address{c.safeContractAddress}, Topics: [][]common.Hash{ {scExecAbi.Events["ERC20SCDeposit"].ID}, {common.BytesToHash(new(big.Int).SetUint64(nonce).Bytes())}, @@ -223,16 +220,16 @@ func (c *client) GetBatchSCMetadata(ctx context.Context, nonce uint64) ([]*contr return nil, err } - depositEvents := make([]*contract.SCExecProxyERC20SCDeposit, 0) + depositEvents := make([]*contract.ERC20SafeERC20SCDeposit, 0) for _, vLog := range logs { - event := new(contract.SCExecProxyERC20SCDeposit) + event := new(contract.ERC20SafeERC20SCDeposit) err = scExecAbi.UnpackIntoInterface(event, "ERC20SCDeposit", vLog.Data) if err != nil { return nil, err } // Add this manually since UnpackIntoInterface only unpacks non-indexed arguments - event.BatchNonce = nonce + event.BatchId = big.NewInt(0).SetUint64(nonce) depositEvents = append(depositEvents, event) } diff --git a/clients/ethereum/client_test.go b/clients/ethereum/client_test.go index 02dd4cff..65073a20 100644 --- a/clients/ethereum/client_test.go +++ b/clients/ethereum/client_test.go @@ -25,6 +25,7 @@ import ( "github.com/multiversx/mx-chain-core-go/core/check" logger "github.com/multiversx/mx-chain-logger-go" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) var expectedAmounts = []*big.Int{big.NewInt(20), big.NewInt(40)} @@ -54,7 +55,6 @@ func createMockEthereumClientArgs() ArgsEthereumClient { }, SignatureHolder: &testsCommon.SignaturesHolderStub{}, SafeContractAddress: testsCommon.CreateRandomEthereumAddress(), - SCExecProxyAddress: testsCommon.CreateRandomEthereumAddress(), GasHandler: &testsCommon.GasHandlerStub{}, TransferGasLimitBase: 50, TransferGasLimitForEach: 20, @@ -1216,15 +1216,16 @@ func TestClient_GetBatchSCMetadata(t *testing.T) { }) t.Run("returns expected logs", func(t *testing.T) { - scExecAbi, _ := contract.SCExecProxyMetaData.GetAbi() - expectedEvent := &contract.SCExecProxyERC20SCDeposit{ - BatchNonce: 1, - DepositNonce: 1, + scExecAbi, _ := contract.ERC20SafeMetaData.GetAbi() + expectedEvent := &contract.ERC20SafeERC20SCDeposit{ + BatchId: big.NewInt(1), + DepositNonce: big.NewInt(2), CallData: "call_data_to_unpack", } eventInputs := scExecAbi.Events["ERC20SCDeposit"].Inputs.NonIndexed() - packedArgs, _ := eventInputs.Pack(expectedEvent.DepositNonce, expectedEvent.CallData) + packedArgs, err := eventInputs.Pack(expectedEvent.DepositNonce, expectedEvent.CallData) + require.Nil(t, err) args := createMockEthereumClientArgs() args.ClientWrapper = &bridgeTests.EthereumClientWrapperStub{ @@ -1237,11 +1238,11 @@ func TestClient_GetBatchSCMetadata(t *testing.T) { }, } c, _ := NewEthereumClient(args) - batch, err := c.GetBatchSCMetadata(context.Background(), expectedEvent.BatchNonce) + batch, err := c.GetBatchSCMetadata(context.Background(), expectedEvent.BatchId.Uint64()) assert.Nil(t, err) assert.Equal(t, 1, len(batch)) - assert.Equal(t, expectedEvent.BatchNonce, batch[0].BatchNonce) + assert.Equal(t, expectedEvent.BatchId, batch[0].BatchId) assert.Equal(t, expectedEvent.DepositNonce, batch[0].DepositNonce) assert.Equal(t, expectedEvent.CallData, batch[0].CallData) }) diff --git a/clients/ethereum/contract/Bridge.go b/clients/ethereum/contract/Bridge.go index 0fd79b2c..feec4ffc 100644 --- a/clients/ethereum/contract/Bridge.go +++ b/clients/ethereum/contract/Bridge.go @@ -49,7 +49,7 @@ type Deposit struct { // BridgeMetaData contains all meta data concerning the Bridge contract. var BridgeMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"board\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"initialQuorum\",\"type\":\"uint256\"},{\"internalType\":\"contractERC20Safe\",\"name\":\"erc20Safe\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminRoleTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isPause\",\"type\":\"bool\"}],\"name\":\"Pause\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"quorum\",\"type\":\"uint256\"}],\"name\":\"QuorumChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RelayerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RelayerRemoved\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addRelayer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchSettleBlockCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"crossTransferStatuses\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"createdBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"recipients\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"depositNonces\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"batchNonceMvx\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"executeTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"executedBatches\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonce\",\"type\":\"uint256\"}],\"name\":\"getBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"uint64\",\"name\":\"blockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastUpdatedBlockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"depositsCount\",\"type\":\"uint16\"}],\"internalType\":\"structBatch\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonce\",\"type\":\"uint256\"}],\"name\":\"getBatchDeposits\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"enumDepositStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"internalType\":\"structDeposit[]\",\"name\":\"\",\"type\":\"tuple[]\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRelayer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRelayers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRelayersCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonceMvx\",\"type\":\"uint256\"}],\"name\":\"getStatusesAfterExecution\",\"outputs\":[{\"internalType\":\"enumDepositStatus[]\",\"name\":\"\",\"type\":\"uint8[]\"},{\"internalType\":\"bool\",\"name\":\"isFinal\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isRelayer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"removeRelayer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRelayer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newBatchSettleLimit\",\"type\":\"uint8\"}],\"name\":\"setBatchSettleLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newQuorum\",\"type\":\"uint256\"}],\"name\":\"setQuorum\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonceMvx\",\"type\":\"uint256\"}],\"name\":\"wasBatchExecuted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"board\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"initialQuorum\",\"type\":\"uint256\"},{\"internalType\":\"contractERC20Safe\",\"name\":\"erc20Safe\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminRoleTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isPause\",\"type\":\"bool\"}],\"name\":\"Pause\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"quorum\",\"type\":\"uint256\"}],\"name\":\"QuorumChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RelayerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RelayerRemoved\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addRelayer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchSettleBlockCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"crossTransferStatuses\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"createdBlockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"recipients\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"depositNonces\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"batchNonceMvx\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"executeTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"executedBatches\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonce\",\"type\":\"uint256\"}],\"name\":\"getBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"uint64\",\"name\":\"blockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastUpdatedBlockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"depositsCount\",\"type\":\"uint16\"}],\"internalType\":\"structBatch\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"isBatchFinal\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonce\",\"type\":\"uint256\"}],\"name\":\"getBatchDeposits\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"enumDepositStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"internalType\":\"structDeposit[]\",\"name\":\"\",\"type\":\"tuple[]\"},{\"internalType\":\"bool\",\"name\":\"areDepositsFinal\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRelayer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRelayers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRelayersCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonceMvx\",\"type\":\"uint256\"}],\"name\":\"getStatusesAfterExecution\",\"outputs\":[{\"internalType\":\"enumDepositStatus[]\",\"name\":\"\",\"type\":\"uint8[]\"},{\"internalType\":\"bool\",\"name\":\"isFinal\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isRelayer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"removeRelayer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRelayer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newBatchSettleLimit\",\"type\":\"uint8\"}],\"name\":\"setBatchSettleLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newQuorum\",\"type\":\"uint256\"}],\"name\":\"setQuorum\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonceMvx\",\"type\":\"uint256\"}],\"name\":\"wasBatchExecuted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // BridgeABI is the input ABI used to generate the binding from. @@ -324,7 +324,7 @@ func (_Bridge *BridgeCallerSession) ExecutedBatches(arg0 *big.Int) (bool, error) // GetBatch is a free data retrieval call binding the contract method 0x5ac44282. // -// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool) +// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool isBatchFinal) func (_Bridge *BridgeCaller) GetBatch(opts *bind.CallOpts, batchNonce *big.Int) (Batch, bool, error) { var out []interface{} err := _Bridge.contract.Call(opts, &out, "getBatch", batchNonce) @@ -342,21 +342,21 @@ func (_Bridge *BridgeCaller) GetBatch(opts *bind.CallOpts, batchNonce *big.Int) // GetBatch is a free data retrieval call binding the contract method 0x5ac44282. // -// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool) +// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool isBatchFinal) func (_Bridge *BridgeSession) GetBatch(batchNonce *big.Int) (Batch, bool, error) { return _Bridge.Contract.GetBatch(&_Bridge.CallOpts, batchNonce) } // GetBatch is a free data retrieval call binding the contract method 0x5ac44282. // -// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool) +// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool isBatchFinal) func (_Bridge *BridgeCallerSession) GetBatch(batchNonce *big.Int) (Batch, bool, error) { return _Bridge.Contract.GetBatch(&_Bridge.CallOpts, batchNonce) } // GetBatchDeposits is a free data retrieval call binding the contract method 0x90924da7. // -// Solidity: function getBatchDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool) +// Solidity: function getBatchDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool areDepositsFinal) func (_Bridge *BridgeCaller) GetBatchDeposits(opts *bind.CallOpts, batchNonce *big.Int) ([]Deposit, bool, error) { var out []interface{} err := _Bridge.contract.Call(opts, &out, "getBatchDeposits", batchNonce) @@ -374,14 +374,14 @@ func (_Bridge *BridgeCaller) GetBatchDeposits(opts *bind.CallOpts, batchNonce *b // GetBatchDeposits is a free data retrieval call binding the contract method 0x90924da7. // -// Solidity: function getBatchDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool) +// Solidity: function getBatchDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool areDepositsFinal) func (_Bridge *BridgeSession) GetBatchDeposits(batchNonce *big.Int) ([]Deposit, bool, error) { return _Bridge.Contract.GetBatchDeposits(&_Bridge.CallOpts, batchNonce) } // GetBatchDeposits is a free data retrieval call binding the contract method 0x90924da7. // -// Solidity: function getBatchDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool) +// Solidity: function getBatchDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool areDepositsFinal) func (_Bridge *BridgeCallerSession) GetBatchDeposits(batchNonce *big.Int) ([]Deposit, bool, error) { return _Bridge.Contract.GetBatchDeposits(&_Bridge.CallOpts, batchNonce) } diff --git a/clients/ethereum/contract/ERC20Safe.go b/clients/ethereum/contract/ERC20Safe.go index a932deb8..6cab929f 100644 --- a/clients/ethereum/contract/ERC20Safe.go +++ b/clients/ethereum/contract/ERC20Safe.go @@ -31,7 +31,7 @@ var ( // ERC20SafeMetaData contains all meta data concerning the ERC20Safe contract. var ERC20SafeMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminRoleTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousBridge\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBridge\",\"type\":\"address\"}],\"name\":\"BridgeTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint112\",\"name\":\"depositNonce\",\"type\":\"uint112\"},{\"indexed\":false,\"internalType\":\"uint112\",\"name\":\"batchId\",\"type\":\"uint112\"}],\"name\":\"ERC20Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isPause\",\"type\":\"bool\"}],\"name\":\"Pause\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchBlockLimit\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"batchDeposits\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"enumDepositStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchSettleLimit\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchSize\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"batches\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"uint64\",\"name\":\"blockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastUpdatedBlockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"depositsCount\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchesCount\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"burnBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipientAddress\",\"type\":\"bytes32\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositsCount\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonce\",\"type\":\"uint256\"}],\"name\":\"getBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"uint64\",\"name\":\"blockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastUpdatedBlockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"depositsCount\",\"type\":\"uint16\"}],\"internalType\":\"structBatch\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonce\",\"type\":\"uint256\"}],\"name\":\"getDeposits\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"enumDepositStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"internalType\":\"structDeposit[]\",\"name\":\"\",\"type\":\"tuple[]\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenMaxLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenMinLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"initSupply\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAnyBatchInProgress\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isTokenWhitelisted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"mintBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"mintBurnTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nativeTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"recoverLostFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"removeTokenFromWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newBatchBlockLimit\",\"type\":\"uint8\"}],\"name\":\"setBatchBlockLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newBatchSettleLimit\",\"type\":\"uint8\"}],\"name\":\"setBatchSettleLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newBatchSize\",\"type\":\"uint16\"}],\"name\":\"setBatchSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBridge\",\"type\":\"address\"}],\"name\":\"setBridge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setTokenMaxLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setTokenMinLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenMaxLimits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenMinLimits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"totalBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipientAddress\",\"type\":\"address\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minimumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maximumAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"mintBurn\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"native\",\"type\":\"bool\"}],\"name\":\"whitelistToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"whitelistedTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminRoleTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousBridge\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBridge\",\"type\":\"address\"}],\"name\":\"BridgeTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint112\",\"name\":\"depositNonce\",\"type\":\"uint112\"},{\"indexed\":false,\"internalType\":\"uint112\",\"name\":\"batchId\",\"type\":\"uint112\"}],\"name\":\"ERC20Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint112\",\"name\":\"batchId\",\"type\":\"uint112\"},{\"indexed\":false,\"internalType\":\"uint112\",\"name\":\"depositNonce\",\"type\":\"uint112\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"callData\",\"type\":\"string\"}],\"name\":\"ERC20SCDeposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isPause\",\"type\":\"bool\"}],\"name\":\"Pause\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchBlockLimit\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"batchDeposits\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"enumDepositStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchSettleLimit\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchSize\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"batches\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"uint64\",\"name\":\"blockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastUpdatedBlockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"depositsCount\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchesCount\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"burnBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipientAddress\",\"type\":\"bytes32\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipientAddress\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"callData\",\"type\":\"string\"}],\"name\":\"depositWithSCExecution\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositsCount\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonce\",\"type\":\"uint256\"}],\"name\":\"getBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"uint64\",\"name\":\"blockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastUpdatedBlockNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"depositsCount\",\"type\":\"uint16\"}],\"internalType\":\"structBatch\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"isBatchFinal\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchNonce\",\"type\":\"uint256\"}],\"name\":\"getDeposits\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"nonce\",\"type\":\"uint112\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"enumDepositStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"internalType\":\"structDeposit[]\",\"name\":\"\",\"type\":\"tuple[]\"},{\"internalType\":\"bool\",\"name\":\"areDepositsFinal\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenMaxLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenMinLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"initSupply\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAnyBatchInProgress\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isTokenWhitelisted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"mintBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"mintBurnTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nativeTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"recoverLostFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"removeTokenFromWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newBatchBlockLimit\",\"type\":\"uint8\"}],\"name\":\"setBatchBlockLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newBatchSettleLimit\",\"type\":\"uint8\"}],\"name\":\"setBatchSettleLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newBatchSize\",\"type\":\"uint16\"}],\"name\":\"setBatchSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBridge\",\"type\":\"address\"}],\"name\":\"setBridge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setTokenMaxLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setTokenMinLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenMaxLimits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenMinLimits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"totalBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipientAddress\",\"type\":\"address\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minimumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maximumAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"mintBurn\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"native\",\"type\":\"bool\"}],\"name\":\"whitelistToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"whitelistedTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // ERC20SafeABI is the input ABI used to generate the binding from. @@ -550,7 +550,7 @@ func (_ERC20Safe *ERC20SafeCallerSession) DepositsCount() (uint64, error) { // GetBatch is a free data retrieval call binding the contract method 0x5ac44282. // -// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool) +// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool isBatchFinal) func (_ERC20Safe *ERC20SafeCaller) GetBatch(opts *bind.CallOpts, batchNonce *big.Int) (Batch, bool, error) { var out []interface{} err := _ERC20Safe.contract.Call(opts, &out, "getBatch", batchNonce) @@ -568,21 +568,21 @@ func (_ERC20Safe *ERC20SafeCaller) GetBatch(opts *bind.CallOpts, batchNonce *big // GetBatch is a free data retrieval call binding the contract method 0x5ac44282. // -// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool) +// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool isBatchFinal) func (_ERC20Safe *ERC20SafeSession) GetBatch(batchNonce *big.Int) (Batch, bool, error) { return _ERC20Safe.Contract.GetBatch(&_ERC20Safe.CallOpts, batchNonce) } // GetBatch is a free data retrieval call binding the contract method 0x5ac44282. // -// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool) +// Solidity: function getBatch(uint256 batchNonce) view returns((uint112,uint64,uint64,uint16), bool isBatchFinal) func (_ERC20Safe *ERC20SafeCallerSession) GetBatch(batchNonce *big.Int) (Batch, bool, error) { return _ERC20Safe.Contract.GetBatch(&_ERC20Safe.CallOpts, batchNonce) } // GetDeposits is a free data retrieval call binding the contract method 0x085c967f. // -// Solidity: function getDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool) +// Solidity: function getDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool areDepositsFinal) func (_ERC20Safe *ERC20SafeCaller) GetDeposits(opts *bind.CallOpts, batchNonce *big.Int) ([]Deposit, bool, error) { var out []interface{} err := _ERC20Safe.contract.Call(opts, &out, "getDeposits", batchNonce) @@ -600,14 +600,14 @@ func (_ERC20Safe *ERC20SafeCaller) GetDeposits(opts *bind.CallOpts, batchNonce * // GetDeposits is a free data retrieval call binding the contract method 0x085c967f. // -// Solidity: function getDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool) +// Solidity: function getDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool areDepositsFinal) func (_ERC20Safe *ERC20SafeSession) GetDeposits(batchNonce *big.Int) ([]Deposit, bool, error) { return _ERC20Safe.Contract.GetDeposits(&_ERC20Safe.CallOpts, batchNonce) } // GetDeposits is a free data retrieval call binding the contract method 0x085c967f. // -// Solidity: function getDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool) +// Solidity: function getDeposits(uint256 batchNonce) view returns((uint112,address,uint256,address,bytes32,uint8)[], bool areDepositsFinal) func (_ERC20Safe *ERC20SafeCallerSession) GetDeposits(batchNonce *big.Int) ([]Deposit, bool, error) { return _ERC20Safe.Contract.GetDeposits(&_ERC20Safe.CallOpts, batchNonce) } @@ -1005,6 +1005,27 @@ func (_ERC20Safe *ERC20SafeTransactorSession) Deposit(tokenAddress common.Addres return _ERC20Safe.Contract.Deposit(&_ERC20Safe.TransactOpts, tokenAddress, amount, recipientAddress) } +// DepositWithSCExecution is a paid mutator transaction binding the contract method 0xcd7271c5. +// +// Solidity: function depositWithSCExecution(address tokenAddress, uint256 amount, bytes32 recipientAddress, string callData) returns() +func (_ERC20Safe *ERC20SafeTransactor) DepositWithSCExecution(opts *bind.TransactOpts, tokenAddress common.Address, amount *big.Int, recipientAddress [32]byte, callData string) (*types.Transaction, error) { + return _ERC20Safe.contract.Transact(opts, "depositWithSCExecution", tokenAddress, amount, recipientAddress, callData) +} + +// DepositWithSCExecution is a paid mutator transaction binding the contract method 0xcd7271c5. +// +// Solidity: function depositWithSCExecution(address tokenAddress, uint256 amount, bytes32 recipientAddress, string callData) returns() +func (_ERC20Safe *ERC20SafeSession) DepositWithSCExecution(tokenAddress common.Address, amount *big.Int, recipientAddress [32]byte, callData string) (*types.Transaction, error) { + return _ERC20Safe.Contract.DepositWithSCExecution(&_ERC20Safe.TransactOpts, tokenAddress, amount, recipientAddress, callData) +} + +// DepositWithSCExecution is a paid mutator transaction binding the contract method 0xcd7271c5. +// +// Solidity: function depositWithSCExecution(address tokenAddress, uint256 amount, bytes32 recipientAddress, string callData) returns() +func (_ERC20Safe *ERC20SafeTransactorSession) DepositWithSCExecution(tokenAddress common.Address, amount *big.Int, recipientAddress [32]byte, callData string) (*types.Transaction, error) { + return _ERC20Safe.Contract.DepositWithSCExecution(&_ERC20Safe.TransactOpts, tokenAddress, amount, recipientAddress, callData) +} + // InitSupply is a paid mutator transaction binding the contract method 0x4013c89c. // // Solidity: function initSupply(address tokenAddress, uint256 amount) returns() @@ -1761,6 +1782,152 @@ func (_ERC20Safe *ERC20SafeFilterer) ParseERC20Deposit(log types.Log) (*ERC20Saf return event, nil } +// ERC20SafeERC20SCDepositIterator is returned from FilterERC20SCDeposit and is used to iterate over the raw logs and unpacked data for ERC20SCDeposit events raised by the ERC20Safe contract. +type ERC20SafeERC20SCDepositIterator struct { + Event *ERC20SafeERC20SCDeposit // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SafeERC20SCDepositIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SafeERC20SCDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SafeERC20SCDeposit) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SafeERC20SCDepositIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SafeERC20SCDepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SafeERC20SCDeposit represents a ERC20SCDeposit event raised by the ERC20Safe contract. +type ERC20SafeERC20SCDeposit struct { + BatchId *big.Int + DepositNonce *big.Int + CallData string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterERC20SCDeposit is a free log retrieval operation binding the contract event 0x527e633d8513f28e14b16d38843a6e5c1c9db79ecb610ef26e171e836f93d9a2. +// +// Solidity: event ERC20SCDeposit(uint112 indexed batchId, uint112 depositNonce, string callData) +func (_ERC20Safe *ERC20SafeFilterer) FilterERC20SCDeposit(opts *bind.FilterOpts, batchId []*big.Int) (*ERC20SafeERC20SCDepositIterator, error) { + + var batchIdRule []interface{} + for _, batchIdItem := range batchId { + batchIdRule = append(batchIdRule, batchIdItem) + } + + logs, sub, err := _ERC20Safe.contract.FilterLogs(opts, "ERC20SCDeposit", batchIdRule) + if err != nil { + return nil, err + } + return &ERC20SafeERC20SCDepositIterator{contract: _ERC20Safe.contract, event: "ERC20SCDeposit", logs: logs, sub: sub}, nil +} + +// WatchERC20SCDeposit is a free log subscription operation binding the contract event 0x527e633d8513f28e14b16d38843a6e5c1c9db79ecb610ef26e171e836f93d9a2. +// +// Solidity: event ERC20SCDeposit(uint112 indexed batchId, uint112 depositNonce, string callData) +func (_ERC20Safe *ERC20SafeFilterer) WatchERC20SCDeposit(opts *bind.WatchOpts, sink chan<- *ERC20SafeERC20SCDeposit, batchId []*big.Int) (event.Subscription, error) { + + var batchIdRule []interface{} + for _, batchIdItem := range batchId { + batchIdRule = append(batchIdRule, batchIdItem) + } + + logs, sub, err := _ERC20Safe.contract.WatchLogs(opts, "ERC20SCDeposit", batchIdRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SafeERC20SCDeposit) + if err := _ERC20Safe.contract.UnpackLog(event, "ERC20SCDeposit", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseERC20SCDeposit is a log parse operation binding the contract event 0x527e633d8513f28e14b16d38843a6e5c1c9db79ecb610ef26e171e836f93d9a2. +// +// Solidity: event ERC20SCDeposit(uint112 indexed batchId, uint112 depositNonce, string callData) +func (_ERC20Safe *ERC20SafeFilterer) ParseERC20SCDeposit(log types.Log) (*ERC20SafeERC20SCDeposit, error) { + event := new(ERC20SafeERC20SCDeposit) + if err := _ERC20Safe.contract.UnpackLog(event, "ERC20SCDeposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // ERC20SafePauseIterator is returned from FilterPause and is used to iterate over the raw logs and unpacked data for Pause events raised by the ERC20Safe contract. type ERC20SafePauseIterator struct { Event *ERC20SafePause // Event containing the contract specifics and raw log diff --git a/clients/ethereum/contract/SCExecProxy.go b/clients/ethereum/contract/SCExecProxy.go deleted file mode 100644 index 27ebe959..00000000 --- a/clients/ethereum/contract/SCExecProxy.go +++ /dev/null @@ -1,657 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package contract - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// SCExecProxyMetaData contains all meta data concerning the SCExecProxy contract. -var SCExecProxyMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"contractERC20Safe\",\"name\":\"erc20Safe\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminRoleTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"batchNonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"callData\",\"type\":\"string\"}],\"name\":\"ERC20SCDeposit\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipientAddress\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"callData\",\"type\":\"string\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isSafePaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safe\",\"outputs\":[{\"internalType\":\"contractERC20Safe\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractERC20Safe\",\"name\":\"erc20Safe\",\"type\":\"address\"}],\"name\":\"setSafe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"transferAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// SCExecProxyABI is the input ABI used to generate the binding from. -// Deprecated: Use SCExecProxyMetaData.ABI instead. -var SCExecProxyABI = SCExecProxyMetaData.ABI - -// SCExecProxy is an auto generated Go binding around an Ethereum contract. -type SCExecProxy struct { - SCExecProxyCaller // Read-only binding to the contract - SCExecProxyTransactor // Write-only binding to the contract - SCExecProxyFilterer // Log filterer for contract events -} - -// SCExecProxyCaller is an auto generated read-only Go binding around an Ethereum contract. -type SCExecProxyCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SCExecProxyTransactor is an auto generated write-only Go binding around an Ethereum contract. -type SCExecProxyTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SCExecProxyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type SCExecProxyFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SCExecProxySession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type SCExecProxySession struct { - Contract *SCExecProxy // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SCExecProxyCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type SCExecProxyCallerSession struct { - Contract *SCExecProxyCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// SCExecProxyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type SCExecProxyTransactorSession struct { - Contract *SCExecProxyTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SCExecProxyRaw is an auto generated low-level Go binding around an Ethereum contract. -type SCExecProxyRaw struct { - Contract *SCExecProxy // Generic contract binding to access the raw methods on -} - -// SCExecProxyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type SCExecProxyCallerRaw struct { - Contract *SCExecProxyCaller // Generic read-only contract binding to access the raw methods on -} - -// SCExecProxyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type SCExecProxyTransactorRaw struct { - Contract *SCExecProxyTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewSCExecProxy creates a new instance of SCExecProxy, bound to a specific deployed contract. -func NewSCExecProxy(address common.Address, backend bind.ContractBackend) (*SCExecProxy, error) { - contract, err := bindSCExecProxy(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &SCExecProxy{SCExecProxyCaller: SCExecProxyCaller{contract: contract}, SCExecProxyTransactor: SCExecProxyTransactor{contract: contract}, SCExecProxyFilterer: SCExecProxyFilterer{contract: contract}}, nil -} - -// NewSCExecProxyCaller creates a new read-only instance of SCExecProxy, bound to a specific deployed contract. -func NewSCExecProxyCaller(address common.Address, caller bind.ContractCaller) (*SCExecProxyCaller, error) { - contract, err := bindSCExecProxy(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &SCExecProxyCaller{contract: contract}, nil -} - -// NewSCExecProxyTransactor creates a new write-only instance of SCExecProxy, bound to a specific deployed contract. -func NewSCExecProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*SCExecProxyTransactor, error) { - contract, err := bindSCExecProxy(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &SCExecProxyTransactor{contract: contract}, nil -} - -// NewSCExecProxyFilterer creates a new log filterer instance of SCExecProxy, bound to a specific deployed contract. -func NewSCExecProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*SCExecProxyFilterer, error) { - contract, err := bindSCExecProxy(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &SCExecProxyFilterer{contract: contract}, nil -} - -// bindSCExecProxy binds a generic wrapper to an already deployed contract. -func bindSCExecProxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := SCExecProxyMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SCExecProxy *SCExecProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _SCExecProxy.Contract.SCExecProxyCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SCExecProxy *SCExecProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SCExecProxy.Contract.SCExecProxyTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SCExecProxy *SCExecProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SCExecProxy.Contract.SCExecProxyTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SCExecProxy *SCExecProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _SCExecProxy.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SCExecProxy *SCExecProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SCExecProxy.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SCExecProxy *SCExecProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SCExecProxy.Contract.contract.Transact(opts, method, params...) -} - -// Admin is a free data retrieval call binding the contract method 0xf851a440. -// -// Solidity: function admin() view returns(address) -func (_SCExecProxy *SCExecProxyCaller) Admin(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _SCExecProxy.contract.Call(opts, &out, "admin") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Admin is a free data retrieval call binding the contract method 0xf851a440. -// -// Solidity: function admin() view returns(address) -func (_SCExecProxy *SCExecProxySession) Admin() (common.Address, error) { - return _SCExecProxy.Contract.Admin(&_SCExecProxy.CallOpts) -} - -// Admin is a free data retrieval call binding the contract method 0xf851a440. -// -// Solidity: function admin() view returns(address) -func (_SCExecProxy *SCExecProxyCallerSession) Admin() (common.Address, error) { - return _SCExecProxy.Contract.Admin(&_SCExecProxy.CallOpts) -} - -// IsSafePaused is a free data retrieval call binding the contract method 0xa0579640. -// -// Solidity: function isSafePaused() view returns(bool) -func (_SCExecProxy *SCExecProxyCaller) IsSafePaused(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _SCExecProxy.contract.Call(opts, &out, "isSafePaused") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsSafePaused is a free data retrieval call binding the contract method 0xa0579640. -// -// Solidity: function isSafePaused() view returns(bool) -func (_SCExecProxy *SCExecProxySession) IsSafePaused() (bool, error) { - return _SCExecProxy.Contract.IsSafePaused(&_SCExecProxy.CallOpts) -} - -// IsSafePaused is a free data retrieval call binding the contract method 0xa0579640. -// -// Solidity: function isSafePaused() view returns(bool) -func (_SCExecProxy *SCExecProxyCallerSession) IsSafePaused() (bool, error) { - return _SCExecProxy.Contract.IsSafePaused(&_SCExecProxy.CallOpts) -} - -// Safe is a free data retrieval call binding the contract method 0x186f0354. -// -// Solidity: function safe() view returns(address) -func (_SCExecProxy *SCExecProxyCaller) Safe(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _SCExecProxy.contract.Call(opts, &out, "safe") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Safe is a free data retrieval call binding the contract method 0x186f0354. -// -// Solidity: function safe() view returns(address) -func (_SCExecProxy *SCExecProxySession) Safe() (common.Address, error) { - return _SCExecProxy.Contract.Safe(&_SCExecProxy.CallOpts) -} - -// Safe is a free data retrieval call binding the contract method 0x186f0354. -// -// Solidity: function safe() view returns(address) -func (_SCExecProxy *SCExecProxyCallerSession) Safe() (common.Address, error) { - return _SCExecProxy.Contract.Safe(&_SCExecProxy.CallOpts) -} - -// Deposit is a paid mutator transaction binding the contract method 0x7583e9fd. -// -// Solidity: function deposit(address tokenAddress, uint256 amount, bytes32 recipientAddress, string callData) returns() -func (_SCExecProxy *SCExecProxyTransactor) Deposit(opts *bind.TransactOpts, tokenAddress common.Address, amount *big.Int, recipientAddress [32]byte, callData string) (*types.Transaction, error) { - return _SCExecProxy.contract.Transact(opts, "deposit", tokenAddress, amount, recipientAddress, callData) -} - -// Deposit is a paid mutator transaction binding the contract method 0x7583e9fd. -// -// Solidity: function deposit(address tokenAddress, uint256 amount, bytes32 recipientAddress, string callData) returns() -func (_SCExecProxy *SCExecProxySession) Deposit(tokenAddress common.Address, amount *big.Int, recipientAddress [32]byte, callData string) (*types.Transaction, error) { - return _SCExecProxy.Contract.Deposit(&_SCExecProxy.TransactOpts, tokenAddress, amount, recipientAddress, callData) -} - -// Deposit is a paid mutator transaction binding the contract method 0x7583e9fd. -// -// Solidity: function deposit(address tokenAddress, uint256 amount, bytes32 recipientAddress, string callData) returns() -func (_SCExecProxy *SCExecProxyTransactorSession) Deposit(tokenAddress common.Address, amount *big.Int, recipientAddress [32]byte, callData string) (*types.Transaction, error) { - return _SCExecProxy.Contract.Deposit(&_SCExecProxy.TransactOpts, tokenAddress, amount, recipientAddress, callData) -} - -// RenounceAdmin is a paid mutator transaction binding the contract method 0x8bad0c0a. -// -// Solidity: function renounceAdmin() returns() -func (_SCExecProxy *SCExecProxyTransactor) RenounceAdmin(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SCExecProxy.contract.Transact(opts, "renounceAdmin") -} - -// RenounceAdmin is a paid mutator transaction binding the contract method 0x8bad0c0a. -// -// Solidity: function renounceAdmin() returns() -func (_SCExecProxy *SCExecProxySession) RenounceAdmin() (*types.Transaction, error) { - return _SCExecProxy.Contract.RenounceAdmin(&_SCExecProxy.TransactOpts) -} - -// RenounceAdmin is a paid mutator transaction binding the contract method 0x8bad0c0a. -// -// Solidity: function renounceAdmin() returns() -func (_SCExecProxy *SCExecProxyTransactorSession) RenounceAdmin() (*types.Transaction, error) { - return _SCExecProxy.Contract.RenounceAdmin(&_SCExecProxy.TransactOpts) -} - -// SetSafe is a paid mutator transaction binding the contract method 0x5db0cb94. -// -// Solidity: function setSafe(address erc20Safe) returns() -func (_SCExecProxy *SCExecProxyTransactor) SetSafe(opts *bind.TransactOpts, erc20Safe common.Address) (*types.Transaction, error) { - return _SCExecProxy.contract.Transact(opts, "setSafe", erc20Safe) -} - -// SetSafe is a paid mutator transaction binding the contract method 0x5db0cb94. -// -// Solidity: function setSafe(address erc20Safe) returns() -func (_SCExecProxy *SCExecProxySession) SetSafe(erc20Safe common.Address) (*types.Transaction, error) { - return _SCExecProxy.Contract.SetSafe(&_SCExecProxy.TransactOpts, erc20Safe) -} - -// SetSafe is a paid mutator transaction binding the contract method 0x5db0cb94. -// -// Solidity: function setSafe(address erc20Safe) returns() -func (_SCExecProxy *SCExecProxyTransactorSession) SetSafe(erc20Safe common.Address) (*types.Transaction, error) { - return _SCExecProxy.Contract.SetSafe(&_SCExecProxy.TransactOpts, erc20Safe) -} - -// TransferAdmin is a paid mutator transaction binding the contract method 0x75829def. -// -// Solidity: function transferAdmin(address newAdmin) returns() -func (_SCExecProxy *SCExecProxyTransactor) TransferAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { - return _SCExecProxy.contract.Transact(opts, "transferAdmin", newAdmin) -} - -// TransferAdmin is a paid mutator transaction binding the contract method 0x75829def. -// -// Solidity: function transferAdmin(address newAdmin) returns() -func (_SCExecProxy *SCExecProxySession) TransferAdmin(newAdmin common.Address) (*types.Transaction, error) { - return _SCExecProxy.Contract.TransferAdmin(&_SCExecProxy.TransactOpts, newAdmin) -} - -// TransferAdmin is a paid mutator transaction binding the contract method 0x75829def. -// -// Solidity: function transferAdmin(address newAdmin) returns() -func (_SCExecProxy *SCExecProxyTransactorSession) TransferAdmin(newAdmin common.Address) (*types.Transaction, error) { - return _SCExecProxy.Contract.TransferAdmin(&_SCExecProxy.TransactOpts, newAdmin) -} - -// SCExecProxyAdminRoleTransferredIterator is returned from FilterAdminRoleTransferred and is used to iterate over the raw logs and unpacked data for AdminRoleTransferred events raised by the SCExecProxy contract. -type SCExecProxyAdminRoleTransferredIterator struct { - Event *SCExecProxyAdminRoleTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SCExecProxyAdminRoleTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SCExecProxyAdminRoleTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SCExecProxyAdminRoleTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SCExecProxyAdminRoleTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SCExecProxyAdminRoleTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SCExecProxyAdminRoleTransferred represents a AdminRoleTransferred event raised by the SCExecProxy contract. -type SCExecProxyAdminRoleTransferred struct { - PreviousAdmin common.Address - NewAdmin common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterAdminRoleTransferred is a free log retrieval operation binding the contract event 0xe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd. -// -// Solidity: event AdminRoleTransferred(address indexed previousAdmin, address indexed newAdmin) -func (_SCExecProxy *SCExecProxyFilterer) FilterAdminRoleTransferred(opts *bind.FilterOpts, previousAdmin []common.Address, newAdmin []common.Address) (*SCExecProxyAdminRoleTransferredIterator, error) { - - var previousAdminRule []interface{} - for _, previousAdminItem := range previousAdmin { - previousAdminRule = append(previousAdminRule, previousAdminItem) - } - var newAdminRule []interface{} - for _, newAdminItem := range newAdmin { - newAdminRule = append(newAdminRule, newAdminItem) - } - - logs, sub, err := _SCExecProxy.contract.FilterLogs(opts, "AdminRoleTransferred", previousAdminRule, newAdminRule) - if err != nil { - return nil, err - } - return &SCExecProxyAdminRoleTransferredIterator{contract: _SCExecProxy.contract, event: "AdminRoleTransferred", logs: logs, sub: sub}, nil -} - -// WatchAdminRoleTransferred is a free log subscription operation binding the contract event 0xe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd. -// -// Solidity: event AdminRoleTransferred(address indexed previousAdmin, address indexed newAdmin) -func (_SCExecProxy *SCExecProxyFilterer) WatchAdminRoleTransferred(opts *bind.WatchOpts, sink chan<- *SCExecProxyAdminRoleTransferred, previousAdmin []common.Address, newAdmin []common.Address) (event.Subscription, error) { - - var previousAdminRule []interface{} - for _, previousAdminItem := range previousAdmin { - previousAdminRule = append(previousAdminRule, previousAdminItem) - } - var newAdminRule []interface{} - for _, newAdminItem := range newAdmin { - newAdminRule = append(newAdminRule, newAdminItem) - } - - logs, sub, err := _SCExecProxy.contract.WatchLogs(opts, "AdminRoleTransferred", previousAdminRule, newAdminRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SCExecProxyAdminRoleTransferred) - if err := _SCExecProxy.contract.UnpackLog(event, "AdminRoleTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseAdminRoleTransferred is a log parse operation binding the contract event 0xe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd. -// -// Solidity: event AdminRoleTransferred(address indexed previousAdmin, address indexed newAdmin) -func (_SCExecProxy *SCExecProxyFilterer) ParseAdminRoleTransferred(log types.Log) (*SCExecProxyAdminRoleTransferred, error) { - event := new(SCExecProxyAdminRoleTransferred) - if err := _SCExecProxy.contract.UnpackLog(event, "AdminRoleTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// SCExecProxyERC20SCDepositIterator is returned from FilterERC20SCDeposit and is used to iterate over the raw logs and unpacked data for ERC20SCDeposit events raised by the SCExecProxy contract. -type SCExecProxyERC20SCDepositIterator struct { - Event *SCExecProxyERC20SCDeposit // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SCExecProxyERC20SCDepositIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SCExecProxyERC20SCDeposit) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SCExecProxyERC20SCDeposit) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SCExecProxyERC20SCDepositIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SCExecProxyERC20SCDepositIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SCExecProxyERC20SCDeposit represents a ERC20SCDeposit event raised by the SCExecProxy contract. -type SCExecProxyERC20SCDeposit struct { - BatchNonce uint64 - DepositNonce uint64 - CallData string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterERC20SCDeposit is a free log retrieval operation binding the contract event 0x78b7f0ae2aed1debc707b7fdfc571d40c238bf57db740c833098f00dfddb6e9b. -// -// Solidity: event ERC20SCDeposit(uint64 indexed batchNonce, uint64 depositNonce, string callData) -func (_SCExecProxy *SCExecProxyFilterer) FilterERC20SCDeposit(opts *bind.FilterOpts, batchNonce []uint64) (*SCExecProxyERC20SCDepositIterator, error) { - - var batchNonceRule []interface{} - for _, batchNonceItem := range batchNonce { - batchNonceRule = append(batchNonceRule, batchNonceItem) - } - - logs, sub, err := _SCExecProxy.contract.FilterLogs(opts, "ERC20SCDeposit", batchNonceRule) - if err != nil { - return nil, err - } - return &SCExecProxyERC20SCDepositIterator{contract: _SCExecProxy.contract, event: "ERC20SCDeposit", logs: logs, sub: sub}, nil -} - -// WatchERC20SCDeposit is a free log subscription operation binding the contract event 0x78b7f0ae2aed1debc707b7fdfc571d40c238bf57db740c833098f00dfddb6e9b. -// -// Solidity: event ERC20SCDeposit(uint64 indexed batchNonce, uint64 depositNonce, string callData) -func (_SCExecProxy *SCExecProxyFilterer) WatchERC20SCDeposit(opts *bind.WatchOpts, sink chan<- *SCExecProxyERC20SCDeposit, batchNonce []uint64) (event.Subscription, error) { - - var batchNonceRule []interface{} - for _, batchNonceItem := range batchNonce { - batchNonceRule = append(batchNonceRule, batchNonceItem) - } - - logs, sub, err := _SCExecProxy.contract.WatchLogs(opts, "ERC20SCDeposit", batchNonceRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SCExecProxyERC20SCDeposit) - if err := _SCExecProxy.contract.UnpackLog(event, "ERC20SCDeposit", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseERC20SCDeposit is a log parse operation binding the contract event 0x78b7f0ae2aed1debc707b7fdfc571d40c238bf57db740c833098f00dfddb6e9b. -// -// Solidity: event ERC20SCDeposit(uint64 indexed batchNonce, uint64 depositNonce, string callData) -func (_SCExecProxy *SCExecProxyFilterer) ParseERC20SCDeposit(log types.Log) (*SCExecProxyERC20SCDeposit, error) { - event := new(SCExecProxyERC20SCDeposit) - if err := _SCExecProxy.contract.UnpackLog(event, "ERC20SCDeposit", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/cmd/bridge/config/config.toml b/cmd/bridge/config/config.toml index ea187744..d64e9116 100644 --- a/cmd/bridge/config/config.toml +++ b/cmd/bridge/config/config.toml @@ -3,7 +3,6 @@ NetworkAddress = "http://127.0.0.1:8545" # a network address MultisigContractAddress = "3009d97FfeD62E57d444e552A9eDF9Ee6Bc8644c" # the eth address for the bridge contract SafeContractAddress = "A6504Cc508889bbDBd4B748aFf6EA6b5D0d2684c" - SCExecProxyAddress = "A6504Cc508889bbDBd4B748aFf6EA6b5D0d2684c" # eth address for bridge sc execution logic PrivateKeyFile = "keys/ethereum.sk" # the path to the file containing the relayer eth private key GasLimitBase = 350000 GasLimitForEach = 30000 diff --git a/config/config.go b/config/config.go index 08f3ecc4..08eda4c3 100644 --- a/config/config.go +++ b/config/config.go @@ -31,7 +31,6 @@ type EthereumConfig struct { NetworkAddress string MultisigContractAddress string SafeContractAddress string - SCExecProxyAddress string PrivateKeyFile string IntervalToResendTxsInSeconds uint64 GasLimitBase uint64 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 2c5113b8..a7b970f1 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.9" services: multiversx: - image: multiversx/chainsimulator:v1.7.12-fix1 + image: multiversx/chainsimulator:v1.7.13-fix2 ports: - 8085:8085 volumes: diff --git a/factory/ethMultiversXBridgeComponents.go b/factory/ethMultiversXBridgeComponents.go index dacff4ff..e084fe24 100644 --- a/factory/ethMultiversXBridgeComponents.go +++ b/factory/ethMultiversXBridgeComponents.go @@ -394,7 +394,6 @@ func (components *ethMultiversXBridgeComponents) createEthereumClient(args ArgsE } safeContractAddress := common.HexToAddress(ethereumConfigs.SafeContractAddress) - scExecProxyAddress := common.HexToAddress(ethereumConfigs.SCExecProxyAddress) ethClientLogId := components.evmCompatibleChain.EvmCompatibleChainClientLogId() argsEthClient := ethereum.ArgsEthereumClient{ @@ -407,7 +406,6 @@ func (components *ethMultiversXBridgeComponents) createEthereumClient(args ArgsE TokensMapper: tokensMapper, SignatureHolder: signaturesHolder, SafeContractAddress: safeContractAddress, - SCExecProxyAddress: scExecProxyAddress, GasHandler: gs, TransferGasLimitBase: ethereumConfigs.GasLimitBase, TransferGasLimitForEach: ethereumConfigs.GasLimitForEach, diff --git a/integrationTests/relayers/ethToMultiversX_test.go b/integrationTests/relayers/ethToMultiversX_test.go index a9422e15..0d9ac3fd 100644 --- a/integrationTests/relayers/ethToMultiversX_test.go +++ b/integrationTests/relayers/ethToMultiversX_test.go @@ -214,9 +214,7 @@ func TestRelayersShouldExecuteTransferFromEthToMultiversXHavingTxsWithSCcalls(t } func testRelayersShouldExecuteTransferFromEthToMultiversXHavingTxsWithSCcalls(t *testing.T, args argsForSCCallsTest) { - zero := big.NewInt(0) safeContractEthAddress := testsCommon.CreateRandomEthereumAddress() - scExecProxyEthAddress := testsCommon.CreateRandomEthereumAddress() token1Erc20 := testsCommon.CreateRandomEthereumAddress() ticker1 := "tck-000001" @@ -235,6 +233,8 @@ func testRelayersShouldExecuteTransferFromEthToMultiversXHavingTxsWithSCcalls(t destination2 := testsCommon.CreateRandomMultiversXAddress() depositor2 := testsCommon.CreateRandomEthereumAddress() + depositor3 := testsCommon.CreateRandomEthereumAddress() + value3 := big.NewInt(333333333) destination3Sc := testsCommon.CreateRandomMultiversXSCAddress() @@ -275,7 +275,7 @@ func testRelayersShouldExecuteTransferFromEthToMultiversXHavingTxsWithSCcalls(t Nonce: big.NewInt(int64(txNonceOnEthereum) + 3), TokenAddress: token3Erc20, Amount: value3, - Depositor: scExecProxyEthAddress, + Depositor: depositor3, Recipient: destination3Sc.AddressSlice(), Status: 0, }) @@ -302,11 +302,11 @@ func testRelayersShouldExecuteTransferFromEthToMultiversXHavingTxsWithSCcalls(t require.Equal(t, 2, len(q.Topics)) assert.Equal(t, expectedBatchNonceHash, q.Topics[1]) - scExecAbi, err := contract.SCExecProxyMetaData.GetAbi() + scExecAbi, err := contract.ERC20SafeMetaData.GetAbi() require.Nil(t, err) eventInputs := scExecAbi.Events["ERC20SCDeposit"].Inputs.NonIndexed() - packedArgs, err := eventInputs.Pack(txNonceOnEthereum+3, args.providedScCallData) + packedArgs, err := eventInputs.Pack(big.NewInt(0).SetUint64(txNonceOnEthereum+3), args.providedScCallData) require.Nil(t, err) scLog := types.Log{ @@ -346,7 +346,6 @@ func testRelayersShouldExecuteTransferFromEthToMultiversXHavingTxsWithSCcalls(t for i := 0; i < numRelayers; i++ { argsBridgeComponents := createMockBridgeComponentsArgs(i, messengers[i], multiversXChainMock, ethereumChainMock) argsBridgeComponents.Configs.GeneralConfig.Eth.SafeContractAddress = safeContractEthAddress.Hex() - argsBridgeComponents.Configs.GeneralConfig.Eth.SCExecProxyAddress = scExecProxyEthAddress.Hex() argsBridgeComponents.Erc20ContractsHolder = erc20ContractsHolder relayer, err := factory.NewEthMultiversXBridgeComponents(argsBridgeComponents) require.Nil(t, err) @@ -389,7 +388,7 @@ func testRelayersShouldExecuteTransferFromEthToMultiversXHavingTxsWithSCcalls(t assert.Equal(t, destination3Sc.AddressBytes(), transfer.Transfers[2].To) assert.Equal(t, hex.EncodeToString([]byte(ticker3)), transfer.Transfers[2].Token) assert.Equal(t, value3, transfer.Transfers[2].Amount) - assert.Equal(t, scExecProxyEthAddress, common.BytesToAddress(transfer.Transfers[2].From)) + assert.Equal(t, depositor3, common.BytesToAddress(transfer.Transfers[2].From)) assert.Equal(t, txNonceOnEthereum+3, transfer.Transfers[2].Nonce.Uint64()) assert.Equal(t, args.expectedScCallData, string(transfer.Transfers[2].Data)) } diff --git a/integrationTests/relayers/slowTests/framework/bridgeComponents.go b/integrationTests/relayers/slowTests/framework/bridgeComponents.go index d0be006e..5323c4e1 100644 --- a/integrationTests/relayers/slowTests/framework/bridgeComponents.go +++ b/integrationTests/relayers/slowTests/framework/bridgeComponents.go @@ -36,7 +36,6 @@ func NewBridgeComponents( erc20ContractsHolder ethereum.Erc20ContractsHolder, numRelayers int, ethSafeContractAddress string, - ethSCExecProxyAddress string, mvxSafeAddress *MvxAddress, mvxMultisigAddress *MvxAddress, ) *BridgeComponents { @@ -69,7 +68,6 @@ func NewBridgeComponents( MultiversXClientStatusHandler: &testsCommon.StatusHandlerStub{}, } argsBridgeComponents.Configs.GeneralConfig.Eth.SafeContractAddress = ethSafeContractAddress - argsBridgeComponents.Configs.GeneralConfig.Eth.SCExecProxyAddress = ethSCExecProxyAddress argsBridgeComponents.Erc20ContractsHolder = erc20ContractsHolder argsBridgeComponents.Configs.GeneralConfig.MultiversX.NetworkAddress = chainSimulator.GetNetworkAddress() argsBridgeComponents.Configs.GeneralConfig.MultiversX.SafeContractAddress = mvxSafeAddress.Bech32() diff --git a/integrationTests/relayers/slowTests/framework/ethereumHandler.go b/integrationTests/relayers/slowTests/framework/ethereumHandler.go index 33524930..286cbf67 100644 --- a/integrationTests/relayers/slowTests/framework/ethereumHandler.go +++ b/integrationTests/relayers/slowTests/framework/ethereumHandler.go @@ -37,8 +37,6 @@ const ( erc20SafeBytecode = "testdata/contracts/eth/ERC20Safe.hex" bridgeABI = "testdata/contracts/eth/Bridge.abi.json" bridgeBytecode = "testdata/contracts/eth/Bridge.hex" - scExecProxyABI = "testdata/contracts/eth/SCExecProxy.abi.json" - scExecProxyBytecode = "testdata/contracts/eth/SCExecProxy.hex" genericERC20ABI = "testdata/contracts/eth/GenericERC20.abi.json" genericERC20Bytecode = "testdata/contracts/eth/GenericERC20.hex" mintBurnERC20ABI = "testdata/contracts/eth/MintBurnERC20.abi.json" @@ -57,8 +55,6 @@ type EthereumHandler struct { ChainID *big.Int SafeAddress common.Address SafeContract *contract.ERC20Safe - SCProxyAddress common.Address - SCProxyContract *contract.SCExecProxy BridgeAddress common.Address BridgeContract *contract.Bridge Erc20ContractsHolder ethereum.Erc20ContractsHolder @@ -126,12 +122,6 @@ func (handler *EthereumHandler) DeployContracts(ctx context.Context) { handler.SimulatedChain.Commit() handler.checkEthTxResult(ctx, tx.Hash()) - // deploy exec-proxy - handler.SCProxyAddress = handler.DeployContract(ctx, scExecProxyABI, scExecProxyBytecode, handler.SafeAddress) - scProxyContract, err := contract.NewSCExecProxy(handler.SCProxyAddress, handler.SimulatedChain) - require.NoError(handler, err) - handler.SCProxyContract = scProxyContract - handler.EthChainWrapper, err = wrappers.NewEthereumChainWrapper(wrappers.ArgsEthereumChainWrapper{ StatusHandler: &testsCommon.StatusHandlerStub{}, MultiSigContract: handler.BridgeContract, @@ -342,27 +332,17 @@ func (handler *EthereumHandler) createDepositsOnEthereumForToken( require.NotNil(handler, token) require.NotNil(handler, token.EthErc20Contract) - allowanceValueForSafe := big.NewInt(0) - allowanceValueForScProxy := big.NewInt(0) + allowanceValue := big.NewInt(0) for _, operation := range params.TestOperations { if operation.ValueToTransferToMvx == nil { continue } - if len(operation.MvxSCCallMethod) > 0 { - allowanceValueForScProxy.Add(allowanceValueForScProxy, operation.ValueToTransferToMvx) - } else { - allowanceValueForSafe.Add(allowanceValueForSafe, operation.ValueToTransferToMvx) - } - } - if allowanceValueForSafe.Cmp(zeroValueBigInt) > 0 { - tx, err := token.EthErc20Contract.Approve(auth, handler.SafeAddress, allowanceValueForSafe) - require.NoError(handler, err) - handler.SimulatedChain.Commit() - handler.checkEthTxResult(ctx, tx.Hash()) + allowanceValue.Add(allowanceValue, operation.ValueToTransferToMvx) } - if allowanceValueForScProxy.Cmp(zeroValueBigInt) > 0 { - tx, err := token.EthErc20Contract.Approve(auth, handler.SCProxyAddress, allowanceValueForScProxy) + + if allowanceValue.Cmp(zeroValueBigInt) > 0 { + tx, err := token.EthErc20Contract.Approve(auth, handler.SafeAddress, allowanceValue) require.NoError(handler, err) handler.SimulatedChain.Commit() handler.checkEthTxResult(ctx, tx.Hash()) @@ -386,7 +366,7 @@ func (handler *EthereumHandler) createDepositsOnEthereumForToken( buff := codec.EncodeCallData(callData) - tx, err = handler.SCProxyContract.Deposit( + tx, err = handler.SafeContract.DepositWithSCExecution( auth, token.EthErc20Address, operation.ValueToTransferToMvx, diff --git a/integrationTests/relayers/slowTests/framework/multiversxHandler.go b/integrationTests/relayers/slowTests/framework/multiversxHandler.go index 9170724f..8464b163 100644 --- a/integrationTests/relayers/slowTests/framework/multiversxHandler.go +++ b/integrationTests/relayers/slowTests/framework/multiversxHandler.go @@ -14,7 +14,7 @@ import ( const ( minRelayerStake = "10000000000000000000" // 10 EGLD - esdtIssueCost = "5000000000000000000" // 5 EGLD + esdtIssueCost = "50000000000000000" // 0.05 EGLD emptyAddress = "erd1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gq4hu" esdtSystemSCAddress = "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u" slashAmount = "00" diff --git a/integrationTests/relayers/slowTests/framework/testSetup.go b/integrationTests/relayers/slowTests/framework/testSetup.go index fe29e79a..3901d40e 100644 --- a/integrationTests/relayers/slowTests/framework/testSetup.go +++ b/integrationTests/relayers/slowTests/framework/testSetup.go @@ -99,7 +99,6 @@ func (setup *TestSetup) StartRelayersAndScModule() { setup.EthereumHandler.Erc20ContractsHolder, NumRelayers, setup.EthereumHandler.SafeAddress.Hex(), - setup.EthereumHandler.SCProxyAddress.Hex(), setup.MultiversxHandler.SafeAddress, setup.MultiversxHandler.MultisigAddress, ) diff --git a/integrationTests/relayers/slowTests/testdata/contracts/eth/Bridge.abi.json b/integrationTests/relayers/slowTests/testdata/contracts/eth/Bridge.abi.json index 55b8a3d8..9e63ed76 100644 --- a/integrationTests/relayers/slowTests/testdata/contracts/eth/Bridge.abi.json +++ b/integrationTests/relayers/slowTests/testdata/contracts/eth/Bridge.abi.json @@ -257,7 +257,7 @@ }, { "internalType": "bool", - "name": "", + "name": "isBatchFinal", "type": "bool" } ], @@ -313,7 +313,7 @@ }, { "internalType": "bool", - "name": "", + "name": "areDepositsFinal", "type": "bool" } ], diff --git a/integrationTests/relayers/slowTests/testdata/contracts/eth/ERC20Safe.abi.json b/integrationTests/relayers/slowTests/testdata/contracts/eth/ERC20Safe.abi.json index 72a2fab0..135487b7 100644 --- a/integrationTests/relayers/slowTests/testdata/contracts/eth/ERC20Safe.abi.json +++ b/integrationTests/relayers/slowTests/testdata/contracts/eth/ERC20Safe.abi.json @@ -94,6 +94,31 @@ "name": "ERC20Deposit", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint112", + "name": "batchId", + "type": "uint112" + }, + { + "indexed": false, + "internalType": "uint112", + "name": "depositNonce", + "type": "uint112" + }, + { + "indexed": false, + "internalType": "string", + "name": "callData", + "type": "string" + } + ], + "name": "ERC20SCDeposit", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -310,6 +335,34 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "recipientAddress", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "callData", + "type": "string" + } + ], + "name": "depositWithSCExecution", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "depositsCount", @@ -362,7 +415,7 @@ }, { "internalType": "bool", - "name": "", + "name": "isBatchFinal", "type": "bool" } ], @@ -418,7 +471,7 @@ }, { "internalType": "bool", - "name": "", + "name": "areDepositsFinal", "type": "bool" } ], diff --git a/integrationTests/relayers/slowTests/testdata/contracts/eth/ERC20Safe.hex b/integrationTests/relayers/slowTests/testdata/contracts/eth/ERC20Safe.hex index 6a35ba70..d7dcd4b3 100644 --- a/integrationTests/relayers/slowTests/testdata/contracts/eth/ERC20Safe.hex +++ b/integrationTests/relayers/slowTests/testdata/contracts/eth/ERC20Safe.hex @@ -1 +1 @@ -0x60806040526002805463ffffffff60401b19166b2828000a000000000000000017905534801561002e57600080fd5b50600080546001600160a01b031916339081178255604051909182917fe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd908290a3506001805460ff60a01b1916600160a01b17905561293b806100926000396000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c80639ab7cfaa1161013b578063cf6682a2116100b8578063e8a70ee21161007c578063e8a70ee2146106bd578063f2e0ec48146106d0578063f4daaba1146106e3578063f6246ea11461070b578063f851a4401461072b57600080fd5b8063cf6682a21461062f578063d4673de91461064f578063daf9c21014610662578063dbba0f0114610685578063e78cea921461069857600080fd5b8063b5af090f116100ff578063b5af090f14610577578063bc56602f146105a3578063c639651d146105c3578063c652a0b5146105e3578063c86726f61461060c57600080fd5b80639ab7cfaa1461046a5780639f0ebb931461047e578063a7c3a06f146104b5578063aee9c872146104c8578063b32c4d8d146104e857600080fd5b806375829def116101c957806387ea09611161018d57806387ea0961146103ff5780638bad0c0a146104195780638dd148021461042157806390e0cfcb14610434578063920b03081461045757600080fd5b806375829def146103b6578063770be784146103c95780637d7763ce146103dc57806382146138146103ef5780638456cb59146103f757600080fd5b80633f4ba83a116102105780633f4ba83a146102ea5780634013c89c146102f25780634506e935146103055780635ac44282146103305780635c975abb1461039857600080fd5b8063085c967f1461024d5780632325b5f71461027757806326b3293f1461029d578063284c0c44146102b2578063306275be146102d7575b600080fd5b61026061025b3660046124da565b61073c565b60405161026e92919061252b565b60405180910390f35b60025461028b90600160581b900460ff1681565b60405160ff909116815260200161026e565b6102b06102ab3660046125f1565b6108bf565b005b6102c56102c0366004612624565b610f7a565b60405161026e96959493929190612646565b6102b06102e5366004612693565b610fe7565b6102b0611041565b6102b06103003660046126ae565b6110be565b600254610318906001600160401b031681565b6040516001600160401b03909116815260200161026e565b61034361033e3660046124da565b6112f6565b6040805183516001600160701b031681526020808501516001600160401b039081169183019190915284830151169181019190915260609283015161ffff16928101929092521515608082015260a00161026e565b600154600160a01b900460ff165b604051901515815260200161026e565b6102b06103c4366004612693565b6113a3565b6102b06103d7366004612693565b61149e565b6102b06103ea3660046126ae565b6115b0565b6103a6611605565b6102b06116e5565b60015461031890600160a81b90046001600160401b031681565b6102b0611761565b6102b061042f366004612693565b6117e4565b6103a6610442366004612693565b60056020526000908152604090205460ff1681565b6102b06104653660046126ae565b6119a9565b60025461028b90600160501b900460ff1681565b6104a761048c366004612693565b6001600160a01b031660009081526007602052604090205490565b60405190815260200161026e565b6102b06104c33660046126e6565b6119fe565b6104a76104d6366004612693565b60096020526000908152604090205481565b61053c6104f63660046124da565b6003602052600090815260409020546001600160701b038116906001600160401b03600160701b8204811691600160b01b81049091169061ffff600160f01b9091041684565b604080516001600160701b039590951685526001600160401b039384166020860152919092169083015261ffff16606082015260800161026e565b6103a6610585366004612693565b6001600160a01b031660009081526004602052604090205460ff1690565b6104a76105b1366004612693565b600a6020526000908152604090205481565b6104a76105d1366004612693565b60086020526000908152604090205481565b6104a76105f1366004612693565b6001600160a01b031660009081526008602052604090205490565b6103a661061a366004612693565b60066020526000908152604090205460ff1681565b6104a761063d366004612693565b600b6020526000908152604090205481565b6102b061065d366004612743565b611afe565b6103a6610670366004612693565b60046020526000908152604090205460ff1681565b6103a6610693366004612767565b611ba9565b6001546001600160a01b03165b6040516001600160a01b03909116815260200161026e565b6102b06106cb3660046127a3565b611da6565b6102b06106de3660046127a3565b611e85565b6002546106f890600160401b900461ffff1681565b60405161ffff909116815260200161026e565b6104a7610719366004612693565b60076020526000908152604090205481565b6000546001600160a01b03166106a5565b606060008060038161074f6001876127dc565b815260208082019290925260409081016000908120825160808101845290546001600160701b0381168252600160701b81046001600160401b0390811695830195909552600160b01b810490941692810192909252600160f01b90920461ffff1660608201529150600c906107c56001876127dc565b81526020019081526020016000206107dc82612033565b81805480602002602001604051908101604052809291908181526020016000905b828210156108af5760008481526020908190206040805160c0810182526006860290920180546001600160701b0316835260018101546001600160a01b0390811694840194909452600281015491830191909152600381015490921660608201526004808301546080830152600583015491929160a084019160ff9091169081111561088b5761088b6124f3565b600481111561089c5761089c6124f3565b81525050815260200190600101906107fd565b5050505091509250925050915091565b600154600160a01b900460ff16156109115760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064015b60405180910390fd5b6001600160a01b03831660009081526004602052604090205460ff1661096d5760405162461bcd60e51b81526020600482015260116024820152702ab739bab83837b93a32b2103a37b5b2b760791b6044820152606401610908565b6001600160a01b0383166000908152600760205260409020548210156109fb5760405162461bcd60e51b815260206004820152603c60248201527f547269656420746f206465706f73697420616e20616d6f756e742062656c6f7760448201527f20746865206d696e696d756d20737065636966696564206c696d6974000000006064820152608401610908565b6001600160a01b038316600090815260086020526040902054821115610a895760405162461bcd60e51b815260206004820152603c60248201527f547269656420746f206465706f73697420616e20616d6f756e742061626f766560448201527f20746865206d6178696d756d20737065636966696564206c696d6974000000006064820152608401610908565b436000610a94612064565b15610b31575060018054600160a81b90046001600160401b0316600081815260036020526040902091610ac791906127ef565b81546001600160401b039182166001600160b01b031990911617600160701b8483160217825560018054600160a81b9004909116906015610b0783612816565b91906101000a8154816001600160401b0302191690836001600160401b0316021790555050610b6f565b60018054600391600091610b559190600160a81b90046001600160401b031661283c565b6001600160401b0316815260200190815260200160002090505b600254600090610b89906001600160401b031660016127ef565b6001600160401b03169050600c600060018060159054906101000a90046001600160401b0316610bb9919061283c565b6001600160401b031681526020019081526020016000206040518060c00160405280836001600160701b03168152602001886001600160a01b03168152602001878152602001336001600160a01b0316815260200186815260200160016004811115610c2757610c276124f3565b90528154600181810184556000938452602093849020835160069093020180546001600160701b039093166dffffffffffffffffffffffffffff199093169290921782559282015181840180546001600160a01b039283166001600160a01b031991821617909155604084015160028401556060840151600384018054919093169116179055608082015160048083019190915560a0830151600583018054949593949193909260ff19909216918490811115610ce657610ce66124f3565b021790555050825467ffffffffffffffff60b01b1916600160b01b6001600160401b0386160217808455600160f01b900461ffff16905082601e610d298361285c565b825461ffff9182166101009390930a928302919092021990911617905550600280546001600160401b0316906000610d6083612816565b91906101000a8154816001600160401b0302191690836001600160401b0316021790555050610da7866001600160a01b031660009081526005602052604090205460ff1690565b610df5576001600160a01b03861660009081526009602052604081208054879290610dd3908490612873565b90915550869050610def6001600160a01b038216333089612143565b50610f2c565b6001600160a01b03861660009081526006602052604090205460ff16610e9b576001600160a01b0386166000908152600b6020526040902054610e39908690612873565b6001600160a01b0387166000908152600a60205260409020541015610e9b5760405162461bcd60e51b81526020600482015260186024820152774e6f7420656e6f756768206d696e74656420746f6b656e7360401b6044820152606401610908565b6001600160a01b0386166000908152600b602052604081208054879290610ec3908490612873565b909155505060405163079cc67960e41b81523360048201526024810186905286906001600160a01b038216906379cc679090604401600060405180830381600087803b158015610f1257600080fd5b505af1158015610f26573d6000803e3d6000fd5b50505050505b8154604080516001600160701b03808516825290921660208301527f6c15ce44793c685a79cde26a0bd5419ef4f3a337991f156be7b365962001b4a7910160405180910390a1505050505050565b600c6020528160005260406000208181548110610f9657600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160701b0390941696506001600160a01b039283169550909391169160ff1686565b33610ffa6000546001600160a01b031690565b6001600160a01b0316146110205760405162461bcd60e51b815260040161090890612886565b6001600160a01b03166000908152600460205260409020805460ff19169055565b336110546000546001600160a01b031690565b6001600160a01b03161461107a5760405162461bcd60e51b815260040161090890612886565b6001805460ff60a01b19169055604051600081527f9422424b175dda897495a07b091ef74a3ef715cf6d866fc972954c1c7f459304906020015b60405180910390a1565b336110d16000546001600160a01b031690565b6001600160a01b0316146110f75760405162461bcd60e51b815260040161090890612886565b6001600160a01b03821660009081526004602052604090205460ff166111535760405162461bcd60e51b81526020600482015260116024820152702ab739bab83837b93a32b2103a37b5b2b760791b6044820152606401610908565b6001600160a01b03821660009081526005602052604090205460ff166111bc576001600160a01b0382166000908152600960205260408120805483929061119b908490612873565b909155508290506111b76001600160a01b038216333085612143565b505050565b6001600160a01b03821660009081526006602052604090205460ff16611262576001600160a01b0382166000908152600b6020526040902054611200908290612873565b6001600160a01b0383166000908152600a602052604090205410156112625760405162461bcd60e51b81526020600482015260186024820152774e6f7420656e6f756768206d696e74656420746f6b656e7360401b6044820152606401610908565b6001600160a01b0382166000908152600b60205260408120805483929061128a908490612873565b909155505060405163079cc67960e41b81523360048201526024810182905282906001600160a01b038216906379cc679090604401600060405180830381600087803b1580156112d957600080fd5b505af11580156112ed573d6000803e3d6000fd5b50505050505050565b604080516080810182526000808252602082018190529181018290526060810182905290806003816113296001876127dc565b81526020808201929092526040908101600020815160808101835290546001600160701b0381168252600160701b81046001600160401b0390811694830194909452600160b01b810490931691810191909152600160f01b90910461ffff16606082015290508061139981612033565b9250925050915091565b336113b66000546001600160a01b031690565b6001600160a01b0316146113dc5760405162461bcd60e51b815260040161090890612886565b6001600160a01b0381166114435760405162461bcd60e51b815260206004820152602860248201527f41646d696e526f6c653a206e65772061646d696e20697320746865207a65726f604482015267206164647265737360c01b6064820152608401610908565b600080546040516001600160a01b03808516939216917fe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd91a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b336114b16000546001600160a01b031690565b6001600160a01b0316146114d75760405162461bcd60e51b815260040161090890612886565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611520573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154491906128c9565b6001600160a01b0384166000908152600460205260408120549192509060ff1615611593576001600160a01b03841660009081526009602052604090205461158c90836127dc565b9050611596565b50805b6115aa6001600160a01b03841633836121aa565b50505050565b336115c36000546001600160a01b031690565b6001600160a01b0316146115e95760405162461bcd60e51b815260040161090890612886565b6001600160a01b03909116600090815260086020526040902055565b600154600090600160a81b90046001600160401b031681036116275750600090565b60018054600091600391839161164c91600160a81b90046001600160401b031661283c565b6001600160401b0390811682526020808301939093526040918201600020825160808101845290546001600160701b0381168252600160701b8104831694820194909452600160b01b840490911691810191909152600160f01b90910461ffff16606082015290506116bc612064565b6116c857600191505090565b6116d181612033565b6116dd57600191505090565b600091505090565b336116f86000546001600160a01b031690565b6001600160a01b03161461171e5760405162461bcd60e51b815260040161090890612886565b6001805460ff60a01b1916600160a01b1781556040519081527f9422424b175dda897495a07b091ef74a3ef715cf6d866fc972954c1c7f459304906020016110b4565b336117746000546001600160a01b031690565b6001600160a01b03161461179a5760405162461bcd60e51b815260040161090890612886565b600080546040516001600160a01b03909116907fe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd908390a3600080546001600160a01b0319169055565b336117f76000546001600160a01b031690565b6001600160a01b03161461181d5760405162461bcd60e51b815260040161090890612886565b6001600160a01b0381166118865760405162461bcd60e51b815260206004820152602a60248201527f427269646765526f6c653a206e65772062726964676520697320746865207a65604482015269726f206164647265737360b01b6064820152608401610908565b6001546001600160a01b03908116908216036118e45760405162461bcd60e51b815260206004820152601860248201527f427269646765526f6c653a2073616d65206164647265737300000000000000006044820152606401610908565b6001600160a01b0381163b61194d5760405162461bcd60e51b815260206004820152602960248201527f427269646765526f6c653a206e657720627269646765206d75737420626520616044820152680818dbdb9d1c9858dd60ba1b6064820152608401610908565b6001546040516001600160a01b038084169216907fcca5fddab921a878ddbd4edb737a2cf3ac6df70864f108606647d1b37a5e07a090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b336119bc6000546001600160a01b031690565b6001600160a01b0316146119e25760405162461bcd60e51b815260040161090890612886565b6001600160a01b03909116600090815260076020526040902055565b33611a116000546001600160a01b031690565b6001600160a01b031614611a375760405162461bcd60e51b815260040161090890612886565b81611a935780611a935760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206e617469766520746f6b656e732063616e2062652073746f7265646044820152602160f81b6064820152608401610908565b6001600160a01b039490941660009081526004602090815260408083208054600160ff19918216179091556005835281842080548216951515959095179094556006825280832080549094169615159690961790925560078252848120939093556008905291902055565b33611b116000546001600160a01b031690565b6001600160a01b031614611b375760405162461bcd60e51b815260040161090890612886565b606461ffff82161115611b825760405162461bcd60e51b8152602060048201526013602482015272084c2e8c6d040e6d2f4ca40e8dede40d0d2ced606b1b6044820152606401610908565b6002805461ffff909216600160401b0269ffff000000000000000019909216919091179055565b600033611bbe6001546001600160a01b031690565b6001600160a01b031614611c205760405162461bcd60e51b8152602060048201526024808201527f41636365737320436f6e74726f6c3a2073656e646572206973206e6f742042726044820152636964676560e01b6064820152608401610908565b6001600160a01b03841660009081526005602052604090205460ff16611ca257836000611c576001600160a01b03831685876121db565b905080611c6957600092505050611d9f565b6001600160a01b03861660009081526009602052604081208054879290611c919084906127dc565b9091555060019350611d9f92505050565b6001600160a01b03841660009081526006602052604090205460ff1615611d4e576001600160a01b0384166000908152600a6020526040902054611ce7908490612873565b6001600160a01b0385166000908152600b60205260409020541015611d4e5760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f756768206275726e656420746f6b656e7300000000000000006044820152606401610908565b6000611d5b8584866122c2565b905080611d6c576000915050611d9f565b6001600160a01b0385166000908152600a602052604081208054869290611d94908490612873565b909155506001925050505b9392505050565b33611db96000546001600160a01b031690565b6001600160a01b031614611ddf5760405162461bcd60e51b815260040161090890612886565b60025460ff600160581b90910481169082161115611e655760405162461bcd60e51b815260206004820152603760248201527f43616e6e6f7420696e63726561736520626174636820626c6f636b206c696d6960448201527f74206f76657220736574746c656d656e74206c696d69740000000000000000006064820152608401610908565b6002805460ff909216600160501b0260ff60501b19909216919091179055565b33611e986000546001600160a01b031690565b6001600160a01b031614611ebe5760405162461bcd60e51b815260040161090890612886565b600154600160a01b900460ff16611f0e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610908565b611f16611605565b15611f7f5760405162461bcd60e51b815260206004820152603360248201527f43616e6e6f74206368616e6765206261746368536574746c654c696d697420776044820152726974682070656e64696e67206261746368657360681b6064820152608401610908565b60025460ff600160501b909104811690821610156120135760405162461bcd60e51b815260206004820152604560248201527f43616e6e6f74206465637265617365206261746368536574746c654c696d697460448201527f20756e646572207468652076616c7565206f6620626174636820626c6f636b206064820152641b1a5b5a5d60da1b608482015260a401610908565b6002805460ff909216600160581b0260ff60581b19909216919091179055565b6002546040820151600091439161205491600160581b900460ff16906127ef565b6001600160401b03161092915050565b600154600090600160a81b90046001600160401b031681036120865750600190565b6001805460009160039183916120ab91600160a81b90046001600160401b031661283c565b6001600160401b0390811682526020808301939093526040918201600020825160808101845290546001600160701b0381168252600160701b81048316948201859052600160b01b810490921692810192909252600160f01b900461ffff166060820181905290925061211d9161233a565b8061213d5750600254606082015161ffff600160401b9092048216911610155b91505090565b6040516001600160a01b0384811660248301528381166044830152606482018390526115aa9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061237c565b6040516001600160a01b038381166024830152604482018390526111b791859182169063a9059cbb90606401612178565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839283929188169161223991906128e2565b6000604051808303816000865af19150503d8060008114612276576040519150601f19603f3d011682016040523d82523d6000602084013e61227b565b606091505b50915091508161229057600092505050611d9f565b80516000036122a457600192505050611d9f565b808060200190518101906122b89190612911565b9695505050505050565b6040516340c10f1960e01b81526001600160a01b0383811660048301526024820183905260009185918216906340c10f1990604401600060405180830381600087803b15801561231157600080fd5b505af1925050508015612322575060015b612330576000915050611d9f565b6001915050611d9f565b60008261ffff1660000361235057506000612376565b600254439061236990600160501b900460ff16846127ef565b6001600160401b03161090505b92915050565b60006123916001600160a01b038416836123df565b905080516000141580156123b65750808060200190518101906123b49190612911565b155b156111b757604051635274afe760e01b81526001600160a01b0384166004820152602401610908565b6060611d9f8383600084600080856001600160a01b0316848660405161240591906128e2565b60006040518083038185875af1925050503d8060008114612442576040519150601f19603f3d011682016040523d82523d6000602084013e612447565b606091505b50915091506122b886838360608261246757612462826124ae565b611d9f565b815115801561247e57506001600160a01b0384163b155b156124a757604051639996b31560e01b81526001600160a01b0385166004820152602401610908565b5080611d9f565b8051156124be5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6000602082840312156124ec57600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6005811061252757634e487b7160e01b600052602160045260246000fd5b9052565b6040808252835182820181905260009190606090818501906020808901865b838110156125b757815180516001600160701b03168652838101516001600160a01b039081168588015288820151898801528782015116878701526080808201519087015260a090810151906125a281880183612509565b505060c094909401939082019060010161254a565b50508295506125c98188018915159052565b50505050509392505050565b80356001600160a01b03811681146125ec57600080fd5b919050565b60008060006060848603121561260657600080fd5b61260f846125d5565b95602085013595506040909401359392505050565b6000806040838503121561263757600080fd5b50508035926020909101359150565b6001600160701b03871681526001600160a01b03868116602083015260408201869052841660608201526080810183905260c0810161268860a0830184612509565b979650505050505050565b6000602082840312156126a557600080fd5b611d9f826125d5565b600080604083850312156126c157600080fd5b6126ca836125d5565b946020939093013593505050565b80151581146124d757600080fd5b600080600080600060a086880312156126fe57600080fd5b612707866125d5565b945060208601359350604086013592506060860135612725816126d8565b91506080860135612735816126d8565b809150509295509295909350565b60006020828403121561275557600080fd5b813561ffff81168114611d9f57600080fd5b60008060006060848603121561277c57600080fd5b612785846125d5565b92506020840135915061279a604085016125d5565b90509250925092565b6000602082840312156127b557600080fd5b813560ff81168114611d9f57600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612376576123766127c6565b6001600160401b0381811683821601908082111561280f5761280f6127c6565b5092915050565b60006001600160401b03808316818103612832576128326127c6565b6001019392505050565b6001600160401b0382811682821603908082111561280f5761280f6127c6565b600061ffff808316818103612832576128326127c6565b80820180821115612376576123766127c6565b60208082526023908201527f41636365737320436f6e74726f6c3a2073656e646572206973206e6f7420416460408201526236b4b760e91b606082015260800190565b6000602082840312156128db57600080fd5b5051919050565b6000825160005b8181101561290357602081860181015185830152016128e9565b506000920191825250919050565b60006020828403121561292357600080fd5b8151611d9f816126d856fea164736f6c6343000814000a +0x60806040526002805463ffffffff60401b19166b2828000a000000000000000017905534801561002e57600080fd5b50600080546001600160a01b031916339081178255604051909182917fe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd908290a3506001805460ff60a01b1916600160a01b179055612b04806100926000396000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c80639ab7cfaa11610146578063cd7271c5116100c3578063e78cea9211610087578063e78cea92146106b6578063e8a70ee2146106db578063f2e0ec48146106ee578063f4daaba114610701578063f6246ea114610729578063f851a4401461074957600080fd5b8063cd7271c51461063a578063cf6682a21461064d578063d4673de91461066d578063daf9c21014610680578063dbba0f01146106a357600080fd5b8063b5af090f1161010a578063b5af090f14610582578063bc56602f146105ae578063c639651d146105ce578063c652a0b5146105ee578063c86726f61461061757600080fd5b80639ab7cfaa146104755780639f0ebb9314610489578063a7c3a06f146104c0578063aee9c872146104d3578063b32c4d8d146104f357600080fd5b806375829def116101d457806387ea09611161019857806387ea09611461040a5780638bad0c0a146104245780638dd148021461042c57806390e0cfcb1461043f578063920b03081461046257600080fd5b806375829def146103c1578063770be784146103d45780637d7763ce146103e757806382146138146103fa5780638456cb591461040257600080fd5b80633f4ba83a1161021b5780633f4ba83a146102f55780634013c89c146102fd5780634506e935146103105780635ac442821461033b5780635c975abb146103a357600080fd5b8063085c967f146102585780632325b5f71461028257806326b3293f146102a8578063284c0c44146102bd578063306275be146102e2575b600080fd5b61026b6102663660046125d1565b61075a565b604051610279929190612622565b60405180910390f35b60025461029690600160581b900460ff1681565b60405160ff9091168152602001610279565b6102bb6102b63660046126e8565b6108dd565b005b6102d06102cb36600461271b565b61098d565b6040516102799695949392919061273d565b6102bb6102f036600461278a565b6109fa565b6102bb610a54565b6102bb61030b3660046127a5565b610ad1565b600254610323906001600160401b031681565b6040516001600160401b039091168152602001610279565b61034e6103493660046125d1565b610d09565b6040805183516001600160701b031681526020808501516001600160401b039081169183019190915284830151169181019190915260609283015161ffff16928101929092521515608082015260a001610279565b600154600160a01b900460ff165b6040519015158152602001610279565b6102bb6103cf36600461278a565b610db6565b6102bb6103e236600461278a565b610eb1565b6102bb6103f53660046127a5565b610fc3565b6103b1611018565b6102bb6110f8565b60015461032390600160a81b90046001600160401b031681565b6102bb611174565b6102bb61043a36600461278a565b6111f7565b6103b161044d36600461278a565b60056020526000908152604090205460ff1681565b6102bb6104703660046127a5565b6113bc565b60025461029690600160501b900460ff1681565b6104b261049736600461278a565b6001600160a01b031660009081526007602052604090205490565b604051908152602001610279565b6102bb6104ce3660046127dd565b611411565b6104b26104e136600461278a565b60096020526000908152604090205481565b6105476105013660046125d1565b6003602052600090815260409020546001600160701b038116906001600160401b03600160701b8204811691600160b01b81049091169061ffff600160f01b9091041684565b604080516001600160701b039590951685526001600160401b039384166020860152919092169083015261ffff166060820152608001610279565b6103b161059036600461278a565b6001600160a01b031660009081526004602052604090205460ff1690565b6104b26105bc36600461278a565b600a6020526000908152604090205481565b6104b26105dc36600461278a565b60086020526000908152604090205481565b6104b26105fc36600461278a565b6001600160a01b031660009081526008602052604090205490565b6103b161062536600461278a565b60066020526000908152604090205460ff1681565b6102bb61064836600461283a565b611511565b6104b261065b36600461278a565b600b6020526000908152604090205481565b6102bb61067b3660046128cd565b6115c1565b6103b161068e36600461278a565b60046020526000908152604090205460ff1681565b6103b16106b13660046128f1565b61166c565b6001546001600160a01b03165b6040516001600160a01b039091168152602001610279565b6102bb6106e936600461292d565b611869565b6102bb6106fc36600461292d565b611948565b60025461071690600160401b900461ffff1681565b60405161ffff9091168152602001610279565b6104b261073736600461278a565b60076020526000908152604090205481565b6000546001600160a01b03166106c3565b606060008060038161076d600187612966565b815260208082019290925260409081016000908120825160808101845290546001600160701b0381168252600160701b81046001600160401b0390811695830195909552600160b01b810490941692810192909252600160f01b90920461ffff1660608201529150600c906107e3600187612966565b81526020019081526020016000206107fa82611af6565b81805480602002602001604051908101604052809291908181526020016000905b828210156108cd5760008481526020908190206040805160c0810182526006860290920180546001600160701b0316835260018101546001600160a01b0390811694840194909452600281015491830191909152600381015490921660608201526004808301546080830152600583015491929160a084019160ff909116908111156108a9576108a96125ea565b60048111156108ba576108ba6125ea565b815250508152602001906001019061081b565b5050505091509250925050915091565b600154600160a01b900460ff161561092f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064015b60405180910390fd5b60008061093d858585611b27565b604080516001600160701b038084168252841660208201529294509092507f6c15ce44793c685a79cde26a0bd5419ef4f3a337991f156be7b365962001b4a7910160405180910390a15050505050565b600c60205281600052604060002081815481106109a957600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160701b0390941696506001600160a01b039283169550909391169160ff1686565b33610a0d6000546001600160a01b031690565b6001600160a01b031614610a335760405162461bcd60e51b815260040161092690612979565b6001600160a01b03166000908152600460205260409020805460ff19169055565b33610a676000546001600160a01b031690565b6001600160a01b031614610a8d5760405162461bcd60e51b815260040161092690612979565b6001805460ff60a01b19169055604051600081527f9422424b175dda897495a07b091ef74a3ef715cf6d866fc972954c1c7f459304906020015b60405180910390a1565b33610ae46000546001600160a01b031690565b6001600160a01b031614610b0a5760405162461bcd60e51b815260040161092690612979565b6001600160a01b03821660009081526004602052604090205460ff16610b665760405162461bcd60e51b81526020600482015260116024820152702ab739bab83837b93a32b2103a37b5b2b760791b6044820152606401610926565b6001600160a01b03821660009081526005602052604090205460ff16610bcf576001600160a01b03821660009081526009602052604081208054839290610bae9084906129bc565b90915550829050610bca6001600160a01b03821633308561215b565b505050565b6001600160a01b03821660009081526006602052604090205460ff16610c75576001600160a01b0382166000908152600b6020526040902054610c139082906129bc565b6001600160a01b0383166000908152600a60205260409020541015610c755760405162461bcd60e51b81526020600482015260186024820152774e6f7420656e6f756768206d696e74656420746f6b656e7360401b6044820152606401610926565b6001600160a01b0382166000908152600b602052604081208054839290610c9d9084906129bc565b909155505060405163079cc67960e41b81523360048201526024810182905282906001600160a01b038216906379cc679090604401600060405180830381600087803b158015610cec57600080fd5b505af1158015610d00573d6000803e3d6000fd5b50505050505050565b60408051608081018252600080825260208201819052918101829052606081018290529080600381610d3c600187612966565b81526020808201929092526040908101600020815160808101835290546001600160701b0381168252600160701b81046001600160401b0390811694830194909452600160b01b810490931691810191909152600160f01b90910461ffff166060820152905080610dac81611af6565b9250925050915091565b33610dc96000546001600160a01b031690565b6001600160a01b031614610def5760405162461bcd60e51b815260040161092690612979565b6001600160a01b038116610e565760405162461bcd60e51b815260206004820152602860248201527f41646d696e526f6c653a206e65772061646d696e20697320746865207a65726f604482015267206164647265737360c01b6064820152608401610926565b600080546040516001600160a01b03808516939216917fe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd91a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b33610ec46000546001600160a01b031690565b6001600160a01b031614610eea5760405162461bcd60e51b815260040161092690612979565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5791906129cf565b6001600160a01b0384166000908152600460205260408120549192509060ff1615610fa6576001600160a01b038416600090815260096020526040902054610f9f9083612966565b9050610fa9565b50805b610fbd6001600160a01b03841633836121c2565b50505050565b33610fd66000546001600160a01b031690565b6001600160a01b031614610ffc5760405162461bcd60e51b815260040161092690612979565b6001600160a01b03909116600090815260086020526040902055565b600154600090600160a81b90046001600160401b0316810361103a5750600090565b60018054600091600391839161105f91600160a81b90046001600160401b03166129e8565b6001600160401b0390811682526020808301939093526040918201600020825160808101845290546001600160701b0381168252600160701b8104831694820194909452600160b01b840490911691810191909152600160f01b90910461ffff16606082015290506110cf6121f3565b6110db57600191505090565b6110e481611af6565b6110f057600191505090565b600091505090565b3361110b6000546001600160a01b031690565b6001600160a01b0316146111315760405162461bcd60e51b815260040161092690612979565b6001805460ff60a01b1916600160a01b1781556040519081527f9422424b175dda897495a07b091ef74a3ef715cf6d866fc972954c1c7f45930490602001610ac7565b336111876000546001600160a01b031690565b6001600160a01b0316146111ad5760405162461bcd60e51b815260040161092690612979565b600080546040516001600160a01b03909116907fe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd908390a3600080546001600160a01b0319169055565b3361120a6000546001600160a01b031690565b6001600160a01b0316146112305760405162461bcd60e51b815260040161092690612979565b6001600160a01b0381166112995760405162461bcd60e51b815260206004820152602a60248201527f427269646765526f6c653a206e65772062726964676520697320746865207a65604482015269726f206164647265737360b01b6064820152608401610926565b6001546001600160a01b03908116908216036112f75760405162461bcd60e51b815260206004820152601860248201527f427269646765526f6c653a2073616d65206164647265737300000000000000006044820152606401610926565b6001600160a01b0381163b6113605760405162461bcd60e51b815260206004820152602960248201527f427269646765526f6c653a206e657720627269646765206d75737420626520616044820152680818dbdb9d1c9858dd60ba1b6064820152608401610926565b6001546040516001600160a01b038084169216907fcca5fddab921a878ddbd4edb737a2cf3ac6df70864f108606647d1b37a5e07a090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b336113cf6000546001600160a01b031690565b6001600160a01b0316146113f55760405162461bcd60e51b815260040161092690612979565b6001600160a01b03909116600090815260076020526040902055565b336114246000546001600160a01b031690565b6001600160a01b03161461144a5760405162461bcd60e51b815260040161092690612979565b816114a657806114a65760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206e617469766520746f6b656e732063616e2062652073746f7265646044820152602160f81b6064820152608401610926565b6001600160a01b039490941660009081526004602090815260408083208054600160ff19918216179091556005835281842080548216951515959095179094556006825280832080549094169615159690961790925560078252848120939093556008905291902055565b600154600160a01b900460ff161561155e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610926565b60008061156c878787611b27565b60405191935091506001600160701b038316907f527e633d8513f28e14b16d38843a6e5c1c9db79ecb610ef26e171e836f93d9a2906115b090849088908890612a0f565b60405180910390a250505050505050565b336115d46000546001600160a01b031690565b6001600160a01b0316146115fa5760405162461bcd60e51b815260040161092690612979565b606461ffff821611156116455760405162461bcd60e51b8152602060048201526013602482015272084c2e8c6d040e6d2f4ca40e8dede40d0d2ced606b1b6044820152606401610926565b6002805461ffff909216600160401b0269ffff000000000000000019909216919091179055565b6000336116816001546001600160a01b031690565b6001600160a01b0316146116e35760405162461bcd60e51b8152602060048201526024808201527f41636365737320436f6e74726f6c3a2073656e646572206973206e6f742042726044820152636964676560e01b6064820152608401610926565b6001600160a01b03841660009081526005602052604090205460ff166117655783600061171a6001600160a01b03831685876122d2565b90508061172c57600092505050611862565b6001600160a01b03861660009081526009602052604081208054879290611754908490612966565b909155506001935061186292505050565b6001600160a01b03841660009081526006602052604090205460ff1615611811576001600160a01b0384166000908152600a60205260409020546117aa9084906129bc565b6001600160a01b0385166000908152600b602052604090205410156118115760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f756768206275726e656420746f6b656e7300000000000000006044820152606401610926565b600061181e8584866123b9565b90508061182f576000915050611862565b6001600160a01b0385166000908152600a6020526040812080548692906118579084906129bc565b909155506001925050505b9392505050565b3361187c6000546001600160a01b031690565b6001600160a01b0316146118a25760405162461bcd60e51b815260040161092690612979565b60025460ff600160581b909104811690821611156119285760405162461bcd60e51b815260206004820152603760248201527f43616e6e6f7420696e63726561736520626174636820626c6f636b206c696d6960448201527f74206f76657220736574746c656d656e74206c696d69740000000000000000006064820152608401610926565b6002805460ff909216600160501b0260ff60501b19909216919091179055565b3361195b6000546001600160a01b031690565b6001600160a01b0316146119815760405162461bcd60e51b815260040161092690612979565b600154600160a01b900460ff166119d15760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610926565b6119d9611018565b15611a425760405162461bcd60e51b815260206004820152603360248201527f43616e6e6f74206368616e6765206261746368536574746c654c696d697420776044820152726974682070656e64696e67206261746368657360681b6064820152608401610926565b60025460ff600160501b90910481169082161015611ad65760405162461bcd60e51b815260206004820152604560248201527f43616e6e6f74206465637265617365206261746368536574746c654c696d697460448201527f20756e646572207468652076616c7565206f6620626174636820626c6f636b206064820152641b1a5b5a5d60da1b608482015260a401610926565b6002805460ff909216600160581b0260ff60581b19909216919091179055565b60025460408201516000914391611b1791600160581b900460ff1690612a4e565b6001600160401b03161092915050565b6001600160a01b038316600090815260046020526040812054819060ff16611b855760405162461bcd60e51b81526020600482015260116024820152702ab739bab83837b93a32b2103a37b5b2b760791b6044820152606401610926565b6001600160a01b038516600090815260076020526040902054841015611c135760405162461bcd60e51b815260206004820152603c60248201527f547269656420746f206465706f73697420616e20616d6f756e742062656c6f7760448201527f20746865206d696e696d756d20737065636966696564206c696d6974000000006064820152608401610926565b6001600160a01b038516600090815260086020526040902054841115611ca15760405162461bcd60e51b815260206004820152603c60248201527f547269656420746f206465706f73697420616e20616d6f756e742061626f766560448201527f20746865206d6178696d756d20737065636966696564206c696d6974000000006064820152608401610926565b436000611cac6121f3565b15611d49575060018054600160a81b90046001600160401b0316600081815260036020526040902091611cdf9190612a4e565b81546001600160401b039182166001600160b01b031990911617600160701b8483160217825560018054600160a81b9004909116906015611d1f83612a6e565b91906101000a8154816001600160401b0302191690836001600160401b0316021790555050611d87565b60018054600391600091611d6d9190600160a81b90046001600160401b03166129e8565b6001600160401b0316815260200190815260200160002090505b600254600090611da1906001600160401b03166001612a4e565b6001600160401b03169050600c600060018060159054906101000a90046001600160401b0316611dd191906129e8565b6001600160401b031681526020019081526020016000206040518060c00160405280836001600160701b031681526020018a6001600160a01b03168152602001898152602001336001600160a01b0316815260200188815260200160016004811115611e3f57611e3f6125ea565b90528154600181810184556000938452602093849020835160069093020180546001600160701b039093166dffffffffffffffffffffffffffff199093169290921782559282015181840180546001600160a01b039283166001600160a01b031991821617909155604084015160028401556060840151600384018054919093169116179055608082015160048083019190915560a0830151600583018054949593949193909260ff19909216918490811115611efe57611efe6125ea565b021790555050825467ffffffffffffffff60b01b1916600160b01b6001600160401b0386160217808455600160f01b900461ffff16905082601e611f4183612a94565b825461ffff9182166101009390930a928302919092021990911617905550600280546001600160401b0316906000611f7883612a6e565b91906101000a8154816001600160401b0302191690836001600160401b0316021790555050611fbf886001600160a01b031660009081526005602052604090205460ff1690565b61200d576001600160a01b03881660009081526009602052604081208054899290611feb9084906129bc565b909155508890506120076001600160a01b03821633308b61215b565b50612144565b6001600160a01b03881660009081526006602052604090205460ff166120b3576001600160a01b0388166000908152600b60205260409020546120519088906129bc565b6001600160a01b0389166000908152600a602052604090205410156120b35760405162461bcd60e51b81526020600482015260186024820152774e6f7420656e6f756768206d696e74656420746f6b656e7360401b6044820152606401610926565b6001600160a01b0388166000908152600b6020526040812080548992906120db9084906129bc565b909155505060405163079cc67960e41b81523360048201526024810188905288906001600160a01b038216906379cc679090604401600060405180830381600087803b15801561212a57600080fd5b505af115801561213e573d6000803e3d6000fd5b50505050505b90546001600160701b031697909650945050505050565b6040516001600160a01b038481166024830152838116604483015260648201839052610fbd9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050612431565b6040516001600160a01b03838116602483015260448201839052610bca91859182169063a9059cbb90606401612190565b600154600090600160a81b90046001600160401b031681036122155750600190565b60018054600091600391839161223a91600160a81b90046001600160401b03166129e8565b6001600160401b0390811682526020808301939093526040918201600020825160808101845290546001600160701b0381168252600160701b81048316948201859052600160b01b810490921692810192909252600160f01b900461ffff16606082018190529092506122ac91612494565b806122cc5750600254606082015161ffff600160401b9092048216911610155b91505090565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283928392918816916123309190612aab565b6000604051808303816000865af19150503d806000811461236d576040519150601f19603f3d011682016040523d82523d6000602084013e612372565b606091505b50915091508161238757600092505050611862565b805160000361239b57600192505050611862565b808060200190518101906123af9190612ada565b9695505050505050565b6040516340c10f1960e01b81526001600160a01b0383811660048301526024820183905260009185918216906340c10f1990604401600060405180830381600087803b15801561240857600080fd5b505af1925050508015612419575060015b612427576000915050611862565b6001915050611862565b60006124466001600160a01b038416836124d6565b9050805160001415801561246b5750808060200190518101906124699190612ada565b155b15610bca57604051635274afe760e01b81526001600160a01b0384166004820152602401610926565b60008261ffff166000036124aa575060006124d0565b60025443906124c390600160501b900460ff1684612a4e565b6001600160401b03161090505b92915050565b60606118628383600084600080856001600160a01b031684866040516124fc9190612aab565b60006040518083038185875af1925050503d8060008114612539576040519150601f19603f3d011682016040523d82523d6000602084013e61253e565b606091505b50915091506123af86838360608261255e57612559826125a5565b611862565b815115801561257557506001600160a01b0384163b155b1561259e57604051639996b31560e01b81526001600160a01b0385166004820152602401610926565b5080611862565b8051156125b55780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6000602082840312156125e357600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6005811061261e57634e487b7160e01b600052602160045260246000fd5b9052565b6040808252835182820181905260009190606090818501906020808901865b838110156126ae57815180516001600160701b03168652838101516001600160a01b039081168588015288820151898801528782015116878701526080808201519087015260a0908101519061269981880183612600565b505060c0949094019390820190600101612641565b50508295506126c08188018915159052565b50505050509392505050565b80356001600160a01b03811681146126e357600080fd5b919050565b6000806000606084860312156126fd57600080fd5b612706846126cc565b95602085013595506040909401359392505050565b6000806040838503121561272e57600080fd5b50508035926020909101359150565b6001600160701b03871681526001600160a01b03868116602083015260408201869052841660608201526080810183905260c0810161277f60a0830184612600565b979650505050505050565b60006020828403121561279c57600080fd5b611862826126cc565b600080604083850312156127b857600080fd5b6127c1836126cc565b946020939093013593505050565b80151581146125ce57600080fd5b600080600080600060a086880312156127f557600080fd5b6127fe866126cc565b94506020860135935060408601359250606086013561281c816127cf565b9150608086013561282c816127cf565b809150509295509295909350565b60008060008060006080868803121561285257600080fd5b61285b866126cc565b9450602086013593506040860135925060608601356001600160401b038082111561288557600080fd5b818801915088601f83011261289957600080fd5b8135818111156128a857600080fd5b8960208285010111156128ba57600080fd5b9699959850939650602001949392505050565b6000602082840312156128df57600080fd5b813561ffff8116811461186257600080fd5b60008060006060848603121561290657600080fd5b61290f846126cc565b925060208401359150612924604085016126cc565b90509250925092565b60006020828403121561293f57600080fd5b813560ff8116811461186257600080fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156124d0576124d0612950565b60208082526023908201527f41636365737320436f6e74726f6c3a2073656e646572206973206e6f7420416460408201526236b4b760e91b606082015260800190565b808201808211156124d0576124d0612950565b6000602082840312156129e157600080fd5b5051919050565b6001600160401b03828116828216039080821115612a0857612a08612950565b5092915050565b6001600160701b038416815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6001600160401b03818116838216019080821115612a0857612a08612950565b60006001600160401b03808316818103612a8a57612a8a612950565b6001019392505050565b600061ffff808316818103612a8a57612a8a612950565b6000825160005b81811015612acc5760208186018101518583015201612ab2565b506000920191825250919050565b600060208284031215612aec57600080fd5b8151611862816127cf56fea164736f6c6343000814000a diff --git a/integrationTests/relayers/slowTests/testdata/contracts/eth/SCExecProxy.abi.json b/integrationTests/relayers/slowTests/testdata/contracts/eth/SCExecProxy.abi.json deleted file mode 100644 index be7257f4..00000000 --- a/integrationTests/relayers/slowTests/testdata/contracts/eth/SCExecProxy.abi.json +++ /dev/null @@ -1,195 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "contract ERC20Safe", - "name": "erc20Safe", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "AddressInsufficientBalance", - "type": "error" - }, - { - "inputs": [], - "name": "FailedInnerCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "SafeERC20FailedOperation", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminRoleTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "batchNonce", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "depositNonce", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "string", - "name": "callData", - "type": "string" - } - ], - "name": "ERC20SCDeposit", - "type": "event" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "recipientAddress", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "callData", - "type": "string" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isSafePaused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "safe", - "outputs": [ - { - "internalType": "contract ERC20Safe", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ERC20Safe", - "name": "erc20Safe", - "type": "address" - } - ], - "name": "setSafe", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/integrationTests/relayers/slowTests/testdata/contracts/eth/SCExecProxy.hex b/integrationTests/relayers/slowTests/testdata/contracts/eth/SCExecProxy.hex deleted file mode 100644 index 466bd63c..00000000 --- a/integrationTests/relayers/slowTests/testdata/contracts/eth/SCExecProxy.hex +++ /dev/null @@ -1 +0,0 @@ -0x608060405234801561001057600080fd5b50604051610a5d380380610a5d83398101604081905261002f91610095565b600080546001600160a01b031916339081178255604051909182917fe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd908290a350600180546001600160a01b0319166001600160a01b03929092169190911790556100c5565b6000602082840312156100a757600080fd5b81516001600160a01b03811681146100be57600080fd5b9392505050565b610989806100d46000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80637583e9fd1161005b5780637583e9fd146100da5780638bad0c0a146100ed578063a0579640146100f5578063f851a4401461010d57600080fd5b8063186f0354146100825780635db0cb94146100b257806375829def146100c7575b600080fd5b600154610095906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c56100c03660046107cb565b61011e565b005b6100c56100d53660046107cb565b610182565b6100c56100e83660046107e8565b61027d565b6100c56104be565b6100fd610541565b60405190151581526020016100a9565b6000546001600160a01b0316610095565b336101316000546001600160a01b031690565b6001600160a01b0316146101605760405162461bcd60e51b81526004016101579061087e565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b336101956000546001600160a01b031690565b6001600160a01b0316146101bb5760405162461bcd60e51b81526004016101579061087e565b6001600160a01b0381166102225760405162461bcd60e51b815260206004820152602860248201527f41646d696e526f6c653a206e65772061646d696e20697320746865207a65726f604482015267206164647265737360c01b6064820152608401610157565b600080546040516001600160a01b03808516939216917fe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd91a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b846102936001600160a01b0382163330886105b4565b60015460405163095ea7b360e01b81526001600160a01b039182166004820152602481018790529082169063095ea7b3906044016020604051808303816000875af11580156102e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030a91906108c1565b506001546040516326b3293f60e01b81526001600160a01b0388811660048301526024820188905260448201879052909116906326b3293f90606401600060405180830381600087803b15801561036057600080fd5b505af1158015610374573d6000803e3d6000fd5b505050506000600160009054906101000a90046001600160a01b03166001600160a01b03166387ea09616040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f191906108e3565b90506000600160009054906101000a90046001600160a01b03166001600160a01b0316634506e9356040518163ffffffff1660e01b8152600401602060405180830381865afa158015610448573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046c91906108e3565b90508167ffffffffffffffff167f78b7f0ae2aed1debc707b7fdfc571d40c238bf57db740c833098f00dfddb6e9b8287876040516104ac9392919061090d565b60405180910390a25050505050505050565b336104d16000546001600160a01b031690565b6001600160a01b0316146104f75760405162461bcd60e51b81526004016101579061087e565b600080546040516001600160a01b03909116907fe379ac64de02d8184ca1a871ac486cb8137de77e485ede140e97057b9c765ffd908390a3600080546001600160a01b0319169055565b60015460408051635c975abb60e01b815290516000926001600160a01b031691635c975abb9160048083019260209291908290030181865afa15801561058b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105af91906108c1565b905090565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261060e908590610614565b50505050565b60006106296001600160a01b0384168361067c565b9050805160001415801561064e57508080602001905181019061064c91906108c1565b155b1561067757604051635274afe760e01b81526001600160a01b0384166004820152602401610157565b505050565b606061068a83836000610691565b9392505050565b6060814710156106b65760405163cd78605960e01b8152306004820152602401610157565b600080856001600160a01b031684866040516106d2919061094d565b60006040518083038185875af1925050503d806000811461070f576040519150601f19603f3d011682016040523d82523d6000602084013e610714565b606091505b509150915061072486838361072e565b9695505050505050565b6060826107435761073e8261078a565b61068a565b815115801561075a57506001600160a01b0384163b155b1561078357604051639996b31560e01b81526001600160a01b0385166004820152602401610157565b508061068a565b80511561079a5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b03811681146107b357600080fd5b6000602082840312156107dd57600080fd5b813561068a816107b6565b60008060008060006080868803121561080057600080fd5b853561080b816107b6565b94506020860135935060408601359250606086013567ffffffffffffffff8082111561083657600080fd5b818801915088601f83011261084a57600080fd5b81358181111561085957600080fd5b89602082850101111561086b57600080fd5b9699959850939650602001949392505050565b60208082526023908201527f41636365737320436f6e74726f6c3a2073656e646572206973206e6f7420416460408201526236b4b760e91b606082015260800190565b6000602082840312156108d357600080fd5b8151801515811461068a57600080fd5b6000602082840312156108f557600080fd5b815167ffffffffffffffff8116811461068a57600080fd5b67ffffffffffffffff8416815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6000825160005b8181101561096e5760208186018101518583015201610954565b50600092019182525091905056fea164736f6c6343000814000a diff --git a/testsCommon/bridge/ethereumClientStub.go b/testsCommon/bridge/ethereumClientStub.go index ea448aa6..98319051 100644 --- a/testsCommon/bridge/ethereumClientStub.go +++ b/testsCommon/bridge/ethereumClientStub.go @@ -21,7 +21,7 @@ type EthereumClientStub struct { GetTransactionsStatusesCalled func(ctx context.Context, batchId uint64) ([]byte, error) GetQuorumSizeCalled func(ctx context.Context) (*big.Int, error) IsQuorumReachedCalled func(ctx context.Context, msgHash common.Hash) (bool, error) - GetBatchSCMetadataCalled func(ctx context.Context, nonce uint64) ([]*contract.SCExecProxyERC20SCDeposit, error) + GetBatchSCMetadataCalled func(ctx context.Context, nonce uint64) ([]*contract.ERC20SafeERC20SCDeposit, error) CheckRequiredBalanceCalled func(ctx context.Context, erc20Address common.Address, value *big.Int) error TotalBalancesCalled func(ctx context.Context, account common.Address) (*big.Int, error) MintBalancesCalled func(ctx context.Context, account common.Address) (*big.Int, error) @@ -111,12 +111,12 @@ func (stub *EthereumClientStub) IsQuorumReached(ctx context.Context, msgHash com } // GetBatchSCMetadata - -func (stub *EthereumClientStub) GetBatchSCMetadata(ctx context.Context, nonce uint64) ([]*contract.SCExecProxyERC20SCDeposit, error) { +func (stub *EthereumClientStub) GetBatchSCMetadata(ctx context.Context, nonce uint64) ([]*contract.ERC20SafeERC20SCDeposit, error) { if stub.GetBatchSCMetadataCalled != nil { return stub.GetBatchSCMetadataCalled(ctx, nonce) } - return []*contract.SCExecProxyERC20SCDeposit{}, errNotImplemented + return []*contract.ERC20SafeERC20SCDeposit{}, errNotImplemented } // CheckRequiredBalance -