From 6adb4983b478fa3fe841e3e5c7e3008b43f78467 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 01:20:26 -0500 Subject: [PATCH 01/24] Fix Native Token Bridge Tests for c-chain --- .../NativeTokenBridge/NativeTokenSource.sol | 9 +- .../tests/NativeTokenSourceTests.t.sol | 6 +- tests/flows/erc20_to_native_token_bridge.go | 98 ++++++++++++------- tests/flows/native_token_bridge.go | 82 ++++++++++------ tests/local/network.go | 10 +- tests/utils/utils.go | 35 ++++++- 6 files changed, 157 insertions(+), 83 deletions(-) diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenSource.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenSource.sol index c49cae759..97e11cfb0 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenSource.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenSource.sol @@ -27,10 +27,9 @@ contract NativeTokenSource is ITokenSource, ReentrancyGuard { - // The address where the burned transaction fees are credited. - // Defined as BLACKHOLE_ADDRESS at - // https://github.com/ava-labs/subnet-evm/blob/e23ab058d039ff9c8469c89b139d21d52c4bd283/constants/constants.go - address public constant BURNED_TX_FEES_ADDRESS = 0x0100000000000000000000000000000000000000; + // Designated Blackhole Address for this contract. Tokens are sent here to be "burned" when + // a SourceAction.Burn message is received from the destination chain. + address public constant BURN_ADDRESS = 0x0100000000000000000000000000000000000001; uint256 public constant MINT_NATIVE_TOKENS_REQUIRED_GAS = 100_000; // Used to keep track of tokens burned through transactions on the destination chain. They can // be reported to this contract to burn an equivalent number of tokens on this chain. @@ -172,7 +171,7 @@ contract NativeTokenSource is */ function _burnTokens(uint256 amount) private { emit BurnTokens(amount); - Address.sendValue(payable(BURNED_TX_FEES_ADDRESS), amount); + Address.sendValue(payable(BURN_ADDRESS), amount); } /** diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol index 1a531603b..6e32993fb 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol @@ -155,7 +155,7 @@ contract NativeTokenSourceTest is Test { ); assertEq(burnedTxFees, nativeTokenSource.destinationBurnedTotal()); - assertEq(burnedTxFees, nativeTokenSource.BURNED_TX_FEES_ADDRESS().balance); + assertEq(burnedTxFees, nativeTokenSource.BURN_ADDRESS().balance); vm.prank(MOCK_TELEPORTER_MESSENGER_ADDRESS); nativeTokenSource.receiveTeleporterMessage( @@ -165,7 +165,7 @@ contract NativeTokenSourceTest is Test { ); assertEq(burnedTxFees, nativeTokenSource.destinationBurnedTotal()); - assertEq(burnedTxFees, nativeTokenSource.BURNED_TX_FEES_ADDRESS().balance); + assertEq(burnedTxFees, nativeTokenSource.BURN_ADDRESS().balance); emit BurnTokens(additionalTxFees); @@ -178,7 +178,7 @@ contract NativeTokenSourceTest is Test { assertEq(burnedTxFees + additionalTxFees, nativeTokenSource.destinationBurnedTotal()); assertEq( - burnedTxFees + additionalTxFees, nativeTokenSource.BURNED_TX_FEES_ADDRESS().balance + burnedTxFees + additionalTxFees, nativeTokenSource.BURN_ADDRESS().balance ); } diff --git a/tests/flows/erc20_to_native_token_bridge.go b/tests/flows/erc20_to_native_token_bridge.go index 9453de465..ef659528d 100644 --- a/tests/flows/erc20_to_native_token_bridge.go +++ b/tests/flows/erc20_to_native_token_bridge.go @@ -46,9 +46,10 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { } ) - // sourceSubnet := network.GetPrimaryNetworkInfo() // TODO: Integrate the C-Chain - sourceSubnet, destSubnet := utils.GetTwoSubnets(network) + sourceSubnet := network.GetPrimaryNetworkInfo() + _, destSubnet := utils.GetTwoSubnets(network) teleporterContractAddress := network.GetTeleporterContractAddress() + _, fundedKey := network.GetFundedAccountInfo() // Info we need to calculate for the test deployerPK, err := crypto.HexToECDSA(deployerKeyStr) @@ -60,45 +61,66 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { Expect(err).Should(BeNil()) log.Info("Example ERC20 Contract Address: " + exampleERC20ContractAddress.Hex()) - // Deploy the contracts - // Both contracts in this test will be deployed to 0x3405506b3711859c5070949ed9b700c7ba7bf750, - // though they do not necessarily have to be deployed at the same address, each contract needs - // to know the address of the other. - // The nativeTokenDestination contract must be added to "adminAddresses" of "contractNativeMinterConfig" - // in the genesis file for the subnet. This will allow it to call the native minter precompile. - erc20TokenSourceAbi, err := erc20tokensource.ERC20TokenSourceMetaData.GetAbi() - Expect(err).Should(BeNil()) - utils.DeployContract( - ctx, - ERC20TokenSourceByteCodeFile, - deployerPK, - sourceSubnet, - erc20TokenSourceAbi, - teleporterContractAddress, - destSubnet.BlockchainID, - bridgeContractAddress, - exampleERC20ContractAddress, - ) + { + // Fund the deployer addresses on each chain + utils.SendNativeTransfer( + ctx, + sourceSubnet, + fundedKey, + deployerAddress, + utils.BigIntMul(initialReserveImbalance, big.NewInt(2)), + ) - nativeTokenDestinationAbi, err := nativetokendestination.NativeTokenDestinationMetaData.GetAbi() - Expect(err).Should(BeNil()) - utils.DeployContract( - ctx, - NativeTokenDestinationByteCodeFile, - deployerPK, - destSubnet, - nativeTokenDestinationAbi, - teleporterContractAddress, - sourceSubnet.BlockchainID, - bridgeContractAddress, - initialReserveImbalance, - ) + utils.SendNativeTransfer( + ctx, + destSubnet, + fundedKey, + deployerAddress, + utils.BigIntMul(initialReserveImbalance, big.NewInt(2)), + ) + } - exampleERC20Abi, err := exampleerc20.ExampleERC20MetaData.GetAbi() - Expect(err).Should(BeNil()) - utils.DeployContract(ctx, ExampleERC20ByteCodeFile, deployerPK, sourceSubnet, exampleERC20Abi) + { + // Deploy the contracts + // Both contracts in this test will be deployed to 0x3405506b3711859c5070949ed9b700c7ba7bf750, + // though they do not necessarily have to be deployed at the same address, each contract needs + // to know the address of the other. + // The nativeTokenDestination contract must be added to "adminAddresses" of "contractNativeMinterConfig" + // in the genesis file for the subnet. This will allow it to call the native minter precompile. + erc20TokenSourceAbi, err := erc20tokensource.ERC20TokenSourceMetaData.GetAbi() + Expect(err).Should(BeNil()) + utils.DeployContract( + ctx, + ERC20TokenSourceByteCodeFile, + deployerPK, + sourceSubnet, + erc20TokenSourceAbi, + teleporterContractAddress, + destSubnet.BlockchainID, + bridgeContractAddress, + exampleERC20ContractAddress, + ) + + nativeTokenDestinationAbi, err := nativetokendestination.NativeTokenDestinationMetaData.GetAbi() + Expect(err).Should(BeNil()) + utils.DeployContract( + ctx, + NativeTokenDestinationByteCodeFile, + deployerPK, + destSubnet, + nativeTokenDestinationAbi, + teleporterContractAddress, + sourceSubnet.BlockchainID, + bridgeContractAddress, + initialReserveImbalance, + ) + + exampleERC20Abi, err := exampleerc20.ExampleERC20MetaData.GetAbi() + Expect(err).Should(BeNil()) + utils.DeployContract(ctx, ExampleERC20ByteCodeFile, deployerPK, sourceSubnet, exampleERC20Abi) - log.Info("Finished deploying contracts") + log.Info("Finished deploying contracts") + } // Create abi objects to call the contract with nativeTokenDestination, err := nativetokendestination.NewNativeTokenDestination( diff --git a/tests/flows/native_token_bridge.go b/tests/flows/native_token_bridge.go index 6a68d9cc9..ef7f9bb6f 100644 --- a/tests/flows/native_token_bridge.go +++ b/tests/flows/native_token_bridge.go @@ -34,7 +34,8 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { ctx = context.Background() deployerAddress = common.HexToAddress("0x1337cfd2dCff6270615B90938aCB1efE79801704") tokenReceiverAddress = common.HexToAddress("0x0123456789012345678901234567890123456789") - burnedTxFeeAddress = common.HexToAddress("0x0100000000000000000000000000000000000000") + burnedTxFeeAddressDest = common.HexToAddress("0x0100000000000000000000000000000000000000") + burnAddressSource = common.HexToAddress("0x0100000000000000000000000000000000000001") emptyDestFeeInfo = nativetokendestination.TeleporterFeeInfo{ FeeTokenAddress: common.Address{}, @@ -46,9 +47,10 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { } ) - // sourceSubnet := network.GetPrimaryNetworkInfo() // TODO: Integrate the C-Chain - sourceSubnet, destSubnet := utils.GetTwoSubnets(network) + sourceSubnet := network.GetPrimaryNetworkInfo() // TODO: Integrate the C-Chain + _, destSubnet := utils.GetTwoSubnets(network) teleporterContractAddress := network.GetTeleporterContractAddress() + _, fundedKey := network.GetFundedAccountInfo() // Info we need to calculate for the test deployerPK, err := crypto.HexToECDSA(deployerKeyStr) @@ -57,6 +59,25 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { Expect(err).Should(BeNil()) log.Info("Native Token Bridge Contract Address: " + bridgeContractAddress.Hex()) + { + // Fund the deployer addresses on each chain + utils.SendNativeTransfer( + ctx, + sourceSubnet, + fundedKey, + deployerAddress, + utils.BigIntMul(initialReserveImbalance, big.NewInt(2)), + ) + + utils.SendNativeTransfer( + ctx, + destSubnet, + fundedKey, + deployerAddress, + utils.BigIntMul(initialReserveImbalance, big.NewInt(2)), + ) + } + { // Deploy the contracts // Both contracts in this test will be deployed to 0xAcB633F5B00099c7ec187eB00156c5cd9D854b5B, @@ -114,18 +135,17 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { checkReserveImbalance(initialReserveImbalance, nativeTokenDestination) - destChainReceipt := - sendNativeTokensToDestination( - ctx, - network, - valueToSend, - deployerPK, - tokenReceiverAddress, - sourceSubnet, - destSubnet, - nativeTokenSource, - emptySourceFeeInfo, - ) + destChainReceipt := sendNativeTokensToDestination( + ctx, + network, + valueToSend, + deployerPK, + tokenReceiverAddress, + sourceSubnet, + destSubnet, + nativeTokenSource, + emptySourceFeeInfo, + ) checkCollateralEvent( destChainReceipt.Logs, @@ -211,18 +231,17 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { { // Transfer tokens B -> A - sourceChainReceipt := - sendTokensToSource( - ctx, - network, - valueToReturn, - deployerPK, - tokenReceiverAddress, - sourceSubnet, - destSubnet, - nativeTokenDestination, - emptyDestFeeInfo, - ) + sourceChainReceipt := sendTokensToSource( + ctx, + network, + valueToReturn, + deployerPK, + tokenReceiverAddress, + sourceSubnet, + destSubnet, + nativeTokenDestination, + emptyDestFeeInfo, + ) checkUnlockNativeEvent( sourceChainReceipt.Logs, @@ -238,7 +257,7 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { // Check reporting of burned tx fees to Source Chain burnedTxFeesBalanceDest, err := destSubnet.WSClient.BalanceAt( ctx, - burnedTxFeeAddress, + burnedTxFeeAddressDest, nil, ) Expect(err).Should(BeNil()) @@ -264,11 +283,11 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { burnedTxFeesBalanceSource, err := sourceSubnet.WSClient.BalanceAt( ctx, - burnedTxFeeAddress, + burnAddressSource, nil, ) Expect(err).Should(BeNil()) - Expect(burnedTxFeesBalanceSource.Cmp(common.Big0) > 0).Should(BeTrue()) + Expect(burnedTxFeesBalanceSource.Uint64()).Should(BeZero()) sourceChainReceipt := network.RelayMessage(ctx, destChainReceipt, destSubnet, sourceSubnet, true) @@ -276,12 +295,11 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { sourceChainReceipt.Logs, nativeTokenSource.ParseBurnTokens, ) - Expect(err).Should(BeNil()) utils.ExpectBigEqual(burnedTxFeesBalanceDest, burnEvent.Amount) burnedTxFeesBalanceSource2, err := sourceSubnet.WSClient.BalanceAt( ctx, - burnedTxFeeAddress, + burnAddressSource, nil, ) Expect(err).Should(BeNil()) diff --git a/tests/local/network.go b/tests/local/network.go index 5f52cd043..1e88428c7 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -77,7 +77,10 @@ func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { f, err := os.CreateTemp(os.TempDir(), "config.json") Expect(err).Should(BeNil()) - _, err = f.Write([]byte(`{"warp-api-enabled": true}`)) + _, err = f.Write([]byte(`{ + "warp-api-enabled": true, + "eth-apis":["eth","eth-filter","net","admin","web3","internal-eth","internal-blockchain","internal-transaction","internal-debug","internal-account","internal-personal","debug","debug-tracer","debug-file-tracer","debug-handler"] + }`)) Expect(err).Should(BeNil()) warpChainConfigPath := f.Name() @@ -86,6 +89,11 @@ func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { Expect(err).Should(BeNil()) anrConfig := runner.NewDefaultANRConfig() + anrConfig.GlobalCChainConfig = `{ + "warp-api-enabled": true, + "eth-apis":["eth","eth-filter","net","admin","web3","internal-eth","internal-blockchain","internal-transaction","internal-debug","internal-account","internal-personal","debug","debug-tracer","debug-file-tracer","debug-handler"], + "log-level": "debug" + }` manager := runner.NewNetworkManager(anrConfig) // Construct the network using the avalanche-network-runner diff --git a/tests/utils/utils.go b/tests/utils/utils.go index 5f8c383c5..219bbee41 100644 --- a/tests/utils/utils.go +++ b/tests/utils/utils.go @@ -342,6 +342,17 @@ func CreateNativeTransferTransaction( return SignTransaction(tx, fromKey, subnetInfo.EVMChainID) } +func SendNativeTransfer( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + fromKey *ecdsa.PrivateKey, + recipient common.Address, + amount *big.Int, +) *types.Receipt { + tx := CreateNativeTransferTransaction(ctx, subnetInfo, fromKey, recipient, amount) + return SendTransactionAndWaitForSuccess(ctx, subnetInfo, tx) +} + // Sends a tx, and waits for it to be mined. // Asserts Receipt.status equals success. func sendAndWaitForTransaction( @@ -441,15 +452,31 @@ func waitForTransaction( if success { if receipt.Status == types.ReceiptStatusFailed { - fmt.Println(TraceTransaction(ctx, subnetInfo, tx)) + // Gomega will print the transaction trace + Expect(TraceTransaction(ctx, subnetInfo, receipt.TxHash)).Should(Equal("")) } - Expect(receipt.Status).Should(Equal(types.ReceiptStatusSuccessful)) } else { Expect(receipt.Status).Should(Equal(types.ReceiptStatusFailed)) } return receipt } +// Returns the first log in 'logs' that is successfully parsed by 'parser' +// Errors and prints a trace of the transaction if no log is found. +func GetEventFromLogsOrTrace[T any]( + ctx context.Context, + receipt *types.Receipt, + subnetInfo interfaces.SubnetTestInfo, + parser func(log types.Log) (T, error), +) T { + log, err := GetEventFromLogs(receipt.Logs, parser) + if err != nil { + // Gomega will print the transaction trace + Expect(TraceTransaction(ctx, subnetInfo, receipt.TxHash)).Should(Equal("")) + } + return log +} + // Returns the first log in 'logs' that is successfully parsed by 'parser' func GetEventFromLogs[T any](logs []*types.Log, parser func(log types.Log) (T, error)) (T, error) { for _, log := range logs { @@ -502,7 +529,7 @@ func CheckBalance(ctx context.Context, addr common.Address, expectedBalance *big ExpectBigEqual(bal, expectedBalance) } -func TraceTransaction(ctx context.Context, subnetInfo interfaces.SubnetTestInfo, tx *types.Transaction) string { +func TraceTransaction(ctx context.Context, subnetInfo interfaces.SubnetTestInfo, txHash common.Hash) string { url := HttpToRPCURI(subnetInfo.NodeURIs[0], subnetInfo.BlockchainID.String()) rpcClient, err := rpc.DialContext(ctx, url) Expect(err).Should(BeNil()) @@ -510,7 +537,7 @@ func TraceTransaction(ctx context.Context, subnetInfo interfaces.SubnetTestInfo, var result interface{} ct := "callTracer" - err = rpcClient.Call(&result, "debug_traceTransaction", tx.Hash().String(), tracers.TraceConfig{Tracer: &ct}) + err = rpcClient.Call(&result, "debug_traceTransaction", txHash.String(), tracers.TraceConfig{Tracer: &ct}) Expect(err).Should(BeNil()) jsonStr, err := json.Marshal(result) From 3e9235ed96b34ea8e7bd16708147eea6f2c91bc9 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 01:26:04 -0500 Subject: [PATCH 02/24] Remove native token bridge deployer address allocations from warp genesis --- tests/utils/warp-genesis.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/utils/warp-genesis.json b/tests/utils/warp-genesis.json index 012b048fc..90bce3c59 100644 --- a/tests/utils/warp-genesis.json +++ b/tests/utils/warp-genesis.json @@ -37,12 +37,6 @@ "alloc": { "0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC": { "balance": "0x52B7D2DCC80CD2E4000000" - }, - "0x1337cfd2dCff6270615B90938aCB1efE79801704": { - "balance": "0x52B7D2DCC80CD2E4000000" - }, - "0x539447ab8Be7e927bE8E005663C81ff2AE951337": { - "balance": "0x52B7D2DCC80CD2E4000000" } }, "nonce": "0x0", From 6364e01f311244742a2ea00308e634ac3039bc32 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 01:31:28 -0500 Subject: [PATCH 03/24] Abi bindings and stub --- .../NativeTokenSource/NativeTokenSource.go | 28 +++++++++---------- tests/testnet/network.go | 6 ++++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go index 0bb70bc2b..7a2a7925d 100644 --- a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go +++ b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go @@ -37,8 +37,8 @@ type TeleporterFeeInfo struct { // NativeTokenSourceMetaData contains all meta data concerning the NativeTokenSource contract. var NativeTokenSourceMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeTokenDestinationAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BurnTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"UnlockTokens\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BURNED_TX_FEES_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_NATIVE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBurnedTotal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"senderBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"transferToDestination\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", - Bin: "0x60e06040523480156200001157600080fd5b506040516200173a3803806200173a8339810160408190526200003491620002b3565b60016000556001600160a01b038316620000bb5760405162461bcd60e51b815260206004820152603360248201527f4e6174697665546f6b656e536f757263653a207a65726f2054656c65706f727460448201527f65724d657373656e67657220616464726573730000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b03831660c05281620001205760405162461bcd60e51b815260206004820152603160248201526000805160206200171a8339815191526044820152701a5bdb88189b1bd8dad8da185a5b881251607a1b6064820152608401620000b2565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000173573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001999190620002f4565b82036200020f5760405162461bcd60e51b815260206004820152603560248201527f4e6174697665546f6b656e536f757263653a2063616e6e6f742062726964676560448201527f20776974682073616d6520626c6f636b636861696e00000000000000000000006064820152608401620000b2565b60808290526001600160a01b038116620002815760405162461bcd60e51b815260206004820152603460248201526000805160206200171a83398151915260448201527f696f6e20636f6e747261637420616464726573730000000000000000000000006064820152608401620000b2565b6001600160a01b031660a052506200030e9050565b80516001600160a01b0381168114620002ae57600080fd5b919050565b600080600060608486031215620002c957600080fd5b620002d48462000296565b925060208401519150620002eb6040850162000296565b90509250925092565b6000602082840312156200030757600080fd5b5051919050565b60805160a05160c0516113ad6200036d6000396000818160ef015281816102320152818161025b015261044e015260008181610167015281816102bb015261056701526000818160920152818161029501526104e301526113ad6000f3fe60806040526004361061007b5760003560e01c8063b6171f731161004e578063b6171f731461013e578063b8c9091a14610155578063c452165e14610189578063c868efaa146101a157600080fd5b806341d3014d1461008057806355db3e9e146100c75780639b3e5803146100dd578063ad0aee2514610129575b600080fd5b34801561008c57600080fd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b3480156100d357600080fd5b506100b460015481565b3480156100e957600080fd5b506101117f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100be565b61013c610137366004610eaa565b6101c1565b005b34801561014a57600080fd5b506100b4620186a081565b34801561016157600080fd5b506101117f000000000000000000000000000000000000000000000000000000000000000081565b34801561019557600080fd5b50610111600160981b81565b3480156101ad57600080fd5b5061013c6101bc366004610f49565b61043b565b6101c96106ec565b6001600160a01b0384166101f85760405162461bcd60e51b81526004016101ef90610fc3565b60405180910390fd5b60006020840135156102575761021e610214602086018661100c565b8560200135610745565b9050610257610230602086018661100c565b7f0000000000000000000000000000000000000000000000000000000000000000836108af565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001888036038101906102f99190611077565b8152602001620186a08152602001878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604051602091820191610368918c913491016001600160a01b03929092168252602082015260400190565b6040516020818303038152906040528152506040518263ffffffff1660e01b81526004016103969190611163565b6020604051808303816000875af11580156103b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d991906111e1565b905080866001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a3460405161042191815260200190565b60405180910390a450506104356001600055565b50505050565b6104436106ec565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104e15760405162461bcd60e51b815260206004820152603c60248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201527f54656c65706f727465724d657373656e67657220636f6e74726163740000000060648201526084016101ef565b7f000000000000000000000000000000000000000000000000000000000000000084146105655760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420646573746960448201526b3730ba34b7b71031b430b4b760a11b60648201526084016101ef565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146105f55760405162461bcd60e51b815260206004820152602660248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201526539b2b73232b960d11b60648201526084016101ef565b600080610604838501856111fa565b9092509050600082600181111561061d5761061d6112a6565b0361064e576000808280602001905181019061063991906112bc565b915091506106478282610994565b50506106e0565b6001826001811115610662576106626112a6565b0361068e5760008180602001905181019061067d91906111e1565b905061068881610a6d565b506106e0565b60405162461bcd60e51b815260206004820152602160248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420616374696f6044820152603760f91b60648201526084016101ef565b50506104356001600055565b60026000540361073e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101ef565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa15801561078e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b291906111e1565b90506107c96001600160a01b038516333086610a9c565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610810573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083491906111e1565b905081811161089a5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101ef565b6108a48282611300565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610900573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092491906111e1565b61092e9190611313565b6040516001600160a01b03851660248201526044810182905290915061043590859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610ad4565b6001600160a01b0382166109ba5760405162461bcd60e51b81526004016101ef90610fc3565b80471015610a1d5760405162461bcd60e51b815260206004820152602a60248201527f4e6174697665546f6b656e536f757263653a20696e73756666696369656e742060448201526918dbdb1b185d195c985b60b21b60648201526084016101ef565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610a698282610bab565b5050565b600154811115610a9957600060015482610a879190611300565b9050610a9281610cc4565b5060018190555b50565b6040516001600160a01b03808516602483015283166044820152606481018290526104359085906323b872dd60e01b9060840161095d565b6000610b29826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610d059092919063ffffffff16565b805190915015610ba65780806020019051810190610b479190611326565b610ba65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101ef565b505050565b80471015610bfb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016101ef565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610c48576040519150601f19603f3d011682016040523d82523d6000602084013e610c4d565b606091505b5050905080610ba65760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016101ef565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610a99600160981b82610bab565b6060610d148484600085610d1c565b949350505050565b606082471015610d7d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101ef565b600080866001600160a01b03168587604051610d999190611348565b60006040518083038185875af1925050503d8060008114610dd6576040519150601f19603f3d011682016040523d82523d6000602084013e610ddb565b606091505b5091509150610dec87838387610df7565b979650505050505050565b60608315610e66578251600003610e5f576001600160a01b0385163b610e5f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101ef565b5081610d14565b610d148383815115610e7b5781518083602001fd5b8060405162461bcd60e51b81526004016101ef9190611364565b6001600160a01b0381168114610a9957600080fd5b6000806000808486036080811215610ec157600080fd5b8535610ecc81610e95565b94506040601f1982011215610ee057600080fd5b50602085019250606085013567ffffffffffffffff80821115610f0257600080fd5b818701915087601f830112610f1657600080fd5b813581811115610f2557600080fd5b8860208260051b8501011115610f3a57600080fd5b95989497505060200194505050565b60008060008060608587031215610f5f57600080fd5b843593506020850135610f7181610e95565b9250604085013567ffffffffffffffff80821115610f8e57600080fd5b818701915087601f830112610fa257600080fd5b813581811115610fb157600080fd5b886020828501011115610f3a57600080fd5b60208082526029908201527f4e6174697665546f6b656e536f757263653a207a65726f20726563697069656e60408201526874206164647265737360b81b606082015260800190565b60006020828403121561101e57600080fd5b813561102981610e95565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561106f5761106f611030565b604052919050565b60006040828403121561108957600080fd5b6040516040810181811067ffffffffffffffff821117156110ac576110ac611030565b60405282356110ba81610e95565b81526020928301359281019290925250919050565b600081518084526020808501945080840160005b838110156111085781516001600160a01b0316875295820195908201906001016110e3565b509495945050505050565b60005b8381101561112e578181015183820152602001611116565b50506000910152565b6000815180845261114f816020860160208601611113565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526111c46101008401826110cf565b905060a0840151601f198483030160e08501526108a48282611137565b6000602082840312156111f357600080fd5b5051919050565b6000806040838503121561120d57600080fd5b82356002811061121c57600080fd5b915060208381013567ffffffffffffffff8082111561123a57600080fd5b818601915086601f83011261124e57600080fd5b81358181111561126057611260611030565b611272601f8201601f19168501611046565b9150808252878482850101111561128857600080fd5b80848401858401376000848284010152508093505050509250929050565b634e487b7160e01b600052602160045260246000fd5b600080604083850312156112cf57600080fd5b82516112da81610e95565b6020939093015192949293505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156108a9576108a96112ea565b808201808211156108a9576108a96112ea565b60006020828403121561133857600080fd5b8151801515811461102957600080fd5b6000825161135a818460208701611113565b9190910192915050565b602081526000611029602083018461113756fea2646970667358221220ef957cee15f1f84359336ed70c1da014d8fd7290244e6c1645813e7729b0bea064736f6c634300081200334e6174697665546f6b656e536f757263653a207a65726f2064657374696e6174", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeTokenDestinationAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BurnTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"UnlockTokens\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BURN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_NATIVE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBurnedTotal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"senderBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"transferToDestination\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b5060405162001740380380620017408339810160408190526200003491620002b3565b60016000556001600160a01b038316620000bb5760405162461bcd60e51b815260206004820152603360248201527f4e6174697665546f6b656e536f757263653a207a65726f2054656c65706f727460448201527f65724d657373656e67657220616464726573730000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b03831660c05281620001205760405162461bcd60e51b81526020600482015260316024820152600080516020620017208339815191526044820152701a5bdb88189b1bd8dad8da185a5b881251607a1b6064820152608401620000b2565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000173573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001999190620002f4565b82036200020f5760405162461bcd60e51b815260206004820152603560248201527f4e6174697665546f6b656e536f757263653a2063616e6e6f742062726964676560448201527f20776974682073616d6520626c6f636b636861696e00000000000000000000006064820152608401620000b2565b60808290526001600160a01b038116620002815760405162461bcd60e51b815260206004820152603460248201526000805160206200172083398151915260448201527f696f6e20636f6e747261637420616464726573730000000000000000000000006064820152608401620000b2565b6001600160a01b031660a052506200030e9050565b80516001600160a01b0381168114620002ae57600080fd5b919050565b600080600060608486031215620002c957600080fd5b620002d48462000296565b925060208401519150620002eb6040850162000296565b90509250925092565b6000602082840312156200030757600080fd5b5051919050565b60805160a05160c0516113b36200036d6000396000818160ef015281816102350152818161025e0152610451015260008181610167015281816102be015261056a01526000818160920152818161029801526104e601526113b36000f3fe60806040526004361061007b5760003560e01c8063b6171f731161004e578063b6171f731461013e578063b8c9091a14610155578063c868efaa14610189578063fccc2813146101a957600080fd5b806341d3014d1461008057806355db3e9e146100c75780639b3e5803146100dd578063ad0aee2514610129575b600080fd5b34801561008c57600080fd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b3480156100d357600080fd5b506100b460015481565b3480156100e957600080fd5b506101117f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100be565b61013c610137366004610eb0565b6101c4565b005b34801561014a57600080fd5b506100b4620186a081565b34801561016157600080fd5b506101117f000000000000000000000000000000000000000000000000000000000000000081565b34801561019557600080fd5b5061013c6101a4366004610f4f565b61043e565b3480156101b557600080fd5b506101116001600160981b0181565b6101cc6106ef565b6001600160a01b0384166101fb5760405162461bcd60e51b81526004016101f290610fc9565b60405180910390fd5b600060208401351561025a576102216102176020860186611012565b8560200135610748565b905061025a6102336020860186611012565b7f0000000000000000000000000000000000000000000000000000000000000000836108b2565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001888036038101906102fc919061107d565b8152602001620186a0815260200187878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509082525060405160209182019161036b918c913491016001600160a01b03929092168252602082015260400190565b6040516020818303038152906040528152506040518263ffffffff1660e01b81526004016103999190611169565b6020604051808303816000875af11580156103b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103dc91906111e7565b905080866001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a3460405161042491815260200190565b60405180910390a450506104386001600055565b50505050565b6104466106ef565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104e45760405162461bcd60e51b815260206004820152603c60248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201527f54656c65706f727465724d657373656e67657220636f6e74726163740000000060648201526084016101f2565b7f000000000000000000000000000000000000000000000000000000000000000084146105685760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420646573746960448201526b3730ba34b7b71031b430b4b760a11b60648201526084016101f2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146105f85760405162461bcd60e51b815260206004820152602660248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201526539b2b73232b960d11b60648201526084016101f2565b60008061060783850185611200565b90925090506000826001811115610620576106206112ac565b03610651576000808280602001905181019061063c91906112c2565b9150915061064a8282610997565b50506106e3565b6001826001811115610665576106656112ac565b036106915760008180602001905181019061068091906111e7565b905061068b81610a70565b506106e3565b60405162461bcd60e51b815260206004820152602160248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420616374696f6044820152603760f91b60648201526084016101f2565b50506104386001600055565b6002600054036107415760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101f2565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b591906111e7565b90506107cc6001600160a01b038516333086610a9f565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610813573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083791906111e7565b905081811161089d5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101f2565b6108a78282611306565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610903573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092791906111e7565b6109319190611319565b6040516001600160a01b03851660248201526044810182905290915061043890859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610ad7565b6001600160a01b0382166109bd5760405162461bcd60e51b81526004016101f290610fc9565b80471015610a205760405162461bcd60e51b815260206004820152602a60248201527f4e6174697665546f6b656e536f757263653a20696e73756666696369656e742060448201526918dbdb1b185d195c985b60b21b60648201526084016101f2565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610a6c8282610bae565b5050565b600154811115610a9c57600060015482610a8a9190611306565b9050610a9581610cc7565b5060018190555b50565b6040516001600160a01b03808516602483015283166044820152606481018290526104389085906323b872dd60e01b90608401610960565b6000610b2c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610d0b9092919063ffffffff16565b805190915015610ba95780806020019051810190610b4a919061132c565b610ba95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101f2565b505050565b80471015610bfe5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016101f2565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610c4b576040519150601f19603f3d011682016040523d82523d6000602084013e610c50565b606091505b5050905080610ba95760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016101f2565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610a9c6001600160981b0182610bae565b6060610d1a8484600085610d22565b949350505050565b606082471015610d835760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101f2565b600080866001600160a01b03168587604051610d9f919061134e565b60006040518083038185875af1925050503d8060008114610ddc576040519150601f19603f3d011682016040523d82523d6000602084013e610de1565b606091505b5091509150610df287838387610dfd565b979650505050505050565b60608315610e6c578251600003610e65576001600160a01b0385163b610e655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f2565b5081610d1a565b610d1a8383815115610e815781518083602001fd5b8060405162461bcd60e51b81526004016101f2919061136a565b6001600160a01b0381168114610a9c57600080fd5b6000806000808486036080811215610ec757600080fd5b8535610ed281610e9b565b94506040601f1982011215610ee657600080fd5b50602085019250606085013567ffffffffffffffff80821115610f0857600080fd5b818701915087601f830112610f1c57600080fd5b813581811115610f2b57600080fd5b8860208260051b8501011115610f4057600080fd5b95989497505060200194505050565b60008060008060608587031215610f6557600080fd5b843593506020850135610f7781610e9b565b9250604085013567ffffffffffffffff80821115610f9457600080fd5b818701915087601f830112610fa857600080fd5b813581811115610fb757600080fd5b886020828501011115610f4057600080fd5b60208082526029908201527f4e6174697665546f6b656e536f757263653a207a65726f20726563697069656e60408201526874206164647265737360b81b606082015260800190565b60006020828403121561102457600080fd5b813561102f81610e9b565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561107557611075611036565b604052919050565b60006040828403121561108f57600080fd5b6040516040810181811067ffffffffffffffff821117156110b2576110b2611036565b60405282356110c081610e9b565b81526020928301359281019290925250919050565b600081518084526020808501945080840160005b8381101561110e5781516001600160a01b0316875295820195908201906001016110e9565b509495945050505050565b60005b8381101561113457818101518382015260200161111c565b50506000910152565b60008151808452611155816020860160208601611119565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526111ca6101008401826110d5565b905060a0840151601f198483030160e08501526108a7828261113d565b6000602082840312156111f957600080fd5b5051919050565b6000806040838503121561121357600080fd5b82356002811061122257600080fd5b915060208381013567ffffffffffffffff8082111561124057600080fd5b818601915086601f83011261125457600080fd5b81358181111561126657611266611036565b611278601f8201601f1916850161104c565b9150808252878482850101111561128e57600080fd5b80848401858401376000848284010152508093505050509250929050565b634e487b7160e01b600052602160045260246000fd5b600080604083850312156112d557600080fd5b82516112e081610e9b565b6020939093015192949293505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156108ac576108ac6112f0565b808201808211156108ac576108ac6112f0565b60006020828403121561133e57600080fd5b8151801515811461102f57600080fd5b60008251611360818460208701611119565b9190910192915050565b60208152600061102f602083018461113d56fea264697066735822122071bd9a76f33a49da172aa34793cd1c054eb702ad51a79d3226641c39be3c19f164736f6c634300081200334e6174697665546f6b656e536f757263653a207a65726f2064657374696e6174", } // NativeTokenSourceABI is the input ABI used to generate the binding from. @@ -208,12 +208,12 @@ func (_NativeTokenSource *NativeTokenSourceTransactorRaw) Transact(opts *bind.Tr return _NativeTokenSource.Contract.contract.Transact(opts, method, params...) } -// BURNEDTXFEESADDRESS is a free data retrieval call binding the contract method 0xc452165e. +// BURNADDRESS is a free data retrieval call binding the contract method 0xfccc2813. // -// Solidity: function BURNED_TX_FEES_ADDRESS() view returns(address) -func (_NativeTokenSource *NativeTokenSourceCaller) BURNEDTXFEESADDRESS(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function BURN_ADDRESS() view returns(address) +func (_NativeTokenSource *NativeTokenSourceCaller) BURNADDRESS(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _NativeTokenSource.contract.Call(opts, &out, "BURNED_TX_FEES_ADDRESS") + err := _NativeTokenSource.contract.Call(opts, &out, "BURN_ADDRESS") if err != nil { return *new(common.Address), err @@ -225,18 +225,18 @@ func (_NativeTokenSource *NativeTokenSourceCaller) BURNEDTXFEESADDRESS(opts *bin } -// BURNEDTXFEESADDRESS is a free data retrieval call binding the contract method 0xc452165e. +// BURNADDRESS is a free data retrieval call binding the contract method 0xfccc2813. // -// Solidity: function BURNED_TX_FEES_ADDRESS() view returns(address) -func (_NativeTokenSource *NativeTokenSourceSession) BURNEDTXFEESADDRESS() (common.Address, error) { - return _NativeTokenSource.Contract.BURNEDTXFEESADDRESS(&_NativeTokenSource.CallOpts) +// Solidity: function BURN_ADDRESS() view returns(address) +func (_NativeTokenSource *NativeTokenSourceSession) BURNADDRESS() (common.Address, error) { + return _NativeTokenSource.Contract.BURNADDRESS(&_NativeTokenSource.CallOpts) } -// BURNEDTXFEESADDRESS is a free data retrieval call binding the contract method 0xc452165e. +// BURNADDRESS is a free data retrieval call binding the contract method 0xfccc2813. // -// Solidity: function BURNED_TX_FEES_ADDRESS() view returns(address) -func (_NativeTokenSource *NativeTokenSourceCallerSession) BURNEDTXFEESADDRESS() (common.Address, error) { - return _NativeTokenSource.Contract.BURNEDTXFEESADDRESS(&_NativeTokenSource.CallOpts) +// Solidity: function BURN_ADDRESS() view returns(address) +func (_NativeTokenSource *NativeTokenSourceCallerSession) BURNADDRESS() (common.Address, error) { + return _NativeTokenSource.Contract.BURNADDRESS(&_NativeTokenSource.CallOpts) } // MINTNATIVETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0xb6171f73. diff --git a/tests/testnet/network.go b/tests/testnet/network.go index b7ce8cdfb..9144e5eae 100644 --- a/tests/testnet/network.go +++ b/tests/testnet/network.go @@ -56,6 +56,12 @@ type testNetwork struct { fundedKey *ecdsa.PrivateKey } +// GetPrimaryNetworkInfo implements interfaces.Network. +func (*testNetwork) GetPrimaryNetworkInfo() interfaces.SubnetTestInfo { + // TODO + panic("unimplemented") +} + func initializeSubnetInfo( subnetPrefix string, teleporterContractAddress common.Address, From a8b893acb58276d5d4e7e7e3df7ea40093e0c261 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 01:34:21 -0500 Subject: [PATCH 04/24] linter --- .../tests/NativeTokenSourceTests.t.sol | 4 +--- tests/flows/native_token_bridge.go | 1 + tests/local/network.go | 10 ++++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol index 6e32993fb..00695ac25 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol @@ -177,9 +177,7 @@ contract NativeTokenSourceTest is Test { ); assertEq(burnedTxFees + additionalTxFees, nativeTokenSource.destinationBurnedTotal()); - assertEq( - burnedTxFees + additionalTxFees, nativeTokenSource.BURN_ADDRESS().balance - ); + assertEq(burnedTxFees + additionalTxFees, nativeTokenSource.BURN_ADDRESS().balance); } function testZeroTeleporterAddress() public { diff --git a/tests/flows/native_token_bridge.go b/tests/flows/native_token_bridge.go index ef7f9bb6f..7ce29c159 100644 --- a/tests/flows/native_token_bridge.go +++ b/tests/flows/native_token_bridge.go @@ -295,6 +295,7 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { sourceChainReceipt.Logs, nativeTokenSource.ParseBurnTokens, ) + Expect(err).Should(BeNil()) utils.ExpectBigEqual(burnedTxFeesBalanceDest, burnEvent.Amount) burnedTxFeesBalanceSource2, err := sourceSubnet.WSClient.BalanceAt( diff --git a/tests/local/network.go b/tests/local/network.go index 1e88428c7..98165e2b0 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -79,7 +79,10 @@ func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { Expect(err).Should(BeNil()) _, err = f.Write([]byte(`{ "warp-api-enabled": true, - "eth-apis":["eth","eth-filter","net","admin","web3","internal-eth","internal-blockchain","internal-transaction","internal-debug","internal-account","internal-personal","debug","debug-tracer","debug-file-tracer","debug-handler"] + "eth-apis":["eth","eth-filter","net","admin","web3", + "internal-eth","internal-blockchain","internal-transaction", + "internal-debug","internal-account","internal-personal", + "debug","debug-tracer","debug-file-tracer","debug-handler"] }`)) Expect(err).Should(BeNil()) warpChainConfigPath := f.Name() @@ -91,7 +94,10 @@ func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { anrConfig := runner.NewDefaultANRConfig() anrConfig.GlobalCChainConfig = `{ "warp-api-enabled": true, - "eth-apis":["eth","eth-filter","net","admin","web3","internal-eth","internal-blockchain","internal-transaction","internal-debug","internal-account","internal-personal","debug","debug-tracer","debug-file-tracer","debug-handler"], + "eth-apis":["eth","eth-filter","net","admin","web3", + "internal-eth","internal-blockchain","internal-transaction", + "internal-debug","internal-account","internal-personal", + "debug","debug-tracer","debug-file-tracer","debug-handler"], "log-level": "debug" }` manager := runner.NewNetworkManager(anrConfig) From 1fcf7dcedbdd92df51bec0ca3157fcde83aef3d2 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 02:20:29 -0500 Subject: [PATCH 05/24] Fix test --- .../ERC20TokenSource/ERC20TokenSource.go | 2 +- .../NativeTokenDestination.go | 2 +- .../NativeTokenSource/NativeTokenSource.go | 2 +- .../NativeTokenBridge/ERC20TokenSource.sol | 2 +- .../NativeTokenDestination.sol | 2 +- .../NativeTokenBridge/NativeTokenSource.sol | 2 +- tests/flows/erc20_to_native_token_bridge.go | 51 +++++++++---------- tests/flows/native_token_bridge.go | 9 ++-- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go index 261277048..c29944073 100644 --- a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go +++ b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go @@ -32,7 +32,7 @@ var ( // ERC20TokenSourceMetaData contains all meta data concerning the ERC20TokenSource contract. var ERC20TokenSourceMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeTokenDestinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"erc20ContractAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BurnTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"UnlockTokens\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BURNED_TX_FEES_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_NATIVE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBurnedTotal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"erc20ContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"senderBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"transferToDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101006040523480156200001257600080fd5b50604051620016f1380380620016f183398101604081905262000035916200031d565b60016000556001600160a01b038416620000b15760405162461bcd60e51b815260206004820152603260248201527f4552433230546f6b656e536f757263653a207a65726f2054656c65706f727465604482015271724d657373656e676572206164647265737360701b60648201526084015b60405180910390fd5b6001600160a01b03841660e05282620001155760405162461bcd60e51b81526020600482015260306024820152600080516020620016d183398151915260448201526f1bdb88189b1bd8dad8da185a5b88125160821b6064820152608401620000a8565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000168573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200018e919062000371565b8303620002045760405162461bcd60e51b815260206004820152603460248201527f4552433230546f6b656e536f757263653a2063616e6e6f74206272696467652060448201527f776974682073616d6520626c6f636b636861696e0000000000000000000000006064820152608401620000a8565b60808390526001600160a01b038216620002765760405162461bcd60e51b81526020600482015260336024820152600080516020620016d183398151915260448201527f6f6e20636f6e74726163742061646472657373000000000000000000000000006064820152608401620000a8565b6001600160a01b0380831660a0528116620002ea5760405162461bcd60e51b815260206004820152602d60248201527f4552433230546f6b656e536f757263653a207a65726f20455243323020636f6e60448201526c7472616374206164647265737360981b6064820152608401620000a8565b6001600160a01b031660c052506200038b915050565b80516001600160a01b03811681146200031857600080fd5b919050565b600080600080608085870312156200033457600080fd5b6200033f8562000300565b935060208501519250620003566040860162000300565b9150620003666060860162000300565b905092959194509250565b6000602082840312156200038457600080fd5b5051919050565b60805160a05160c05160e0516112ba620004176000396000818160f50152818161029c015281816102d301526104ed015260008181610183015281816101e30152818161027b0152818161036d01528181610a9a0152610c6a01526000818161013e015281816103330152610605015260008181609d0152818161030d015261058201526112ba6000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063b6171f7311610066578063b6171f731461012f578063b8c9091a14610139578063c452165e14610160578063c868efaa1461016b578063e486df151461017e57600080fd5b806341d3014d1461009857806355db3e9e146100d257806387a2edba146100db5780639b3e5803146100f0575b600080fd5b6100bf7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100bf60015481565b6100ee6100e9366004610e39565b6101a5565b005b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c9565b6100bf620186a081565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b610117600160981b81565b6100ee610179366004610ed2565b6104da565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6101ad610785565b6001600160a01b0385166101dc5760405162461bcd60e51b81526004016101d390610f5b565b60405180910390fd5b60006102087f0000000000000000000000000000000000000000000000000000000000000000866107de565b90508381116102705760405162461bcd60e51b815260206004820152602e60248201527f4552433230546f6b656e536f757263653a20696e73756666696369656e74206160448201526d191a9d5cdd195908185b5bdd5b9d60921b60648201526084016101d3565b83156102c1576102c17f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000086610948565b60006102cd8583610fb9565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200160405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018b8152508152602001620186a08152602001888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516001600160a01b038e166020808301919091529181018890529101906060016040516020818303038152906040528152506040518263ffffffff1660e01b81526004016104339190611060565b6020604051808303816000875af1158015610452573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047691906110de565b905080886001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a856040516104be91815260200190565b60405180910390a45050506104d36001600055565b5050505050565b6104e2610785565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105805760405162461bcd60e51b815260206004820152603b60248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564205460448201527f656c65706f727465724d657373656e67657220636f6e7472616374000000000060648201526084016101d3565b7f000000000000000000000000000000000000000000000000000000000000000084146106035760405162461bcd60e51b815260206004820152602b60248201527f4552433230546f6b656e536f757263653a20696e76616c69642064657374696e60448201526a30ba34b7b71031b430b4b760a91b60648201526084016101d3565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146106925760405162461bcd60e51b815260206004820152602560248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564207360448201526432b73232b960d91b60648201526084016101d3565b6000806106a18385018561110d565b909250905060008260018111156106ba576106ba6111d5565b036106eb57600080828060200190518101906106d691906111eb565b915091506106e48282610a2d565b5050610773565b60018260018111156106ff576106ff6111d5565b0361072b5760008180602001905181019061071a91906110de565b905061072581610ac4565b50610773565b60405162461bcd60e51b815260206004820181905260248201527f4552433230546f6b656e536f757263653a20696e76616c696420616374696f6e60448201526064016101d3565b505061077f6001600055565b50505050565b6002600054036107d75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101d3565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610827573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084b91906110de565b90506108626001600160a01b038516333086610af3565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa1580156108a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cd91906110de565b90508181116109335760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101d3565b61093d8282610fb9565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bd91906110de565b6109c79190611219565b6040516001600160a01b03851660248201526044810182905290915061077f90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b2b565b6001600160a01b038216610a535760405162461bcd60e51b81526004016101d390610f5b565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610ac07f00000000000000000000000000000000000000000000000000000000000000008383610c02565b5050565b600154811115610af057600060015482610ade9190610fb9565b9050610ae981610c32565b5060018190555b50565b6040516001600160a01b038085166024830152831660448201526064810182905261077f9085906323b872dd60e01b906084016109f6565b6000610b80826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c949092919063ffffffff16565b805190915015610bfd5780806020019051810190610b9e919061122c565b610bfd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101d3565b505050565b6040516001600160a01b038316602482015260448101829052610bfd90849063a9059cbb60e01b906064016109f6565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610af07f0000000000000000000000000000000000000000000000000000000000000000600160981b83610c02565b6060610ca38484600085610cab565b949350505050565b606082471015610d0c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101d3565b600080866001600160a01b03168587604051610d289190611255565b60006040518083038185875af1925050503d8060008114610d65576040519150601f19603f3d011682016040523d82523d6000602084013e610d6a565b606091505b5091509150610d7b87838387610d86565b979650505050505050565b60608315610df5578251600003610dee576001600160a01b0385163b610dee5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101d3565b5081610ca3565b610ca38383815115610e0a5781518083602001fd5b8060405162461bcd60e51b81526004016101d39190611271565b6001600160a01b0381168114610af057600080fd5b600080600080600060808688031215610e5157600080fd5b8535610e5c81610e24565b94506020860135935060408601359250606086013567ffffffffffffffff80821115610e8757600080fd5b818801915088601f830112610e9b57600080fd5b813581811115610eaa57600080fd5b8960208260051b8501011115610ebf57600080fd5b9699959850939650602001949392505050565b60008060008060608587031215610ee857600080fd5b843593506020850135610efa81610e24565b9250604085013567ffffffffffffffff80821115610f1757600080fd5b818701915087601f830112610f2b57600080fd5b813581811115610f3a57600080fd5b886020828501011115610f4c57600080fd5b95989497505060200194505050565b60208082526028908201527f4552433230546f6b656e536f757263653a207a65726f20726563697069656e74604082015267206164647265737360c01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561094257610942610fa3565b600081518084526020808501945080840160005b838110156110055781516001600160a01b031687529582019590820190600101610fe0565b509495945050505050565b60005b8381101561102b578181015183820152602001611013565b50506000910152565b6000815180845261104c816020860160208601611010565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526110c1610100840182610fcc565b905060a0840151601f198483030160e085015261093d8282611034565b6000602082840312156110f057600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561112057600080fd5b82356002811061112f57600080fd5b9150602083013567ffffffffffffffff8082111561114c57600080fd5b818501915085601f83011261116057600080fd5b813581811115611172576111726110f7565b604051601f8201601f19908116603f0116810190838211818310171561119a5761119a6110f7565b816040528281528860208487010111156111b357600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b634e487b7160e01b600052602160045260246000fd5b600080604083850312156111fe57600080fd5b825161120981610e24565b6020939093015192949293505050565b8082018082111561094257610942610fa3565b60006020828403121561123e57600080fd5b8151801515811461124e57600080fd5b9392505050565b60008251611267818460208701611010565b9190910192915050565b60208152600061124e602083018461103456fea26469706673582212206db92aab8e09f9f85b4abd58bbc94a7f36273b9aa5f1dfff3f5f3f7a6060434a64736f6c634300081200334552433230546f6b656e536f757263653a207a65726f2064657374696e617469", + Bin: "0x6101006040523480156200001257600080fd5b50604051620016fb380380620016fb83398101604081905262000035916200031d565b60016000556001600160a01b038416620000b15760405162461bcd60e51b815260206004820152603260248201527f4552433230546f6b656e536f757263653a207a65726f2054656c65706f727465604482015271724d657373656e676572206164647265737360701b60648201526084015b60405180910390fd5b6001600160a01b03841660e05282620001155760405162461bcd60e51b81526020600482015260306024820152600080516020620016db83398151915260448201526f1bdb88189b1bd8dad8da185a5b88125160821b6064820152608401620000a8565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000168573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200018e919062000371565b8303620002045760405162461bcd60e51b815260206004820152603460248201527f4552433230546f6b656e536f757263653a2063616e6e6f74206272696467652060448201527f776974682073616d6520626c6f636b636861696e0000000000000000000000006064820152608401620000a8565b60808390526001600160a01b038216620002765760405162461bcd60e51b81526020600482015260336024820152600080516020620016db83398151915260448201527f6f6e20636f6e74726163742061646472657373000000000000000000000000006064820152608401620000a8565b6001600160a01b0380831660a0528116620002ea5760405162461bcd60e51b815260206004820152602d60248201527f4552433230546f6b656e536f757263653a207a65726f20455243323020636f6e60448201526c7472616374206164647265737360981b6064820152608401620000a8565b6001600160a01b031660c052506200038b915050565b80516001600160a01b03811681146200031857600080fd5b919050565b600080600080608085870312156200033457600080fd5b6200033f8562000300565b935060208501519250620003566040860162000300565b9150620003666060860162000300565b905092959194509250565b6000602082840312156200038457600080fd5b5051919050565b60805160a05160c05160e0516112c4620004176000396000818160f5015281816102a1015281816102d801526104f2015260008181610188015281816101e8015281816102800152818161037201528181610a9f0152610c6f01526000818161013e01528181610338015261060a015260008181609d01528181610312015261058701526112c46000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063b6171f7311610066578063b6171f731461012f578063b8c9091a14610139578063c452165e14610160578063c868efaa14610170578063e486df151461018357600080fd5b806341d3014d1461009857806355db3e9e146100d257806387a2edba146100db5780639b3e5803146100f0575b600080fd5b6100bf7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100bf60015481565b6100ee6100e9366004610e43565b6101aa565b005b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c9565b6100bf620186a081565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b61011762010203600160981b0181565b6100ee61017e366004610edc565b6104df565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6101b261078a565b6001600160a01b0385166101e15760405162461bcd60e51b81526004016101d890610f65565b60405180910390fd5b600061020d7f0000000000000000000000000000000000000000000000000000000000000000866107e3565b90508381116102755760405162461bcd60e51b815260206004820152602e60248201527f4552433230546f6b656e536f757263653a20696e73756666696369656e74206160448201526d191a9d5cdd195908185b5bdd5b9d60921b60648201526084016101d8565b83156102c6576102c67f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008661094d565b60006102d28583610fc3565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200160405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018b8152508152602001620186a08152602001888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516001600160a01b038e166020808301919091529181018890529101906060016040516020818303038152906040528152506040518263ffffffff1660e01b8152600401610438919061106a565b6020604051808303816000875af1158015610457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906110e8565b905080886001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a856040516104c391815260200190565b60405180910390a45050506104d86001600055565b5050505050565b6104e761078a565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105855760405162461bcd60e51b815260206004820152603b60248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564205460448201527f656c65706f727465724d657373656e67657220636f6e7472616374000000000060648201526084016101d8565b7f000000000000000000000000000000000000000000000000000000000000000084146106085760405162461bcd60e51b815260206004820152602b60248201527f4552433230546f6b656e536f757263653a20696e76616c69642064657374696e60448201526a30ba34b7b71031b430b4b760a91b60648201526084016101d8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146106975760405162461bcd60e51b815260206004820152602560248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564207360448201526432b73232b960d91b60648201526084016101d8565b6000806106a683850185611117565b909250905060008260018111156106bf576106bf6111df565b036106f057600080828060200190518101906106db91906111f5565b915091506106e98282610a32565b5050610778565b6001826001811115610704576107046111df565b036107305760008180602001905181019061071f91906110e8565b905061072a81610ac9565b50610778565b60405162461bcd60e51b815260206004820181905260248201527f4552433230546f6b656e536f757263653a20696e76616c696420616374696f6e60448201526064016101d8565b50506107846001600055565b50505050565b6002600054036107dc5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101d8565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085091906110e8565b90506108676001600160a01b038516333086610af8565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa1580156108ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d291906110e8565b90508181116109385760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101d8565b6109428282610fc3565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801561099e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c291906110e8565b6109cc9190611223565b6040516001600160a01b03851660248201526044810182905290915061078490859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b30565b6001600160a01b038216610a585760405162461bcd60e51b81526004016101d890610f65565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610ac57f00000000000000000000000000000000000000000000000000000000000000008383610c07565b5050565b600154811115610af557600060015482610ae39190610fc3565b9050610aee81610c37565b5060018190555b50565b6040516001600160a01b03808516602483015283166044820152606481018290526107849085906323b872dd60e01b906084016109fb565b6000610b85826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c9e9092919063ffffffff16565b805190915015610c025780806020019051810190610ba39190611236565b610c025760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101d8565b505050565b6040516001600160a01b038316602482015260448101829052610c0290849063a9059cbb60e01b906064016109fb565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610af57f000000000000000000000000000000000000000000000000000000000000000062010203600160981b0183610c07565b6060610cad8484600085610cb5565b949350505050565b606082471015610d165760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101d8565b600080866001600160a01b03168587604051610d32919061125f565b60006040518083038185875af1925050503d8060008114610d6f576040519150601f19603f3d011682016040523d82523d6000602084013e610d74565b606091505b5091509150610d8587838387610d90565b979650505050505050565b60608315610dff578251600003610df8576001600160a01b0385163b610df85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101d8565b5081610cad565b610cad8383815115610e145781518083602001fd5b8060405162461bcd60e51b81526004016101d8919061127b565b6001600160a01b0381168114610af557600080fd5b600080600080600060808688031215610e5b57600080fd5b8535610e6681610e2e565b94506020860135935060408601359250606086013567ffffffffffffffff80821115610e9157600080fd5b818801915088601f830112610ea557600080fd5b813581811115610eb457600080fd5b8960208260051b8501011115610ec957600080fd5b9699959850939650602001949392505050565b60008060008060608587031215610ef257600080fd5b843593506020850135610f0481610e2e565b9250604085013567ffffffffffffffff80821115610f2157600080fd5b818701915087601f830112610f3557600080fd5b813581811115610f4457600080fd5b886020828501011115610f5657600080fd5b95989497505060200194505050565b60208082526028908201527f4552433230546f6b656e536f757263653a207a65726f20726563697069656e74604082015267206164647265737360c01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561094757610947610fad565b600081518084526020808501945080840160005b8381101561100f5781516001600160a01b031687529582019590820190600101610fea565b509495945050505050565b60005b8381101561103557818101518382015260200161101d565b50506000910152565b6000815180845261105681602086016020860161101a565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526110cb610100840182610fd6565b905060a0840151601f198483030160e0850152610942828261103e565b6000602082840312156110fa57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561112a57600080fd5b82356002811061113957600080fd5b9150602083013567ffffffffffffffff8082111561115657600080fd5b818501915085601f83011261116a57600080fd5b81358181111561117c5761117c611101565b604051601f8201601f19908116603f011681019083821181831017156111a4576111a4611101565b816040528281528860208487010111156111bd57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b634e487b7160e01b600052602160045260246000fd5b6000806040838503121561120857600080fd5b825161121381610e2e565b6020939093015192949293505050565b8082018082111561094757610947610fad565b60006020828403121561124857600080fd5b8151801515811461125857600080fd5b9392505050565b6000825161127181846020870161101a565b9190910192915050565b602081526000611258602083018461103e56fea2646970667358221220402d136387198fbb8c71367b1381e6ab3b5b22f4cd83c1c744100881fea1067764736f6c634300081200334552433230546f6b656e536f757263653a207a65726f2064657374696e617469", } // ERC20TokenSourceABI is the input ABI used to generate the binding from. diff --git a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenDestination/NativeTokenDestination.go b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenDestination/NativeTokenDestination.go index 4017e2666..c9be14453 100644 --- a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenDestination/NativeTokenDestination.go +++ b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenDestination/NativeTokenDestination.go @@ -38,7 +38,7 @@ type TeleporterFeeInfo struct { // NativeTokenDestinationMetaData contains all meta data concerning the NativeTokenDestination contract. var NativeTokenDestinationMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeTokenSourceAddress_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"initialReserveImbalance_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"name\":\"CollateralAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NativeTokensMinted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAddressBalance\",\"type\":\"uint256\"}],\"name\":\"ReportTotalBurnedTxFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferToSource\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BURNED_TX_FEES_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BURN_FOR_TRANSFER_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REPORT_BURNED_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TRANSFER_NATIVE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentReserveImbalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialReserveImbalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isCollateralized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenSourceAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"senderBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"reportTotalBurnedTxFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourceBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalMinted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"transferToSource\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", - Bin: "0x6101206040527302000000000000000000000000000000000000016080523480156200002a57600080fd5b5060405162001bf138038062001bf18339810160408190526200004d9162000350565b60016000556001600160a01b038416620000d45760405162461bcd60e51b815260206004820152603860248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2054656c60448201527f65706f727465724d657373656e6765722061646472657373000000000000000060648201526084015b60405180910390fd5b6001600160a01b03841661010052826200013a5760405162461bcd60e51b8152602060048201526031602482015260008051602062001bd18339815191526044820152701c98d948189b1bd8dad8da185a5b881251607a1b6064820152608401620000cb565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200018d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001b3919062000399565b8303620002295760405162461bcd60e51b815260206004820152603a60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a2063616e6e6f74206260448201527f726964676520776974682073616d6520626c6f636b636861696e0000000000006064820152608401620000cb565b60a08390526001600160a01b0382166200029b5760405162461bcd60e51b8152602060048201526034602482015260008051602062001bd183398151915260448201527f72636520636f6e747261637420616464726573730000000000000000000000006064820152608401620000cb565b6001600160a01b03821660c0526000819003620003215760405162461bcd60e51b815260206004820152603660248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f20696e6960448201527f7469616c207265736572766520696d62616c616e6365000000000000000000006064820152608401620000cb565b60e081905260015550620003b3915050565b80516001600160a01b03811681146200034b57600080fd5b919050565b600080600080608085870312156200036757600080fd5b620003728562000333565b935060208501519250620003896040860162000333565b6060959095015193969295505050565b600060208284031215620003ac57600080fd5b5051919050565b60805160a05160c05160e0516101005161178c62000445600039600081816102440152818161035c015281816105fe01528181610638015261084801526000818161021001526103060152600081816101b1015281816103bc01528181610698015261096b01526000818161013c015281816103960152818161067201526108e701526000610bdc015261178c6000f3fe6080604052600436106100e75760003560e01c80638ac7dd201161008a578063ab28523011610059578063ab28523014610297578063c452165e146102ae578063c868efaa146102c6578063d30951261461029757600080fd5b80638ac7dd20146101fe5780639b3e580314610232578063a2309ff814610266578063a2a950171461027c57600080fd5b80633a94fe51116100c65780633a94fe511461015e57806349e3284e146101805780635d93f9af1461019f57806375846562146101eb57600080fd5b8062d872ae146100ec57806318160ddd1461011557806329b7b3fd1461012a575b600080fd5b3480156100f857600080fd5b5061010260015481565b6040519081526020015b60405180910390f35b34801561012157600080fd5b506101026102e6565b34801561013657600080fd5b506101027f000000000000000000000000000000000000000000000000000000000000000081565b34801561016a57600080fd5b5061017e61017936600461130a565b610345565b005b34801561018c57600080fd5b506001546040519015815260200161010c565b3480156101ab57600080fd5b506101d37f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161010c565b61017e6101f9366004611376565b610520565b34801561020a57600080fd5b506101027f000000000000000000000000000000000000000000000000000000000000000081565b34801561023e57600080fd5b506101d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561027257600080fd5b5061010260025481565b34801561028857600080fd5b506101d36001600160981b0181565b3480156102a357600080fd5b50610102620186a081565b3480156102ba57600080fd5b506101d3600160981b81565b3480156102d257600080fd5b5061017e6102e13660046113da565b610835565b6000806103006001600160981b0131600160981b31611479565b905060007f00000000000000000000000000000000000000000000000000000000000000006002546103329190611479565b905061033e828261148c565b9250505090565b6000600160981b6001600160a01b031631905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001888036038101906103fa919061149f565b8152602001620186a081526020018787808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208082018990528251808303820181528284019093529092019161046c91600191606001611555565b6040516020818303038152906040528152506040518263ffffffff1660e01b815260040161049a91906115d0565b6020604051808303816000875af11580156104b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104dd919061164e565b9050807f2550fa6041684d40e635e29e93dde9017d70c25b46aa88393317b5182ed6ae7c8360405161051191815260200190565b60405180910390a25050505050565b610528610c46565b6001600160a01b0384166105575760405162461bcd60e51b815260040161054e90611667565b60405180910390fd5b600154156105c45760405162461bcd60e51b815260206004820152603460248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20636f6e7472616374604482015273081d5b99195c98dbdb1b185d195c985b1a5e995960621b606482015260840161054e565b6000602084013515610623576105ea6105e060208601866116b5565b8560200135610c9f565b90506106236105fc60208601866116b5565b7f000000000000000000000000000000000000000000000000000000000000000083610e09565b6106346001600160981b0134610eee565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001888036038101906106d6919061149f565b8152602001620186a081526020018787808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250938552505060405160209384019361074492508d913491016001600160a01b03929092168252602082015260400190565b60408051601f19818403018152908290526107629291602001611555565b6040516020818303038152906040528152506040518263ffffffff1660e01b815260040161079091906115d0565b6020604051808303816000875af11580156107af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d3919061164e565b905080866001600160a01b0316336001600160a01b03167f0322cbb1d3c23f6dbf1deddb3b4ef3ce0f93ae6eec7b44e4f395804104466d143460405161081b91815260200190565b60405180910390a4505061082f6001600055565b50505050565b61083d610c46565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108e55760405162461bcd60e51b815260206004820152604160248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20756e617574686f7260448201527f697a65642054656c65706f727465724d657373656e67657220636f6e747261636064820152601d60fa1b608482015260a40161054e565b7f000000000000000000000000000000000000000000000000000000000000000084146109695760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20696e76616c69642060448201526b39b7bab931b29031b430b4b760a11b606482015260840161054e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146109fe5760405162461bcd60e51b815260206004820152602b60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20756e617574686f7260448201526a34bd32b21039b2b73232b960a91b606482015260840161054e565b600080610a0d838501856116d9565b90925090506001600160a01b038216610a385760405162461bcd60e51b815260040161054e90611667565b80600003610a9c5760405162461bcd60e51b815260206004820152602b60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2074726160448201526a6e736665722076616c756560a81b606482015260840161054e565b600154819015610b6157600154821115610b055760015460408051918252600060208301527f244160b15e69cc411f041d94ae7fab6f6bba85dade8403216c05ff4b920d5449910160405180910390a1600154610af9908361148c565b60006001559050610b61565b8160016000828254610b17919061148c565b90915550506001546040805184815260208101929092527f244160b15e69cc411f041d94ae7fab6f6bba85dade8403216c05ff4b920d5449910160405180910390a1505050610c3c565b8060026000828254610b739190611479565b90915550506040518181526001600160a01b038416907fd949ea0e9d5db53492d77f28fd5467fb2f6c4f5b88e3350e3c36729b76e99cf29060200160405180910390a26040516327ad555d60e11b81526001600160a01b038481166004830152602482018390527f00000000000000000000000000000000000000000000000000000000000000001690634f5aaaba90604401600060405180830381600087803b158015610c2057600080fd5b505af1158015610c34573d6000803e3d6000fd5b505050505050505b61082f6001600055565b600260005403610c985760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161054e565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c919061164e565b9050610d236001600160a01b03851633308661100c565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610d6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8e919061164e565b9050818111610df45760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b606482015260840161054e565b610dfe828261148c565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610e5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7e919061164e565b610e889190611479565b6040516001600160a01b03851660248201526044810182905290915061082f90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611044565b80471015610f3e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161054e565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610f8b576040519150601f19603f3d011682016040523d82523d6000602084013e610f90565b606091505b50509050806110075760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161054e565b505050565b6040516001600160a01b038085166024830152831660448201526064810182905261082f9085906323b872dd60e01b90608401610eb7565b6000611099826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111169092919063ffffffff16565b80519091501561100757808060200190518101906110b79190611705565b6110075760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161054e565b6060611125848460008561112d565b949350505050565b60608247101561118e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161054e565b600080866001600160a01b031685876040516111aa9190611727565b60006040518083038185875af1925050503d80600081146111e7576040519150601f19603f3d011682016040523d82523d6000602084013e6111ec565b606091505b50915091506111fd87838387611208565b979650505050505050565b60608315611277578251600003611270576001600160a01b0385163b6112705760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161054e565b5081611125565b611125838381511561128c5781518083602001fd5b8060405162461bcd60e51b815260040161054e9190611743565b6000604082840312156112b857600080fd5b50919050565b60008083601f8401126112d057600080fd5b50813567ffffffffffffffff8111156112e857600080fd5b6020830191508360208260051b850101111561130357600080fd5b9250929050565b60008060006060848603121561131f57600080fd5b61132985856112a6565b9250604084013567ffffffffffffffff81111561134557600080fd5b611351868287016112be565b9497909650939450505050565b6001600160a01b038116811461137357600080fd5b50565b6000806000806080858703121561138c57600080fd5b84356113978161135e565b93506113a686602087016112a6565b9250606085013567ffffffffffffffff8111156113c257600080fd5b6113ce878288016112be565b95989497509550505050565b600080600080606085870312156113f057600080fd5b8435935060208501356114028161135e565b9250604085013567ffffffffffffffff8082111561141f57600080fd5b818701915087601f83011261143357600080fd5b81358181111561144257600080fd5b88602082850101111561145457600080fd5b95989497505060200194505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610e0357610e03611463565b81810381811115610e0357610e03611463565b6000604082840312156114b157600080fd5b6040516040810181811067ffffffffffffffff821117156114e257634e487b7160e01b600052604160045260246000fd5b60405282356114f08161135e565b81526020928301359281019290925250919050565b60005b83811015611520578181015183820152602001611508565b50506000910152565b60008151808452611541816020860160208601611505565b601f01601f19169290920160200192915050565b60006002841061157557634e487b7160e01b600052602160045260246000fd5b838252604060208301526111256040830184611529565b600081518084526020808501945080840160005b838110156115c55781516001600160a01b0316875295820195908201906001016115a0565b509495945050505050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c084015261163161010084018261158c565b905060a0840151601f198483030160e0850152610dfe8282611529565b60006020828403121561166057600080fd5b5051919050565b6020808252602e908201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2072656360408201526d697069656e74206164647265737360901b606082015260800190565b6000602082840312156116c757600080fd5b81356116d28161135e565b9392505050565b600080604083850312156116ec57600080fd5b82356116f78161135e565b946020939093013593505050565b60006020828403121561171757600080fd5b815180151581146116d257600080fd5b60008251611739818460208701611505565b9190910192915050565b6020815260006116d2602083018461152956fea264697066735822122031be351ec7473d9d4a6c8e7fd7b35a9c184972d95b090fff1627f7609890413364736f6c634300081200334e6174697665546f6b656e44657374696e6174696f6e3a207a65726f20736f75", + Bin: "0x6101206040527302000000000000000000000000000000000000016080523480156200002a57600080fd5b5060405162001bf738038062001bf78339810160408190526200004d9162000350565b60016000556001600160a01b038416620000d45760405162461bcd60e51b815260206004820152603860248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2054656c60448201527f65706f727465724d657373656e6765722061646472657373000000000000000060648201526084015b60405180910390fd5b6001600160a01b03841661010052826200013a5760405162461bcd60e51b8152602060048201526031602482015260008051602062001bd78339815191526044820152701c98d948189b1bd8dad8da185a5b881251607a1b6064820152608401620000cb565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200018d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001b3919062000399565b8303620002295760405162461bcd60e51b815260206004820152603a60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a2063616e6e6f74206260448201527f726964676520776974682073616d6520626c6f636b636861696e0000000000006064820152608401620000cb565b60a08390526001600160a01b0382166200029b5760405162461bcd60e51b8152602060048201526034602482015260008051602062001bd783398151915260448201527f72636520636f6e747261637420616464726573730000000000000000000000006064820152608401620000cb565b6001600160a01b03821660c0526000819003620003215760405162461bcd60e51b815260206004820152603660248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f20696e6960448201527f7469616c207265736572766520696d62616c616e6365000000000000000000006064820152608401620000cb565b60e081905260015550620003b3915050565b80516001600160a01b03811681146200034b57600080fd5b919050565b600080600080608085870312156200036757600080fd5b620003728562000333565b935060208501519250620003896040860162000333565b6060959095015193969295505050565b600060208284031215620003ac57600080fd5b5051919050565b60805160a05160c05160e05161010051611792620004456000396000818161024401528181610360015281816106020152818161063e015261084e015260008181610210015261030a0152600081816101b1015281816103c00152818161069e015261097101526000818161013c0152818161039a0152818161067801526108ed01526000610be201526117926000f3fe6080604052600436106100e75760003560e01c80638ac7dd201161008a578063ab28523011610059578063ab28523014610299578063c452165e146102b0578063c868efaa146102c8578063d30951261461029957600080fd5b80638ac7dd20146101fe5780639b3e580314610232578063a2309ff814610266578063a2a950171461027c57600080fd5b80633a94fe51116100c65780633a94fe511461015e57806349e3284e146101805780635d93f9af1461019f57806375846562146101eb57600080fd5b8062d872ae146100ec57806318160ddd1461011557806329b7b3fd1461012a575b600080fd5b3480156100f857600080fd5b5061010260015481565b6040519081526020015b60405180910390f35b34801561012157600080fd5b506101026102e8565b34801561013657600080fd5b506101027f000000000000000000000000000000000000000000000000000000000000000081565b34801561016a57600080fd5b5061017e610179366004611310565b610349565b005b34801561018c57600080fd5b506001546040519015815260200161010c565b3480156101ab57600080fd5b506101d37f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161010c565b61017e6101f936600461137c565b610524565b34801561020a57600080fd5b506101027f000000000000000000000000000000000000000000000000000000000000000081565b34801561023e57600080fd5b506101d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561027257600080fd5b5061010260025481565b34801561028857600080fd5b506101d362010203600160981b0181565b3480156102a557600080fd5b50610102620186a081565b3480156102bc57600080fd5b506101d3600160981b81565b3480156102d457600080fd5b5061017e6102e33660046113e0565b61083b565b60008061030462010203600160981b0131600160981b3161147f565b905060007f0000000000000000000000000000000000000000000000000000000000000000600254610336919061147f565b90506103428282611492565b9250505090565b6000600160981b6001600160a01b031631905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001888036038101906103fe91906114a5565b8152602001620186a08152602001878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516020808201899052825180830382018152828401909352909201916104709160019160600161155b565b6040516020818303038152906040528152506040518263ffffffff1660e01b815260040161049e91906115d6565b6020604051808303816000875af11580156104bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e19190611654565b9050807f2550fa6041684d40e635e29e93dde9017d70c25b46aa88393317b5182ed6ae7c8360405161051591815260200190565b60405180910390a25050505050565b61052c610c4c565b6001600160a01b03841661055b5760405162461bcd60e51b81526004016105529061166d565b60405180910390fd5b600154156105c85760405162461bcd60e51b815260206004820152603460248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20636f6e7472616374604482015273081d5b99195c98dbdb1b185d195c985b1a5e995960621b6064820152608401610552565b6000602084013515610627576105ee6105e460208601866116bb565b8560200135610ca5565b905061062761060060208601866116bb565b7f000000000000000000000000000000000000000000000000000000000000000083610e0f565b61063a62010203600160981b0134610ef4565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001888036038101906106dc91906114a5565b8152602001620186a081526020018787808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250938552505060405160209384019361074a92508d913491016001600160a01b03929092168252602082015260400190565b60408051601f1981840301815290829052610768929160200161155b565b6040516020818303038152906040528152506040518263ffffffff1660e01b815260040161079691906115d6565b6020604051808303816000875af11580156107b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d99190611654565b905080866001600160a01b0316336001600160a01b03167f0322cbb1d3c23f6dbf1deddb3b4ef3ce0f93ae6eec7b44e4f395804104466d143460405161082191815260200190565b60405180910390a450506108356001600055565b50505050565b610843610c4c565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108eb5760405162461bcd60e51b815260206004820152604160248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20756e617574686f7260448201527f697a65642054656c65706f727465724d657373656e67657220636f6e747261636064820152601d60fa1b608482015260a401610552565b7f0000000000000000000000000000000000000000000000000000000000000000841461096f5760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20696e76616c69642060448201526b39b7bab931b29031b430b4b760a11b6064820152608401610552565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614610a045760405162461bcd60e51b815260206004820152602b60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20756e617574686f7260448201526a34bd32b21039b2b73232b960a91b6064820152608401610552565b600080610a13838501856116df565b90925090506001600160a01b038216610a3e5760405162461bcd60e51b81526004016105529061166d565b80600003610aa25760405162461bcd60e51b815260206004820152602b60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2074726160448201526a6e736665722076616c756560a81b6064820152608401610552565b600154819015610b6757600154821115610b0b5760015460408051918252600060208301527f244160b15e69cc411f041d94ae7fab6f6bba85dade8403216c05ff4b920d5449910160405180910390a1600154610aff9083611492565b60006001559050610b67565b8160016000828254610b1d9190611492565b90915550506001546040805184815260208101929092527f244160b15e69cc411f041d94ae7fab6f6bba85dade8403216c05ff4b920d5449910160405180910390a1505050610c42565b8060026000828254610b79919061147f565b90915550506040518181526001600160a01b038416907fd949ea0e9d5db53492d77f28fd5467fb2f6c4f5b88e3350e3c36729b76e99cf29060200160405180910390a26040516327ad555d60e11b81526001600160a01b038481166004830152602482018390527f00000000000000000000000000000000000000000000000000000000000000001690634f5aaaba90604401600060405180830381600087803b158015610c2657600080fd5b505af1158015610c3a573d6000803e3d6000fd5b505050505050505b6108356001600055565b600260005403610c9e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610552565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610cee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d129190611654565b9050610d296001600160a01b038516333086611012565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610d70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d949190611654565b9050818111610dfa5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b6064820152608401610552565b610e048282611492565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e849190611654565b610e8e919061147f565b6040516001600160a01b03851660248201526044810182905290915061083590859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261104a565b80471015610f445760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610552565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610f91576040519150601f19603f3d011682016040523d82523d6000602084013e610f96565b606091505b505090508061100d5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610552565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526108359085906323b872dd60e01b90608401610ebd565b600061109f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661111c9092919063ffffffff16565b80519091501561100d57808060200190518101906110bd919061170b565b61100d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610552565b606061112b8484600085611133565b949350505050565b6060824710156111945760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610552565b600080866001600160a01b031685876040516111b0919061172d565b60006040518083038185875af1925050503d80600081146111ed576040519150601f19603f3d011682016040523d82523d6000602084013e6111f2565b606091505b50915091506112038783838761120e565b979650505050505050565b6060831561127d578251600003611276576001600160a01b0385163b6112765760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610552565b508161112b565b61112b83838151156112925781518083602001fd5b8060405162461bcd60e51b81526004016105529190611749565b6000604082840312156112be57600080fd5b50919050565b60008083601f8401126112d657600080fd5b50813567ffffffffffffffff8111156112ee57600080fd5b6020830191508360208260051b850101111561130957600080fd5b9250929050565b60008060006060848603121561132557600080fd5b61132f85856112ac565b9250604084013567ffffffffffffffff81111561134b57600080fd5b611357868287016112c4565b9497909650939450505050565b6001600160a01b038116811461137957600080fd5b50565b6000806000806080858703121561139257600080fd5b843561139d81611364565b93506113ac86602087016112ac565b9250606085013567ffffffffffffffff8111156113c857600080fd5b6113d4878288016112c4565b95989497509550505050565b600080600080606085870312156113f657600080fd5b84359350602085013561140881611364565b9250604085013567ffffffffffffffff8082111561142557600080fd5b818701915087601f83011261143957600080fd5b81358181111561144857600080fd5b88602082850101111561145a57600080fd5b95989497505060200194505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610e0957610e09611469565b81810381811115610e0957610e09611469565b6000604082840312156114b757600080fd5b6040516040810181811067ffffffffffffffff821117156114e857634e487b7160e01b600052604160045260246000fd5b60405282356114f681611364565b81526020928301359281019290925250919050565b60005b8381101561152657818101518382015260200161150e565b50506000910152565b6000815180845261154781602086016020860161150b565b601f01601f19169290920160200192915050565b60006002841061157b57634e487b7160e01b600052602160045260246000fd5b8382526040602083015261112b604083018461152f565b600081518084526020808501945080840160005b838110156115cb5781516001600160a01b0316875295820195908201906001016115a6565b509495945050505050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c0840152611637610100840182611592565b905060a0840151601f198483030160e0850152610e04828261152f565b60006020828403121561166657600080fd5b5051919050565b6020808252602e908201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2072656360408201526d697069656e74206164647265737360901b606082015260800190565b6000602082840312156116cd57600080fd5b81356116d881611364565b9392505050565b600080604083850312156116f257600080fd5b82356116fd81611364565b946020939093013593505050565b60006020828403121561171d57600080fd5b815180151581146116d857600080fd5b6000825161173f81846020870161150b565b9190910192915050565b6020815260006116d8602083018461152f56fea2646970667358221220e89ef403357bacb012c03a70c17ce482aa7adb9c71c8023484c78578c2575dee64736f6c634300081200334e6174697665546f6b656e44657374696e6174696f6e3a207a65726f20736f75", } // NativeTokenDestinationABI is the input ABI used to generate the binding from. diff --git a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go index 7a2a7925d..291434fe5 100644 --- a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go +++ b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go @@ -38,7 +38,7 @@ type TeleporterFeeInfo struct { // NativeTokenSourceMetaData contains all meta data concerning the NativeTokenSource contract. var NativeTokenSourceMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeTokenDestinationAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BurnTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"UnlockTokens\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BURN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_NATIVE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBurnedTotal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"senderBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"transferToDestination\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", - Bin: "0x60e06040523480156200001157600080fd5b5060405162001740380380620017408339810160408190526200003491620002b3565b60016000556001600160a01b038316620000bb5760405162461bcd60e51b815260206004820152603360248201527f4e6174697665546f6b656e536f757263653a207a65726f2054656c65706f727460448201527f65724d657373656e67657220616464726573730000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b03831660c05281620001205760405162461bcd60e51b81526020600482015260316024820152600080516020620017208339815191526044820152701a5bdb88189b1bd8dad8da185a5b881251607a1b6064820152608401620000b2565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000173573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001999190620002f4565b82036200020f5760405162461bcd60e51b815260206004820152603560248201527f4e6174697665546f6b656e536f757263653a2063616e6e6f742062726964676560448201527f20776974682073616d6520626c6f636b636861696e00000000000000000000006064820152608401620000b2565b60808290526001600160a01b038116620002815760405162461bcd60e51b815260206004820152603460248201526000805160206200172083398151915260448201527f696f6e20636f6e747261637420616464726573730000000000000000000000006064820152608401620000b2565b6001600160a01b031660a052506200030e9050565b80516001600160a01b0381168114620002ae57600080fd5b919050565b600080600060608486031215620002c957600080fd5b620002d48462000296565b925060208401519150620002eb6040850162000296565b90509250925092565b6000602082840312156200030757600080fd5b5051919050565b60805160a05160c0516113b36200036d6000396000818160ef015281816102350152818161025e0152610451015260008181610167015281816102be015261056a01526000818160920152818161029801526104e601526113b36000f3fe60806040526004361061007b5760003560e01c8063b6171f731161004e578063b6171f731461013e578063b8c9091a14610155578063c868efaa14610189578063fccc2813146101a957600080fd5b806341d3014d1461008057806355db3e9e146100c75780639b3e5803146100dd578063ad0aee2514610129575b600080fd5b34801561008c57600080fd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b3480156100d357600080fd5b506100b460015481565b3480156100e957600080fd5b506101117f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100be565b61013c610137366004610eb0565b6101c4565b005b34801561014a57600080fd5b506100b4620186a081565b34801561016157600080fd5b506101117f000000000000000000000000000000000000000000000000000000000000000081565b34801561019557600080fd5b5061013c6101a4366004610f4f565b61043e565b3480156101b557600080fd5b506101116001600160981b0181565b6101cc6106ef565b6001600160a01b0384166101fb5760405162461bcd60e51b81526004016101f290610fc9565b60405180910390fd5b600060208401351561025a576102216102176020860186611012565b8560200135610748565b905061025a6102336020860186611012565b7f0000000000000000000000000000000000000000000000000000000000000000836108b2565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001888036038101906102fc919061107d565b8152602001620186a0815260200187878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509082525060405160209182019161036b918c913491016001600160a01b03929092168252602082015260400190565b6040516020818303038152906040528152506040518263ffffffff1660e01b81526004016103999190611169565b6020604051808303816000875af11580156103b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103dc91906111e7565b905080866001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a3460405161042491815260200190565b60405180910390a450506104386001600055565b50505050565b6104466106ef565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104e45760405162461bcd60e51b815260206004820152603c60248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201527f54656c65706f727465724d657373656e67657220636f6e74726163740000000060648201526084016101f2565b7f000000000000000000000000000000000000000000000000000000000000000084146105685760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420646573746960448201526b3730ba34b7b71031b430b4b760a11b60648201526084016101f2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146105f85760405162461bcd60e51b815260206004820152602660248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201526539b2b73232b960d11b60648201526084016101f2565b60008061060783850185611200565b90925090506000826001811115610620576106206112ac565b03610651576000808280602001905181019061063c91906112c2565b9150915061064a8282610997565b50506106e3565b6001826001811115610665576106656112ac565b036106915760008180602001905181019061068091906111e7565b905061068b81610a70565b506106e3565b60405162461bcd60e51b815260206004820152602160248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420616374696f6044820152603760f91b60648201526084016101f2565b50506104386001600055565b6002600054036107415760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101f2565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b591906111e7565b90506107cc6001600160a01b038516333086610a9f565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610813573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083791906111e7565b905081811161089d5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101f2565b6108a78282611306565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610903573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092791906111e7565b6109319190611319565b6040516001600160a01b03851660248201526044810182905290915061043890859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610ad7565b6001600160a01b0382166109bd5760405162461bcd60e51b81526004016101f290610fc9565b80471015610a205760405162461bcd60e51b815260206004820152602a60248201527f4e6174697665546f6b656e536f757263653a20696e73756666696369656e742060448201526918dbdb1b185d195c985b60b21b60648201526084016101f2565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610a6c8282610bae565b5050565b600154811115610a9c57600060015482610a8a9190611306565b9050610a9581610cc7565b5060018190555b50565b6040516001600160a01b03808516602483015283166044820152606481018290526104389085906323b872dd60e01b90608401610960565b6000610b2c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610d0b9092919063ffffffff16565b805190915015610ba95780806020019051810190610b4a919061132c565b610ba95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101f2565b505050565b80471015610bfe5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016101f2565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610c4b576040519150601f19603f3d011682016040523d82523d6000602084013e610c50565b606091505b5050905080610ba95760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016101f2565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610a9c6001600160981b0182610bae565b6060610d1a8484600085610d22565b949350505050565b606082471015610d835760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101f2565b600080866001600160a01b03168587604051610d9f919061134e565b60006040518083038185875af1925050503d8060008114610ddc576040519150601f19603f3d011682016040523d82523d6000602084013e610de1565b606091505b5091509150610df287838387610dfd565b979650505050505050565b60608315610e6c578251600003610e65576001600160a01b0385163b610e655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f2565b5081610d1a565b610d1a8383815115610e815781518083602001fd5b8060405162461bcd60e51b81526004016101f2919061136a565b6001600160a01b0381168114610a9c57600080fd5b6000806000808486036080811215610ec757600080fd5b8535610ed281610e9b565b94506040601f1982011215610ee657600080fd5b50602085019250606085013567ffffffffffffffff80821115610f0857600080fd5b818701915087601f830112610f1c57600080fd5b813581811115610f2b57600080fd5b8860208260051b8501011115610f4057600080fd5b95989497505060200194505050565b60008060008060608587031215610f6557600080fd5b843593506020850135610f7781610e9b565b9250604085013567ffffffffffffffff80821115610f9457600080fd5b818701915087601f830112610fa857600080fd5b813581811115610fb757600080fd5b886020828501011115610f4057600080fd5b60208082526029908201527f4e6174697665546f6b656e536f757263653a207a65726f20726563697069656e60408201526874206164647265737360b81b606082015260800190565b60006020828403121561102457600080fd5b813561102f81610e9b565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561107557611075611036565b604052919050565b60006040828403121561108f57600080fd5b6040516040810181811067ffffffffffffffff821117156110b2576110b2611036565b60405282356110c081610e9b565b81526020928301359281019290925250919050565b600081518084526020808501945080840160005b8381101561110e5781516001600160a01b0316875295820195908201906001016110e9565b509495945050505050565b60005b8381101561113457818101518382015260200161111c565b50506000910152565b60008151808452611155816020860160208601611119565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526111ca6101008401826110d5565b905060a0840151601f198483030160e08501526108a7828261113d565b6000602082840312156111f957600080fd5b5051919050565b6000806040838503121561121357600080fd5b82356002811061122257600080fd5b915060208381013567ffffffffffffffff8082111561124057600080fd5b818601915086601f83011261125457600080fd5b81358181111561126657611266611036565b611278601f8201601f1916850161104c565b9150808252878482850101111561128e57600080fd5b80848401858401376000848284010152508093505050509250929050565b634e487b7160e01b600052602160045260246000fd5b600080604083850312156112d557600080fd5b82516112e081610e9b565b6020939093015192949293505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156108ac576108ac6112f0565b808201808211156108ac576108ac6112f0565b60006020828403121561133e57600080fd5b8151801515811461102f57600080fd5b60008251611360818460208701611119565b9190910192915050565b60208152600061102f602083018461113d56fea264697066735822122071bd9a76f33a49da172aa34793cd1c054eb702ad51a79d3226641c39be3c19f164736f6c634300081200334e6174697665546f6b656e536f757263653a207a65726f2064657374696e6174", + Bin: "0x60e06040523480156200001157600080fd5b5060405162001744380380620017448339810160408190526200003491620002b3565b60016000556001600160a01b038316620000bb5760405162461bcd60e51b815260206004820152603360248201527f4e6174697665546f6b656e536f757263653a207a65726f2054656c65706f727460448201527f65724d657373656e67657220616464726573730000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b03831660c05281620001205760405162461bcd60e51b81526020600482015260316024820152600080516020620017248339815191526044820152701a5bdb88189b1bd8dad8da185a5b881251607a1b6064820152608401620000b2565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000173573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001999190620002f4565b82036200020f5760405162461bcd60e51b815260206004820152603560248201527f4e6174697665546f6b656e536f757263653a2063616e6e6f742062726964676560448201527f20776974682073616d6520626c6f636b636861696e00000000000000000000006064820152608401620000b2565b60808290526001600160a01b038116620002815760405162461bcd60e51b815260206004820152603460248201526000805160206200172483398151915260448201527f696f6e20636f6e747261637420616464726573730000000000000000000000006064820152608401620000b2565b6001600160a01b031660a052506200030e9050565b80516001600160a01b0381168114620002ae57600080fd5b919050565b600080600060608486031215620002c957600080fd5b620002d48462000296565b925060208401519150620002eb6040850162000296565b90509250925092565b6000602082840312156200030757600080fd5b5051919050565b60805160a05160c0516113b76200036d6000396000818160ef01528181610237015281816102600152610453015260008181610167015281816102c0015261056c01526000818160920152818161029a01526104e801526113b76000f3fe60806040526004361061007b5760003560e01c8063b6171f731161004e578063b6171f731461013e578063b8c9091a14610155578063c868efaa14610189578063fccc2813146101a957600080fd5b806341d3014d1461008057806355db3e9e146100c75780639b3e5803146100dd578063ad0aee2514610129575b600080fd5b34801561008c57600080fd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b3480156100d357600080fd5b506100b460015481565b3480156100e957600080fd5b506101117f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100be565b61013c610137366004610eb4565b6101c6565b005b34801561014a57600080fd5b506100b4620186a081565b34801561016157600080fd5b506101117f000000000000000000000000000000000000000000000000000000000000000081565b34801561019557600080fd5b5061013c6101a4366004610f53565b610440565b3480156101b557600080fd5b5061011162010203600160981b0181565b6101ce6106f1565b6001600160a01b0384166101fd5760405162461bcd60e51b81526004016101f490610fcd565b60405180910390fd5b600060208401351561025c576102236102196020860186611016565b856020013561074a565b905061025c6102356020860186611016565b7f0000000000000000000000000000000000000000000000000000000000000000836108b4565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001888036038101906102fe9190611081565b8152602001620186a0815260200187878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509082525060405160209182019161036d918c913491016001600160a01b03929092168252602082015260400190565b6040516020818303038152906040528152506040518263ffffffff1660e01b815260040161039b919061116d565b6020604051808303816000875af11580156103ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103de91906111eb565b905080866001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a3460405161042691815260200190565b60405180910390a4505061043a6001600055565b50505050565b6104486106f1565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104e65760405162461bcd60e51b815260206004820152603c60248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201527f54656c65706f727465724d657373656e67657220636f6e74726163740000000060648201526084016101f4565b7f0000000000000000000000000000000000000000000000000000000000000000841461056a5760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420646573746960448201526b3730ba34b7b71031b430b4b760a11b60648201526084016101f4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146105fa5760405162461bcd60e51b815260206004820152602660248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201526539b2b73232b960d11b60648201526084016101f4565b60008061060983850185611204565b90925090506000826001811115610622576106226112b0565b03610653576000808280602001905181019061063e91906112c6565b9150915061064c8282610999565b50506106e5565b6001826001811115610667576106676112b0565b036106935760008180602001905181019061068291906111eb565b905061068d81610a72565b506106e5565b60405162461bcd60e51b815260206004820152602160248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420616374696f6044820152603760f91b60648201526084016101f4565b505061043a6001600055565b6002600054036107435760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101f4565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610793573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b791906111eb565b90506107ce6001600160a01b038516333086610aa1565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083991906111eb565b905081811161089f5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101f4565b6108a9828261130a565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610905573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092991906111eb565b610933919061131d565b6040516001600160a01b03851660248201526044810182905290915061043a90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610ad9565b6001600160a01b0382166109bf5760405162461bcd60e51b81526004016101f490610fcd565b80471015610a225760405162461bcd60e51b815260206004820152602a60248201527f4e6174697665546f6b656e536f757263653a20696e73756666696369656e742060448201526918dbdb1b185d195c985b60b21b60648201526084016101f4565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610a6e8282610bb0565b5050565b600154811115610a9e57600060015482610a8c919061130a565b9050610a9781610cc9565b5060018190555b50565b6040516001600160a01b038085166024830152831660448201526064810182905261043a9085906323b872dd60e01b90608401610962565b6000610b2e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610d0f9092919063ffffffff16565b805190915015610bab5780806020019051810190610b4c9190611330565b610bab5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101f4565b505050565b80471015610c005760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016101f4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610c4d576040519150601f19603f3d011682016040523d82523d6000602084013e610c52565b606091505b5050905080610bab5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016101f4565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610a9e62010203600160981b0182610bb0565b6060610d1e8484600085610d26565b949350505050565b606082471015610d875760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101f4565b600080866001600160a01b03168587604051610da39190611352565b60006040518083038185875af1925050503d8060008114610de0576040519150601f19603f3d011682016040523d82523d6000602084013e610de5565b606091505b5091509150610df687838387610e01565b979650505050505050565b60608315610e70578251600003610e69576001600160a01b0385163b610e695760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f4565b5081610d1e565b610d1e8383815115610e855781518083602001fd5b8060405162461bcd60e51b81526004016101f4919061136e565b6001600160a01b0381168114610a9e57600080fd5b6000806000808486036080811215610ecb57600080fd5b8535610ed681610e9f565b94506040601f1982011215610eea57600080fd5b50602085019250606085013567ffffffffffffffff80821115610f0c57600080fd5b818701915087601f830112610f2057600080fd5b813581811115610f2f57600080fd5b8860208260051b8501011115610f4457600080fd5b95989497505060200194505050565b60008060008060608587031215610f6957600080fd5b843593506020850135610f7b81610e9f565b9250604085013567ffffffffffffffff80821115610f9857600080fd5b818701915087601f830112610fac57600080fd5b813581811115610fbb57600080fd5b886020828501011115610f4457600080fd5b60208082526029908201527f4e6174697665546f6b656e536f757263653a207a65726f20726563697069656e60408201526874206164647265737360b81b606082015260800190565b60006020828403121561102857600080fd5b813561103381610e9f565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156110795761107961103a565b604052919050565b60006040828403121561109357600080fd5b6040516040810181811067ffffffffffffffff821117156110b6576110b661103a565b60405282356110c481610e9f565b81526020928301359281019290925250919050565b600081518084526020808501945080840160005b838110156111125781516001600160a01b0316875295820195908201906001016110ed565b509495945050505050565b60005b83811015611138578181015183820152602001611120565b50506000910152565b6000815180845261115981602086016020860161111d565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526111ce6101008401826110d9565b905060a0840151601f198483030160e08501526108a98282611141565b6000602082840312156111fd57600080fd5b5051919050565b6000806040838503121561121757600080fd5b82356002811061122657600080fd5b915060208381013567ffffffffffffffff8082111561124457600080fd5b818601915086601f83011261125857600080fd5b81358181111561126a5761126a61103a565b61127c601f8201601f19168501611050565b9150808252878482850101111561129257600080fd5b80848401858401376000848284010152508093505050509250929050565b634e487b7160e01b600052602160045260246000fd5b600080604083850312156112d957600080fd5b82516112e481610e9f565b6020939093015192949293505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156108ae576108ae6112f4565b808201808211156108ae576108ae6112f4565b60006020828403121561134257600080fd5b8151801515811461103357600080fd5b6000825161136481846020870161111d565b9190910192915050565b602081526000611033602083018461114156fea264697066735822122031ef857c57a775ff9e7cac49b12778b33e10c03bfca3940c98b02fa2dab7d93c64736f6c634300081200334e6174697665546f6b656e536f757263653a207a65726f2064657374696e6174", } // NativeTokenSourceABI is the input ABI used to generate the binding from. diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol index a6c26992e..34dc0356a 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol @@ -28,7 +28,7 @@ contract ERC20TokenSource is // The address where the burned transaction fees are credited. // Defined as BLACKHOLE_ADDRESS at // https://github.com/ava-labs/subnet-evm/blob/e23ab058d039ff9c8469c89b139d21d52c4bd283/constants/constants.go - address public constant BURNED_TX_FEES_ADDRESS = 0x0100000000000000000000000000000000000000; + address public constant BURNED_TX_FEES_ADDRESS = 0x0100000000000000000000000000000000010203; uint256 public constant MINT_NATIVE_TOKENS_REQUIRED_GAS = 100_000; // Used to keep track of tokens burned through transactions on the destination chain. They can // be reported to this contract to burn an equivalent number of tokens on this chain. diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenDestination.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenDestination.sol index ed4c6e8f2..eff8de4cb 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenDestination.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenDestination.sol @@ -32,7 +32,7 @@ contract NativeTokenDestination is ITeleporterReceiver, INativeTokenDestination, // Designated Blackhole Address for this contract. Tokens are sent here to be "burned" before // sending an unlock message to the source chain. Different from the burned tx fee address so // they can be tracked separately. - address public constant BURN_FOR_TRANSFER_ADDRESS = 0x0100000000000000000000000000000000000001; + address public constant BURN_FOR_TRANSFER_ADDRESS = 0x0100000000000000000000000000000000010203; INativeMinter private immutable _nativeMinter = INativeMinter(0x0200000000000000000000000000000000000001); diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenSource.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenSource.sol index 97e11cfb0..e8fb8f6b0 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenSource.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/NativeTokenSource.sol @@ -29,7 +29,7 @@ contract NativeTokenSource is { // Designated Blackhole Address for this contract. Tokens are sent here to be "burned" when // a SourceAction.Burn message is received from the destination chain. - address public constant BURN_ADDRESS = 0x0100000000000000000000000000000000000001; + address public constant BURN_ADDRESS = 0x0100000000000000000000000000000000010203; uint256 public constant MINT_NATIVE_TOKENS_REQUIRED_GAS = 100_000; // Used to keep track of tokens burned through transactions on the destination chain. They can // be reported to this contract to burn an equivalent number of tokens on this chain. diff --git a/tests/flows/erc20_to_native_token_bridge.go b/tests/flows/erc20_to_native_token_bridge.go index ef659528d..6af4da8d6 100644 --- a/tests/flows/erc20_to_native_token_bridge.go +++ b/tests/flows/erc20_to_native_token_bridge.go @@ -39,6 +39,7 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { deployerAddress = common.HexToAddress("0x539447ab8Be7e927bE8E005663C81ff2AE951337") tokenReceiverAddress = common.HexToAddress("0x4444444444444444444444444444444444444444") burnedTxFeeAddress = common.HexToAddress("0x0100000000000000000000000000000000000000") + burnAddressSource = common.HexToAddress("0x0100000000000000000000000000000000010203") emptyDestFeeInfo = nativetokendestination.TeleporterFeeInfo{ FeeTokenAddress: common.Address{}, @@ -159,18 +160,17 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { checkReserveImbalance(initialReserveImbalance, nativeTokenDestination) - destChainReceipt := - sendERC20TokensToDestination( - ctx, - network, - valueToSend, - deployerPK, - tokenReceiverAddress, - sourceSubnet, - destSubnet, - erc20TokenSource, - common.Big0, - ) + destChainReceipt := sendERC20TokensToDestination( + ctx, + network, + valueToSend, + deployerPK, + tokenReceiverAddress, + sourceSubnet, + destSubnet, + erc20TokenSource, + common.Big0, + ) collateralEvent, err := utils.GetEventFromLogs( destChainReceipt.Logs, @@ -255,18 +255,17 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { { // Transfer tokens B -> A - sourceChainReceipt := - sendTokensToSource( - ctx, - network, - valueToReturn, - deployerPK, - tokenReceiverAddress, - sourceSubnet, - destSubnet, - nativeTokenDestination, - emptyDestFeeInfo, - ) + sourceChainReceipt := sendTokensToSource( + ctx, + network, + valueToReturn, + deployerPK, + tokenReceiverAddress, + sourceSubnet, + destSubnet, + nativeTokenDestination, + emptyDestFeeInfo, + ) checkUnlockERC20Event( sourceChainReceipt.Logs, @@ -308,7 +307,7 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { Expect(err).Should(BeNil()) utils.ExpectBigEqual(reportEvent.BurnAddressBalance, burnedTxFeesBalanceDest) - burnedTxFeesBalanceSource, err := exampleERC20.BalanceOf(nil, burnedTxFeeAddress) + burnedTxFeesBalanceSource, err := exampleERC20.BalanceOf(nil, burnAddressSource) Expect(err).Should(BeNil()) utils.ExpectBigEqual(burnedTxFeesBalanceSource, common.Big0) @@ -321,7 +320,7 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { Expect(err).Should(BeNil()) utils.ExpectBigEqual(burnedTxFeesBalanceDest, burnEvent.Amount) - burnedTxFeesBalanceSource2, err := exampleERC20.BalanceOf(nil, burnedTxFeeAddress) + burnedTxFeesBalanceSource2, err := exampleERC20.BalanceOf(nil, burnAddressSource) Expect(err).Should(BeNil()) utils.ExpectBigEqual(burnedTxFeesBalanceSource2, burnEvent.Amount) } diff --git a/tests/flows/native_token_bridge.go b/tests/flows/native_token_bridge.go index 7ce29c159..c3bd49650 100644 --- a/tests/flows/native_token_bridge.go +++ b/tests/flows/native_token_bridge.go @@ -35,7 +35,7 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { deployerAddress = common.HexToAddress("0x1337cfd2dCff6270615B90938aCB1efE79801704") tokenReceiverAddress = common.HexToAddress("0x0123456789012345678901234567890123456789") burnedTxFeeAddressDest = common.HexToAddress("0x0100000000000000000000000000000000000000") - burnAddressSource = common.HexToAddress("0x0100000000000000000000000000000000000001") + burnAddressSource = common.HexToAddress("0x0100000000000000000000000000000000010203") emptyDestFeeInfo = nativetokendestination.TeleporterFeeInfo{ FeeTokenAddress: common.Address{}, @@ -291,11 +291,12 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { sourceChainReceipt := network.RelayMessage(ctx, destChainReceipt, destSubnet, sourceSubnet, true) - burnEvent, err := utils.GetEventFromLogs( - sourceChainReceipt.Logs, + burnEvent := utils.GetEventFromLogsOrTrace( + ctx, + sourceChainReceipt, + sourceSubnet, nativeTokenSource.ParseBurnTokens, ) - Expect(err).Should(BeNil()) utils.ExpectBigEqual(burnedTxFeesBalanceDest, burnEvent.Amount) burnedTxFeesBalanceSource2, err := sourceSubnet.WSClient.BalanceAt( From 4bfe558935c5c7aed271263dbb0e44f46c0de0c8 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 02:37:45 -0500 Subject: [PATCH 06/24] Fix comment --- .../NativeTokenBridge/ERC20TokenSource.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol index 34dc0356a..98e78f4a4 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol @@ -25,9 +25,8 @@ contract ERC20TokenSource is ITokenSource, ReentrancyGuard { - // The address where the burned transaction fees are credited. - // Defined as BLACKHOLE_ADDRESS at - // https://github.com/ava-labs/subnet-evm/blob/e23ab058d039ff9c8469c89b139d21d52c4bd283/constants/constants.go + // Designated Blackhole Address for this contract. Tokens are sent here to be "burned" when + // a SourceAction.Burn message is received from the destination chain. address public constant BURNED_TX_FEES_ADDRESS = 0x0100000000000000000000000000000000010203; uint256 public constant MINT_NATIVE_TOKENS_REQUIRED_GAS = 100_000; // Used to keep track of tokens burned through transactions on the destination chain. They can From 0de046f9c5f969b991b78700f3f991596f8f9969 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 02:50:34 -0500 Subject: [PATCH 07/24] Linter --- .../NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go | 2 +- .../NativeTokenBridge/ERC20TokenSource.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go index c29944073..eef020bb6 100644 --- a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go +++ b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go @@ -32,7 +32,7 @@ var ( // ERC20TokenSourceMetaData contains all meta data concerning the ERC20TokenSource contract. var ERC20TokenSourceMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeTokenDestinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"erc20ContractAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BurnTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"UnlockTokens\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BURNED_TX_FEES_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_NATIVE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBurnedTotal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"erc20ContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"senderBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"transferToDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101006040523480156200001257600080fd5b50604051620016fb380380620016fb83398101604081905262000035916200031d565b60016000556001600160a01b038416620000b15760405162461bcd60e51b815260206004820152603260248201527f4552433230546f6b656e536f757263653a207a65726f2054656c65706f727465604482015271724d657373656e676572206164647265737360701b60648201526084015b60405180910390fd5b6001600160a01b03841660e05282620001155760405162461bcd60e51b81526020600482015260306024820152600080516020620016db83398151915260448201526f1bdb88189b1bd8dad8da185a5b88125160821b6064820152608401620000a8565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000168573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200018e919062000371565b8303620002045760405162461bcd60e51b815260206004820152603460248201527f4552433230546f6b656e536f757263653a2063616e6e6f74206272696467652060448201527f776974682073616d6520626c6f636b636861696e0000000000000000000000006064820152608401620000a8565b60808390526001600160a01b038216620002765760405162461bcd60e51b81526020600482015260336024820152600080516020620016db83398151915260448201527f6f6e20636f6e74726163742061646472657373000000000000000000000000006064820152608401620000a8565b6001600160a01b0380831660a0528116620002ea5760405162461bcd60e51b815260206004820152602d60248201527f4552433230546f6b656e536f757263653a207a65726f20455243323020636f6e60448201526c7472616374206164647265737360981b6064820152608401620000a8565b6001600160a01b031660c052506200038b915050565b80516001600160a01b03811681146200031857600080fd5b919050565b600080600080608085870312156200033457600080fd5b6200033f8562000300565b935060208501519250620003566040860162000300565b9150620003666060860162000300565b905092959194509250565b6000602082840312156200038457600080fd5b5051919050565b60805160a05160c05160e0516112c4620004176000396000818160f5015281816102a1015281816102d801526104f2015260008181610188015281816101e8015281816102800152818161037201528181610a9f0152610c6f01526000818161013e01528181610338015261060a015260008181609d01528181610312015261058701526112c46000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063b6171f7311610066578063b6171f731461012f578063b8c9091a14610139578063c452165e14610160578063c868efaa14610170578063e486df151461018357600080fd5b806341d3014d1461009857806355db3e9e146100d257806387a2edba146100db5780639b3e5803146100f0575b600080fd5b6100bf7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100bf60015481565b6100ee6100e9366004610e43565b6101aa565b005b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c9565b6100bf620186a081565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b61011762010203600160981b0181565b6100ee61017e366004610edc565b6104df565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6101b261078a565b6001600160a01b0385166101e15760405162461bcd60e51b81526004016101d890610f65565b60405180910390fd5b600061020d7f0000000000000000000000000000000000000000000000000000000000000000866107e3565b90508381116102755760405162461bcd60e51b815260206004820152602e60248201527f4552433230546f6b656e536f757263653a20696e73756666696369656e74206160448201526d191a9d5cdd195908185b5bdd5b9d60921b60648201526084016101d8565b83156102c6576102c67f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008661094d565b60006102d28583610fc3565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200160405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018b8152508152602001620186a08152602001888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516001600160a01b038e166020808301919091529181018890529101906060016040516020818303038152906040528152506040518263ffffffff1660e01b8152600401610438919061106a565b6020604051808303816000875af1158015610457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906110e8565b905080886001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a856040516104c391815260200190565b60405180910390a45050506104d86001600055565b5050505050565b6104e761078a565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105855760405162461bcd60e51b815260206004820152603b60248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564205460448201527f656c65706f727465724d657373656e67657220636f6e7472616374000000000060648201526084016101d8565b7f000000000000000000000000000000000000000000000000000000000000000084146106085760405162461bcd60e51b815260206004820152602b60248201527f4552433230546f6b656e536f757263653a20696e76616c69642064657374696e60448201526a30ba34b7b71031b430b4b760a91b60648201526084016101d8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146106975760405162461bcd60e51b815260206004820152602560248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564207360448201526432b73232b960d91b60648201526084016101d8565b6000806106a683850185611117565b909250905060008260018111156106bf576106bf6111df565b036106f057600080828060200190518101906106db91906111f5565b915091506106e98282610a32565b5050610778565b6001826001811115610704576107046111df565b036107305760008180602001905181019061071f91906110e8565b905061072a81610ac9565b50610778565b60405162461bcd60e51b815260206004820181905260248201527f4552433230546f6b656e536f757263653a20696e76616c696420616374696f6e60448201526064016101d8565b50506107846001600055565b50505050565b6002600054036107dc5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101d8565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085091906110e8565b90506108676001600160a01b038516333086610af8565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa1580156108ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d291906110e8565b90508181116109385760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101d8565b6109428282610fc3565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801561099e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c291906110e8565b6109cc9190611223565b6040516001600160a01b03851660248201526044810182905290915061078490859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b30565b6001600160a01b038216610a585760405162461bcd60e51b81526004016101d890610f65565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610ac57f00000000000000000000000000000000000000000000000000000000000000008383610c07565b5050565b600154811115610af557600060015482610ae39190610fc3565b9050610aee81610c37565b5060018190555b50565b6040516001600160a01b03808516602483015283166044820152606481018290526107849085906323b872dd60e01b906084016109fb565b6000610b85826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c9e9092919063ffffffff16565b805190915015610c025780806020019051810190610ba39190611236565b610c025760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101d8565b505050565b6040516001600160a01b038316602482015260448101829052610c0290849063a9059cbb60e01b906064016109fb565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610af57f000000000000000000000000000000000000000000000000000000000000000062010203600160981b0183610c07565b6060610cad8484600085610cb5565b949350505050565b606082471015610d165760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101d8565b600080866001600160a01b03168587604051610d32919061125f565b60006040518083038185875af1925050503d8060008114610d6f576040519150601f19603f3d011682016040523d82523d6000602084013e610d74565b606091505b5091509150610d8587838387610d90565b979650505050505050565b60608315610dff578251600003610df8576001600160a01b0385163b610df85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101d8565b5081610cad565b610cad8383815115610e145781518083602001fd5b8060405162461bcd60e51b81526004016101d8919061127b565b6001600160a01b0381168114610af557600080fd5b600080600080600060808688031215610e5b57600080fd5b8535610e6681610e2e565b94506020860135935060408601359250606086013567ffffffffffffffff80821115610e9157600080fd5b818801915088601f830112610ea557600080fd5b813581811115610eb457600080fd5b8960208260051b8501011115610ec957600080fd5b9699959850939650602001949392505050565b60008060008060608587031215610ef257600080fd5b843593506020850135610f0481610e2e565b9250604085013567ffffffffffffffff80821115610f2157600080fd5b818701915087601f830112610f3557600080fd5b813581811115610f4457600080fd5b886020828501011115610f5657600080fd5b95989497505060200194505050565b60208082526028908201527f4552433230546f6b656e536f757263653a207a65726f20726563697069656e74604082015267206164647265737360c01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561094757610947610fad565b600081518084526020808501945080840160005b8381101561100f5781516001600160a01b031687529582019590820190600101610fea565b509495945050505050565b60005b8381101561103557818101518382015260200161101d565b50506000910152565b6000815180845261105681602086016020860161101a565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526110cb610100840182610fd6565b905060a0840151601f198483030160e0850152610942828261103e565b6000602082840312156110fa57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561112a57600080fd5b82356002811061113957600080fd5b9150602083013567ffffffffffffffff8082111561115657600080fd5b818501915085601f83011261116a57600080fd5b81358181111561117c5761117c611101565b604051601f8201601f19908116603f011681019083821181831017156111a4576111a4611101565b816040528281528860208487010111156111bd57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b634e487b7160e01b600052602160045260246000fd5b6000806040838503121561120857600080fd5b825161121381610e2e565b6020939093015192949293505050565b8082018082111561094757610947610fad565b60006020828403121561124857600080fd5b8151801515811461125857600080fd5b9392505050565b6000825161127181846020870161101a565b9190910192915050565b602081526000611258602083018461103e56fea2646970667358221220402d136387198fbb8c71367b1381e6ab3b5b22f4cd83c1c744100881fea1067764736f6c634300081200334552433230546f6b656e536f757263653a207a65726f2064657374696e617469", + Bin: "0x6101006040523480156200001257600080fd5b50604051620016fb380380620016fb83398101604081905262000035916200031d565b60016000556001600160a01b038416620000b15760405162461bcd60e51b815260206004820152603260248201527f4552433230546f6b656e536f757263653a207a65726f2054656c65706f727465604482015271724d657373656e676572206164647265737360701b60648201526084015b60405180910390fd5b6001600160a01b03841660e05282620001155760405162461bcd60e51b81526020600482015260306024820152600080516020620016db83398151915260448201526f1bdb88189b1bd8dad8da185a5b88125160821b6064820152608401620000a8565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000168573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200018e919062000371565b8303620002045760405162461bcd60e51b815260206004820152603460248201527f4552433230546f6b656e536f757263653a2063616e6e6f74206272696467652060448201527f776974682073616d6520626c6f636b636861696e0000000000000000000000006064820152608401620000a8565b60808390526001600160a01b038216620002765760405162461bcd60e51b81526020600482015260336024820152600080516020620016db83398151915260448201527f6f6e20636f6e74726163742061646472657373000000000000000000000000006064820152608401620000a8565b6001600160a01b0380831660a0528116620002ea5760405162461bcd60e51b815260206004820152602d60248201527f4552433230546f6b656e536f757263653a207a65726f20455243323020636f6e60448201526c7472616374206164647265737360981b6064820152608401620000a8565b6001600160a01b031660c052506200038b915050565b80516001600160a01b03811681146200031857600080fd5b919050565b600080600080608085870312156200033457600080fd5b6200033f8562000300565b935060208501519250620003566040860162000300565b9150620003666060860162000300565b905092959194509250565b6000602082840312156200038457600080fd5b5051919050565b60805160a05160c05160e0516112c4620004176000396000818160f5015281816102a1015281816102d801526104f2015260008181610188015281816101e8015281816102800152818161037201528181610a9f0152610c6f01526000818161013e01528181610338015261060a015260008181609d01528181610312015261058701526112c46000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063b6171f7311610066578063b6171f731461012f578063b8c9091a14610139578063c452165e14610160578063c868efaa14610170578063e486df151461018357600080fd5b806341d3014d1461009857806355db3e9e146100d257806387a2edba146100db5780639b3e5803146100f0575b600080fd5b6100bf7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100bf60015481565b6100ee6100e9366004610e43565b6101aa565b005b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c9565b6100bf620186a081565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b61011762010203600160981b0181565b6100ee61017e366004610edc565b6104df565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6101b261078a565b6001600160a01b0385166101e15760405162461bcd60e51b81526004016101d890610f65565b60405180910390fd5b600061020d7f0000000000000000000000000000000000000000000000000000000000000000866107e3565b90508381116102755760405162461bcd60e51b815260206004820152602e60248201527f4552433230546f6b656e536f757263653a20696e73756666696369656e74206160448201526d191a9d5cdd195908185b5bdd5b9d60921b60648201526084016101d8565b83156102c6576102c67f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008661094d565b60006102d28583610fc3565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200160405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018b8152508152602001620186a08152602001888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516001600160a01b038e166020808301919091529181018890529101906060016040516020818303038152906040528152506040518263ffffffff1660e01b8152600401610438919061106a565b6020604051808303816000875af1158015610457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906110e8565b905080886001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a856040516104c391815260200190565b60405180910390a45050506104d86001600055565b5050505050565b6104e761078a565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105855760405162461bcd60e51b815260206004820152603b60248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564205460448201527f656c65706f727465724d657373656e67657220636f6e7472616374000000000060648201526084016101d8565b7f000000000000000000000000000000000000000000000000000000000000000084146106085760405162461bcd60e51b815260206004820152602b60248201527f4552433230546f6b656e536f757263653a20696e76616c69642064657374696e60448201526a30ba34b7b71031b430b4b760a91b60648201526084016101d8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146106975760405162461bcd60e51b815260206004820152602560248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564207360448201526432b73232b960d91b60648201526084016101d8565b6000806106a683850185611117565b909250905060008260018111156106bf576106bf6111df565b036106f057600080828060200190518101906106db91906111f5565b915091506106e98282610a32565b5050610778565b6001826001811115610704576107046111df565b036107305760008180602001905181019061071f91906110e8565b905061072a81610ac9565b50610778565b60405162461bcd60e51b815260206004820181905260248201527f4552433230546f6b656e536f757263653a20696e76616c696420616374696f6e60448201526064016101d8565b50506107846001600055565b50505050565b6002600054036107dc5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101d8565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085091906110e8565b90506108676001600160a01b038516333086610af8565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa1580156108ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d291906110e8565b90508181116109385760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101d8565b6109428282610fc3565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801561099e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c291906110e8565b6109cc9190611223565b6040516001600160a01b03851660248201526044810182905290915061078490859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b30565b6001600160a01b038216610a585760405162461bcd60e51b81526004016101d890610f65565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610ac57f00000000000000000000000000000000000000000000000000000000000000008383610c07565b5050565b600154811115610af557600060015482610ae39190610fc3565b9050610aee81610c37565b5060018190555b50565b6040516001600160a01b03808516602483015283166044820152606481018290526107849085906323b872dd60e01b906084016109fb565b6000610b85826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c9e9092919063ffffffff16565b805190915015610c025780806020019051810190610ba39190611236565b610c025760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101d8565b505050565b6040516001600160a01b038316602482015260448101829052610c0290849063a9059cbb60e01b906064016109fb565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610af57f000000000000000000000000000000000000000000000000000000000000000062010203600160981b0183610c07565b6060610cad8484600085610cb5565b949350505050565b606082471015610d165760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101d8565b600080866001600160a01b03168587604051610d32919061125f565b60006040518083038185875af1925050503d8060008114610d6f576040519150601f19603f3d011682016040523d82523d6000602084013e610d74565b606091505b5091509150610d8587838387610d90565b979650505050505050565b60608315610dff578251600003610df8576001600160a01b0385163b610df85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101d8565b5081610cad565b610cad8383815115610e145781518083602001fd5b8060405162461bcd60e51b81526004016101d8919061127b565b6001600160a01b0381168114610af557600080fd5b600080600080600060808688031215610e5b57600080fd5b8535610e6681610e2e565b94506020860135935060408601359250606086013567ffffffffffffffff80821115610e9157600080fd5b818801915088601f830112610ea557600080fd5b813581811115610eb457600080fd5b8960208260051b8501011115610ec957600080fd5b9699959850939650602001949392505050565b60008060008060608587031215610ef257600080fd5b843593506020850135610f0481610e2e565b9250604085013567ffffffffffffffff80821115610f2157600080fd5b818701915087601f830112610f3557600080fd5b813581811115610f4457600080fd5b886020828501011115610f5657600080fd5b95989497505060200194505050565b60208082526028908201527f4552433230546f6b656e536f757263653a207a65726f20726563697069656e74604082015267206164647265737360c01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561094757610947610fad565b600081518084526020808501945080840160005b8381101561100f5781516001600160a01b031687529582019590820190600101610fea565b509495945050505050565b60005b8381101561103557818101518382015260200161101d565b50506000910152565b6000815180845261105681602086016020860161101a565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526110cb610100840182610fd6565b905060a0840151601f198483030160e0850152610942828261103e565b6000602082840312156110fa57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561112a57600080fd5b82356002811061113957600080fd5b9150602083013567ffffffffffffffff8082111561115657600080fd5b818501915085601f83011261116a57600080fd5b81358181111561117c5761117c611101565b604051601f8201601f19908116603f011681019083821181831017156111a4576111a4611101565b816040528281528860208487010111156111bd57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b634e487b7160e01b600052602160045260246000fd5b6000806040838503121561120857600080fd5b825161121381610e2e565b6020939093015192949293505050565b8082018082111561094757610947610fad565b60006020828403121561124857600080fd5b8151801515811461125857600080fd5b9392505050565b6000825161127181846020870161101a565b9190910192915050565b602081526000611258602083018461103e56fea2646970667358221220f7bcae96d4f9e3234ec55078f48d8fa92d1d513f9c4a9ad7d9348b74221ea0ae64736f6c634300081200334552433230546f6b656e536f757263653a207a65726f2064657374696e617469", } // ERC20TokenSourceABI is the input ABI used to generate the binding from. diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol index 98e78f4a4..6f9fef7c7 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol @@ -26,7 +26,7 @@ contract ERC20TokenSource is ReentrancyGuard { // Designated Blackhole Address for this contract. Tokens are sent here to be "burned" when - // a SourceAction.Burn message is received from the destination chain. + // a SourceAction.Burn message is received from the destination chain. address public constant BURNED_TX_FEES_ADDRESS = 0x0100000000000000000000000000000000010203; uint256 public constant MINT_NATIVE_TOKENS_REQUIRED_GAS = 100_000; // Used to keep track of tokens burned through transactions on the destination chain. They can From 359767207363ef251290287090fddb9dfb9b73c8 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 03:14:50 -0500 Subject: [PATCH 08/24] Rename burn address for uniformity --- .../ERC20TokenSource/ERC20TokenSource.go | 28 +++++++++---------- .../NativeTokenBridge/ERC20TokenSource.sol | 4 +-- .../tests/ERC20TokenSourceTests.t.sol | 7 ++--- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go index eef020bb6..e81a2d28b 100644 --- a/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go +++ b/abi-bindings/go/CrossChainApplications/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go @@ -31,8 +31,8 @@ var ( // ERC20TokenSourceMetaData contains all meta data concerning the ERC20TokenSource contract. var ERC20TokenSourceMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeTokenDestinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"erc20ContractAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BurnTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"UnlockTokens\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BURNED_TX_FEES_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_NATIVE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBurnedTotal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"erc20ContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"senderBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"transferToDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101006040523480156200001257600080fd5b50604051620016fb380380620016fb83398101604081905262000035916200031d565b60016000556001600160a01b038416620000b15760405162461bcd60e51b815260206004820152603260248201527f4552433230546f6b656e536f757263653a207a65726f2054656c65706f727465604482015271724d657373656e676572206164647265737360701b60648201526084015b60405180910390fd5b6001600160a01b03841660e05282620001155760405162461bcd60e51b81526020600482015260306024820152600080516020620016db83398151915260448201526f1bdb88189b1bd8dad8da185a5b88125160821b6064820152608401620000a8565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000168573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200018e919062000371565b8303620002045760405162461bcd60e51b815260206004820152603460248201527f4552433230546f6b656e536f757263653a2063616e6e6f74206272696467652060448201527f776974682073616d6520626c6f636b636861696e0000000000000000000000006064820152608401620000a8565b60808390526001600160a01b038216620002765760405162461bcd60e51b81526020600482015260336024820152600080516020620016db83398151915260448201527f6f6e20636f6e74726163742061646472657373000000000000000000000000006064820152608401620000a8565b6001600160a01b0380831660a0528116620002ea5760405162461bcd60e51b815260206004820152602d60248201527f4552433230546f6b656e536f757263653a207a65726f20455243323020636f6e60448201526c7472616374206164647265737360981b6064820152608401620000a8565b6001600160a01b031660c052506200038b915050565b80516001600160a01b03811681146200031857600080fd5b919050565b600080600080608085870312156200033457600080fd5b6200033f8562000300565b935060208501519250620003566040860162000300565b9150620003666060860162000300565b905092959194509250565b6000602082840312156200038457600080fd5b5051919050565b60805160a05160c05160e0516112c4620004176000396000818160f5015281816102a1015281816102d801526104f2015260008181610188015281816101e8015281816102800152818161037201528181610a9f0152610c6f01526000818161013e01528181610338015261060a015260008181609d01528181610312015261058701526112c46000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063b6171f7311610066578063b6171f731461012f578063b8c9091a14610139578063c452165e14610160578063c868efaa14610170578063e486df151461018357600080fd5b806341d3014d1461009857806355db3e9e146100d257806387a2edba146100db5780639b3e5803146100f0575b600080fd5b6100bf7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100bf60015481565b6100ee6100e9366004610e43565b6101aa565b005b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c9565b6100bf620186a081565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b61011762010203600160981b0181565b6100ee61017e366004610edc565b6104df565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6101b261078a565b6001600160a01b0385166101e15760405162461bcd60e51b81526004016101d890610f65565b60405180910390fd5b600061020d7f0000000000000000000000000000000000000000000000000000000000000000866107e3565b90508381116102755760405162461bcd60e51b815260206004820152602e60248201527f4552433230546f6b656e536f757263653a20696e73756666696369656e74206160448201526d191a9d5cdd195908185b5bdd5b9d60921b60648201526084016101d8565b83156102c6576102c67f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008661094d565b60006102d28583610fc3565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200160405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018b8152508152602001620186a08152602001888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516001600160a01b038e166020808301919091529181018890529101906060016040516020818303038152906040528152506040518263ffffffff1660e01b8152600401610438919061106a565b6020604051808303816000875af1158015610457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906110e8565b905080886001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a856040516104c391815260200190565b60405180910390a45050506104d86001600055565b5050505050565b6104e761078a565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105855760405162461bcd60e51b815260206004820152603b60248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564205460448201527f656c65706f727465724d657373656e67657220636f6e7472616374000000000060648201526084016101d8565b7f000000000000000000000000000000000000000000000000000000000000000084146106085760405162461bcd60e51b815260206004820152602b60248201527f4552433230546f6b656e536f757263653a20696e76616c69642064657374696e60448201526a30ba34b7b71031b430b4b760a91b60648201526084016101d8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146106975760405162461bcd60e51b815260206004820152602560248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564207360448201526432b73232b960d91b60648201526084016101d8565b6000806106a683850185611117565b909250905060008260018111156106bf576106bf6111df565b036106f057600080828060200190518101906106db91906111f5565b915091506106e98282610a32565b5050610778565b6001826001811115610704576107046111df565b036107305760008180602001905181019061071f91906110e8565b905061072a81610ac9565b50610778565b60405162461bcd60e51b815260206004820181905260248201527f4552433230546f6b656e536f757263653a20696e76616c696420616374696f6e60448201526064016101d8565b50506107846001600055565b50505050565b6002600054036107dc5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101d8565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085091906110e8565b90506108676001600160a01b038516333086610af8565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa1580156108ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d291906110e8565b90508181116109385760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101d8565b6109428282610fc3565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801561099e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c291906110e8565b6109cc9190611223565b6040516001600160a01b03851660248201526044810182905290915061078490859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b30565b6001600160a01b038216610a585760405162461bcd60e51b81526004016101d890610f65565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610ac57f00000000000000000000000000000000000000000000000000000000000000008383610c07565b5050565b600154811115610af557600060015482610ae39190610fc3565b9050610aee81610c37565b5060018190555b50565b6040516001600160a01b03808516602483015283166044820152606481018290526107849085906323b872dd60e01b906084016109fb565b6000610b85826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c9e9092919063ffffffff16565b805190915015610c025780806020019051810190610ba39190611236565b610c025760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101d8565b505050565b6040516001600160a01b038316602482015260448101829052610c0290849063a9059cbb60e01b906064016109fb565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610af57f000000000000000000000000000000000000000000000000000000000000000062010203600160981b0183610c07565b6060610cad8484600085610cb5565b949350505050565b606082471015610d165760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101d8565b600080866001600160a01b03168587604051610d32919061125f565b60006040518083038185875af1925050503d8060008114610d6f576040519150601f19603f3d011682016040523d82523d6000602084013e610d74565b606091505b5091509150610d8587838387610d90565b979650505050505050565b60608315610dff578251600003610df8576001600160a01b0385163b610df85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101d8565b5081610cad565b610cad8383815115610e145781518083602001fd5b8060405162461bcd60e51b81526004016101d8919061127b565b6001600160a01b0381168114610af557600080fd5b600080600080600060808688031215610e5b57600080fd5b8535610e6681610e2e565b94506020860135935060408601359250606086013567ffffffffffffffff80821115610e9157600080fd5b818801915088601f830112610ea557600080fd5b813581811115610eb457600080fd5b8960208260051b8501011115610ec957600080fd5b9699959850939650602001949392505050565b60008060008060608587031215610ef257600080fd5b843593506020850135610f0481610e2e565b9250604085013567ffffffffffffffff80821115610f2157600080fd5b818701915087601f830112610f3557600080fd5b813581811115610f4457600080fd5b886020828501011115610f5657600080fd5b95989497505060200194505050565b60208082526028908201527f4552433230546f6b656e536f757263653a207a65726f20726563697069656e74604082015267206164647265737360c01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561094757610947610fad565b600081518084526020808501945080840160005b8381101561100f5781516001600160a01b031687529582019590820190600101610fea565b509495945050505050565b60005b8381101561103557818101518382015260200161101d565b50506000910152565b6000815180845261105681602086016020860161101a565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526110cb610100840182610fd6565b905060a0840151601f198483030160e0850152610942828261103e565b6000602082840312156110fa57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561112a57600080fd5b82356002811061113957600080fd5b9150602083013567ffffffffffffffff8082111561115657600080fd5b818501915085601f83011261116a57600080fd5b81358181111561117c5761117c611101565b604051601f8201601f19908116603f011681019083821181831017156111a4576111a4611101565b816040528281528860208487010111156111bd57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b634e487b7160e01b600052602160045260246000fd5b6000806040838503121561120857600080fd5b825161121381610e2e565b6020939093015192949293505050565b8082018082111561094757610947610fad565b60006020828403121561124857600080fd5b8151801515811461125857600080fd5b9392505050565b6000825161127181846020870161101a565b9190910192915050565b602081526000611258602083018461103e56fea2646970667358221220f7bcae96d4f9e3234ec55078f48d8fa92d1d513f9c4a9ad7d9348b74221ea0ae64736f6c634300081200334552433230546f6b656e536f757263653a207a65726f2064657374696e617469", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeTokenDestinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"erc20ContractAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BurnTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"UnlockTokens\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BURN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_NATIVE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationBurnedTotal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"erc20ContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"senderBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"transferToDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101006040523480156200001257600080fd5b50604051620016fb380380620016fb83398101604081905262000035916200031d565b60016000556001600160a01b038416620000b15760405162461bcd60e51b815260206004820152603260248201527f4552433230546f6b656e536f757263653a207a65726f2054656c65706f727465604482015271724d657373656e676572206164647265737360701b60648201526084015b60405180910390fd5b6001600160a01b03841660e05282620001155760405162461bcd60e51b81526020600482015260306024820152600080516020620016db83398151915260448201526f1bdb88189b1bd8dad8da185a5b88125160821b6064820152608401620000a8565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000168573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200018e919062000371565b8303620002045760405162461bcd60e51b815260206004820152603460248201527f4552433230546f6b656e536f757263653a2063616e6e6f74206272696467652060448201527f776974682073616d6520626c6f636b636861696e0000000000000000000000006064820152608401620000a8565b60808390526001600160a01b038216620002765760405162461bcd60e51b81526020600482015260336024820152600080516020620016db83398151915260448201527f6f6e20636f6e74726163742061646472657373000000000000000000000000006064820152608401620000a8565b6001600160a01b0380831660a0528116620002ea5760405162461bcd60e51b815260206004820152602d60248201527f4552433230546f6b656e536f757263653a207a65726f20455243323020636f6e60448201526c7472616374206164647265737360981b6064820152608401620000a8565b6001600160a01b031660c052506200038b915050565b80516001600160a01b03811681146200031857600080fd5b919050565b600080600080608085870312156200033457600080fd5b6200033f8562000300565b935060208501519250620003566040860162000300565b9150620003666060860162000300565b905092959194509250565b6000602082840312156200038457600080fd5b5051919050565b60805160a05160c05160e0516112c4620004176000396000818160f5015281816102a1015281816102d801526104f2015260008181610178015281816101e8015281816102800152818161037201528181610a9f0152610c6f01526000818161013e01528181610338015261060a015260008181609d01528181610312015261058701526112c46000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063b6171f7311610066578063b6171f731461012f578063b8c9091a14610139578063c868efaa14610160578063e486df1514610173578063fccc28131461019a57600080fd5b806341d3014d1461009857806355db3e9e146100d257806387a2edba146100db5780639b3e5803146100f0575b600080fd5b6100bf7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100bf60015481565b6100ee6100e9366004610e43565b6101aa565b005b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c9565b6100bf620186a081565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b6100ee61016e366004610edc565b6104df565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b61011762010203600160981b0181565b6101b261078a565b6001600160a01b0385166101e15760405162461bcd60e51b81526004016101d890610f65565b60405180910390fd5b600061020d7f0000000000000000000000000000000000000000000000000000000000000000866107e3565b90508381116102755760405162461bcd60e51b815260206004820152602e60248201527f4552433230546f6b656e536f757263653a20696e73756666696369656e74206160448201526d191a9d5cdd195908185b5bdd5b9d60921b60648201526084016101d8565b83156102c6576102c67f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008661094d565b60006102d28583610fc3565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200160405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018b8152508152602001620186a08152602001888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516001600160a01b038e166020808301919091529181018890529101906060016040516020818303038152906040528152506040518263ffffffff1660e01b8152600401610438919061106a565b6020604051808303816000875af1158015610457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906110e8565b905080886001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a856040516104c391815260200190565b60405180910390a45050506104d86001600055565b5050505050565b6104e761078a565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105855760405162461bcd60e51b815260206004820152603b60248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564205460448201527f656c65706f727465724d657373656e67657220636f6e7472616374000000000060648201526084016101d8565b7f000000000000000000000000000000000000000000000000000000000000000084146106085760405162461bcd60e51b815260206004820152602b60248201527f4552433230546f6b656e536f757263653a20696e76616c69642064657374696e60448201526a30ba34b7b71031b430b4b760a91b60648201526084016101d8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146106975760405162461bcd60e51b815260206004820152602560248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564207360448201526432b73232b960d91b60648201526084016101d8565b6000806106a683850185611117565b909250905060008260018111156106bf576106bf6111df565b036106f057600080828060200190518101906106db91906111f5565b915091506106e98282610a32565b5050610778565b6001826001811115610704576107046111df565b036107305760008180602001905181019061071f91906110e8565b905061072a81610ac9565b50610778565b60405162461bcd60e51b815260206004820181905260248201527f4552433230546f6b656e536f757263653a20696e76616c696420616374696f6e60448201526064016101d8565b50506107846001600055565b50505050565b6002600054036107dc5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101d8565b6002600055565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085091906110e8565b90506108676001600160a01b038516333086610af8565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa1580156108ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d291906110e8565b90508181116109385760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016101d8565b6109428282610fc3565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801561099e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c291906110e8565b6109cc9190611223565b6040516001600160a01b03851660248201526044810182905290915061078490859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b30565b6001600160a01b038216610a585760405162461bcd60e51b81526004016101d890610f65565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a1610ac57f00000000000000000000000000000000000000000000000000000000000000008383610c07565b5050565b600154811115610af557600060015482610ae39190610fc3565b9050610aee81610c37565b5060018190555b50565b6040516001600160a01b03808516602483015283166044820152606481018290526107849085906323b872dd60e01b906084016109fb565b6000610b85826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c9e9092919063ffffffff16565b805190915015610c025780806020019051810190610ba39190611236565b610c025760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101d8565b505050565b6040516001600160a01b038316602482015260448101829052610c0290849063a9059cbb60e01b906064016109fb565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a1610af57f000000000000000000000000000000000000000000000000000000000000000062010203600160981b0183610c07565b6060610cad8484600085610cb5565b949350505050565b606082471015610d165760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101d8565b600080866001600160a01b03168587604051610d32919061125f565b60006040518083038185875af1925050503d8060008114610d6f576040519150601f19603f3d011682016040523d82523d6000602084013e610d74565b606091505b5091509150610d8587838387610d90565b979650505050505050565b60608315610dff578251600003610df8576001600160a01b0385163b610df85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101d8565b5081610cad565b610cad8383815115610e145781518083602001fd5b8060405162461bcd60e51b81526004016101d8919061127b565b6001600160a01b0381168114610af557600080fd5b600080600080600060808688031215610e5b57600080fd5b8535610e6681610e2e565b94506020860135935060408601359250606086013567ffffffffffffffff80821115610e9157600080fd5b818801915088601f830112610ea557600080fd5b813581811115610eb457600080fd5b8960208260051b8501011115610ec957600080fd5b9699959850939650602001949392505050565b60008060008060608587031215610ef257600080fd5b843593506020850135610f0481610e2e565b9250604085013567ffffffffffffffff80821115610f2157600080fd5b818701915087601f830112610f3557600080fd5b813581811115610f4457600080fd5b886020828501011115610f5657600080fd5b95989497505060200194505050565b60208082526028908201527f4552433230546f6b656e536f757263653a207a65726f20726563697069656e74604082015267206164647265737360c01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561094757610947610fad565b600081518084526020808501945080840160005b8381101561100f5781516001600160a01b031687529582019590820190600101610fea565b509495945050505050565b60005b8381101561103557818101518382015260200161101d565b50506000910152565b6000815180845261105681602086016020860161101a565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526110cb610100840182610fd6565b905060a0840151601f198483030160e0850152610942828261103e565b6000602082840312156110fa57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561112a57600080fd5b82356002811061113957600080fd5b9150602083013567ffffffffffffffff8082111561115657600080fd5b818501915085601f83011261116a57600080fd5b81358181111561117c5761117c611101565b604051601f8201601f19908116603f011681019083821181831017156111a4576111a4611101565b816040528281528860208487010111156111bd57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b634e487b7160e01b600052602160045260246000fd5b6000806040838503121561120857600080fd5b825161121381610e2e565b6020939093015192949293505050565b8082018082111561094757610947610fad565b60006020828403121561124857600080fd5b8151801515811461125857600080fd5b9392505050565b6000825161127181846020870161101a565b9190910192915050565b602081526000611258602083018461103e56fea2646970667358221220ae41ab86f0f2d9e84c6efd3f08ae0951dfcea1e1bd7f1a79b97cd3dc87312cd664736f6c634300081200334552433230546f6b656e536f757263653a207a65726f2064657374696e617469", } // ERC20TokenSourceABI is the input ABI used to generate the binding from. @@ -202,12 +202,12 @@ func (_ERC20TokenSource *ERC20TokenSourceTransactorRaw) Transact(opts *bind.Tran return _ERC20TokenSource.Contract.contract.Transact(opts, method, params...) } -// BURNEDTXFEESADDRESS is a free data retrieval call binding the contract method 0xc452165e. +// BURNADDRESS is a free data retrieval call binding the contract method 0xfccc2813. // -// Solidity: function BURNED_TX_FEES_ADDRESS() view returns(address) -func (_ERC20TokenSource *ERC20TokenSourceCaller) BURNEDTXFEESADDRESS(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function BURN_ADDRESS() view returns(address) +func (_ERC20TokenSource *ERC20TokenSourceCaller) BURNADDRESS(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _ERC20TokenSource.contract.Call(opts, &out, "BURNED_TX_FEES_ADDRESS") + err := _ERC20TokenSource.contract.Call(opts, &out, "BURN_ADDRESS") if err != nil { return *new(common.Address), err @@ -219,18 +219,18 @@ func (_ERC20TokenSource *ERC20TokenSourceCaller) BURNEDTXFEESADDRESS(opts *bind. } -// BURNEDTXFEESADDRESS is a free data retrieval call binding the contract method 0xc452165e. +// BURNADDRESS is a free data retrieval call binding the contract method 0xfccc2813. // -// Solidity: function BURNED_TX_FEES_ADDRESS() view returns(address) -func (_ERC20TokenSource *ERC20TokenSourceSession) BURNEDTXFEESADDRESS() (common.Address, error) { - return _ERC20TokenSource.Contract.BURNEDTXFEESADDRESS(&_ERC20TokenSource.CallOpts) +// Solidity: function BURN_ADDRESS() view returns(address) +func (_ERC20TokenSource *ERC20TokenSourceSession) BURNADDRESS() (common.Address, error) { + return _ERC20TokenSource.Contract.BURNADDRESS(&_ERC20TokenSource.CallOpts) } -// BURNEDTXFEESADDRESS is a free data retrieval call binding the contract method 0xc452165e. +// BURNADDRESS is a free data retrieval call binding the contract method 0xfccc2813. // -// Solidity: function BURNED_TX_FEES_ADDRESS() view returns(address) -func (_ERC20TokenSource *ERC20TokenSourceCallerSession) BURNEDTXFEESADDRESS() (common.Address, error) { - return _ERC20TokenSource.Contract.BURNEDTXFEESADDRESS(&_ERC20TokenSource.CallOpts) +// Solidity: function BURN_ADDRESS() view returns(address) +func (_ERC20TokenSource *ERC20TokenSourceCallerSession) BURNADDRESS() (common.Address, error) { + return _ERC20TokenSource.Contract.BURNADDRESS(&_ERC20TokenSource.CallOpts) } // MINTNATIVETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0xb6171f73. diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol index 6f9fef7c7..1b73d2d1f 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/ERC20TokenSource.sol @@ -27,7 +27,7 @@ contract ERC20TokenSource is { // Designated Blackhole Address for this contract. Tokens are sent here to be "burned" when // a SourceAction.Burn message is received from the destination chain. - address public constant BURNED_TX_FEES_ADDRESS = 0x0100000000000000000000000000000000010203; + address public constant BURN_ADDRESS = 0x0100000000000000000000000000000000010203; uint256 public constant MINT_NATIVE_TOKENS_REQUIRED_GAS = 100_000; // Used to keep track of tokens burned through transactions on the destination chain. They can // be reported to this contract to burn an equivalent number of tokens on this chain. @@ -181,7 +181,7 @@ contract ERC20TokenSource is */ function _burnTokens(uint256 amount) private { emit BurnTokens(amount); - SafeERC20.safeTransfer(IERC20(erc20ContractAddress), BURNED_TX_FEES_ADDRESS, amount); + SafeERC20.safeTransfer(IERC20(erc20ContractAddress), BURN_ADDRESS, amount); } /** diff --git a/contracts/src/CrossChainApplications/NativeTokenBridge/tests/ERC20TokenSourceTests.t.sol b/contracts/src/CrossChainApplications/NativeTokenBridge/tests/ERC20TokenSourceTests.t.sol index d986aff04..bd7e41712 100644 --- a/contracts/src/CrossChainApplications/NativeTokenBridge/tests/ERC20TokenSourceTests.t.sol +++ b/contracts/src/CrossChainApplications/NativeTokenBridge/tests/ERC20TokenSourceTests.t.sol @@ -159,7 +159,7 @@ contract ERC20TokenSourceTest is Test { ); assertEq(burnedTxFees, erc20TokenSource.destinationBurnedTotal()); - assertEq(burnedTxFees, mockERC20.balanceOf(erc20TokenSource.BURNED_TX_FEES_ADDRESS())); + assertEq(burnedTxFees, mockERC20.balanceOf(erc20TokenSource.BURN_ADDRESS())); vm.prank(MOCK_TELEPORTER_MESSENGER_ADDRESS); erc20TokenSource.receiveTeleporterMessage( @@ -169,7 +169,7 @@ contract ERC20TokenSourceTest is Test { ); assertEq(burnedTxFees, erc20TokenSource.destinationBurnedTotal()); - assertEq(burnedTxFees, mockERC20.balanceOf(erc20TokenSource.BURNED_TX_FEES_ADDRESS())); + assertEq(burnedTxFees, mockERC20.balanceOf(erc20TokenSource.BURN_ADDRESS())); emit BurnTokens(additionalTxFees); @@ -182,8 +182,7 @@ contract ERC20TokenSourceTest is Test { assertEq(burnedTxFees + additionalTxFees, erc20TokenSource.destinationBurnedTotal()); assertEq( - burnedTxFees + additionalTxFees, - mockERC20.balanceOf(erc20TokenSource.BURNED_TX_FEES_ADDRESS()) + burnedTxFees + additionalTxFees, mockERC20.balanceOf(erc20TokenSource.BURN_ADDRESS()) ); } From b4b64c7a5704b18b8f58aa0d6de44d76e5994f39 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 03:29:23 -0500 Subject: [PATCH 09/24] Add log check to publish block hash --- tests/flows/block_hash_publish_receive.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/flows/block_hash_publish_receive.go b/tests/flows/block_hash_publish_receive.go index c1ddb8a6d..54d372725 100644 --- a/tests/flows/block_hash_publish_receive.go +++ b/tests/flows/block_hash_publish_receive.go @@ -43,7 +43,6 @@ func BlockHashPublishReceive(network interfaces.Network) { expectedBlockHash := block.Hash() // publish latest block hash - tx_opts, err := bind.NewKeyedTransactorWithChainID( fundedKey, subnetAInfo.EVMChainID) Expect(err).Should(BeNil()) @@ -54,12 +53,15 @@ func BlockHashPublishReceive(network interfaces.Network) { receipt := utils.WaitForTransactionSuccess(ctx, subnetAInfo, tx) - // relay publication + publishLog, err := utils.GetEventFromLogs(receipt.Logs, publisher.ParsePublishBlockHash) + Expect(err).Should(BeNil()) + Expect(publishLog.BlockHeight.Uint64()).Should(Equal(expectedBlockNumberU64)) + Expect(publishLog.BlockHash).Should(Equal(expectedBlockHash)) + // relay publication network.RelayMessage(ctx, receipt, subnetAInfo, subnetBInfo, true) // receive publication - blockNumber, blockHash, err := receiver.GetLatestBlockInfo(&bind.CallOpts{}) Expect(err).Should(BeNil()) From a22ffbaf30d1af0ac14373e9e9c4979e16483216 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 09:02:42 -0500 Subject: [PATCH 10/24] Fix test --- tests/flows/block_hash_publish_receive.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/flows/block_hash_publish_receive.go b/tests/flows/block_hash_publish_receive.go index 54d372725..5706bb78a 100644 --- a/tests/flows/block_hash_publish_receive.go +++ b/tests/flows/block_hash_publish_receive.go @@ -56,7 +56,7 @@ func BlockHashPublishReceive(network interfaces.Network) { publishLog, err := utils.GetEventFromLogs(receipt.Logs, publisher.ParsePublishBlockHash) Expect(err).Should(BeNil()) Expect(publishLog.BlockHeight.Uint64()).Should(Equal(expectedBlockNumberU64)) - Expect(publishLog.BlockHash).Should(Equal(expectedBlockHash)) + Expect(publishLog.BlockHash[:]).Should(Equal(expectedBlockHash[:])) // relay publication network.RelayMessage(ctx, receipt, subnetAInfo, subnetBInfo, true) From 38306128b549d0ff633f684b36fcb2ea876b8fcb Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 19 Dec 2023 09:20:15 -0500 Subject: [PATCH 11/24] Remove debug --- tests/local/network.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/local/network.go b/tests/local/network.go index 98165e2b0..e90c5b3ee 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -97,8 +97,7 @@ func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { "eth-apis":["eth","eth-filter","net","admin","web3", "internal-eth","internal-blockchain","internal-transaction", "internal-debug","internal-account","internal-personal", - "debug","debug-tracer","debug-file-tracer","debug-handler"], - "log-level": "debug" + "debug","debug-tracer","debug-file-tracer","debug-handler"] }` manager := runner.NewNetworkManager(anrConfig) From 01884ed31e8027830eff34421fd6df649751fcdc Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Wed, 20 Dec 2023 09:11:10 -0500 Subject: [PATCH 12/24] Review fixes --- tests/local/network.go | 23 +++++++++-------------- tests/testnet/network.go | 6 ------ 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/tests/local/network.go b/tests/local/network.go index e90c5b3ee..9b18c2ea8 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -57,6 +57,13 @@ type LocalNetwork struct { const ( fundedKeyStr = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027" + cChainConfig = `{ + "warp-api-enabled": true, + "eth-apis":["eth","eth-filter","net","admin","web3", + "internal-eth","internal-blockchain","internal-transaction", + "internal-debug","internal-account","internal-personal", + "debug","debug-tracer","debug-file-tracer","debug-handler"] + }` ) func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { @@ -77,13 +84,7 @@ func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { f, err := os.CreateTemp(os.TempDir(), "config.json") Expect(err).Should(BeNil()) - _, err = f.Write([]byte(`{ - "warp-api-enabled": true, - "eth-apis":["eth","eth-filter","net","admin","web3", - "internal-eth","internal-blockchain","internal-transaction", - "internal-debug","internal-account","internal-personal", - "debug","debug-tracer","debug-file-tracer","debug-handler"] - }`)) + _, err = f.Write([]byte(cChainConfig)) Expect(err).Should(BeNil()) warpChainConfigPath := f.Name() @@ -92,13 +93,7 @@ func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { Expect(err).Should(BeNil()) anrConfig := runner.NewDefaultANRConfig() - anrConfig.GlobalCChainConfig = `{ - "warp-api-enabled": true, - "eth-apis":["eth","eth-filter","net","admin","web3", - "internal-eth","internal-blockchain","internal-transaction", - "internal-debug","internal-account","internal-personal", - "debug","debug-tracer","debug-file-tracer","debug-handler"] - }` + anrConfig.GlobalCChainConfig = cChainConfig manager := runner.NewNetworkManager(anrConfig) // Construct the network using the avalanche-network-runner diff --git a/tests/testnet/network.go b/tests/testnet/network.go index da8a4d1d7..fa90d1b20 100644 --- a/tests/testnet/network.go +++ b/tests/testnet/network.go @@ -58,12 +58,6 @@ type testNetwork struct { fundedKey *ecdsa.PrivateKey } -// GetPrimaryNetworkInfo implements interfaces.Network. -func (*testNetwork) GetPrimaryNetworkInfo() interfaces.SubnetTestInfo { - // TODO - panic("unimplemented") -} - func initializeSubnetInfo( subnetPrefix string, teleporterContractAddress common.Address, From 6f1f0dde657b4503bcba9c8822694ecf2bdd1edd Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Wed, 20 Dec 2023 11:32:13 -0500 Subject: [PATCH 13/24] Rename var --- tests/local/network.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/local/network.go b/tests/local/network.go index 9b18c2ea8..f0ad30825 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -57,7 +57,7 @@ type LocalNetwork struct { const ( fundedKeyStr = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027" - cChainConfig = `{ + warpEnabledChainConfig = `{ "warp-api-enabled": true, "eth-apis":["eth","eth-filter","net","admin","web3", "internal-eth","internal-blockchain","internal-transaction", @@ -84,7 +84,7 @@ func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { f, err := os.CreateTemp(os.TempDir(), "config.json") Expect(err).Should(BeNil()) - _, err = f.Write([]byte(cChainConfig)) + _, err = f.Write([]byte(warpEnabledChainConfig)) Expect(err).Should(BeNil()) warpChainConfigPath := f.Name() @@ -93,7 +93,7 @@ func NewLocalNetwork(warpGenesisFile string) *LocalNetwork { Expect(err).Should(BeNil()) anrConfig := runner.NewDefaultANRConfig() - anrConfig.GlobalCChainConfig = cChainConfig + anrConfig.GlobalCChainConfig = warpEnabledChainConfig manager := runner.NewNetworkManager(anrConfig) // Construct the network using the avalanche-network-runner From 41315b667d0be3256075a4dc3e21692ab3f3a3f7 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Wed, 20 Dec 2023 11:36:13 -0500 Subject: [PATCH 14/24] lint --- tests/local/network.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/local/network.go b/tests/local/network.go index f0ad30825..5ea5fc4d4 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -56,7 +56,7 @@ type LocalNetwork struct { } const ( - fundedKeyStr = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027" + fundedKeyStr = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027" warpEnabledChainConfig = `{ "warp-api-enabled": true, "eth-apis":["eth","eth-filter","net","admin","web3", @@ -415,8 +415,7 @@ func (n *LocalNetwork) RelayMessage(ctx context.Context, expectSuccess bool, ) *types.Receipt { // Fetch the Teleporter message from the logs - sendEvent, err := - utils.GetEventFromLogs(sourceReceipt.Logs, source.TeleporterMessenger.ParseSendCrossChainMessage) + sendEvent, err := utils.GetEventFromLogs(sourceReceipt.Logs, source.TeleporterMessenger.ParseSendCrossChainMessage) Expect(err).Should(BeNil()) signedWarpMessageBytes := n.ConstructSignedWarpMessageBytes(ctx, sourceReceipt, source, destination) @@ -439,8 +438,7 @@ func (n *LocalNetwork) RelayMessage(ctx context.Context, receipt := utils.SendTransactionAndWaitForSuccess(ctx, destination, signedTx) // Check the transaction logs for the ReceiveCrossChainMessage event emitted by the Teleporter contract - receiveEvent, err := - utils.GetEventFromLogs(receipt.Logs, destination.TeleporterMessenger.ParseReceiveCrossChainMessage) + receiveEvent, err := utils.GetEventFromLogs(receipt.Logs, destination.TeleporterMessenger.ParseReceiveCrossChainMessage) Expect(err).Should(BeNil()) Expect(receiveEvent.OriginBlockchainID[:]).Should(Equal(source.BlockchainID[:])) return receipt From 6cf2f7b44bce2616fd0a402441aa82c9be59de22 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Wed, 20 Dec 2023 11:52:59 -0500 Subject: [PATCH 15/24] lint --- tests/local/network.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/local/network.go b/tests/local/network.go index 5ea5fc4d4..071145f56 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -438,7 +438,10 @@ func (n *LocalNetwork) RelayMessage(ctx context.Context, receipt := utils.SendTransactionAndWaitForSuccess(ctx, destination, signedTx) // Check the transaction logs for the ReceiveCrossChainMessage event emitted by the Teleporter contract - receiveEvent, err := utils.GetEventFromLogs(receipt.Logs, destination.TeleporterMessenger.ParseReceiveCrossChainMessage) + receiveEvent, err := utils.GetEventFromLogs( + receipt.Logs, + destination.TeleporterMessenger.ParseReceiveCrossChainMessage, + ) Expect(err).Should(BeNil()) Expect(receiveEvent.OriginBlockchainID[:]).Should(Equal(source.BlockchainID[:])) return receipt From c161a78a2825b809aab2e3a49606f51838b90026 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 4 Jan 2024 09:15:16 -0500 Subject: [PATCH 16/24] Comment on funding amounts for ntb tests --- tests/flows/erc20_to_native_token_bridge.go | 8 +++++--- tests/flows/native_token_bridge.go | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/flows/erc20_to_native_token_bridge.go b/tests/flows/erc20_to_native_token_bridge.go index ce9e1edf1..e9df78367 100644 --- a/tests/flows/erc20_to_native_token_bridge.go +++ b/tests/flows/erc20_to_native_token_bridge.go @@ -62,13 +62,15 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { log.Info("Example ERC20 Contract Address: " + exampleERC20ContractAddress.Hex()) { - // Fund the deployer addresses on each chain + // We need 10 eth (1e19 wei) to deploy the contract, plus some for gas for other transactions + fundingAmount := utils.BigIntMul(big.NewInt(1e15), big.NewInt(1e5)) + utils.SendNativeTransfer( ctx, sourceSubnet, fundedKey, deployerAddress, - utils.BigIntMul(initialReserveImbalance, big.NewInt(2)), + fundingAmount, ) utils.SendNativeTransfer( @@ -76,7 +78,7 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { destSubnet, fundedKey, deployerAddress, - utils.BigIntMul(initialReserveImbalance, big.NewInt(2)), + fundingAmount, ) } diff --git a/tests/flows/native_token_bridge.go b/tests/flows/native_token_bridge.go index d081b5337..eaec0499f 100644 --- a/tests/flows/native_token_bridge.go +++ b/tests/flows/native_token_bridge.go @@ -59,7 +59,9 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { log.Info("Native Token Bridge Contract Address: " + bridgeContractAddress.Hex()) { - // Fund the deployer addresses on each chain + // The deployer is used to also send native transfers so we don't have to create an additional address. + // The deployer will send 1.25*initialReserveImbalance over the course of the test, plus 10 eth to + // deploy the contract, plus a little bit of gas, so transfer 2*initialReserveImbalance to be safe. utils.SendNativeTransfer( ctx, sourceSubnet, From 8efaff16ad3dd700a39996a127d05775412c6c7a Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 4 Jan 2024 09:19:34 -0500 Subject: [PATCH 17/24] Lint --- tests/flows/erc20_to_native_token_bridge.go | 2 +- tests/flows/native_token_bridge.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/flows/erc20_to_native_token_bridge.go b/tests/flows/erc20_to_native_token_bridge.go index e9df78367..d7410e6ab 100644 --- a/tests/flows/erc20_to_native_token_bridge.go +++ b/tests/flows/erc20_to_native_token_bridge.go @@ -64,7 +64,7 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { { // We need 10 eth (1e19 wei) to deploy the contract, plus some for gas for other transactions fundingAmount := utils.BigIntMul(big.NewInt(1e15), big.NewInt(1e5)) - + utils.SendNativeTransfer( ctx, sourceSubnet, diff --git a/tests/flows/native_token_bridge.go b/tests/flows/native_token_bridge.go index eaec0499f..c69c8d20c 100644 --- a/tests/flows/native_token_bridge.go +++ b/tests/flows/native_token_bridge.go @@ -60,7 +60,7 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { { // The deployer is used to also send native transfers so we don't have to create an additional address. - // The deployer will send 1.25*initialReserveImbalance over the course of the test, plus 10 eth to + // The deployer will send 1.25*initialReserveImbalance over the course of the test, plus 10 eth to // deploy the contract, plus a little bit of gas, so transfer 2*initialReserveImbalance to be safe. utils.SendNativeTransfer( ctx, From c546f931338ab87e52d292aaafc31c57cec7f5d0 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 4 Jan 2024 09:28:38 -0500 Subject: [PATCH 18/24] Fix test --- tests/flows/erc20_to_native_token_bridge.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/flows/erc20_to_native_token_bridge.go b/tests/flows/erc20_to_native_token_bridge.go index d7410e6ab..1bb93d4ac 100644 --- a/tests/flows/erc20_to_native_token_bridge.go +++ b/tests/flows/erc20_to_native_token_bridge.go @@ -62,23 +62,24 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { log.Info("Example ERC20 Contract Address: " + exampleERC20ContractAddress.Hex()) { - // We need 10 eth (1e19 wei) to deploy the contract, plus some for gas for other transactions - fundingAmount := utils.BigIntMul(big.NewInt(1e15), big.NewInt(1e5)) - + // deployerAddress needs 10 eth (1e19 wei) to deploy the contract, plus some for gas for other transactions + sourceFundingAmount := utils.BigIntMul(big.NewInt(1e15), big.NewInt(1e5)) utils.SendNativeTransfer( ctx, sourceSubnet, fundedKey, deployerAddress, - fundingAmount, + sourceFundingAmount, ) + // deployerAddress needs valueToReturn to attempt (and fail) to send tokens before it is sent any from the source. + // It also needs some extra for gas costs, so we send valueToReturn*2 utils.SendNativeTransfer( ctx, destSubnet, fundedKey, deployerAddress, - fundingAmount, + utils.BigIntMul(valueToReturn, big.NewInt(2)), ) } From 4558dbd1932758658708f4efb9ebc5a1192ff186 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 4 Jan 2024 09:56:14 -0500 Subject: [PATCH 19/24] Update tests/flows/erc20_to_native_token_bridge.go Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com> Signed-off-by: Geoff Stuart --- tests/flows/erc20_to_native_token_bridge.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/flows/erc20_to_native_token_bridge.go b/tests/flows/erc20_to_native_token_bridge.go index 1bb93d4ac..5a0815937 100644 --- a/tests/flows/erc20_to_native_token_bridge.go +++ b/tests/flows/erc20_to_native_token_bridge.go @@ -62,7 +62,7 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { log.Info("Example ERC20 Contract Address: " + exampleERC20ContractAddress.Hex()) { - // deployerAddress needs 10 eth (1e19 wei) to deploy the contract, plus some for gas for other transactions + // Fund the deployer address with sufficient native tokens (10 eth = 1e20 wei) on the source chain to deploy the contract and send a number of transfer transactions. sourceFundingAmount := utils.BigIntMul(big.NewInt(1e15), big.NewInt(1e5)) utils.SendNativeTransfer( ctx, From 43b6539ce1c49e0e9e5a71a629001e917304fc8c Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 4 Jan 2024 09:56:22 -0500 Subject: [PATCH 20/24] Update tests/flows/erc20_to_native_token_bridge.go Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com> Signed-off-by: Geoff Stuart --- tests/flows/erc20_to_native_token_bridge.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/flows/erc20_to_native_token_bridge.go b/tests/flows/erc20_to_native_token_bridge.go index 5a0815937..53346cab1 100644 --- a/tests/flows/erc20_to_native_token_bridge.go +++ b/tests/flows/erc20_to_native_token_bridge.go @@ -72,7 +72,7 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { sourceFundingAmount, ) - // deployerAddress needs valueToReturn to attempt (and fail) to send tokens before it is sent any from the source. + // On the destination chain, the deployer address needs valueToReturn native tokens to attempt (and fail) to send tokens before the bridge contracts are collateralized. // It also needs some extra for gas costs, so we send valueToReturn*2 utils.SendNativeTransfer( ctx, From d78691ab5a7616088153b6cc7eeafcec53042803 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 4 Jan 2024 09:56:26 -0500 Subject: [PATCH 21/24] Update tests/flows/native_token_bridge.go Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com> Signed-off-by: Geoff Stuart --- tests/flows/native_token_bridge.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/flows/native_token_bridge.go b/tests/flows/native_token_bridge.go index c69c8d20c..67e0d7eb3 100644 --- a/tests/flows/native_token_bridge.go +++ b/tests/flows/native_token_bridge.go @@ -60,8 +60,8 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { { // The deployer is used to also send native transfers so we don't have to create an additional address. - // The deployer will send 1.25*initialReserveImbalance over the course of the test, plus 10 eth to - // deploy the contract, plus a little bit of gas, so transfer 2*initialReserveImbalance to be safe. + // The deployer will send 1.25*initialReserveImbalance over the course of the test. Send 2*initialReserveImbalance native tokens + // so that it also has enough to cover transaction fees, including deploying the contract. utils.SendNativeTransfer( ctx, sourceSubnet, From 4d1a43fba1cdce683ff71c7e294ce1b0629f82cb Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 4 Jan 2024 10:00:47 -0500 Subject: [PATCH 22/24] Linter --- tests/flows/erc20_to_native_token_bridge.go | 7 ++++--- tests/flows/native_token_bridge.go | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/flows/erc20_to_native_token_bridge.go b/tests/flows/erc20_to_native_token_bridge.go index 53346cab1..f3f74fd36 100644 --- a/tests/flows/erc20_to_native_token_bridge.go +++ b/tests/flows/erc20_to_native_token_bridge.go @@ -62,7 +62,8 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { log.Info("Example ERC20 Contract Address: " + exampleERC20ContractAddress.Hex()) { - // Fund the deployer address with sufficient native tokens (10 eth = 1e20 wei) on the source chain to deploy the contract and send a number of transfer transactions. + // Fund the deployer address with sufficient native tokens (100 eth = 1e20 wei) on the source chain to deploy the + // contract and send a number of transfer transactions. sourceFundingAmount := utils.BigIntMul(big.NewInt(1e15), big.NewInt(1e5)) utils.SendNativeTransfer( ctx, @@ -72,8 +73,8 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { sourceFundingAmount, ) - // On the destination chain, the deployer address needs valueToReturn native tokens to attempt (and fail) to send tokens before the bridge contracts are collateralized. - // It also needs some extra for gas costs, so we send valueToReturn*2 + // On the destination chain, the deployer address needs valueToReturn native tokens to attempt (and fail) to send + // tokens before the bridge contracts are collateralized. It also needs some extra for gas costs, so we send valueToReturn*2 utils.SendNativeTransfer( ctx, destSubnet, diff --git a/tests/flows/native_token_bridge.go b/tests/flows/native_token_bridge.go index 67e0d7eb3..c5c4cb201 100644 --- a/tests/flows/native_token_bridge.go +++ b/tests/flows/native_token_bridge.go @@ -60,8 +60,8 @@ func NativeTokenBridge(network interfaces.LocalNetwork) { { // The deployer is used to also send native transfers so we don't have to create an additional address. - // The deployer will send 1.25*initialReserveImbalance over the course of the test. Send 2*initialReserveImbalance native tokens - // so that it also has enough to cover transaction fees, including deploying the contract. + // The deployer will send 1.25*initialReserveImbalance over the course of the test. Send 2*initialReserveImbalance + // native tokens so that it also has enough to cover transaction fees, including deploying the contract. utils.SendNativeTransfer( ctx, sourceSubnet, From 2c8824cb1b6476efd81dc9ff169e839106fc9fc8 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 4 Jan 2024 10:05:12 -0500 Subject: [PATCH 23/24] Linter --- tests/flows/erc20_to_native_token_bridge.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/flows/erc20_to_native_token_bridge.go b/tests/flows/erc20_to_native_token_bridge.go index f3f74fd36..0e9d5da42 100644 --- a/tests/flows/erc20_to_native_token_bridge.go +++ b/tests/flows/erc20_to_native_token_bridge.go @@ -73,8 +73,9 @@ func ERC20ToNativeTokenBridge(network interfaces.LocalNetwork) { sourceFundingAmount, ) - // On the destination chain, the deployer address needs valueToReturn native tokens to attempt (and fail) to send - // tokens before the bridge contracts are collateralized. It also needs some extra for gas costs, so we send valueToReturn*2 + // On the destination chain, the deployer address needs valueToReturn native tokens to attempt (and fail) + // to send tokens before the bridge contracts are collateralized. It also needs some extra for gas costs, + // so we send valueToReturn*2 utils.SendNativeTransfer( ctx, destSubnet, From 7c40855948b0fc2b0b932b5eaa467eb59934f376 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 4 Jan 2024 19:11:24 -0500 Subject: [PATCH 24/24] Refactor TraceTransaction --- tests/utils/utils.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/utils/utils.go b/tests/utils/utils.go index d4aa1eb4b..98ebd8a89 100644 --- a/tests/utils/utils.go +++ b/tests/utils/utils.go @@ -455,8 +455,7 @@ func waitForTransaction( if success { if receipt.Status == types.ReceiptStatusFailed { - // Gomega will print the transaction trace - Expect(TraceTransaction(ctx, subnetInfo, receipt.TxHash)).Should(Equal("")) + TraceTransactionAndExit(ctx, subnetInfo, receipt.TxHash) } } else { Expect(receipt.Status).Should(Equal(types.ReceiptStatusFailed)) @@ -474,8 +473,7 @@ func GetEventFromLogsOrTrace[T any]( ) T { log, err := GetEventFromLogs(receipt.Logs, parser) if err != nil { - // Gomega will print the transaction trace - Expect(TraceTransaction(ctx, subnetInfo, receipt.TxHash)).Should(Equal("")) + TraceTransactionAndExit(ctx, subnetInfo, receipt.TxHash) } return log } @@ -532,6 +530,11 @@ func CheckBalance(ctx context.Context, addr common.Address, expectedBalance *big ExpectBigEqual(bal, expectedBalance) } +// Gomega will print the transaction trace and exit +func TraceTransactionAndExit(ctx context.Context, subnetInfo interfaces.SubnetTestInfo, txHash common.Hash) { + Expect(TraceTransaction(ctx, subnetInfo, txHash)).Should(Equal("")) +} + func TraceTransaction(ctx context.Context, subnetInfo interfaces.SubnetTestInfo, txHash common.Hash) string { url := HttpToRPCURI(subnetInfo.NodeURIs[0], subnetInfo.BlockchainID.String()) rpcClient, err := rpc.DialContext(ctx, url)