diff --git a/abi-bindings/go/CrossChainApplications/examples/ERC20Bridge/ERC20Bridge/ERC20Bridge.go b/abi-bindings/go/CrossChainApplications/examples/ERC20Bridge/ERC20Bridge/ERC20Bridge.go index 769e257df..c72c8a7e5 100644 --- a/abi-bindings/go/CrossChainApplications/examples/ERC20Bridge/ERC20Bridge/ERC20Bridge.go +++ b/abi-bindings/go/CrossChainApplications/examples/ERC20Bridge/ERC20Bridge/ERC20Bridge.go @@ -31,8 +31,8 @@ var ( // ERC20BridgeMetaData contains all meta data concerning the ERC20Bridge contract. var ERC20BridgeMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"nativeBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nativeBridgeAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"bridgeTokenAddress\",\"type\":\"address\"}],\"name\":\"CreateBridgeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"MintBridgeTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"}],\"name\":\"SubmitCreateBridgeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CREATE_BRIDGE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_BRIDGE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TRANSFER_BRIDGE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WARP_PRECOMPILE_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"primaryFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"secondaryFeeAmount\",\"type\":\"uint256\"}],\"name\":\"bridgeTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeTokenContract\",\"type\":\"address\"}],\"name\":\"bridgedBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"nativeName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"nativeSymbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"nativeDecimals\",\"type\":\"uint8\"}],\"name\":\"encodeCreateBridgeTokenData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"bridgeAmount\",\"type\":\"uint256\"}],\"name\":\"encodeMintBridgeTokensData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"encodeTransferBridgeTokensData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinTeleporterVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nativeBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeTokenAddress\",\"type\":\"address\"}],\"name\":\"nativeToWrappedTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"bridgeTokenAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"contractERC20\",\"name\":\"nativeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"messageFeeAsset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"messageFeeAmount\",\"type\":\"uint256\"}],\"name\":\"submitCreateBridgeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeTokenContract\",\"type\":\"address\"}],\"name\":\"submittedBridgeTokenCreations\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"tokenCreationSubmitted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeToken\",\"type\":\"address\"}],\"name\":\"wrappedTokenContracts\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"bridgeTokenExists\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60c06040523480156200001157600080fd5b50604051620044ff380380620044ff833981016040819052620000349162000212565b600160005580806001600160a01b038116620000bc5760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f727465722072656769737472792061646472657373000000000000000000606482015260840160405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa15801562000107573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200012d919062000244565b600255506200013c33620001c0565b507302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000190573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001b6919062000244565b60a052506200025e565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156200022557600080fd5b81516001600160a01b03811681146200023d57600080fd5b9392505050565b6000602082840312156200025757600080fd5b5051919050565b60805160a051614251620002ae6000396000818161021b01528181610b0c01528181611a6b015261233601526000818161018001528181610dcc01528181610ff101526111f401526142516000f3fe60806040523480156200001157600080fd5b5060043610620001755760003560e01c80637a465fd911620000d3578063b9e55da11162000086578063b9e55da1146200039f578063c60da61214620003d3578063c63d220714620003ea578063c868efaa1462000401578063d2cc7a701462000418578063f2fde38b146200042157600080fd5b80637a465fd914620002e65780638343f66114620002f15780638c56fcf014620003395780638da5cb5b14620003505780639731429714620003625780639bd9abc0146200037957600080fd5b80635f217bcc116200012c5780635f217bcc146200026357806365435568146200026e5780636b47cd9a14620002ab5780636c7e40d114620002b6578063715018a614620002cd5780637497185614620002d757600080fd5b80631a7f5bec146200017a5780632b0d8f1814620001bf578063367e958414620001d85780634511243e14620001fe5780634950d2d014620002155780635eb99514146200024c575b600080fd5b620001a27f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b620001d6620001d0366004620025bc565b62000438565b005b620001ef620001e9366004620026bd565b62000533565b604051620001b69190620027a5565b620001d66200020f366004620025bc565b62000592565b6200023d7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001620001b6565b620001d66200025d366004620027ba565b62000685565b6200023d621e848081565b620001a26200027f366004620027d4565b60076020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b6200023d620493e081565b620001d6620002c73660046200281b565b6200069d565b620001d6620009ee565b620001a26005600160991b0181565b6200023d62030d4081565b6200032862000302366004620027d4565b600460209081526000938452604080852082529284528284209052825290205460ff1681565b6040519015158152602001620001b6565b620001ef6200034a3660046200287d565b62000a06565b6003546001600160a01b0316620001a2565b6200032862000373366004620025bc565b62000a62565b620003286200038a366004620025bc565b60066020526000908152604090205460ff1681565b6200023d620003b0366004620027d4565b600560209081526000938452604080852082529284528284209052825290205481565b620001ef620003e4366004620028c3565b62000a80565b620001d6620003fb3660046200292f565b62000b00565b620001d662000412366004620029a4565b62000db4565b6002546200023d565b620001d662000432366004620025bc565b62000f67565b6200044262000fe3565b6001600160a01b038116620004745760405162461bcd60e51b81526004016200046b9062002a34565b60405180910390fd5b6200047f8162000a62565b15620004e45760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b60648201526084016200046b565b6001600160a01b0381166000818152600160208190526040808320805460ff1916909217909155517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b606060008585858560405160200162000550949392919062002a82565b60405160208183030381529060405290506000816040516020016200057792919062002ae7565b6040516020818303038152906040529150505b949350505050565b6200059c62000fe3565b6001600160a01b038116620005c55760405162461bcd60e51b81526004016200046b9062002a34565b620005d08162000a62565b620006305760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b60648201526084016200046b565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152600160205260409020805460ff19169055565b6200068f62000fe3565b6200069a8162000fed565b50565b620006a762001194565b6001600160a01b038416620006d05760405162461bcd60e51b81526004016200046b9062002b21565b6000620006dc620011ef565b9050600082156200070b57620006f38484620012f1565b90506200070b6001600160a01b038516838362001467565b60006200084986876001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000751573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200077b919081019062002bc6565b886001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620007ba573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620007e4919081019062002bc6565b896001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000823573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e9919062002bff565b90506000836001600160a01b031663624488506040518060c001604052808c81526020018b6001600160a01b0316815260200160405180604001604052808b6001600160a01b03168152602001888152508152602001621e84808152602001600067ffffffffffffffff811115620008c557620008c5620025dc565b604051908082528060200260200182016040528015620008ef578160200160208202803683370190505b508152602001858152506040518263ffffffff1660e01b815260040162000917919062002c65565b6020604051808303816000875af115801562000937573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200095d919062002ce7565b60008a81526004602090815260408083206001600160a01b03808e16808652918452828520908d16808652935292819020805460ff1916600117905551929350918b907f110b902745a3d7d6b66732479f01de654a3bc6e501be7c8ba2c3a6f9868cb53990620009d09086815260200190565b60405180910390a450505050620009e76001600055565b5050505050565b620009f862001553565b62000a046000620015af565b565b6060600084848460405160200162000a219392919062002d01565b604051602081830303815290604052905060018160405160200162000a4892919062002ae7565b6040516020818303038152906040529150505b9392505050565b6001600160a01b031660009081526001602052604090205460ff1690565b60408051602081018890526001600160a01b0387811682840152868116606080840191909152908616608083015260a0820185905260c08083018590528351808403909101815260e08301909352919062000ae49060029083906101000162002ae7565b6040516020818303038152906040529150509695505050505050565b62000b0a62001194565b7f0000000000000000000000000000000000000000000000000000000000000000870362000b4c5760405162461bcd60e51b81526004016200046b9062002d25565b6001600160a01b03841662000b755760405162461bcd60e51b81526004016200046b9062002d6d565b6001600160a01b03861662000b9e5760405162461bcd60e51b81526004016200046b9062002b21565b6001600160a01b03851660009081526006602052604090205460ff161562000c895762000bcc818362002dc6565b831162000c2b5760405162461bcd60e51b815260206004820152602660248201527f45524332304272696467653a20696e73756666696369656e7420746f74616c20604482015265185b5bdd5b9d60d21b60648201526084016200046b565b62000c836040518060e00160405280898152602001886001600160a01b03168152602001876001600160a01b03168152602001866001600160a01b031681526020018581526020018481526020018381525062001601565b62000da0565b60008781526004602090815260408083206001600160a01b03808b168552908352818420908916845290915290205460ff1662000d1b5760405162461bcd60e51b815260206004820152602960248201527f45524332304272696467653a20696e76616c69642062726964676520746f6b656044820152686e206164647265737360b81b60648201526084016200046b565b600062000d298685620012f1565b905082811162000d8e5760405162461bcd60e51b815260206004820152602960248201527f45524332304272696467653a20696e73756666696369656e742061646a757374604482015268195908185b5bdd5b9d60ba1b60648201526084016200046b565b62000d9e888888888588620019ed565b505b62000dab6001600055565b50505050505050565b60025460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa15801562000e1c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e42919062002ce7565b101562000eab5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b60648201526084016200046b565b62000eb63362000a62565b1562000f1e5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b60648201526084016200046b565b62000f61848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525062001ca992505050565b50505050565b62000f7162001553565b6001600160a01b03811662000fd85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200046b565b6200069a81620015af565b62000a0462001553565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200104e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001074919062002ce7565b60025490915081831115620010e65760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b60648201526084016200046b565b8083116200115d5760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e0060648201526084016200046b565b6002839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b600260005403620011e85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016200046b565b6002600055565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001251573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001277919062002ddc565b9050620012848162000a62565b15620012ec5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b60648201526084016200046b565b919050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156200133b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001361919062002ce7565b90506200137a6001600160a01b03851633308662001e27565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015620013c2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013e8919062002ce7565b9050818111620014505760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016200046b565b6200145c828262002dfc565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015620014b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014df919062002ce7565b620014eb919062002dc6565b6040516001600160a01b03851660248201526044810182905290915062000f6190859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262001e4b565b6003546001600160a01b0316331462000a045760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200046b565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006200160d620011ef565b90506000808360a00151111562001650576200163283604001518460a00151620012f1565b604084015190915062001650906001600160a01b0316838362001467565b60008360a00151846080015162001668919062002dfc565b604085810151905163079cc67960e41b815233600482015260248101839052919250906001600160a01b038216906379cc679090604401600060405180830381600087803b158015620016ba57600080fd5b505af1158015620016cf573d6000803e3d6000fd5b505050506000816001600160a01b031663f72539686040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001714573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200173a919062002ce7565b90506000826001600160a01b0316631a0b79bf6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200177d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620017a3919062002ddc565b905081876000015103620017e957806001600160a01b031687602001516001600160a01b031614620017e95760405162461bcd60e51b81526004016200046b9062002e12565b60006200186f88600001518960200151866001600160a01b03166374d32ad46040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001838573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200185e919062002ddc565b8b60600151898d60c0015162000a80565b90506000876001600160a01b031663624488506040518060c00160405280878152602001866001600160a01b0316815260200160405180604001604052808e604001516001600160a01b031681526020018c8152508152602001620493e08152602001600067ffffffffffffffff811115620018ef57620018ef620025dc565b60405190808252806020026020018201604052801562001919578160200160208202803683370190505b508152602001858152506040518263ffffffff1660e01b815260040162001941919062002c65565b6020604051808303816000875af115801562001961573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001987919062002ce7565b90508089600001518a604001516001600160a01b03167f97935c4470efae40c8440c3abfe968a5512232dd375cc974e712f487c2b99c318c602001518d606001518b604051620019da9392919062002d01565b60405180910390a4505050505050505050565b6001600160a01b03841660009081526006602052604090205460ff161562001a695760405162461bcd60e51b815260206004820152602860248201527f45524332304272696467653a2063616e6e6f742062726964676520777261707060448201526732b2103a37b5b2b760c11b60648201526084016200046b565b7f0000000000000000000000000000000000000000000000000000000000000000860362001aab5760405162461bcd60e51b81526004016200046b9062002d25565b600062001ab7620011ef565b9050811562001ad65762001ad66001600160a01b038616828462001467565b600062001ae4838562002dfc565b60008981526005602090815260408083206001600160a01b03808d168552908352818420908b16845290915281208054929350839290919062001b2990849062002dc6565b909155506000905062001b3e87878462000a06565b90506000836001600160a01b031663624488506040518060c001604052808d81526020018c6001600160a01b0316815260200160405180604001604052808d6001600160a01b031681526020018a815250815260200162030d408152602001600067ffffffffffffffff81111562001bba5762001bba620025dc565b60405190808252806020026020018201604052801562001be4578160200160208202803683370190505b508152602001858152506040518263ffffffff1660e01b815260040162001c0c919062002c65565b6020604051808303816000875af115801562001c2c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001c52919062002ce7565b9050808a896001600160a01b03167f97935c4470efae40c8440c3abfe968a5512232dd375cc974e712f487c2b99c318c8b8860405162001c959392919062002d01565b60405180910390a450505050505050505050565b6000808280602001905181019062001cc2919062002e61565b9092509050600082600281111562001cde5762001cde62002ad1565b0362001d22576000806000808480602001905181019062001d00919062002ed0565b935093509350935062001d1889898686868662001f29565b50505050620009e7565b600182600281111562001d395762001d3962002ad1565b0362001d785760008060008380602001905181019062001d5a919062002f5a565b92509250925062001d6f888885858562002098565b505050620009e7565b600282600281111562001d8f5762001d8f62002ad1565b0362001dde576000806000806000808680602001905181019062001db4919062002fa2565b95509550955095509550955062001dd28b8b88888888888862002212565b505050505050620009e7565b60405162461bcd60e51b815260206004820152601b60248201527f45524332304272696467653a20696e76616c696420616374696f6e000000000060448201526064016200046b565b62000f61846323b872dd60e01b8585856040516024016200151b9392919062002d01565b600062001ea2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620023cb9092919063ffffffff16565b80519091501562001f24578080602001905181019062001ec3919062003012565b62001f245760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016200046b565b505050565b60008681526007602090815260408083206001600160a01b038981168552908352818420888216855290925290912054161562001fba5760405162461bcd60e51b815260206004820152602860248201527f45524332304272696467653a2062726964676520746f6b656e20616c72656164604482015267792065786973747360c01b60648201526084016200046b565b600086868686868660405162001fd09062002598565b62001fe19695949392919062003036565b604051809103906000f08015801562001ffe573d6000803e3d6000fd5b506001600160a01b038181166000818152600660209081526040808320805460ff191660011790558c8352600782528083208c8616808552908352818420958c168085529583529281902080546001600160a01b031916851790555192835293945091928a917fe1c61a845f79534e11924517ddbedc668d0c20e467eafb4d3bd2858e2815f3b5910160405180910390a450505050505050565b620020a262001194565b6001600160a01b038216620020cb5760405162461bcd60e51b81526004016200046b9062002d6d565b60008581526007602090815260408083206001600160a01b03808916855290835281842087821685529092529091205416806200215c5760405162461bcd60e51b815260206004820152602860248201527f45524332304272696467653a2062726964676520746f6b656e20646f6573206e6044820152671bdd08195e1a5cdd60c21b60648201526084016200046b565b6040516340c10f1960e01b81526001600160a01b038481166004830152602482018490528216906340c10f1990604401600060405180830381600087803b158015620021a757600080fd5b505af1158015620021bc573d6000803e3d6000fd5b5050604080516001600160a01b03878116825260208201879052851693507fc0767f158f0d5394b598489a51ed607cd55a8be2dcef113ba1626efcf4c6395492500160405180910390a250620009e76001600055565b6200221c62001194565b6001600160a01b038316620022455760405162461bcd60e51b81526004016200046b9062002d6d565b6001600160a01b0385166200226e5760405162461bcd60e51b81526004016200046b9062002b21565b60008881526005602090815260408083206001600160a01b03808c168552908352818420908816845290915290205482811015620022f95760405162461bcd60e51b815260206004820152602160248201527f45524332304272696467653a20696e73756666696369656e742062616c616e636044820152606560f81b60648201526084016200046b565b62002305838262002dfc565b60008a81526005602090815260408083206001600160a01b03808e168552908352818420908a1684529091529020557f00000000000000000000000000000000000000000000000000000000000000008703620023a4576001600160a01b0386163014620023875760405162461bcd60e51b81526004016200046b9062002e12565b6200239d6001600160a01b0386168585620023dc565b50620023b6565b620023b4878787878787620019ed565b505b620023c16001600055565b5050505050505050565b60606200058a84846000856200240e565b6040516001600160a01b03831660248201526044810182905262001f2490849063a9059cbb60e01b906064016200151b565b606082471015620024715760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016200046b565b600080866001600160a01b031685876040516200248f919062003095565b60006040518083038185875af1925050503d8060008114620024ce576040519150601f19603f3d011682016040523d82523d6000602084013e620024d3565b606091505b5091509150620024e687838387620024f1565b979650505050505050565b60608315620025655782516000036200255d576001600160a01b0385163b6200255d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200046b565b50816200058a565b6200058a83838151156200257c5781518083602001fd5b8060405162461bcd60e51b81526004016200046b9190620027a5565b61116880620030b483390190565b6001600160a01b03811681146200069a57600080fd5b600060208284031215620025cf57600080fd5b813562000a5b81620025a6565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156200261e576200261e620025dc565b604052919050565b600067ffffffffffffffff821115620026435762002643620025dc565b50601f01601f191660200190565b600082601f8301126200266357600080fd5b81356200267a620026748262002626565b620025f2565b8181528460208386010111156200269057600080fd5b816020850160208301376000918101602001919091529392505050565b60ff811681146200069a57600080fd5b60008060008060808587031215620026d457600080fd5b8435620026e181620025a6565b9350602085013567ffffffffffffffff80821115620026ff57600080fd5b6200270d8883890162002651565b945060408701359150808211156200272457600080fd5b50620027338782880162002651565b92505060608501356200274681620026ad565b939692955090935050565b60005b838110156200276e57818101518382015260200162002754565b50506000910152565b600081518084526200279181602086016020860162002751565b601f01601f19169290920160200192915050565b60208152600062000a5b602083018462002777565b600060208284031215620027cd57600080fd5b5035919050565b600080600060608486031215620027ea57600080fd5b833592506020840135620027fe81620025a6565b915060408401356200281081620025a6565b809150509250925092565b600080600080600060a086880312156200283457600080fd5b8535945060208601356200284881620025a6565b935060408601356200285a81620025a6565b925060608601356200286c81620025a6565b949793965091946080013592915050565b6000806000606084860312156200289357600080fd5b8335620028a081620025a6565b92506020840135620028b281620025a6565b929592945050506040919091013590565b60008060008060008060c08789031215620028dd57600080fd5b863595506020870135620028f181620025a6565b945060408701356200290381620025a6565b935060608701356200291581620025a6565b9598949750929560808101359460a0909101359350915050565b600080600080600080600060e0888a0312156200294b57600080fd5b8735965060208801356200295f81620025a6565b955060408801356200297181620025a6565b945060608801356200298381620025a6565b9699959850939660808101359560a0820135955060c0909101359350915050565b60008060008060608587031215620029bb57600080fd5b843593506020850135620029cf81620025a6565b9250604085013567ffffffffffffffff80821115620029ed57600080fd5b818701915087601f83011262002a0257600080fd5b81358181111562002a1257600080fd5b88602082850101111562002a2557600080fd5b95989497505060200194505050565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b6001600160a01b038516815260806020820181905260009062002aa89083018662002777565b828103604084015262002abc818662002777565b91505060ff8316606083015295945050505050565b634e487b7160e01b600052602160045260246000fd5b60006003841062002b0857634e487b7160e01b600052602160045260246000fd5b838252604060208301526200058a604083018462002777565b6020808252602c908201527f45524332304272696467653a207a65726f2064657374696e6174696f6e20627260408201526b69646765206164647265737360a01b606082015260800190565b600062002b7e620026748462002626565b905082815283838301111562002b9357600080fd5b62000a5b83602083018462002751565b600082601f83011262002bb557600080fd5b62000a5b8383516020850162002b6d565b60006020828403121562002bd957600080fd5b815167ffffffffffffffff81111562002bf157600080fd5b6200058a8482850162002ba3565b60006020828403121562002c1257600080fd5b815162000a5b81620026ad565b600081518084526020808501945080840160005b8381101562002c5a5781516001600160a01b03168752958201959082019060010162002c33565b509495945050505050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c084015262002cc861010084018262002c1f565b905060a0840151601f198483030160e08501526200145c828262002777565b60006020828403121562002cfa57600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526028908201527f45524332304272696467653a2063616e6e6f742062726964676520746f20736160408201526736b29031b430b4b760c11b606082015260800190565b60208082526023908201527f45524332304272696467653a207a65726f20726563697069656e74206164647260408201526265737360e81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8082018082111562001461576200146162002db0565b60006020828403121562002def57600080fd5b815162000a5b81620025a6565b8181038181111562001461576200146162002db0565b6020808252602f908201527f45524332304272696467653a20696e76616c69642064657374696e6174696f6e60408201526e20627269646765206164647265737360881b606082015260800190565b6000806040838503121562002e7557600080fd5b82516003811062002e8557600080fd5b602084015190925067ffffffffffffffff81111562002ea357600080fd5b8301601f8101851362002eb557600080fd5b62002ec68582516020840162002b6d565b9150509250929050565b6000806000806080858703121562002ee757600080fd5b845162002ef481620025a6565b602086015190945067ffffffffffffffff8082111562002f1357600080fd5b62002f218883890162002ba3565b9450604087015191508082111562002f3857600080fd5b5062002f478782880162002ba3565b92505060608501516200274681620026ad565b60008060006060848603121562002f7057600080fd5b835162002f7d81620025a6565b602085015190935062002f9081620025a6565b80925050604084015190509250925092565b60008060008060008060c0878903121562002fbc57600080fd5b86519550602087015162002fd081620025a6565b604088015190955062002fe381620025a6565b606088015190945062002ff681620025a6565b809350506080870151915060a087015190509295509295509295565b6000602082840312156200302557600080fd5b8151801515811462000a5b57600080fd5b8681526001600160a01b0386811660208301528516604082015260c0606082018190526000906200306a9083018662002777565b82810360808401526200307e818662002777565b91505060ff831660a0830152979650505050505050565b60008251620030a981846020870162002751565b919091019291505056fe6101206040523480156200001257600080fd5b506040516200116838038062001168833981016040819052620000359162000292565b82826003620000458382620003d5565b506004620000548282620003d5565b50879150620000b690505760405162461bcd60e51b815260206004820152602160248201527f427269646765546f6b656e3a207a65726f20736f7572636520636861696e20696044820152601960fa1b60648201526084015b60405180910390fd5b6001600160a01b0385166200011e5760405162461bcd60e51b815260206004820152602760248201527f427269646765546f6b656e3a207a65726f20736f7572636520627269646765206044820152666164647265737360c81b6064820152608401620000ad565b6001600160a01b038416620001855760405162461bcd60e51b815260206004820152602660248201527f427269646765546f6b656e3a207a65726f20736f75726365206173736574206160448201526564647265737360d01b6064820152608401620000ad565b3360805260a09590955250506001600160a01b0391821660c0521660e05260ff1661010052620004a1565b80516001600160a01b0381168114620001c857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f557600080fd5b81516001600160401b0380821115620002125762000212620001cd565b604051601f8301601f19908116603f011681019082821181831017156200023d576200023d620001cd565b816040528381526020925086838588010111156200025a57600080fd5b600091505b838210156200027e57858201830151818301840152908201906200025f565b600093810190920192909252949350505050565b60008060008060008060c08789031215620002ac57600080fd5b86519550620002be60208801620001b0565b9450620002ce60408801620001b0565b60608801519094506001600160401b0380821115620002ec57600080fd5b620002fa8a838b01620001e3565b945060808901519150808211156200031157600080fd5b506200032089828a01620001e3565b92505060a087015160ff811681146200033857600080fd5b809150509295509295509295565b600181811c908216806200035b57607f821691505b6020821081036200037c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003d057600081815260208120601f850160051c81016020861015620003ab5750805b601f850160051c820191505b81811015620003cc57828155600101620003b7565b5050505b505050565b81516001600160401b03811115620003f157620003f1620001cd565b620004098162000402845462000346565b8462000382565b602080601f831160018114620004415760008415620004285750858301515b600019600386901b1c1916600185901b178555620003cc565b600085815260208120601f198616915b82811015620004725788860151825594840194600190910190840162000451565b5085821015620004915787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e05161010051610c7b620004ed60003960006101c70152600061025a01526000610173015260006102fc0152600081816102c2015261041b0152610c7b6000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a2578063a457c2d711610071578063a457c2d714610297578063a9059cbb146102aa578063cd596583146102bd578063dd62ed3e146102e4578063f7253968146102f757600080fd5b806370a082311461022c57806374d32ad41461025557806379cc67901461027c57806395d89b411461028f57600080fd5b806323b872dd116100e957806323b872dd146101ad578063313ce567146101c057806339509351146101f157806340c10f191461020457806342966c681461021957600080fd5b806306fdde031461011b578063095ea7b31461013957806318160ddd1461015c5780631a0b79bf1461016e575b600080fd5b61012361031e565b6040516101309190610aac565b60405180910390f35b61014c610147366004610b16565b6103b0565b6040519015158152602001610130565b6002545b604051908152602001610130565b6101957f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610130565b61014c6101bb366004610b40565b6103ca565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610130565b61014c6101ff366004610b16565b6103ee565b610217610212366004610b16565b610410565b005b610217610227366004610b7c565b61049b565b61016061023a366004610b95565b6001600160a01b031660009081526020819052604090205490565b6101957f000000000000000000000000000000000000000000000000000000000000000081565b61021761028a366004610b16565b6104a8565b6101236104bd565b61014c6102a5366004610b16565b6104cc565b61014c6102b8366004610b16565b610547565b6101957f000000000000000000000000000000000000000000000000000000000000000081565b6101606102f2366004610bb7565b610555565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60606003805461032d90610bea565b80601f016020809104026020016040519081016040528092919081815260200182805461035990610bea565b80156103a65780601f1061037b576101008083540402835291602001916103a6565b820191906000526020600020905b81548152906001019060200180831161038957829003601f168201915b5050505050905090565b6000336103be818585610580565b60019150505b92915050565b6000336103d88582856106a5565b6103e385858561071f565b506001949350505050565b6000336103be8185856104018383610555565b61040b9190610c24565b610580565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461048d5760405162461bcd60e51b815260206004820152601960248201527f427269646765546f6b656e3a20756e617574686f72697a65640000000000000060448201526064015b60405180910390fd5b61049782826108c3565b5050565b6104a53382610982565b50565b6104b38233836106a5565b6104978282610982565b60606004805461032d90610bea565b600033816104da8286610555565b90508381101561053a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610484565b6103e38286868403610580565b6000336103be81858561071f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166105e25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610484565b6001600160a01b0382166106435760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610484565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006106b18484610555565b90506000198114610719578181101561070c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610484565b6107198484848403610580565b50505050565b6001600160a01b0383166107835760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610484565b6001600160a01b0382166107e55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610484565b6001600160a01b0383166000908152602081905260409020548181101561085d5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610484565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610719565b6001600160a01b0382166109195760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610484565b806002600082825461092b9190610c24565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b0382166109e25760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610484565b6001600160a01b03821660009081526020819052604090205481811015610a565760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610484565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610698565b600060208083528351808285015260005b81811015610ad957858101830151858201604001528201610abd565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610b1157600080fd5b919050565b60008060408385031215610b2957600080fd5b610b3283610afa565b946020939093013593505050565b600080600060608486031215610b5557600080fd5b610b5e84610afa565b9250610b6c60208501610afa565b9150604084013590509250925092565b600060208284031215610b8e57600080fd5b5035919050565b600060208284031215610ba757600080fd5b610bb082610afa565b9392505050565b60008060408385031215610bca57600080fd5b610bd383610afa565b9150610be160208401610afa565b90509250929050565b600181811c90821680610bfe57607f821691505b602082108103610c1e57634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103c457634e487b7160e01b600052601160045260246000fdfea2646970667358221220fbb944f7f95047b4299f75db28938d3bcf2b5c0c912d7ac944940616ebf3988e64736f6c63430008120033a264697066735822122076293effbb562d62d49cc7d98f3143d1bf811405850cf44a11cd2f00999dcb0564736f6c63430008120033", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"teleporterMessageID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"nativeBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nativeBridgeAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"bridgeTokenAddress\",\"type\":\"address\"}],\"name\":\"CreateBridgeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"MintBridgeTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"teleporterMessageID\",\"type\":\"bytes32\"}],\"name\":\"SubmitCreateBridgeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CREATE_BRIDGE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_BRIDGE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TRANSFER_BRIDGE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WARP_PRECOMPILE_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"primaryFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"secondaryFeeAmount\",\"type\":\"uint256\"}],\"name\":\"bridgeTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeTokenContract\",\"type\":\"address\"}],\"name\":\"bridgedBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"nativeName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"nativeSymbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"nativeDecimals\",\"type\":\"uint8\"}],\"name\":\"encodeCreateBridgeTokenData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"bridgeAmount\",\"type\":\"uint256\"}],\"name\":\"encodeMintBridgeTokensData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"encodeTransferBridgeTokensData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinTeleporterVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nativeBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeTokenAddress\",\"type\":\"address\"}],\"name\":\"nativeToWrappedTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"bridgeTokenAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"contractERC20\",\"name\":\"nativeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"messageFeeAsset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"messageFeeAmount\",\"type\":\"uint256\"}],\"name\":\"submitCreateBridgeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeTokenContract\",\"type\":\"address\"}],\"name\":\"submittedBridgeTokenCreations\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"tokenCreationSubmitted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeToken\",\"type\":\"address\"}],\"name\":\"wrappedTokenContracts\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"bridgeTokenExists\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60c06040523480156200001157600080fd5b50604051620044ff380380620044ff833981016040819052620000349162000212565b600160005580806001600160a01b038116620000bc5760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f727465722072656769737472792061646472657373000000000000000000606482015260840160405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa15801562000107573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200012d919062000244565b600255506200013c33620001c0565b507302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000190573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001b6919062000244565b60a052506200025e565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156200022557600080fd5b81516001600160a01b03811681146200023d57600080fd5b9392505050565b6000602082840312156200025757600080fd5b5051919050565b60805160a051614251620002ae6000396000818161021b01528181610b0c01528181611a6b015261233601526000818161018001528181610dcc01528181610ff101526111f401526142516000f3fe60806040523480156200001157600080fd5b5060043610620001755760003560e01c80637a465fd911620000d3578063b9e55da11162000086578063b9e55da1146200039f578063c60da61214620003d3578063c63d220714620003ea578063c868efaa1462000401578063d2cc7a701462000418578063f2fde38b146200042157600080fd5b80637a465fd914620002e65780638343f66114620002f15780638c56fcf014620003395780638da5cb5b14620003505780639731429714620003625780639bd9abc0146200037957600080fd5b80635f217bcc116200012c5780635f217bcc146200026357806365435568146200026e5780636b47cd9a14620002ab5780636c7e40d114620002b6578063715018a614620002cd5780637497185614620002d757600080fd5b80631a7f5bec146200017a5780632b0d8f1814620001bf578063367e958414620001d85780634511243e14620001fe5780634950d2d014620002155780635eb99514146200024c575b600080fd5b620001a27f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b620001d6620001d0366004620025bc565b62000438565b005b620001ef620001e9366004620026bd565b62000533565b604051620001b69190620027a5565b620001d66200020f366004620025bc565b62000592565b6200023d7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001620001b6565b620001d66200025d366004620027ba565b62000685565b6200023d621e848081565b620001a26200027f366004620027d4565b60076020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b6200023d620493e081565b620001d6620002c73660046200281b565b6200069d565b620001d6620009ee565b620001a26005600160991b0181565b6200023d62030d4081565b6200032862000302366004620027d4565b600460209081526000938452604080852082529284528284209052825290205460ff1681565b6040519015158152602001620001b6565b620001ef6200034a3660046200287d565b62000a06565b6003546001600160a01b0316620001a2565b6200032862000373366004620025bc565b62000a62565b620003286200038a366004620025bc565b60066020526000908152604090205460ff1681565b6200023d620003b0366004620027d4565b600560209081526000938452604080852082529284528284209052825290205481565b620001ef620003e4366004620028c3565b62000a80565b620001d6620003fb3660046200292f565b62000b00565b620001d662000412366004620029a4565b62000db4565b6002546200023d565b620001d662000432366004620025bc565b62000f67565b6200044262000fe3565b6001600160a01b038116620004745760405162461bcd60e51b81526004016200046b9062002a34565b60405180910390fd5b6200047f8162000a62565b15620004e45760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b60648201526084016200046b565b6001600160a01b0381166000818152600160208190526040808320805460ff1916909217909155517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b606060008585858560405160200162000550949392919062002a82565b60405160208183030381529060405290506000816040516020016200057792919062002ae7565b6040516020818303038152906040529150505b949350505050565b6200059c62000fe3565b6001600160a01b038116620005c55760405162461bcd60e51b81526004016200046b9062002a34565b620005d08162000a62565b620006305760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b60648201526084016200046b565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152600160205260409020805460ff19169055565b6200068f62000fe3565b6200069a8162000fed565b50565b620006a762001194565b6001600160a01b038416620006d05760405162461bcd60e51b81526004016200046b9062002b21565b6000620006dc620011ef565b9050600082156200070b57620006f38484620012f1565b90506200070b6001600160a01b038516838362001467565b60006200084986876001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000751573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200077b919081019062002bc6565b886001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620007ba573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620007e4919081019062002bc6565b896001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000823573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e9919062002bff565b90506000836001600160a01b031663624488506040518060c001604052808c81526020018b6001600160a01b0316815260200160405180604001604052808b6001600160a01b03168152602001888152508152602001621e84808152602001600067ffffffffffffffff811115620008c557620008c5620025dc565b604051908082528060200260200182016040528015620008ef578160200160208202803683370190505b508152602001858152506040518263ffffffff1660e01b815260040162000917919062002c65565b6020604051808303816000875af115801562000937573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200095d919062002ce7565b60008a81526004602090815260408083206001600160a01b03808e16808652918452828520908d16808652935292819020805460ff1916600117905551929350918b907f3800d3f6af9e0e73fee531cb134766d3dae314dd340599073c396d9e5e8736bd90620009d09086815260200190565b60405180910390a450505050620009e76001600055565b5050505050565b620009f862001553565b62000a046000620015af565b565b6060600084848460405160200162000a219392919062002d01565b604051602081830303815290604052905060018160405160200162000a4892919062002ae7565b6040516020818303038152906040529150505b9392505050565b6001600160a01b031660009081526001602052604090205460ff1690565b60408051602081018890526001600160a01b0387811682840152868116606080840191909152908616608083015260a0820185905260c08083018590528351808403909101815260e08301909352919062000ae49060029083906101000162002ae7565b6040516020818303038152906040529150509695505050505050565b62000b0a62001194565b7f0000000000000000000000000000000000000000000000000000000000000000870362000b4c5760405162461bcd60e51b81526004016200046b9062002d25565b6001600160a01b03841662000b755760405162461bcd60e51b81526004016200046b9062002d6d565b6001600160a01b03861662000b9e5760405162461bcd60e51b81526004016200046b9062002b21565b6001600160a01b03851660009081526006602052604090205460ff161562000c895762000bcc818362002dc6565b831162000c2b5760405162461bcd60e51b815260206004820152602660248201527f45524332304272696467653a20696e73756666696369656e7420746f74616c20604482015265185b5bdd5b9d60d21b60648201526084016200046b565b62000c836040518060e00160405280898152602001886001600160a01b03168152602001876001600160a01b03168152602001866001600160a01b031681526020018581526020018481526020018381525062001601565b62000da0565b60008781526004602090815260408083206001600160a01b03808b168552908352818420908916845290915290205460ff1662000d1b5760405162461bcd60e51b815260206004820152602960248201527f45524332304272696467653a20696e76616c69642062726964676520746f6b656044820152686e206164647265737360b81b60648201526084016200046b565b600062000d298685620012f1565b905082811162000d8e5760405162461bcd60e51b815260206004820152602960248201527f45524332304272696467653a20696e73756666696369656e742061646a757374604482015268195908185b5bdd5b9d60ba1b60648201526084016200046b565b62000d9e888888888588620019ed565b505b62000dab6001600055565b50505050505050565b60025460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa15801562000e1c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e42919062002ce7565b101562000eab5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b60648201526084016200046b565b62000eb63362000a62565b1562000f1e5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b60648201526084016200046b565b62000f61848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525062001ca992505050565b50505050565b62000f7162001553565b6001600160a01b03811662000fd85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200046b565b6200069a81620015af565b62000a0462001553565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200104e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001074919062002ce7565b60025490915081831115620010e65760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b60648201526084016200046b565b8083116200115d5760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e0060648201526084016200046b565b6002839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b600260005403620011e85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016200046b565b6002600055565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001251573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001277919062002ddc565b9050620012848162000a62565b15620012ec5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b60648201526084016200046b565b919050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156200133b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001361919062002ce7565b90506200137a6001600160a01b03851633308662001e27565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015620013c2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013e8919062002ce7565b9050818111620014505760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016200046b565b6200145c828262002dfc565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015620014b9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014df919062002ce7565b620014eb919062002dc6565b6040516001600160a01b03851660248201526044810182905290915062000f6190859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262001e4b565b6003546001600160a01b0316331462000a045760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200046b565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006200160d620011ef565b90506000808360a00151111562001650576200163283604001518460a00151620012f1565b604084015190915062001650906001600160a01b0316838362001467565b60008360a00151846080015162001668919062002dfc565b604085810151905163079cc67960e41b815233600482015260248101839052919250906001600160a01b038216906379cc679090604401600060405180830381600087803b158015620016ba57600080fd5b505af1158015620016cf573d6000803e3d6000fd5b505050506000816001600160a01b031663f72539686040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001714573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200173a919062002ce7565b90506000826001600160a01b0316631a0b79bf6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200177d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620017a3919062002ddc565b905081876000015103620017e957806001600160a01b031687602001516001600160a01b031614620017e95760405162461bcd60e51b81526004016200046b9062002e12565b60006200186f88600001518960200151866001600160a01b03166374d32ad46040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001838573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200185e919062002ddc565b8b60600151898d60c0015162000a80565b90506000876001600160a01b031663624488506040518060c00160405280878152602001866001600160a01b0316815260200160405180604001604052808e604001516001600160a01b031681526020018c8152508152602001620493e08152602001600067ffffffffffffffff811115620018ef57620018ef620025dc565b60405190808252806020026020018201604052801562001919578160200160208202803683370190505b508152602001858152506040518263ffffffff1660e01b815260040162001941919062002c65565b6020604051808303816000875af115801562001961573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001987919062002ce7565b90508089600001518a604001516001600160a01b03167f217c87a6d6d3d58781939a048638f7802a91151cc9eb573762b268bf8ec9c2578c602001518d606001518b604051620019da9392919062002d01565b60405180910390a4505050505050505050565b6001600160a01b03841660009081526006602052604090205460ff161562001a695760405162461bcd60e51b815260206004820152602860248201527f45524332304272696467653a2063616e6e6f742062726964676520777261707060448201526732b2103a37b5b2b760c11b60648201526084016200046b565b7f0000000000000000000000000000000000000000000000000000000000000000860362001aab5760405162461bcd60e51b81526004016200046b9062002d25565b600062001ab7620011ef565b9050811562001ad65762001ad66001600160a01b038616828462001467565b600062001ae4838562002dfc565b60008981526005602090815260408083206001600160a01b03808d168552908352818420908b16845290915281208054929350839290919062001b2990849062002dc6565b909155506000905062001b3e87878462000a06565b90506000836001600160a01b031663624488506040518060c001604052808d81526020018c6001600160a01b0316815260200160405180604001604052808d6001600160a01b031681526020018a815250815260200162030d408152602001600067ffffffffffffffff81111562001bba5762001bba620025dc565b60405190808252806020026020018201604052801562001be4578160200160208202803683370190505b508152602001858152506040518263ffffffff1660e01b815260040162001c0c919062002c65565b6020604051808303816000875af115801562001c2c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001c52919062002ce7565b9050808a896001600160a01b03167f217c87a6d6d3d58781939a048638f7802a91151cc9eb573762b268bf8ec9c2578c8b8860405162001c959392919062002d01565b60405180910390a450505050505050505050565b6000808280602001905181019062001cc2919062002e61565b9092509050600082600281111562001cde5762001cde62002ad1565b0362001d22576000806000808480602001905181019062001d00919062002ed0565b935093509350935062001d1889898686868662001f29565b50505050620009e7565b600182600281111562001d395762001d3962002ad1565b0362001d785760008060008380602001905181019062001d5a919062002f5a565b92509250925062001d6f888885858562002098565b505050620009e7565b600282600281111562001d8f5762001d8f62002ad1565b0362001dde576000806000806000808680602001905181019062001db4919062002fa2565b95509550955095509550955062001dd28b8b88888888888862002212565b505050505050620009e7565b60405162461bcd60e51b815260206004820152601b60248201527f45524332304272696467653a20696e76616c696420616374696f6e000000000060448201526064016200046b565b62000f61846323b872dd60e01b8585856040516024016200151b9392919062002d01565b600062001ea2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620023cb9092919063ffffffff16565b80519091501562001f24578080602001905181019062001ec3919062003012565b62001f245760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016200046b565b505050565b60008681526007602090815260408083206001600160a01b038981168552908352818420888216855290925290912054161562001fba5760405162461bcd60e51b815260206004820152602860248201527f45524332304272696467653a2062726964676520746f6b656e20616c72656164604482015267792065786973747360c01b60648201526084016200046b565b600086868686868660405162001fd09062002598565b62001fe19695949392919062003036565b604051809103906000f08015801562001ffe573d6000803e3d6000fd5b506001600160a01b038181166000818152600660209081526040808320805460ff191660011790558c8352600782528083208c8616808552908352818420958c168085529583529281902080546001600160a01b031916851790555192835293945091928a917fe1c61a845f79534e11924517ddbedc668d0c20e467eafb4d3bd2858e2815f3b5910160405180910390a450505050505050565b620020a262001194565b6001600160a01b038216620020cb5760405162461bcd60e51b81526004016200046b9062002d6d565b60008581526007602090815260408083206001600160a01b03808916855290835281842087821685529092529091205416806200215c5760405162461bcd60e51b815260206004820152602860248201527f45524332304272696467653a2062726964676520746f6b656e20646f6573206e6044820152671bdd08195e1a5cdd60c21b60648201526084016200046b565b6040516340c10f1960e01b81526001600160a01b038481166004830152602482018490528216906340c10f1990604401600060405180830381600087803b158015620021a757600080fd5b505af1158015620021bc573d6000803e3d6000fd5b5050604080516001600160a01b03878116825260208201879052851693507fc0767f158f0d5394b598489a51ed607cd55a8be2dcef113ba1626efcf4c6395492500160405180910390a250620009e76001600055565b6200221c62001194565b6001600160a01b038316620022455760405162461bcd60e51b81526004016200046b9062002d6d565b6001600160a01b0385166200226e5760405162461bcd60e51b81526004016200046b9062002b21565b60008881526005602090815260408083206001600160a01b03808c168552908352818420908816845290915290205482811015620022f95760405162461bcd60e51b815260206004820152602160248201527f45524332304272696467653a20696e73756666696369656e742062616c616e636044820152606560f81b60648201526084016200046b565b62002305838262002dfc565b60008a81526005602090815260408083206001600160a01b03808e168552908352818420908a1684529091529020557f00000000000000000000000000000000000000000000000000000000000000008703620023a4576001600160a01b0386163014620023875760405162461bcd60e51b81526004016200046b9062002e12565b6200239d6001600160a01b0386168585620023dc565b50620023b6565b620023b4878787878787620019ed565b505b620023c16001600055565b5050505050505050565b60606200058a84846000856200240e565b6040516001600160a01b03831660248201526044810182905262001f2490849063a9059cbb60e01b906064016200151b565b606082471015620024715760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016200046b565b600080866001600160a01b031685876040516200248f919062003095565b60006040518083038185875af1925050503d8060008114620024ce576040519150601f19603f3d011682016040523d82523d6000602084013e620024d3565b606091505b5091509150620024e687838387620024f1565b979650505050505050565b60608315620025655782516000036200255d576001600160a01b0385163b6200255d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200046b565b50816200058a565b6200058a83838151156200257c5781518083602001fd5b8060405162461bcd60e51b81526004016200046b9190620027a5565b61116880620030b483390190565b6001600160a01b03811681146200069a57600080fd5b600060208284031215620025cf57600080fd5b813562000a5b81620025a6565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156200261e576200261e620025dc565b604052919050565b600067ffffffffffffffff821115620026435762002643620025dc565b50601f01601f191660200190565b600082601f8301126200266357600080fd5b81356200267a620026748262002626565b620025f2565b8181528460208386010111156200269057600080fd5b816020850160208301376000918101602001919091529392505050565b60ff811681146200069a57600080fd5b60008060008060808587031215620026d457600080fd5b8435620026e181620025a6565b9350602085013567ffffffffffffffff80821115620026ff57600080fd5b6200270d8883890162002651565b945060408701359150808211156200272457600080fd5b50620027338782880162002651565b92505060608501356200274681620026ad565b939692955090935050565b60005b838110156200276e57818101518382015260200162002754565b50506000910152565b600081518084526200279181602086016020860162002751565b601f01601f19169290920160200192915050565b60208152600062000a5b602083018462002777565b600060208284031215620027cd57600080fd5b5035919050565b600080600060608486031215620027ea57600080fd5b833592506020840135620027fe81620025a6565b915060408401356200281081620025a6565b809150509250925092565b600080600080600060a086880312156200283457600080fd5b8535945060208601356200284881620025a6565b935060408601356200285a81620025a6565b925060608601356200286c81620025a6565b949793965091946080013592915050565b6000806000606084860312156200289357600080fd5b8335620028a081620025a6565b92506020840135620028b281620025a6565b929592945050506040919091013590565b60008060008060008060c08789031215620028dd57600080fd5b863595506020870135620028f181620025a6565b945060408701356200290381620025a6565b935060608701356200291581620025a6565b9598949750929560808101359460a0909101359350915050565b600080600080600080600060e0888a0312156200294b57600080fd5b8735965060208801356200295f81620025a6565b955060408801356200297181620025a6565b945060608801356200298381620025a6565b9699959850939660808101359560a0820135955060c0909101359350915050565b60008060008060608587031215620029bb57600080fd5b843593506020850135620029cf81620025a6565b9250604085013567ffffffffffffffff80821115620029ed57600080fd5b818701915087601f83011262002a0257600080fd5b81358181111562002a1257600080fd5b88602082850101111562002a2557600080fd5b95989497505060200194505050565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b6001600160a01b038516815260806020820181905260009062002aa89083018662002777565b828103604084015262002abc818662002777565b91505060ff8316606083015295945050505050565b634e487b7160e01b600052602160045260246000fd5b60006003841062002b0857634e487b7160e01b600052602160045260246000fd5b838252604060208301526200058a604083018462002777565b6020808252602c908201527f45524332304272696467653a207a65726f2064657374696e6174696f6e20627260408201526b69646765206164647265737360a01b606082015260800190565b600062002b7e620026748462002626565b905082815283838301111562002b9357600080fd5b62000a5b83602083018462002751565b600082601f83011262002bb557600080fd5b62000a5b8383516020850162002b6d565b60006020828403121562002bd957600080fd5b815167ffffffffffffffff81111562002bf157600080fd5b6200058a8482850162002ba3565b60006020828403121562002c1257600080fd5b815162000a5b81620026ad565b600081518084526020808501945080840160005b8381101562002c5a5781516001600160a01b03168752958201959082019060010162002c33565b509495945050505050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c084015262002cc861010084018262002c1f565b905060a0840151601f198483030160e08501526200145c828262002777565b60006020828403121562002cfa57600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526028908201527f45524332304272696467653a2063616e6e6f742062726964676520746f20736160408201526736b29031b430b4b760c11b606082015260800190565b60208082526023908201527f45524332304272696467653a207a65726f20726563697069656e74206164647260408201526265737360e81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8082018082111562001461576200146162002db0565b60006020828403121562002def57600080fd5b815162000a5b81620025a6565b8181038181111562001461576200146162002db0565b6020808252602f908201527f45524332304272696467653a20696e76616c69642064657374696e6174696f6e60408201526e20627269646765206164647265737360881b606082015260800190565b6000806040838503121562002e7557600080fd5b82516003811062002e8557600080fd5b602084015190925067ffffffffffffffff81111562002ea357600080fd5b8301601f8101851362002eb557600080fd5b62002ec68582516020840162002b6d565b9150509250929050565b6000806000806080858703121562002ee757600080fd5b845162002ef481620025a6565b602086015190945067ffffffffffffffff8082111562002f1357600080fd5b62002f218883890162002ba3565b9450604087015191508082111562002f3857600080fd5b5062002f478782880162002ba3565b92505060608501516200274681620026ad565b60008060006060848603121562002f7057600080fd5b835162002f7d81620025a6565b602085015190935062002f9081620025a6565b80925050604084015190509250925092565b60008060008060008060c0878903121562002fbc57600080fd5b86519550602087015162002fd081620025a6565b604088015190955062002fe381620025a6565b606088015190945062002ff681620025a6565b809350506080870151915060a087015190509295509295509295565b6000602082840312156200302557600080fd5b8151801515811462000a5b57600080fd5b8681526001600160a01b0386811660208301528516604082015260c0606082018190526000906200306a9083018662002777565b82810360808401526200307e818662002777565b91505060ff831660a0830152979650505050505050565b60008251620030a981846020870162002751565b919091019291505056fe6101206040523480156200001257600080fd5b506040516200116838038062001168833981016040819052620000359162000292565b82826003620000458382620003d5565b506004620000548282620003d5565b50879150620000b690505760405162461bcd60e51b815260206004820152602160248201527f427269646765546f6b656e3a207a65726f20736f7572636520636861696e20696044820152601960fa1b60648201526084015b60405180910390fd5b6001600160a01b0385166200011e5760405162461bcd60e51b815260206004820152602760248201527f427269646765546f6b656e3a207a65726f20736f7572636520627269646765206044820152666164647265737360c81b6064820152608401620000ad565b6001600160a01b038416620001855760405162461bcd60e51b815260206004820152602660248201527f427269646765546f6b656e3a207a65726f20736f75726365206173736574206160448201526564647265737360d01b6064820152608401620000ad565b3360805260a09590955250506001600160a01b0391821660c0521660e05260ff1661010052620004a1565b80516001600160a01b0381168114620001c857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f557600080fd5b81516001600160401b0380821115620002125762000212620001cd565b604051601f8301601f19908116603f011681019082821181831017156200023d576200023d620001cd565b816040528381526020925086838588010111156200025a57600080fd5b600091505b838210156200027e57858201830151818301840152908201906200025f565b600093810190920192909252949350505050565b60008060008060008060c08789031215620002ac57600080fd5b86519550620002be60208801620001b0565b9450620002ce60408801620001b0565b60608801519094506001600160401b0380821115620002ec57600080fd5b620002fa8a838b01620001e3565b945060808901519150808211156200031157600080fd5b506200032089828a01620001e3565b92505060a087015160ff811681146200033857600080fd5b809150509295509295509295565b600181811c908216806200035b57607f821691505b6020821081036200037c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003d057600081815260208120601f850160051c81016020861015620003ab5750805b601f850160051c820191505b81811015620003cc57828155600101620003b7565b5050505b505050565b81516001600160401b03811115620003f157620003f1620001cd565b620004098162000402845462000346565b8462000382565b602080601f831160018114620004415760008415620004285750858301515b600019600386901b1c1916600185901b178555620003cc565b600085815260208120601f198616915b82811015620004725788860151825594840194600190910190840162000451565b5085821015620004915787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e05161010051610c7b620004ed60003960006101c70152600061025a01526000610173015260006102fc0152600081816102c2015261041b0152610c7b6000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a2578063a457c2d711610071578063a457c2d714610297578063a9059cbb146102aa578063cd596583146102bd578063dd62ed3e146102e4578063f7253968146102f757600080fd5b806370a082311461022c57806374d32ad41461025557806379cc67901461027c57806395d89b411461028f57600080fd5b806323b872dd116100e957806323b872dd146101ad578063313ce567146101c057806339509351146101f157806340c10f191461020457806342966c681461021957600080fd5b806306fdde031461011b578063095ea7b31461013957806318160ddd1461015c5780631a0b79bf1461016e575b600080fd5b61012361031e565b6040516101309190610aac565b60405180910390f35b61014c610147366004610b16565b6103b0565b6040519015158152602001610130565b6002545b604051908152602001610130565b6101957f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610130565b61014c6101bb366004610b40565b6103ca565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610130565b61014c6101ff366004610b16565b6103ee565b610217610212366004610b16565b610410565b005b610217610227366004610b7c565b61049b565b61016061023a366004610b95565b6001600160a01b031660009081526020819052604090205490565b6101957f000000000000000000000000000000000000000000000000000000000000000081565b61021761028a366004610b16565b6104a8565b6101236104bd565b61014c6102a5366004610b16565b6104cc565b61014c6102b8366004610b16565b610547565b6101957f000000000000000000000000000000000000000000000000000000000000000081565b6101606102f2366004610bb7565b610555565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60606003805461032d90610bea565b80601f016020809104026020016040519081016040528092919081815260200182805461035990610bea565b80156103a65780601f1061037b576101008083540402835291602001916103a6565b820191906000526020600020905b81548152906001019060200180831161038957829003601f168201915b5050505050905090565b6000336103be818585610580565b60019150505b92915050565b6000336103d88582856106a5565b6103e385858561071f565b506001949350505050565b6000336103be8185856104018383610555565b61040b9190610c24565b610580565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461048d5760405162461bcd60e51b815260206004820152601960248201527f427269646765546f6b656e3a20756e617574686f72697a65640000000000000060448201526064015b60405180910390fd5b61049782826108c3565b5050565b6104a53382610982565b50565b6104b38233836106a5565b6104978282610982565b60606004805461032d90610bea565b600033816104da8286610555565b90508381101561053a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610484565b6103e38286868403610580565b6000336103be81858561071f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166105e25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610484565b6001600160a01b0382166106435760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610484565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006106b18484610555565b90506000198114610719578181101561070c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610484565b6107198484848403610580565b50505050565b6001600160a01b0383166107835760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610484565b6001600160a01b0382166107e55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610484565b6001600160a01b0383166000908152602081905260409020548181101561085d5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610484565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610719565b6001600160a01b0382166109195760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610484565b806002600082825461092b9190610c24565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b0382166109e25760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610484565b6001600160a01b03821660009081526020819052604090205481811015610a565760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610484565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610698565b600060208083528351808285015260005b81811015610ad957858101830151858201604001528201610abd565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610b1157600080fd5b919050565b60008060408385031215610b2957600080fd5b610b3283610afa565b946020939093013593505050565b600080600060608486031215610b5557600080fd5b610b5e84610afa565b9250610b6c60208501610afa565b9150604084013590509250925092565b600060208284031215610b8e57600080fd5b5035919050565b600060208284031215610ba757600080fd5b610bb082610afa565b9392505050565b60008060408385031215610bca57600080fd5b610bd383610afa565b9150610be160208401610afa565b90509250929050565b600181811c90821680610bfe57607f821691505b602082108103610c1e57634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103c457634e487b7160e01b600052601160045260246000fdfea2646970667358221220fbb944f7f95047b4299f75db28938d3bcf2b5c0c912d7ac944940616ebf3988e64736f6c63430008120033a26469706673582212209f2ef11cac684550a31ec69515b06062438ebd9ac6ca4af92ba3fa3d9c7f955064736f6c63430008120033", } // ERC20BridgeABI is the input ABI used to generate the binding from. @@ -937,17 +937,17 @@ func (it *ERC20BridgeBridgeTokensIterator) Close() error { type ERC20BridgeBridgeTokens struct { TokenContractAddress common.Address DestinationBlockchainID [32]byte - TeleporterMessageID *big.Int + TeleporterMessageID [32]byte DestinationBridgeAddress common.Address Recipient common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterBridgeTokens is a free log retrieval operation binding the contract event 0x97935c4470efae40c8440c3abfe968a5512232dd375cc974e712f487c2b99c31. +// FilterBridgeTokens is a free log retrieval operation binding the contract event 0x217c87a6d6d3d58781939a048638f7802a91151cc9eb573762b268bf8ec9c257. // -// Solidity: event BridgeTokens(address indexed tokenContractAddress, bytes32 indexed destinationBlockchainID, uint256 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount) -func (_ERC20Bridge *ERC20BridgeFilterer) FilterBridgeTokens(opts *bind.FilterOpts, tokenContractAddress []common.Address, destinationBlockchainID [][32]byte, teleporterMessageID []*big.Int) (*ERC20BridgeBridgeTokensIterator, error) { +// Solidity: event BridgeTokens(address indexed tokenContractAddress, bytes32 indexed destinationBlockchainID, bytes32 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount) +func (_ERC20Bridge *ERC20BridgeFilterer) FilterBridgeTokens(opts *bind.FilterOpts, tokenContractAddress []common.Address, destinationBlockchainID [][32]byte, teleporterMessageID [][32]byte) (*ERC20BridgeBridgeTokensIterator, error) { var tokenContractAddressRule []interface{} for _, tokenContractAddressItem := range tokenContractAddress { @@ -969,10 +969,10 @@ func (_ERC20Bridge *ERC20BridgeFilterer) FilterBridgeTokens(opts *bind.FilterOpt return &ERC20BridgeBridgeTokensIterator{contract: _ERC20Bridge.contract, event: "BridgeTokens", logs: logs, sub: sub}, nil } -// WatchBridgeTokens is a free log subscription operation binding the contract event 0x97935c4470efae40c8440c3abfe968a5512232dd375cc974e712f487c2b99c31. +// WatchBridgeTokens is a free log subscription operation binding the contract event 0x217c87a6d6d3d58781939a048638f7802a91151cc9eb573762b268bf8ec9c257. // -// Solidity: event BridgeTokens(address indexed tokenContractAddress, bytes32 indexed destinationBlockchainID, uint256 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount) -func (_ERC20Bridge *ERC20BridgeFilterer) WatchBridgeTokens(opts *bind.WatchOpts, sink chan<- *ERC20BridgeBridgeTokens, tokenContractAddress []common.Address, destinationBlockchainID [][32]byte, teleporterMessageID []*big.Int) (event.Subscription, error) { +// Solidity: event BridgeTokens(address indexed tokenContractAddress, bytes32 indexed destinationBlockchainID, bytes32 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount) +func (_ERC20Bridge *ERC20BridgeFilterer) WatchBridgeTokens(opts *bind.WatchOpts, sink chan<- *ERC20BridgeBridgeTokens, tokenContractAddress []common.Address, destinationBlockchainID [][32]byte, teleporterMessageID [][32]byte) (event.Subscription, error) { var tokenContractAddressRule []interface{} for _, tokenContractAddressItem := range tokenContractAddress { @@ -1019,9 +1019,9 @@ func (_ERC20Bridge *ERC20BridgeFilterer) WatchBridgeTokens(opts *bind.WatchOpts, }), nil } -// ParseBridgeTokens is a log parse operation binding the contract event 0x97935c4470efae40c8440c3abfe968a5512232dd375cc974e712f487c2b99c31. +// ParseBridgeTokens is a log parse operation binding the contract event 0x217c87a6d6d3d58781939a048638f7802a91151cc9eb573762b268bf8ec9c257. // -// Solidity: event BridgeTokens(address indexed tokenContractAddress, bytes32 indexed destinationBlockchainID, uint256 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount) +// Solidity: event BridgeTokens(address indexed tokenContractAddress, bytes32 indexed destinationBlockchainID, bytes32 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount) func (_ERC20Bridge *ERC20BridgeFilterer) ParseBridgeTokens(log types.Log) (*ERC20BridgeBridgeTokens, error) { event := new(ERC20BridgeBridgeTokens) if err := _ERC20Bridge.contract.UnpackLog(event, "BridgeTokens", log); err != nil { @@ -1718,13 +1718,13 @@ type ERC20BridgeSubmitCreateBridgeToken struct { DestinationBlockchainID [32]byte DestinationBridgeAddress common.Address NativeContractAddress common.Address - TeleporterMessageID *big.Int + TeleporterMessageID [32]byte Raw types.Log // Blockchain specific contextual infos } -// FilterSubmitCreateBridgeToken is a free log retrieval operation binding the contract event 0x110b902745a3d7d6b66732479f01de654a3bc6e501be7c8ba2c3a6f9868cb539. +// FilterSubmitCreateBridgeToken is a free log retrieval operation binding the contract event 0x3800d3f6af9e0e73fee531cb134766d3dae314dd340599073c396d9e5e8736bd. // -// Solidity: event SubmitCreateBridgeToken(bytes32 indexed destinationBlockchainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, uint256 teleporterMessageID) +// Solidity: event SubmitCreateBridgeToken(bytes32 indexed destinationBlockchainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, bytes32 teleporterMessageID) func (_ERC20Bridge *ERC20BridgeFilterer) FilterSubmitCreateBridgeToken(opts *bind.FilterOpts, destinationBlockchainID [][32]byte, destinationBridgeAddress []common.Address, nativeContractAddress []common.Address) (*ERC20BridgeSubmitCreateBridgeTokenIterator, error) { var destinationBlockchainIDRule []interface{} @@ -1747,9 +1747,9 @@ func (_ERC20Bridge *ERC20BridgeFilterer) FilterSubmitCreateBridgeToken(opts *bin return &ERC20BridgeSubmitCreateBridgeTokenIterator{contract: _ERC20Bridge.contract, event: "SubmitCreateBridgeToken", logs: logs, sub: sub}, nil } -// WatchSubmitCreateBridgeToken is a free log subscription operation binding the contract event 0x110b902745a3d7d6b66732479f01de654a3bc6e501be7c8ba2c3a6f9868cb539. +// WatchSubmitCreateBridgeToken is a free log subscription operation binding the contract event 0x3800d3f6af9e0e73fee531cb134766d3dae314dd340599073c396d9e5e8736bd. // -// Solidity: event SubmitCreateBridgeToken(bytes32 indexed destinationBlockchainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, uint256 teleporterMessageID) +// Solidity: event SubmitCreateBridgeToken(bytes32 indexed destinationBlockchainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, bytes32 teleporterMessageID) func (_ERC20Bridge *ERC20BridgeFilterer) WatchSubmitCreateBridgeToken(opts *bind.WatchOpts, sink chan<- *ERC20BridgeSubmitCreateBridgeToken, destinationBlockchainID [][32]byte, destinationBridgeAddress []common.Address, nativeContractAddress []common.Address) (event.Subscription, error) { var destinationBlockchainIDRule []interface{} @@ -1797,9 +1797,9 @@ func (_ERC20Bridge *ERC20BridgeFilterer) WatchSubmitCreateBridgeToken(opts *bind }), nil } -// ParseSubmitCreateBridgeToken is a log parse operation binding the contract event 0x110b902745a3d7d6b66732479f01de654a3bc6e501be7c8ba2c3a6f9868cb539. +// ParseSubmitCreateBridgeToken is a log parse operation binding the contract event 0x3800d3f6af9e0e73fee531cb134766d3dae314dd340599073c396d9e5e8736bd. // -// Solidity: event SubmitCreateBridgeToken(bytes32 indexed destinationBlockchainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, uint256 teleporterMessageID) +// Solidity: event SubmitCreateBridgeToken(bytes32 indexed destinationBlockchainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, bytes32 teleporterMessageID) func (_ERC20Bridge *ERC20BridgeFilterer) ParseSubmitCreateBridgeToken(log types.Log) (*ERC20BridgeSubmitCreateBridgeToken, error) { event := new(ERC20BridgeSubmitCreateBridgeToken) if err := _ERC20Bridge.contract.UnpackLog(event, "SubmitCreateBridgeToken", log); err != nil { diff --git a/abi-bindings/go/CrossChainApplications/examples/ExampleMessenger/ExampleCrossChainMessenger/ExampleCrossChainMessenger.go b/abi-bindings/go/CrossChainApplications/examples/ExampleMessenger/ExampleCrossChainMessenger/ExampleCrossChainMessenger.go index ce97d7a9e..06c0f2e4c 100644 --- a/abi-bindings/go/CrossChainApplications/examples/ExampleMessenger/ExampleCrossChainMessenger/ExampleCrossChainMessenger.go +++ b/abi-bindings/go/CrossChainApplications/examples/ExampleMessenger/ExampleCrossChainMessenger/ExampleCrossChainMessenger.go @@ -31,8 +31,8 @@ var ( // ExampleCrossChainMessengerMetaData contains all meta data concerning the ExampleCrossChainMessenger contract. var ExampleCrossChainMessengerMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"ReceiveMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"SendMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"getCurrentMessage\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinTeleporterVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"sendMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b5060405162001a7338038062001a73833981016040819052620000349162000196565b600160005580806001600160a01b038116620000bc5760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f727465722072656769737472792061646472657373000000000000000000606482015260840160405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa15801562000107573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200012d9190620001c8565b600255506200013c3362000144565b5050620001e2565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208284031215620001a957600080fd5b81516001600160a01b0381168114620001c157600080fd5b9392505050565b600060208284031215620001db57600080fd5b5051919050565b608051611861620002126000396000818160be015281816104f2015281816108ca0152610c2801526118616000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c806397314297116100715780639731429714610151578063b33fead414610174578063c868efaa14610195578063d2cc7a70146101a8578063f2fde38b146101ba578063f63d09d7146101cd57600080fd5b80631a7f5bec146100b95780632b0d8f18146100fd5780634511243e146101125780635eb9951414610125578063715018a6146101385780638da5cb5b14610140575b600080fd5b6100e07f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61011061010b366004611211565b6101e0565b005b610110610120366004611211565b6102d2565b610110610133366004611235565b6103bc565b6101106103d0565b6003546001600160a01b03166100e0565b61016461015f366004611211565b6103e4565b60405190151581526020016100f4565b610187610182366004611235565b610402565b6040516100f492919061129e565b6101106101a336600461130b565b6104da565b6002545b6040519081526020016100f4565b6101106101c8366004611211565b610682565b6101ac6101db366004611367565b6106f8565b6101e86108be565b6001600160a01b0381166102175760405162461bcd60e51b815260040161020e906113ed565b60405180910390fd5b610220816103e4565b156102835760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b606482015260840161020e565b6001600160a01b0381166000818152600160208190526040808320805460ff1916909217909155517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b6102da6108be565b6001600160a01b0381166103005760405162461bcd60e51b815260040161020e906113ed565b610309816103e4565b6103675760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b606482015260840161020e565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152600160205260409020805460ff19169055565b6103c46108be565b6103cd816108c6565b50565b6103d8610a66565b6103e26000610ac0565b565b6001600160a01b031660009081526001602052604090205460ff1690565b6000818152600460209081526040808320815180830190925280546001600160a01b0316825260018101805460609486949392908401916104429061143b565b80601f016020809104026020016040519081016040528092919081815260200182805461046e9061143b565b80156104bb5780601f10610490576101008083540402835291602001916104bb565b820191906000526020600020905b81548152906001019060200180831161049e57829003601f168201915b5050505050815250509050806000015181602001519250925050915091565b60025460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa158015610541573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105659190611475565b10156105cc5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b606482015260840161020e565b6105d5336103e4565b1561063b5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b606482015260840161020e565b61067c848484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b1292505050565b50505050565b61068a610a66565b6001600160a01b0381166106ef5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161020e565b6103cd81610ac0565b6000610702610bca565b600061070c610c23565b905060008615610736576107208888610d1e565b90506107366001600160a01b0389168383610e88565b886001600160a01b03168a7fa06eff1edd0c66b8dc96d086dda7ba263edf88d7417e6cb15073b5e7bff8a8ca8a848a8a8a6040516107789594939291906114b7565b60405180910390a3816001600160a01b031663624488506040518060c001604052808d81526020018c6001600160a01b0316815260200160405180604001604052808d6001600160a01b03168152602001868152508152602001898152602001600067ffffffffffffffff8111156107f2576107f26114e5565b60405190808252806020026020018201604052801561081b578160200160208202803683370190505b50815260200188886040516020016108349291906114fb565b6040516020818303038152906040528152506040518263ffffffff1660e01b81526004016108629190611553565b6020604051808303816000875af1158015610881573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a59190611475565b925050506108b36001600055565b979650505050505050565b6103e2610a66565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610926573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094a9190611475565b600254909150818311156109ba5760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b606482015260840161020e565b808311610a2f5760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e00606482015260840161020e565b6002839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6003546001600160a01b031633146103e25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161020e565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081806020019051810190610b2891906115d1565b6040805180820182526001600160a01b038681168252602080830185815260008a81526004909252939020825181546001600160a01b03191692169190911781559151929350916001820190610b7e90826116c1565b50905050826001600160a01b0316847f1f5c800b5f2b573929a7948f82a199c2a212851b53a6c5bd703ece23999d24aa83604051610bbc9190611781565b60405180910390a350505050565b600260005403610c1c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161020e565b6002600055565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca89190611794565b9050610cb3816103e4565b15610d195760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b606482015260840161020e565b919050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610d67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8b9190611475565b9050610da26001600160a01b038516333086610f6d565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610de9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0d9190611475565b9050818111610e735760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b606482015260840161020e565b610e7d82826117c7565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610ed9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efd9190611475565b610f0791906117da565b6040516001600160a01b03851660248201526044810182905290915061067c90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610fa5565b6040516001600160a01b038085166024830152831660448201526064810182905261067c9085906323b872dd60e01b90608401610f36565b6000610ffa826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661107c9092919063ffffffff16565b805190915015611077578080602001905181019061101891906117ed565b6110775760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161020e565b505050565b606061108b8484600085611093565b949350505050565b6060824710156110f45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161020e565b600080866001600160a01b03168587604051611110919061180f565b60006040518083038185875af1925050503d806000811461114d576040519150601f19603f3d011682016040523d82523d6000602084013e611152565b606091505b50915091506108b387838387606083156111cd5782516000036111c6576001600160a01b0385163b6111c65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161020e565b508161108b565b61108b83838151156111e25781518083602001fd5b8060405162461bcd60e51b815260040161020e9190611781565b6001600160a01b03811681146103cd57600080fd5b60006020828403121561122357600080fd5b813561122e816111fc565b9392505050565b60006020828403121561124757600080fd5b5035919050565b60005b83811015611269578181015183820152602001611251565b50506000910152565b6000815180845261128a81602086016020860161124e565b601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820181905260009061108b90830184611272565b60008083601f8401126112d457600080fd5b50813567ffffffffffffffff8111156112ec57600080fd5b60208301915083602082850101111561130457600080fd5b9250929050565b6000806000806060858703121561132157600080fd5b843593506020850135611333816111fc565b9250604085013567ffffffffffffffff81111561134f57600080fd5b61135b878288016112c2565b95989497509550505050565b600080600080600080600060c0888a03121561138257600080fd5b873596506020880135611394816111fc565b955060408801356113a4816111fc565b9450606088013593506080880135925060a088013567ffffffffffffffff8111156113ce57600080fd5b6113da8a828b016112c2565b989b979a50959850939692959293505050565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b600181811c9082168061144f57607f821691505b60208210810361146f57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561148757600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b03861681528460208201528360408201526080606082015260006108b360808301848661148e565b634e487b7160e01b600052604160045260246000fd5b60208152600061108b60208301848661148e565b600081518084526020808501945080840160005b838110156115485781516001600160a01b031687529582019590820190600101611523565b509495945050505050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526115b461010084018261150f565b905060a0840151601f198483030160e0850152610e7d8282611272565b6000602082840312156115e357600080fd5b815167ffffffffffffffff808211156115fb57600080fd5b818401915084601f83011261160f57600080fd5b815181811115611621576116216114e5565b604051601f8201601f19908116603f01168101908382118183101715611649576116496114e5565b8160405282815287602084870101111561166257600080fd5b6108b383602083016020880161124e565b601f82111561107757600081815260208120601f850160051c8101602086101561169a5750805b601f850160051c820191505b818110156116b9578281556001016116a6565b505050505050565b815167ffffffffffffffff8111156116db576116db6114e5565b6116ef816116e9845461143b565b84611673565b602080601f831160018114611724576000841561170c5750858301515b600019600386901b1c1916600185901b1785556116b9565b600085815260208120601f198616915b8281101561175357888601518255948401946001909101908401611734565b50858210156117715787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061122e6020830184611272565b6000602082840312156117a657600080fd5b815161122e816111fc565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e8257610e826117b1565b80820180821115610e8257610e826117b1565b6000602082840312156117ff57600080fd5b8151801515811461122e57600080fd5b6000825161182181846020870161124e565b919091019291505056fea2646970667358221220664b88eda3868eb9b50c4e7f7706de693f2da7ea89cf9fe2c7a84105f59d239564736f6c63430008120033", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"ReceiveMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"SendMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"getCurrentMessage\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinTeleporterVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"sendMessage\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60a06040523480156200001157600080fd5b5060405162001a7338038062001a73833981016040819052620000349162000196565b600160005580806001600160a01b038116620000bc5760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f727465722072656769737472792061646472657373000000000000000000606482015260840160405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa15801562000107573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200012d9190620001c8565b600255506200013c3362000144565b5050620001e2565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208284031215620001a957600080fd5b81516001600160a01b0381168114620001c157600080fd5b9392505050565b600060208284031215620001db57600080fd5b5051919050565b608051611861620002126000396000818160be015281816104f2015281816108ca0152610c2801526118616000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c806397314297116100715780639731429714610151578063b33fead414610174578063c868efaa14610195578063d2cc7a70146101a8578063f2fde38b146101ba578063f63d09d7146101cd57600080fd5b80631a7f5bec146100b95780632b0d8f18146100fd5780634511243e146101125780635eb9951414610125578063715018a6146101385780638da5cb5b14610140575b600080fd5b6100e07f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61011061010b366004611211565b6101e0565b005b610110610120366004611211565b6102d2565b610110610133366004611235565b6103bc565b6101106103d0565b6003546001600160a01b03166100e0565b61016461015f366004611211565b6103e4565b60405190151581526020016100f4565b610187610182366004611235565b610402565b6040516100f492919061129e565b6101106101a336600461130b565b6104da565b6002545b6040519081526020016100f4565b6101106101c8366004611211565b610682565b6101ac6101db366004611367565b6106f8565b6101e86108be565b6001600160a01b0381166102175760405162461bcd60e51b815260040161020e906113ed565b60405180910390fd5b610220816103e4565b156102835760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b606482015260840161020e565b6001600160a01b0381166000818152600160208190526040808320805460ff1916909217909155517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b6102da6108be565b6001600160a01b0381166103005760405162461bcd60e51b815260040161020e906113ed565b610309816103e4565b6103675760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b606482015260840161020e565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152600160205260409020805460ff19169055565b6103c46108be565b6103cd816108c6565b50565b6103d8610a66565b6103e26000610ac0565b565b6001600160a01b031660009081526001602052604090205460ff1690565b6000818152600460209081526040808320815180830190925280546001600160a01b0316825260018101805460609486949392908401916104429061143b565b80601f016020809104026020016040519081016040528092919081815260200182805461046e9061143b565b80156104bb5780601f10610490576101008083540402835291602001916104bb565b820191906000526020600020905b81548152906001019060200180831161049e57829003601f168201915b5050505050815250509050806000015181602001519250925050915091565b60025460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa158015610541573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105659190611475565b10156105cc5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b606482015260840161020e565b6105d5336103e4565b1561063b5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b606482015260840161020e565b61067c848484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b1292505050565b50505050565b61068a610a66565b6001600160a01b0381166106ef5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161020e565b6103cd81610ac0565b6000610702610bca565b600061070c610c23565b905060008615610736576107208888610d1e565b90506107366001600160a01b0389168383610e88565b886001600160a01b03168a7fa06eff1edd0c66b8dc96d086dda7ba263edf88d7417e6cb15073b5e7bff8a8ca8a848a8a8a6040516107789594939291906114b7565b60405180910390a3816001600160a01b031663624488506040518060c001604052808d81526020018c6001600160a01b0316815260200160405180604001604052808d6001600160a01b03168152602001868152508152602001898152602001600067ffffffffffffffff8111156107f2576107f26114e5565b60405190808252806020026020018201604052801561081b578160200160208202803683370190505b50815260200188886040516020016108349291906114fb565b6040516020818303038152906040528152506040518263ffffffff1660e01b81526004016108629190611553565b6020604051808303816000875af1158015610881573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a59190611475565b925050506108b36001600055565b979650505050505050565b6103e2610a66565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610926573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094a9190611475565b600254909150818311156109ba5760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b606482015260840161020e565b808311610a2f5760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e00606482015260840161020e565b6002839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6003546001600160a01b031633146103e25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161020e565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081806020019051810190610b2891906115d1565b6040805180820182526001600160a01b038681168252602080830185815260008a81526004909252939020825181546001600160a01b03191692169190911781559151929350916001820190610b7e90826116c1565b50905050826001600160a01b0316847f1f5c800b5f2b573929a7948f82a199c2a212851b53a6c5bd703ece23999d24aa83604051610bbc9190611781565b60405180910390a350505050565b600260005403610c1c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161020e565b6002600055565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca89190611794565b9050610cb3816103e4565b15610d195760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b606482015260840161020e565b919050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610d67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8b9190611475565b9050610da26001600160a01b038516333086610f6d565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610de9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0d9190611475565b9050818111610e735760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b606482015260840161020e565b610e7d82826117c7565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610ed9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efd9190611475565b610f0791906117da565b6040516001600160a01b03851660248201526044810182905290915061067c90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610fa5565b6040516001600160a01b038085166024830152831660448201526064810182905261067c9085906323b872dd60e01b90608401610f36565b6000610ffa826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661107c9092919063ffffffff16565b805190915015611077578080602001905181019061101891906117ed565b6110775760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161020e565b505050565b606061108b8484600085611093565b949350505050565b6060824710156110f45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161020e565b600080866001600160a01b03168587604051611110919061180f565b60006040518083038185875af1925050503d806000811461114d576040519150601f19603f3d011682016040523d82523d6000602084013e611152565b606091505b50915091506108b387838387606083156111cd5782516000036111c6576001600160a01b0385163b6111c65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161020e565b508161108b565b61108b83838151156111e25781518083602001fd5b8060405162461bcd60e51b815260040161020e9190611781565b6001600160a01b03811681146103cd57600080fd5b60006020828403121561122357600080fd5b813561122e816111fc565b9392505050565b60006020828403121561124757600080fd5b5035919050565b60005b83811015611269578181015183820152602001611251565b50506000910152565b6000815180845261128a81602086016020860161124e565b601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820181905260009061108b90830184611272565b60008083601f8401126112d457600080fd5b50813567ffffffffffffffff8111156112ec57600080fd5b60208301915083602082850101111561130457600080fd5b9250929050565b6000806000806060858703121561132157600080fd5b843593506020850135611333816111fc565b9250604085013567ffffffffffffffff81111561134f57600080fd5b61135b878288016112c2565b95989497509550505050565b600080600080600080600060c0888a03121561138257600080fd5b873596506020880135611394816111fc565b955060408801356113a4816111fc565b9450606088013593506080880135925060a088013567ffffffffffffffff8111156113ce57600080fd5b6113da8a828b016112c2565b989b979a50959850939692959293505050565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b600181811c9082168061144f57607f821691505b60208210810361146f57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561148757600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b03861681528460208201528360408201526080606082015260006108b360808301848661148e565b634e487b7160e01b600052604160045260246000fd5b60208152600061108b60208301848661148e565b600081518084526020808501945080840160005b838110156115485781516001600160a01b031687529582019590820190600101611523565b509495945050505050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526115b461010084018261150f565b905060a0840151601f198483030160e0850152610e7d8282611272565b6000602082840312156115e357600080fd5b815167ffffffffffffffff808211156115fb57600080fd5b818401915084601f83011261160f57600080fd5b815181811115611621576116216114e5565b604051601f8201601f19908116603f01168101908382118183101715611649576116496114e5565b8160405282815287602084870101111561166257600080fd5b6108b383602083016020880161124e565b601f82111561107757600081815260208120601f850160051c8101602086101561169a5750805b601f850160051c820191505b818110156116b9578281556001016116a6565b505050505050565b815167ffffffffffffffff8111156116db576116db6114e5565b6116ef816116e9845461143b565b84611673565b602080601f831160018114611724576000841561170c5750858301515b600019600386901b1c1916600185901b1785556116b9565b600085815260208120601f198616915b8281101561175357888601518255948401946001909101908401611734565b50858210156117715787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152600061122e6020830184611272565b6000602082840312156117a657600080fd5b815161122e816111fc565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e8257610e826117b1565b80820180821115610e8257610e826117b1565b6000602082840312156117ff57600080fd5b8151801515811461122e57600080fd5b6000825161182181846020870161124e565b919091019291505056fea26469706673582212202d063c76fbea1ddada67a7bdd99d18c5f2dde185dc26f3006dbe23896dedfb9864736f6c63430008120033", } // ExampleCrossChainMessengerABI is the input ABI used to generate the binding from. @@ -423,21 +423,21 @@ func (_ExampleCrossChainMessenger *ExampleCrossChainMessengerTransactorSession) // SendMessage is a paid mutator transaction binding the contract method 0xf63d09d7. // -// Solidity: function sendMessage(bytes32 destinationBlockchainID, address destinationAddress, address feeTokenAddress, uint256 feeAmount, uint256 requiredGasLimit, string message) returns(uint256) +// Solidity: function sendMessage(bytes32 destinationBlockchainID, address destinationAddress, address feeTokenAddress, uint256 feeAmount, uint256 requiredGasLimit, string message) returns(bytes32) func (_ExampleCrossChainMessenger *ExampleCrossChainMessengerTransactor) SendMessage(opts *bind.TransactOpts, destinationBlockchainID [32]byte, destinationAddress common.Address, feeTokenAddress common.Address, feeAmount *big.Int, requiredGasLimit *big.Int, message string) (*types.Transaction, error) { return _ExampleCrossChainMessenger.contract.Transact(opts, "sendMessage", destinationBlockchainID, destinationAddress, feeTokenAddress, feeAmount, requiredGasLimit, message) } // SendMessage is a paid mutator transaction binding the contract method 0xf63d09d7. // -// Solidity: function sendMessage(bytes32 destinationBlockchainID, address destinationAddress, address feeTokenAddress, uint256 feeAmount, uint256 requiredGasLimit, string message) returns(uint256) +// Solidity: function sendMessage(bytes32 destinationBlockchainID, address destinationAddress, address feeTokenAddress, uint256 feeAmount, uint256 requiredGasLimit, string message) returns(bytes32) func (_ExampleCrossChainMessenger *ExampleCrossChainMessengerSession) SendMessage(destinationBlockchainID [32]byte, destinationAddress common.Address, feeTokenAddress common.Address, feeAmount *big.Int, requiredGasLimit *big.Int, message string) (*types.Transaction, error) { return _ExampleCrossChainMessenger.Contract.SendMessage(&_ExampleCrossChainMessenger.TransactOpts, destinationBlockchainID, destinationAddress, feeTokenAddress, feeAmount, requiredGasLimit, message) } // SendMessage is a paid mutator transaction binding the contract method 0xf63d09d7. // -// Solidity: function sendMessage(bytes32 destinationBlockchainID, address destinationAddress, address feeTokenAddress, uint256 feeAmount, uint256 requiredGasLimit, string message) returns(uint256) +// Solidity: function sendMessage(bytes32 destinationBlockchainID, address destinationAddress, address feeTokenAddress, uint256 feeAmount, uint256 requiredGasLimit, string message) returns(bytes32) func (_ExampleCrossChainMessenger *ExampleCrossChainMessengerTransactorSession) SendMessage(destinationBlockchainID [32]byte, destinationAddress common.Address, feeTokenAddress common.Address, feeAmount *big.Int, requiredGasLimit *big.Int, message string) (*types.Transaction, error) { return _ExampleCrossChainMessenger.Contract.SendMessage(&_ExampleCrossChainMessenger.TransactOpts, destinationBlockchainID, destinationAddress, feeTokenAddress, feeAmount, requiredGasLimit, message) } diff --git a/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go b/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go index 2f95fc020..bdc640c13 100644 --- a/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/ERC20TokenSource/ERC20TokenSource.go +++ b/abi-bindings/go/CrossChainApplications/examples/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\":\"teleporterRegistryAddress\",\"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\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"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\":\"getMinTeleporterVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6101006040523480156200001257600080fd5b506040516200200a3803806200200a8339810160408190526200003591620003f0565b83806001600160a01b038116620000b95760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f72746572207265676973747279206164647265737300000000000000000060648201526084015b60405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa15801562000104573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200012a919062000444565b60015550620001393362000381565b50600160035582620001965760405162461bcd60e51b8152602060048201526030602482015260008051602062001fea83398151915260448201526f1bdb88189b1bd8dad8da185a5b88125160821b6064820152608401620000b0565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020f919062000444565b8303620002855760405162461bcd60e51b815260206004820152603460248201527f4552433230546f6b656e536f757263653a2063616e6e6f74206272696467652060448201527f776974682073616d6520626c6f636b636861696e0000000000000000000000006064820152608401620000b0565b60a08390526001600160a01b038216620002f75760405162461bcd60e51b8152602060048201526033602482015260008051602062001fea83398151915260448201527f6f6e20636f6e74726163742061646472657373000000000000000000000000006064820152608401620000b0565b6001600160a01b0380831660c05281166200036b5760405162461bcd60e51b815260206004820152602d60248201527f4552433230546f6b656e536f757263653a207a65726f20455243323020636f6e60448201526c7472616374206164647265737360981b6064820152608401620000b0565b6001600160a01b031660e052506200045e915050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b0381168114620003eb57600080fd5b919050565b600080600080608085870312156200040757600080fd5b6200041285620003d3565b9350602085015192506200042960408601620003d3565b91506200043960608601620003d3565b905092959194509250565b6000602082840312156200045757600080fd5b5051919050565b60805160a05160c05160e051611afe620004ec60003960008181610278015281816104ef015281816105870152818161063901528181611351015261142501526000818161022b015281816105ff015261105f01526000818161016e015281816105d90152610fdc015260008181610115015281816107dd015281816109ef0152610c950152611afe6000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80638da5cb5b116100a2578063c452165e11610071578063c452165e1461024d578063c868efaa14610258578063d2cc7a701461026b578063e486df1514610273578063f2fde38b1461029a57600080fd5b80638da5cb5b146101e857806397314297146101f9578063b6171f731461021c578063b8c9091a1461022657600080fd5b806355db3e9e116100de57806355db3e9e146101b15780635eb99514146101ba578063715018a6146101cd57806387a2edba146101d557600080fd5b80631a7f5bec146101105780632b0d8f181461015457806341d3014d146101695780634511243e1461019e575b600080fd5b6101377f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101676101623660046115dd565b6102ad565b005b6101907f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161014b565b6101676101ac3660046115dd565b61039c565b61019060045481565b6101676101c8366004611601565b610486565b61016761049a565b6101676101e336600461161a565b6104ae565b6002546001600160a01b0316610137565b61020c6102073660046115dd565b6107a7565b604051901515815260200161014b565b610190620186a081565b6101377f000000000000000000000000000000000000000000000000000000000000000081565b610137600160981b81565b6101676102663660046116b3565b6107c5565b600154610190565b6101377f000000000000000000000000000000000000000000000000000000000000000081565b6101676102a83660046115dd565b61096d565b6102b56109e3565b6001600160a01b0381166102e45760405162461bcd60e51b81526004016102db9061173c565b60405180910390fd5b6102ed816107a7565b156103505760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b60648201526084016102db565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b6103a46109e3565b6001600160a01b0381166103ca5760405162461bcd60e51b81526004016102db9061173c565b6103d3816107a7565b6104315760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b60648201526084016102db565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152602081905260409020805460ff19169055565b61048e6109e3565b610497816109eb565b50565b6104a2610b8b565b6104ac6000610be5565b565b6104b6610c37565b60006104c0610c90565b90506001600160a01b0386166104e85760405162461bcd60e51b81526004016102db9061178a565b60006105147f000000000000000000000000000000000000000000000000000000000000000087610d8b565b905084811161057c5760405162461bcd60e51b815260206004820152602e60248201527f4552433230546f6b656e536f757263653a20696e73756666696369656e74206160448201526d191a9d5cdd195908185b5bdd5b9d60921b60648201526084016102db565b84156105ad576105ad7f00000000000000000000000000000000000000000000000000000000000000008387610ef5565b60006105b986836117e8565b90506000836001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200160405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018c8152508152602001620186a08152602001898980806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516001600160a01b038f166020808301919091529181018890529101906060016040516020818303038152906040528152506040518263ffffffff1660e01b81526004016106ff919061188f565b6020604051808303816000875af115801561071e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610742919061190d565b905080896001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a8560405161078a91815260200190565b60405180910390a4505050506107a06001600355565b5050505050565b6001600160a01b031660009081526020819052604090205460ff1690565b60015460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610850919061190d565b10156108b75760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b60648201526084016102db565b6108c0336107a7565b156109265760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b60648201526084016102db565b610967848484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610fda92505050565b50505050565b610975610b8b565b6001600160a01b0381166109da5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102db565b61049781610be5565b6104ac610b8b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f919061190d565b60015490915081831115610adf5760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b60648201526084016102db565b808311610b545760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e0060648201526084016102db565b6001839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6002546001600160a01b031633146104ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102db565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260035403610c895760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102db565b6002600355565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d159190611926565b9050610d20816107a7565b15610d865760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b60648201526084016102db565b919050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610dd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df8919061190d565b9050610e0f6001600160a01b0385163330866111d5565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a919061190d565b9050818111610ee05760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016102db565b610eea82826117e8565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610f46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6a919061190d565b610f749190611943565b6040516001600160a01b03851660248201526044810182905290915061096790859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261120d565b7f0000000000000000000000000000000000000000000000000000000000000000831461105d5760405162461bcd60e51b815260206004820152602b60248201527f4552433230546f6b656e536f757263653a20696e76616c69642064657374696e60448201526a30ba34b7b71031b430b4b760a91b60648201526084016102db565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146110ec5760405162461bcd60e51b815260206004820152602560248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564207360448201526432b73232b960d91b60648201526084016102db565b60008082806020019051810190611103919061196c565b9092509050600082600181111561111c5761111c611a33565b0361114d57600080828060200190518101906111389190611a49565b9150915061114682826112e4565b50506107a0565b600182600181111561116157611161611a33565b0361118d5760008180602001905181019061117c919061190d565b90506111878161137b565b506107a0565b60405162461bcd60e51b815260206004820181905260248201527f4552433230546f6b656e536f757263653a20696e76616c696420616374696f6e60448201526064016102db565b6040516001600160a01b03808516602483015283166044820152606481018290526109679085906323b872dd60e01b90608401610fa3565b6000611262826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113a69092919063ffffffff16565b8051909150156112df57808060200190518101906112809190611a77565b6112df5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102db565b505050565b6001600160a01b03821661130a5760405162461bcd60e51b81526004016102db9061178a565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a16113777f000000000000000000000000000000000000000000000000000000000000000083836113bd565b5050565b6004548111156104975760006004548261139591906117e8565b90506113a0816113ed565b50600455565b60606113b5848460008561144f565b949350505050565b6040516001600160a01b0383166024820152604481018290526112df90849063a9059cbb60e01b90606401610fa3565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a16104977f0000000000000000000000000000000000000000000000000000000000000000600160981b836113bd565b6060824710156114b05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102db565b600080866001600160a01b031685876040516114cc9190611a99565b60006040518083038185875af1925050503d8060008114611509576040519150601f19603f3d011682016040523d82523d6000602084013e61150e565b606091505b509150915061151f8783838761152a565b979650505050505050565b60608315611599578251600003611592576001600160a01b0385163b6115925760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102db565b50816113b5565b6113b583838151156115ae5781518083602001fd5b8060405162461bcd60e51b81526004016102db9190611ab5565b6001600160a01b038116811461049757600080fd5b6000602082840312156115ef57600080fd5b81356115fa816115c8565b9392505050565b60006020828403121561161357600080fd5b5035919050565b60008060008060006080868803121561163257600080fd5b853561163d816115c8565b94506020860135935060408601359250606086013567ffffffffffffffff8082111561166857600080fd5b818801915088601f83011261167c57600080fd5b81358181111561168b57600080fd5b8960208260051b85010111156116a057600080fd5b9699959850939650602001949392505050565b600080600080606085870312156116c957600080fd5b8435935060208501356116db816115c8565b9250604085013567ffffffffffffffff808211156116f857600080fd5b818701915087601f83011261170c57600080fd5b81358181111561171b57600080fd5b88602082850101111561172d57600080fd5b95989497505060200194505050565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b60208082526028908201527f4552433230546f6b656e536f757263653a207a65726f20726563697069656e74604082015267206164647265737360c01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b81810381811115610eef57610eef6117d2565b600081518084526020808501945080840160005b838110156118345781516001600160a01b03168752958201959082019060010161180f565b509495945050505050565b60005b8381101561185a578181015183820152602001611842565b50506000910152565b6000815180845261187b81602086016020860161183f565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526118f06101008401826117fb565b905060a0840151601f198483030160e0850152610eea8282611863565b60006020828403121561191f57600080fd5b5051919050565b60006020828403121561193857600080fd5b81516115fa816115c8565b80820180821115610eef57610eef6117d2565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561197f57600080fd5b82516002811061198e57600080fd5b602084015190925067ffffffffffffffff808211156119ac57600080fd5b818501915085601f8301126119c057600080fd5b8151818111156119d2576119d2611956565b604051601f8201601f19908116603f011681019083821181831017156119fa576119fa611956565b81604052828152886020848701011115611a1357600080fd5b611a2483602083016020880161183f565b80955050505050509250929050565b634e487b7160e01b600052602160045260246000fd5b60008060408385031215611a5c57600080fd5b8251611a67816115c8565b6020939093015192949293505050565b600060208284031215611a8957600080fd5b815180151581146115fa57600080fd5b60008251611aab81846020870161183f565b9190910192915050565b6020815260006115fa602083018461186356fea26469706673582212207fc3364d4a9108648b9dfd06debbe901ebb1f102c23efd5cb4a38c3655da858264736f6c634300081200334552433230546f6b656e536f757263653a207a65726f2064657374696e617469", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"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\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"teleporterMessageID\",\"type\":\"bytes32\"},{\"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\":\"getMinTeleporterVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6101006040523480156200001257600080fd5b506040516200200a3803806200200a8339810160408190526200003591620003f0565b83806001600160a01b038116620000b95760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f72746572207265676973747279206164647265737300000000000000000060648201526084015b60405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa15801562000104573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200012a919062000444565b60015550620001393362000381565b50600160035582620001965760405162461bcd60e51b8152602060048201526030602482015260008051602062001fea83398151915260448201526f1bdb88189b1bd8dad8da185a5b88125160821b6064820152608401620000b0565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020f919062000444565b8303620002855760405162461bcd60e51b815260206004820152603460248201527f4552433230546f6b656e536f757263653a2063616e6e6f74206272696467652060448201527f776974682073616d6520626c6f636b636861696e0000000000000000000000006064820152608401620000b0565b60a08390526001600160a01b038216620002f75760405162461bcd60e51b8152602060048201526033602482015260008051602062001fea83398151915260448201527f6f6e20636f6e74726163742061646472657373000000000000000000000000006064820152608401620000b0565b6001600160a01b0380831660c05281166200036b5760405162461bcd60e51b815260206004820152602d60248201527f4552433230546f6b656e536f757263653a207a65726f20455243323020636f6e60448201526c7472616374206164647265737360981b6064820152608401620000b0565b6001600160a01b031660e052506200045e915050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b0381168114620003eb57600080fd5b919050565b600080600080608085870312156200040757600080fd5b6200041285620003d3565b9350602085015192506200042960408601620003d3565b91506200043960608601620003d3565b905092959194509250565b6000602082840312156200045757600080fd5b5051919050565b60805160a05160c05160e051611afe620004ec60003960008181610278015281816104ef015281816105870152818161063901528181611351015261142501526000818161022b015281816105ff015261105f01526000818161016e015281816105d90152610fdc015260008181610115015281816107dd015281816109ef0152610c950152611afe6000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80638da5cb5b116100a2578063c452165e11610071578063c452165e1461024d578063c868efaa14610258578063d2cc7a701461026b578063e486df1514610273578063f2fde38b1461029a57600080fd5b80638da5cb5b146101e857806397314297146101f9578063b6171f731461021c578063b8c9091a1461022657600080fd5b806355db3e9e116100de57806355db3e9e146101b15780635eb99514146101ba578063715018a6146101cd57806387a2edba146101d557600080fd5b80631a7f5bec146101105780632b0d8f181461015457806341d3014d146101695780634511243e1461019e575b600080fd5b6101377f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101676101623660046115dd565b6102ad565b005b6101907f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161014b565b6101676101ac3660046115dd565b61039c565b61019060045481565b6101676101c8366004611601565b610486565b61016761049a565b6101676101e336600461161a565b6104ae565b6002546001600160a01b0316610137565b61020c6102073660046115dd565b6107a7565b604051901515815260200161014b565b610190620186a081565b6101377f000000000000000000000000000000000000000000000000000000000000000081565b610137600160981b81565b6101676102663660046116b3565b6107c5565b600154610190565b6101377f000000000000000000000000000000000000000000000000000000000000000081565b6101676102a83660046115dd565b61096d565b6102b56109e3565b6001600160a01b0381166102e45760405162461bcd60e51b81526004016102db9061173c565b60405180910390fd5b6102ed816107a7565b156103505760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b60648201526084016102db565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b6103a46109e3565b6001600160a01b0381166103ca5760405162461bcd60e51b81526004016102db9061173c565b6103d3816107a7565b6104315760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b60648201526084016102db565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152602081905260409020805460ff19169055565b61048e6109e3565b610497816109eb565b50565b6104a2610b8b565b6104ac6000610be5565b565b6104b6610c37565b60006104c0610c90565b90506001600160a01b0386166104e85760405162461bcd60e51b81526004016102db9061178a565b60006105147f000000000000000000000000000000000000000000000000000000000000000087610d8b565b905084811161057c5760405162461bcd60e51b815260206004820152602e60248201527f4552433230546f6b656e536f757263653a20696e73756666696369656e74206160448201526d191a9d5cdd195908185b5bdd5b9d60921b60648201526084016102db565b84156105ad576105ad7f00000000000000000000000000000000000000000000000000000000000000008387610ef5565b60006105b986836117e8565b90506000836001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200160405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018c8152508152602001620186a08152602001898980806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516001600160a01b038f166020808301919091529181018890529101906060016040516020818303038152906040528152506040518263ffffffff1660e01b81526004016106ff919061188f565b6020604051808303816000875af115801561071e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610742919061190d565b905080896001600160a01b0316336001600160a01b03167f6cf14fdf618c440df3de7de7dcacf59541a464e55f360cbe73724c12e0c4cf998560405161078a91815260200190565b60405180910390a4505050506107a06001600355565b5050505050565b6001600160a01b031660009081526020819052604090205460ff1690565b60015460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610850919061190d565b10156108b75760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b60648201526084016102db565b6108c0336107a7565b156109265760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b60648201526084016102db565b610967848484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610fda92505050565b50505050565b610975610b8b565b6001600160a01b0381166109da5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102db565b61049781610be5565b6104ac610b8b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f919061190d565b60015490915081831115610adf5760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b60648201526084016102db565b808311610b545760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e0060648201526084016102db565b6001839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6002546001600160a01b031633146104ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102db565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260035403610c895760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102db565b6002600355565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d159190611926565b9050610d20816107a7565b15610d865760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b60648201526084016102db565b919050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610dd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df8919061190d565b9050610e0f6001600160a01b0385163330866111d5565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a919061190d565b9050818111610ee05760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016102db565b610eea82826117e8565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610f46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6a919061190d565b610f749190611943565b6040516001600160a01b03851660248201526044810182905290915061096790859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261120d565b7f0000000000000000000000000000000000000000000000000000000000000000831461105d5760405162461bcd60e51b815260206004820152602b60248201527f4552433230546f6b656e536f757263653a20696e76616c69642064657374696e60448201526a30ba34b7b71031b430b4b760a91b60648201526084016102db565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146110ec5760405162461bcd60e51b815260206004820152602560248201527f4552433230546f6b656e536f757263653a20756e617574686f72697a6564207360448201526432b73232b960d91b60648201526084016102db565b60008082806020019051810190611103919061196c565b9092509050600082600181111561111c5761111c611a33565b0361114d57600080828060200190518101906111389190611a49565b9150915061114682826112e4565b50506107a0565b600182600181111561116157611161611a33565b0361118d5760008180602001905181019061117c919061190d565b90506111878161137b565b506107a0565b60405162461bcd60e51b815260206004820181905260248201527f4552433230546f6b656e536f757263653a20696e76616c696420616374696f6e60448201526064016102db565b6040516001600160a01b03808516602483015283166044820152606481018290526109679085906323b872dd60e01b90608401610fa3565b6000611262826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113a69092919063ffffffff16565b8051909150156112df57808060200190518101906112809190611a77565b6112df5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102db565b505050565b6001600160a01b03821661130a5760405162461bcd60e51b81526004016102db9061178a565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a16113777f000000000000000000000000000000000000000000000000000000000000000083836113bd565b5050565b6004548111156104975760006004548261139591906117e8565b90506113a0816113ed565b50600455565b60606113b5848460008561144f565b949350505050565b6040516001600160a01b0383166024820152604481018290526112df90849063a9059cbb60e01b90606401610fa3565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a16104977f0000000000000000000000000000000000000000000000000000000000000000600160981b836113bd565b6060824710156114b05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102db565b600080866001600160a01b031685876040516114cc9190611a99565b60006040518083038185875af1925050503d8060008114611509576040519150601f19603f3d011682016040523d82523d6000602084013e61150e565b606091505b509150915061151f8783838761152a565b979650505050505050565b60608315611599578251600003611592576001600160a01b0385163b6115925760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102db565b50816113b5565b6113b583838151156115ae5781518083602001fd5b8060405162461bcd60e51b81526004016102db9190611ab5565b6001600160a01b038116811461049757600080fd5b6000602082840312156115ef57600080fd5b81356115fa816115c8565b9392505050565b60006020828403121561161357600080fd5b5035919050565b60008060008060006080868803121561163257600080fd5b853561163d816115c8565b94506020860135935060408601359250606086013567ffffffffffffffff8082111561166857600080fd5b818801915088601f83011261167c57600080fd5b81358181111561168b57600080fd5b8960208260051b85010111156116a057600080fd5b9699959850939650602001949392505050565b600080600080606085870312156116c957600080fd5b8435935060208501356116db816115c8565b9250604085013567ffffffffffffffff808211156116f857600080fd5b818701915087601f83011261170c57600080fd5b81358181111561171b57600080fd5b88602082850101111561172d57600080fd5b95989497505060200194505050565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b60208082526028908201527f4552433230546f6b656e536f757263653a207a65726f20726563697069656e74604082015267206164647265737360c01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b81810381811115610eef57610eef6117d2565b600081518084526020808501945080840160005b838110156118345781516001600160a01b03168752958201959082019060010161180f565b509495945050505050565b60005b8381101561185a578181015183820152602001611842565b50506000910152565b6000815180845261187b81602086016020860161183f565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c08401526118f06101008401826117fb565b905060a0840151601f198483030160e0850152610eea8282611863565b60006020828403121561191f57600080fd5b5051919050565b60006020828403121561193857600080fd5b81516115fa816115c8565b80820180821115610eef57610eef6117d2565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561197f57600080fd5b82516002811061198e57600080fd5b602084015190925067ffffffffffffffff808211156119ac57600080fd5b818501915085601f8301126119c057600080fd5b8151818111156119d2576119d2611956565b604051601f8201601f19908116603f011681019083821181831017156119fa576119fa611956565b81604052828152886020848701011115611a1357600080fd5b611a2483602083016020880161183f565b80955050505050509250929050565b634e487b7160e01b600052602160045260246000fd5b60008060408385031215611a5c57600080fd5b8251611a67816115c8565b6020939093015192949293505050565b600060208284031215611a8957600080fd5b815180151581146115fa57600080fd5b60008251611aab81846020870161183f565b9190910192915050565b6020815260006115fa602083018461186356fea26469706673582212201465b3777042e15ce095cf96f1e5c217100b76afef97025cb95a8538d5cac17864736f6c634300081200334552433230546f6b656e536f757263653a207a65726f2064657374696e617469", } // ERC20TokenSourceABI is the input ABI used to generate the binding from. @@ -1458,15 +1458,15 @@ func (it *ERC20TokenSourceTransferToDestinationIterator) Close() error { type ERC20TokenSourceTransferToDestination struct { Sender common.Address Recipient common.Address - TeleporterMessageID *big.Int + TeleporterMessageID [32]byte Amount *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterTransferToDestination is a free log retrieval operation binding the contract event 0x2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a. +// FilterTransferToDestination is a free log retrieval operation binding the contract event 0x6cf14fdf618c440df3de7de7dcacf59541a464e55f360cbe73724c12e0c4cf99. // -// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, uint256 indexed teleporterMessageID, uint256 amount) -func (_ERC20TokenSource *ERC20TokenSourceFilterer) FilterTransferToDestination(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address, teleporterMessageID []*big.Int) (*ERC20TokenSourceTransferToDestinationIterator, error) { +// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, bytes32 indexed teleporterMessageID, uint256 amount) +func (_ERC20TokenSource *ERC20TokenSourceFilterer) FilterTransferToDestination(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address, teleporterMessageID [][32]byte) (*ERC20TokenSourceTransferToDestinationIterator, error) { var senderRule []interface{} for _, senderItem := range sender { @@ -1488,10 +1488,10 @@ func (_ERC20TokenSource *ERC20TokenSourceFilterer) FilterTransferToDestination(o return &ERC20TokenSourceTransferToDestinationIterator{contract: _ERC20TokenSource.contract, event: "TransferToDestination", logs: logs, sub: sub}, nil } -// WatchTransferToDestination is a free log subscription operation binding the contract event 0x2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a. +// WatchTransferToDestination is a free log subscription operation binding the contract event 0x6cf14fdf618c440df3de7de7dcacf59541a464e55f360cbe73724c12e0c4cf99. // -// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, uint256 indexed teleporterMessageID, uint256 amount) -func (_ERC20TokenSource *ERC20TokenSourceFilterer) WatchTransferToDestination(opts *bind.WatchOpts, sink chan<- *ERC20TokenSourceTransferToDestination, sender []common.Address, recipient []common.Address, teleporterMessageID []*big.Int) (event.Subscription, error) { +// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, bytes32 indexed teleporterMessageID, uint256 amount) +func (_ERC20TokenSource *ERC20TokenSourceFilterer) WatchTransferToDestination(opts *bind.WatchOpts, sink chan<- *ERC20TokenSourceTransferToDestination, sender []common.Address, recipient []common.Address, teleporterMessageID [][32]byte) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { @@ -1538,9 +1538,9 @@ func (_ERC20TokenSource *ERC20TokenSourceFilterer) WatchTransferToDestination(op }), nil } -// ParseTransferToDestination is a log parse operation binding the contract event 0x2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a. +// ParseTransferToDestination is a log parse operation binding the contract event 0x6cf14fdf618c440df3de7de7dcacf59541a464e55f360cbe73724c12e0c4cf99. // -// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, uint256 indexed teleporterMessageID, uint256 amount) +// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, bytes32 indexed teleporterMessageID, uint256 amount) func (_ERC20TokenSource *ERC20TokenSourceFilterer) ParseTransferToDestination(log types.Log) (*ERC20TokenSourceTransferToDestination, error) { event := new(ERC20TokenSourceTransferToDestination) if err := _ERC20TokenSource.contract.UnpackLog(event, "TransferToDestination", log); err != nil { diff --git a/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/NativeTokenDestination/NativeTokenDestination.go b/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/NativeTokenDestination/NativeTokenDestination.go index 3974c890a..1561bebea 100644 --- a/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/NativeTokenDestination/NativeTokenDestination.go +++ b/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/NativeTokenDestination/NativeTokenDestination.go @@ -37,8 +37,8 @@ type TeleporterFeeInfo struct { // NativeTokenDestinationMetaData contains all meta data concerning the NativeTokenDestination contract. var NativeTokenDestinationMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"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\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"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\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"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\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"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\":\"getMinTeleporterVersion\",\"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\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenSourceAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"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\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"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\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x61012060405273020000000000000000000000000000000000000160a0523480156200002a57600080fd5b5060405162002582380380620025828339810160408190526200004d9162000418565b83806001600160a01b038116620000d15760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f72746572207265676973747279206164647265737300000000000000000060648201526084015b60405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa1580156200011c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000142919062000461565b600155506200015133620003a9565b50600160035582620001af5760405162461bcd60e51b81526020600482015260316024820152600080516020620025628339815191526044820152701c98d948189b1bd8dad8da185a5b881251607a1b6064820152608401620000c8565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000202573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000228919062000461565b83036200029e5760405162461bcd60e51b815260206004820152603a60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a2063616e6e6f74206260448201527f726964676520776974682073616d6520626c6f636b636861696e0000000000006064820152608401620000c8565b60c08390526001600160a01b038216620003105760405162461bcd60e51b815260206004820152603460248201526000805160206200256283398151915260448201527f72636520636f6e747261637420616464726573730000000000000000000000006064820152608401620000c8565b6001600160a01b03821660e0526000819003620003965760405162461bcd60e51b815260206004820152603660248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f20696e6960448201527f7469616c207265736572766520696d62616c616e6365000000000000000000006064820152608401620000c8565b610100819052600455506200047b915050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200041357600080fd5b919050565b600080600080608085870312156200042f57600080fd5b6200043a85620003fb565b9350602085015192506200045160408601620003fb565b6060959095015193969295505050565b6000602082840312156200047457600080fd5b5051919050565b60805160a05160c05160e051610100516120556200050d600039600081816103140152610449015260008181610298015281816105da01528181610a0601526115750152600081816101e0015281816105b4015281816109e001526114f1015260006117ee0152600081816101940152818161085d01528181610bda01528181610de70152610ee101526120556000f3fe60806040526004361061013f5760003560e01c806375846562116100b6578063ab2852301161006f578063ab285230146103a5578063c452165e146103bc578063c868efaa146103d4578063d2cc7a70146103f4578063d3095126146103a5578063f2fde38b1461040957600080fd5b806375846562146102ef5780638ac7dd20146103025780638da5cb5b146103365780639731429714610354578063a2309ff814610374578063a2a950171461038a57600080fd5b80633a94fe51116101085780633a94fe51146102245780634511243e1461024457806349e3284e146102645780635d93f9af146102865780635eb99514146102ba578063715018a6146102da57600080fd5b8062d872ae1461014457806318160ddd1461016d5780631a7f5bec1461018257806329b7b3fd146101ce5780632b0d8f1814610202575b600080fd5b34801561015057600080fd5b5061015a60045481565b6040519081526020015b60405180910390f35b34801561017957600080fd5b5061015a610429565b34801561018e57600080fd5b506101b67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610164565b3480156101da57600080fd5b5061015a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561020e57600080fd5b5061022261021d366004611b01565b610488565b005b34801561023057600080fd5b5061022261023f366004611b89565b610577565b34801561025057600080fd5b5061022261025f366004611b01565b61073f565b34801561027057600080fd5b50600454155b6040519015158152602001610164565b34801561029257600080fd5b506101b67f000000000000000000000000000000000000000000000000000000000000000081565b3480156102c657600080fd5b506102226102d5366004611bdd565b610829565b3480156102e657600080fd5b5061022261083d565b6102226102fd366004611bf6565b610851565b34801561030e57600080fd5b5061015a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034257600080fd5b506002546001600160a01b03166101b6565b34801561036057600080fd5b5061027661036f366004611b01565b610ba4565b34801561038057600080fd5b5061015a60055481565b34801561039657600080fd5b506101b66001600160981b0181565b3480156103b157600080fd5b5061015a620186a081565b3480156103c857600080fd5b506101b6600160981b81565b3480156103e057600080fd5b506102226103ef366004611c5a565b610bc2565b34801561040057600080fd5b5060015461015a565b34801561041557600080fd5b50610222610424366004611b01565b610d64565b6000806104436001600160981b0131600160981b31611cf9565b905060007f00000000000000000000000000000000000000000000000000000000000000006005546104759190611cf9565b90506104818282611d0c565b9250505090565b610490610dda565b6001600160a01b0381166104bf5760405162461bcd60e51b81526004016104b690611d1f565b60405180910390fd5b6104c881610ba4565b1561052b5760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b60648201526084016104b6565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b6000610581610de2565b90506000600160981b6001600160a01b03163190506000826001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001898036038101906106189190611d6d565b8152602001620186a081526020018888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208082018990528251808303820181528284019093529092019161068a91600191606001611e23565b6040516020818303038152906040528152506040518263ffffffff1660e01b81526004016106b89190611e9e565b6020604051808303816000875af11580156106d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fb9190611f1c565b9050807f2550fa6041684d40e635e29e93dde9017d70c25b46aa88393317b5182ed6ae7c8360405161072f91815260200190565b60405180910390a2505050505050565b610747610dda565b6001600160a01b03811661076d5760405162461bcd60e51b81526004016104b690611d1f565b61077681610ba4565b6107d45760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b60648201526084016104b6565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152602081905260409020805460ff19169055565b610831610dda565b61083a81610edd565b50565b61084561107d565b61084f60006110d7565b565b610859611129565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190611f35565b90506001600160a01b0385166109055760405162461bcd60e51b81526004016104b690611f52565b600454156109725760405162461bcd60e51b815260206004820152603460248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20636f6e7472616374604482015273081d5b99195c98dbdb1b185d195c985b1a5e995960621b60648201526084016104b6565b60006020850135156109b15761099861098e6020870187611b01565b8660200135611182565b90506109b16109aa6020870187611b01565b83836112ec565b6109c26001600160981b01346113d1565b6000826001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200189803603810190610a449190611d6d565b8152602001620186a0815260200188888080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509385525050604051602093840193610ab292508e913491016001600160a01b03929092168252602082015260400190565b60408051601f1981840301815290829052610ad09291602001611e23565b6040516020818303038152906040528152506040518263ffffffff1660e01b8152600401610afe9190611e9e565b6020604051808303816000875af1158015610b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b419190611f1c565b905080876001600160a01b0316336001600160a01b03167f0322cbb1d3c23f6dbf1deddb3b4ef3ce0f93ae6eec7b44e4f395804104466d1434604051610b8991815260200190565b60405180910390a4505050610b9e6001600355565b50505050565b6001600160a01b031660009081526020819052604090205460ff1690565b60015460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa158015610c29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4d9190611f1c565b1015610cb45760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b60648201526084016104b6565b610cbd33610ba4565b15610d235760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b60648201526084016104b6565b610b9e848484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114ef92505050565b610d6c61107d565b6001600160a01b038116610dd15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104b6565b61083a816110d7565b61084f61107d565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e679190611f35565b9050610e7281610ba4565b15610ed85760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b60648201526084016104b6565b919050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f619190611f1c565b60015490915081831115610fd15760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b60648201526084016104b6565b8083116110465760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e0060648201526084016104b6565b6001839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6002546001600160a01b0316331461084f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104b6565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60026003540361117b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104b6565b6002600355565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156111cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ef9190611f1c565b90506112066001600160a01b038516333086611852565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa15801561124d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112719190611f1c565b90508181116112d75760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016104b6565b6112e18282611d0c565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801561133d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113619190611f1c565b61136b9190611cf9565b6040516001600160a01b038516602482015260448101829052909150610b9e90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261188a565b804710156114215760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016104b6565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461146e576040519150601f19603f3d011682016040523d82523d6000602084013e611473565b606091505b50509050806114ea5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016104b6565b505050565b7f000000000000000000000000000000000000000000000000000000000000000083146115735760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20696e76616c69642060448201526b39b7bab931b29031b430b4b760a11b60648201526084016104b6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146116085760405162461bcd60e51b815260206004820152602b60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20756e617574686f7260448201526a34bd32b21039b2b73232b960a91b60648201526084016104b6565b6000808280602001905181019061161f9190611fa0565b90925090506001600160a01b03821661164a5760405162461bcd60e51b81526004016104b690611f52565b806000036116ae5760405162461bcd60e51b815260206004820152602b60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2074726160448201526a6e736665722076616c756560a81b60648201526084016104b6565b600454819015611773576004548211156117175760045460408051918252600060208301527f244160b15e69cc411f041d94ae7fab6f6bba85dade8403216c05ff4b920d5449910160405180910390a160045461170b9083611d0c565b60006004559050611773565b81600460008282546117299190611d0c565b90915550506004546040805184815260208101929092527f244160b15e69cc411f041d94ae7fab6f6bba85dade8403216c05ff4b920d5449910160405180910390a1505050505050565b80600560008282546117859190611cf9565b90915550506040518181526001600160a01b038416907fd949ea0e9d5db53492d77f28fd5467fb2f6c4f5b88e3350e3c36729b76e99cf29060200160405180910390a26040516327ad555d60e11b81526001600160a01b038481166004830152602482018390527f00000000000000000000000000000000000000000000000000000000000000001690634f5aaaba90604401600060405180830381600087803b15801561183257600080fd5b505af1158015611846573d6000803e3d6000fd5b50505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610b9e9085906323b872dd60e01b9060840161139a565b60006118df826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661195c9092919063ffffffff16565b8051909150156114ea57808060200190518101906118fd9190611fce565b6114ea5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104b6565b606061196b8484600085611973565b949350505050565b6060824710156119d45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104b6565b600080866001600160a01b031685876040516119f09190611ff0565b60006040518083038185875af1925050503d8060008114611a2d576040519150601f19603f3d011682016040523d82523d6000602084013e611a32565b606091505b5091509150611a4387838387611a4e565b979650505050505050565b60608315611abd578251600003611ab6576001600160a01b0385163b611ab65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104b6565b508161196b565b61196b8383815115611ad25781518083602001fd5b8060405162461bcd60e51b81526004016104b6919061200c565b6001600160a01b038116811461083a57600080fd5b600060208284031215611b1357600080fd5b8135611b1e81611aec565b9392505050565b600060408284031215611b3757600080fd5b50919050565b60008083601f840112611b4f57600080fd5b50813567ffffffffffffffff811115611b6757600080fd5b6020830191508360208260051b8501011115611b8257600080fd5b9250929050565b600080600060608486031215611b9e57600080fd5b611ba88585611b25565b9250604084013567ffffffffffffffff811115611bc457600080fd5b611bd086828701611b3d565b9497909650939450505050565b600060208284031215611bef57600080fd5b5035919050565b60008060008060808587031215611c0c57600080fd5b8435611c1781611aec565b9350611c268660208701611b25565b9250606085013567ffffffffffffffff811115611c4257600080fd5b611c4e87828801611b3d565b95989497509550505050565b60008060008060608587031215611c7057600080fd5b843593506020850135611c8281611aec565b9250604085013567ffffffffffffffff80821115611c9f57600080fd5b818701915087601f830112611cb357600080fd5b813581811115611cc257600080fd5b886020828501011115611cd457600080fd5b95989497505060200194505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156112e6576112e6611ce3565b818103818111156112e6576112e6611ce3565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b600060408284031215611d7f57600080fd5b6040516040810181811067ffffffffffffffff82111715611db057634e487b7160e01b600052604160045260246000fd5b6040528235611dbe81611aec565b81526020928301359281019290925250919050565b60005b83811015611dee578181015183820152602001611dd6565b50506000910152565b60008151808452611e0f816020860160208601611dd3565b601f01601f19169290920160200192915050565b600060028410611e4357634e487b7160e01b600052602160045260246000fd5b8382526040602083015261196b6040830184611df7565b600081518084526020808501945080840160005b83811015611e935781516001600160a01b031687529582019590820190600101611e6e565b509495945050505050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c0840152611eff610100840182611e5a565b905060a0840151601f198483030160e08501526112e18282611df7565b600060208284031215611f2e57600080fd5b5051919050565b600060208284031215611f4757600080fd5b8151611b1e81611aec565b6020808252602e908201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2072656360408201526d697069656e74206164647265737360901b606082015260800190565b60008060408385031215611fb357600080fd5b8251611fbe81611aec565b6020939093015192949293505050565b600060208284031215611fe057600080fd5b81518015158114611b1e57600080fd5b60008251612002818460208701611dd3565b9190910192915050565b602081526000611b1e6020830184611df756fea2646970667358221220f5e8be05690af906668d2a0425a802d5310705671cd1f430f0d4f0b00efaaefa64736f6c634300081200334e6174697665546f6b656e44657374696e6174696f6e3a207a65726f20736f75", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"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\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"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\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"teleporterMessageID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"burnAddressBalance\",\"type\":\"uint256\"}],\"name\":\"ReportTotalBurnedTxFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"teleporterMessageID\",\"type\":\"bytes32\"},{\"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\":\"getMinTeleporterVersion\",\"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\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenSourceAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"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\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"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\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x61012060405273020000000000000000000000000000000000000160a0523480156200002a57600080fd5b5060405162002582380380620025828339810160408190526200004d9162000418565b83806001600160a01b038116620000d15760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f72746572207265676973747279206164647265737300000000000000000060648201526084015b60405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa1580156200011c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000142919062000461565b600155506200015133620003a9565b50600160035582620001af5760405162461bcd60e51b81526020600482015260316024820152600080516020620025628339815191526044820152701c98d948189b1bd8dad8da185a5b881251607a1b6064820152608401620000c8565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000202573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000228919062000461565b83036200029e5760405162461bcd60e51b815260206004820152603a60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a2063616e6e6f74206260448201527f726964676520776974682073616d6520626c6f636b636861696e0000000000006064820152608401620000c8565b60c08390526001600160a01b038216620003105760405162461bcd60e51b815260206004820152603460248201526000805160206200256283398151915260448201527f72636520636f6e747261637420616464726573730000000000000000000000006064820152608401620000c8565b6001600160a01b03821660e0526000819003620003965760405162461bcd60e51b815260206004820152603660248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f20696e6960448201527f7469616c207265736572766520696d62616c616e6365000000000000000000006064820152608401620000c8565b610100819052600455506200047b915050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200041357600080fd5b919050565b600080600080608085870312156200042f57600080fd5b6200043a85620003fb565b9350602085015192506200045160408601620003fb565b6060959095015193969295505050565b6000602082840312156200047457600080fd5b5051919050565b60805160a05160c05160e051610100516120556200050d600039600081816103140152610449015260008181610298015281816105da01528181610a0601526115750152600081816101e0015281816105b4015281816109e001526114f1015260006117ee0152600081816101940152818161085d01528181610bda01528181610de70152610ee101526120556000f3fe60806040526004361061013f5760003560e01c806375846562116100b6578063ab2852301161006f578063ab285230146103a5578063c452165e146103bc578063c868efaa146103d4578063d2cc7a70146103f4578063d3095126146103a5578063f2fde38b1461040957600080fd5b806375846562146102ef5780638ac7dd20146103025780638da5cb5b146103365780639731429714610354578063a2309ff814610374578063a2a950171461038a57600080fd5b80633a94fe51116101085780633a94fe51146102245780634511243e1461024457806349e3284e146102645780635d93f9af146102865780635eb99514146102ba578063715018a6146102da57600080fd5b8062d872ae1461014457806318160ddd1461016d5780631a7f5bec1461018257806329b7b3fd146101ce5780632b0d8f1814610202575b600080fd5b34801561015057600080fd5b5061015a60045481565b6040519081526020015b60405180910390f35b34801561017957600080fd5b5061015a610429565b34801561018e57600080fd5b506101b67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610164565b3480156101da57600080fd5b5061015a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561020e57600080fd5b5061022261021d366004611b01565b610488565b005b34801561023057600080fd5b5061022261023f366004611b89565b610577565b34801561025057600080fd5b5061022261025f366004611b01565b61073f565b34801561027057600080fd5b50600454155b6040519015158152602001610164565b34801561029257600080fd5b506101b67f000000000000000000000000000000000000000000000000000000000000000081565b3480156102c657600080fd5b506102226102d5366004611bdd565b610829565b3480156102e657600080fd5b5061022261083d565b6102226102fd366004611bf6565b610851565b34801561030e57600080fd5b5061015a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034257600080fd5b506002546001600160a01b03166101b6565b34801561036057600080fd5b5061027661036f366004611b01565b610ba4565b34801561038057600080fd5b5061015a60055481565b34801561039657600080fd5b506101b66001600160981b0181565b3480156103b157600080fd5b5061015a620186a081565b3480156103c857600080fd5b506101b6600160981b81565b3480156103e057600080fd5b506102226103ef366004611c5a565b610bc2565b34801561040057600080fd5b5060015461015a565b34801561041557600080fd5b50610222610424366004611b01565b610d64565b6000806104436001600160981b0131600160981b31611cf9565b905060007f00000000000000000000000000000000000000000000000000000000000000006005546104759190611cf9565b90506104818282611d0c565b9250505090565b610490610dda565b6001600160a01b0381166104bf5760405162461bcd60e51b81526004016104b690611d1f565b60405180910390fd5b6104c881610ba4565b1561052b5760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b60648201526084016104b6565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b6000610581610de2565b90506000600160981b6001600160a01b03163190506000826001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001898036038101906106189190611d6d565b8152602001620186a081526020018888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208082018990528251808303820181528284019093529092019161068a91600191606001611e23565b6040516020818303038152906040528152506040518263ffffffff1660e01b81526004016106b89190611e9e565b6020604051808303816000875af11580156106d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fb9190611f1c565b9050807f4c37b521cdeedd09975d7697ea18c95dc3c46dea1ca09dfcdd2e17f1061915098360405161072f91815260200190565b60405180910390a2505050505050565b610747610dda565b6001600160a01b03811661076d5760405162461bcd60e51b81526004016104b690611d1f565b61077681610ba4565b6107d45760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b60648201526084016104b6565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152602081905260409020805460ff19169055565b610831610dda565b61083a81610edd565b50565b61084561107d565b61084f60006110d7565b565b610859611129565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190611f35565b90506001600160a01b0385166109055760405162461bcd60e51b81526004016104b690611f52565b600454156109725760405162461bcd60e51b815260206004820152603460248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20636f6e7472616374604482015273081d5b99195c98dbdb1b185d195c985b1a5e995960621b60648201526084016104b6565b60006020850135156109b15761099861098e6020870187611b01565b8660200135611182565b90506109b16109aa6020870187611b01565b83836112ec565b6109c26001600160981b01346113d1565b6000826001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815260200189803603810190610a449190611d6d565b8152602001620186a0815260200188888080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509385525050604051602093840193610ab292508e913491016001600160a01b03929092168252602082015260400190565b60408051601f1981840301815290829052610ad09291602001611e23565b6040516020818303038152906040528152506040518263ffffffff1660e01b8152600401610afe9190611e9e565b6020604051808303816000875af1158015610b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b419190611f1c565b905080876001600160a01b0316336001600160a01b03167f8adc7b22fb27c91bbad9f38633adae809888623a9aee14c1adec44ee7e7cf2c034604051610b8991815260200190565b60405180910390a4505050610b9e6001600355565b50505050565b6001600160a01b031660009081526020819052604090205460ff1690565b60015460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa158015610c29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4d9190611f1c565b1015610cb45760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b60648201526084016104b6565b610cbd33610ba4565b15610d235760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b60648201526084016104b6565b610b9e848484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114ef92505050565b610d6c61107d565b6001600160a01b038116610dd15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104b6565b61083a816110d7565b61084f61107d565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e679190611f35565b9050610e7281610ba4565b15610ed85760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b60648201526084016104b6565b919050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f619190611f1c565b60015490915081831115610fd15760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b60648201526084016104b6565b8083116110465760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e0060648201526084016104b6565b6001839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6002546001600160a01b0316331461084f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104b6565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60026003540361117b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104b6565b6002600355565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa1580156111cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ef9190611f1c565b90506112066001600160a01b038516333086611852565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa15801561124d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112719190611f1c565b90508181116112d75760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016104b6565b6112e18282611d0c565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801561133d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113619190611f1c565b61136b9190611cf9565b6040516001600160a01b038516602482015260448101829052909150610b9e90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261188a565b804710156114215760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016104b6565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461146e576040519150601f19603f3d011682016040523d82523d6000602084013e611473565b606091505b50509050806114ea5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016104b6565b505050565b7f000000000000000000000000000000000000000000000000000000000000000083146115735760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20696e76616c69642060448201526b39b7bab931b29031b430b4b760a11b60648201526084016104b6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146116085760405162461bcd60e51b815260206004820152602b60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a20756e617574686f7260448201526a34bd32b21039b2b73232b960a91b60648201526084016104b6565b6000808280602001905181019061161f9190611fa0565b90925090506001600160a01b03821661164a5760405162461bcd60e51b81526004016104b690611f52565b806000036116ae5760405162461bcd60e51b815260206004820152602b60248201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2074726160448201526a6e736665722076616c756560a81b60648201526084016104b6565b600454819015611773576004548211156117175760045460408051918252600060208301527f244160b15e69cc411f041d94ae7fab6f6bba85dade8403216c05ff4b920d5449910160405180910390a160045461170b9083611d0c565b60006004559050611773565b81600460008282546117299190611d0c565b90915550506004546040805184815260208101929092527f244160b15e69cc411f041d94ae7fab6f6bba85dade8403216c05ff4b920d5449910160405180910390a1505050505050565b80600560008282546117859190611cf9565b90915550506040518181526001600160a01b038416907fd949ea0e9d5db53492d77f28fd5467fb2f6c4f5b88e3350e3c36729b76e99cf29060200160405180910390a26040516327ad555d60e11b81526001600160a01b038481166004830152602482018390527f00000000000000000000000000000000000000000000000000000000000000001690634f5aaaba90604401600060405180830381600087803b15801561183257600080fd5b505af1158015611846573d6000803e3d6000fd5b50505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610b9e9085906323b872dd60e01b9060840161139a565b60006118df826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661195c9092919063ffffffff16565b8051909150156114ea57808060200190518101906118fd9190611fce565b6114ea5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104b6565b606061196b8484600085611973565b949350505050565b6060824710156119d45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104b6565b600080866001600160a01b031685876040516119f09190611ff0565b60006040518083038185875af1925050503d8060008114611a2d576040519150601f19603f3d011682016040523d82523d6000602084013e611a32565b606091505b5091509150611a4387838387611a4e565b979650505050505050565b60608315611abd578251600003611ab6576001600160a01b0385163b611ab65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104b6565b508161196b565b61196b8383815115611ad25781518083602001fd5b8060405162461bcd60e51b81526004016104b6919061200c565b6001600160a01b038116811461083a57600080fd5b600060208284031215611b1357600080fd5b8135611b1e81611aec565b9392505050565b600060408284031215611b3757600080fd5b50919050565b60008083601f840112611b4f57600080fd5b50813567ffffffffffffffff811115611b6757600080fd5b6020830191508360208260051b8501011115611b8257600080fd5b9250929050565b600080600060608486031215611b9e57600080fd5b611ba88585611b25565b9250604084013567ffffffffffffffff811115611bc457600080fd5b611bd086828701611b3d565b9497909650939450505050565b600060208284031215611bef57600080fd5b5035919050565b60008060008060808587031215611c0c57600080fd5b8435611c1781611aec565b9350611c268660208701611b25565b9250606085013567ffffffffffffffff811115611c4257600080fd5b611c4e87828801611b3d565b95989497509550505050565b60008060008060608587031215611c7057600080fd5b843593506020850135611c8281611aec565b9250604085013567ffffffffffffffff80821115611c9f57600080fd5b818701915087601f830112611cb357600080fd5b813581811115611cc257600080fd5b886020828501011115611cd457600080fd5b95989497505060200194505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156112e6576112e6611ce3565b818103818111156112e6576112e6611ce3565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b600060408284031215611d7f57600080fd5b6040516040810181811067ffffffffffffffff82111715611db057634e487b7160e01b600052604160045260246000fd5b6040528235611dbe81611aec565b81526020928301359281019290925250919050565b60005b83811015611dee578181015183820152602001611dd6565b50506000910152565b60008151808452611e0f816020860160208601611dd3565b601f01601f19169290920160200192915050565b600060028410611e4357634e487b7160e01b600052602160045260246000fd5b8382526040602083015261196b6040830184611df7565b600081518084526020808501945080840160005b83811015611e935781516001600160a01b031687529582019590820190600101611e6e565b509495945050505050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c0840152611eff610100840182611e5a565b905060a0840151601f198483030160e08501526112e18282611df7565b600060208284031215611f2e57600080fd5b5051919050565b600060208284031215611f4757600080fd5b8151611b1e81611aec565b6020808252602e908201527f4e6174697665546f6b656e44657374696e6174696f6e3a207a65726f2072656360408201526d697069656e74206164647265737360901b606082015260800190565b60008060408385031215611fb357600080fd5b8251611fbe81611aec565b6020939093015192949293505050565b600060208284031215611fe057600080fd5b81518015158114611b1e57600080fd5b60008251612002818460208701611dd3565b9190910192915050565b602081526000611b1e6020830184611df756fea264697066735822122062e549c48a64404c8523d009fdeb1ece2b1fe6d1b1d47ccd623cb1a0c355d48464736f6c634300081200334e6174697665546f6b656e44657374696e6174696f6e3a207a65726f20736f75", } // NativeTokenDestinationABI is the input ABI used to generate the binding from. @@ -1496,15 +1496,15 @@ func (it *NativeTokenDestinationReportTotalBurnedTxFeesIterator) Close() error { // NativeTokenDestinationReportTotalBurnedTxFees represents a ReportTotalBurnedTxFees event raised by the NativeTokenDestination contract. type NativeTokenDestinationReportTotalBurnedTxFees struct { - TeleporterMessageID *big.Int + TeleporterMessageID [32]byte BurnAddressBalance *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterReportTotalBurnedTxFees is a free log retrieval operation binding the contract event 0x2550fa6041684d40e635e29e93dde9017d70c25b46aa88393317b5182ed6ae7c. +// FilterReportTotalBurnedTxFees is a free log retrieval operation binding the contract event 0x4c37b521cdeedd09975d7697ea18c95dc3c46dea1ca09dfcdd2e17f106191509. // -// Solidity: event ReportTotalBurnedTxFees(uint256 indexed teleporterMessageID, uint256 burnAddressBalance) -func (_NativeTokenDestination *NativeTokenDestinationFilterer) FilterReportTotalBurnedTxFees(opts *bind.FilterOpts, teleporterMessageID []*big.Int) (*NativeTokenDestinationReportTotalBurnedTxFeesIterator, error) { +// Solidity: event ReportTotalBurnedTxFees(bytes32 indexed teleporterMessageID, uint256 burnAddressBalance) +func (_NativeTokenDestination *NativeTokenDestinationFilterer) FilterReportTotalBurnedTxFees(opts *bind.FilterOpts, teleporterMessageID [][32]byte) (*NativeTokenDestinationReportTotalBurnedTxFeesIterator, error) { var teleporterMessageIDRule []interface{} for _, teleporterMessageIDItem := range teleporterMessageID { @@ -1518,10 +1518,10 @@ func (_NativeTokenDestination *NativeTokenDestinationFilterer) FilterReportTotal return &NativeTokenDestinationReportTotalBurnedTxFeesIterator{contract: _NativeTokenDestination.contract, event: "ReportTotalBurnedTxFees", logs: logs, sub: sub}, nil } -// WatchReportTotalBurnedTxFees is a free log subscription operation binding the contract event 0x2550fa6041684d40e635e29e93dde9017d70c25b46aa88393317b5182ed6ae7c. +// WatchReportTotalBurnedTxFees is a free log subscription operation binding the contract event 0x4c37b521cdeedd09975d7697ea18c95dc3c46dea1ca09dfcdd2e17f106191509. // -// Solidity: event ReportTotalBurnedTxFees(uint256 indexed teleporterMessageID, uint256 burnAddressBalance) -func (_NativeTokenDestination *NativeTokenDestinationFilterer) WatchReportTotalBurnedTxFees(opts *bind.WatchOpts, sink chan<- *NativeTokenDestinationReportTotalBurnedTxFees, teleporterMessageID []*big.Int) (event.Subscription, error) { +// Solidity: event ReportTotalBurnedTxFees(bytes32 indexed teleporterMessageID, uint256 burnAddressBalance) +func (_NativeTokenDestination *NativeTokenDestinationFilterer) WatchReportTotalBurnedTxFees(opts *bind.WatchOpts, sink chan<- *NativeTokenDestinationReportTotalBurnedTxFees, teleporterMessageID [][32]byte) (event.Subscription, error) { var teleporterMessageIDRule []interface{} for _, teleporterMessageIDItem := range teleporterMessageID { @@ -1560,9 +1560,9 @@ func (_NativeTokenDestination *NativeTokenDestinationFilterer) WatchReportTotalB }), nil } -// ParseReportTotalBurnedTxFees is a log parse operation binding the contract event 0x2550fa6041684d40e635e29e93dde9017d70c25b46aa88393317b5182ed6ae7c. +// ParseReportTotalBurnedTxFees is a log parse operation binding the contract event 0x4c37b521cdeedd09975d7697ea18c95dc3c46dea1ca09dfcdd2e17f106191509. // -// Solidity: event ReportTotalBurnedTxFees(uint256 indexed teleporterMessageID, uint256 burnAddressBalance) +// Solidity: event ReportTotalBurnedTxFees(bytes32 indexed teleporterMessageID, uint256 burnAddressBalance) func (_NativeTokenDestination *NativeTokenDestinationFilterer) ParseReportTotalBurnedTxFees(log types.Log) (*NativeTokenDestinationReportTotalBurnedTxFees, error) { event := new(NativeTokenDestinationReportTotalBurnedTxFees) if err := _NativeTokenDestination.contract.UnpackLog(event, "ReportTotalBurnedTxFees", log); err != nil { @@ -1931,15 +1931,15 @@ func (it *NativeTokenDestinationTransferToSourceIterator) Close() error { type NativeTokenDestinationTransferToSource struct { Sender common.Address Recipient common.Address - TeleporterMessageID *big.Int + TeleporterMessageID [32]byte Amount *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterTransferToSource is a free log retrieval operation binding the contract event 0x0322cbb1d3c23f6dbf1deddb3b4ef3ce0f93ae6eec7b44e4f395804104466d14. +// FilterTransferToSource is a free log retrieval operation binding the contract event 0x8adc7b22fb27c91bbad9f38633adae809888623a9aee14c1adec44ee7e7cf2c0. // -// Solidity: event TransferToSource(address indexed sender, address indexed recipient, uint256 indexed teleporterMessageID, uint256 amount) -func (_NativeTokenDestination *NativeTokenDestinationFilterer) FilterTransferToSource(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address, teleporterMessageID []*big.Int) (*NativeTokenDestinationTransferToSourceIterator, error) { +// Solidity: event TransferToSource(address indexed sender, address indexed recipient, bytes32 indexed teleporterMessageID, uint256 amount) +func (_NativeTokenDestination *NativeTokenDestinationFilterer) FilterTransferToSource(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address, teleporterMessageID [][32]byte) (*NativeTokenDestinationTransferToSourceIterator, error) { var senderRule []interface{} for _, senderItem := range sender { @@ -1961,10 +1961,10 @@ func (_NativeTokenDestination *NativeTokenDestinationFilterer) FilterTransferToS return &NativeTokenDestinationTransferToSourceIterator{contract: _NativeTokenDestination.contract, event: "TransferToSource", logs: logs, sub: sub}, nil } -// WatchTransferToSource is a free log subscription operation binding the contract event 0x0322cbb1d3c23f6dbf1deddb3b4ef3ce0f93ae6eec7b44e4f395804104466d14. +// WatchTransferToSource is a free log subscription operation binding the contract event 0x8adc7b22fb27c91bbad9f38633adae809888623a9aee14c1adec44ee7e7cf2c0. // -// Solidity: event TransferToSource(address indexed sender, address indexed recipient, uint256 indexed teleporterMessageID, uint256 amount) -func (_NativeTokenDestination *NativeTokenDestinationFilterer) WatchTransferToSource(opts *bind.WatchOpts, sink chan<- *NativeTokenDestinationTransferToSource, sender []common.Address, recipient []common.Address, teleporterMessageID []*big.Int) (event.Subscription, error) { +// Solidity: event TransferToSource(address indexed sender, address indexed recipient, bytes32 indexed teleporterMessageID, uint256 amount) +func (_NativeTokenDestination *NativeTokenDestinationFilterer) WatchTransferToSource(opts *bind.WatchOpts, sink chan<- *NativeTokenDestinationTransferToSource, sender []common.Address, recipient []common.Address, teleporterMessageID [][32]byte) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { @@ -2011,9 +2011,9 @@ func (_NativeTokenDestination *NativeTokenDestinationFilterer) WatchTransferToSo }), nil } -// ParseTransferToSource is a log parse operation binding the contract event 0x0322cbb1d3c23f6dbf1deddb3b4ef3ce0f93ae6eec7b44e4f395804104466d14. +// ParseTransferToSource is a log parse operation binding the contract event 0x8adc7b22fb27c91bbad9f38633adae809888623a9aee14c1adec44ee7e7cf2c0. // -// Solidity: event TransferToSource(address indexed sender, address indexed recipient, uint256 indexed teleporterMessageID, uint256 amount) +// Solidity: event TransferToSource(address indexed sender, address indexed recipient, bytes32 indexed teleporterMessageID, uint256 amount) func (_NativeTokenDestination *NativeTokenDestinationFilterer) ParseTransferToSource(log types.Log) (*NativeTokenDestinationTransferToSource, error) { event := new(NativeTokenDestinationTransferToSource) if err := _NativeTokenDestination.contract.UnpackLog(event, "TransferToSource", log); err != nil { diff --git a/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go b/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go index 6f55f319e..e17f4d596 100644 --- a/abi-bindings/go/CrossChainApplications/examples/NativeTokenBridge/NativeTokenSource/NativeTokenSource.go +++ b/abi-bindings/go/CrossChainApplications/examples/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\":\"teleporterRegistryAddress\",\"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\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"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\":\"getMinTeleporterVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60e06040523480156200001157600080fd5b506040516200209d3803806200209d83398101604081905262000034916200037b565b82806001600160a01b038116620000b85760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f72746572207265676973747279206164647265737300000000000000000060648201526084015b60405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa15801562000103573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001299190620003bc565b6001555062000138336200030c565b50600160035581620001965760405162461bcd60e51b815260206004820152603160248201526000805160206200207d8339815191526044820152701a5bdb88189b1bd8dad8da185a5b881251607a1b6064820152608401620000af565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020f9190620003bc565b8203620002855760405162461bcd60e51b815260206004820152603560248201527f4e6174697665546f6b656e536f757263653a2063616e6e6f742062726964676560448201527f20776974682073616d6520626c6f636b636861696e00000000000000000000006064820152608401620000af565b60a08290526001600160a01b038116620002f75760405162461bcd60e51b815260206004820152603460248201526000805160206200207d83398151915260448201527f696f6e20636f6e747261637420616464726573730000000000000000000000006064820152608401620000af565b6001600160a01b031660c05250620003d69050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200037657600080fd5b919050565b6000806000606084860312156200039157600080fd5b6200039c846200035e565b925060208401519150620003b3604085016200035e565b90509250925092565b600060208284031215620003cf57600080fd5b5051919050565b60805160a05160c051611c4662000437600039600081816102a20152818161060d015261102301526000818161017d015281816105e70152610f9f01526000818161010a015281816107a6015281816109b20152610c580152611c466000f3fe6080604052600436106100f35760003560e01c8063973142971161008a578063c452165e11610059578063c452165e146102c4578063c868efaa146102dc578063d2cc7a70146102fc578063f2fde38b1461031157600080fd5b80639731429714610236578063ad0aee2514610266578063b6171f7314610279578063b8c9091a1461029057600080fd5b806355db3e9e116100c657806355db3e9e146101cd5780635eb99514146101e3578063715018a6146102035780638da5cb5b1461021857600080fd5b80631a7f5bec146100f85780632b0d8f181461014957806341d3014d1461016b5780634511243e146101ad575b600080fd5b34801561010457600080fd5b5061012c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015557600080fd5b506101696101643660046116bd565b610331565b005b34801561017757600080fd5b5061019f7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610140565b3480156101b957600080fd5b506101696101c83660046116bd565b610420565b3480156101d957600080fd5b5061019f60045481565b3480156101ef57600080fd5b506101696101fe3660046116e1565b61050a565b34801561020f57600080fd5b5061016961051e565b34801561022457600080fd5b506002546001600160a01b031661012c565b34801561024257600080fd5b506102566102513660046116bd565b610532565b6040519015158152602001610140565b6101696102743660046116fa565b610550565b34801561028557600080fd5b5061019f620186a081565b34801561029c57600080fd5b5061012c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102d057600080fd5b5061012c600160981b81565b3480156102e857600080fd5b506101696102f7366004611799565b61078e565b34801561030857600080fd5b5060015461019f565b34801561031d57600080fd5b5061016961032c3660046116bd565b610930565b6103396109a6565b6001600160a01b0381166103685760405162461bcd60e51b815260040161035f90611813565b60405180910390fd5b61037181610532565b156103d45760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b606482015260840161035f565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b6104286109a6565b6001600160a01b03811661044e5760405162461bcd60e51b815260040161035f90611813565b61045781610532565b6104b55760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b606482015260840161035f565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152602081905260409020805460ff19169055565b6105126109a6565b61051b816109ae565b50565b610526610b4e565b6105306000610ba8565b565b6001600160a01b031660009081526020819052604090205460ff1690565b610558610bfa565b6000610562610c53565b90506001600160a01b03851661058a5760405162461bcd60e51b815260040161035f90611861565b60006020850135156105c9576105b06105a660208701876116bd565b8660200135610d4e565b90506105c96105c260208701876116bd565b8383610eb8565b6000826001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018980360381019061064b91906118f1565b8152602001620186a081526020018888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040516020918201916106ba918d913491016001600160a01b03929092168252602082015260400190565b6040516020818303038152906040528152506040518263ffffffff1660e01b81526004016106e891906119dd565b6020604051808303816000875af1158015610707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072b9190611a5b565b905080876001600160a01b0316336001600160a01b03167f2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a3460405161077391815260200190565b60405180910390a45050506107886001600355565b50505050565b60015460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa1580156107f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108199190611a5b565b10156108805760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b606482015260840161035f565b61088933610532565b156108ef5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b606482015260840161035f565b610788848484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610f9d92505050565b610938610b4e565b6001600160a01b03811661099d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161035f565b61051b81610ba8565b610530610b4e565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a329190611a5b565b60015490915081831115610aa25760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b606482015260840161035f565b808311610b175760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e00606482015260840161035f565b6001839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6002546001600160a01b031633146105305760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161035f565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260035403610c4c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161035f565b6002600355565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd89190611a74565b9050610ce381610532565b15610d495760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b606482015260840161035f565b919050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610d97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbb9190611a5b565b9050610dd26001600160a01b0385163330866111ab565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610e19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3d9190611a5b565b9050818111610ea35760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b606482015260840161035f565b610ead8282611aa7565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d9190611a5b565b610f379190611aba565b6040516001600160a01b03851660248201526044810182905290915061078890859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111e3565b7f000000000000000000000000000000000000000000000000000000000000000083146110215760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420646573746960448201526b3730ba34b7b71031b430b4b760a11b606482015260840161035f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146110b15760405162461bcd60e51b815260206004820152602660248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201526539b2b73232b960d11b606482015260840161035f565b600080828060200190518101906110c89190611acd565b909250905060008260018111156110e1576110e1611b7b565b0361111257600080828060200190518101906110fd9190611b91565b9150915061110b82826112ba565b50506111a4565b600182600181111561112657611126611b7b565b03611152576000818060200190518101906111419190611a5b565b905061114c81611393565b506111a4565b60405162461bcd60e51b815260206004820152602160248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420616374696f6044820152603760f91b606482015260840161035f565b5050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526107889085906323b872dd60e01b90608401610f66565b6000611238826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113be9092919063ffffffff16565b8051909150156112b557808060200190518101906112569190611bbf565b6112b55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161035f565b505050565b6001600160a01b0382166112e05760405162461bcd60e51b815260040161035f90611861565b804710156113435760405162461bcd60e51b815260206004820152602a60248201527f4e6174697665546f6b656e536f757263653a20696e73756666696369656e742060448201526918dbdb1b185d195c985b60b21b606482015260840161035f565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a161138f82826113d5565b5050565b60045481111561051b576000600454826113ad9190611aa7565b90506113b8816114ee565b50600455565b60606113cd848460008561152f565b949350505050565b804710156114255760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161035f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611472576040519150601f19603f3d011682016040523d82523d6000602084013e611477565b606091505b50509050806112b55760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161035f565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a161051b600160981b826113d5565b6060824710156115905760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161035f565b600080866001600160a01b031685876040516115ac9190611be1565b60006040518083038185875af1925050503d80600081146115e9576040519150601f19603f3d011682016040523d82523d6000602084013e6115ee565b606091505b50915091506115ff8783838761160a565b979650505050505050565b60608315611679578251600003611672576001600160a01b0385163b6116725760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161035f565b50816113cd565b6113cd838381511561168e5781518083602001fd5b8060405162461bcd60e51b815260040161035f9190611bfd565b6001600160a01b038116811461051b57600080fd5b6000602082840312156116cf57600080fd5b81356116da816116a8565b9392505050565b6000602082840312156116f357600080fd5b5035919050565b600080600080848603608081121561171157600080fd5b853561171c816116a8565b94506040601f198201121561173057600080fd5b50602085019250606085013567ffffffffffffffff8082111561175257600080fd5b818701915087601f83011261176657600080fd5b81358181111561177557600080fd5b8860208260051b850101111561178a57600080fd5b95989497505060200194505050565b600080600080606085870312156117af57600080fd5b8435935060208501356117c1816116a8565b9250604085013567ffffffffffffffff808211156117de57600080fd5b818701915087601f8301126117f257600080fd5b81358181111561180157600080fd5b88602082850101111561178a57600080fd5b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b60208082526029908201527f4e6174697665546f6b656e536f757263653a207a65726f20726563697069656e60408201526874206164647265737360b81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156118e9576118e96118aa565b604052919050565b60006040828403121561190357600080fd5b6040516040810181811067ffffffffffffffff82111715611926576119266118aa565b6040528235611934816116a8565b81526020928301359281019290925250919050565b600081518084526020808501945080840160005b838110156119825781516001600160a01b03168752958201959082019060010161195d565b509495945050505050565b60005b838110156119a8578181015183820152602001611990565b50506000910152565b600081518084526119c981602086016020860161198d565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c0840152611a3e610100840182611949565b905060a0840151601f198483030160e0850152610ead82826119b1565b600060208284031215611a6d57600080fd5b5051919050565b600060208284031215611a8657600080fd5b81516116da816116a8565b634e487b7160e01b600052601160045260246000fd5b81810381811115610eb257610eb2611a91565b80820180821115610eb257610eb2611a91565b60008060408385031215611ae057600080fd5b825160028110611aef57600080fd5b602084015190925067ffffffffffffffff80821115611b0d57600080fd5b818501915085601f830112611b2157600080fd5b815181811115611b3357611b336118aa565b611b46601f8201601f19166020016118c0565b9150808252866020828501011115611b5d57600080fd5b611b6e81602084016020860161198d565b5080925050509250929050565b634e487b7160e01b600052602160045260246000fd5b60008060408385031215611ba457600080fd5b8251611baf816116a8565b6020939093015192949293505050565b600060208284031215611bd157600080fd5b815180151581146116da57600080fd5b60008251611bf381846020870161198d565b9190910192915050565b6020815260006116da60208301846119b156fea26469706673582212201db042ff0d1f898a03296c23e7dcccf73922a152160fe6d1369bb35e18536cb764736f6c634300081200334e6174697665546f6b656e536f757263653a207a65726f2064657374696e6174", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"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\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"teleporterMessageID\",\"type\":\"bytes32\"},{\"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\":\"getMinTeleporterVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeTokenDestinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60e06040523480156200001157600080fd5b506040516200209d3803806200209d83398101604081905262000034916200037b565b82806001600160a01b038116620000b85760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f72746572207265676973747279206164647265737300000000000000000060648201526084015b60405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa15801562000103573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001299190620003bc565b6001555062000138336200030c565b50600160035581620001965760405162461bcd60e51b815260206004820152603160248201526000805160206200207d8339815191526044820152701a5bdb88189b1bd8dad8da185a5b881251607a1b6064820152608401620000af565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020f9190620003bc565b8203620002855760405162461bcd60e51b815260206004820152603560248201527f4e6174697665546f6b656e536f757263653a2063616e6e6f742062726964676560448201527f20776974682073616d6520626c6f636b636861696e00000000000000000000006064820152608401620000af565b60a08290526001600160a01b038116620002f75760405162461bcd60e51b815260206004820152603460248201526000805160206200207d83398151915260448201527f696f6e20636f6e747261637420616464726573730000000000000000000000006064820152608401620000af565b6001600160a01b031660c05250620003d69050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200037657600080fd5b919050565b6000806000606084860312156200039157600080fd5b6200039c846200035e565b925060208401519150620003b3604085016200035e565b90509250925092565b600060208284031215620003cf57600080fd5b5051919050565b60805160a05160c051611c4662000437600039600081816102a20152818161060d015261102301526000818161017d015281816105e70152610f9f01526000818161010a015281816107a6015281816109b20152610c580152611c466000f3fe6080604052600436106100f35760003560e01c8063973142971161008a578063c452165e11610059578063c452165e146102c4578063c868efaa146102dc578063d2cc7a70146102fc578063f2fde38b1461031157600080fd5b80639731429714610236578063ad0aee2514610266578063b6171f7314610279578063b8c9091a1461029057600080fd5b806355db3e9e116100c657806355db3e9e146101cd5780635eb99514146101e3578063715018a6146102035780638da5cb5b1461021857600080fd5b80631a7f5bec146100f85780632b0d8f181461014957806341d3014d1461016b5780634511243e146101ad575b600080fd5b34801561010457600080fd5b5061012c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015557600080fd5b506101696101643660046116bd565b610331565b005b34801561017757600080fd5b5061019f7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610140565b3480156101b957600080fd5b506101696101c83660046116bd565b610420565b3480156101d957600080fd5b5061019f60045481565b3480156101ef57600080fd5b506101696101fe3660046116e1565b61050a565b34801561020f57600080fd5b5061016961051e565b34801561022457600080fd5b506002546001600160a01b031661012c565b34801561024257600080fd5b506102566102513660046116bd565b610532565b6040519015158152602001610140565b6101696102743660046116fa565b610550565b34801561028557600080fd5b5061019f620186a081565b34801561029c57600080fd5b5061012c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102d057600080fd5b5061012c600160981b81565b3480156102e857600080fd5b506101696102f7366004611799565b61078e565b34801561030857600080fd5b5060015461019f565b34801561031d57600080fd5b5061016961032c3660046116bd565b610930565b6103396109a6565b6001600160a01b0381166103685760405162461bcd60e51b815260040161035f90611813565b60405180910390fd5b61037181610532565b156103d45760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b606482015260840161035f565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b6104286109a6565b6001600160a01b03811661044e5760405162461bcd60e51b815260040161035f90611813565b61045781610532565b6104b55760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b606482015260840161035f565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152602081905260409020805460ff19169055565b6105126109a6565b61051b816109ae565b50565b610526610b4e565b6105306000610ba8565b565b6001600160a01b031660009081526020819052604090205460ff1690565b610558610bfa565b6000610562610c53565b90506001600160a01b03851661058a5760405162461bcd60e51b815260040161035f90611861565b60006020850135156105c9576105b06105a660208701876116bd565b8660200135610d4e565b90506105c96105c260208701876116bd565b8383610eb8565b6000826001600160a01b031663624488506040518060c001604052807f000000000000000000000000000000000000000000000000000000000000000081526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020018980360381019061064b91906118f1565b8152602001620186a081526020018888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040516020918201916106ba918d913491016001600160a01b03929092168252602082015260400190565b6040516020818303038152906040528152506040518263ffffffff1660e01b81526004016106e891906119dd565b6020604051808303816000875af1158015610707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072b9190611a5b565b905080876001600160a01b0316336001600160a01b03167f6cf14fdf618c440df3de7de7dcacf59541a464e55f360cbe73724c12e0c4cf993460405161077391815260200190565b60405180910390a45050506107886001600355565b50505050565b60015460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa1580156107f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108199190611a5b565b10156108805760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b606482015260840161035f565b61088933610532565b156108ef5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b606482015260840161035f565b610788848484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610f9d92505050565b610938610b4e565b6001600160a01b03811661099d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161035f565b61051b81610ba8565b610530610b4e565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a329190611a5b565b60015490915081831115610aa25760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b606482015260840161035f565b808311610b175760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e00606482015260840161035f565b6001839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6002546001600160a01b031633146105305760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161035f565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260035403610c4c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161035f565b6002600355565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd89190611a74565b9050610ce381610532565b15610d495760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881cd95b991a5b99c81c185d5cd95960821b606482015260840161035f565b919050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015610d97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbb9190611a5b565b9050610dd26001600160a01b0385163330866111ab565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015610e19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3d9190611a5b565b9050818111610ea35760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b606482015260840161035f565b610ead8282611aa7565b925050505b92915050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d9190611a5b565b610f379190611aba565b6040516001600160a01b03851660248201526044810182905290915061078890859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111e3565b7f000000000000000000000000000000000000000000000000000000000000000083146110215760405162461bcd60e51b815260206004820152602c60248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420646573746960448201526b3730ba34b7b71031b430b4b760a11b606482015260840161035f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146110b15760405162461bcd60e51b815260206004820152602660248201527f4e6174697665546f6b656e536f757263653a20756e617574686f72697a65642060448201526539b2b73232b960d11b606482015260840161035f565b600080828060200190518101906110c89190611acd565b909250905060008260018111156110e1576110e1611b7b565b0361111257600080828060200190518101906110fd9190611b91565b9150915061110b82826112ba565b50506111a4565b600182600181111561112657611126611b7b565b03611152576000818060200190518101906111419190611a5b565b905061114c81611393565b506111a4565b60405162461bcd60e51b815260206004820152602160248201527f4e6174697665546f6b656e536f757263653a20696e76616c696420616374696f6044820152603760f91b606482015260840161035f565b5050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526107889085906323b872dd60e01b90608401610f66565b6000611238826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113be9092919063ffffffff16565b8051909150156112b557808060200190518101906112569190611bbf565b6112b55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161035f565b505050565b6001600160a01b0382166112e05760405162461bcd60e51b815260040161035f90611861565b804710156113435760405162461bcd60e51b815260206004820152602a60248201527f4e6174697665546f6b656e536f757263653a20696e73756666696369656e742060448201526918dbdb1b185d195c985b60b21b606482015260840161035f565b604080516001600160a01b0384168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb407910160405180910390a161138f82826113d5565b5050565b60045481111561051b576000600454826113ad9190611aa7565b90506113b8816114ee565b50600455565b60606113cd848460008561152f565b949350505050565b804710156114255760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161035f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611472576040519150601f19603f3d011682016040523d82523d6000602084013e611477565b606091505b50509050806112b55760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161035f565b6040518181527f2cd3fd70cd5a5d6d805e90d22741aa1a84590ace7cf01b244719558d266143829060200160405180910390a161051b600160981b826113d5565b6060824710156115905760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161035f565b600080866001600160a01b031685876040516115ac9190611be1565b60006040518083038185875af1925050503d80600081146115e9576040519150601f19603f3d011682016040523d82523d6000602084013e6115ee565b606091505b50915091506115ff8783838761160a565b979650505050505050565b60608315611679578251600003611672576001600160a01b0385163b6116725760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161035f565b50816113cd565b6113cd838381511561168e5781518083602001fd5b8060405162461bcd60e51b815260040161035f9190611bfd565b6001600160a01b038116811461051b57600080fd5b6000602082840312156116cf57600080fd5b81356116da816116a8565b9392505050565b6000602082840312156116f357600080fd5b5035919050565b600080600080848603608081121561171157600080fd5b853561171c816116a8565b94506040601f198201121561173057600080fd5b50602085019250606085013567ffffffffffffffff8082111561175257600080fd5b818701915087601f83011261176657600080fd5b81358181111561177557600080fd5b8860208260051b850101111561178a57600080fd5b95989497505060200194505050565b600080600080606085870312156117af57600080fd5b8435935060208501356117c1816116a8565b9250604085013567ffffffffffffffff808211156117de57600080fd5b818701915087601f8301126117f257600080fd5b81358181111561180157600080fd5b88602082850101111561178a57600080fd5b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b60208082526029908201527f4e6174697665546f6b656e536f757263653a207a65726f20726563697069656e60408201526874206164647265737360b81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156118e9576118e96118aa565b604052919050565b60006040828403121561190357600080fd5b6040516040810181811067ffffffffffffffff82111715611926576119266118aa565b6040528235611934816116a8565b81526020928301359281019290925250919050565b600081518084526020808501945080840160005b838110156119825781516001600160a01b03168752958201959082019060010161195d565b509495945050505050565b60005b838110156119a8578181015183820152602001611990565b50506000910152565b600081518084526119c981602086016020860161198d565b601f01601f19169290920160200192915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c0840152611a3e610100840182611949565b905060a0840151601f198483030160e0850152610ead82826119b1565b600060208284031215611a6d57600080fd5b5051919050565b600060208284031215611a8657600080fd5b81516116da816116a8565b634e487b7160e01b600052601160045260246000fd5b81810381811115610eb257610eb2611a91565b80820180821115610eb257610eb2611a91565b60008060408385031215611ae057600080fd5b825160028110611aef57600080fd5b602084015190925067ffffffffffffffff80821115611b0d57600080fd5b818501915085601f830112611b2157600080fd5b815181811115611b3357611b336118aa565b611b46601f8201601f19166020016118c0565b9150808252866020828501011115611b5d57600080fd5b611b6e81602084016020860161198d565b5080925050509250929050565b634e487b7160e01b600052602160045260246000fd5b60008060408385031215611ba457600080fd5b8251611baf816116a8565b6020939093015192949293505050565b600060208284031215611bd157600080fd5b815180151581146116da57600080fd5b60008251611bf381846020870161198d565b9190910192915050565b6020815260006116da60208301846119b156fea2646970667358221220ea5960c866d92d97d6ab7663fc24c29ca031b791365d46be138ed5cff4289bd564736f6c634300081200334e6174697665546f6b656e536f757263653a207a65726f2064657374696e6174", } // NativeTokenSourceABI is the input ABI used to generate the binding from. @@ -1433,15 +1433,15 @@ func (it *NativeTokenSourceTransferToDestinationIterator) Close() error { type NativeTokenSourceTransferToDestination struct { Sender common.Address Recipient common.Address - TeleporterMessageID *big.Int + TeleporterMessageID [32]byte Amount *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterTransferToDestination is a free log retrieval operation binding the contract event 0x2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a. +// FilterTransferToDestination is a free log retrieval operation binding the contract event 0x6cf14fdf618c440df3de7de7dcacf59541a464e55f360cbe73724c12e0c4cf99. // -// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, uint256 indexed teleporterMessageID, uint256 amount) -func (_NativeTokenSource *NativeTokenSourceFilterer) FilterTransferToDestination(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address, teleporterMessageID []*big.Int) (*NativeTokenSourceTransferToDestinationIterator, error) { +// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, bytes32 indexed teleporterMessageID, uint256 amount) +func (_NativeTokenSource *NativeTokenSourceFilterer) FilterTransferToDestination(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address, teleporterMessageID [][32]byte) (*NativeTokenSourceTransferToDestinationIterator, error) { var senderRule []interface{} for _, senderItem := range sender { @@ -1463,10 +1463,10 @@ func (_NativeTokenSource *NativeTokenSourceFilterer) FilterTransferToDestination return &NativeTokenSourceTransferToDestinationIterator{contract: _NativeTokenSource.contract, event: "TransferToDestination", logs: logs, sub: sub}, nil } -// WatchTransferToDestination is a free log subscription operation binding the contract event 0x2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a. +// WatchTransferToDestination is a free log subscription operation binding the contract event 0x6cf14fdf618c440df3de7de7dcacf59541a464e55f360cbe73724c12e0c4cf99. // -// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, uint256 indexed teleporterMessageID, uint256 amount) -func (_NativeTokenSource *NativeTokenSourceFilterer) WatchTransferToDestination(opts *bind.WatchOpts, sink chan<- *NativeTokenSourceTransferToDestination, sender []common.Address, recipient []common.Address, teleporterMessageID []*big.Int) (event.Subscription, error) { +// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, bytes32 indexed teleporterMessageID, uint256 amount) +func (_NativeTokenSource *NativeTokenSourceFilterer) WatchTransferToDestination(opts *bind.WatchOpts, sink chan<- *NativeTokenSourceTransferToDestination, sender []common.Address, recipient []common.Address, teleporterMessageID [][32]byte) (event.Subscription, error) { var senderRule []interface{} for _, senderItem := range sender { @@ -1513,9 +1513,9 @@ func (_NativeTokenSource *NativeTokenSourceFilterer) WatchTransferToDestination( }), nil } -// ParseTransferToDestination is a log parse operation binding the contract event 0x2b4e8f08417773e367064a6aea9ca2df303a60876676f70b6c3c5e66b314ca5a. +// ParseTransferToDestination is a log parse operation binding the contract event 0x6cf14fdf618c440df3de7de7dcacf59541a464e55f360cbe73724c12e0c4cf99. // -// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, uint256 indexed teleporterMessageID, uint256 amount) +// Solidity: event TransferToDestination(address indexed sender, address indexed recipient, bytes32 indexed teleporterMessageID, uint256 amount) func (_NativeTokenSource *NativeTokenSourceFilterer) ParseTransferToDestination(log types.Log) (*NativeTokenSourceTransferToDestination, error) { event := new(NativeTokenSourceTransferToDestination) if err := _NativeTokenSource.contract.UnpackLog(event, "TransferToDestination", log); err != nil { diff --git a/abi-bindings/go/CrossChainApplications/examples/VerifiedBlockHash/BlockHashPublisher/BlockHashPublisher.go b/abi-bindings/go/CrossChainApplications/examples/VerifiedBlockHash/BlockHashPublisher/BlockHashPublisher.go index 1ebe9a439..8d3c3d1c5 100644 --- a/abi-bindings/go/CrossChainApplications/examples/VerifiedBlockHash/BlockHashPublisher/BlockHashPublisher.go +++ b/abi-bindings/go/CrossChainApplications/examples/VerifiedBlockHash/BlockHashPublisher/BlockHashPublisher.go @@ -31,8 +31,8 @@ var ( // BlockHashPublisherMetaData contains all meta data concerning the BlockHashPublisher contract. var BlockHashPublisherMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"PublishBlockHash\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"RECEIVE_BLOCK_HASH_REQUIRED_GAS_LIMIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"}],\"name\":\"publishLatestBlockHash\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60a060405234801561001057600080fd5b506040516105cf3803806105cf83398101604081905261002f916100c0565b6001600160a01b0381166100af5760405162461bcd60e51b815260206004820152603460248201527f426c6f636b486173685075626c69736865723a207a65726f2074656c65706f7260448201527f7465722072656769737472792061646472657373000000000000000000000000606482015260840160405180910390fd5b6001600160a01b03166080526100f0565b6000602082840312156100d257600080fd5b81516001600160a01b03811681146100e957600080fd5b9392505050565b6080516104be610111600039600081816068015261012701526104be6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806318aef19b146100465780631a7f5bec1461006357806382ab2b86146100a2575b600080fd5b610050620249f081565b6040519081526020015b60405180910390f35b61008a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161005a565b6100506100b03660046102d3565b6000806100be600143610303565b6040805160208101839052824081830181905282518083038401815260608301938490529281905292935083906001600160a01b0387169088907fe13623d33d18131ce960c33b1282ceac1fe7b5ccfcf7f8c0f6dad32dd61e3bdd9060800160405180910390a47f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610183573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a79190610324565b6001600160a01b031663624488506040518060c00160405280898152602001886001600160a01b03168152602001604051806040016040528060006001600160a01b0316815260200160008152508152602001620249f08152602001600067ffffffffffffffff81111561021d5761021d610348565b604051908082528060200260200182016040528015610246578160200160208202803683370190505b508152602001848152506040518263ffffffff1660e01b815260040161026c91906103e8565b6020604051808303816000875af115801561028b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102af919061046f565b93505050505b92915050565b6001600160a01b03811681146102d057600080fd5b50565b600080604083850312156102e657600080fd5b8235915060208301356102f8816102bb565b809150509250929050565b818103818111156102b557634e487b7160e01b600052601160045260246000fd5b60006020828403121561033657600080fd5b8151610341816102bb565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600081518084526020808501945080840160005b838110156103975781516001600160a01b031687529582019590820190600101610372565b509495945050505050565b6000815180845260005b818110156103c8576020818501810151868301820152016103ac565b506000602082860101526020601f19601f83011685010191505092915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c084015261044961010084018261035e565b905060a0840151601f198483030160e085015261046682826103a2565b95945050505050565b60006020828403121561048157600080fd5b505191905056fea2646970667358221220be23ed36673afe24d2158ea7d983ddd66ef5c730d74a6ed726e6b40206969ae264736f6c63430008120033", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"PublishBlockHash\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"RECEIVE_BLOCK_HASH_REQUIRED_GAS_LIMIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"}],\"name\":\"publishLatestBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60a060405234801561001057600080fd5b506040516105cf3803806105cf83398101604081905261002f916100c0565b6001600160a01b0381166100af5760405162461bcd60e51b815260206004820152603460248201527f426c6f636b486173685075626c69736865723a207a65726f2074656c65706f7260448201527f7465722072656769737472792061646472657373000000000000000000000000606482015260840160405180910390fd5b6001600160a01b03166080526100f0565b6000602082840312156100d257600080fd5b81516001600160a01b03811681146100e957600080fd5b9392505050565b6080516104be610111600039600081816068015261012701526104be6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806318aef19b146100465780631a7f5bec1461006357806382ab2b86146100a2575b600080fd5b610050620249f081565b6040519081526020015b60405180910390f35b61008a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161005a565b6100506100b03660046102d3565b6000806100be600143610303565b6040805160208101839052824081830181905282518083038401815260608301938490529281905292935083906001600160a01b0387169088907fe13623d33d18131ce960c33b1282ceac1fe7b5ccfcf7f8c0f6dad32dd61e3bdd9060800160405180910390a47f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d820e64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610183573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a79190610324565b6001600160a01b031663624488506040518060c00160405280898152602001886001600160a01b03168152602001604051806040016040528060006001600160a01b0316815260200160008152508152602001620249f08152602001600067ffffffffffffffff81111561021d5761021d610348565b604051908082528060200260200182016040528015610246578160200160208202803683370190505b508152602001848152506040518263ffffffff1660e01b815260040161026c91906103e8565b6020604051808303816000875af115801561028b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102af919061046f565b93505050505b92915050565b6001600160a01b03811681146102d057600080fd5b50565b600080604083850312156102e657600080fd5b8235915060208301356102f8816102bb565b809150509250929050565b818103818111156102b557634e487b7160e01b600052601160045260246000fd5b60006020828403121561033657600080fd5b8151610341816102bb565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600081518084526020808501945080840160005b838110156103975781516001600160a01b031687529582019590820190600101610372565b509495945050505050565b6000815180845260005b818110156103c8576020818501810151868301820152016103ac565b506000602082860101526020601f19601f83011685010191505092915050565b60208152815160208201526000602083015160018060a01b03808216604085015260408501519150808251166060850152506020810151608084015250606083015160a0830152608083015160e060c084015261044961010084018261035e565b905060a0840151601f198483030160e085015261046682826103a2565b95945050505050565b60006020828403121561048157600080fd5b505191905056fea264697066735822122095fdecf298b7da5997dfedba8e3431b48287e7609185c10b0c01810ae796e5ad64736f6c63430008120033", } // BlockHashPublisherABI is the input ABI used to generate the binding from. @@ -266,21 +266,21 @@ func (_BlockHashPublisher *BlockHashPublisherCallerSession) TeleporterRegistry() // PublishLatestBlockHash is a paid mutator transaction binding the contract method 0x82ab2b86. // -// Solidity: function publishLatestBlockHash(bytes32 destinationBlockchainID, address destinationAddress) returns(uint256) +// Solidity: function publishLatestBlockHash(bytes32 destinationBlockchainID, address destinationAddress) returns(bytes32) func (_BlockHashPublisher *BlockHashPublisherTransactor) PublishLatestBlockHash(opts *bind.TransactOpts, destinationBlockchainID [32]byte, destinationAddress common.Address) (*types.Transaction, error) { return _BlockHashPublisher.contract.Transact(opts, "publishLatestBlockHash", destinationBlockchainID, destinationAddress) } // PublishLatestBlockHash is a paid mutator transaction binding the contract method 0x82ab2b86. // -// Solidity: function publishLatestBlockHash(bytes32 destinationBlockchainID, address destinationAddress) returns(uint256) +// Solidity: function publishLatestBlockHash(bytes32 destinationBlockchainID, address destinationAddress) returns(bytes32) func (_BlockHashPublisher *BlockHashPublisherSession) PublishLatestBlockHash(destinationBlockchainID [32]byte, destinationAddress common.Address) (*types.Transaction, error) { return _BlockHashPublisher.Contract.PublishLatestBlockHash(&_BlockHashPublisher.TransactOpts, destinationBlockchainID, destinationAddress) } // PublishLatestBlockHash is a paid mutator transaction binding the contract method 0x82ab2b86. // -// Solidity: function publishLatestBlockHash(bytes32 destinationBlockchainID, address destinationAddress) returns(uint256) +// Solidity: function publishLatestBlockHash(bytes32 destinationBlockchainID, address destinationAddress) returns(bytes32) func (_BlockHashPublisher *BlockHashPublisherTransactorSession) PublishLatestBlockHash(destinationBlockchainID [32]byte, destinationAddress common.Address) (*types.Transaction, error) { return _BlockHashPublisher.Contract.PublishLatestBlockHash(&_BlockHashPublisher.TransactOpts, destinationBlockchainID, destinationAddress) } diff --git a/abi-bindings/go/CrossChainApplications/examples/VerifiedBlockHash/BlockHashReceiver/BlockHashReceiver.go b/abi-bindings/go/CrossChainApplications/examples/VerifiedBlockHash/BlockHashReceiver/BlockHashReceiver.go index 3039b9b15..d1c26f1e6 100644 --- a/abi-bindings/go/CrossChainApplications/examples/VerifiedBlockHash/BlockHashReceiver/BlockHashReceiver.go +++ b/abi-bindings/go/CrossChainApplications/examples/VerifiedBlockHash/BlockHashReceiver/BlockHashReceiver.go @@ -32,7 +32,7 @@ var ( // BlockHashReceiverMetaData contains all meta data concerning the BlockHashReceiver contract. var BlockHashReceiverMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"publisherBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"publisherContractAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldMinTeleporterVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newMinTeleporterVersion\",\"type\":\"uint256\"}],\"name\":\"MinTeleporterVersionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"ReceiveBlockHash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"TeleporterAddressUnpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getLatestBlockInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinTeleporterVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"isTeleporterAddressPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestBlockHeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"pauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourceBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourcePublisherContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterRegistry\",\"outputs\":[{\"internalType\":\"contractTeleporterRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterAddress\",\"type\":\"address\"}],\"name\":\"unpauseTeleporterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"updateMinTeleporterVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60e060405234801561001057600080fd5b50604051610eaf380380610eaf83398101604081905261002f916101b3565b82806001600160a01b0381166100b15760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f727465722072656769737472792061646472657373000000000000000000606482015260840160405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa1580156100fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011f91906101ef565b6001555061012c33610145565b5060a0919091526001600160a01b031660c05250610208565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146101ae57600080fd5b919050565b6000806000606084860312156101c857600080fd5b6101d184610197565b9250602084015191506101e660408501610197565b90509250925092565b60006020828403121561020157600080fd5b5051919050565b60805160a05160c051610c5d610252600039600081816101c401526109ac015260008181610143015261092a01526000818160ff015281816104c401526106e00152610c5d6000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806379a0710c11610097578063c868efaa11610066578063c868efaa1461024e578063d2cc7a7014610261578063f2fde38b14610269578063f3f39ee51461027c57600080fd5b806379a0710c146101bf5780638da5cb5b146101e657806397314297146101f7578063b17810be1461023357600080fd5b80634511243e116100d35780634511243e146101885780635eb995141461019b5780636c4f6ba9146101ae578063715018a6146101b757600080fd5b80631a7f5bec146100fa57806329b7b3fd1461013e5780632b0d8f1814610173575b600080fd5b6101217f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101657f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610135565b610186610181366004610ada565b610285565b005b610186610196366004610ada565b610387565b6101866101a9366004610afc565b610484565b61016560045481565b610186610498565b6101217f000000000000000000000000000000000000000000000000000000000000000081565b6002546001600160a01b0316610121565b610223610205366004610ada565b6001600160a01b031660009081526020819052604090205460ff1690565b6040519015158152602001610135565b60035460045460408051928352602083019190915201610135565b61018661025c366004610b15565b6104ac565b600154610165565b610186610277366004610ada565b61065e565b61016560035481565b61028d6106d4565b6001600160a01b0381166102bc5760405162461bcd60e51b81526004016102b390610b9c565b60405180910390fd5b6001600160a01b03811660009081526020819052604090205460ff161561033b5760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b60648201526084016102b3565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b61038f6106d4565b6001600160a01b0381166103b55760405162461bcd60e51b81526004016102b390610b9c565b6001600160a01b03811660009081526020819052604090205460ff1661042f5760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b60648201526084016102b3565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152602081905260409020805460ff19169055565b61048c6106d4565b610495816106dc565b50565b6104a061087c565b6104aa60006108d6565b565b60015460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa158015610513573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105379190610bea565b101561059e5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b60648201526084016102b3565b3360009081526020819052604090205460ff16156106175760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b60648201526084016102b3565b610658848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061092892505050565b50505050565b61066661087c565b6001600160a01b0381166106cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102b3565b610495816108d6565b6104aa61087c565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107609190610bea565b600154909150818311156107d05760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b60648201526084016102b3565b8083116108455760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e0060648201526084016102b3565b6001839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6002546001600160a01b031633146104aa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102b3565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b7f000000000000000000000000000000000000000000000000000000000000000083146109aa5760405162461bcd60e51b815260206004820152602a60248201527f426c6f636b4861736852656365697665723a20696e76616c696420736f757263604482015269194818da185a5b88125160b21b60648201526084016102b3565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614610a455760405162461bcd60e51b815260206004820152603160248201527f426c6f636b4861736852656365697665723a20696e76616c696420736f757263604482015270329031b430b4b710383ab13634b9b432b960791b60648201526084016102b3565b60008082806020019051810190610a5c9190610c03565b91509150600354821115610ab7576003829055600481905560405181815282906001600160a01b0386169087907f0bca78aa82d7575f42e4b4b2fe04765a4b2f3661786403788ce987e065ac590d9060200160405180910390a45b5050505050565b80356001600160a01b0381168114610ad557600080fd5b919050565b600060208284031215610aec57600080fd5b610af582610abe565b9392505050565b600060208284031215610b0e57600080fd5b5035919050565b60008060008060608587031215610b2b57600080fd5b84359350610b3b60208601610abe565b9250604085013567ffffffffffffffff80821115610b5857600080fd5b818701915087601f830112610b6c57600080fd5b813581811115610b7b57600080fd5b886020828501011115610b8d57600080fd5b95989497505060200194505050565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b600060208284031215610bfc57600080fd5b5051919050565b60008060408385031215610c1657600080fd5b50508051602090910151909290915056fea2646970667358221220bd0f2269ac029448dc5ac2776292a4baf2bad0c2dde0c35570947d800f38333e64736f6c63430008120033", + Bin: "0x60e060405234801561001057600080fd5b50604051610eaf380380610eaf83398101604081905261002f916101b3565b82806001600160a01b0381166100b15760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465725570677261646561626c653a207a65726f2074656c6560448201527f706f727465722072656769737472792061646472657373000000000000000000606482015260840160405180910390fd5b6001600160a01b03811660808190526040805163301fd1f560e21b8152905163c07f47d4916004808201926020929091908290030181865afa1580156100fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011f91906101ef565b6001555061012c33610145565b5060a0919091526001600160a01b031660c05250610208565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146101ae57600080fd5b919050565b6000806000606084860312156101c857600080fd5b6101d184610197565b9250602084015191506101e660408501610197565b90509250925092565b60006020828403121561020157600080fd5b5051919050565b60805160a05160c051610c5d610252600039600081816101c401526109ac015260008181610143015261092a01526000818160ff015281816104c401526106e00152610c5d6000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806379a0710c11610097578063c868efaa11610066578063c868efaa1461024e578063d2cc7a7014610261578063f2fde38b14610269578063f3f39ee51461027c57600080fd5b806379a0710c146101bf5780638da5cb5b146101e657806397314297146101f7578063b17810be1461023357600080fd5b80634511243e116100d35780634511243e146101885780635eb995141461019b5780636c4f6ba9146101ae578063715018a6146101b757600080fd5b80631a7f5bec146100fa57806329b7b3fd1461013e5780632b0d8f1814610173575b600080fd5b6101217f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101657f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610135565b610186610181366004610ada565b610285565b005b610186610196366004610ada565b610387565b6101866101a9366004610afc565b610484565b61016560045481565b610186610498565b6101217f000000000000000000000000000000000000000000000000000000000000000081565b6002546001600160a01b0316610121565b610223610205366004610ada565b6001600160a01b031660009081526020819052604090205460ff1690565b6040519015158152602001610135565b60035460045460408051928352602083019190915201610135565b61018661025c366004610b15565b6104ac565b600154610165565b610186610277366004610ada565b61065e565b61016560035481565b61028d6106d4565b6001600160a01b0381166102bc5760405162461bcd60e51b81526004016102b390610b9c565b60405180910390fd5b6001600160a01b03811660009081526020819052604090205460ff161561033b5760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465725570677261646561626c653a2061646472657373206160448201526c1b1c9958591e481c185d5cd959609a1b60648201526084016102b3565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f933f93e57a222e6330362af8b376d0a8725b6901e9a2fb86d00f169702b28a4c9190a250565b61038f6106d4565b6001600160a01b0381166103b55760405162461bcd60e51b81526004016102b390610b9c565b6001600160a01b03811660009081526020819052604090205460ff1661042f5760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465725570677261646561626c653a2061646472657373206e6044820152681bdd081c185d5cd95960ba1b60648201526084016102b3565b6040516001600160a01b038216907f844e2f3154214672229235858fd029d1dfd543901c6d05931f0bc2480a2d72c390600090a26001600160a01b03166000908152602081905260409020805460ff19169055565b61048c6106d4565b610495816106dc565b50565b6104a061087c565b6104aa60006108d6565b565b60015460405163260f846760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634c1f08ce90602401602060405180830381865afa158015610513573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105379190610bea565b101561059e5760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201526f32b632b837b93a32b91039b2b73232b960811b60648201526084016102b3565b3360009081526020819052604090205460ff16156106175760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465725570677261646561626c653a2054656c65706f72746560448201526f1c881859191c995cdcc81c185d5cd95960821b60648201526084016102b3565b610658848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061092892505050565b50505050565b61066661087c565b6001600160a01b0381166106cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102b3565b610495816108d6565b6104aa61087c565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c07f47d46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107609190610bea565b600154909150818311156107d05760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465725570677261646561626c653a20696e76616c6964205460448201527032b632b837b93a32b9103b32b939b4b7b760791b60648201526084016102b3565b8083116108455760405162461bcd60e51b815260206004820152603f60248201527f54656c65706f727465725570677261646561626c653a206e6f7420677265617460448201527f6572207468616e2063757272656e74206d696e696d756d2076657273696f6e0060648201526084016102b3565b6001839055604051839082907fa9a7ef57e41f05b4c15480842f5f0c27edfcbb553fed281f7c4068452cc1c02d90600090a3505050565b6002546001600160a01b031633146104aa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102b3565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b7f000000000000000000000000000000000000000000000000000000000000000083146109aa5760405162461bcd60e51b815260206004820152602a60248201527f426c6f636b4861736852656365697665723a20696e76616c696420736f757263604482015269194818da185a5b88125160b21b60648201526084016102b3565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614610a455760405162461bcd60e51b815260206004820152603160248201527f426c6f636b4861736852656365697665723a20696e76616c696420736f757263604482015270329031b430b4b710383ab13634b9b432b960791b60648201526084016102b3565b60008082806020019051810190610a5c9190610c03565b91509150600354821115610ab7576003829055600481905560405181815282906001600160a01b0386169087907f0bca78aa82d7575f42e4b4b2fe04765a4b2f3661786403788ce987e065ac590d9060200160405180910390a45b5050505050565b80356001600160a01b0381168114610ad557600080fd5b919050565b600060208284031215610aec57600080fd5b610af582610abe565b9392505050565b600060208284031215610b0e57600080fd5b5035919050565b60008060008060608587031215610b2b57600080fd5b84359350610b3b60208601610abe565b9250604085013567ffffffffffffffff80821115610b5857600080fd5b818701915087601f830112610b6c57600080fd5b813581811115610b7b57600080fd5b886020828501011115610b8d57600080fd5b95989497505060200194505050565b6020808252602e908201527f54656c65706f727465725570677261646561626c653a207a65726f2054656c6560408201526d706f72746572206164647265737360901b606082015260800190565b600060208284031215610bfc57600080fd5b5051919050565b60008060408385031215610c1657600080fd5b50508051602090910151909290915056fea264697066735822122014d327392c6478d764c3528fb7fb6d95dcbe558ce7d5c3b66adac4c5fc5560bf64736f6c63430008120033", } // BlockHashReceiverABI is the input ABI used to generate the binding from. diff --git a/abi-bindings/go/Teleporter/TeleporterMessenger/TeleporterMessenger.go b/abi-bindings/go/Teleporter/TeleporterMessenger/TeleporterMessenger.go index c27ca6275..191d6483b 100644 --- a/abi-bindings/go/Teleporter/TeleporterMessenger/TeleporterMessenger.go +++ b/abi-bindings/go/Teleporter/TeleporterMessenger/TeleporterMessenger.go @@ -37,7 +37,7 @@ type TeleporterFeeInfo struct { // TeleporterMessage is an auto generated low-level Go binding around an user-defined struct. type TeleporterMessage struct { - MessageID *big.Int + MessageNonce *big.Int SenderAddress common.Address DestinationBlockchainID [32]byte DestinationAddress common.Address @@ -59,14 +59,14 @@ type TeleporterMessageInput struct { // TeleporterMessageReceipt is an auto generated low-level Go binding around an user-defined struct. type TeleporterMessageReceipt struct { - ReceivedMessageID *big.Int + ReceivedMessageNonce *big.Int RelayerRewardAddress common.Address } // TeleporterMessengerMetaData contains all meta data concerning the TeleporterMessenger contract. var TeleporterMessengerMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"updatedFeeInfo\",\"type\":\"tuple\"}],\"name\":\"AddFeeAmount\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"MessageExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"MessageExecutionFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"deliverer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"rewardRedeemer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"ReceiveCrossChainMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"RelayerRewardsRedeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"}],\"name\":\"SendCrossChainMessage\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"WARP_MESSENGER\",\"outputs\":[{\"internalType\":\"contractIWarpMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"additionalFeeAmount\",\"type\":\"uint256\"}],\"name\":\"addFeeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeAsset\",\"type\":\"address\"}],\"name\":\"checkRelayerRewardAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"getFeeInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"getMessageHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"getNextMessageID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getReceiptAtIndex\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"getReceiptQueueSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"getRelayerRewardAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"latestMessageIDs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"messageReceived\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"receiptQueues\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"first\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"last\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"messageIndex\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"name\":\"receiveCrossChainMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"receivedFailedMessageHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeAsset\",\"type\":\"address\"}],\"name\":\"redeemRelayerRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"retryMessageExecution\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"retrySendCrossChainMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structTeleporterMessageInput\",\"name\":\"messageInput\",\"type\":\"tuple\"}],\"name\":\"sendCrossChainMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"messageIDs\",\"type\":\"uint256[]\"},{\"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\":\"sendSpecifiedReceipts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"sentMessageInfo\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b50600160008190558055613050806100296000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c8063892bf412116100b8578063ccb5f8091161007c578063ccb5f80914610366578063d127dc9b14610379578063df20e8bc14610382578063e03555df14610395578063e6e67bd5146103b8578063fc2d6197146103f457600080fd5b8063892bf412146102c1578063af402850146102e1578063b771b3bc146102f4578063c473eef814610302578063c9bb11431461033b57600080fd5b80632bc8b0bf116100ff5780632bc8b0bf146101bd57806333e890fe146101d0578063624488501461021c57806366533d121461022f57806382f2c43a1461028f57600080fd5b8063191eb6981461013c57806319570c7414610162578063220c95681461017757806322296c3a1461018a57806329ec9beb1461019d575b600080fd5b61014f61014a3660046120cb565b610407565b6040519081526020015b60405180910390f35b61017561017036600461218b565b61062a565b005b61014f6101853660046121ca565b610865565b6101756101983660046121ec565b610886565b61014f6101ab366004612209565b60036020526000908152604090205481565b61014f6101cb366004612209565b61097b565b6102046101de3660046121ca565b60009182526007602090815260408084209284529190529020546001600160a01b031690565b6040516001600160a01b039091168152602001610159565b61014f61022a366004612222565b610992565b61028161023d3660046121ca565b60056020908152600092835260408084208252918352918190208054825180840190935260018201546001600160a01b031683526002909101549282019290925282565b60405161015992919061225c565b6102a261029d3660046121ca565b6109f0565b604080516001600160a01b039093168352602083019190915201610159565b6102d46102cf3660046121ca565b610a39565b6040516101599190612283565b6101756102ef3660046122a3565b610a6c565b6102046005600160991b0181565b61014f6103103660046122f1565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b61014f6103493660046121ca565b600660209081526000928352604080842090915290825290205481565b61017561037436600461231f565b610c01565b61014f60025481565b61014f610390366004612209565b611112565b6103a86103a33660046121ca565b61111d565b6040519015158152602001610159565b6103df6103c6366004612209565b6004602052600090815260409020805460019091015482565b60408051928352602083019190915201610159565b6101756104023660046122a3565b611147565b60006001600054146104345760405162461bcd60e51b815260040161042b90612346565b60405180910390fd5b60026000908155856001600160401b0381111561045357610453612389565b60405190808252806020026020018201604052801561049857816020015b60408051808201909152600080825260208201528152602001906001900390816104715790505b50905060005b868110156105955760008888838181106104ba576104ba61239f565b60008d815260076020908152604080832093820295909501358083529290529290922054919250506001600160a01b0316806105475760405162461bcd60e51b815260206004820152602660248201527f54656c65706f727465724d657373656e6765723a2072656365697074206e6f7460448201526508199bdd5b9960d21b606482015260840161042b565b6040518060400160405280838152602001826001600160a01b03168152508484815181106105775761057761239f565b602002602001018190525050508061058e906123cb565b905061049e565b506040805160c081018252898152600060208201526106199181016105bf368990038901896124bc565b815260200160008152602001868680806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093855250506040805192835260208084019091529092015250826113a1565b600160005598975050505050505050565b60016000541461064c5760405162461bcd60e51b815260040161042b90612346565b6002600055806106b65760405162461bcd60e51b815260206004820152602f60248201527f54656c65706f727465724d657373656e6765723a207a65726f2061646469746960448201526e1bdb985b0819995948185b5bdd5b9d608a1b606482015260840161042b565b6001600160a01b0382166106dc5760405162461bcd60e51b815260040161042b906124d8565b60008481526005602090815260408083208684529091529020546107125760405162461bcd60e51b815260040161042b9061252c565b60008481526005602090815260408083208684529091529020600101546001600160a01b038381169116146107af5760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465724d657373656e6765723a20696e76616c69642066656560448201527f20617373657420636f6e74726163742061646472657373000000000000000000606482015260840161042b565b60006107bb83836115d3565b60008681526005602090815260408083208884529091528120600201805492935083929091906107ec908490612572565b90915550506000858152600560209081526040808320878452825291829020825160018201546001600160a01b0316815260029091015491810191909152859187917f28fe05eedf0479c9159e5b6dd2a28c93fa1a408eba22dc801fd9bc493a7fc0c2910160405180910390a350506001600055505050565b60008281526005602090815260408083208484529091529020545b92915050565b3360009081526008602090815260408083206001600160a01b0385168452909152902054806109085760405162461bcd60e51b815260206004820152602860248201527f54656c65706f727465724d657373656e6765723a206e6f2072657761726420746044820152676f2072656465656d60c01b606482015260840161042b565b3360008181526008602090815260408083206001600160a01b03871680855290835281842093909355518481529192917f3294c84e5b0f29d9803655319087207bc94f4db29f7927846944822773780b88910160405180910390a36109776001600160a01b038316338361173b565b5050565b6000818152600460205260408120610880906117a3565b60006001600054146109b65760405162461bcd60e51b815260040161042b90612346565b60026000556109e56109c783612694565b833560009081526004602052604090206109e0906117b6565b6113a1565b600160005592915050565b6000828152600560209081526040808320848452825291829020825180840190935260018101546001600160a01b031680845260029091015492909101829052905b9250929050565b60408051808201909152600080825260208201526000838152600460205260409020610a6590836118c5565b9392505050565b600160005414610a8e5760405162461bcd60e51b815260040161042b90612346565b60026000818155838152600560209081526040808320853584528252918290208251808401845281548152835180850190945260018201546001600160a01b03168452930154828201528201528051610af95760405162461bcd60e51b815260040161042b9061252c565b600082604051602001610b0c919061298c565b60408051601f1981840301815291905282518151602083012091925014610b455760405162461bcd60e51b815260040161042b9061299f565b8260000135847f0563d357b89128d5a0c37c9b06420836e35d193eaf17f7960fc88e47d1e02f57858560200151604051610b809291906129e8565b60405180910390a360405163ee5b48eb60e01b81526005600160991b019063ee5b48eb90610bb2908490600401612a6d565b6020604051808303816000875af1158015610bd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf59190612a80565b50506001600055505050565b6001805414610c225760405162461bcd60e51b815260040161042b90612a99565b60026001556001600160a01b038116610c965760405162461bcd60e51b815260206004820152603060248201527f54656c65706f727465724d657373656e6765723a207a65726f2072656c61796560448201526f7220726577617264206164647265737360801b606482015260840161042b565b6040516306f8253560e41b815263ffffffff8316600482015260009081906005600160991b0190636f82535090602401600060405180830381865afa158015610ce3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d0b9190810190612b3e565b9150915080610d6e5760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465724d657373656e6765723a20696e76616c69642077617260448201526870206d65737361676560b81b606482015260840161042b565b60208201516001600160a01b03163014610de55760405162461bcd60e51b815260206004820152603260248201527f54656c65706f727465724d657373656e6765723a20696e76616c6964206f726960448201527167696e2073656e646572206164647265737360701b606482015260840161042b565b60025480610e5e576005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e569190612a80565b600281905590505b60008360400151806020019051810190610e789190612cdb565b905081816040015114610ee75760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465724d657373656e6765723a20696e76616c6964206465736044820152701d1a5b985d1a5bdb8818da185a5b881251607a1b606482015260840161042b565b8351815160009182526007602090815260408084209284529190529020546001600160a01b031615610f725760405162461bcd60e51b815260206004820152602e60248201527f54656c65706f727465724d657373656e6765723a206d65737361676520616c7260448201526d1958591e4819195b1a5d995c995960921b606482015260840161042b565b610f80338260a0015161198a565b610fde5760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465724d657373656e6765723a20756e617574686f72697a6560448201526832103932b630bcb2b960b91b606482015260840161042b565b8351600090815260076020908152604080832084518452909152812080546001600160a01b0319166001600160a01b03881617905560c082015151905b8181101561106d5760008360c00151828151811061103b5761103b61239f565b6020026020010151905061105c8760000151826000015183602001516119ff565b50611066816123cb565b905061101b565b5084516000908152600460209081526040918290208251808401909352845183526001600160a01b03891691830191909152906110ab908290611acf565b82518651604051339291907f6b013241f9192863bc66c1f1e9a01dc592c94592bfed5e1ed380808525679575906110e5908c908990612eeb565b60405180910390a460e083015151156111045785516111049084611b2b565b505060018055505050505050565b600061088082611c5a565b60008281526007602090815260408083208484529091528120546001600160a01b03161515610a65565b60018054146111685760405162461bcd60e51b815260040161042b90612a99565b6002600155600082815260066020908152604080832084358452909152902054806111a55760405162461bcd60e51b815260040161042b9061252c565b80826040516020016111b7919061298c565b60405160208183030381529060405280519060200120146111ea5760405162461bcd60e51b815260040161042b9061299f565b60006111fc60808401606085016121ec565b6001600160a01b03163b116112705760405162461bcd60e51b815260206004820152603460248201527f54656c65706f727465724d657373656e6765723a2064657374696e6174696f6e604482015273206164647265737320686173206e6f20636f646560601b606482015260840161042b565b60405182359084907f5ad362d54cba0e49d358be9ce586a7136d10a2533579c4460b7e48ec273083ef90600090a3600083815260066020908152604080832085358452825280832083905585916112cb9186019086016121ec565b6112d860e0860186612f0f565b6040516024016112eb9493929190612f55565b60408051601f198184030181529190526020810180516001600160e01b031663643477d560e11b1790529050600061133361132c60808601606087016121ec565b5a84611c74565b9050806113965760405162461bcd60e51b815260206004820152602b60248201527f54656c65706f727465724d657373656e6765723a20726574727920657865637560448201526a1d1a5bdb8819985a5b195960aa1b606482015260840161042b565b505060018055505050565b6000806113b18460000151611c5a565b90506000604051806101000160405280838152602001336001600160a01b031681526020018660000151815260200186602001516001600160a01b0316815260200186606001518152602001866080015181526020018581526020018660a00151815250905060008160405160200161142a9190612f80565b60408051601f198184030181529181528751600090815260036020908152828220879055918901519091015191925090156114a4576040870151516001600160a01b031661148a5760405162461bcd60e51b815260040161042b906124d8565b604087015180516020909101516114a191906115d3565b90505b60408051808201825288820151516001600160a01b03908116825260208083018590528351808501855286518783012081528082018481528c516000908152600584528681208b82528452869020915182555180516001830180546001600160a01b031916919095161790935591015160029091015588519151909186917f0563d357b89128d5a0c37c9b06420836e35d193eaf17f7960fc88e47d1e02f57906115519088908690612f93565b60405180910390a360405163ee5b48eb60e01b81526005600160991b019063ee5b48eb90611583908690600401612a6d565b6020604051808303816000875af11580156115a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c69190612a80565b5093979650505050505050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa15801561161c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116409190612a80565b90506116576001600160a01b038516333086611c8e565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa15801561169e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c29190612a80565b90508181116117285760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b606482015260840161042b565b6117328282612fa6565b95945050505050565b6040516001600160a01b03831660248201526044810182905261179e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cc6565b505050565b8054600182015460009161088091612fa6565b606060006117cd60056117c8856117a3565b611d98565b90508060000361181c576040805160008082526020820190925290611814565b60408051808201909152600080825260208201528152602001906001900390816117ed5790505b509392505050565b806001600160401b0381111561183457611834612389565b60405190808252806020026020018201604052801561187957816020015b60408051808201909152600080825260208201528152602001906001900390816118525790505b50915060005b818110156118be5761189084611dae565b8382815181106118a2576118a261239f565b6020026020010181905250806118b7906123cb565b905061187f565b5050919050565b60408051808201909152600080825260208201526118e2836117a3565b821061193a5760405162461bcd60e51b815260206004820152602160248201527f5265636569707451756575653a20696e646578206f7574206f6620626f756e646044820152607360f81b606482015260840161042b565b8260020160008385600001546119509190612572565b81526020808201929092526040908101600020815180830190925280548252600101546001600160a01b0316918101919091529392505050565b6000815160000361199d57506001610880565b60005b82518110156119f557836001600160a01b03168382815181106119c5576119c561239f565b60200260200101516001600160a01b0316036119e5576001915050610880565b6119ee816123cb565b90506119a0565b5060009392505050565b60008381526005602090815260408083208584528252918290208251808401845281548152835180850190945260018201546001600160a01b0316845260029091015483830152908101919091528051611a595750505050565b600084815260056020908152604080832086845282528083208381556001810180546001600160a01b031916905560020183905583820180518301516001600160a01b0387811686526008855283862092515116855292528220805491929091611ac4908490612572565b909155505050505050565b6001820180548291600285019160009182611ae9836123cb565b90915550815260208082019290925260400160002082518155910151600190910180546001600160a01b0319166001600160a01b039092169190911790555050565b80608001515a1015611b8d5760405162461bcd60e51b815260206004820152602560248201527f54656c65706f727465724d657373656e6765723a20696e73756666696369656e604482015264742067617360d81b606482015260840161042b565b80606001516001600160a01b03163b600003611bad576109778282611e79565b602081015160e0820151604051600092611bcb928692602401612fb9565b60408051601f198184030181529190526020810180516001600160e01b031663643477d560e11b17905260608301516080840151919250600091611c10919084611c74565b905080611c2757611c218484611e79565b50505050565b825160405185907f5ad362d54cba0e49d358be9ce586a7136d10a2533579c4460b7e48ec273083ef90600090a350505050565b600081815260036020526040812054610880906001612572565b60008060008084516020860160008989f195945050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611c219085906323b872dd60e01b90608401611767565b6000611d1b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611ef79092919063ffffffff16565b80519091501561179e5780806020019051810190611d399190612fe3565b61179e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161042b565b6000818310611da75781610a65565b5090919050565b604080518082019091526000808252602082015281546001830154819003611e185760405162461bcd60e51b815260206004820152601960248201527f5265636569707451756575653a20656d70747920717565756500000000000000604482015260640161042b565b60008181526002840160208181526040808420815180830190925280548252600180820180546001600160a01b03811685870152888852959094529490556001600160a01b031990921690559250611e71908290612572565b909255919050565b80604051602001611e8a9190612f80565b60408051601f198184030181528282528051602091820120600086815260068352838120865182529092529190205581519083907fbedbbe6103cef0a6c9ecbf6aa23da414542c42d7918bea18aab8b601b2c3a44990611eeb908590612f80565b60405180910390a35050565b6060611f068484600085611f0e565b949350505050565b606082471015611f6f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161042b565b600080866001600160a01b03168587604051611f8b9190612ffe565b60006040518083038185875af1925050503d8060008114611fc8576040519150601f19603f3d011682016040523d82523d6000602084013e611fcd565b606091505b5091509150611fde87838387611fe9565b979650505050505050565b60608315612058578251600003612051576001600160a01b0385163b6120515760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161042b565b5081611f06565b611f06838381511561206d5781518083602001fd5b8060405162461bcd60e51b815260040161042b9190612a6d565b60008083601f84011261209957600080fd5b5081356001600160401b038111156120b057600080fd5b6020830191508360208260051b8501011115610a3257600080fd5b60008060008060008086880360a08112156120e557600080fd5b8735965060208801356001600160401b038082111561210357600080fd5b61210f8b838c01612087565b90985096508691506040603f198401121561212957600080fd5b60408a01955060808a013592508083111561214357600080fd5b505061215189828a01612087565b979a9699509497509295939492505050565b6001600160a01b038116811461217857600080fd5b50565b803561218681612163565b919050565b600080600080608085870312156121a157600080fd5b843593506020850135925060408501356121ba81612163565b9396929550929360600135925050565b600080604083850312156121dd57600080fd5b50508035926020909101359150565b6000602082840312156121fe57600080fd5b8135610a6581612163565b60006020828403121561221b57600080fd5b5035919050565b60006020828403121561223457600080fd5b81356001600160401b0381111561224a57600080fd5b820160e08185031215610a6557600080fd5b82815260608101610a65602083018480516001600160a01b03168252602090810151910152565b815181526020808301516001600160a01b03169082015260408101610880565b600080604083850312156122b657600080fd5b8235915060208301356001600160401b038111156122d357600080fd5b830161010081860312156122e657600080fd5b809150509250929050565b6000806040838503121561230457600080fd5b823561230f81612163565b915060208301356122e681612163565b6000806040838503121561233257600080fd5b823563ffffffff8116811461230f57600080fd5b60208082526023908201527f5265656e7472616e63794775617264733a2073656e646572207265656e7472616040820152626e637960e81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016123dd576123dd6123b5565b5060010190565b604080519081016001600160401b038111828210171561240657612406612389565b60405290565b60405160c081016001600160401b038111828210171561240657612406612389565b60405161010081016001600160401b038111828210171561240657612406612389565b604051601f8201601f191681016001600160401b038111828210171561247957612479612389565b604052919050565b60006040828403121561249357600080fd5b61249b6123e4565b905081356124a881612163565b808252506020820135602082015292915050565b6000604082840312156124ce57600080fd5b610a658383612481565b60208082526034908201527f54656c65706f727465724d657373656e6765723a207a65726f2066656520617360408201527373657420636f6e7472616374206164647265737360601b606082015260800190565b60208082526026908201527f54656c65706f727465724d657373656e6765723a206d657373616765206e6f7460408201526508199bdd5b9960d21b606082015260800190565b80820180821115610880576108806123b5565b60006001600160401b0382111561259e5761259e612389565b5060051b60200190565b600082601f8301126125b957600080fd5b813560206125ce6125c983612585565b612451565b82815260059290921b840181019181810190868411156125ed57600080fd5b8286015b8481101561261157803561260481612163565b83529183019183016125f1565b509695505050505050565b60006001600160401b0382111561263557612635612389565b50601f01601f191660200190565b600082601f83011261265457600080fd5b81356126626125c98261261c565b81815284602083860101111561267757600080fd5b816020850160208301376000918101602001919091529392505050565b600060e082360312156126a657600080fd5b6126ae61240c565b823581526126be6020840161217b565b60208201526126d03660408501612481565b60408201526080830135606082015260a08301356001600160401b03808211156126f957600080fd5b612705368387016125a8565b608084015260c085013591508082111561271e57600080fd5b5061272b36828601612643565b60a08301525092915050565b6000808335601e1984360301811261274e57600080fd5b83016020810192503590506001600160401b0381111561276d57600080fd5b8060051b3603821315610a3257600080fd5b8183526000602080850194508260005b858110156127bd5781356127a281612163565b6001600160a01b03168752958201959082019060010161278f565b509495945050505050565b6000808335601e198436030181126127df57600080fd5b83016020810192503590506001600160401b038111156127fe57600080fd5b8060061b3603821315610a3257600080fd5b8183526000602080850194508260005b858110156127bd57813587528282013561283981612163565b6001600160a01b0316878401526040968701969190910190600101612820565b6000808335601e1984360301811261287057600080fd5b83016020810192503590506001600160401b0381111561288f57600080fd5b803603821315610a3257600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006101008235845260208301356128de81612163565b6001600160a01b03166020850152604083810135908501526129026060840161217b565b6001600160a01b031660608501526080838101359085015261292760a0840184612737565b8260a087015261293a838701828461277f565b9250505061294b60c08401846127c8565b85830360c087015261295e838284612810565b9250505061296f60e0840184612859565b85830360e087015261298283828461289e565b9695505050505050565b602081526000610a6560208301846128c7565b60208082526029908201527f54656c65706f727465724d657373656e6765723a20696e76616c6964206d65736040820152680e6c2ceca40d0c2e6d60bb1b606082015260800190565b6060815260006129fb60608301856128c7565b9050610a65602083018480516001600160a01b03168252602090810151910152565b60005b83811015612a38578181015183820152602001612a20565b50506000910152565b60008151808452612a59816020860160208601612a1d565b601f01601f19169290920160200192915050565b602081526000610a656020830184612a41565b600060208284031215612a9257600080fd5b5051919050565b60208082526025908201527f5265656e7472616e63794775617264733a207265636569766572207265656e7460408201526472616e637960d81b606082015260800190565b805161218681612163565b600082601f830112612afa57600080fd5b8151612b086125c98261261c565b818152846020838601011115612b1d57600080fd5b611f06826020830160208701612a1d565b8051801515811461218657600080fd5b60008060408385031215612b5157600080fd5b82516001600160401b0380821115612b6857600080fd5b9084019060608287031215612b7c57600080fd5b604051606081018181108382111715612b9757612b97612389565b604052825181526020830151612bac81612163565b6020820152604083015182811115612bc357600080fd5b612bcf88828601612ae9565b6040830152509350612be691505060208401612b2e565b90509250929050565b600082601f830112612c0057600080fd5b81516020612c106125c983612585565b82815260059290921b84018101918181019086841115612c2f57600080fd5b8286015b84811015612611578051612c4681612163565b8352918301918301612c33565b600082601f830112612c6457600080fd5b81516020612c746125c983612585565b82815260069290921b84018101918181019086841115612c9357600080fd5b8286015b848110156126115760408189031215612cb05760008081fd5b612cb86123e4565b8151815284820151612cc981612163565b81860152835291830191604001612c97565b600060208284031215612ced57600080fd5b81516001600160401b0380821115612d0457600080fd5b908301906101008286031215612d1957600080fd5b612d2161242e565b82518152612d3160208401612ade565b602082015260408301516040820152612d4c60608401612ade565b60608201526080830151608082015260a083015182811115612d6d57600080fd5b612d7987828601612bef565b60a08301525060c083015182811115612d9157600080fd5b612d9d87828601612c53565b60c08301525060e083015182811115612db557600080fd5b612dc187828601612ae9565b60e08301525095945050505050565b600081518084526020808501945080840160005b838110156127bd5781516001600160a01b031687529582019590820190600101612de4565b600081518084526020808501945080840160005b838110156127bd57612e43878351805182526020908101516001600160a01b0316910152565b6040969096019590820190600101612e1d565b60006101008251845260018060a01b036020840151166020850152604083015160408501526060830151612e9560608601826001600160a01b03169052565b506080830151608085015260a08301518160a0860152612eb782860182612dd0565b91505060c083015184820360c0860152612ed18282612e09565b91505060e083015184820360e08601526117328282612a41565b6001600160a01b0383168152604060208201819052600090611f0690830184612e56565b6000808335601e19843603018112612f2657600080fd5b8301803591506001600160401b03821115612f4057600080fd5b602001915036819003821315610a3257600080fd5b8481526001600160a01b0384166020820152606060408201819052600090612982908301848661289e565b602081526000610a656020830184612e56565b6060815260006129fb6060830185612e56565b81810381811115610880576108806123b5565b8381526001600160a01b038316602082015260606040820181905260009061173290830184612a41565b600060208284031215612ff557600080fd5b610a6582612b2e565b60008251613010818460208701612a1d565b919091019291505056fea26469706673582212204b9bc3c80545c98c6c622e512f4ae3c7d35b8d5d6d9cd51523c9986f0c07cf3f64736f6c63430008120033", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"updatedFeeInfo\",\"type\":\"tuple\"}],\"name\":\"AddFeeAmount\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"blockchainID\",\"type\":\"bytes32\"}],\"name\":\"BlockchainIDInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"MessageExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"MessageExecutionFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"deliverer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"rewardRedeemer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"ReceiveCrossChainMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"RelayerRewardsRedeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"}],\"name\":\"SendCrossChainMessage\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"WARP_MESSENGER\",\"outputs\":[{\"internalType\":\"contractIWarpMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"additionalFeeAmount\",\"type\":\"uint256\"}],\"name\":\"addFeeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"calculateMessageID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeAsset\",\"type\":\"address\"}],\"name\":\"checkRelayerRewardAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"}],\"name\":\"getFeeInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"}],\"name\":\"getMessageHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"getNextMessageID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getReceiptAtIndex\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"getReceiptQueueSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"}],\"name\":\"getRelayerRewardAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initializeBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"}],\"name\":\"messageReceived\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID\",\"type\":\"bytes32\"}],\"name\":\"receiptQueues\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"first\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"last\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"messageIndex\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"name\":\"receiveCrossChainMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"}],\"name\":\"receivedFailedMessageHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeAsset\",\"type\":\"address\"}],\"name\":\"redeemRelayerRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"retryMessageExecution\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"retrySendCrossChainMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"destinationBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structTeleporterMessageInput\",\"name\":\"messageInput\",\"type\":\"tuple\"}],\"name\":\"sendCrossChainMessage\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"messageIDs\",\"type\":\"bytes32[]\"},{\"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\":\"sendSpecifiedReceipts\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"}],\"name\":\"sentMessageInfo\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6080604052600160035534801561001557600080fd5b506001600081905580556132978061002e6000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c8063a8898181116100c3578063df20e8bc1161007c578063df20e8bc1461033b578063e69d606a1461034e578063e6e67bd5146103b6578063ebc3b1ba146103f2578063ecc7042814610415578063fc2d61971461041e57600080fd5b8063a8898181146102b2578063a9a85614146102c5578063b771b3bc146102d8578063c473eef8146102e6578063ccb5f8091461031f578063d127dc9b1461033257600080fd5b8063399b77da11610115578063399b77da1461021957806362448850146102395780638245a1b01461024c578063860a3b061461025f578063892bf4121461027f5780638ac0fd041461029f57600080fd5b80630af5b4ff1461015257806322296c3a1461016d5780632bc8b0bf146101825780632ca40f55146101955780632e27c223146101ee575b600080fd5b61015a610431565b6040519081526020015b60405180910390f35b61018061017b366004612233565b610503565b005b61015a610190366004612250565b6105f8565b6101e06101a3366004612250565b6005602090815260009182526040918290208054835180850190945260018201546001600160a01b03168452600290910154918301919091529082565b604051610164929190612269565b6102016101fc366004612250565b610615565b6040516001600160a01b039091168152602001610164565b61015a610227366004612250565b60009081526005602052604090205490565b61015a610247366004612290565b61069e565b61018061025a3660046122e3565b6106fc565b61015a61026d366004612250565b60066020526000908152604090205481565b61029261028d366004612317565b6108a7565b6040516101649190612339565b6101806102ad366004612359565b6108da565b61015a6102c0366004612391565b610af0565b61015a6102d3366004612408565b610b33565b6102016005600160991b0181565b61015a6102f43660046124a0565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b61018061032d3660046124d9565b610dd8565b61015a60025481565b61015a610349366004612250565b611217565b61039761035c366004612250565b600090815260056020908152604091829020825180840190935260018101546001600160a01b03168084526002909101549290910182905291565b604080516001600160a01b039093168352602083019190915201610164565b6103dd6103c4366004612250565b6004602052600090815260409020805460019091015482565b60408051928352602083019190915201610164565b610405610400366004612250565b611247565b6040519015158152602001610164565b61015a60035481565b61018061042c366004612500565b61125d565b600254600090806104fe576005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610481573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a59190612546565b9050806104cd5760405162461bcd60e51b81526004016104c49061255f565b60405180910390fd5b600281905560405181907f1eac640109dc937d2a9f42735a05f794b39a5e3759d681951d671aabbce4b10490600090a25b919050565b3360009081526009602090815260408083206001600160a01b0385168452909152902054806105855760405162461bcd60e51b815260206004820152602860248201527f54656c65706f727465724d657373656e6765723a206e6f2072657761726420746044820152676f2072656465656d60c01b60648201526084016104c4565b3360008181526009602090815260408083206001600160a01b03871680855290835281842093909355518481529192917f3294c84e5b0f29d9803655319087207bc94f4db29f7927846944822773780b88910160405180910390a36105f46001600160a01b03831633836114b8565b5050565b600081815260046020526040812061060f90611520565b92915050565b6000818152600760205260408120546106825760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465724d657373656e6765723a206d657373616765206e6f74604482015268081c9958d95a5d995960ba1b60648201526084016104c4565b506000908152600860205260409020546001600160a01b031690565b60006001600054146106c25760405162461bcd60e51b81526004016104c4906125a6565b60026000556106f16106d3836127e6565b833560009081526004602052604090206106ec90611533565b611642565b600160005592915050565b60016000541461071e5760405162461bcd60e51b81526004016104c4906125a6565b6002600081815590546107379060408401358435610af0565b6000818152600560209081526040918290208251808401845281548152835180850190945260018201546001600160a01b03168452600290910154838301529081019190915280519192509061079f5760405162461bcd60e51b81526004016104c490612889565b6000836040516020016107b29190612b24565b60408051601f19818403018152919052825181516020830120919250146107eb5760405162461bcd60e51b81526004016104c490612b37565b8360400135837f2a211ad4a59ab9d003852404f9c57c690704ee755f3c79d2c2812ad32da99df8868560200151604051610826929190612b80565b60405180910390a360405163ee5b48eb60e01b81526005600160991b019063ee5b48eb90610858908490600401612c05565b6020604051808303816000875af1158015610877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089b9190612546565b50506001600055505050565b604080518082019091526000808252602082015260008381526004602052604090206108d39083611882565b9392505050565b6001600054146108fc5760405162461bcd60e51b81526004016104c4906125a6565b6002600055806109665760405162461bcd60e51b815260206004820152602f60248201527f54656c65706f727465724d657373656e6765723a207a65726f2061646469746960448201526e1bdb985b0819995948185b5bdd5b9d608a1b60648201526084016104c4565b6001600160a01b03821661098c5760405162461bcd60e51b81526004016104c490612c18565b6000838152600560205260409020546109b75760405162461bcd60e51b81526004016104c490612889565b6000838152600560205260409020600101546001600160a01b03838116911614610a495760405162461bcd60e51b815260206004820152603760248201527f54656c65706f727465724d657373656e6765723a20696e76616c69642066656560448201527f20617373657420636f6e7472616374206164647265737300000000000000000060648201526084016104c4565b6000610a558383611947565b600085815260056020526040812060020180549293508392909190610a7b908490612c82565b909155505060008481526005602052604090819020905185917fc1bfd1f1208927dfbd414041dcb5256e6c9ad90dd61aec3249facbd34ff7b3e191610add916001019081546001600160a01b0316815260019190910154602082015260400190565b60405180910390a2505060016000555050565b60408051306020820152908101849052606081018390526080810182905260009060a0016040516020818303038152906040528051906020012090509392505050565b6000600160005414610b575760405162461bcd60e51b81526004016104c4906125a6565b60026000818155905490866001600160401b03811115610b7957610b796125e9565b604051908082528060200260200182016040528015610bbe57816020015b6040805180820190915260008082526020820152815260200190600190039081610b975790505b50905060005b87811015610d42576000898983818110610be057610be0612c95565b90506020020135905060006007600083815260200190815260200160002054905080600003610c605760405162461bcd60e51b815260206004820152602660248201527f54656c65706f727465724d657373656e6765723a2072656365697074206e6f7460448201526508199bdd5b9960d21b60648201526084016104c4565b610c6b8c8683610af0565b8214610cdf5760405162461bcd60e51b815260206004820152603a60248201527f54656c65706f727465724d657373656e6765723a206d6573736167652049442060448201527f6e6f742066726f6d206f726967696e20626c6f636b636861696e00000000000060648201526084016104c4565b6000828152600860209081526040918290205482518084019093528383526001600160a01b03169082018190528551909190869086908110610d2357610d23612c95565b602002602001018190525050505080610d3b90612cab565b9050610bc4565b506040805160c0810182528a815260006020820152610dc6918101610d6c368a90038a018a612cc4565b81526020016000815260200187878080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509385525050604080519283526020808401909152909201525082611642565b60016000559998505050505050505050565b6001805414610df95760405162461bcd60e51b81526004016104c490612ce0565b60026001556040516306f8253560e41b815263ffffffff8316600482015260009081906005600160991b0190636f82535090602401600060405180830381865afa158015610e4b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e739190810190612d85565b9150915080610ed65760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465724d657373656e6765723a20696e76616c69642077617260448201526870206d65737361676560b81b60648201526084016104c4565b60208201516001600160a01b03163014610f4d5760405162461bcd60e51b815260206004820152603260248201527f54656c65706f727465724d657373656e6765723a20696e76616c6964206f726960448201527167696e2073656e646572206164647265737360701b60648201526084016104c4565b60008260400151806020019051810190610f679190612f22565b90506000610f73610431565b905080826040015114610fe25760405162461bcd60e51b815260206004820152603160248201527f54656c65706f727465724d657373656e6765723a20696e76616c6964206465736044820152701d1a5b985d1a5bdb8818da185a5b881251607a1b60648201526084016104c4565b83518251600091610ff4918490610af0565b600081815260076020526040902054909150156110695760405162461bcd60e51b815260206004820152602d60248201527f54656c65706f727465724d657373656e6765723a206d65737361676520616c7260448201526c1958591e481c9958d95a5d9959609a1b60648201526084016104c4565b611077338460a00151611aaf565b6110d55760405162461bcd60e51b815260206004820152602960248201527f54656c65706f727465724d657373656e6765723a20756e617574686f72697a6560448201526832103932b630bcb2b960b91b60648201526084016104c4565b6110e3818460000151611b24565b6001600160a01b0386161561111a57600081815260086020526040902080546001600160a01b0319166001600160a01b0388161790555b60c08301515160005b81811015611167576111578488600001518760c00151848151811061114a5761114a612c95565b6020026020010151611b96565b61116081612cab565b9050611123565b5085516000908152600460209081526040918290208251808401909352865183526001600160a01b038a1691830191909152906111a5908290611c71565b336001600160a01b03168760000151847f292ee90bbaf70b5d4936025e09d56ba08f3e421156b6a568cf3c2840d9343e348b896040516111e6929190613132565b60405180910390a460e085015151156112085761120883886000015187611ccd565b50506001805550505050505050565b6002546000908061123a5760405162461bcd60e51b81526004016104c49061255f565b6108d38184600354610af0565b600081815260076020526040812054151561060f565b600180541461127e5760405162461bcd60e51b81526004016104c490612ce0565b60026001819055546000906112969084908435610af0565b600081815260066020526040902054909150806112c55760405162461bcd60e51b81526004016104c490612889565b80836040516020016112d79190612b24565b604051602081830303815290604052805190602001201461130a5760405162461bcd60e51b81526004016104c490612b37565b600061131c6080850160608601612233565b6001600160a01b03163b116113905760405162461bcd60e51b815260206004820152603460248201527f54656c65706f727465724d657373656e6765723a2064657374696e6174696f6e604482015273206164647265737320686173206e6f20636f646560601b60648201526084016104c4565b604051849083907f34795cc6b122b9a0ae684946319f1e14a577b4e8f9b3dda9ac94c21a54d3188c90600090a3600082815260066020908152604080832083905586916113e1918701908701612233565b6113ee60e0870187613156565b604051602401611401949392919061319c565b60408051601f198184030181529190526020810180516001600160e01b031663643477d560e11b179052905060006114496114426080870160608801612233565b5a84611e00565b9050806114ac5760405162461bcd60e51b815260206004820152602b60248201527f54656c65706f727465724d657373656e6765723a20726574727920657865637560448201526a1d1a5bdb8819985a5b195960aa1b60648201526084016104c4565b50506001805550505050565b6040516001600160a01b03831660248201526044810182905261151b90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611e1a565b505050565b8054600182015460009161060f916131c7565b6060600061154a600561154585611520565b611eec565b905080600003611599576040805160008082526020820190925290611591565b604080518082019091526000808252602082015281526020019060019003908161156a5790505b509392505050565b806001600160401b038111156115b1576115b16125e9565b6040519080825280602002602001820160405280156115f657816020015b60408051808201909152600080825260208201528152602001906001900390816115cf5790505b50915060005b8181101561163b5761160d84611f02565b83828151811061161f5761161f612c95565b60200260200101819052508061163490612cab565b90506115fc565b5050919050565b60008061164d610431565b905060006003549050600061166783876000015184610af0565b90506000604051806101000160405280848152602001336001600160a01b031681526020018860000151815260200188602001516001600160a01b0316815260200188606001518152602001886080015181526020018781526020018860a0015181525090506000816040516020016116e091906131da565b604051602081830303815290604052905060036000815461170090612cab565b909155506040880151602001516000901561175a576040890151516001600160a01b03166117405760405162461bcd60e51b81526004016104c490612c18565b604089015180516020909101516117579190611947565b90505b6040805180820182528a820151516001600160a01b039081168252602080830185905283518085018552865187830120815280820184815260008a815260058452869020915182555180516001830180546001600160a01b03191691909516179093559101516002909101558a51915190919086907f2a211ad4a59ab9d003852404f9c57c690704ee755f3c79d2c2812ad32da99df8906117fe90889086906131ed565b60405180910390a360405163ee5b48eb60e01b81526005600160991b019063ee5b48eb90611830908690600401612c05565b6020604051808303816000875af115801561184f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118739190612546565b50939998505050505050505050565b604080518082019091526000808252602082015261189f83611520565b82106118f75760405162461bcd60e51b815260206004820152602160248201527f5265636569707451756575653a20696e646578206f7574206f6620626f756e646044820152607360f81b60648201526084016104c4565b82600201600083856000015461190d9190612c82565b81526020808201929092526040908101600020815180830190925280548252600101546001600160a01b0316918101919091529392505050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038516906370a0823190602401602060405180830381865afa158015611990573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b49190612546565b90506119cb6001600160a01b038516333086611fcd565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa158015611a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a369190612546565b9050818111611a9c5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016104c4565b611aa682826131c7565b95945050505050565b60008151600003611ac25750600161060f565b60005b8251811015611b1a57836001600160a01b0316838281518110611aea57611aea612c95565b60200260200101516001600160a01b031603611b0a57600191505061060f565b611b1381612cab565b9050611ac5565b5060009392505050565b80600003611b845760405162461bcd60e51b815260206004820152602760248201527f54656c65706f727465724d657373656e6765723a207a65726f206d657373616760448201526665206e6f6e636560c81b60648201526084016104c4565b60009182526007602052604090912055565b6000611ba784848460000151610af0565b6000818152600560209081526040918290208251808401845281548152835180850190945260018201546001600160a01b031684526002909101548383015290810191909152805191925090611bfe575050505050565b60008281526005602090815260408083208381556001810180546001600160a01b03191690556002018390558382018051830151878401516001600160a01b0390811686526009855283862092515116855292528220805491929091611c65908490612c82565b90915550505050505050565b6001820180548291600285019160009182611c8b83612cab565b90915550815260208082019290925260400160002082518155910151600190910180546001600160a01b0319166001600160a01b039092169190911790555050565b80608001515a1015611d2f5760405162461bcd60e51b815260206004820152602560248201527f54656c65706f727465724d657373656e6765723a20696e73756666696369656e604482015264742067617360d81b60648201526084016104c4565b80606001516001600160a01b03163b600003611d505761151b83838361200b565b602081015160e0820151604051600092611d6e928692602401613200565b60408051601f198184030181529190526020810180516001600160e01b031663643477d560e11b17905260608301516080840151919250600091611db3919084611e00565b905080611dcc57611dc585858561200b565b5050505050565b604051849086907f34795cc6b122b9a0ae684946319f1e14a577b4e8f9b3dda9ac94c21a54d3188c90600090a35050505050565b60008060008084516020860160008989f195945050505050565b6000611e6f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120809092919063ffffffff16565b80519091501561151b5780806020019051810190611e8d919061322a565b61151b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104c4565b6000818310611efb57816108d3565b5090919050565b604080518082019091526000808252602082015281546001830154819003611f6c5760405162461bcd60e51b815260206004820152601960248201527f5265636569707451756575653a20656d7074792071756575650000000000000060448201526064016104c4565b60008181526002840160208181526040808420815180830190925280548252600180820180546001600160a01b03811685870152888852959094529490556001600160a01b031990921690559250611fc5908290612c82565b909255919050565b6040516001600160a01b03808516602483015283166044820152606481018290526120059085906323b872dd60e01b906084016114e4565b50505050565b8060405160200161201c91906131da565b60408051601f1981840301815282825280516020918201206000878152600690925291902055829084907f4619adc1017b82e02eaefac01a43d50d6d8de4460774bc370c3ff0210d40c985906120739085906131da565b60405180910390a3505050565b606061208f8484600085612097565b949350505050565b6060824710156120f85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104c4565b600080866001600160a01b031685876040516121149190613245565b60006040518083038185875af1925050503d8060008114612151576040519150601f19603f3d011682016040523d82523d6000602084013e612156565b606091505b509150915061216787838387612172565b979650505050505050565b606083156121e15782516000036121da576001600160a01b0385163b6121da5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104c4565b508161208f565b61208f83838151156121f65781518083602001fd5b8060405162461bcd60e51b81526004016104c49190612c05565b6001600160a01b038116811461222557600080fd5b50565b80356104fe81612210565b60006020828403121561224557600080fd5b81356108d381612210565b60006020828403121561226257600080fd5b5035919050565b828152606081016108d3602083018480516001600160a01b03168252602090810151910152565b6000602082840312156122a257600080fd5b81356001600160401b038111156122b857600080fd5b820160e081850312156108d357600080fd5b600061010082840312156122dd57600080fd5b50919050565b6000602082840312156122f557600080fd5b81356001600160401b0381111561230b57600080fd5b61208f848285016122ca565b6000806040838503121561232a57600080fd5b50508035926020909101359150565b815181526020808301516001600160a01b0316908201526040810161060f565b60008060006060848603121561236e57600080fd5b83359250602084013561238081612210565b929592945050506040919091013590565b6000806000606084860312156123a657600080fd5b505081359360208301359350604090920135919050565b60008083601f8401126123cf57600080fd5b5081356001600160401b038111156123e657600080fd5b6020830191508360208260051b850101111561240157600080fd5b9250929050565b60008060008060008086880360a081121561242257600080fd5b8735965060208801356001600160401b038082111561244057600080fd5b61244c8b838c016123bd565b90985096508691506040603f198401121561246657600080fd5b60408a01955060808a013592508083111561248057600080fd5b505061248e89828a016123bd565b979a9699509497509295939492505050565b600080604083850312156124b357600080fd5b82356124be81612210565b915060208301356124ce81612210565b809150509250929050565b600080604083850312156124ec57600080fd5b823563ffffffff811681146124be57600080fd5b6000806040838503121561251357600080fd5b8235915060208301356001600160401b0381111561253057600080fd5b61253c858286016122ca565b9150509250929050565b60006020828403121561255857600080fd5b5051919050565b60208082526027908201527f54656c65706f727465724d657373656e6765723a207a65726f20626c6f636b636040820152661a185a5b88125160ca1b606082015260800190565b60208082526023908201527f5265656e7472616e63794775617264733a2073656e646572207265656e7472616040820152626e637960e81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715612621576126216125e9565b60405290565b60405160c081016001600160401b0381118282101715612621576126216125e9565b60405161010081016001600160401b0381118282101715612621576126216125e9565b604051601f8201601f191681016001600160401b0381118282101715612694576126946125e9565b604052919050565b6000604082840312156126ae57600080fd5b6126b66125ff565b905081356126c381612210565b808252506020820135602082015292915050565b60006001600160401b038211156126f0576126f06125e9565b5060051b60200190565b600082601f83011261270b57600080fd5b8135602061272061271b836126d7565b61266c565b82815260059290921b8401810191818101908684111561273f57600080fd5b8286015b8481101561276357803561275681612210565b8352918301918301612743565b509695505050505050565b60006001600160401b03821115612787576127876125e9565b50601f01601f191660200190565b600082601f8301126127a657600080fd5b81356127b461271b8261276e565b8181528460208386010111156127c957600080fd5b816020850160208301376000918101602001919091529392505050565b600060e082360312156127f857600080fd5b612800612627565b8235815261281060208401612228565b6020820152612822366040850161269c565b60408201526080830135606082015260a08301356001600160401b038082111561284b57600080fd5b612857368387016126fa565b608084015260c085013591508082111561287057600080fd5b5061287d36828601612795565b60a08301525092915050565b60208082526026908201527f54656c65706f727465724d657373656e6765723a206d657373616765206e6f7460408201526508199bdd5b9960d21b606082015260800190565b6000808335601e198436030181126128e657600080fd5b83016020810192503590506001600160401b0381111561290557600080fd5b8060051b360382131561240157600080fd5b8183526000602080850194508260005b8581101561295557813561293a81612210565b6001600160a01b031687529582019590820190600101612927565b509495945050505050565b6000808335601e1984360301811261297757600080fd5b83016020810192503590506001600160401b0381111561299657600080fd5b8060061b360382131561240157600080fd5b8183526000602080850194508260005b858110156129555781358752828201356129d181612210565b6001600160a01b03168784015260409687019691909101906001016129b8565b6000808335601e19843603018112612a0857600080fd5b83016020810192503590506001600160401b03811115612a2757600080fd5b80360382131561240157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000610100823584526020830135612a7681612210565b6001600160a01b0316602085015260408381013590850152612a9a60608401612228565b6001600160a01b0316606085015260808381013590850152612abf60a08401846128cf565b8260a0870152612ad28387018284612917565b92505050612ae360c0840184612960565b85830360c0870152612af68382846129a8565b92505050612b0760e08401846129f1565b85830360e0870152612b1a838284612a36565b9695505050505050565b6020815260006108d36020830184612a5f565b60208082526029908201527f54656c65706f727465724d657373656e6765723a20696e76616c6964206d65736040820152680e6c2ceca40d0c2e6d60bb1b606082015260800190565b606081526000612b936060830185612a5f565b90506108d3602083018480516001600160a01b03168252602090810151910152565b60005b83811015612bd0578181015183820152602001612bb8565b50506000910152565b60008151808452612bf1816020860160208601612bb5565b601f01601f19169290920160200192915050565b6020815260006108d36020830184612bd9565b60208082526034908201527f54656c65706f727465724d657373656e6765723a207a65726f2066656520617360408201527373657420636f6e7472616374206164647265737360601b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561060f5761060f612c6c565b634e487b7160e01b600052603260045260246000fd5b600060018201612cbd57612cbd612c6c565b5060010190565b600060408284031215612cd657600080fd5b6108d3838361269c565b60208082526025908201527f5265656e7472616e63794775617264733a207265636569766572207265656e7460408201526472616e637960d81b606082015260800190565b80516104fe81612210565b600082601f830112612d4157600080fd5b8151612d4f61271b8261276e565b818152846020838601011115612d6457600080fd5b61208f826020830160208701612bb5565b805180151581146104fe57600080fd5b60008060408385031215612d9857600080fd5b82516001600160401b0380821115612daf57600080fd5b9084019060608287031215612dc357600080fd5b604051606081018181108382111715612dde57612dde6125e9565b604052825181526020830151612df381612210565b6020820152604083015182811115612e0a57600080fd5b612e1688828601612d30565b6040830152509350612e2d91505060208401612d75565b90509250929050565b600082601f830112612e4757600080fd5b81516020612e5761271b836126d7565b82815260059290921b84018101918181019086841115612e7657600080fd5b8286015b84811015612763578051612e8d81612210565b8352918301918301612e7a565b600082601f830112612eab57600080fd5b81516020612ebb61271b836126d7565b82815260069290921b84018101918181019086841115612eda57600080fd5b8286015b848110156127635760408189031215612ef75760008081fd5b612eff6125ff565b8151815284820151612f1081612210565b81860152835291830191604001612ede565b600060208284031215612f3457600080fd5b81516001600160401b0380821115612f4b57600080fd5b908301906101008286031215612f6057600080fd5b612f68612649565b82518152612f7860208401612d25565b602082015260408301516040820152612f9360608401612d25565b60608201526080830151608082015260a083015182811115612fb457600080fd5b612fc087828601612e36565b60a08301525060c083015182811115612fd857600080fd5b612fe487828601612e9a565b60c08301525060e083015182811115612ffc57600080fd5b61300887828601612d30565b60e08301525095945050505050565b600081518084526020808501945080840160005b838110156129555781516001600160a01b03168752958201959082019060010161302b565b600081518084526020808501945080840160005b838110156129555761308a878351805182526020908101516001600160a01b0316910152565b6040969096019590820190600101613064565b60006101008251845260018060a01b0360208401511660208501526040830151604085015260608301516130dc60608601826001600160a01b03169052565b506080830151608085015260a08301518160a08601526130fe82860182613017565b91505060c083015184820360c08601526131188282613050565b91505060e083015184820360e0860152611aa68282612bd9565b6001600160a01b038316815260406020820181905260009061208f9083018461309d565b6000808335601e1984360301811261316d57600080fd5b8301803591506001600160401b0382111561318757600080fd5b60200191503681900382131561240157600080fd5b8481526001600160a01b0384166020820152606060408201819052600090612b1a9083018486612a36565b8181038181111561060f5761060f612c6c565b6020815260006108d3602083018461309d565b606081526000612b93606083018561309d565b8381526001600160a01b0383166020820152606060408201819052600090611aa690830184612bd9565b60006020828403121561323c57600080fd5b6108d382612d75565b60008251613257818460208701612bb5565b919091019291505056fea2646970667358221220b5a4c7ce8dfba3cc1946f986f0b0825617beb03e6d4db80c3a76603f44f0a57964736f6c63430008120033", } // TeleporterMessengerABI is the input ABI used to generate the binding from. @@ -298,6 +298,37 @@ func (_TeleporterMessenger *TeleporterMessengerCallerSession) BlockchainID() ([3 return _TeleporterMessenger.Contract.BlockchainID(&_TeleporterMessenger.CallOpts) } +// CalculateMessageID is a free data retrieval call binding the contract method 0xa8898181. +// +// Solidity: function calculateMessageID(bytes32 sourceBlockchainID, bytes32 destinationBlockchainID, uint256 nonce) view returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerCaller) CalculateMessageID(opts *bind.CallOpts, sourceBlockchainID [32]byte, destinationBlockchainID [32]byte, nonce *big.Int) ([32]byte, error) { + var out []interface{} + err := _TeleporterMessenger.contract.Call(opts, &out, "calculateMessageID", sourceBlockchainID, destinationBlockchainID, nonce) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateMessageID is a free data retrieval call binding the contract method 0xa8898181. +// +// Solidity: function calculateMessageID(bytes32 sourceBlockchainID, bytes32 destinationBlockchainID, uint256 nonce) view returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerSession) CalculateMessageID(sourceBlockchainID [32]byte, destinationBlockchainID [32]byte, nonce *big.Int) ([32]byte, error) { + return _TeleporterMessenger.Contract.CalculateMessageID(&_TeleporterMessenger.CallOpts, sourceBlockchainID, destinationBlockchainID, nonce) +} + +// CalculateMessageID is a free data retrieval call binding the contract method 0xa8898181. +// +// Solidity: function calculateMessageID(bytes32 sourceBlockchainID, bytes32 destinationBlockchainID, uint256 nonce) view returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerCallerSession) CalculateMessageID(sourceBlockchainID [32]byte, destinationBlockchainID [32]byte, nonce *big.Int) ([32]byte, error) { + return _TeleporterMessenger.Contract.CalculateMessageID(&_TeleporterMessenger.CallOpts, sourceBlockchainID, destinationBlockchainID, nonce) +} + // CheckRelayerRewardAmount is a free data retrieval call binding the contract method 0xc473eef8. // // Solidity: function checkRelayerRewardAmount(address relayer, address feeAsset) view returns(uint256) @@ -329,12 +360,12 @@ func (_TeleporterMessenger *TeleporterMessengerCallerSession) CheckRelayerReward return _TeleporterMessenger.Contract.CheckRelayerRewardAmount(&_TeleporterMessenger.CallOpts, relayer, feeAsset) } -// GetFeeInfo is a free data retrieval call binding the contract method 0x82f2c43a. +// GetFeeInfo is a free data retrieval call binding the contract method 0xe69d606a. // -// Solidity: function getFeeInfo(bytes32 destinationBlockchainID, uint256 messageID) view returns(address, uint256) -func (_TeleporterMessenger *TeleporterMessengerCaller) GetFeeInfo(opts *bind.CallOpts, destinationBlockchainID [32]byte, messageID *big.Int) (common.Address, *big.Int, error) { +// Solidity: function getFeeInfo(bytes32 messageID) view returns(address, uint256) +func (_TeleporterMessenger *TeleporterMessengerCaller) GetFeeInfo(opts *bind.CallOpts, messageID [32]byte) (common.Address, *big.Int, error) { var out []interface{} - err := _TeleporterMessenger.contract.Call(opts, &out, "getFeeInfo", destinationBlockchainID, messageID) + err := _TeleporterMessenger.contract.Call(opts, &out, "getFeeInfo", messageID) if err != nil { return *new(common.Address), *new(*big.Int), err @@ -347,26 +378,26 @@ func (_TeleporterMessenger *TeleporterMessengerCaller) GetFeeInfo(opts *bind.Cal } -// GetFeeInfo is a free data retrieval call binding the contract method 0x82f2c43a. +// GetFeeInfo is a free data retrieval call binding the contract method 0xe69d606a. // -// Solidity: function getFeeInfo(bytes32 destinationBlockchainID, uint256 messageID) view returns(address, uint256) -func (_TeleporterMessenger *TeleporterMessengerSession) GetFeeInfo(destinationBlockchainID [32]byte, messageID *big.Int) (common.Address, *big.Int, error) { - return _TeleporterMessenger.Contract.GetFeeInfo(&_TeleporterMessenger.CallOpts, destinationBlockchainID, messageID) +// Solidity: function getFeeInfo(bytes32 messageID) view returns(address, uint256) +func (_TeleporterMessenger *TeleporterMessengerSession) GetFeeInfo(messageID [32]byte) (common.Address, *big.Int, error) { + return _TeleporterMessenger.Contract.GetFeeInfo(&_TeleporterMessenger.CallOpts, messageID) } -// GetFeeInfo is a free data retrieval call binding the contract method 0x82f2c43a. +// GetFeeInfo is a free data retrieval call binding the contract method 0xe69d606a. // -// Solidity: function getFeeInfo(bytes32 destinationBlockchainID, uint256 messageID) view returns(address, uint256) -func (_TeleporterMessenger *TeleporterMessengerCallerSession) GetFeeInfo(destinationBlockchainID [32]byte, messageID *big.Int) (common.Address, *big.Int, error) { - return _TeleporterMessenger.Contract.GetFeeInfo(&_TeleporterMessenger.CallOpts, destinationBlockchainID, messageID) +// Solidity: function getFeeInfo(bytes32 messageID) view returns(address, uint256) +func (_TeleporterMessenger *TeleporterMessengerCallerSession) GetFeeInfo(messageID [32]byte) (common.Address, *big.Int, error) { + return _TeleporterMessenger.Contract.GetFeeInfo(&_TeleporterMessenger.CallOpts, messageID) } -// GetMessageHash is a free data retrieval call binding the contract method 0x220c9568. +// GetMessageHash is a free data retrieval call binding the contract method 0x399b77da. // -// Solidity: function getMessageHash(bytes32 destinationBlockchainID, uint256 messageID) view returns(bytes32) -func (_TeleporterMessenger *TeleporterMessengerCaller) GetMessageHash(opts *bind.CallOpts, destinationBlockchainID [32]byte, messageID *big.Int) ([32]byte, error) { +// Solidity: function getMessageHash(bytes32 messageID) view returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerCaller) GetMessageHash(opts *bind.CallOpts, messageID [32]byte) ([32]byte, error) { var out []interface{} - err := _TeleporterMessenger.contract.Call(opts, &out, "getMessageHash", destinationBlockchainID, messageID) + err := _TeleporterMessenger.contract.Call(opts, &out, "getMessageHash", messageID) if err != nil { return *new([32]byte), err @@ -378,32 +409,32 @@ func (_TeleporterMessenger *TeleporterMessengerCaller) GetMessageHash(opts *bind } -// GetMessageHash is a free data retrieval call binding the contract method 0x220c9568. +// GetMessageHash is a free data retrieval call binding the contract method 0x399b77da. // -// Solidity: function getMessageHash(bytes32 destinationBlockchainID, uint256 messageID) view returns(bytes32) -func (_TeleporterMessenger *TeleporterMessengerSession) GetMessageHash(destinationBlockchainID [32]byte, messageID *big.Int) ([32]byte, error) { - return _TeleporterMessenger.Contract.GetMessageHash(&_TeleporterMessenger.CallOpts, destinationBlockchainID, messageID) +// Solidity: function getMessageHash(bytes32 messageID) view returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerSession) GetMessageHash(messageID [32]byte) ([32]byte, error) { + return _TeleporterMessenger.Contract.GetMessageHash(&_TeleporterMessenger.CallOpts, messageID) } -// GetMessageHash is a free data retrieval call binding the contract method 0x220c9568. +// GetMessageHash is a free data retrieval call binding the contract method 0x399b77da. // -// Solidity: function getMessageHash(bytes32 destinationBlockchainID, uint256 messageID) view returns(bytes32) -func (_TeleporterMessenger *TeleporterMessengerCallerSession) GetMessageHash(destinationBlockchainID [32]byte, messageID *big.Int) ([32]byte, error) { - return _TeleporterMessenger.Contract.GetMessageHash(&_TeleporterMessenger.CallOpts, destinationBlockchainID, messageID) +// Solidity: function getMessageHash(bytes32 messageID) view returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerCallerSession) GetMessageHash(messageID [32]byte) ([32]byte, error) { + return _TeleporterMessenger.Contract.GetMessageHash(&_TeleporterMessenger.CallOpts, messageID) } // GetNextMessageID is a free data retrieval call binding the contract method 0xdf20e8bc. // -// Solidity: function getNextMessageID(bytes32 destinationBlockchainID) view returns(uint256) -func (_TeleporterMessenger *TeleporterMessengerCaller) GetNextMessageID(opts *bind.CallOpts, destinationBlockchainID [32]byte) (*big.Int, error) { +// Solidity: function getNextMessageID(bytes32 destinationBlockchainID) view returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerCaller) GetNextMessageID(opts *bind.CallOpts, destinationBlockchainID [32]byte) ([32]byte, error) { var out []interface{} err := _TeleporterMessenger.contract.Call(opts, &out, "getNextMessageID", destinationBlockchainID) if err != nil { - return *new(*big.Int), err + return *new([32]byte), err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err @@ -411,15 +442,15 @@ func (_TeleporterMessenger *TeleporterMessengerCaller) GetNextMessageID(opts *bi // GetNextMessageID is a free data retrieval call binding the contract method 0xdf20e8bc. // -// Solidity: function getNextMessageID(bytes32 destinationBlockchainID) view returns(uint256) -func (_TeleporterMessenger *TeleporterMessengerSession) GetNextMessageID(destinationBlockchainID [32]byte) (*big.Int, error) { +// Solidity: function getNextMessageID(bytes32 destinationBlockchainID) view returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerSession) GetNextMessageID(destinationBlockchainID [32]byte) ([32]byte, error) { return _TeleporterMessenger.Contract.GetNextMessageID(&_TeleporterMessenger.CallOpts, destinationBlockchainID) } // GetNextMessageID is a free data retrieval call binding the contract method 0xdf20e8bc. // -// Solidity: function getNextMessageID(bytes32 destinationBlockchainID) view returns(uint256) -func (_TeleporterMessenger *TeleporterMessengerCallerSession) GetNextMessageID(destinationBlockchainID [32]byte) (*big.Int, error) { +// Solidity: function getNextMessageID(bytes32 destinationBlockchainID) view returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerCallerSession) GetNextMessageID(destinationBlockchainID [32]byte) ([32]byte, error) { return _TeleporterMessenger.Contract.GetNextMessageID(&_TeleporterMessenger.CallOpts, destinationBlockchainID) } @@ -485,12 +516,12 @@ func (_TeleporterMessenger *TeleporterMessengerCallerSession) GetReceiptQueueSiz return _TeleporterMessenger.Contract.GetReceiptQueueSize(&_TeleporterMessenger.CallOpts, originBlockchainID) } -// GetRelayerRewardAddress is a free data retrieval call binding the contract method 0x33e890fe. +// GetRelayerRewardAddress is a free data retrieval call binding the contract method 0x2e27c223. // -// Solidity: function getRelayerRewardAddress(bytes32 originBlockchainID, uint256 messageID) view returns(address) -func (_TeleporterMessenger *TeleporterMessengerCaller) GetRelayerRewardAddress(opts *bind.CallOpts, originBlockchainID [32]byte, messageID *big.Int) (common.Address, error) { +// Solidity: function getRelayerRewardAddress(bytes32 messageID) view returns(address) +func (_TeleporterMessenger *TeleporterMessengerCaller) GetRelayerRewardAddress(opts *bind.CallOpts, messageID [32]byte) (common.Address, error) { var out []interface{} - err := _TeleporterMessenger.contract.Call(opts, &out, "getRelayerRewardAddress", originBlockchainID, messageID) + err := _TeleporterMessenger.contract.Call(opts, &out, "getRelayerRewardAddress", messageID) if err != nil { return *new(common.Address), err @@ -502,26 +533,26 @@ func (_TeleporterMessenger *TeleporterMessengerCaller) GetRelayerRewardAddress(o } -// GetRelayerRewardAddress is a free data retrieval call binding the contract method 0x33e890fe. +// GetRelayerRewardAddress is a free data retrieval call binding the contract method 0x2e27c223. // -// Solidity: function getRelayerRewardAddress(bytes32 originBlockchainID, uint256 messageID) view returns(address) -func (_TeleporterMessenger *TeleporterMessengerSession) GetRelayerRewardAddress(originBlockchainID [32]byte, messageID *big.Int) (common.Address, error) { - return _TeleporterMessenger.Contract.GetRelayerRewardAddress(&_TeleporterMessenger.CallOpts, originBlockchainID, messageID) +// Solidity: function getRelayerRewardAddress(bytes32 messageID) view returns(address) +func (_TeleporterMessenger *TeleporterMessengerSession) GetRelayerRewardAddress(messageID [32]byte) (common.Address, error) { + return _TeleporterMessenger.Contract.GetRelayerRewardAddress(&_TeleporterMessenger.CallOpts, messageID) } -// GetRelayerRewardAddress is a free data retrieval call binding the contract method 0x33e890fe. +// GetRelayerRewardAddress is a free data retrieval call binding the contract method 0x2e27c223. // -// Solidity: function getRelayerRewardAddress(bytes32 originBlockchainID, uint256 messageID) view returns(address) -func (_TeleporterMessenger *TeleporterMessengerCallerSession) GetRelayerRewardAddress(originBlockchainID [32]byte, messageID *big.Int) (common.Address, error) { - return _TeleporterMessenger.Contract.GetRelayerRewardAddress(&_TeleporterMessenger.CallOpts, originBlockchainID, messageID) +// Solidity: function getRelayerRewardAddress(bytes32 messageID) view returns(address) +func (_TeleporterMessenger *TeleporterMessengerCallerSession) GetRelayerRewardAddress(messageID [32]byte) (common.Address, error) { + return _TeleporterMessenger.Contract.GetRelayerRewardAddress(&_TeleporterMessenger.CallOpts, messageID) } -// LatestMessageIDs is a free data retrieval call binding the contract method 0x29ec9beb. +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. // -// Solidity: function latestMessageIDs(bytes32 destinationBlockchainID) view returns(uint256 messageID) -func (_TeleporterMessenger *TeleporterMessengerCaller) LatestMessageIDs(opts *bind.CallOpts, destinationBlockchainID [32]byte) (*big.Int, error) { +// Solidity: function messageNonce() view returns(uint256) +func (_TeleporterMessenger *TeleporterMessengerCaller) MessageNonce(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _TeleporterMessenger.contract.Call(opts, &out, "latestMessageIDs", destinationBlockchainID) + err := _TeleporterMessenger.contract.Call(opts, &out, "messageNonce") if err != nil { return *new(*big.Int), err @@ -533,26 +564,26 @@ func (_TeleporterMessenger *TeleporterMessengerCaller) LatestMessageIDs(opts *bi } -// LatestMessageIDs is a free data retrieval call binding the contract method 0x29ec9beb. +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. // -// Solidity: function latestMessageIDs(bytes32 destinationBlockchainID) view returns(uint256 messageID) -func (_TeleporterMessenger *TeleporterMessengerSession) LatestMessageIDs(destinationBlockchainID [32]byte) (*big.Int, error) { - return _TeleporterMessenger.Contract.LatestMessageIDs(&_TeleporterMessenger.CallOpts, destinationBlockchainID) +// Solidity: function messageNonce() view returns(uint256) +func (_TeleporterMessenger *TeleporterMessengerSession) MessageNonce() (*big.Int, error) { + return _TeleporterMessenger.Contract.MessageNonce(&_TeleporterMessenger.CallOpts) } -// LatestMessageIDs is a free data retrieval call binding the contract method 0x29ec9beb. +// MessageNonce is a free data retrieval call binding the contract method 0xecc70428. // -// Solidity: function latestMessageIDs(bytes32 destinationBlockchainID) view returns(uint256 messageID) -func (_TeleporterMessenger *TeleporterMessengerCallerSession) LatestMessageIDs(destinationBlockchainID [32]byte) (*big.Int, error) { - return _TeleporterMessenger.Contract.LatestMessageIDs(&_TeleporterMessenger.CallOpts, destinationBlockchainID) +// Solidity: function messageNonce() view returns(uint256) +func (_TeleporterMessenger *TeleporterMessengerCallerSession) MessageNonce() (*big.Int, error) { + return _TeleporterMessenger.Contract.MessageNonce(&_TeleporterMessenger.CallOpts) } -// MessageReceived is a free data retrieval call binding the contract method 0xe03555df. +// MessageReceived is a free data retrieval call binding the contract method 0xebc3b1ba. // -// Solidity: function messageReceived(bytes32 originBlockchainID, uint256 messageID) view returns(bool) -func (_TeleporterMessenger *TeleporterMessengerCaller) MessageReceived(opts *bind.CallOpts, originBlockchainID [32]byte, messageID *big.Int) (bool, error) { +// Solidity: function messageReceived(bytes32 messageID) view returns(bool) +func (_TeleporterMessenger *TeleporterMessengerCaller) MessageReceived(opts *bind.CallOpts, messageID [32]byte) (bool, error) { var out []interface{} - err := _TeleporterMessenger.contract.Call(opts, &out, "messageReceived", originBlockchainID, messageID) + err := _TeleporterMessenger.contract.Call(opts, &out, "messageReceived", messageID) if err != nil { return *new(bool), err @@ -564,18 +595,18 @@ func (_TeleporterMessenger *TeleporterMessengerCaller) MessageReceived(opts *bin } -// MessageReceived is a free data retrieval call binding the contract method 0xe03555df. +// MessageReceived is a free data retrieval call binding the contract method 0xebc3b1ba. // -// Solidity: function messageReceived(bytes32 originBlockchainID, uint256 messageID) view returns(bool) -func (_TeleporterMessenger *TeleporterMessengerSession) MessageReceived(originBlockchainID [32]byte, messageID *big.Int) (bool, error) { - return _TeleporterMessenger.Contract.MessageReceived(&_TeleporterMessenger.CallOpts, originBlockchainID, messageID) +// Solidity: function messageReceived(bytes32 messageID) view returns(bool) +func (_TeleporterMessenger *TeleporterMessengerSession) MessageReceived(messageID [32]byte) (bool, error) { + return _TeleporterMessenger.Contract.MessageReceived(&_TeleporterMessenger.CallOpts, messageID) } -// MessageReceived is a free data retrieval call binding the contract method 0xe03555df. +// MessageReceived is a free data retrieval call binding the contract method 0xebc3b1ba. // -// Solidity: function messageReceived(bytes32 originBlockchainID, uint256 messageID) view returns(bool) -func (_TeleporterMessenger *TeleporterMessengerCallerSession) MessageReceived(originBlockchainID [32]byte, messageID *big.Int) (bool, error) { - return _TeleporterMessenger.Contract.MessageReceived(&_TeleporterMessenger.CallOpts, originBlockchainID, messageID) +// Solidity: function messageReceived(bytes32 messageID) view returns(bool) +func (_TeleporterMessenger *TeleporterMessengerCallerSession) MessageReceived(messageID [32]byte) (bool, error) { + return _TeleporterMessenger.Contract.MessageReceived(&_TeleporterMessenger.CallOpts, messageID) } // ReceiptQueues is a free data retrieval call binding the contract method 0xe6e67bd5. @@ -623,12 +654,12 @@ func (_TeleporterMessenger *TeleporterMessengerCallerSession) ReceiptQueues(sour return _TeleporterMessenger.Contract.ReceiptQueues(&_TeleporterMessenger.CallOpts, sourceBlockchainID) } -// ReceivedFailedMessageHashes is a free data retrieval call binding the contract method 0xc9bb1143. +// ReceivedFailedMessageHashes is a free data retrieval call binding the contract method 0x860a3b06. // -// Solidity: function receivedFailedMessageHashes(bytes32 sourceBlockchainID, uint256 messageID) view returns(bytes32 messageHash) -func (_TeleporterMessenger *TeleporterMessengerCaller) ReceivedFailedMessageHashes(opts *bind.CallOpts, sourceBlockchainID [32]byte, messageID *big.Int) ([32]byte, error) { +// Solidity: function receivedFailedMessageHashes(bytes32 messageID) view returns(bytes32 messageHash) +func (_TeleporterMessenger *TeleporterMessengerCaller) ReceivedFailedMessageHashes(opts *bind.CallOpts, messageID [32]byte) ([32]byte, error) { var out []interface{} - err := _TeleporterMessenger.contract.Call(opts, &out, "receivedFailedMessageHashes", sourceBlockchainID, messageID) + err := _TeleporterMessenger.contract.Call(opts, &out, "receivedFailedMessageHashes", messageID) if err != nil { return *new([32]byte), err @@ -640,29 +671,29 @@ func (_TeleporterMessenger *TeleporterMessengerCaller) ReceivedFailedMessageHash } -// ReceivedFailedMessageHashes is a free data retrieval call binding the contract method 0xc9bb1143. +// ReceivedFailedMessageHashes is a free data retrieval call binding the contract method 0x860a3b06. // -// Solidity: function receivedFailedMessageHashes(bytes32 sourceBlockchainID, uint256 messageID) view returns(bytes32 messageHash) -func (_TeleporterMessenger *TeleporterMessengerSession) ReceivedFailedMessageHashes(sourceBlockchainID [32]byte, messageID *big.Int) ([32]byte, error) { - return _TeleporterMessenger.Contract.ReceivedFailedMessageHashes(&_TeleporterMessenger.CallOpts, sourceBlockchainID, messageID) +// Solidity: function receivedFailedMessageHashes(bytes32 messageID) view returns(bytes32 messageHash) +func (_TeleporterMessenger *TeleporterMessengerSession) ReceivedFailedMessageHashes(messageID [32]byte) ([32]byte, error) { + return _TeleporterMessenger.Contract.ReceivedFailedMessageHashes(&_TeleporterMessenger.CallOpts, messageID) } -// ReceivedFailedMessageHashes is a free data retrieval call binding the contract method 0xc9bb1143. +// ReceivedFailedMessageHashes is a free data retrieval call binding the contract method 0x860a3b06. // -// Solidity: function receivedFailedMessageHashes(bytes32 sourceBlockchainID, uint256 messageID) view returns(bytes32 messageHash) -func (_TeleporterMessenger *TeleporterMessengerCallerSession) ReceivedFailedMessageHashes(sourceBlockchainID [32]byte, messageID *big.Int) ([32]byte, error) { - return _TeleporterMessenger.Contract.ReceivedFailedMessageHashes(&_TeleporterMessenger.CallOpts, sourceBlockchainID, messageID) +// Solidity: function receivedFailedMessageHashes(bytes32 messageID) view returns(bytes32 messageHash) +func (_TeleporterMessenger *TeleporterMessengerCallerSession) ReceivedFailedMessageHashes(messageID [32]byte) ([32]byte, error) { + return _TeleporterMessenger.Contract.ReceivedFailedMessageHashes(&_TeleporterMessenger.CallOpts, messageID) } -// SentMessageInfo is a free data retrieval call binding the contract method 0x66533d12. +// SentMessageInfo is a free data retrieval call binding the contract method 0x2ca40f55. // -// Solidity: function sentMessageInfo(bytes32 destinationBlockchainID, uint256 messageID) view returns(bytes32 messageHash, (address,uint256) feeInfo) -func (_TeleporterMessenger *TeleporterMessengerCaller) SentMessageInfo(opts *bind.CallOpts, destinationBlockchainID [32]byte, messageID *big.Int) (struct { +// Solidity: function sentMessageInfo(bytes32 messageID) view returns(bytes32 messageHash, (address,uint256) feeInfo) +func (_TeleporterMessenger *TeleporterMessengerCaller) SentMessageInfo(opts *bind.CallOpts, messageID [32]byte) (struct { MessageHash [32]byte FeeInfo TeleporterFeeInfo }, error) { var out []interface{} - err := _TeleporterMessenger.contract.Call(opts, &out, "sentMessageInfo", destinationBlockchainID, messageID) + err := _TeleporterMessenger.contract.Call(opts, &out, "sentMessageInfo", messageID) outstruct := new(struct { MessageHash [32]byte @@ -679,45 +710,66 @@ func (_TeleporterMessenger *TeleporterMessengerCaller) SentMessageInfo(opts *bin } -// SentMessageInfo is a free data retrieval call binding the contract method 0x66533d12. +// SentMessageInfo is a free data retrieval call binding the contract method 0x2ca40f55. // -// Solidity: function sentMessageInfo(bytes32 destinationBlockchainID, uint256 messageID) view returns(bytes32 messageHash, (address,uint256) feeInfo) -func (_TeleporterMessenger *TeleporterMessengerSession) SentMessageInfo(destinationBlockchainID [32]byte, messageID *big.Int) (struct { +// Solidity: function sentMessageInfo(bytes32 messageID) view returns(bytes32 messageHash, (address,uint256) feeInfo) +func (_TeleporterMessenger *TeleporterMessengerSession) SentMessageInfo(messageID [32]byte) (struct { MessageHash [32]byte FeeInfo TeleporterFeeInfo }, error) { - return _TeleporterMessenger.Contract.SentMessageInfo(&_TeleporterMessenger.CallOpts, destinationBlockchainID, messageID) + return _TeleporterMessenger.Contract.SentMessageInfo(&_TeleporterMessenger.CallOpts, messageID) } -// SentMessageInfo is a free data retrieval call binding the contract method 0x66533d12. +// SentMessageInfo is a free data retrieval call binding the contract method 0x2ca40f55. // -// Solidity: function sentMessageInfo(bytes32 destinationBlockchainID, uint256 messageID) view returns(bytes32 messageHash, (address,uint256) feeInfo) -func (_TeleporterMessenger *TeleporterMessengerCallerSession) SentMessageInfo(destinationBlockchainID [32]byte, messageID *big.Int) (struct { +// Solidity: function sentMessageInfo(bytes32 messageID) view returns(bytes32 messageHash, (address,uint256) feeInfo) +func (_TeleporterMessenger *TeleporterMessengerCallerSession) SentMessageInfo(messageID [32]byte) (struct { MessageHash [32]byte FeeInfo TeleporterFeeInfo }, error) { - return _TeleporterMessenger.Contract.SentMessageInfo(&_TeleporterMessenger.CallOpts, destinationBlockchainID, messageID) + return _TeleporterMessenger.Contract.SentMessageInfo(&_TeleporterMessenger.CallOpts, messageID) +} + +// AddFeeAmount is a paid mutator transaction binding the contract method 0x8ac0fd04. +// +// Solidity: function addFeeAmount(bytes32 messageID, address feeTokenAddress, uint256 additionalFeeAmount) returns() +func (_TeleporterMessenger *TeleporterMessengerTransactor) AddFeeAmount(opts *bind.TransactOpts, messageID [32]byte, feeTokenAddress common.Address, additionalFeeAmount *big.Int) (*types.Transaction, error) { + return _TeleporterMessenger.contract.Transact(opts, "addFeeAmount", messageID, feeTokenAddress, additionalFeeAmount) +} + +// AddFeeAmount is a paid mutator transaction binding the contract method 0x8ac0fd04. +// +// Solidity: function addFeeAmount(bytes32 messageID, address feeTokenAddress, uint256 additionalFeeAmount) returns() +func (_TeleporterMessenger *TeleporterMessengerSession) AddFeeAmount(messageID [32]byte, feeTokenAddress common.Address, additionalFeeAmount *big.Int) (*types.Transaction, error) { + return _TeleporterMessenger.Contract.AddFeeAmount(&_TeleporterMessenger.TransactOpts, messageID, feeTokenAddress, additionalFeeAmount) } -// AddFeeAmount is a paid mutator transaction binding the contract method 0x19570c74. +// AddFeeAmount is a paid mutator transaction binding the contract method 0x8ac0fd04. // -// Solidity: function addFeeAmount(bytes32 destinationBlockchainID, uint256 messageID, address feeTokenAddress, uint256 additionalFeeAmount) returns() -func (_TeleporterMessenger *TeleporterMessengerTransactor) AddFeeAmount(opts *bind.TransactOpts, destinationBlockchainID [32]byte, messageID *big.Int, feeTokenAddress common.Address, additionalFeeAmount *big.Int) (*types.Transaction, error) { - return _TeleporterMessenger.contract.Transact(opts, "addFeeAmount", destinationBlockchainID, messageID, feeTokenAddress, additionalFeeAmount) +// Solidity: function addFeeAmount(bytes32 messageID, address feeTokenAddress, uint256 additionalFeeAmount) returns() +func (_TeleporterMessenger *TeleporterMessengerTransactorSession) AddFeeAmount(messageID [32]byte, feeTokenAddress common.Address, additionalFeeAmount *big.Int) (*types.Transaction, error) { + return _TeleporterMessenger.Contract.AddFeeAmount(&_TeleporterMessenger.TransactOpts, messageID, feeTokenAddress, additionalFeeAmount) } -// AddFeeAmount is a paid mutator transaction binding the contract method 0x19570c74. +// InitializeBlockchainID is a paid mutator transaction binding the contract method 0x0af5b4ff. // -// Solidity: function addFeeAmount(bytes32 destinationBlockchainID, uint256 messageID, address feeTokenAddress, uint256 additionalFeeAmount) returns() -func (_TeleporterMessenger *TeleporterMessengerSession) AddFeeAmount(destinationBlockchainID [32]byte, messageID *big.Int, feeTokenAddress common.Address, additionalFeeAmount *big.Int) (*types.Transaction, error) { - return _TeleporterMessenger.Contract.AddFeeAmount(&_TeleporterMessenger.TransactOpts, destinationBlockchainID, messageID, feeTokenAddress, additionalFeeAmount) +// Solidity: function initializeBlockchainID() returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerTransactor) InitializeBlockchainID(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TeleporterMessenger.contract.Transact(opts, "initializeBlockchainID") } -// AddFeeAmount is a paid mutator transaction binding the contract method 0x19570c74. +// InitializeBlockchainID is a paid mutator transaction binding the contract method 0x0af5b4ff. // -// Solidity: function addFeeAmount(bytes32 destinationBlockchainID, uint256 messageID, address feeTokenAddress, uint256 additionalFeeAmount) returns() -func (_TeleporterMessenger *TeleporterMessengerTransactorSession) AddFeeAmount(destinationBlockchainID [32]byte, messageID *big.Int, feeTokenAddress common.Address, additionalFeeAmount *big.Int) (*types.Transaction, error) { - return _TeleporterMessenger.Contract.AddFeeAmount(&_TeleporterMessenger.TransactOpts, destinationBlockchainID, messageID, feeTokenAddress, additionalFeeAmount) +// Solidity: function initializeBlockchainID() returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerSession) InitializeBlockchainID() (*types.Transaction, error) { + return _TeleporterMessenger.Contract.InitializeBlockchainID(&_TeleporterMessenger.TransactOpts) +} + +// InitializeBlockchainID is a paid mutator transaction binding the contract method 0x0af5b4ff. +// +// Solidity: function initializeBlockchainID() returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerTransactorSession) InitializeBlockchainID() (*types.Transaction, error) { + return _TeleporterMessenger.Contract.InitializeBlockchainID(&_TeleporterMessenger.TransactOpts) } // ReceiveCrossChainMessage is a paid mutator transaction binding the contract method 0xccb5f809. @@ -783,66 +835,66 @@ func (_TeleporterMessenger *TeleporterMessengerTransactorSession) RetryMessageEx return _TeleporterMessenger.Contract.RetryMessageExecution(&_TeleporterMessenger.TransactOpts, originBlockchainID, message) } -// RetrySendCrossChainMessage is a paid mutator transaction binding the contract method 0xaf402850. +// RetrySendCrossChainMessage is a paid mutator transaction binding the contract method 0x8245a1b0. // -// Solidity: function retrySendCrossChainMessage(bytes32 destinationBlockchainID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) returns() -func (_TeleporterMessenger *TeleporterMessengerTransactor) RetrySendCrossChainMessage(opts *bind.TransactOpts, destinationBlockchainID [32]byte, message TeleporterMessage) (*types.Transaction, error) { - return _TeleporterMessenger.contract.Transact(opts, "retrySendCrossChainMessage", destinationBlockchainID, message) +// Solidity: function retrySendCrossChainMessage((uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) returns() +func (_TeleporterMessenger *TeleporterMessengerTransactor) RetrySendCrossChainMessage(opts *bind.TransactOpts, message TeleporterMessage) (*types.Transaction, error) { + return _TeleporterMessenger.contract.Transact(opts, "retrySendCrossChainMessage", message) } -// RetrySendCrossChainMessage is a paid mutator transaction binding the contract method 0xaf402850. +// RetrySendCrossChainMessage is a paid mutator transaction binding the contract method 0x8245a1b0. // -// Solidity: function retrySendCrossChainMessage(bytes32 destinationBlockchainID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) returns() -func (_TeleporterMessenger *TeleporterMessengerSession) RetrySendCrossChainMessage(destinationBlockchainID [32]byte, message TeleporterMessage) (*types.Transaction, error) { - return _TeleporterMessenger.Contract.RetrySendCrossChainMessage(&_TeleporterMessenger.TransactOpts, destinationBlockchainID, message) +// Solidity: function retrySendCrossChainMessage((uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) returns() +func (_TeleporterMessenger *TeleporterMessengerSession) RetrySendCrossChainMessage(message TeleporterMessage) (*types.Transaction, error) { + return _TeleporterMessenger.Contract.RetrySendCrossChainMessage(&_TeleporterMessenger.TransactOpts, message) } -// RetrySendCrossChainMessage is a paid mutator transaction binding the contract method 0xaf402850. +// RetrySendCrossChainMessage is a paid mutator transaction binding the contract method 0x8245a1b0. // -// Solidity: function retrySendCrossChainMessage(bytes32 destinationBlockchainID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) returns() -func (_TeleporterMessenger *TeleporterMessengerTransactorSession) RetrySendCrossChainMessage(destinationBlockchainID [32]byte, message TeleporterMessage) (*types.Transaction, error) { - return _TeleporterMessenger.Contract.RetrySendCrossChainMessage(&_TeleporterMessenger.TransactOpts, destinationBlockchainID, message) +// Solidity: function retrySendCrossChainMessage((uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) returns() +func (_TeleporterMessenger *TeleporterMessengerTransactorSession) RetrySendCrossChainMessage(message TeleporterMessage) (*types.Transaction, error) { + return _TeleporterMessenger.Contract.RetrySendCrossChainMessage(&_TeleporterMessenger.TransactOpts, message) } // SendCrossChainMessage is a paid mutator transaction binding the contract method 0x62448850. // -// Solidity: function sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes) messageInput) returns(uint256) +// Solidity: function sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes) messageInput) returns(bytes32) func (_TeleporterMessenger *TeleporterMessengerTransactor) SendCrossChainMessage(opts *bind.TransactOpts, messageInput TeleporterMessageInput) (*types.Transaction, error) { return _TeleporterMessenger.contract.Transact(opts, "sendCrossChainMessage", messageInput) } // SendCrossChainMessage is a paid mutator transaction binding the contract method 0x62448850. // -// Solidity: function sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes) messageInput) returns(uint256) +// Solidity: function sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes) messageInput) returns(bytes32) func (_TeleporterMessenger *TeleporterMessengerSession) SendCrossChainMessage(messageInput TeleporterMessageInput) (*types.Transaction, error) { return _TeleporterMessenger.Contract.SendCrossChainMessage(&_TeleporterMessenger.TransactOpts, messageInput) } // SendCrossChainMessage is a paid mutator transaction binding the contract method 0x62448850. // -// Solidity: function sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes) messageInput) returns(uint256) +// Solidity: function sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes) messageInput) returns(bytes32) func (_TeleporterMessenger *TeleporterMessengerTransactorSession) SendCrossChainMessage(messageInput TeleporterMessageInput) (*types.Transaction, error) { return _TeleporterMessenger.Contract.SendCrossChainMessage(&_TeleporterMessenger.TransactOpts, messageInput) } -// SendSpecifiedReceipts is a paid mutator transaction binding the contract method 0x191eb698. +// SendSpecifiedReceipts is a paid mutator transaction binding the contract method 0xa9a85614. // -// Solidity: function sendSpecifiedReceipts(bytes32 originBlockchainID, uint256[] messageIDs, (address,uint256) feeInfo, address[] allowedRelayerAddresses) returns(uint256) -func (_TeleporterMessenger *TeleporterMessengerTransactor) SendSpecifiedReceipts(opts *bind.TransactOpts, originBlockchainID [32]byte, messageIDs []*big.Int, feeInfo TeleporterFeeInfo, allowedRelayerAddresses []common.Address) (*types.Transaction, error) { +// Solidity: function sendSpecifiedReceipts(bytes32 originBlockchainID, bytes32[] messageIDs, (address,uint256) feeInfo, address[] allowedRelayerAddresses) returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerTransactor) SendSpecifiedReceipts(opts *bind.TransactOpts, originBlockchainID [32]byte, messageIDs [][32]byte, feeInfo TeleporterFeeInfo, allowedRelayerAddresses []common.Address) (*types.Transaction, error) { return _TeleporterMessenger.contract.Transact(opts, "sendSpecifiedReceipts", originBlockchainID, messageIDs, feeInfo, allowedRelayerAddresses) } -// SendSpecifiedReceipts is a paid mutator transaction binding the contract method 0x191eb698. +// SendSpecifiedReceipts is a paid mutator transaction binding the contract method 0xa9a85614. // -// Solidity: function sendSpecifiedReceipts(bytes32 originBlockchainID, uint256[] messageIDs, (address,uint256) feeInfo, address[] allowedRelayerAddresses) returns(uint256) -func (_TeleporterMessenger *TeleporterMessengerSession) SendSpecifiedReceipts(originBlockchainID [32]byte, messageIDs []*big.Int, feeInfo TeleporterFeeInfo, allowedRelayerAddresses []common.Address) (*types.Transaction, error) { +// Solidity: function sendSpecifiedReceipts(bytes32 originBlockchainID, bytes32[] messageIDs, (address,uint256) feeInfo, address[] allowedRelayerAddresses) returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerSession) SendSpecifiedReceipts(originBlockchainID [32]byte, messageIDs [][32]byte, feeInfo TeleporterFeeInfo, allowedRelayerAddresses []common.Address) (*types.Transaction, error) { return _TeleporterMessenger.Contract.SendSpecifiedReceipts(&_TeleporterMessenger.TransactOpts, originBlockchainID, messageIDs, feeInfo, allowedRelayerAddresses) } -// SendSpecifiedReceipts is a paid mutator transaction binding the contract method 0x191eb698. +// SendSpecifiedReceipts is a paid mutator transaction binding the contract method 0xa9a85614. // -// Solidity: function sendSpecifiedReceipts(bytes32 originBlockchainID, uint256[] messageIDs, (address,uint256) feeInfo, address[] allowedRelayerAddresses) returns(uint256) -func (_TeleporterMessenger *TeleporterMessengerTransactorSession) SendSpecifiedReceipts(originBlockchainID [32]byte, messageIDs []*big.Int, feeInfo TeleporterFeeInfo, allowedRelayerAddresses []common.Address) (*types.Transaction, error) { +// Solidity: function sendSpecifiedReceipts(bytes32 originBlockchainID, bytes32[] messageIDs, (address,uint256) feeInfo, address[] allowedRelayerAddresses) returns(bytes32) +func (_TeleporterMessenger *TeleporterMessengerTransactorSession) SendSpecifiedReceipts(originBlockchainID [32]byte, messageIDs [][32]byte, feeInfo TeleporterFeeInfo, allowedRelayerAddresses []common.Address) (*types.Transaction, error) { return _TeleporterMessenger.Contract.SendSpecifiedReceipts(&_TeleporterMessenger.TransactOpts, originBlockchainID, messageIDs, feeInfo, allowedRelayerAddresses) } @@ -915,48 +967,39 @@ func (it *TeleporterMessengerAddFeeAmountIterator) Close() error { // TeleporterMessengerAddFeeAmount represents a AddFeeAmount event raised by the TeleporterMessenger contract. type TeleporterMessengerAddFeeAmount struct { - DestinationBlockchainID [32]byte - MessageID *big.Int - UpdatedFeeInfo TeleporterFeeInfo - Raw types.Log // Blockchain specific contextual infos + MessageID [32]byte + UpdatedFeeInfo TeleporterFeeInfo + Raw types.Log // Blockchain specific contextual infos } -// FilterAddFeeAmount is a free log retrieval operation binding the contract event 0x28fe05eedf0479c9159e5b6dd2a28c93fa1a408eba22dc801fd9bc493a7fc0c2. +// FilterAddFeeAmount is a free log retrieval operation binding the contract event 0xc1bfd1f1208927dfbd414041dcb5256e6c9ad90dd61aec3249facbd34ff7b3e1. // -// Solidity: event AddFeeAmount(bytes32 indexed destinationBlockchainID, uint256 indexed messageID, (address,uint256) updatedFeeInfo) -func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterAddFeeAmount(opts *bind.FilterOpts, destinationBlockchainID [][32]byte, messageID []*big.Int) (*TeleporterMessengerAddFeeAmountIterator, error) { +// Solidity: event AddFeeAmount(bytes32 indexed messageID, (address,uint256) updatedFeeInfo) +func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterAddFeeAmount(opts *bind.FilterOpts, messageID [][32]byte) (*TeleporterMessengerAddFeeAmountIterator, error) { - var destinationBlockchainIDRule []interface{} - for _, destinationBlockchainIDItem := range destinationBlockchainID { - destinationBlockchainIDRule = append(destinationBlockchainIDRule, destinationBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } - logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "AddFeeAmount", destinationBlockchainIDRule, messageIDRule) + logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "AddFeeAmount", messageIDRule) if err != nil { return nil, err } return &TeleporterMessengerAddFeeAmountIterator{contract: _TeleporterMessenger.contract, event: "AddFeeAmount", logs: logs, sub: sub}, nil } -// WatchAddFeeAmount is a free log subscription operation binding the contract event 0x28fe05eedf0479c9159e5b6dd2a28c93fa1a408eba22dc801fd9bc493a7fc0c2. +// WatchAddFeeAmount is a free log subscription operation binding the contract event 0xc1bfd1f1208927dfbd414041dcb5256e6c9ad90dd61aec3249facbd34ff7b3e1. // -// Solidity: event AddFeeAmount(bytes32 indexed destinationBlockchainID, uint256 indexed messageID, (address,uint256) updatedFeeInfo) -func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchAddFeeAmount(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerAddFeeAmount, destinationBlockchainID [][32]byte, messageID []*big.Int) (event.Subscription, error) { +// Solidity: event AddFeeAmount(bytes32 indexed messageID, (address,uint256) updatedFeeInfo) +func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchAddFeeAmount(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerAddFeeAmount, messageID [][32]byte) (event.Subscription, error) { - var destinationBlockchainIDRule []interface{} - for _, destinationBlockchainIDItem := range destinationBlockchainID { - destinationBlockchainIDRule = append(destinationBlockchainIDRule, destinationBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } - logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "AddFeeAmount", destinationBlockchainIDRule, messageIDRule) + logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "AddFeeAmount", messageIDRule) if err != nil { return nil, err } @@ -988,9 +1031,9 @@ func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchAddFeeAmount(opts }), nil } -// ParseAddFeeAmount is a log parse operation binding the contract event 0x28fe05eedf0479c9159e5b6dd2a28c93fa1a408eba22dc801fd9bc493a7fc0c2. +// ParseAddFeeAmount is a log parse operation binding the contract event 0xc1bfd1f1208927dfbd414041dcb5256e6c9ad90dd61aec3249facbd34ff7b3e1. // -// Solidity: event AddFeeAmount(bytes32 indexed destinationBlockchainID, uint256 indexed messageID, (address,uint256) updatedFeeInfo) +// Solidity: event AddFeeAmount(bytes32 indexed messageID, (address,uint256) updatedFeeInfo) func (_TeleporterMessenger *TeleporterMessengerFilterer) ParseAddFeeAmount(log types.Log) (*TeleporterMessengerAddFeeAmount, error) { event := new(TeleporterMessengerAddFeeAmount) if err := _TeleporterMessenger.contract.UnpackLog(event, "AddFeeAmount", log); err != nil { @@ -1000,6 +1043,150 @@ func (_TeleporterMessenger *TeleporterMessengerFilterer) ParseAddFeeAmount(log t return event, nil } +// TeleporterMessengerBlockchainIDInitializedIterator is returned from FilterBlockchainIDInitialized and is used to iterate over the raw logs and unpacked data for BlockchainIDInitialized events raised by the TeleporterMessenger contract. +type TeleporterMessengerBlockchainIDInitializedIterator struct { + Event *TeleporterMessengerBlockchainIDInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TeleporterMessengerBlockchainIDInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TeleporterMessengerBlockchainIDInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TeleporterMessengerBlockchainIDInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TeleporterMessengerBlockchainIDInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TeleporterMessengerBlockchainIDInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TeleporterMessengerBlockchainIDInitialized represents a BlockchainIDInitialized event raised by the TeleporterMessenger contract. +type TeleporterMessengerBlockchainIDInitialized struct { + BlockchainID [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBlockchainIDInitialized is a free log retrieval operation binding the contract event 0x1eac640109dc937d2a9f42735a05f794b39a5e3759d681951d671aabbce4b104. +// +// Solidity: event BlockchainIDInitialized(bytes32 indexed blockchainID) +func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterBlockchainIDInitialized(opts *bind.FilterOpts, blockchainID [][32]byte) (*TeleporterMessengerBlockchainIDInitializedIterator, error) { + + var blockchainIDRule []interface{} + for _, blockchainIDItem := range blockchainID { + blockchainIDRule = append(blockchainIDRule, blockchainIDItem) + } + + logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "BlockchainIDInitialized", blockchainIDRule) + if err != nil { + return nil, err + } + return &TeleporterMessengerBlockchainIDInitializedIterator{contract: _TeleporterMessenger.contract, event: "BlockchainIDInitialized", logs: logs, sub: sub}, nil +} + +// WatchBlockchainIDInitialized is a free log subscription operation binding the contract event 0x1eac640109dc937d2a9f42735a05f794b39a5e3759d681951d671aabbce4b104. +// +// Solidity: event BlockchainIDInitialized(bytes32 indexed blockchainID) +func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchBlockchainIDInitialized(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerBlockchainIDInitialized, blockchainID [][32]byte) (event.Subscription, error) { + + var blockchainIDRule []interface{} + for _, blockchainIDItem := range blockchainID { + blockchainIDRule = append(blockchainIDRule, blockchainIDItem) + } + + logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "BlockchainIDInitialized", blockchainIDRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TeleporterMessengerBlockchainIDInitialized) + if err := _TeleporterMessenger.contract.UnpackLog(event, "BlockchainIDInitialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBlockchainIDInitialized is a log parse operation binding the contract event 0x1eac640109dc937d2a9f42735a05f794b39a5e3759d681951d671aabbce4b104. +// +// Solidity: event BlockchainIDInitialized(bytes32 indexed blockchainID) +func (_TeleporterMessenger *TeleporterMessengerFilterer) ParseBlockchainIDInitialized(log types.Log) (*TeleporterMessengerBlockchainIDInitialized, error) { + event := new(TeleporterMessengerBlockchainIDInitialized) + if err := _TeleporterMessenger.contract.UnpackLog(event, "BlockchainIDInitialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // TeleporterMessengerMessageExecutedIterator is returned from FilterMessageExecuted and is used to iterate over the raw logs and unpacked data for MessageExecuted events raised by the TeleporterMessenger contract. type TeleporterMessengerMessageExecutedIterator struct { Event *TeleporterMessengerMessageExecuted // Event containing the contract specifics and raw log @@ -1069,47 +1256,47 @@ func (it *TeleporterMessengerMessageExecutedIterator) Close() error { // TeleporterMessengerMessageExecuted represents a MessageExecuted event raised by the TeleporterMessenger contract. type TeleporterMessengerMessageExecuted struct { + MessageID [32]byte OriginBlockchainID [32]byte - MessageID *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterMessageExecuted is a free log retrieval operation binding the contract event 0x5ad362d54cba0e49d358be9ce586a7136d10a2533579c4460b7e48ec273083ef. +// FilterMessageExecuted is a free log retrieval operation binding the contract event 0x34795cc6b122b9a0ae684946319f1e14a577b4e8f9b3dda9ac94c21a54d3188c. // -// Solidity: event MessageExecuted(bytes32 indexed originBlockchainID, uint256 indexed messageID) -func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterMessageExecuted(opts *bind.FilterOpts, originBlockchainID [][32]byte, messageID []*big.Int) (*TeleporterMessengerMessageExecutedIterator, error) { +// Solidity: event MessageExecuted(bytes32 indexed messageID, bytes32 indexed originBlockchainID) +func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterMessageExecuted(opts *bind.FilterOpts, messageID [][32]byte, originBlockchainID [][32]byte) (*TeleporterMessengerMessageExecutedIterator, error) { - var originBlockchainIDRule []interface{} - for _, originBlockchainIDItem := range originBlockchainID { - originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } + var originBlockchainIDRule []interface{} + for _, originBlockchainIDItem := range originBlockchainID { + originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) + } - logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "MessageExecuted", originBlockchainIDRule, messageIDRule) + logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "MessageExecuted", messageIDRule, originBlockchainIDRule) if err != nil { return nil, err } return &TeleporterMessengerMessageExecutedIterator{contract: _TeleporterMessenger.contract, event: "MessageExecuted", logs: logs, sub: sub}, nil } -// WatchMessageExecuted is a free log subscription operation binding the contract event 0x5ad362d54cba0e49d358be9ce586a7136d10a2533579c4460b7e48ec273083ef. +// WatchMessageExecuted is a free log subscription operation binding the contract event 0x34795cc6b122b9a0ae684946319f1e14a577b4e8f9b3dda9ac94c21a54d3188c. // -// Solidity: event MessageExecuted(bytes32 indexed originBlockchainID, uint256 indexed messageID) -func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchMessageExecuted(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerMessageExecuted, originBlockchainID [][32]byte, messageID []*big.Int) (event.Subscription, error) { +// Solidity: event MessageExecuted(bytes32 indexed messageID, bytes32 indexed originBlockchainID) +func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchMessageExecuted(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerMessageExecuted, messageID [][32]byte, originBlockchainID [][32]byte) (event.Subscription, error) { - var originBlockchainIDRule []interface{} - for _, originBlockchainIDItem := range originBlockchainID { - originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } + var originBlockchainIDRule []interface{} + for _, originBlockchainIDItem := range originBlockchainID { + originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) + } - logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "MessageExecuted", originBlockchainIDRule, messageIDRule) + logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "MessageExecuted", messageIDRule, originBlockchainIDRule) if err != nil { return nil, err } @@ -1141,9 +1328,9 @@ func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchMessageExecuted(op }), nil } -// ParseMessageExecuted is a log parse operation binding the contract event 0x5ad362d54cba0e49d358be9ce586a7136d10a2533579c4460b7e48ec273083ef. +// ParseMessageExecuted is a log parse operation binding the contract event 0x34795cc6b122b9a0ae684946319f1e14a577b4e8f9b3dda9ac94c21a54d3188c. // -// Solidity: event MessageExecuted(bytes32 indexed originBlockchainID, uint256 indexed messageID) +// Solidity: event MessageExecuted(bytes32 indexed messageID, bytes32 indexed originBlockchainID) func (_TeleporterMessenger *TeleporterMessengerFilterer) ParseMessageExecuted(log types.Log) (*TeleporterMessengerMessageExecuted, error) { event := new(TeleporterMessengerMessageExecuted) if err := _TeleporterMessenger.contract.UnpackLog(event, "MessageExecuted", log); err != nil { @@ -1222,48 +1409,48 @@ func (it *TeleporterMessengerMessageExecutionFailedIterator) Close() error { // TeleporterMessengerMessageExecutionFailed represents a MessageExecutionFailed event raised by the TeleporterMessenger contract. type TeleporterMessengerMessageExecutionFailed struct { + MessageID [32]byte OriginBlockchainID [32]byte - MessageID *big.Int Message TeleporterMessage Raw types.Log // Blockchain specific contextual infos } -// FilterMessageExecutionFailed is a free log retrieval operation binding the contract event 0xbedbbe6103cef0a6c9ecbf6aa23da414542c42d7918bea18aab8b601b2c3a449. +// FilterMessageExecutionFailed is a free log retrieval operation binding the contract event 0x4619adc1017b82e02eaefac01a43d50d6d8de4460774bc370c3ff0210d40c985. // -// Solidity: event MessageExecutionFailed(bytes32 indexed originBlockchainID, uint256 indexed messageID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) -func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterMessageExecutionFailed(opts *bind.FilterOpts, originBlockchainID [][32]byte, messageID []*big.Int) (*TeleporterMessengerMessageExecutionFailedIterator, error) { +// Solidity: event MessageExecutionFailed(bytes32 indexed messageID, bytes32 indexed originBlockchainID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) +func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterMessageExecutionFailed(opts *bind.FilterOpts, messageID [][32]byte, originBlockchainID [][32]byte) (*TeleporterMessengerMessageExecutionFailedIterator, error) { - var originBlockchainIDRule []interface{} - for _, originBlockchainIDItem := range originBlockchainID { - originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } + var originBlockchainIDRule []interface{} + for _, originBlockchainIDItem := range originBlockchainID { + originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) + } - logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "MessageExecutionFailed", originBlockchainIDRule, messageIDRule) + logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "MessageExecutionFailed", messageIDRule, originBlockchainIDRule) if err != nil { return nil, err } return &TeleporterMessengerMessageExecutionFailedIterator{contract: _TeleporterMessenger.contract, event: "MessageExecutionFailed", logs: logs, sub: sub}, nil } -// WatchMessageExecutionFailed is a free log subscription operation binding the contract event 0xbedbbe6103cef0a6c9ecbf6aa23da414542c42d7918bea18aab8b601b2c3a449. +// WatchMessageExecutionFailed is a free log subscription operation binding the contract event 0x4619adc1017b82e02eaefac01a43d50d6d8de4460774bc370c3ff0210d40c985. // -// Solidity: event MessageExecutionFailed(bytes32 indexed originBlockchainID, uint256 indexed messageID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) -func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchMessageExecutionFailed(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerMessageExecutionFailed, originBlockchainID [][32]byte, messageID []*big.Int) (event.Subscription, error) { +// Solidity: event MessageExecutionFailed(bytes32 indexed messageID, bytes32 indexed originBlockchainID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) +func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchMessageExecutionFailed(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerMessageExecutionFailed, messageID [][32]byte, originBlockchainID [][32]byte) (event.Subscription, error) { - var originBlockchainIDRule []interface{} - for _, originBlockchainIDItem := range originBlockchainID { - originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } + var originBlockchainIDRule []interface{} + for _, originBlockchainIDItem := range originBlockchainID { + originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) + } - logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "MessageExecutionFailed", originBlockchainIDRule, messageIDRule) + logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "MessageExecutionFailed", messageIDRule, originBlockchainIDRule) if err != nil { return nil, err } @@ -1295,9 +1482,9 @@ func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchMessageExecutionFa }), nil } -// ParseMessageExecutionFailed is a log parse operation binding the contract event 0xbedbbe6103cef0a6c9ecbf6aa23da414542c42d7918bea18aab8b601b2c3a449. +// ParseMessageExecutionFailed is a log parse operation binding the contract event 0x4619adc1017b82e02eaefac01a43d50d6d8de4460774bc370c3ff0210d40c985. // -// Solidity: event MessageExecutionFailed(bytes32 indexed originBlockchainID, uint256 indexed messageID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) +// Solidity: event MessageExecutionFailed(bytes32 indexed messageID, bytes32 indexed originBlockchainID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) func (_TeleporterMessenger *TeleporterMessengerFilterer) ParseMessageExecutionFailed(log types.Log) (*TeleporterMessengerMessageExecutionFailed, error) { event := new(TeleporterMessengerMessageExecutionFailed) if err := _TeleporterMessenger.contract.UnpackLog(event, "MessageExecutionFailed", log); err != nil { @@ -1376,58 +1563,58 @@ func (it *TeleporterMessengerReceiveCrossChainMessageIterator) Close() error { // TeleporterMessengerReceiveCrossChainMessage represents a ReceiveCrossChainMessage event raised by the TeleporterMessenger contract. type TeleporterMessengerReceiveCrossChainMessage struct { + MessageID [32]byte OriginBlockchainID [32]byte - MessageID *big.Int Deliverer common.Address RewardRedeemer common.Address Message TeleporterMessage Raw types.Log // Blockchain specific contextual infos } -// FilterReceiveCrossChainMessage is a free log retrieval operation binding the contract event 0x6b013241f9192863bc66c1f1e9a01dc592c94592bfed5e1ed380808525679575. +// FilterReceiveCrossChainMessage is a free log retrieval operation binding the contract event 0x292ee90bbaf70b5d4936025e09d56ba08f3e421156b6a568cf3c2840d9343e34. // -// Solidity: event ReceiveCrossChainMessage(bytes32 indexed originBlockchainID, uint256 indexed messageID, address indexed deliverer, address rewardRedeemer, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) -func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterReceiveCrossChainMessage(opts *bind.FilterOpts, originBlockchainID [][32]byte, messageID []*big.Int, deliverer []common.Address) (*TeleporterMessengerReceiveCrossChainMessageIterator, error) { +// Solidity: event ReceiveCrossChainMessage(bytes32 indexed messageID, bytes32 indexed originBlockchainID, address indexed deliverer, address rewardRedeemer, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) +func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterReceiveCrossChainMessage(opts *bind.FilterOpts, messageID [][32]byte, originBlockchainID [][32]byte, deliverer []common.Address) (*TeleporterMessengerReceiveCrossChainMessageIterator, error) { - var originBlockchainIDRule []interface{} - for _, originBlockchainIDItem := range originBlockchainID { - originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } + var originBlockchainIDRule []interface{} + for _, originBlockchainIDItem := range originBlockchainID { + originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) + } var delivererRule []interface{} for _, delivererItem := range deliverer { delivererRule = append(delivererRule, delivererItem) } - logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "ReceiveCrossChainMessage", originBlockchainIDRule, messageIDRule, delivererRule) + logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "ReceiveCrossChainMessage", messageIDRule, originBlockchainIDRule, delivererRule) if err != nil { return nil, err } return &TeleporterMessengerReceiveCrossChainMessageIterator{contract: _TeleporterMessenger.contract, event: "ReceiveCrossChainMessage", logs: logs, sub: sub}, nil } -// WatchReceiveCrossChainMessage is a free log subscription operation binding the contract event 0x6b013241f9192863bc66c1f1e9a01dc592c94592bfed5e1ed380808525679575. +// WatchReceiveCrossChainMessage is a free log subscription operation binding the contract event 0x292ee90bbaf70b5d4936025e09d56ba08f3e421156b6a568cf3c2840d9343e34. // -// Solidity: event ReceiveCrossChainMessage(bytes32 indexed originBlockchainID, uint256 indexed messageID, address indexed deliverer, address rewardRedeemer, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) -func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchReceiveCrossChainMessage(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerReceiveCrossChainMessage, originBlockchainID [][32]byte, messageID []*big.Int, deliverer []common.Address) (event.Subscription, error) { +// Solidity: event ReceiveCrossChainMessage(bytes32 indexed messageID, bytes32 indexed originBlockchainID, address indexed deliverer, address rewardRedeemer, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) +func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchReceiveCrossChainMessage(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerReceiveCrossChainMessage, messageID [][32]byte, originBlockchainID [][32]byte, deliverer []common.Address) (event.Subscription, error) { - var originBlockchainIDRule []interface{} - for _, originBlockchainIDItem := range originBlockchainID { - originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } + var originBlockchainIDRule []interface{} + for _, originBlockchainIDItem := range originBlockchainID { + originBlockchainIDRule = append(originBlockchainIDRule, originBlockchainIDItem) + } var delivererRule []interface{} for _, delivererItem := range deliverer { delivererRule = append(delivererRule, delivererItem) } - logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "ReceiveCrossChainMessage", originBlockchainIDRule, messageIDRule, delivererRule) + logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "ReceiveCrossChainMessage", messageIDRule, originBlockchainIDRule, delivererRule) if err != nil { return nil, err } @@ -1459,9 +1646,9 @@ func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchReceiveCrossChainM }), nil } -// ParseReceiveCrossChainMessage is a log parse operation binding the contract event 0x6b013241f9192863bc66c1f1e9a01dc592c94592bfed5e1ed380808525679575. +// ParseReceiveCrossChainMessage is a log parse operation binding the contract event 0x292ee90bbaf70b5d4936025e09d56ba08f3e421156b6a568cf3c2840d9343e34. // -// Solidity: event ReceiveCrossChainMessage(bytes32 indexed originBlockchainID, uint256 indexed messageID, address indexed deliverer, address rewardRedeemer, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) +// Solidity: event ReceiveCrossChainMessage(bytes32 indexed messageID, bytes32 indexed originBlockchainID, address indexed deliverer, address rewardRedeemer, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message) func (_TeleporterMessenger *TeleporterMessengerFilterer) ParseReceiveCrossChainMessage(log types.Log) (*TeleporterMessengerReceiveCrossChainMessage, error) { event := new(TeleporterMessengerReceiveCrossChainMessage) if err := _TeleporterMessenger.contract.UnpackLog(event, "ReceiveCrossChainMessage", log); err != nil { @@ -1694,49 +1881,49 @@ func (it *TeleporterMessengerSendCrossChainMessageIterator) Close() error { // TeleporterMessengerSendCrossChainMessage represents a SendCrossChainMessage event raised by the TeleporterMessenger contract. type TeleporterMessengerSendCrossChainMessage struct { + MessageID [32]byte DestinationBlockchainID [32]byte - MessageID *big.Int Message TeleporterMessage FeeInfo TeleporterFeeInfo Raw types.Log // Blockchain specific contextual infos } -// FilterSendCrossChainMessage is a free log retrieval operation binding the contract event 0x0563d357b89128d5a0c37c9b06420836e35d193eaf17f7960fc88e47d1e02f57. +// FilterSendCrossChainMessage is a free log retrieval operation binding the contract event 0x2a211ad4a59ab9d003852404f9c57c690704ee755f3c79d2c2812ad32da99df8. // -// Solidity: event SendCrossChainMessage(bytes32 indexed destinationBlockchainID, uint256 indexed messageID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message, (address,uint256) feeInfo) -func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterSendCrossChainMessage(opts *bind.FilterOpts, destinationBlockchainID [][32]byte, messageID []*big.Int) (*TeleporterMessengerSendCrossChainMessageIterator, error) { +// Solidity: event SendCrossChainMessage(bytes32 indexed messageID, bytes32 indexed destinationBlockchainID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message, (address,uint256) feeInfo) +func (_TeleporterMessenger *TeleporterMessengerFilterer) FilterSendCrossChainMessage(opts *bind.FilterOpts, messageID [][32]byte, destinationBlockchainID [][32]byte) (*TeleporterMessengerSendCrossChainMessageIterator, error) { - var destinationBlockchainIDRule []interface{} - for _, destinationBlockchainIDItem := range destinationBlockchainID { - destinationBlockchainIDRule = append(destinationBlockchainIDRule, destinationBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } + var destinationBlockchainIDRule []interface{} + for _, destinationBlockchainIDItem := range destinationBlockchainID { + destinationBlockchainIDRule = append(destinationBlockchainIDRule, destinationBlockchainIDItem) + } - logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "SendCrossChainMessage", destinationBlockchainIDRule, messageIDRule) + logs, sub, err := _TeleporterMessenger.contract.FilterLogs(opts, "SendCrossChainMessage", messageIDRule, destinationBlockchainIDRule) if err != nil { return nil, err } return &TeleporterMessengerSendCrossChainMessageIterator{contract: _TeleporterMessenger.contract, event: "SendCrossChainMessage", logs: logs, sub: sub}, nil } -// WatchSendCrossChainMessage is a free log subscription operation binding the contract event 0x0563d357b89128d5a0c37c9b06420836e35d193eaf17f7960fc88e47d1e02f57. +// WatchSendCrossChainMessage is a free log subscription operation binding the contract event 0x2a211ad4a59ab9d003852404f9c57c690704ee755f3c79d2c2812ad32da99df8. // -// Solidity: event SendCrossChainMessage(bytes32 indexed destinationBlockchainID, uint256 indexed messageID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message, (address,uint256) feeInfo) -func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchSendCrossChainMessage(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerSendCrossChainMessage, destinationBlockchainID [][32]byte, messageID []*big.Int) (event.Subscription, error) { +// Solidity: event SendCrossChainMessage(bytes32 indexed messageID, bytes32 indexed destinationBlockchainID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message, (address,uint256) feeInfo) +func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchSendCrossChainMessage(opts *bind.WatchOpts, sink chan<- *TeleporterMessengerSendCrossChainMessage, messageID [][32]byte, destinationBlockchainID [][32]byte) (event.Subscription, error) { - var destinationBlockchainIDRule []interface{} - for _, destinationBlockchainIDItem := range destinationBlockchainID { - destinationBlockchainIDRule = append(destinationBlockchainIDRule, destinationBlockchainIDItem) - } var messageIDRule []interface{} for _, messageIDItem := range messageID { messageIDRule = append(messageIDRule, messageIDItem) } + var destinationBlockchainIDRule []interface{} + for _, destinationBlockchainIDItem := range destinationBlockchainID { + destinationBlockchainIDRule = append(destinationBlockchainIDRule, destinationBlockchainIDItem) + } - logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "SendCrossChainMessage", destinationBlockchainIDRule, messageIDRule) + logs, sub, err := _TeleporterMessenger.contract.WatchLogs(opts, "SendCrossChainMessage", messageIDRule, destinationBlockchainIDRule) if err != nil { return nil, err } @@ -1768,9 +1955,9 @@ func (_TeleporterMessenger *TeleporterMessengerFilterer) WatchSendCrossChainMess }), nil } -// ParseSendCrossChainMessage is a log parse operation binding the contract event 0x0563d357b89128d5a0c37c9b06420836e35d193eaf17f7960fc88e47d1e02f57. +// ParseSendCrossChainMessage is a log parse operation binding the contract event 0x2a211ad4a59ab9d003852404f9c57c690704ee755f3c79d2c2812ad32da99df8. // -// Solidity: event SendCrossChainMessage(bytes32 indexed destinationBlockchainID, uint256 indexed messageID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message, (address,uint256) feeInfo) +// Solidity: event SendCrossChainMessage(bytes32 indexed messageID, bytes32 indexed destinationBlockchainID, (uint256,address,bytes32,address,uint256,address[],(uint256,address)[],bytes) message, (address,uint256) feeInfo) func (_TeleporterMessenger *TeleporterMessengerFilterer) ParseSendCrossChainMessage(log types.Log) (*TeleporterMessengerSendCrossChainMessage, error) { event := new(TeleporterMessengerSendCrossChainMessage) if err := _TeleporterMessenger.contract.UnpackLog(event, "SendCrossChainMessage", log); err != nil { diff --git a/abi-bindings/go/Teleporter/TeleporterMessenger/event_test.go b/abi-bindings/go/Teleporter/TeleporterMessenger/event_test.go index 9f458a123..051a66a99 100644 --- a/abi-bindings/go/Teleporter/TeleporterMessenger/event_test.go +++ b/abi-bindings/go/Teleporter/TeleporterMessenger/event_test.go @@ -7,6 +7,7 @@ import ( "math/big" "testing" + "github.com/ava-labs/avalanchego/ids" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ) @@ -65,9 +66,10 @@ func TestToEvent(t *testing.T) { } func TestFilterTeleporterEvents(t *testing.T) { - mockBlockchainID := [32]byte{1, 2, 3, 4} - messageID := big.NewInt(1) - message := createTestTeleporterMessage(messageID.Int64()) + mockBlockchainID := ids.ID{1, 2, 3, 4} + mockMessageNonce := big.NewInt(8) + mockMessageID := ids.ID{9, 10, 11, 12} + message := createTestTeleporterMessage(mockMessageNonce) feeInfo := TeleporterFeeInfo{ FeeTokenAddress: common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567"), Amount: big.NewInt(1), @@ -86,14 +88,14 @@ func TestFilterTeleporterEvents(t *testing.T) { { event: SendCrossChainMessage, args: []interface{}{ + mockMessageID, mockBlockchainID, - messageID, message, feeInfo, }, expected: &TeleporterMessengerSendCrossChainMessage{ + MessageID: mockMessageID, DestinationBlockchainID: mockBlockchainID, - MessageID: messageID, Message: message, FeeInfo: feeInfo, }, @@ -101,15 +103,15 @@ func TestFilterTeleporterEvents(t *testing.T) { { event: ReceiveCrossChainMessage, args: []interface{}{ + mockMessageID, mockBlockchainID, - messageID, deliverer, deliverer, message, }, expected: &TeleporterMessengerReceiveCrossChainMessage{ + MessageID: mockMessageID, OriginBlockchainID: mockBlockchainID, - MessageID: messageID, Deliverer: deliverer, RewardRedeemer: deliverer, Message: message, @@ -118,12 +120,12 @@ func TestFilterTeleporterEvents(t *testing.T) { { event: MessageExecuted, args: []interface{}{ + mockMessageID, mockBlockchainID, - messageID, }, expected: &TeleporterMessengerMessageExecuted{ + MessageID: mockMessageID, OriginBlockchainID: mockBlockchainID, - MessageID: messageID, }, }, } diff --git a/abi-bindings/go/Teleporter/TeleporterMessenger/packing.go b/abi-bindings/go/Teleporter/TeleporterMessenger/packing.go index bada9b6e5..f90c5bc13 100644 --- a/abi-bindings/go/Teleporter/TeleporterMessenger/packing.go +++ b/abi-bindings/go/Teleporter/TeleporterMessenger/packing.go @@ -18,14 +18,14 @@ func init() { // so we must manually keep this up-to-date with the struct defined in the contract. var err error teleporterMessageType, err = abi.NewType("tuple", "struct Overloader.F", []abi.ArgumentMarshaling{ - {Name: "messageID", Type: "uint256"}, + {Name: "messageNonce", Type: "uint256"}, {Name: "senderAddress", Type: "address"}, {Name: "destinationBlockchainID", Type: "bytes32"}, {Name: "destinationAddress", Type: "address"}, {Name: "requiredGasLimit", Type: "uint256"}, {Name: "allowedRelayerAddresses", Type: "address[]"}, {Name: "receipts", Type: "tuple[]", Components: []abi.ArgumentMarshaling{ - {Name: "receivedMessageID", Type: "uint256"}, + {Name: "receivedMessageNonce", Type: "uint256"}, {Name: "relayerRewardAddress", Type: "address"}, }}, {Name: "message", Type: "bytes"}, diff --git a/abi-bindings/go/Teleporter/TeleporterMessenger/packing_test.go b/abi-bindings/go/Teleporter/TeleporterMessenger/packing_test.go index 831651814..1e036cfa7 100644 --- a/abi-bindings/go/Teleporter/TeleporterMessenger/packing_test.go +++ b/abi-bindings/go/Teleporter/TeleporterMessenger/packing_test.go @@ -8,15 +8,16 @@ import ( "math/big" "testing" + "github.com/ava-labs/avalanchego/ids" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ) -func createTestTeleporterMessage(messageID int64) TeleporterMessage { +func createTestTeleporterMessage(messageNonce *big.Int) TeleporterMessage { m := TeleporterMessage{ - MessageID: big.NewInt(messageID), + MessageNonce: messageNonce, SenderAddress: common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567"), - DestinationBlockchainID: [32]byte{1, 2, 3, 4}, + DestinationBlockchainID: ids.ID{1, 2, 3, 4}, DestinationAddress: common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567"), RequiredGasLimit: big.NewInt(2), AllowedRelayerAddresses: []common.Address{ @@ -24,7 +25,7 @@ func createTestTeleporterMessage(messageID int64) TeleporterMessage { }, Receipts: []TeleporterMessageReceipt{ { - ReceivedMessageID: big.NewInt(1), + ReceivedMessageNonce: big.NewInt(1), RelayerRewardAddress: common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567"), }, }, @@ -34,10 +35,7 @@ func createTestTeleporterMessage(messageID int64) TeleporterMessage { } func TestPackUnpackTeleporterMessage(t *testing.T) { - var ( - messageID int64 = 4 - ) - message := createTestTeleporterMessage(messageID) + message := createTestTeleporterMessage(big.NewInt(4)) b, err := PackTeleporterMessage(message) if err != nil { @@ -56,7 +54,7 @@ func TestPackUnpackTeleporterMessage(t *testing.T) { } for i := 0; i < len(message.Receipts); i++ { - require.Equal(t, message.Receipts[i].ReceivedMessageID, unpacked.Receipts[i].ReceivedMessageID) + require.Equal(t, message.Receipts[i].ReceivedMessageNonce, unpacked.Receipts[i].ReceivedMessageNonce) require.Equal(t, message.Receipts[i].RelayerRewardAddress, unpacked.Receipts[i].RelayerRewardAddress) } @@ -64,9 +62,10 @@ func TestPackUnpackTeleporterMessage(t *testing.T) { } func TestUnpackEvent(t *testing.T) { - mockBlockchainID := [32]byte{1, 2, 3, 4} - messageID := big.NewInt(1) - message := createTestTeleporterMessage(messageID.Int64()) + mockBlockchainID := ids.ID{1, 2, 3, 4} + mockMessageNonce := big.NewInt(5) + mockMessageID := ids.ID{9, 10, 11, 12} + message := createTestTeleporterMessage(mockMessageNonce) feeInfo := TeleporterFeeInfo{ FeeTokenAddress: common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567"), Amount: big.NewInt(1), @@ -86,15 +85,15 @@ func TestUnpackEvent(t *testing.T) { { event: SendCrossChainMessage, args: []interface{}{ + mockMessageID, mockBlockchainID, - messageID, message, feeInfo, }, out: new(TeleporterMessengerSendCrossChainMessage), expected: &TeleporterMessengerSendCrossChainMessage{ DestinationBlockchainID: mockBlockchainID, - MessageID: messageID, + MessageID: mockMessageID, Message: message, FeeInfo: feeInfo, }, @@ -102,8 +101,8 @@ func TestUnpackEvent(t *testing.T) { { event: ReceiveCrossChainMessage, args: []interface{}{ + mockMessageID, mockBlockchainID, - messageID, deliverer, deliverer, message, @@ -111,7 +110,7 @@ func TestUnpackEvent(t *testing.T) { out: new(TeleporterMessengerReceiveCrossChainMessage), expected: &TeleporterMessengerReceiveCrossChainMessage{ OriginBlockchainID: mockBlockchainID, - MessageID: messageID, + MessageID: mockMessageID, Deliverer: deliverer, RewardRedeemer: deliverer, Message: message, @@ -120,13 +119,13 @@ func TestUnpackEvent(t *testing.T) { { event: MessageExecuted, args: []interface{}{ + mockMessageID, mockBlockchainID, - messageID, }, out: new(TeleporterMessengerMessageExecuted), expected: &TeleporterMessengerMessageExecuted{ + MessageID: mockMessageID, OriginBlockchainID: mockBlockchainID, - MessageID: messageID, }, }, } diff --git a/abi-bindings/go/Teleporter/upgrades/TeleporterRegistry/TeleporterRegistry.go b/abi-bindings/go/Teleporter/upgrades/TeleporterRegistry/TeleporterRegistry.go index 7420f02bb..091e6a9b8 100644 --- a/abi-bindings/go/Teleporter/upgrades/TeleporterRegistry/TeleporterRegistry.go +++ b/abi-bindings/go/Teleporter/upgrades/TeleporterRegistry/TeleporterRegistry.go @@ -38,7 +38,7 @@ type ProtocolRegistryEntry struct { // TeleporterRegistryMetaData contains all meta data concerning the TeleporterRegistry contract. var TeleporterRegistryMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"protocolAddress\",\"type\":\"address\"}],\"internalType\":\"structProtocolRegistryEntry[]\",\"name\":\"initialEntries\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"protocolAddress\",\"type\":\"address\"}],\"name\":\"AddProtocolVersion\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldVersion\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newVersion\",\"type\":\"uint256\"}],\"name\":\"LatestVersionUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_VERSION_INCREMENT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VALIDATORS_SOURCE_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WARP_MESSENGER\",\"outputs\":[{\"internalType\":\"contractIWarpMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"messageIndex\",\"type\":\"uint32\"}],\"name\":\"addProtocolVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"getAddressFromVersion\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestTeleporter\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"getTeleporterFromVersion\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"protocolAddress\",\"type\":\"address\"}],\"name\":\"getVersionFromAddress\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60a06040523480156200001157600080fd5b50604051620010a5380380620010a5833981016040819052620000349162000423565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000087573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ad919062000515565b60805260005b8151811015620000ff57620000ea828281518110620000d657620000d66200052f565b60200260200101516200010760201b60201c565b80620000f6816200055b565b915050620000b3565b505062000593565b80516000036200015e5760405162461bcd60e51b815260206004820181905260248201527f54656c65706f7274657252656769737472793a207a65726f2076657273696f6e60448201526064015b60405180910390fd5b80516000908152600160205260409020546001600160a01b031615620001da5760405162461bcd60e51b815260206004820152602a60248201527f54656c65706f7274657252656769737472793a2076657273696f6e20616c72656044820152696164792065786973747360b01b606482015260840162000155565b60208101516001600160a01b0316620002485760405162461bcd60e51b815260206004820152602960248201527f54656c65706f7274657252656769737472793a207a65726f2070726f746f636f6044820152686c206164647265737360b81b606482015260840162000155565b6101f46000546200025a919062000577565b81511115620002c35760405162461bcd60e51b815260206004820152602e60248201527f54656c65706f7274657252656769737472793a2076657273696f6e20696e637260448201526d0cadacadce840e8dede40d0d2ced60931b606482015260840162000155565b602081810180518351600090815260018452604080822080546001600160a01b0319166001600160a01b03948516179055925190911681526002909252902054815111156200032d5780516020808301516001600160a01b03166000908152600290915260409020555b602081015181516040516001600160a01b03909216917fa5eed93d951a9603d5f7c0a57de79a299dd3dbd5e51429be209d8053a42ab43a90600090a360005481511115620003ac576000805482518083556040519192909183917f30623e953733f6474dabdfbef1103ce15ab73cdc77c6dfad0f9874d167e8a9b091a3505b50565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715620003ea57620003ea620003af565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200041b576200041b620003af565b604052919050565b600060208083850312156200043757600080fd5b82516001600160401b03808211156200044f57600080fd5b818501915085601f8301126200046457600080fd5b815181811115620004795762000479620003af565b62000489848260051b01620003f0565b818152848101925060069190911b830184019087821115620004aa57600080fd5b928401925b818410156200050a5760408489031215620004ca5760008081fd5b620004d4620003c5565b84518152858501516001600160a01b0381168114620004f35760008081fd5b8187015283526040939093019291840191620004af565b979650505050505050565b6000602082840312156200052857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820162000570576200057062000545565b5060010190565b808201808211156200058d576200058d62000545565b92915050565b608051610aef620005b66000396000818161014901526102640152610aef6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063ac473ac311610066578063ac473ac314610124578063b771b3bc1461012d578063c07f47d41461013b578063d127dc9b14610144578063d820e64f1461016b57600080fd5b80630731775d146100a3578063215abce9146100c857806341f34ed9146100db57806346f9ef49146100f05780634c1f08ce14610103575b600080fd5b6100ab600081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100ab6100d63660046107ce565b610173565b6100ee6100e93660046107e7565b610184565b005b6100ab6100fe3660046107ce565b6103f9565b610116610111366004610829565b6104be565b6040519081526020016100bf565b6101166101f481565b6100ab6005600160991b0181565b61011660005481565b6101167f000000000000000000000000000000000000000000000000000000000000000081565b6100ab610566565b600061017e826103f9565b92915050565b6040516306f8253560e41b815263ffffffff8216600482015260009081906005600160991b0190636f82535090602401600060405180830381865afa1580156101d1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101f991908101906108cb565b91509150806102605760405162461bcd60e51b815260206004820152602860248201527f54656c65706f7274657252656769737472793a20696e76616c69642077617270604482015267206d65737361676560c01b60648201526084015b60405180910390fd5b81517f0000000000000000000000000000000000000000000000000000000000000000146102e45760405162461bcd60e51b815260206004820152602b60248201527f54656c65706f7274657252656769737472793a20696e76616c696420736f757260448201526a18d94818da185a5b88125160aa1b6064820152608401610257565b60208201516001600160a01b0316156103595760405162461bcd60e51b815260206004820152603160248201527f54656c65706f7274657252656769737472793a20696e76616c6964206f726967604482015270696e2073656e646572206164647265737360781b6064820152608401610257565b600080836040015180602001905181019061037491906109d3565b90925090506001600160a01b03811630146103e95760405162461bcd60e51b815260206004820152602f60248201527f54656c65706f7274657252656769737472793a20696e76616c6964206465737460448201526e696e6174696f6e206164647265737360881b6064820152608401610257565b6103f282610578565b5050505050565b60008160000361044b5760405162461bcd60e51b815260206004820181905260248201527f54656c65706f7274657252656769737472793a207a65726f2076657273696f6e6044820152606401610257565b6000828152600160205260409020546001600160a01b03168061017e5760405162461bcd60e51b815260206004820152602560248201527f54656c65706f7274657252656769737472793a2076657273696f6e206e6f7420604482015264199bdd5b9960da1b6064820152608401610257565b60006001600160a01b0382166104e65760405162461bcd60e51b815260040161025790610a4f565b6001600160a01b0382166000908152600260205260408120549081900361017e5760405162461bcd60e51b815260206004820152602e60248201527f54656c65706f7274657252656769737472793a2070726f746f636f6c2061646460448201526d1c995cdcc81b9bdd08199bdd5b9960921b6064820152608401610257565b60006105736000546103f9565b905090565b80516000036105c95760405162461bcd60e51b815260206004820181905260248201527f54656c65706f7274657252656769737472793a207a65726f2076657273696f6e6044820152606401610257565b80516000908152600160205260409020546001600160a01b0316156106435760405162461bcd60e51b815260206004820152602a60248201527f54656c65706f7274657252656769737472793a2076657273696f6e20616c72656044820152696164792065786973747360b01b6064820152608401610257565b60208101516001600160a01b031661066d5760405162461bcd60e51b815260040161025790610a4f565b6101f460005461067d9190610a98565b815111156106e45760405162461bcd60e51b815260206004820152602e60248201527f54656c65706f7274657252656769737472793a2076657273696f6e20696e637260448201526d0cadacadce840e8dede40d0d2ced60931b6064820152608401610257565b602081810180518351600090815260018452604080822080546001600160a01b0319166001600160a01b039485161790559251909116815260029092529020548151111561074d5780516020808301516001600160a01b03166000908152600290915260409020555b602081015181516040516001600160a01b03909216917fa5eed93d951a9603d5f7c0a57de79a299dd3dbd5e51429be209d8053a42ab43a90600090a3600054815111156107cb576000805482518083556040519192909183917f30623e953733f6474dabdfbef1103ce15ab73cdc77c6dfad0f9874d167e8a9b091a3505b50565b6000602082840312156107e057600080fd5b5035919050565b6000602082840312156107f957600080fd5b813563ffffffff8116811461080d57600080fd5b9392505050565b6001600160a01b03811681146107cb57600080fd5b60006020828403121561083b57600080fd5b813561080d81610814565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561087f5761087f610846565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156108ae576108ae610846565b604052919050565b805180151581146108c657600080fd5b919050565b600080604083850312156108de57600080fd5b825167ffffffffffffffff808211156108f657600080fd5b908401906060828703121561090a57600080fd5b61091261085c565b8251815260208084015161092581610814565b8282015260408401518381111561093b57600080fd5b80850194505087601f85011261095057600080fd5b83518381111561096257610962610846565b610974601f8201601f19168301610885565b9350808452888282870101111561098a57600080fd5b60005b818110156109a857858101830151858201840152820161098d565b506000828286010152508260408301528195506109c68188016108b6565b9450505050509250929050565b60008082840360608112156109e757600080fd5b60408112156109f557600080fd5b506040516040810181811067ffffffffffffffff82111715610a1957610a19610846565b604052835181526020840151610a2e81610814565b60208201526040840151909250610a4481610814565b809150509250929050565b60208082526029908201527f54656c65706f7274657252656769737472793a207a65726f2070726f746f636f6040820152686c206164647265737360b81b606082015260800190565b8082018082111561017e57634e487b7160e01b600052601160045260246000fdfea264697066735822122016a01b82efbc713391ff3b433ba78ec8212ee7853f4eaa4d2181a52d8db5906b64736f6c63430008120033", + Bin: "0x60a06040523480156200001157600080fd5b50604051620010a5380380620010a5833981016040819052620000349162000423565b7302000000000000000000000000000000000000056001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000087573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ad919062000515565b60805260005b8151811015620000ff57620000ea828281518110620000d657620000d66200052f565b60200260200101516200010760201b60201c565b80620000f6816200055b565b915050620000b3565b505062000593565b80516000036200015e5760405162461bcd60e51b815260206004820181905260248201527f54656c65706f7274657252656769737472793a207a65726f2076657273696f6e60448201526064015b60405180910390fd5b80516000908152600160205260409020546001600160a01b031615620001da5760405162461bcd60e51b815260206004820152602a60248201527f54656c65706f7274657252656769737472793a2076657273696f6e20616c72656044820152696164792065786973747360b01b606482015260840162000155565b60208101516001600160a01b0316620002485760405162461bcd60e51b815260206004820152602960248201527f54656c65706f7274657252656769737472793a207a65726f2070726f746f636f6044820152686c206164647265737360b81b606482015260840162000155565b6101f46000546200025a919062000577565b81511115620002c35760405162461bcd60e51b815260206004820152602e60248201527f54656c65706f7274657252656769737472793a2076657273696f6e20696e637260448201526d0cadacadce840e8dede40d0d2ced60931b606482015260840162000155565b602081810180518351600090815260018452604080822080546001600160a01b0319166001600160a01b03948516179055925190911681526002909252902054815111156200032d5780516020808301516001600160a01b03166000908152600290915260409020555b602081015181516040516001600160a01b03909216917fa5eed93d951a9603d5f7c0a57de79a299dd3dbd5e51429be209d8053a42ab43a90600090a360005481511115620003ac576000805482518083556040519192909183917f30623e953733f6474dabdfbef1103ce15ab73cdc77c6dfad0f9874d167e8a9b091a3505b50565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715620003ea57620003ea620003af565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200041b576200041b620003af565b604052919050565b600060208083850312156200043757600080fd5b82516001600160401b03808211156200044f57600080fd5b818501915085601f8301126200046457600080fd5b815181811115620004795762000479620003af565b62000489848260051b01620003f0565b818152848101925060069190911b830184019087821115620004aa57600080fd5b928401925b818410156200050a5760408489031215620004ca5760008081fd5b620004d4620003c5565b84518152858501516001600160a01b0381168114620004f35760008081fd5b8187015283526040939093019291840191620004af565b979650505050505050565b6000602082840312156200052857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820162000570576200057062000545565b5060010190565b808201808211156200058d576200058d62000545565b92915050565b608051610aef620005b66000396000818161014901526102640152610aef6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063ac473ac311610066578063ac473ac314610124578063b771b3bc1461012d578063c07f47d41461013b578063d127dc9b14610144578063d820e64f1461016b57600080fd5b80630731775d146100a3578063215abce9146100c857806341f34ed9146100db57806346f9ef49146100f05780634c1f08ce14610103575b600080fd5b6100ab600081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100ab6100d63660046107ce565b610173565b6100ee6100e93660046107e7565b610184565b005b6100ab6100fe3660046107ce565b6103f9565b610116610111366004610829565b6104be565b6040519081526020016100bf565b6101166101f481565b6100ab6005600160991b0181565b61011660005481565b6101167f000000000000000000000000000000000000000000000000000000000000000081565b6100ab610566565b600061017e826103f9565b92915050565b6040516306f8253560e41b815263ffffffff8216600482015260009081906005600160991b0190636f82535090602401600060405180830381865afa1580156101d1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101f991908101906108cb565b91509150806102605760405162461bcd60e51b815260206004820152602860248201527f54656c65706f7274657252656769737472793a20696e76616c69642077617270604482015267206d65737361676560c01b60648201526084015b60405180910390fd5b81517f0000000000000000000000000000000000000000000000000000000000000000146102e45760405162461bcd60e51b815260206004820152602b60248201527f54656c65706f7274657252656769737472793a20696e76616c696420736f757260448201526a18d94818da185a5b88125160aa1b6064820152608401610257565b60208201516001600160a01b0316156103595760405162461bcd60e51b815260206004820152603160248201527f54656c65706f7274657252656769737472793a20696e76616c6964206f726967604482015270696e2073656e646572206164647265737360781b6064820152608401610257565b600080836040015180602001905181019061037491906109d3565b90925090506001600160a01b03811630146103e95760405162461bcd60e51b815260206004820152602f60248201527f54656c65706f7274657252656769737472793a20696e76616c6964206465737460448201526e696e6174696f6e206164647265737360881b6064820152608401610257565b6103f282610578565b5050505050565b60008160000361044b5760405162461bcd60e51b815260206004820181905260248201527f54656c65706f7274657252656769737472793a207a65726f2076657273696f6e6044820152606401610257565b6000828152600160205260409020546001600160a01b03168061017e5760405162461bcd60e51b815260206004820152602560248201527f54656c65706f7274657252656769737472793a2076657273696f6e206e6f7420604482015264199bdd5b9960da1b6064820152608401610257565b60006001600160a01b0382166104e65760405162461bcd60e51b815260040161025790610a4f565b6001600160a01b0382166000908152600260205260408120549081900361017e5760405162461bcd60e51b815260206004820152602e60248201527f54656c65706f7274657252656769737472793a2070726f746f636f6c2061646460448201526d1c995cdcc81b9bdd08199bdd5b9960921b6064820152608401610257565b60006105736000546103f9565b905090565b80516000036105c95760405162461bcd60e51b815260206004820181905260248201527f54656c65706f7274657252656769737472793a207a65726f2076657273696f6e6044820152606401610257565b80516000908152600160205260409020546001600160a01b0316156106435760405162461bcd60e51b815260206004820152602a60248201527f54656c65706f7274657252656769737472793a2076657273696f6e20616c72656044820152696164792065786973747360b01b6064820152608401610257565b60208101516001600160a01b031661066d5760405162461bcd60e51b815260040161025790610a4f565b6101f460005461067d9190610a98565b815111156106e45760405162461bcd60e51b815260206004820152602e60248201527f54656c65706f7274657252656769737472793a2076657273696f6e20696e637260448201526d0cadacadce840e8dede40d0d2ced60931b6064820152608401610257565b602081810180518351600090815260018452604080822080546001600160a01b0319166001600160a01b039485161790559251909116815260029092529020548151111561074d5780516020808301516001600160a01b03166000908152600290915260409020555b602081015181516040516001600160a01b03909216917fa5eed93d951a9603d5f7c0a57de79a299dd3dbd5e51429be209d8053a42ab43a90600090a3600054815111156107cb576000805482518083556040519192909183917f30623e953733f6474dabdfbef1103ce15ab73cdc77c6dfad0f9874d167e8a9b091a3505b50565b6000602082840312156107e057600080fd5b5035919050565b6000602082840312156107f957600080fd5b813563ffffffff8116811461080d57600080fd5b9392505050565b6001600160a01b03811681146107cb57600080fd5b60006020828403121561083b57600080fd5b813561080d81610814565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561087f5761087f610846565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156108ae576108ae610846565b604052919050565b805180151581146108c657600080fd5b919050565b600080604083850312156108de57600080fd5b825167ffffffffffffffff808211156108f657600080fd5b908401906060828703121561090a57600080fd5b61091261085c565b8251815260208084015161092581610814565b8282015260408401518381111561093b57600080fd5b80850194505087601f85011261095057600080fd5b83518381111561096257610962610846565b610974601f8201601f19168301610885565b9350808452888282870101111561098a57600080fd5b60005b818110156109a857858101830151858201840152820161098d565b506000828286010152508260408301528195506109c68188016108b6565b9450505050509250929050565b60008082840360608112156109e757600080fd5b60408112156109f557600080fd5b506040516040810181811067ffffffffffffffff82111715610a1957610a19610846565b604052835181526020840151610a2e81610814565b60208201526040840151909250610a4481610814565b809150509250929050565b60208082526029908201527f54656c65706f7274657252656769737472793a207a65726f2070726f746f636f6040820152686c206164647265737360b81b606082015260800190565b8082018082111561017e57634e487b7160e01b600052601160045260246000fdfea2646970667358221220688efa3498e8367fbba36ffd205c216b58a4b7ecfe13169d82b931f2400f1bc864736f6c63430008120033", } // TeleporterRegistryABI is the input ABI used to generate the binding from. diff --git a/cmd/teleporter-cli/transaction.go b/cmd/teleporter-cli/transaction.go index 29e12f369..7b94bd13c 100644 --- a/cmd/teleporter-cli/transaction.go +++ b/cmd/teleporter-cli/transaction.go @@ -62,7 +62,7 @@ the command parses to log event fields to a more human readable format.`, cobra.CheckErr(err) logger.Info("Parsed Teleporter message", zap.String("warpMessageID", unsignedMsg.ID().Hex()), - zap.String("teleporterMessageID", teleporterMessage.MessageID.String()), + zap.String("teleporterMessageNonce", teleporterMessage.MessageNonce.String()), zap.Any("message", teleporterMessage)) } } diff --git a/contracts/src/CrossChainApplications/examples/ERC20Bridge/ERC20Bridge.sol b/contracts/src/CrossChainApplications/examples/ERC20Bridge/ERC20Bridge.sol index a4455de67..73824fcc5 100644 --- a/contracts/src/CrossChainApplications/examples/ERC20Bridge/ERC20Bridge.sol +++ b/contracts/src/CrossChainApplications/examples/ERC20Bridge/ERC20Bridge.sol @@ -221,7 +221,7 @@ contract ERC20Bridge is IERC20Bridge, ReentrancyGuard, TeleporterOwnerUpgradeabl ); // Send Teleporter message. - uint256 messageID = teleporterMessenger.sendCrossChainMessage( + bytes32 messageID = teleporterMessenger.sendCrossChainMessage( TeleporterMessageInput({ destinationBlockchainID: destinationBlockchainID, destinationAddress: destinationBridgeAddress, @@ -541,7 +541,7 @@ contract ERC20Bridge is IERC20Bridge, ReentrancyGuard, TeleporterOwnerUpgradeabl bytes memory messageData = encodeMintBridgeTokensData(nativeContractAddress, recipient, bridgeAmount); - uint256 messageID = teleporterMessenger.sendCrossChainMessage( + bytes32 messageID = teleporterMessenger.sendCrossChainMessage( TeleporterMessageInput({ destinationBlockchainID: destinationBlockchainID, destinationAddress: destinationBridgeAddress, @@ -625,7 +625,7 @@ contract ERC20Bridge is IERC20Bridge, ReentrancyGuard, TeleporterOwnerUpgradeabl feeAmount: wrappedTransferInfo.secondaryFeeAmount }); - uint256 messageID = teleporterMessenger.sendCrossChainMessage( + bytes32 messageID = teleporterMessenger.sendCrossChainMessage( TeleporterMessageInput({ destinationBlockchainID: nativeBlockchainID, destinationAddress: nativeBridgeAddress, diff --git a/contracts/src/CrossChainApplications/examples/ERC20Bridge/IERC20Bridge.sol b/contracts/src/CrossChainApplications/examples/ERC20Bridge/IERC20Bridge.sol index 4426c4733..08155d9e9 100644 --- a/contracts/src/CrossChainApplications/examples/ERC20Bridge/IERC20Bridge.sol +++ b/contracts/src/CrossChainApplications/examples/ERC20Bridge/IERC20Bridge.sol @@ -31,7 +31,7 @@ interface IERC20Bridge { event BridgeTokens( address indexed tokenContractAddress, bytes32 indexed destinationBlockchainID, - uint256 indexed teleporterMessageID, + bytes32 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount @@ -44,7 +44,7 @@ interface IERC20Bridge { bytes32 indexed destinationBlockchainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, - uint256 teleporterMessageID + bytes32 teleporterMessageID ); /** diff --git a/contracts/src/CrossChainApplications/examples/ERC20Bridge/tests/ERC20BridgeTests.t.sol b/contracts/src/CrossChainApplications/examples/ERC20Bridge/tests/ERC20BridgeTests.t.sol index 67689d5f9..381734d74 100644 --- a/contracts/src/CrossChainApplications/examples/ERC20Bridge/tests/ERC20BridgeTests.t.sol +++ b/contracts/src/CrossChainApplications/examples/ERC20Bridge/tests/ERC20BridgeTests.t.sol @@ -26,6 +26,8 @@ contract ERC20BridgeTest is Test { 0xf9FA4a0c696b659328DDaaBCB46Ae4eBFC9e68e4; address public constant WARP_PRECOMPILE_ADDRESS = address(0x0200000000000000000000000000000000000005); + bytes32 internal constant _MOCK_MESSAGE_ID = + bytes32(hex"1111111111111111111111111111111111111111111111111111111111111111"); bytes32 private constant _MOCK_BLOCKCHAIN_ID = bytes32(uint256(123456)); bytes32 private constant _DEFAULT_OTHER_CHAIN_ID = bytes32(hex"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"); @@ -42,7 +44,7 @@ contract ERC20BridgeTest is Test { event BridgeTokens( address indexed tokenContractAddress, bytes32 indexed destinationBlockchainID, - uint256 indexed teleporterMessageID, + bytes32 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount @@ -52,7 +54,7 @@ contract ERC20BridgeTest is Test { bytes32 indexed destinationBlockchainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, - uint256 teleporterMessageID + bytes32 teleporterMessageID ); event CreateBridgeToken( @@ -192,11 +194,10 @@ contract ERC20BridgeTest is Test { ) }); - uint256 mockMessageID = 42; vm.mockCall( MOCK_TELEPORTER_MESSENGER_ADDRESS, abi.encodeCall(ITeleporterMessenger.sendCrossChainMessage, (expectedMessageInput)), - abi.encode(mockMessageID) + abi.encode(_MOCK_MESSAGE_ID) ); vm.expectCall( MOCK_TELEPORTER_MESSENGER_ADDRESS, @@ -207,7 +208,7 @@ contract ERC20BridgeTest is Test { emit BridgeTokens({ tokenContractAddress: address(mockERC20), destinationBlockchainID: _DEFAULT_OTHER_CHAIN_ID, - teleporterMessageID: mockMessageID, + teleporterMessageID: _MOCK_MESSAGE_ID, destinationBridgeAddress: _DEFAULT_OTHER_BRIDGE_ADDRESS, recipient: _DEFAULT_RECIPIENT, amount: totalAmount @@ -301,11 +302,10 @@ contract ERC20BridgeTest is Test { abi.encodeCall(IERC20.approve, (MOCK_TELEPORTER_MESSENGER_ADDRESS, feeAmount)) ); - uint256 mockMessageID = 42; vm.mockCall( MOCK_TELEPORTER_MESSENGER_ADDRESS, abi.encodeCall(ITeleporterMessenger.sendCrossChainMessage, (expectedMessageInput)), - abi.encode(mockMessageID) + abi.encode(_MOCK_MESSAGE_ID) ); vm.expectCall( MOCK_TELEPORTER_MESSENGER_ADDRESS, @@ -316,7 +316,7 @@ contract ERC20BridgeTest is Test { emit BridgeTokens({ tokenContractAddress: address(mockERC20), destinationBlockchainID: _DEFAULT_OTHER_CHAIN_ID, - teleporterMessageID: mockMessageID, + teleporterMessageID: _MOCK_MESSAGE_ID, destinationBridgeAddress: _DEFAULT_OTHER_BRIDGE_ADDRESS, recipient: _DEFAULT_RECIPIENT, amount: bridgeAmount @@ -378,11 +378,10 @@ contract ERC20BridgeTest is Test { abi.encodeCall(IERC20.approve, (MOCK_TELEPORTER_MESSENGER_ADDRESS, bridgeFeeAmount)) ); - uint256 mockMessageID = 42; vm.mockCall( MOCK_TELEPORTER_MESSENGER_ADDRESS, abi.encodeCall(ITeleporterMessenger.sendCrossChainMessage, (expectedMessageInput)), - abi.encode(mockMessageID) + abi.encode(_MOCK_MESSAGE_ID) ); vm.expectCall( MOCK_TELEPORTER_MESSENGER_ADDRESS, @@ -393,7 +392,7 @@ contract ERC20BridgeTest is Test { emit BridgeTokens({ tokenContractAddress: address(mockERC20), destinationBlockchainID: _DEFAULT_OTHER_CHAIN_ID, - teleporterMessageID: mockMessageID, + teleporterMessageID: _MOCK_MESSAGE_ID, destinationBridgeAddress: _DEFAULT_OTHER_BRIDGE_ADDRESS, recipient: _DEFAULT_RECIPIENT, amount: expectedBridgeAmount @@ -586,11 +585,10 @@ contract ERC20BridgeTest is Test { ) }); - uint256 mockMessageID = 456; vm.mockCall( MOCK_TELEPORTER_MESSENGER_ADDRESS, abi.encodeCall(ITeleporterMessenger.sendCrossChainMessage, (expectedMessageInput)), - abi.encode(mockMessageID) + abi.encode(_MOCK_MESSAGE_ID) ); vm.expectCall( MOCK_TELEPORTER_MESSENGER_ADDRESS, @@ -599,7 +597,10 @@ contract ERC20BridgeTest is Test { vm.expectEmit(true, true, true, true, address(erc20Bridge)); emit SubmitCreateBridgeToken( - destinationBlockchainID, destinationBridgeAddress, nativeContractAddress, mockMessageID + destinationBlockchainID, + destinationBridgeAddress, + nativeContractAddress, + _MOCK_MESSAGE_ID ); erc20Bridge.submitCreateBridgeToken( diff --git a/contracts/src/CrossChainApplications/examples/ExampleMessenger/ExampleCrossChainMessenger.sol b/contracts/src/CrossChainApplications/examples/ExampleMessenger/ExampleCrossChainMessenger.sol index d0d1e1071..75e470e7a 100644 --- a/contracts/src/CrossChainApplications/examples/ExampleMessenger/ExampleCrossChainMessenger.sol +++ b/contracts/src/CrossChainApplications/examples/ExampleMessenger/ExampleCrossChainMessenger.sol @@ -69,7 +69,7 @@ contract ExampleCrossChainMessenger is ReentrancyGuard, TeleporterOwnerUpgradeab uint256 feeAmount, uint256 requiredGasLimit, string calldata message - ) external nonReentrant returns (uint256) { + ) external nonReentrant returns (bytes32) { ITeleporterMessenger teleporterMessenger = _getTeleporterMessenger(); // For non-zero fee amounts, first transfer the fee to this contract, and then // allow the Teleporter contract to spend it. diff --git a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/ERC20TokenSource.sol b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/ERC20TokenSource.sol index 63995aede..95d82b262 100644 --- a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/ERC20TokenSource.sol +++ b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/ERC20TokenSource.sol @@ -103,7 +103,7 @@ contract ERC20TokenSource is uint256 transferAmount = adjustedAmount - feeAmount; - uint256 messageID = teleporterMessenger.sendCrossChainMessage( + bytes32 messageID = teleporterMessenger.sendCrossChainMessage( TeleporterMessageInput({ destinationBlockchainID: destinationBlockchainID, destinationAddress: nativeTokenDestinationAddress, diff --git a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/INativeTokenDestination.sol b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/INativeTokenDestination.sol index 66480a3fe..b0423d656 100644 --- a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/INativeTokenDestination.sol +++ b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/INativeTokenDestination.sol @@ -23,7 +23,7 @@ interface INativeTokenDestination { event TransferToSource( address indexed sender, address indexed recipient, - uint256 indexed teleporterMessageID, + bytes32 indexed teleporterMessageID, uint256 amount ); @@ -40,7 +40,7 @@ interface INativeTokenDestination { /** * @dev Emitted when reporting total burned tx fees to source chain. */ - event ReportTotalBurnedTxFees(uint256 indexed teleporterMessageID, uint256 burnAddressBalance); + event ReportTotalBurnedTxFees(bytes32 indexed teleporterMessageID, uint256 burnAddressBalance); /** * @dev Burns native tokens on the destination contract chain, and sends a message to the source diff --git a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/ITokenSource.sol b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/ITokenSource.sol index 02963210b..849083efb 100644 --- a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/ITokenSource.sol +++ b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/ITokenSource.sol @@ -29,7 +29,7 @@ interface ITokenSource { event TransferToDestination( address indexed sender, address indexed recipient, - uint256 indexed teleporterMessageID, + bytes32 indexed teleporterMessageID, uint256 amount ); diff --git a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/NativeTokenDestination.sol b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/NativeTokenDestination.sol index 7cb6e5fde..fb687f6b3 100644 --- a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/NativeTokenDestination.sol +++ b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/NativeTokenDestination.sol @@ -119,7 +119,7 @@ contract NativeTokenDestination is // Burn native token by sending to BURN_FOR_TRANSFER_ADDRESS Address.sendValue(payable(BURN_FOR_TRANSFER_ADDRESS), msg.value); - uint256 messageID = teleporterMessenger.sendCrossChainMessage( + bytes32 messageID = teleporterMessenger.sendCrossChainMessage( TeleporterMessageInput({ destinationBlockchainID: sourceBlockchainID, destinationAddress: nativeTokenSourceAddress, @@ -148,7 +148,7 @@ contract NativeTokenDestination is ITeleporterMessenger teleporterMessenger = _getTeleporterMessenger(); uint256 totalBurnedTxFees = address(BURNED_TX_FEES_ADDRESS).balance; - uint256 messageID = teleporterMessenger.sendCrossChainMessage( + bytes32 messageID = teleporterMessenger.sendCrossChainMessage( TeleporterMessageInput({ destinationBlockchainID: sourceBlockchainID, destinationAddress: nativeTokenSourceAddress, diff --git a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/NativeTokenSource.sol b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/NativeTokenSource.sol index 4e1ffdd6a..77a4d5bf3 100644 --- a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/NativeTokenSource.sol +++ b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/NativeTokenSource.sol @@ -92,7 +92,7 @@ contract NativeTokenSource is ); } - uint256 messageID = teleporterMessenger.sendCrossChainMessage( + bytes32 messageID = teleporterMessenger.sendCrossChainMessage( TeleporterMessageInput({ destinationBlockchainID: destinationBlockchainID, destinationAddress: nativeTokenDestinationAddress, diff --git a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/ERC20TokenSourceTests.t.sol b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/ERC20TokenSourceTests.t.sol index 4fb32c22e..9a4515ef2 100644 --- a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/ERC20TokenSourceTests.t.sol +++ b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/ERC20TokenSourceTests.t.sol @@ -5,80 +5,35 @@ pragma solidity 0.8.18; -import {Test} from "forge-std/Test.sol"; +import {NativeTokenBridgeTest} from "./NativeTokenBridgeTest.t.sol"; import { ERC20TokenSource, - IERC20, ITokenSource, TeleporterMessageInput, TeleporterFeeInfo, - IWarpMessenger, ITeleporterMessenger } from "../ERC20TokenSource.sol"; -import {TeleporterRegistry} from "@teleporter/upgrades/TeleporterRegistry.sol"; -import {UnitTestMockERC20} from "@mocks/UnitTestMockERC20.sol"; - -contract ERC20TokenSourceTest is Test { - address public constant MOCK_TELEPORTER_MESSENGER_ADDRESS = - 0x644E5b7c5D4Bc8073732CEa72c66e0BB90dFC00f; - address public constant MOCK_TELEPORTER_REGISTRY_ADDRESS = - 0xf9FA4a0c696b659328DDaaBCB46Ae4eBFC9e68e4; - address public constant WARP_PRECOMPILE_ADDRESS = - address(0x0200000000000000000000000000000000000005); - bytes32 private constant _MOCK_BLOCKCHAIN_ID = bytes32(uint256(123456)); - bytes32 private constant _DEFAULT_OTHER_CHAIN_ID = - bytes32(hex"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"); - address private constant _DEFAULT_OTHER_BRIDGE_ADDRESS = - 0xd54e3E251b9b0EEd3ed70A858e927bbC2659587d; - uint256 private constant _DEFAULT_INITIAL_RESERVE_IMBALANCE = 1000000000; - address private constant _DEFAULT_RECIPIENT = 0xa4CEE7d1aF6aDdDD33E3b1cC680AB84fdf1b6d1d; - uint256 private constant _DEFAULT_TRANSFER_AMOUNT = 1e18; - uint256 private constant _DEFAULT_FEE_AMOUNT = 123456; +contract ERC20TokenSourceTest is NativeTokenBridgeTest { ERC20TokenSource public erc20TokenSource; - UnitTestMockERC20 public mockERC20; event TransferToDestination( address indexed sender, address indexed recipient, - uint256 indexed teleporterMessageID, + bytes32 indexed teleporterMessageID, uint256 amount ); event UnlockTokens(address recipient, uint256 amount); event BurnTokens(uint256 amount); - function setUp() public virtual { - vm.mockCall( - WARP_PRECOMPILE_ADDRESS, - abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector), - abi.encode(_MOCK_BLOCKCHAIN_ID) - ); - vm.mockCall( - MOCK_TELEPORTER_MESSENGER_ADDRESS, - abi.encodeWithSelector(ITeleporterMessenger.sendCrossChainMessage.selector), - abi.encode(1) - ); - - vm.expectCall( - WARP_PRECOMPILE_ADDRESS, abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector) - ); - - _initMockTeleporterRegistry(); - - mockERC20 = new UnitTestMockERC20(); + function setUp() public virtual override { + NativeTokenBridgeTest.setUp(); erc20TokenSource = new ERC20TokenSource( MOCK_TELEPORTER_REGISTRY_ADDRESS, _DEFAULT_OTHER_CHAIN_ID, _DEFAULT_OTHER_BRIDGE_ADDRESS, address(mockERC20) ); - - vm.mockCall( - address(mockERC20), abi.encodeWithSelector(IERC20.allowance.selector), abi.encode(1234) - ); - vm.mockCall( - address(mockERC20), abi.encodeWithSelector(IERC20.approve.selector), abi.encode(true) - ); } function testTransferToDestination() public { @@ -87,7 +42,7 @@ contract ERC20TokenSourceTest is Test { sender: address(this), recipient: _DEFAULT_RECIPIENT, amount: _DEFAULT_TRANSFER_AMOUNT, - teleporterMessageID: 1 + teleporterMessageID: _MOCK_MESSAGE_ID }); TeleporterMessageInput memory expectedMessageInput = TeleporterMessageInput({ @@ -310,43 +265,6 @@ contract ERC20TokenSourceTest is Test { ); } - function _initMockTeleporterRegistry() internal { - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector( - TeleporterRegistry(MOCK_TELEPORTER_REGISTRY_ADDRESS).latestVersion.selector - ), - abi.encode(1) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector( - TeleporterRegistry.getVersionFromAddress.selector, - (MOCK_TELEPORTER_MESSENGER_ADDRESS) - ), - abi.encode(1) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector(TeleporterRegistry.getAddressFromVersion.selector, (1)), - abi.encode(MOCK_TELEPORTER_MESSENGER_ADDRESS) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector(TeleporterRegistry.getVersionFromAddress.selector), - abi.encode(0) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector(TeleporterRegistry.getLatestTeleporter.selector), - abi.encode(ITeleporterMessenger(MOCK_TELEPORTER_MESSENGER_ADDRESS)) - ); - } - function _formatERC20TokenSourceErrorMessage(string memory errorMessage) private pure diff --git a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenBridgeTest.t.sol b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenBridgeTest.t.sol new file mode 100644 index 000000000..e5db60729 --- /dev/null +++ b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenBridgeTest.t.sol @@ -0,0 +1,101 @@ +// (c) 2023, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +// SPDX-License-Identifier: Ecosystem + +pragma solidity 0.8.18; + +import {Test} from "forge-std/Test.sol"; +import {UnitTestMockERC20} from "@mocks/UnitTestMockERC20.sol"; +import {IWarpMessenger} from "@subnet-evm-contracts/interfaces/IWarpMessenger.sol"; +import {ITeleporterMessenger} from "@teleporter/ITeleporterMessenger.sol"; +import {TeleporterRegistry} from "@teleporter/upgrades/TeleporterRegistry.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +contract NativeTokenBridgeTest is Test { + address public constant MOCK_TELEPORTER_MESSENGER_ADDRESS = + 0x644E5b7c5D4Bc8073732CEa72c66e0BB90dFC00f; + address public constant MOCK_TELEPORTER_REGISTRY_ADDRESS = + 0xf9FA4a0c696b659328DDaaBCB46Ae4eBFC9e68e4; + address public constant WARP_PRECOMPILE_ADDRESS = + address(0x0200000000000000000000000000000000000005); + address public constant NATIVE_MINTER_PRECOMPILE_ADDRESS = + address(0x0200000000000000000000000000000000000001); + bytes32 internal constant _MOCK_BLOCKCHAIN_ID = bytes32(uint256(123456)); + bytes32 internal constant _DEFAULT_OTHER_CHAIN_ID = + bytes32(hex"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"); + address internal constant _DEFAULT_OTHER_BRIDGE_ADDRESS = + 0xd54e3E251b9b0EEd3ed70A858e927bbC2659587d; + uint256 internal constant _DEFAULT_INITIAL_RESERVE_IMBALANCE = 1000000000; + address internal constant _DEFAULT_RECIPIENT = 0xa4CEE7d1aF6aDdDD33E3b1cC680AB84fdf1b6d1d; + uint256 internal constant _DEFAULT_TRANSFER_AMOUNT = 1e18; + uint256 internal constant _DEFAULT_FEE_AMOUNT = 123456; + bytes32 internal constant _MOCK_MESSAGE_ID = + bytes32(hex"1111111111111111111111111111111111111111111111111111111111111111"); + + UnitTestMockERC20 public mockERC20; + + function setUp() public virtual { + vm.mockCall( + WARP_PRECOMPILE_ADDRESS, + abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector), + abi.encode(_MOCK_BLOCKCHAIN_ID) + ); + vm.mockCall( + MOCK_TELEPORTER_MESSENGER_ADDRESS, + abi.encodeWithSelector(ITeleporterMessenger.sendCrossChainMessage.selector), + abi.encode(_MOCK_MESSAGE_ID) + ); + + vm.expectCall( + WARP_PRECOMPILE_ADDRESS, abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector) + ); + + _initMockTeleporterRegistry(); + + mockERC20 = new UnitTestMockERC20(); + vm.mockCall( + address(mockERC20), abi.encodeWithSelector(IERC20.allowance.selector), abi.encode(1234) + ); + vm.mockCall( + address(mockERC20), abi.encodeWithSelector(IERC20.approve.selector), abi.encode(true) + ); + } + + function _initMockTeleporterRegistry() internal { + vm.mockCall( + MOCK_TELEPORTER_REGISTRY_ADDRESS, + abi.encodeWithSelector( + TeleporterRegistry(MOCK_TELEPORTER_REGISTRY_ADDRESS).latestVersion.selector + ), + abi.encode(1) + ); + + vm.mockCall( + MOCK_TELEPORTER_REGISTRY_ADDRESS, + abi.encodeWithSelector( + TeleporterRegistry.getVersionFromAddress.selector, + (MOCK_TELEPORTER_MESSENGER_ADDRESS) + ), + abi.encode(1) + ); + + vm.mockCall( + MOCK_TELEPORTER_REGISTRY_ADDRESS, + abi.encodeWithSelector(TeleporterRegistry.getAddressFromVersion.selector, (1)), + abi.encode(MOCK_TELEPORTER_MESSENGER_ADDRESS) + ); + + vm.mockCall( + MOCK_TELEPORTER_REGISTRY_ADDRESS, + abi.encodeWithSelector(TeleporterRegistry.getVersionFromAddress.selector), + abi.encode(0) + ); + + vm.mockCall( + MOCK_TELEPORTER_REGISTRY_ADDRESS, + abi.encodeWithSelector(TeleporterRegistry.getLatestTeleporter.selector), + abi.encode(ITeleporterMessenger(MOCK_TELEPORTER_MESSENGER_ADDRESS)) + ); + } +} diff --git a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenDestinationTests.t.sol b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenDestinationTests.t.sol index dd75a87ec..cc143e521 100644 --- a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenDestinationTests.t.sol +++ b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenDestinationTests.t.sol @@ -5,89 +5,42 @@ pragma solidity 0.8.18; -import {Test} from "forge-std/Test.sol"; +import {NativeTokenBridgeTest} from "./NativeTokenBridgeTest.t.sol"; import { NativeTokenDestination, - IERC20, ITokenSource, TeleporterMessageInput, TeleporterFeeInfo, - IWarpMessenger, ITeleporterMessenger } from "../NativeTokenDestination.sol"; -import {TeleporterRegistry} from "@teleporter/upgrades/TeleporterRegistry.sol"; -import {UnitTestMockERC20} from "@mocks/UnitTestMockERC20.sol"; import {INativeMinter} from "@subnet-evm-contracts/interfaces/INativeMinter.sol"; -contract NativeTokenDestinationTest is Test { - address public constant MOCK_TELEPORTER_MESSENGER_ADDRESS = - 0x644E5b7c5D4Bc8073732CEa72c66e0BB90dFC00f; - address public constant MOCK_TELEPORTER_REGISTRY_ADDRESS = - 0xf9FA4a0c696b659328DDaaBCB46Ae4eBFC9e68e4; - address public constant WARP_PRECOMPILE_ADDRESS = - address(0x0200000000000000000000000000000000000005); - address public constant NATIVE_MINTER_PRECOMPILE_ADDRESS = - address(0x0200000000000000000000000000000000000001); - bytes32 private constant _MOCK_BLOCKCHAIN_ID = bytes32(uint256(123456)); - bytes32 private constant _DEFAULT_OTHER_CHAIN_ID = - bytes32(hex"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"); - address private constant _DEFAULT_OTHER_BRIDGE_ADDRESS = - 0xd54e3E251b9b0EEd3ed70A858e927bbC2659587d; - uint256 private constant _DEFAULT_INITIAL_RESERVE_IMBALANCE = 1000000000; - address private constant _DEFAULT_RECIPIENT = 0xa4CEE7d1aF6aDdDD33E3b1cC680AB84fdf1b6d1d; - uint256 private constant _DEFAULT_TRANSFER_AMOUNT = 1e18; - uint256 private constant _DEFAULT_FEE_AMOUNT = 123456; - +contract NativeTokenDestinationTest is NativeTokenBridgeTest { NativeTokenDestination public nativeTokenDestination; - UnitTestMockERC20 public mockERC20; event TransferToSource( address indexed sender, address indexed recipient, - uint256 indexed teleporterMessageID, + bytes32 indexed teleporterMessageID, uint256 amount ); event CollateralAdded(uint256 amount, uint256 remaining); event NativeTokensMinted(address indexed recipient, uint256 amount); - event ReportTotalBurnedTxFees(uint256 indexed teleporterMessageID, uint256 burnAddressBalance); + event ReportTotalBurnedTxFees(bytes32 indexed teleporterMessageID, uint256 burnAddressBalance); - function setUp() public virtual { - vm.mockCall( - WARP_PRECOMPILE_ADDRESS, - abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector), - abi.encode(_MOCK_BLOCKCHAIN_ID) - ); + function setUp() public virtual override { + NativeTokenBridgeTest.setUp(); vm.mockCall( NATIVE_MINTER_PRECOMPILE_ADDRESS, abi.encodeWithSelector(INativeMinter.mintNativeCoin.selector), "" ); - vm.mockCall( - MOCK_TELEPORTER_MESSENGER_ADDRESS, - abi.encodeWithSelector(ITeleporterMessenger.sendCrossChainMessage.selector), - abi.encode(1) - ); - - vm.expectCall( - WARP_PRECOMPILE_ADDRESS, abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector) - ); - - _initMockTeleporterRegistry(); - nativeTokenDestination = new NativeTokenDestination( MOCK_TELEPORTER_REGISTRY_ADDRESS, _DEFAULT_OTHER_CHAIN_ID, _DEFAULT_OTHER_BRIDGE_ADDRESS, _DEFAULT_INITIAL_RESERVE_IMBALANCE ); - mockERC20 = new UnitTestMockERC20(); - - vm.mockCall( - address(mockERC20), abi.encodeWithSelector(IERC20.allowance.selector), abi.encode(1234) - ); - vm.mockCall( - address(mockERC20), abi.encodeWithSelector(IERC20.approve.selector), abi.encode(true) - ); } function collateralizeBridge() public { @@ -117,7 +70,7 @@ contract NativeTokenDestinationTest is Test { sender: address(this), recipient: _DEFAULT_RECIPIENT, amount: _DEFAULT_TRANSFER_AMOUNT, - teleporterMessageID: 1 + teleporterMessageID: _MOCK_MESSAGE_ID }); TeleporterMessageInput memory expectedMessageInput = TeleporterMessageInput({ @@ -201,7 +154,10 @@ contract NativeTokenDestinationTest is Test { uint256 burnedFees = nativeTokenDestination.BURNED_TX_FEES_ADDRESS().balance; vm.expectEmit(true, true, true, true, address(nativeTokenDestination)); - emit ReportTotalBurnedTxFees({burnAddressBalance: burnedFees, teleporterMessageID: 1}); + emit ReportTotalBurnedTxFees({ + burnAddressBalance: burnedFees, + teleporterMessageID: _MOCK_MESSAGE_ID + }); TeleporterMessageInput memory expectedMessageInput = TeleporterMessageInput({ destinationBlockchainID: _DEFAULT_OTHER_CHAIN_ID, @@ -359,43 +315,6 @@ contract NativeTokenDestinationTest is Test { ); } - function _initMockTeleporterRegistry() internal { - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector( - TeleporterRegistry(MOCK_TELEPORTER_REGISTRY_ADDRESS).latestVersion.selector - ), - abi.encode(1) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector( - TeleporterRegistry.getVersionFromAddress.selector, - (MOCK_TELEPORTER_MESSENGER_ADDRESS) - ), - abi.encode(1) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector(TeleporterRegistry.getAddressFromVersion.selector, (1)), - abi.encode(MOCK_TELEPORTER_MESSENGER_ADDRESS) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector(TeleporterRegistry.getVersionFromAddress.selector), - abi.encode(0) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector(TeleporterRegistry.getLatestTeleporter.selector), - abi.encode(ITeleporterMessenger(MOCK_TELEPORTER_MESSENGER_ADDRESS)) - ); - } - function _formatNativeTokenDestinationErrorMessage(string memory errorMessage) private pure diff --git a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol index 2e01afe07..130796071 100644 --- a/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol +++ b/contracts/src/CrossChainApplications/examples/NativeTokenBridge/tests/NativeTokenSourceTests.t.sol @@ -5,79 +5,34 @@ pragma solidity 0.8.18; -import {Test} from "forge-std/Test.sol"; +import {NativeTokenBridgeTest} from "./NativeTokenBridgeTest.t.sol"; import { NativeTokenSource, - IERC20, ITokenSource, TeleporterMessageInput, TeleporterFeeInfo, - IWarpMessenger, ITeleporterMessenger } from "../NativeTokenSource.sol"; -import {TeleporterRegistry} from "@teleporter/upgrades/TeleporterRegistry.sol"; -import {UnitTestMockERC20} from "@mocks/UnitTestMockERC20.sol"; - -contract NativeTokenSourceTest is Test { - address public constant MOCK_TELEPORTER_MESSENGER_ADDRESS = - 0x644E5b7c5D4Bc8073732CEa72c66e0BB90dFC00f; - address public constant MOCK_TELEPORTER_REGISTRY_ADDRESS = - 0xf9FA4a0c696b659328DDaaBCB46Ae4eBFC9e68e4; - address public constant WARP_PRECOMPILE_ADDRESS = - address(0x0200000000000000000000000000000000000005); - bytes32 private constant _MOCK_BLOCKCHAIN_ID = bytes32(uint256(123456)); - bytes32 private constant _DEFAULT_OTHER_CHAIN_ID = - bytes32(hex"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"); - address private constant _DEFAULT_OTHER_BRIDGE_ADDRESS = - 0xd54e3E251b9b0EEd3ed70A858e927bbC2659587d; - uint256 private constant _DEFAULT_INITIAL_RESERVE_IMBALANCE = 1000000000; - address private constant _DEFAULT_RECIPIENT = 0xa4CEE7d1aF6aDdDD33E3b1cC680AB84fdf1b6d1d; - uint256 private constant _DEFAULT_TRANSFER_AMOUNT = 1e18; - uint256 private constant _DEFAULT_FEE_AMOUNT = 123456; +contract NativeTokenSourceTest is NativeTokenBridgeTest { NativeTokenSource public nativeTokenSource; - UnitTestMockERC20 public mockERC20; event TransferToDestination( address indexed sender, address indexed recipient, - uint256 indexed teleporterMessageID, + bytes32 indexed teleporterMessageID, uint256 amount ); event UnlockTokens(address recipient, uint256 amount); event BurnTokens(uint256 amount); - function setUp() public virtual { - vm.mockCall( - WARP_PRECOMPILE_ADDRESS, - abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector), - abi.encode(_MOCK_BLOCKCHAIN_ID) - ); - vm.mockCall( - MOCK_TELEPORTER_MESSENGER_ADDRESS, - abi.encodeWithSelector(ITeleporterMessenger.sendCrossChainMessage.selector), - abi.encode(1) - ); - - vm.expectCall( - WARP_PRECOMPILE_ADDRESS, abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector) - ); - - _initMockTeleporterRegistry(); - + function setUp() public virtual override { + NativeTokenBridgeTest.setUp(); nativeTokenSource = new NativeTokenSource( MOCK_TELEPORTER_REGISTRY_ADDRESS, _DEFAULT_OTHER_CHAIN_ID, _DEFAULT_OTHER_BRIDGE_ADDRESS ); - mockERC20 = new UnitTestMockERC20(); - - vm.mockCall( - address(mockERC20), abi.encodeWithSelector(IERC20.allowance.selector), abi.encode(1234) - ); - vm.mockCall( - address(mockERC20), abi.encodeWithSelector(IERC20.approve.selector), abi.encode(true) - ); } function testTransferToDestination() public { @@ -86,7 +41,7 @@ contract NativeTokenSourceTest is Test { sender: address(this), recipient: _DEFAULT_RECIPIENT, amount: _DEFAULT_TRANSFER_AMOUNT, - teleporterMessageID: 1 + teleporterMessageID: _MOCK_MESSAGE_ID }); TeleporterMessageInput memory expectedMessageInput = TeleporterMessageInput({ @@ -111,6 +66,17 @@ contract NativeTokenSourceTest is Test { TeleporterFeeInfo({feeTokenAddress: address(mockERC20), amount: _DEFAULT_FEE_AMOUNT}), new address[](0) ); + + vm.expectCall( + MOCK_TELEPORTER_MESSENGER_ADDRESS, + abi.encodeCall(ITeleporterMessenger.sendCrossChainMessage, (expectedMessageInput)) + ); + + nativeTokenSource.transferToDestination{value: _DEFAULT_TRANSFER_AMOUNT}( + _DEFAULT_RECIPIENT, + TeleporterFeeInfo({feeTokenAddress: address(mockERC20), amount: _DEFAULT_FEE_AMOUNT}), + new address[](0) + ); } function testUnlock() public { @@ -306,43 +272,6 @@ contract NativeTokenSourceTest is Test { ); } - function _initMockTeleporterRegistry() internal { - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector( - TeleporterRegistry(MOCK_TELEPORTER_REGISTRY_ADDRESS).latestVersion.selector - ), - abi.encode(1) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector( - TeleporterRegistry.getVersionFromAddress.selector, - (MOCK_TELEPORTER_MESSENGER_ADDRESS) - ), - abi.encode(1) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector(TeleporterRegistry.getVersionFromAddress.selector), - abi.encode(0) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector(TeleporterRegistry.getAddressFromVersion.selector, (1)), - abi.encode(MOCK_TELEPORTER_MESSENGER_ADDRESS) - ); - - vm.mockCall( - MOCK_TELEPORTER_REGISTRY_ADDRESS, - abi.encodeWithSelector(TeleporterRegistry.getLatestTeleporter.selector), - abi.encode(ITeleporterMessenger(MOCK_TELEPORTER_MESSENGER_ADDRESS)) - ); - } - function _formatNativeTokenSourceErrorMessage(string memory errorMessage) private pure diff --git a/contracts/src/CrossChainApplications/examples/VerifiedBlockHash/BlockHashPublisher.sol b/contracts/src/CrossChainApplications/examples/VerifiedBlockHash/BlockHashPublisher.sol index e94002c94..38e513b52 100644 --- a/contracts/src/CrossChainApplications/examples/VerifiedBlockHash/BlockHashPublisher.sol +++ b/contracts/src/CrossChainApplications/examples/VerifiedBlockHash/BlockHashPublisher.sol @@ -47,7 +47,7 @@ contract BlockHashPublisher { function publishLatestBlockHash( bytes32 destinationBlockchainID, address destinationAddress - ) external returns (uint256) { + ) external returns (bytes32) { // Get the latest block info. Note it must the previous block // because the current block hash is not available during execution. uint256 blockHeight = block.number - 1; diff --git a/contracts/src/Teleporter/ITeleporterMessenger.sol b/contracts/src/Teleporter/ITeleporterMessenger.sol index 882729624..840f944fd 100644 --- a/contracts/src/Teleporter/ITeleporterMessenger.sol +++ b/contracts/src/Teleporter/ITeleporterMessenger.sol @@ -5,10 +5,10 @@ pragma solidity 0.8.18; -// A message receipt identifies the message ID that was delivered +// A message receipt identifies the message that was delivered by its nonce, // and the address that can redeem the reward for that message. struct TeleporterMessageReceipt { - uint256 receivedMessageID; + uint256 receivedMessageNonce; address relayerRewardAddress; } @@ -28,7 +28,7 @@ struct TeleporterMessageInput { // Represents a message sent or received by an implementation of {ITeleporterMessenger}. struct TeleporterMessage { - uint256 messageID; + uint256 messageNonce; address senderAddress; bytes32 destinationBlockchainID; address destinationAddress; @@ -52,12 +52,17 @@ struct TeleporterFeeInfo { * @custom:security-contact https://github.com/ava-labs/teleporter/blob/main/SECURITY.md */ interface ITeleporterMessenger { + /** + * Emitted when the blockchain ID of the contract instance is initialized using the Warp precompile. + */ + event BlockchainIDInitialized(bytes32 indexed blockchainID); + /** * @dev Emitted when sending a Teleporter message cross-chain. */ event SendCrossChainMessage( + bytes32 indexed messageID, bytes32 indexed destinationBlockchainID, - uint256 indexed messageID, TeleporterMessage message, TeleporterFeeInfo feeInfo ); @@ -66,18 +71,14 @@ interface ITeleporterMessenger { * @dev Emitted when an additional fee amount is added to a Teleporter message that had previously * been sent, but not yet delivered to the destination chain. */ - event AddFeeAmount( - bytes32 indexed destinationBlockchainID, - uint256 indexed messageID, - TeleporterFeeInfo updatedFeeInfo - ); + event AddFeeAmount(bytes32 indexed messageID, TeleporterFeeInfo updatedFeeInfo); /** * @dev Emitted when a Teleporter message is being delivered on the destination chain to an address, * but message execution fails. Failed messages can then be retried with `retryMessageExecution` */ event MessageExecutionFailed( - bytes32 indexed originBlockchainID, uint256 indexed messageID, TeleporterMessage message + bytes32 indexed messageID, bytes32 indexed originBlockchainID, TeleporterMessage message ); /** @@ -87,14 +88,14 @@ interface ITeleporterMessenger { * * Each message received can be executed successfully at most once. */ - event MessageExecuted(bytes32 indexed originBlockchainID, uint256 indexed messageID); + event MessageExecuted(bytes32 indexed messageID, bytes32 indexed originBlockchainID); /** * @dev Emitted when a TeleporterMessage is successfully received. */ event ReceiveCrossChainMessage( + bytes32 indexed messageID, bytes32 indexed originBlockchainID, - uint256 indexed messageID, address indexed deliverer, address rewardRedeemer, TeleporterMessage message @@ -111,7 +112,7 @@ interface ITeleporterMessenger { */ function sendCrossChainMessage(TeleporterMessageInput calldata messageInput) external - returns (uint256); + returns (bytes32); /** * @dev Called by transactions to retry the sending of a cross-chain message. @@ -122,10 +123,7 @@ interface ITeleporterMessenger { * The message is checked to have already been previously submitted by comparing its message hash against those kept in * state until a receipt is received for the message. */ - function retrySendCrossChainMessage( - bytes32 destinationBlockchainID, - TeleporterMessage calldata message - ) external; + function retrySendCrossChainMessage(TeleporterMessage calldata message) external; /** * @dev Adds the additional fee amount to the amount to be paid to the relayer that delivers @@ -136,8 +134,7 @@ interface ITeleporterMessenger { * receipt of delivery of the message. */ function addFeeAmount( - bytes32 destinationBlockchainID, - uint256 messageID, + bytes32 messageID, address feeTokenAddress, uint256 additionalFeeAmount ) external; @@ -174,10 +171,10 @@ interface ITeleporterMessenger { */ function sendSpecifiedReceipts( bytes32 originBlockchainID, - uint256[] calldata messageIDs, + bytes32[] calldata messageIDs, TeleporterFeeInfo calldata feeInfo, address[] calldata allowedRelayerAddresses - ) external returns (uint256); + ) external returns (bytes32); /** * @dev Sends any fee amount rewards for the given fee asset out to the caller. @@ -188,29 +185,20 @@ interface ITeleporterMessenger { * @dev Gets the hash of a given message stored in the EVM state, if the message exists. * @return The message hash */ - function getMessageHash( - bytes32 destinationBlockchainID, - uint256 messageID - ) external view returns (bytes32); + function getMessageHash(bytes32 messageID) external view returns (bytes32); /** * @dev Checks whether or not the given message has been received by this chain. * @return Boolean representing if the given message has been received. */ - function messageReceived( - bytes32 originBlockchainID, - uint256 messageID - ) external view returns (bool); + function messageReceived(bytes32 messageID) external view returns (bool); /** * @dev Returns the address the relayer reward should be sent to on the origin chain * for a given message, assuming that the message has already been delivered. * @return The relayer reward address for the given message. */ - function getRelayerRewardAddress( - bytes32 originBlockchainID, - uint256 messageID - ) external view returns (address); + function getRelayerRewardAddress(bytes32 messageID) external view returns (address); /** * @dev Gets the current reward amount of a given fee asset that is redeemable by the given relayer. @@ -222,19 +210,21 @@ interface ITeleporterMessenger { ) external view returns (uint256); /** - * @dev Gets the fee token address and amount for a given message. - * @return The fee token address and fee amount for a the given message. + * @dev Gets the fee token address and amount for a given sent message. + * @return The fee token address and fee amount for a the given sent message ID. + * If the message ID is not found, zero address and amount values are returned. */ - function getFeeInfo( - bytes32 destinationBlockchainID, - uint256 messageID - ) external view returns (address, uint256); + function getFeeInfo(bytes32 messageID) external view returns (address, uint256); /** - * @dev Gets the next message ID to be used for a given chain ID. - * @return The next message ID to be used to send a message to the given chain ID. + * @dev Gets the message ID that would currently be used for the next message sent from the contract + * instance to the given destination blockchain. Note that this message ID may never be used in the + * event that the next call to sendCrossChainMessage in a transaction uses a different destination + * blockchain. The current value as returned by this function will change with each successful call + * to sendCrossChainMessage. + * @return The specified message ID. */ - function getNextMessageID(bytes32 destinationBlockchainID) external view returns (uint256); + function getNextMessageID(bytes32 destinationBlockchainID) external view returns (bytes32); /** * @dev Gets the number of receipts that are waiting to be sent to the given origin chain ID. diff --git a/contracts/src/Teleporter/TeleporterMessenger.sol b/contracts/src/Teleporter/TeleporterMessenger.sol index 16c4cb96f..336c84140 100644 --- a/contracts/src/Teleporter/TeleporterMessenger.sol +++ b/contracts/src/Teleporter/TeleporterMessenger.sol @@ -43,42 +43,39 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { IWarpMessenger public constant WARP_MESSENGER = IWarpMessenger(0x0200000000000000000000000000000000000005); - // The blockchain ID of the chain the contract is deployed on. Initialized lazily on the first call of `receiveCrossChainMessage` + // The blockchain ID of the chain the contract is deployed on. Can be initialized by calling initializeBlockchainID, + // or will be initialized automatically on the first successful call to send or receive a message. bytes32 public blockchainID; - // Tracks the latest message ID used for a given destination chain. - // Key is the destination blockchain ID, and the value is the last message ID used for that chain. - // Note that the first message ID used for each chain will be 1 (not 0). - mapping(bytes32 destinationBlockchainID => uint256 messageID) public latestMessageIDs; + // A monotonically incremented integer tracking the total number of messages sent by this TeleporterMessenger contract. + // Used to provide uniqueness when generating message IDs for new messages. Initially starts at 1 such that the + // nonce value can be used to provide replay protection. + uint256 public messageNonce = 1; // Tracks the outstanding receipts to send back to a given chain in subsequent messages sent to that chain. - // Key is the blockchain ID of the other chain, and the value is a queue of pending receipts for messages + // The key is the blockchain ID of the other chain, and the value is a queue of pending receipts for messages // received from that chain. mapping(bytes32 sourceBlockchainID => ReceiptQueue.TeleporterMessageReceiptQueue receiptQueue) public receiptQueues; // Tracks the message hash and fee information for each message sent that has yet to be acknowledged - // with a receipt. The messages are tracked per chain and keyed by message ID. - // The first key is the blockchain ID of the destination chain, the second key is the message ID, and the value is the info - // for the uniquely identified message. - mapping( - bytes32 destinationBlockchainID => mapping(uint256 messageID => SentMessageInfo messageInfo) - ) public sentMessageInfo; + // with a receipt. The key is the message ID, and the value is the info for the uniquely identified message. + mapping(bytes32 messageID => SentMessageInfo messageInfo) public sentMessageInfo; - // Tracks the hash of messages that have been received but whose execution has never succeeded. + // Tracks the hash of messages that have been received but have never succeeded in execution. // Enables retrying of failed messages with higher gas limits. Message execution is guaranteed to - // succeed at most once. The first key is the blockchain ID of the sending chain, the second key is the message ID, and - // the value is the hash of the uniquely identified message whose execution failed. - mapping(bytes32 sourceBlockchainID => mapping(uint256 messageID => bytes32 messageHash)) public - receivedFailedMessageHashes; - - // Tracks the relayer reward address for each message delivered from a given chain. - // Note that these values are also used to determine if a given message has been delivered or not. - // The first key is the blockchain ID, the second key is the message ID, and the value is the reward address - // provided by the deliverer of the uniquely identified message. - mapping( - bytes32 sourceBlockchainID => mapping(uint256 messageID => address relayerRewardAddress) - ) internal _relayerRewardAddresses; + // succeed at most once. The key is the message ID, and the value is the hash of the uniquely + // identified message whose execution failed. + mapping(bytes32 messageID => bytes32 messageHash) public receivedFailedMessageHashes; + + // Tracks the message nonce for each message that has been received. The key is the message ID, + // and the value is the nonce value that was received as a part of that message. + // Note: the `messageNonce` values are also used to determine if a given message has been received or not. + mapping(bytes32 messageID => uint256 messageNonce) internal _receivedMessageNonces; + + // Tracks the relayer reward address for each message that has been received. + // The key is the message ID, and the value is the reward address provided by the deliverer of the message. + mapping(bytes32 messageID => address relayerRewardAddress) internal _relayerRewardAddresses; // Tracks the reward amounts for a given asset able to be redeemed by a given relayer. // The first key is the relayer reward address, the second key is the fee token contract address, @@ -99,7 +96,7 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { function sendCrossChainMessage(TeleporterMessageInput calldata messageInput) external senderNonReentrant - returns (uint256) + returns (bytes32) { // Get the outstanding receipts for messages that have been previously received // from the destination chain but not yet acknowledged, and attach the receipts @@ -116,16 +113,22 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { * Emits a {SendCrossChainMessage} event. * Requirements: * - * - `message` must have been previously sent to the given `destinationBlockchainID`. + * - `message` must have been previously sent. * - `message` encoding must match previously sent message. */ - function retrySendCrossChainMessage( - bytes32 destinationBlockchainID, - TeleporterMessage calldata message - ) external senderNonReentrant { + function retrySendCrossChainMessage(TeleporterMessage calldata message) + external + senderNonReentrant + { + // Calculate the message ID based on the message nonce. + // If the blockchain ID has yet to be initialized, no messages have ever been sent by + // this contract, meaning that the message to be retried will not be found in any event. + // Thus, don't need to initialize the blockchain ID here. + bytes32 messageID = + calculateMessageID(blockchainID, message.destinationBlockchainID, message.messageNonce); + // Get the previously sent message hash. - SentMessageInfo memory existingMessageInfo = - sentMessageInfo[destinationBlockchainID][message.messageID]; + SentMessageInfo memory existingMessageInfo = sentMessageInfo[messageID]; // If the message hash is zero, the message was never sent. require( existingMessageInfo.messageHash != bytes32(0), "TeleporterMessenger: message not found" @@ -141,7 +144,7 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { // Emit and make state variable changes before external calls when possible, // though this function is protected by sender reentrancy guard. emit SendCrossChainMessage( - destinationBlockchainID, message.messageID, message, existingMessageInfo.feeInfo + messageID, message.destinationBlockchainID, message, existingMessageInfo.feeInfo ); // Resubmit the message to the warp precompile now that we know @@ -156,12 +159,11 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { * Requirements: * * - `additionalFeeAmount` must be non-zero. - * - `message` must exist and not have been delivered yet. + * - `message` must exist and not have been acknowledged with a receipt yet. * - `feeTokenAddress` must match the fee asset contract address used in the original call to `sendCrossChainMessage`. */ function addFeeAmount( - bytes32 destinationBlockchainID, - uint256 messageID, + bytes32 messageID, address feeTokenAddress, uint256 additionalFeeAmount ) external senderNonReentrant { @@ -177,7 +179,7 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { // will be cleared from state. At this point, you can not add to its fee. This is also the // case if the given message never existed. require( - sentMessageInfo[destinationBlockchainID][messageID].messageHash != bytes32(0), + sentMessageInfo[messageID].messageHash != bytes32(0), "TeleporterMessenger: message not found" ); @@ -187,8 +189,7 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { // the previously submitted asset type as a defensive measure to avoid having users accidentally confuse // which asset they are paying. require( - sentMessageInfo[destinationBlockchainID][messageID].feeInfo.feeTokenAddress - == feeTokenAddress, + sentMessageInfo[messageID].feeInfo.feeTokenAddress == feeTokenAddress, "TeleporterMessenger: invalid fee asset contract address" ); @@ -197,13 +198,9 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { SafeERC20TransferFrom.safeTransferFrom(IERC20(feeTokenAddress), additionalFeeAmount); // Store the updated fee amount, and emit it as an event. - sentMessageInfo[destinationBlockchainID][messageID].feeInfo.amount += adjustedAmount; + sentMessageInfo[messageID].feeInfo.amount += adjustedAmount; - emit AddFeeAmount( - destinationBlockchainID, - messageID, - sentMessageInfo[destinationBlockchainID][messageID].feeInfo - ); + emit AddFeeAmount(messageID, sentMessageInfo[messageID].feeInfo); } /** @@ -217,19 +214,13 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { * - `messageIndex` must specify a valid warp message in the transaction's storage slots. * - Valid warp message provided in storage slots, and sender address matches the address of this contract. * - Teleporter message `destinationBlockchainID` must match the `blockchainID` of this contract. - * - Teleporter message was not previously delivered. + * - Teleporter message was not previously received. * - Transaction was sent by an allowed relayer for corresponding teleporter message. */ function receiveCrossChainMessage( uint32 messageIndex, address relayerRewardAddress ) external receiverNonReentrant { - // The relayer reward address is not allowed to be the zero address because it is how the - // contract tracks whether or not a message has been delivered. - require( - relayerRewardAddress != address(0), "TeleporterMessenger: zero relayer reward address" - ); - // Verify and parse the cross chain message included in the transaction access list // using the warp message precompile. (WarpMessage memory warpMessage, bool success) = @@ -245,47 +236,46 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { "TeleporterMessenger: invalid origin sender address" ); - // If the blockchain ID has yet to be initialized, do so now. - bytes32 blockchainID_ = blockchainID; - if (blockchainID_ == bytes32(0)) { - blockchainID_ = WARP_MESSENGER.getBlockchainID(); - blockchainID = blockchainID_; - } - // Parse the payload of the message. TeleporterMessage memory teleporterMessage = abi.decode(warpMessage.payload, (TeleporterMessage)); + // If the blockchain ID has yet to be initialized, do so now. + bytes32 blockchainID_ = initializeBlockchainID(); + // Require that the message was intended for this blockchain. require( teleporterMessage.destinationBlockchainID == blockchainID_, "TeleporterMessenger: invalid destination chain ID" ); - // Require that the message has not been delivered previously. - require( - !_messageReceived(warpMessage.sourceChainID, teleporterMessage.messageID), - "TeleporterMessenger: message already delivered" + // Calculate the message ID of the message given the source blockchain ID and message nonce. + bytes32 messageID = calculateMessageID( + warpMessage.sourceChainID, blockchainID_, teleporterMessage.messageNonce ); + // Require that the message has not been received previously. + require(!_messageReceived(messageID), "TeleporterMessenger: message already received"); + // Check that the caller is allowed to deliver this message. require( _checkIsAllowedRelayer(msg.sender, teleporterMessage.allowedRelayerAddresses), "TeleporterMessenger: unauthorized relayer" ); - // Store the relayer reward address provided, effectively marking the message as received. - _relayerRewardAddresses[warpMessage.sourceChainID][teleporterMessage.messageID] = - relayerRewardAddress; + // Mark the message as received. + _markMessageReceived(messageID, teleporterMessage.messageNonce); + + // Store the relayer reward address if non-zero. + if (relayerRewardAddress != address(0)) { + _relayerRewardAddresses[messageID] = relayerRewardAddress; + } // Process the receipts that were included in the teleporter message by paying the // fee for the messages are reward to the given relayers. uint256 length = teleporterMessage.receipts.length; for (uint256 i; i < length; ++i) { - TeleporterMessageReceipt memory receipt = teleporterMessage.receipts[i]; - _markReceipt( - warpMessage.sourceChainID, receipt.receivedMessageID, receipt.relayerRewardAddress - ); + _markReceipt(blockchainID_, warpMessage.sourceChainID, teleporterMessage.receipts[i]); } // Store the receipt of this message delivery. @@ -294,14 +284,14 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { receiptsQueue.enqueue( TeleporterMessageReceipt({ - receivedMessageID: teleporterMessage.messageID, + receivedMessageNonce: teleporterMessage.messageNonce, relayerRewardAddress: relayerRewardAddress }) ); emit ReceiveCrossChainMessage( + messageID, warpMessage.sourceChainID, - teleporterMessage.messageID, msg.sender, relayerRewardAddress, teleporterMessage @@ -309,7 +299,7 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { // Execute the message. if (teleporterMessage.message.length > 0) { - _handleInitialMessageExecution(warpMessage.sourceChainID, teleporterMessage); + _handleInitialMessageExecution(messageID, warpMessage.sourceChainID, teleporterMessage); } } @@ -332,9 +322,15 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { bytes32 originBlockchainID, TeleporterMessage calldata message ) external receiverNonReentrant { + // Calculate the message ID based on the origin blockchainID and message nonce. + // If the blockchain ID has yet to be initialized, no messages have ever been received by + // this contract, meaning that the message to be retried will not be found in any event. + // Thus, don't need to initialize the blockchain ID here. + bytes32 messageID = + calculateMessageID(originBlockchainID, blockchainID, message.messageNonce); + // Check that the hash of the payload provided matches the hash of the payload that previously failed to execute. - bytes32 failedMessageHash = - receivedFailedMessageHashes[originBlockchainID][message.messageID]; + bytes32 failedMessageHash = receivedFailedMessageHashes[messageID]; require(failedMessageHash != bytes32(0), "TeleporterMessenger: message not found"); require( keccak256(abi.encode(message)) == failedMessageHash, @@ -350,9 +346,9 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { // Clear the failed message hash from state prior to retrying its execution to redundantly prevent // reentrance attacks (on top of the nonReentrant guard). - emit MessageExecuted(originBlockchainID, message.messageID); - delete receivedFailedMessageHashes[originBlockchainID][ - message.messageID + emit MessageExecuted(messageID, originBlockchainID); + delete receivedFailedMessageHashes[ + messageID ]; // Re-encode the payload by ABI encoding a call to the {receiveTeleporterMessage} function @@ -365,7 +361,7 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { ); // Reattempt the message execution with all of the gas left available for execution of this transaction. - // Use all of the gas left because this message has already been successfully delivered, and it is the + // Use all of the gas left because this message has already been successfully received, and it is the // caller's responsibility to provide as much gas as is needed. Compared to the initial delivery, where // the relayer should still receive their reward even if the message execution takes more gas than expected. // Require that the call be successful such that in the failure case this transaction reverts and the @@ -393,23 +389,38 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { */ function sendSpecifiedReceipts( bytes32 originBlockchainID, - uint256[] calldata messageIDs, + bytes32[] calldata messageIDs, TeleporterFeeInfo calldata feeInfo, address[] calldata allowedRelayerAddresses - ) external senderNonReentrant returns (uint256) { + ) external senderNonReentrant returns (bytes32) { + // If the blockchain ID has yet to be initialized, no messages have ever been received by + // this contract, meaning that the receipt(s) will not be found in any event. + // Thus, don't need to initialize the blockchain ID here. + bytes32 blockchainID_ = blockchainID; + // Iterate through the specified message IDs and create teleporter receipts to send back. TeleporterMessageReceipt[] memory receiptsToSend = new TeleporterMessageReceipt[]( messageIDs.length ); for (uint256 i; i < messageIDs.length; ++i) { - uint256 receivedMessageID = messageIDs[i]; + bytes32 receivedMessageID = messageIDs[i]; + + // Get the nonce for this message ID. + uint256 receivedMessageNonce = _receivedMessageNonces[receivedMessageID]; + require(receivedMessageNonce != 0, "TeleporterMessenger: receipt not found"); + + // Check that the message ID was received from the specified origin blockchain. + require( + receivedMessageID + == calculateMessageID(originBlockchainID, blockchainID_, receivedMessageNonce), + "TeleporterMessenger: message ID not from origin blockchain" + ); + // Get the relayer reward address for the message. - address relayerRewardAddress = - _relayerRewardAddresses[originBlockchainID][receivedMessageID]; - require(relayerRewardAddress != address(0), "TeleporterMessenger: receipt not found"); + address relayerRewardAddress = _relayerRewardAddresses[receivedMessageID]; receiptsToSend[i] = TeleporterMessageReceipt({ - receivedMessageID: receivedMessageID, + receivedMessageNonce: receivedMessageNonce, relayerRewardAddress: relayerRewardAddress }); } @@ -453,31 +464,23 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { /** * See {ITeleporterMessenger-getMessageHash} */ - function getMessageHash( - bytes32 destinationBlockchainID, - uint256 messageID - ) external view returns (bytes32) { - return sentMessageInfo[destinationBlockchainID][messageID].messageHash; + function getMessageHash(bytes32 messageID) external view returns (bytes32) { + return sentMessageInfo[messageID].messageHash; } /** * @dev See {ITeleporterMessenger-messageReceived} */ - function messageReceived( - bytes32 originBlockchainID, - uint256 messageID - ) external view returns (bool) { - return _messageReceived(originBlockchainID, messageID); + function messageReceived(bytes32 messageID) external view returns (bool) { + return _messageReceived(messageID); } /** * @dev See {ITeleporterMessenger-getRelayerRewardAddress} */ - function getRelayerRewardAddress( - bytes32 originBlockchainID, - uint256 messageID - ) external view returns (address) { - return _relayerRewardAddresses[originBlockchainID][messageID]; + function getRelayerRewardAddress(bytes32 messageID) external view returns (address) { + require(_messageReceived(messageID), "TeleporterMessenger: message not received"); + return _relayerRewardAddresses[messageID]; } /** @@ -493,20 +496,19 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { /** * @dev See {ITeleporterMessenger-getFeeInfo} */ - function getFeeInfo( - bytes32 destinationBlockchainID, - uint256 messageID - ) external view returns (address, uint256) { - TeleporterFeeInfo memory feeInfo = - sentMessageInfo[destinationBlockchainID][messageID].feeInfo; + function getFeeInfo(bytes32 messageID) external view returns (address, uint256) { + TeleporterFeeInfo memory feeInfo = sentMessageInfo[messageID].feeInfo; return (feeInfo.feeTokenAddress, feeInfo.amount); } /** - * @dev Returns the next message ID to be used to send a message to the given blockchain ID. + * @dev Gets the next message ID to be used for a message sent from the contract instance. + * @return The next message ID to be used for a message sent from the contract instance. */ - function getNextMessageID(bytes32 destinationBlockchainID) external view returns (uint256) { - return _getNextMessageID(destinationBlockchainID); + function getNextMessageID(bytes32 destinationBlockchainID) external view returns (bytes32) { + bytes32 blockchainID_ = blockchainID; + require(blockchainID_ != bytes32(0), "TeleporterMessenger: zero blockchain ID"); + return calculateMessageID(blockchainID_, destinationBlockchainID, messageNonce); } /** @@ -526,15 +528,42 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { return receiptQueues[originBlockchainID].getReceiptAtIndex(index); } + /** + * @dev If not already set, initializes blockchainID by getting the current + * blockchain ID value from the Warp precompile. + * Emits {BlockchainIDInitialized} event. + * @return The current blockchain ID. + */ + function initializeBlockchainID() public returns (bytes32) { + bytes32 blockchainID_ = blockchainID; + if (blockchainID_ == bytes32(0)) { + blockchainID_ = WARP_MESSENGER.getBlockchainID(); + require(blockchainID_ != bytes32(0), "TeleporterMessenger: zero blockchain ID"); + blockchainID = blockchainID_; + emit BlockchainIDInitialized(blockchainID_); + } + return blockchainID_; + } + + /** + * @dev Calculates the message ID for a message sent from this contract instance with the + * given source blockchain ID, destination blockchain ID, and message nonce. + */ + function calculateMessageID( + bytes32 sourceBlockchainID, + bytes32 destinationBlockchainID, + uint256 nonce + ) public view returns (bytes32) { + return + keccak256(abi.encode(address(this), sourceBlockchainID, destinationBlockchainID, nonce)); + } + /** * @dev Checks if a given message has been received. * @return A boolean representing if the given message has been received or not. */ - function _messageReceived( - bytes32 originBlockchainID, - uint256 messageID - ) internal view returns (bool) { - return _relayerRewardAddresses[originBlockchainID][messageID] != address(0); + function _messageReceived(bytes32 messageID) internal view returns (bool) { + return _receivedMessageNonces[messageID] != 0; } /** @@ -568,13 +597,18 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { function _sendTeleporterMessage( TeleporterMessageInput memory messageInput, TeleporterMessageReceipt[] memory receipts - ) private returns (uint256) { + ) private returns (bytes32) { + // If the blockchain ID has yet to be initialized, do so now. + bytes32 blockchainID_ = initializeBlockchainID(); + // Get the message ID to use for this message. - uint256 messageID = _getNextMessageID(messageInput.destinationBlockchainID); + uint256 messageNonce_ = messageNonce; + bytes32 messageID = + calculateMessageID(blockchainID_, messageInput.destinationBlockchainID, messageNonce_); // Construct and serialize the message. TeleporterMessage memory teleporterMessage = TeleporterMessage({ - messageID: messageID, + messageNonce: messageNonce_, senderAddress: msg.sender, destinationBlockchainID: messageInput.destinationBlockchainID, destinationAddress: messageInput.destinationAddress, @@ -585,8 +619,8 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { }); bytes memory teleporterMessageBytes = abi.encode(teleporterMessage); - // Set the message ID value as being used. - latestMessageIDs[messageInput.destinationBlockchainID] = messageID; + // Increment the message nonce so the next message will have a different ID + ++messageNonce; // If the fee amount is non-zero, transfer the asset into control of this TeleporterMessenger contract instance. // The fee is allowed to be 0 because it's possible for someone to run their own relayer and deliver their own messages, @@ -611,13 +645,13 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { feeTokenAddress: messageInput.feeInfo.feeTokenAddress, amount: adjustedFeeAmount }); - sentMessageInfo[messageInput.destinationBlockchainID][messageID] = SentMessageInfo({ + sentMessageInfo[messageID] = SentMessageInfo({ messageHash: keccak256(teleporterMessageBytes), feeInfo: adjustedFeeInfo }); emit SendCrossChainMessage( - messageInput.destinationBlockchainID, messageID, teleporterMessage, adjustedFeeInfo + messageID, messageInput.destinationBlockchainID, teleporterMessage, adjustedFeeInfo ); // Submit the message to the AWM precompile. @@ -626,6 +660,16 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { return messageID; } + /** + * @dev Marks a message as being received by storing the message nonce associated with the + * given message ID. The message nonce must not be zero in order to be able to distinguish between + * received and unreceived messages based on their ID. + */ + function _markMessageReceived(bytes32 messageID, uint256 messageNonce_) private { + require(messageNonce_ != 0, "TeleporterMessenger: zero message nonce"); + _receivedMessageNonces[messageID] = messageNonce_; + } + /** * @dev Records the receival of a receipt for a message previously sent to the `destinationBlockchainID` with the given `messageID`. * @@ -633,12 +677,16 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { * the message information from `sentMessageInfo` and increments the reward redeemable by the specified relayer reward address. */ function _markReceipt( - bytes32 destinationBlockchainID, - uint256 messageID, - address relayerRewardAddress + bytes32 sourceBlockchainID_, + bytes32 destinationBlockchainID_, + TeleporterMessageReceipt memory receipt ) private { + bytes32 messageID = calculateMessageID( + sourceBlockchainID_, destinationBlockchainID_, receipt.receivedMessageNonce + ); + // Get the information about the sent message to be marked as received. - SentMessageInfo memory messageInfo = sentMessageInfo[destinationBlockchainID][messageID]; + SentMessageInfo memory messageInfo = sentMessageInfo[messageID]; // If the message hash does not exist, it could be the case that the receipt was already // received for this message (it's possible for receipts to be sent more than once) @@ -648,17 +696,17 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { return; } - // Delete the message information from state now that it is known to be delivered. - delete sentMessageInfo[destinationBlockchainID][messageID]; + // Delete the message information from state now that it is known to be received. + delete sentMessageInfo[messageID]; // Increment the fee/reward amount owed to the relayer for having delivered // the message identified in this receipt. - _relayerRewardAmounts[relayerRewardAddress][messageInfo.feeInfo.feeTokenAddress] += + _relayerRewardAmounts[receipt.relayerRewardAddress][messageInfo.feeInfo.feeTokenAddress] += messageInfo.feeInfo.amount; } /** - * @dev Attempts to execute the newly delivered message. + * @dev Attempts to execute the newly received message. * * Only revert in the event that the message deliverer (relayer) did not provide enough gas to handle the execution * (including possibly storing a failed message in state). All execution specific errors (i.e. invalid call data, etc) @@ -671,11 +719,12 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { * - There is enough gas left to cover `message.requiredGasLimit`. */ function _handleInitialMessageExecution( + bytes32 messageID, bytes32 originBlockchainID, TeleporterMessage memory message ) private { // Check that the message delivery was provided the required gas amount as specified by the sender. - // If the required gas amount is provided, the message will be considered delivered whether or not + // If the required gas amount is provided, the message will be considered received whether or not // its execution succeeds, such that the relayer can claim their fee reward. However, if the message // execution fails, the message hash will be stored in state such that anyone can try to provide more // gas to successfully execute the message. @@ -686,7 +735,7 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { // execution so that it can be retried in the future should a contract be later deployed to // the address. if (message.destinationAddress.code.length == 0) { - _storeFailedMessageExecution(originBlockchainID, message); + _storeFailedMessageExecution(messageID, originBlockchainID, message); return; } @@ -704,14 +753,14 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { // If the execution failed, store a hash of the message in state such that its // execution can be retried again in the future with a higher gas limit (paid by whoever - // retries). Either way, the message will now be considered "delivered" since the relayer + // retries). Either way, the message will now be considered received since the relayer // provided enough gas to meet the required gas limit. if (!success) { - _storeFailedMessageExecution(originBlockchainID, message); + _storeFailedMessageExecution(messageID, originBlockchainID, message); return; } - emit MessageExecuted(originBlockchainID, message.messageID); + emit MessageExecuted(messageID, originBlockchainID); } function _tryExecuteMessage( @@ -742,24 +791,17 @@ contract TeleporterMessenger is ITeleporterMessenger, ReentrancyGuards { } /** - * @dev Stores the hash of a message that has been successfully delivered but fails to execute properly + * @dev Stores the hash of a message that has been successfully received but fails to execute properly * such that the message execution can be retried by anyone in the future. */ function _storeFailedMessageExecution( + bytes32 messageID, bytes32 originBlockchainID, TeleporterMessage memory message ) private { - receivedFailedMessageHashes[originBlockchainID][message.messageID] = - keccak256(abi.encode(message)); + receivedFailedMessageHashes[messageID] = keccak256(abi.encode(message)); // Emit a failed execution event for anyone monitoring unsuccessful messages to retry. - emit MessageExecutionFailed(originBlockchainID, message.messageID, message); - } - - /** - * @dev Returns the next message ID to be used to send a message to the given `originBlockchainID`. - */ - function _getNextMessageID(bytes32 originBlockchainID) private view returns (uint256) { - return latestMessageIDs[originBlockchainID] + 1; + emit MessageExecutionFailed(messageID, originBlockchainID, message); } } diff --git a/contracts/src/Teleporter/tests/AddFeeAmountTests.t.sol b/contracts/src/Teleporter/tests/AddFeeAmountTests.t.sol index f4edf8e57..6b9083255 100644 --- a/contracts/src/Teleporter/tests/AddFeeAmountTests.t.sol +++ b/contracts/src/Teleporter/tests/AddFeeAmountTests.t.sol @@ -23,7 +23,8 @@ contract AddFeeAmountTest is TeleporterMessengerTest { function testSuccess() public { // First submit a message with a small fee uint256 originalFeeAmount = 10; - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, originalFeeAmount); + bytes32 messageID = + _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, originalFeeAmount); // Add to the fee uint256 additionalFeeAmount = 131313; @@ -37,17 +38,14 @@ contract AddFeeAmountTest is TeleporterMessengerTest { ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit AddFeeAmount( - DEFAULT_DESTINATION_CHAIN_ID, messageID, TeleporterFeeInfo({feeTokenAddress: address(_mockFeeAsset), amount: totalFeeAmount}) ); - teleporterMessenger.addFeeAmount( - DEFAULT_DESTINATION_CHAIN_ID, messageID, address(_mockFeeAsset), additionalFeeAmount - ); + teleporterMessenger.addFeeAmount(messageID, address(_mockFeeAsset), additionalFeeAmount); // Get the fee info to make sure it is properly updated. (address actualFeeAsset, uint256 actualFeeAmount) = - teleporterMessenger.getFeeInfo(DEFAULT_DESTINATION_CHAIN_ID, messageID); + teleporterMessenger.getFeeInfo(messageID); assertEq(actualFeeAsset, address(_mockFeeAsset)); assertEq(actualFeeAmount, totalFeeAmount); } @@ -55,81 +53,77 @@ contract AddFeeAmountTest is TeleporterMessengerTest { function testInvalidMessage() public { // Add to the fee amount of a message that doesn't exist. Expect revert. uint256 additionalFeeAmount = 131313; - uint256 fakeMessageID = 13; + bytes32 fakeMessageID = bytes32(uint256(13)); vm.expectRevert(_formatTeleporterErrorMessage("message not found")); - teleporterMessenger.addFeeAmount( - DEFAULT_DESTINATION_CHAIN_ID, fakeMessageID, address(_mockFeeAsset), additionalFeeAmount - ); + teleporterMessenger.addFeeAmount(fakeMessageID, address(_mockFeeAsset), additionalFeeAmount); } function testMessageAlreadyDelivered() public { // First submit a message with a small fee uint256 originalFeeAmount = 10; - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, originalFeeAmount); + uint256 expectedNonce = teleporterMessenger.messageNonce(); + bytes32 messageID = + _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, originalFeeAmount); // Now mock receiving a message back from that subnet with a receipt of the above message. address relayerRewardAddress = 0xA66884fAdC0D4d7B7eedcF61Eb863Ff413bB6234; TeleporterMessageReceipt[] memory receipts = new TeleporterMessageReceipt[](1); receipts[0] = TeleporterMessageReceipt({ - receivedMessageID: messageID, + receivedMessageNonce: expectedNonce, relayerRewardAddress: relayerRewardAddress }); - _receiveTestMessage(DEFAULT_DESTINATION_CHAIN_ID, messageID, relayerRewardAddress, receipts); + _receiveTestMessage(DEFAULT_DESTINATION_BLOCKCHAIN_ID, 1, relayerRewardAddress, receipts); // Now try to add to the fee of the message. Should revert since the message receipt was received already. uint256 additionalFeeAmount = 131313; vm.expectRevert(_formatTeleporterErrorMessage("message not found")); - teleporterMessenger.addFeeAmount( - DEFAULT_DESTINATION_CHAIN_ID, messageID, address(_mockFeeAsset), additionalFeeAmount - ); + teleporterMessenger.addFeeAmount(messageID, address(_mockFeeAsset), additionalFeeAmount); } function testInvalidAmount() public { // First submit a message with a small fee uint256 originalFeeAmount = 10; - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, originalFeeAmount); + bytes32 messageID = + _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, originalFeeAmount); // Expect revert when adding 0 additional amount. uint256 additionalFeeAmount = 0; vm.expectRevert(_formatTeleporterErrorMessage("zero additional fee amount")); - teleporterMessenger.addFeeAmount( - DEFAULT_DESTINATION_CHAIN_ID, messageID, address(_mockFeeAsset), additionalFeeAmount - ); + teleporterMessenger.addFeeAmount(messageID, address(_mockFeeAsset), additionalFeeAmount); } function testMismatchFeeAsset() public { // First submit a message with a small fee uint256 originalFeeAmount = 10; - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, originalFeeAmount); + bytes32 messageID = + _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, originalFeeAmount); // Expect revert when using a different fee asset than originally used. uint256 additionalFeeAmount = 131313; address differentFeeAsset = 0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664; vm.expectRevert(_formatTeleporterErrorMessage("invalid fee asset contract address")); - teleporterMessenger.addFeeAmount( - DEFAULT_DESTINATION_CHAIN_ID, messageID, differentFeeAsset, additionalFeeAmount - ); + teleporterMessenger.addFeeAmount(messageID, differentFeeAsset, additionalFeeAmount); } function testInvalidFeeAsset() public { // First submit a message with a small fee uint256 originalFeeAmount = 10; - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, originalFeeAmount); + bytes32 messageID = + _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, originalFeeAmount); // Expect revert when using an invalid fee asset. uint256 additionalFeeAmount = 131313; address invalidFeeAsset = address(0); vm.expectRevert(_formatTeleporterErrorMessage("zero fee asset contract address")); - teleporterMessenger.addFeeAmount( - DEFAULT_DESTINATION_CHAIN_ID, messageID, invalidFeeAsset, additionalFeeAmount - ); + teleporterMessenger.addFeeAmount(messageID, invalidFeeAsset, additionalFeeAmount); } function testInsufficientBalance() public { // First submit a message with a small fee uint256 originalFeeAmount = 10; - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, originalFeeAmount); + bytes32 messageID = + _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, originalFeeAmount); // Add to the fee, but mock the ERC20 contract returning an error from transferFrom uint256 additionalFeeAmount = 131313; @@ -150,8 +144,6 @@ contract AddFeeAmountTest is TeleporterMessengerTest { ); vm.expectRevert("SafeERC20: ERC20 operation did not succeed"); - teleporterMessenger.addFeeAmount( - DEFAULT_DESTINATION_CHAIN_ID, messageID, address(_mockFeeAsset), additionalFeeAmount - ); + teleporterMessenger.addFeeAmount(messageID, address(_mockFeeAsset), additionalFeeAmount); } } diff --git a/contracts/src/Teleporter/tests/FallbackReceiveTests.t.sol b/contracts/src/Teleporter/tests/FallbackReceiveTests.t.sol index 136fc1cfd..0204d7783 100644 --- a/contracts/src/Teleporter/tests/FallbackReceiveTests.t.sol +++ b/contracts/src/Teleporter/tests/FallbackReceiveTests.t.sol @@ -65,7 +65,7 @@ contract FallbackReceiveTest is TeleporterMessengerTest { function setUp() public virtual override { TeleporterMessengerTest.setUp(); destinationContract = new FallbackReceiveApp( - DEFAULT_ORIGIN_CHAIN_ID, + DEFAULT_ORIGIN_BLOCKCHAIN_ID, address(this) ); } @@ -75,17 +75,22 @@ contract FallbackReceiveTest is TeleporterMessengerTest { // Construct the mock message to be received. TeleporterMessage memory messageToReceive = TeleporterMessage({ - messageID: 1, + messageNonce: teleporterMessenger.messageNonce(), senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(destinationContract), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), receipts: new TeleporterMessageReceipt[](0), message: abi.encode(FallbackReceiveAction.Succeed) }); + bytes32 receivedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageToReceive.messageNonce + ); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -93,14 +98,14 @@ contract FallbackReceiveTest is TeleporterMessengerTest { // Receive the message and check that message execution was successful. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + receivedMessageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), DEFAULT_RELAYER_REWARD_ADDRESS, messageToReceive ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); - emit MessageExecuted(DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID); + emit MessageExecuted(receivedMessageID, DEFAULT_ORIGIN_BLOCKCHAIN_ID); teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); // Check that the nonce was incremented. @@ -112,17 +117,22 @@ contract FallbackReceiveTest is TeleporterMessengerTest { // Construct the mock message to be received. TeleporterMessage memory messageToReceive = TeleporterMessage({ - messageID: 1, + messageNonce: teleporterMessenger.messageNonce(), senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(destinationContract), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), receipts: new TeleporterMessageReceipt[](0), message: abi.encode(FallbackReceiveAction.Fail) }); + bytes32 receivedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageToReceive.messageNonce + ); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -130,15 +140,15 @@ contract FallbackReceiveTest is TeleporterMessengerTest { // Receive the message and check that message execution failed. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + receivedMessageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), DEFAULT_RELAYER_REWARD_ADDRESS, messageToReceive ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit MessageExecutionFailed( - DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID, messageToReceive + receivedMessageID, DEFAULT_ORIGIN_BLOCKCHAIN_ID, messageToReceive ); teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); diff --git a/contracts/src/Teleporter/tests/GetFeeInfoTests.t.sol b/contracts/src/Teleporter/tests/GetFeeInfoTests.t.sol index 3a7ca7239..e29ecda5e 100644 --- a/contracts/src/Teleporter/tests/GetFeeInfoTests.t.sol +++ b/contracts/src/Teleporter/tests/GetFeeInfoTests.t.sol @@ -18,11 +18,11 @@ contract GetFeeInfoTest is TeleporterMessengerTest { function testSuccess() public { // First submit a message with a fee uint256 feeAmount = 1687435413; - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, feeAmount); + bytes32 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, feeAmount); // Get the fee info to make sure it is correct. (address actualFeeAsset, uint256 actualFeeAmount) = - teleporterMessenger.getFeeInfo(DEFAULT_DESTINATION_CHAIN_ID, messageID); + teleporterMessenger.getFeeInfo(messageID); assertEq(actualFeeAsset, address(_mockFeeAsset)); assertEq(actualFeeAmount, feeAmount); } @@ -33,12 +33,12 @@ contract GetFeeInfoTest is TeleporterMessengerTest { uint256 feeAmount = 1687435413; uint256 tokenTransferFee = 35413; _mockFeeAsset.setFeeOnTransferSender(address(this), tokenTransferFee); - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, feeAmount); + bytes32 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, feeAmount); // Get the fee info to make sure it is correct, including the fee amount being less than // the amount specified when submitting the message due to the "fee on token transfer". (address actualFeeAsset, uint256 actualFeeAmount) = - teleporterMessenger.getFeeInfo(DEFAULT_DESTINATION_CHAIN_ID, messageID); + teleporterMessenger.getFeeInfo(messageID); assertEq(actualFeeAsset, address(_mockFeeAsset)); assertEq(actualFeeAmount, feeAmount - tokenTransferFee); } @@ -46,30 +46,31 @@ contract GetFeeInfoTest is TeleporterMessengerTest { function testAfterReceipt() public { // First submit a message with a small fee uint256 feeAmount = 10; - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, feeAmount); + uint256 expectedNonce = teleporterMessenger.messageNonce(); + bytes32 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, feeAmount); // Now mock receiving a message back from that subnet with a receipt of the above message. address relayerRewardAddress = 0xA66884fAdC0D4d7B7eedcF61Eb863Ff413bB6234; TeleporterMessageReceipt[] memory receipts = new TeleporterMessageReceipt[](1); receipts[0] = TeleporterMessageReceipt({ - receivedMessageID: messageID, + receivedMessageNonce: expectedNonce, relayerRewardAddress: relayerRewardAddress }); - _receiveTestMessage(DEFAULT_DESTINATION_CHAIN_ID, messageID, relayerRewardAddress, receipts); + _receiveTestMessage(DEFAULT_DESTINATION_BLOCKCHAIN_ID, 6, relayerRewardAddress, receipts); // Now, if we get the fee info for the message it should be reported as zero since the receipt has already been received. (address actualFeeAsset, uint256 actualFeeAmount) = - teleporterMessenger.getFeeInfo(DEFAULT_DESTINATION_CHAIN_ID, messageID); + teleporterMessenger.getFeeInfo(messageID); assertEq(actualFeeAsset, address(0)); assertEq(actualFeeAmount, 0); } function testInvalidMessage() public { - uint256 fakeMessageID = 4646; + bytes32 fakeMessageID = bytes32(uint256(4646)); // Get the fee info to make sure it is zero since the message doesn't exist. (address actualFeeAsset, uint256 actualFeeAmount) = - teleporterMessenger.getFeeInfo(DEFAULT_DESTINATION_CHAIN_ID, fakeMessageID); + teleporterMessenger.getFeeInfo(fakeMessageID); assertEq(actualFeeAsset, address(0)); assertEq(actualFeeAmount, 0); } diff --git a/contracts/src/Teleporter/tests/GetMessageHashTests.t.sol b/contracts/src/Teleporter/tests/GetMessageHashTests.t.sol index f27190030..e1fbe1876 100644 --- a/contracts/src/Teleporter/tests/GetMessageHashTests.t.sol +++ b/contracts/src/Teleporter/tests/GetMessageHashTests.t.sol @@ -21,46 +21,45 @@ contract GetMessageHashTest is TeleporterMessengerTest { function testSuccess() public { // Submit a message - uint256 messageID = _sendTestMessageWithNoFee(DEFAULT_DESTINATION_CHAIN_ID); TeleporterMessage memory expectedMessage = TeleporterMessage({ - messageID: messageID, + messageNonce: teleporterMessenger.messageNonce(), senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), receipts: new TeleporterMessageReceipt[](0), message: new bytes(0) }); + bytes32 messageID = _sendTestMessageWithNoFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID); + bytes memory expectedMessageBytes = abi.encode(expectedMessage); bytes32 expectedMessageHash = keccak256(expectedMessageBytes); // Get its stored hash - bytes32 actualMessageHash = - teleporterMessenger.getMessageHash(DEFAULT_DESTINATION_CHAIN_ID, messageID); + bytes32 actualMessageHash = teleporterMessenger.getMessageHash(messageID); assertEq(actualMessageHash, expectedMessageHash); } function testMessageDoesNotExist() public { - assertEq(teleporterMessenger.getMessageHash(DEFAULT_DESTINATION_CHAIN_ID, 42), bytes32(0)); + assertEq(teleporterMessenger.getMessageHash(bytes32(uint256(42))), bytes32(0)); } function testMessageAlreadyReceived() public { // Submit a message - uint256 messageID = _sendTestMessageWithNoFee(DEFAULT_DESTINATION_CHAIN_ID); + uint256 expectedNonce = teleporterMessenger.messageNonce(); + bytes32 messageID = _sendTestMessageWithNoFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID); // Now mock receiving a message back from that subnet with a receipt of the above message. address relayerRewardAddress = 0xA66884fAdC0D4d7B7eedcF61Eb863Ff413bB6234; TeleporterMessageReceipt[] memory receipts = new TeleporterMessageReceipt[](1); receipts[0] = TeleporterMessageReceipt({ - receivedMessageID: messageID, + receivedMessageNonce: expectedNonce, relayerRewardAddress: relayerRewardAddress }); - _receiveTestMessage(DEFAULT_DESTINATION_CHAIN_ID, messageID, relayerRewardAddress, receipts); + _receiveTestMessage(DEFAULT_DESTINATION_BLOCKCHAIN_ID, 43, relayerRewardAddress, receipts); // Now the message hash should be cleared. - assertEq( - teleporterMessenger.getMessageHash(DEFAULT_DESTINATION_CHAIN_ID, messageID), bytes32(0) - ); + assertEq(teleporterMessenger.getMessageHash(messageID), bytes32(0)); } } diff --git a/contracts/src/Teleporter/tests/GetNextMessageIdTests.t.sol b/contracts/src/Teleporter/tests/GetNextMessageIdTests.t.sol index 50d440908..58d615bae 100644 --- a/contracts/src/Teleporter/tests/GetNextMessageIdTests.t.sol +++ b/contracts/src/Teleporter/tests/GetNextMessageIdTests.t.sol @@ -20,24 +20,28 @@ contract GetNextMessageIDTest is TeleporterMessengerTest { TeleporterMessengerTest.setUp(); } - function testFirstMessageID() public { - bytes32 blockchainID = - bytes32(hex"11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff"); - - assertEq(teleporterMessenger.getNextMessageID(blockchainID), 1); - } + function testGetMessageID() public { + // Generate the next expected message ID manually. + bytes32 expectedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + teleporterMessenger.messageNonce() + ); - function testSecondMessageID() public { - bytes32 blockchainID = - bytes32(hex"11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff"); + // Check the contract reports the same as expected. + assertEq( + teleporterMessenger.getNextMessageID(DEFAULT_DESTINATION_BLOCKCHAIN_ID), + expectedMessageID + ); + // Send a message to ensure it is assigned the expected ID. vm.mockCall( WARP_PRECOMPILE_ADDRESS, abi.encode(IWarpMessenger.sendWarpMessage.selector), abi.encode(bytes32(0)) ); TeleporterMessageInput memory messageInput = TeleporterMessageInput({ - destinationBlockchainID: blockchainID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(0), feeInfo: TeleporterFeeInfo({feeTokenAddress: address(0), amount: uint256(0)}), requiredGasLimit: 1e6, @@ -45,37 +49,21 @@ contract GetNextMessageIDTest is TeleporterMessengerTest { message: new bytes(0) }); - uint256 first = teleporterMessenger.sendCrossChainMessage(messageInput); - uint256 second = teleporterMessenger.getNextMessageID(blockchainID); - - assertEq(first, 1); - assertEq(second, 2); - } - - function testOtherDestinationSubnetID() public { - bytes32 blockchainID = - bytes32(hex"11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff"); - bytes32 otherBlockchainID = - bytes32(hex"00000000556677889900aabbccddeeff11223344556677889900aabbccddeeff"); + bytes32 messageID = teleporterMessenger.sendCrossChainMessage(messageInput); + assertEq(messageID, expectedMessageID); - vm.mockCall( - WARP_PRECOMPILE_ADDRESS, - abi.encode(IWarpMessenger.sendWarpMessage.selector), - abi.encode(bytes32(0)) + // Generate the next expected message ID now that a message has been sent. + bytes32 secondExpectedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + teleporterMessenger.messageNonce() ); - TeleporterMessageInput memory messageInput = TeleporterMessageInput({ - destinationBlockchainID: blockchainID, - destinationAddress: address(0), - feeInfo: TeleporterFeeInfo({feeTokenAddress: address(0), amount: uint256(0)}), - requiredGasLimit: 1e6, - allowedRelayerAddresses: new address[](0), - message: new bytes(0) - }); - uint256 first = teleporterMessenger.sendCrossChainMessage(messageInput); - uint256 other = teleporterMessenger.getNextMessageID(otherBlockchainID); - - assertEq(first, 1); - assertEq(other, 1); + // Check the contract reports the same as expected, and that is different than the first ID. + assertEq( + teleporterMessenger.getNextMessageID(DEFAULT_DESTINATION_BLOCKCHAIN_ID), + secondExpectedMessageID + ); + assertNotEq(expectedMessageID, secondExpectedMessageID); } } diff --git a/contracts/src/Teleporter/tests/GetOutstandingReceiptsToSendTests.t.sol b/contracts/src/Teleporter/tests/GetOutstandingReceiptsToSendTests.t.sol index e8901a693..2071b2c9c 100644 --- a/contracts/src/Teleporter/tests/GetOutstandingReceiptsToSendTests.t.sol +++ b/contracts/src/Teleporter/tests/GetOutstandingReceiptsToSendTests.t.sol @@ -28,24 +28,24 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { // a message that should contain the receipts. Finally, send another message that should not // have any more receipts since they were included in the previous message. function testSuccess() public { + bytes32 blockchainID = + bytes32(hex"11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff"); + // Assemble mock receipt information that we will expect to be // included in a subsequent message sent to another chain. TeleporterMessageReceipt[] memory expectedReceipts = new TeleporterMessageReceipt[](3); - expectedReceipts[0] = TeleporterMessageReceipt(13, 0xF1DFE63909C027Ed814Dd92C5a3644590abf4850); expectedReceipts[1] = - TeleporterMessageReceipt(42, 0x52A258ED593C793251a89bfd36caE158EE9fC4F8); + TeleporterMessageReceipt(42, 0xF1DFE63909C027Ed814Dd92C5a3644590abf4850); expectedReceipts[2] = TeleporterMessageReceipt(94, 0xdc00AB1cF6942cE0891eF1AC5ff686833Fa0C542); // Mock receiving each of the messages corresponding to the receipts. - bytes32 blockchainID = - bytes32(hex"11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff"); for (uint256 i = 0; i < expectedReceipts.length; i++) { _receiveTestMessage( blockchainID, - expectedReceipts[i].receivedMessageID, + expectedReceipts[i].receivedMessageNonce, expectedReceipts[i].relayerRewardAddress, new TeleporterMessageReceipt[](0) ); @@ -53,9 +53,15 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { // Now that we have "received" 3 mock messages, when we send a message back to the // other chain, we should expect to see the 3 receipts included in the message metadata. - TeleporterMessage memory expectedMessage = _createMockTeleporterMessage(1, hex"deadbeef"); + TeleporterMessage memory expectedMessage = + _createMockTeleporterMessage(teleporterMessenger.messageNonce(), hex"deadbeef"); expectedMessage.receipts = expectedReceipts; expectedMessage.destinationBlockchainID = blockchainID; + bytes32 expectedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + expectedMessage.destinationBlockchainID, + expectedMessage.messageNonce + ); TeleporterFeeInfo memory feeInfo = TeleporterFeeInfo(address(0), 0); TeleporterMessageInput memory messageInput = TeleporterMessageInput({ destinationBlockchainID: expectedMessage.destinationBlockchainID, @@ -69,7 +75,7 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { vm.mockCall( WARP_PRECOMPILE_ADDRESS, abi.encode(IWarpMessenger.sendWarpMessage.selector), - abi.encode(bytes32(0)) + abi.encode(expectedMessageID) ); // Expect the exact message to be passed to the precompile. @@ -81,18 +87,15 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { // Expect the SendCrossChainMessage event to be emitted. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit SendCrossChainMessage( - messageInput.destinationBlockchainID, - expectedMessage.messageID, - expectedMessage, - feeInfo + expectedMessageID, messageInput.destinationBlockchainID, expectedMessage, feeInfo ); // Submit the message. - assertEq(teleporterMessenger.sendCrossChainMessage(messageInput), 1); + teleporterMessenger.sendCrossChainMessage(messageInput); // Submit another message to be sent to check that it does not contain any more receipts. TeleporterMessage memory nextExpectedMessage = - _createMockTeleporterMessage(2, hex"deadbeef"); + _createMockTeleporterMessage(teleporterMessenger.messageNonce(), hex"deadbeef"); nextExpectedMessage.destinationBlockchainID = blockchainID; vm.expectCall( WARP_PRECOMPILE_ADDRESS, @@ -100,20 +103,27 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit SendCrossChainMessage( + teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + nextExpectedMessage.destinationBlockchainID, + nextExpectedMessage.messageNonce + ), messageInput.destinationBlockchainID, - nextExpectedMessage.messageID, nextExpectedMessage, feeInfo ); // Submit the new message. - assertEq(teleporterMessenger.sendCrossChainMessage(messageInput), 2); + teleporterMessenger.sendCrossChainMessage(messageInput); } // Test that when there are more than the maximum limit of receipts to include in a message (5), // the first batch of receipts on the first outbound message has the maximum batch size, and // next contains the remaining receipts. function testExceedsLimit() public { + bytes32 blockchainID = + bytes32(hex"11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff"); + // Assemble mock receipt information that we will expect to be // included in a subsequent message sent to another chain. TeleporterMessageReceipt[] memory expectedReceiptsBatch1 = new TeleporterMessageReceipt[](5); // the limit of receipts per message is 5. @@ -135,12 +145,10 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { TeleporterMessageReceipt(80, 0xdc00AB1cF6942cE0891eF1AC5ff686833Fa0C542); // Mock receiving each of the messages corresponding to the receipts. - bytes32 blockchainID = - bytes32(hex"11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff"); for (uint256 i = 0; i < expectedReceiptsBatch1.length; i++) { _receiveTestMessage( blockchainID, - expectedReceiptsBatch1[i].receivedMessageID, + expectedReceiptsBatch1[i].receivedMessageNonce, expectedReceiptsBatch1[i].relayerRewardAddress, new TeleporterMessageReceipt[](0) ); @@ -148,7 +156,7 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { for (uint256 i = 0; i < expectedReceiptsBatch2.length; i++) { _receiveTestMessage( blockchainID, - expectedReceiptsBatch2[i].receivedMessageID, + expectedReceiptsBatch2[i].receivedMessageNonce, expectedReceiptsBatch2[i].relayerRewardAddress, new TeleporterMessageReceipt[](0) ); @@ -157,7 +165,8 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { // Now that we have "received" 7 mock messages, when we send a message back to the // other chain, we should expect to see the 5 receipts included in the message metadata because // that is the max receipt batch size limit. - TeleporterMessage memory expectedMessage = _createMockTeleporterMessage(1, hex"deadbeef"); + TeleporterMessage memory expectedMessage = + _createMockTeleporterMessage(teleporterMessenger.messageNonce(), hex"deadbeef"); expectedMessage.receipts = expectedReceiptsBatch1; expectedMessage.destinationBlockchainID = blockchainID; TeleporterFeeInfo memory feeInfo = TeleporterFeeInfo(address(0), 0); @@ -185,18 +194,22 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { // Expect the SendCrossChainMessage event to be emitted. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit SendCrossChainMessage( + teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + expectedMessage.destinationBlockchainID, + expectedMessage.messageNonce + ), messageInput.destinationBlockchainID, - expectedMessage.messageID, expectedMessage, feeInfo ); // Submit the message. - assertEq(teleporterMessenger.sendCrossChainMessage(messageInput), 1); + teleporterMessenger.sendCrossChainMessage(messageInput); // Submit another message to be sent to check that it contains the remaining 2 receipts to be sent. TeleporterMessage memory nextExpectedMessage = - _createMockTeleporterMessage(2, hex"deadbeef"); + _createMockTeleporterMessage(teleporterMessenger.messageNonce(), hex"deadbeef"); nextExpectedMessage.receipts = expectedReceiptsBatch2; nextExpectedMessage.destinationBlockchainID = blockchainID; vm.expectCall( @@ -205,13 +218,17 @@ contract GetOutstandingReceiptsToSendTest is TeleporterMessengerTest { ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit SendCrossChainMessage( + teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + nextExpectedMessage.destinationBlockchainID, + nextExpectedMessage.messageNonce + ), messageInput.destinationBlockchainID, - nextExpectedMessage.messageID, nextExpectedMessage, feeInfo ); // Submit the new message. - assertEq(teleporterMessenger.sendCrossChainMessage(messageInput), 2); + teleporterMessenger.sendCrossChainMessage(messageInput); } } diff --git a/contracts/src/Teleporter/tests/GetRelayerRewardAddressTests.t.sol b/contracts/src/Teleporter/tests/GetRelayerRewardAddressTests.t.sol index 5ccb30f58..3621c27e6 100644 --- a/contracts/src/Teleporter/tests/GetRelayerRewardAddressTests.t.sol +++ b/contracts/src/Teleporter/tests/GetRelayerRewardAddressTests.t.sol @@ -16,26 +16,43 @@ contract GetRelayerRewardAddressTest is TeleporterMessengerTest { } function testSuccess() public { - // Before receiving the message, it returns the 0 address. - uint256 mockMessageID = 8; - assertEq( - teleporterMessenger.getRelayerRewardAddress(DEFAULT_DESTINATION_CHAIN_ID, mockMessageID), - address(0) + // Receive a message + uint256 mockNonce = 8; + bytes32 mockMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, mockNonce ); - - // Mock receiving the message address relayerRewardAddress = 0xCAFebAbeDc0D4D7B7EEdCf61eb863fF413BB6234; _receiveTestMessage( - DEFAULT_DESTINATION_CHAIN_ID, - mockMessageID, + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + mockNonce, relayerRewardAddress, new TeleporterMessageReceipt[](0) ); // Now it has the relayer reward address. - assertEq( - teleporterMessenger.getRelayerRewardAddress(DEFAULT_DESTINATION_CHAIN_ID, mockMessageID), - relayerRewardAddress + assertEq(teleporterMessenger.getRelayerRewardAddress(mockMessageID), relayerRewardAddress); + } + + function testZeroRelayerRewardAddress() public { + // Receive a message with a zero relayer reward address + uint256 mockNonce = 4343; + bytes32 mockMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, mockNonce + ); + _receiveTestMessage( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, mockNonce, address(0), new TeleporterMessageReceipt[](0) + ); + + // Check that the zero address is returned as the reward address. + assertEq(teleporterMessenger.getRelayerRewardAddress(mockMessageID), address(0)); + } + + function testMessageNotReceived() public { + // Before receiving the given message, getRelayerRewardAddress should revert. + bytes32 mockMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, 4242 ); + vm.expectRevert(_formatTeleporterErrorMessage("message not received")); + teleporterMessenger.getRelayerRewardAddress(mockMessageID); } } diff --git a/contracts/src/Teleporter/tests/HandleInitialMessageExecutionTests.t.sol b/contracts/src/Teleporter/tests/HandleInitialMessageExecutionTests.t.sol index 5b530732d..e6fddacb7 100644 --- a/contracts/src/Teleporter/tests/HandleInitialMessageExecutionTests.t.sol +++ b/contracts/src/Teleporter/tests/HandleInitialMessageExecutionTests.t.sol @@ -95,9 +95,9 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { // Construct the mock message to be received. string memory messageString = "Testing successful message"; TeleporterMessage memory messageToReceive = TeleporterMessage({ - messageID: 42, + messageNonce: 42, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(destinationContract), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), @@ -105,32 +105,35 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { message: abi.encode(SampleMessageReceiverAction.Receive, abi.encode(messageString, true)) }); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); // Receive the message and check that message execution was successful. + bytes32 expectedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageToReceive.messageNonce + ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + expectedMessageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), DEFAULT_RELAYER_REWARD_ADDRESS, messageToReceive ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); - emit MessageExecuted(DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID); + emit MessageExecuted(expectedMessageID, DEFAULT_ORIGIN_BLOCKCHAIN_ID); teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); // Check that the message had the proper affect on the destination contract. assertEq(destinationContract.latestMessage(), messageString); - assertEq(destinationContract.latestMessageSenderSubnetID(), DEFAULT_ORIGIN_CHAIN_ID); + assertEq(destinationContract.latestMessageSenderSubnetID(), DEFAULT_ORIGIN_BLOCKCHAIN_ID); assertEq(destinationContract.latestMessageSenderAddress(), address(this)); assertEq( - teleporterMessenger.getRelayerRewardAddress( - DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID - ), + teleporterMessenger.getRelayerRewardAddress(expectedMessageID), DEFAULT_RELAYER_REWARD_ADDRESS ); } @@ -139,9 +142,9 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { // Construct the mock message to be received. string memory messageString = "Testing successful message"; TeleporterMessage memory messageToReceive = TeleporterMessage({ - messageID: 42, + messageNonce: 42, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(destinationContract), requiredGasLimit: uint256( bytes32(hex"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") // UINT256_MAX @@ -151,7 +154,7 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { message: abi.encode(SampleMessageReceiverAction.Receive, abi.encode(messageString, true)) }); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -165,9 +168,9 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { // Construct the mock message to be received. string memory messageString = "Testing successful message"; TeleporterMessage memory messageToReceive = TeleporterMessage({ - messageID: 42, + messageNonce: 42, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(destinationContract), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), @@ -175,7 +178,12 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { message: abi.encode(SampleMessageReceiverAction.ReceiveRecursive, abi.encode(messageString)) }); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); + bytes32 messageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageToReceive.messageNonce + ); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -185,16 +193,14 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { // still successfully delivered. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + messageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), DEFAULT_RELAYER_REWARD_ADDRESS, messageToReceive ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); - emit MessageExecutionFailed( - DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID, messageToReceive - ); + emit MessageExecutionFailed(messageID, DEFAULT_ORIGIN_BLOCKCHAIN_ID, messageToReceive); teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); // Check that the message hash was stored in state and the message did not have any affect on the destination. @@ -202,22 +208,19 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { assertEq(destinationContract.latestMessageSenderSubnetID(), bytes32(0)); assertEq(destinationContract.latestMessageSenderAddress(), address(0)); assertEq( - teleporterMessenger.getRelayerRewardAddress( - DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID - ), - DEFAULT_RELAYER_REWARD_ADDRESS + teleporterMessenger.getRelayerRewardAddress(messageID), DEFAULT_RELAYER_REWARD_ADDRESS ); vm.expectRevert(_formatTeleporterErrorMessage("retry execution failed")); - teleporterMessenger.retryMessageExecution(DEFAULT_ORIGIN_CHAIN_ID, messageToReceive); + teleporterMessenger.retryMessageExecution(DEFAULT_ORIGIN_BLOCKCHAIN_ID, messageToReceive); } function testStoreHashOfFailedMessageExecution() public { // Construct the mock message to be received. string memory messageString = "Testing successful message"; TeleporterMessage memory messageToReceive = TeleporterMessage({ - messageID: 42, + messageNonce: 42, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(destinationContract), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), @@ -225,7 +228,12 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { message: abi.encode(SampleMessageReceiverAction.Receive, abi.encode(messageString, false)) }); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); + bytes32 messageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageToReceive.messageNonce + ); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -233,16 +241,14 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { // Receive the message. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + messageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), DEFAULT_RELAYER_REWARD_ADDRESS, messageToReceive ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); - emit MessageExecutionFailed( - DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID, messageToReceive - ); + emit MessageExecutionFailed(messageID, DEFAULT_ORIGIN_BLOCKCHAIN_ID, messageToReceive); teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); // Check that the message hash was stored in state and the message did not have any affect on the destination. @@ -250,12 +256,9 @@ contract HandleInitialMessageExecutionTest is TeleporterMessengerTest { assertEq(destinationContract.latestMessageSenderSubnetID(), bytes32(0)); assertEq(destinationContract.latestMessageSenderAddress(), address(0)); assertEq( - teleporterMessenger.getRelayerRewardAddress( - DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID - ), - DEFAULT_RELAYER_REWARD_ADDRESS + teleporterMessenger.getRelayerRewardAddress(messageID), DEFAULT_RELAYER_REWARD_ADDRESS ); vm.expectRevert(_formatTeleporterErrorMessage("retry execution failed")); - teleporterMessenger.retryMessageExecution(DEFAULT_ORIGIN_CHAIN_ID, messageToReceive); + teleporterMessenger.retryMessageExecution(DEFAULT_ORIGIN_BLOCKCHAIN_ID, messageToReceive); } } diff --git a/contracts/src/Teleporter/tests/InitializeBlockchainIDTests.t.sol b/contracts/src/Teleporter/tests/InitializeBlockchainIDTests.t.sol new file mode 100644 index 000000000..c76640875 --- /dev/null +++ b/contracts/src/Teleporter/tests/InitializeBlockchainIDTests.t.sol @@ -0,0 +1,116 @@ +// (c) 2023, Ava Labs, Inc. All rights reserved. +// See the file LICENSE for licensing terms. + +// SPDX-License-Identifier: Ecosystem + +pragma solidity 0.8.18; + +import {Test} from "forge-std/Test.sol"; +import { + TeleporterMessenger, + TeleporterMessage, + TeleporterMessageInput, + TeleporterMessageReceipt, + TeleporterFeeInfo, + IWarpMessenger, + WarpMessage +} from "../TeleporterMessenger.sol"; + +// TeleporterMessengerTest and its child contracts all initialize the blockchain ID in the set up +// step for ease of use. This test contract is separate to allow for testing the initialization +// step itself. +contract InitializeBlockchainIDTest is Test { + TeleporterMessenger public teleporterMessenger; + address public constant WARP_PRECOMPILE_ADDRESS = 0x0200000000000000000000000000000000000005; + bytes32 public constant DEFAULT_ORIGIN_BLOCKCHAIN_ID = + bytes32(hex"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"); + bytes32 public constant DEFAULT_DESTINATION_BLOCKCHAIN_ID = + bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); + + // Set up the Teleporter contract but leave the blockchain ID uninitialized. + function setUp() public virtual { + vm.mockCall( + WARP_PRECOMPILE_ADDRESS, + abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector), + abi.encode(DEFAULT_DESTINATION_BLOCKCHAIN_ID) + ); + + teleporterMessenger = new TeleporterMessenger(); + } + + function testUninitialized() public { + assertEq(teleporterMessenger.blockchainID(), bytes32(0)); + vm.expectRevert("TeleporterMessenger: zero blockchain ID"); + teleporterMessenger.getNextMessageID(DEFAULT_DESTINATION_BLOCKCHAIN_ID); + } + + function testSuccess() public { + bytes32 res = teleporterMessenger.initializeBlockchainID(); + assertEq(res, DEFAULT_DESTINATION_BLOCKCHAIN_ID); + assertEq(teleporterMessenger.blockchainID(), DEFAULT_DESTINATION_BLOCKCHAIN_ID); + + // Should be able to call multiple times and get same result. + res = teleporterMessenger.initializeBlockchainID(); + assertEq(res, DEFAULT_DESTINATION_BLOCKCHAIN_ID); + } + + function testInitializedBySending() public { + // Send a message. + vm.mockCall( + WARP_PRECOMPILE_ADDRESS, + abi.encode(IWarpMessenger.sendWarpMessage.selector), + abi.encode(bytes32(0)) + ); + teleporterMessenger.sendCrossChainMessage( + TeleporterMessageInput({ + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, + destinationAddress: address(1), + feeInfo: TeleporterFeeInfo({feeTokenAddress: address(0), amount: 0}), + requiredGasLimit: 1000, + allowedRelayerAddresses: new address[](0), + message: new bytes(0) + }) + ); + + // Check the blockchain ID is initialized. + assertEq(teleporterMessenger.blockchainID(), DEFAULT_DESTINATION_BLOCKCHAIN_ID); + } + + function testInitializedByReceiving() public { + TeleporterMessage memory teleporterMessage = TeleporterMessage({ + messageNonce: 1, + senderAddress: address(this), + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, + destinationAddress: address(1), + requiredGasLimit: 100, + allowedRelayerAddresses: new address[](0), + receipts: new TeleporterMessageReceipt[](0), + message: new bytes(0) + }); + WarpMessage memory warpMessage = WarpMessage({ + sourceChainID: DEFAULT_ORIGIN_BLOCKCHAIN_ID, + originSenderAddress: address(teleporterMessenger), + payload: abi.encode(teleporterMessage) + }); + vm.mockCall( + WARP_PRECOMPILE_ADDRESS, + abi.encodeCall(IWarpMessenger.getVerifiedWarpMessage, (0)), + abi.encode(warpMessage, true) + ); + teleporterMessenger.receiveCrossChainMessage(0, address(0)); + + // Check the blockchain ID is initialized. + assertEq(teleporterMessenger.blockchainID(), DEFAULT_DESTINATION_BLOCKCHAIN_ID); + } + + function testCannotInitializeToZero() public { + vm.mockCall( + WARP_PRECOMPILE_ADDRESS, + abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector), + abi.encode(bytes32(0)) + ); + + vm.expectRevert("TeleporterMessenger: zero blockchain ID"); + teleporterMessenger.initializeBlockchainID(); + } +} diff --git a/contracts/src/Teleporter/tests/MarkReceiptTests.t.sol b/contracts/src/Teleporter/tests/MarkReceiptTests.t.sol index ec46bda4d..805fb633b 100644 --- a/contracts/src/Teleporter/tests/MarkReceiptTests.t.sol +++ b/contracts/src/Teleporter/tests/MarkReceiptTests.t.sol @@ -36,10 +36,12 @@ contract MarkReceiptTest is TeleporterMessengerTest { FeeRewardInfo(3333333333333333, 0xdc00AB1cF6942cE0891eF1AC5ff686833Fa0C542) ]; + uint256[3] memory messageNonces; + bytes32[3] memory messageIDs; for (uint256 i = 0; i < feeRewardInfos.length; i++) { - assertEq( - _sendTestMessageWithFee(DEFAULT_ORIGIN_CHAIN_ID, feeRewardInfos[i].feeAmount), i + 1 - ); + messageNonces[i] = teleporterMessenger.messageNonce(); + messageIDs[i] = + _sendTestMessageWithFee(DEFAULT_ORIGIN_BLOCKCHAIN_ID, feeRewardInfos[i].feeAmount); } // Mock receiving a message with the 3 receipts from the mock messages sent above. @@ -48,14 +50,16 @@ contract MarkReceiptTest is TeleporterMessengerTest { ); for (uint256 i = 0; i < receipts.length; i++) { receipts[i] = TeleporterMessageReceipt({ - receivedMessageID: i + 1, + receivedMessageNonce: messageNonces[i], relayerRewardAddress: feeRewardInfos[i].relayerRewardAddress }); } - TeleporterMessage memory messageToReceive = _createMockTeleporterMessage(1, new bytes(0)); + uint256 receivedMessageNonce = 1; + TeleporterMessage memory messageToReceive = + _createMockTeleporterMessage(receivedMessageNonce, new bytes(0)); messageToReceive.receipts = receipts; WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -74,33 +78,41 @@ contract MarkReceiptTest is TeleporterMessengerTest { } // Check that the message received is considered delivered, and that the relayer reward address is stored. + bytes32 expectedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, receivedMessageNonce + ); assertEq( - teleporterMessenger.getRelayerRewardAddress(DEFAULT_ORIGIN_CHAIN_ID, 1), + teleporterMessenger.getRelayerRewardAddress(expectedMessageID), expectedRelayerRewardAddress ); - assertTrue(teleporterMessenger.messageReceived(DEFAULT_ORIGIN_CHAIN_ID, 1)); + assertTrue(teleporterMessenger.messageReceived(expectedMessageID)); // Check that the message hashes for the message receipts we received have been cleared. for (uint256 i = 0; i < receipts.length; i++) { - assertEq(teleporterMessenger.getMessageHash(DEFAULT_ORIGIN_CHAIN_ID, i + 1), bytes32(0)); + assertEq(teleporterMessenger.getMessageHash(messageIDs[i]), bytes32(0)); } } function testReceiptForNoFeeMessage() public { // Submit a a mock message with no fee. - assertEq(_sendTestMessageWithNoFee(DEFAULT_ORIGIN_CHAIN_ID), 1); + uint256 sentMessageNonce = teleporterMessenger.messageNonce(); + _sendTestMessageWithNoFee(DEFAULT_ORIGIN_BLOCKCHAIN_ID); // Mock receiving a message with the a receipts of the mock message sent above. TeleporterMessageReceipt[] memory receipts = new TeleporterMessageReceipt[](1); receipts[0] = TeleporterMessageReceipt({ - receivedMessageID: 1, + receivedMessageNonce: sentMessageNonce, relayerRewardAddress: DEFAULT_RELAYER_REWARD_ADDRESS }); - TeleporterMessage memory messageToReceive = _createMockTeleporterMessage(1, new bytes(0)); + uint256 receivedMessageNonce = 42; + bytes32 receivedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, receivedMessageNonce + ); + TeleporterMessage memory messageToReceive = + _createMockTeleporterMessage(receivedMessageNonce, new bytes(0)); messageToReceive.receipts = receipts; WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); - + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); // Receive the mock message. @@ -109,30 +121,36 @@ contract MarkReceiptTest is TeleporterMessengerTest { // Check that the message received is considered delivered, and that the relayer reward address is stored. assertEq( - teleporterMessenger.getRelayerRewardAddress(DEFAULT_ORIGIN_CHAIN_ID, 1), + teleporterMessenger.getRelayerRewardAddress(receivedMessageID), expectedRelayerRewardAddress ); - assertTrue(teleporterMessenger.messageReceived(DEFAULT_ORIGIN_CHAIN_ID, 1)); + assertTrue(teleporterMessenger.messageReceived(receivedMessageID)); } function testDuplicateReceiptAllowed() public { // Submit a mock message to be sent. FeeRewardInfo memory feeRewardInfo = FeeRewardInfo(1111111111111111, 0x52A258ED593C793251a89bfd36caE158EE9fC4F8); - assertEq(_sendTestMessageWithFee(DEFAULT_ORIGIN_CHAIN_ID, feeRewardInfo.feeAmount), 1); + uint256 sentMessageNonce = teleporterMessenger.messageNonce(); + _sendTestMessageWithFee(DEFAULT_ORIGIN_BLOCKCHAIN_ID, feeRewardInfo.feeAmount); // Mock receiving a message with the 2 receipts for the same mock message above. TeleporterMessageReceipt[] memory receipts = new TeleporterMessageReceipt[](2); TeleporterMessageReceipt memory receipt = TeleporterMessageReceipt({ - receivedMessageID: 1, + receivedMessageNonce: sentMessageNonce, relayerRewardAddress: feeRewardInfo.relayerRewardAddress }); receipts[0] = receipt; receipts[1] = receipt; - TeleporterMessage memory messageToReceive = _createMockTeleporterMessage(1, new bytes(0)); + uint256 receivedMessageNonce = 12; + bytes32 receivedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, receivedMessageNonce + ); + TeleporterMessage memory messageToReceive = + _createMockTeleporterMessage(receivedMessageNonce, new bytes(0)); messageToReceive.receipts = receipts; WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -150,12 +168,12 @@ contract MarkReceiptTest is TeleporterMessengerTest { // Check that the message received is considered delivered, and that the relayer reward address is stored. assertEq( - teleporterMessenger.getRelayerRewardAddress(DEFAULT_ORIGIN_CHAIN_ID, 1), + teleporterMessenger.getRelayerRewardAddress(receivedMessageID), expectedRelayerRewardAddress ); - assertTrue(teleporterMessenger.messageReceived(DEFAULT_ORIGIN_CHAIN_ID, 1)); + assertTrue(teleporterMessenger.messageReceived(receivedMessageID)); // Check that the message hashes for the message receipts we received have been cleared. - assertEq(teleporterMessenger.getMessageHash(DEFAULT_ORIGIN_CHAIN_ID, 1), bytes32(0)); + assertEq(teleporterMessenger.getMessageHash(receivedMessageID), bytes32(0)); } } diff --git a/contracts/src/Teleporter/tests/MessageReceivedTests.t.sol b/contracts/src/Teleporter/tests/MessageReceivedTests.t.sol index 4bafc2f44..7bf8a3c77 100644 --- a/contracts/src/Teleporter/tests/MessageReceivedTests.t.sol +++ b/contracts/src/Teleporter/tests/MessageReceivedTests.t.sol @@ -18,14 +18,28 @@ contract MessageReceivedTest is TeleporterMessengerTest { function testReceivedMessage() public { // Mock receiving a message from another subnet. address relayerRewardAddress = 0xA66884fAdC0D4d7B7eedcF61Eb863Ff413bB6234; + uint256 messageNonce = 1; + bytes32 messageID = teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, messageNonce + ); _receiveTestMessage( - DEFAULT_DESTINATION_CHAIN_ID, 1, relayerRewardAddress, new TeleporterMessageReceipt[](0) + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageNonce, + relayerRewardAddress, + new TeleporterMessageReceipt[](0) ); - assertEq(teleporterMessenger.messageReceived(DEFAULT_DESTINATION_CHAIN_ID, 1), true); + assertEq(teleporterMessenger.messageReceived(messageID), true); } function testUnreceivedMessage() public { - assertEq(teleporterMessenger.messageReceived(DEFAULT_DESTINATION_CHAIN_ID, 1), false); + assertEq( + teleporterMessenger.messageReceived( + teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, 1 + ) + ), + false + ); } } diff --git a/contracts/src/Teleporter/tests/ReceiptsQueueTests.t.sol b/contracts/src/Teleporter/tests/ReceiptsQueueTests.t.sol index 0bc83e6cd..8a80f94e6 100644 --- a/contracts/src/Teleporter/tests/ReceiptsQueueTests.t.sol +++ b/contracts/src/Teleporter/tests/ReceiptsQueueTests.t.sol @@ -19,15 +19,15 @@ contract ReceiptQueueTest is Test { // Add 3 elements to the queue. TeleporterMessageReceipt private _receipt1 = TeleporterMessageReceipt({ - receivedMessageID: 543, + receivedMessageNonce: 543, relayerRewardAddress: 0x10eB43ef5982628728E3E4bb9F78834f67Fbb40b }); TeleporterMessageReceipt private _receipt2 = TeleporterMessageReceipt({ - receivedMessageID: 684384, + receivedMessageNonce: 684384, relayerRewardAddress: 0x10eB43ef5982628728E3E4bb9F78834f67Fbb40b }); TeleporterMessageReceipt private _receipt3 = TeleporterMessageReceipt({ - receivedMessageID: 654351, + receivedMessageNonce: 654351, relayerRewardAddress: 0xcC8E718045817AebA89592C72Ae1C9917f5D0894 }); @@ -44,13 +44,13 @@ contract ReceiptQueueTest is Test { // Dequeue 3 elements and check they are given in the correct order (FIFO). TeleporterMessageReceipt memory result = _queue.dequeue(); - assertEq(result.receivedMessageID, _receipt1.receivedMessageID); + assertEq(result.receivedMessageNonce, _receipt1.receivedMessageNonce); assertEq(result.relayerRewardAddress, _receipt1.relayerRewardAddress); result = _queue.dequeue(); - assertEq(result.receivedMessageID, _receipt2.receivedMessageID); + assertEq(result.receivedMessageNonce, _receipt2.receivedMessageNonce); assertEq(result.relayerRewardAddress, _receipt2.relayerRewardAddress); result = _queue.dequeue(); - assertEq(result.receivedMessageID, _receipt3.receivedMessageID); + assertEq(result.receivedMessageNonce, _receipt3.receivedMessageNonce); assertEq(result.relayerRewardAddress, _receipt3.relayerRewardAddress); // Check the size is now 0 again. @@ -67,16 +67,16 @@ contract ReceiptQueueTest is Test { // Finally dequeue the elements and once again check they are returned in the correct order. result = _queue.dequeue(); - assertEq(result.receivedMessageID, _receipt1.receivedMessageID); + assertEq(result.receivedMessageNonce, _receipt1.receivedMessageNonce); assertEq(result.relayerRewardAddress, _receipt1.relayerRewardAddress); result = _queue.dequeue(); - assertEq(result.receivedMessageID, _receipt1.receivedMessageID); + assertEq(result.receivedMessageNonce, _receipt1.receivedMessageNonce); assertEq(result.relayerRewardAddress, _receipt1.relayerRewardAddress); result = _queue.dequeue(); - assertEq(result.receivedMessageID, _receipt2.receivedMessageID); + assertEq(result.receivedMessageNonce, _receipt2.receivedMessageNonce); assertEq(result.relayerRewardAddress, _receipt2.relayerRewardAddress); result = _queue.dequeue(); - assertEq(result.receivedMessageID, _receipt3.receivedMessageID); + assertEq(result.receivedMessageNonce, _receipt3.receivedMessageNonce); assertEq(result.relayerRewardAddress, _receipt3.relayerRewardAddress); } @@ -84,7 +84,7 @@ contract ReceiptQueueTest is Test { // Check that you can't dequeue from empty queue. vm.expectRevert(_formatReceiptQueueErrorMessage("empty queue")); TeleporterMessageReceipt memory result = _queue.dequeue(); - assertEq(result.receivedMessageID, 0); + assertEq(result.receivedMessageNonce, 0); assertEq(result.relayerRewardAddress, address(0)); } @@ -99,7 +99,7 @@ contract ReceiptQueueTest is Test { // Check that you can get receipts at specific indexes. TeleporterMessageReceipt memory result = _queue.getReceiptAtIndex(2); - assertEq(result.receivedMessageID, _receipt2.receivedMessageID); + assertEq(result.receivedMessageNonce, _receipt2.receivedMessageNonce); assertEq(result.relayerRewardAddress, _receipt2.relayerRewardAddress); // Check can't get an out of index element. @@ -111,7 +111,7 @@ contract ReceiptQueueTest is Test { // Check that you can't get receipts from empty queue. vm.expectRevert(_formatReceiptQueueErrorMessage("index out of bounds")); TeleporterMessageReceipt memory result = _queue.getReceiptAtIndex(0); - assertEq(result.receivedMessageID, 0); + assertEq(result.receivedMessageNonce, 0); assertEq(result.relayerRewardAddress, address(0)); } diff --git a/contracts/src/Teleporter/tests/ReceiveCrossChainMessageTests.t.sol b/contracts/src/Teleporter/tests/ReceiveCrossChainMessageTests.t.sol index 48dabfa46..149d70ab8 100644 --- a/contracts/src/Teleporter/tests/ReceiveCrossChainMessageTests.t.sol +++ b/contracts/src/Teleporter/tests/ReceiveCrossChainMessageTests.t.sol @@ -36,9 +36,9 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { // Construct the test message to be received. TeleporterMessage memory messageToReceive = TeleporterMessage({ - messageID: 1, + messageNonce: 987, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: allowedRelayers, @@ -46,19 +46,24 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { message: DEFAULT_MESSAGE_PAYLOAD }); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); + bytes32 messageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageToReceive.messageNonce + ); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); // Check receipt queue size - assertEq(teleporterMessenger.getReceiptQueueSize(DEFAULT_ORIGIN_CHAIN_ID), 0); + assertEq(teleporterMessenger.getReceiptQueueSize(DEFAULT_ORIGIN_BLOCKCHAIN_ID), 0); // Receive the message. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + messageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), DEFAULT_RELAYER_REWARD_ADDRESS, messageToReceive @@ -66,25 +71,30 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); // Check receipt queue size - assertEq(teleporterMessenger.getReceiptQueueSize(DEFAULT_ORIGIN_CHAIN_ID), 1); + assertEq(teleporterMessenger.getReceiptQueueSize(DEFAULT_ORIGIN_BLOCKCHAIN_ID), 1); // Check receipt queue contents TeleporterMessageReceipt memory receipt = - teleporterMessenger.getReceiptAtIndex(DEFAULT_ORIGIN_CHAIN_ID, 0); - assertEq(receipt.receivedMessageID, 1); + teleporterMessenger.getReceiptAtIndex(DEFAULT_ORIGIN_BLOCKCHAIN_ID, 0); + assertEq(receipt.receivedMessageNonce, messageToReceive.messageNonce); assertEq(receipt.relayerRewardAddress, DEFAULT_RELAYER_REWARD_ADDRESS); // Receive at a different index - messageToReceive.messageID = 2; + messageToReceive.messageNonce = 654; + messageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageToReceive.messageNonce + ); warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); _setUpSuccessGetVerifiedWarpMessageMock(3, warpMessage); // Receive the message. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + messageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), DEFAULT_RELAYER_REWARD_ADDRESS, messageToReceive @@ -92,11 +102,11 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { teleporterMessenger.receiveCrossChainMessage(3, DEFAULT_RELAYER_REWARD_ADDRESS); // Check receipt queue size - assertEq(teleporterMessenger.getReceiptQueueSize(DEFAULT_ORIGIN_CHAIN_ID), 2); + assertEq(teleporterMessenger.getReceiptQueueSize(DEFAULT_ORIGIN_BLOCKCHAIN_ID), 2); // Check receipt queue contents - receipt = teleporterMessenger.getReceiptAtIndex(DEFAULT_ORIGIN_CHAIN_ID, 1); - assertEq(receipt.receivedMessageID, 2); + receipt = teleporterMessenger.getReceiptAtIndex(DEFAULT_ORIGIN_BLOCKCHAIN_ID, 1); + assertEq(receipt.receivedMessageNonce, messageToReceive.messageNonce); assertEq(receipt.relayerRewardAddress, DEFAULT_RELAYER_REWARD_ADDRESS); } @@ -135,7 +145,7 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { TeleporterMessage memory messageToReceive = _createMockTeleporterMessage(1, new bytes(0)); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); address invalidSenderAddress = 0xb73aD7e0FF026a805D1f1186EAB89E41bf01835D; warpMessage.originSenderAddress = invalidSenderAddress; @@ -154,7 +164,7 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { messageToReceive.destinationBlockchainID = invalidDestinationBlockchainID; WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -163,9 +173,53 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); } - function testInvalidRelayerAddress() public { - vm.expectRevert(_formatTeleporterErrorMessage("zero relayer reward address")); - teleporterMessenger.receiveCrossChainMessage(0, address(0)); + function testZeroMessageNonce() public { + // Construct the test message to be received. + TeleporterMessage memory messageToReceive = TeleporterMessage({ + messageNonce: 0, + senderAddress: address(this), + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, + destinationAddress: DEFAULT_DESTINATION_ADDRESS, + requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, + allowedRelayerAddresses: new address[](0), + receipts: new TeleporterMessageReceipt[](0), + message: DEFAULT_MESSAGE_PAYLOAD + }); + WarpMessage memory warpMessage = + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); + + // Mock the call to the warp precompile to get the message. + _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); + + // Receive the message. + vm.expectRevert(_formatTeleporterErrorMessage("zero message nonce")); + teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); + } + + function testReceiveSameNonceFromMultipleChains() public { + bytes32 sourceBlockchainID1 = + bytes32(hex"1111111111111111111111111111111111111111111111111111111111111111"); + bytes32 sourceBlockchainID2 = + bytes32(hex"2222222222222222222222222222222222222222222222222222222222222222"); + uint256 mockMessageNonce = 5454; + bytes32 expectedMessageID1 = teleporterMessenger.calculateMessageID( + sourceBlockchainID1, DEFAULT_DESTINATION_BLOCKCHAIN_ID, mockMessageNonce + ); + bytes32 expectedMessageID2 = teleporterMessenger.calculateMessageID( + sourceBlockchainID2, DEFAULT_DESTINATION_BLOCKCHAIN_ID, mockMessageNonce + ); + + // Receive two messages with the same nonce from different source chains. + _receiveTestMessage( + sourceBlockchainID1, mockMessageNonce, address(0), new TeleporterMessageReceipt[](0) + ); + _receiveTestMessage( + sourceBlockchainID2, mockMessageNonce, address(0), new TeleporterMessageReceipt[](0) + ); + + // Check that both messages were received. + assertTrue(teleporterMessenger.messageReceived(expectedMessageID1)); + assertTrue(teleporterMessenger.messageReceived(expectedMessageID2)); } function testMessageAlreadyReceived() public { @@ -173,7 +227,7 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { testSuccess(); // Check you can't deliver it again. - vm.expectRevert(_formatTeleporterErrorMessage("message already delivered")); + vm.expectRevert(_formatTeleporterErrorMessage("message already received")); teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); } @@ -185,9 +239,9 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { // Construct the test message to be received. TeleporterMessage memory messageToReceive = TeleporterMessage({ - messageID: 42, + messageNonce: 42, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: allowedRelayers, @@ -195,7 +249,7 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { message: DEFAULT_MESSAGE_PAYLOAD }); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -205,6 +259,12 @@ contract ReceiveCrossChainMessagedTest is TeleporterMessengerTest { teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); } + function testZeroRelayerAddress() public { + _receiveTestMessage( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, 12, address(0), new TeleporterMessageReceipt[](0) + ); + } + function testMessageSentToEOADoesNotExecute() public { _receiveMessageSentToEOA(); } diff --git a/contracts/src/Teleporter/tests/RedeemRelayerRewardsTests.t.sol b/contracts/src/Teleporter/tests/RedeemRelayerRewardsTests.t.sol index 112949bb1..261d13e34 100644 --- a/contracts/src/Teleporter/tests/RedeemRelayerRewardsTests.t.sol +++ b/contracts/src/Teleporter/tests/RedeemRelayerRewardsTests.t.sol @@ -100,19 +100,24 @@ contract RedeemRelayerRewardsTest is TeleporterMessengerTest { // receiving back a message with receipt of that message such that the relayer // is able to redeem the reward. function _setUpRelayerRewards(FeeRewardInfo memory feeRewardInfo) private { - uint256 messageID = - _sendTestMessageWithFee(DEFAULT_ORIGIN_CHAIN_ID, feeRewardInfo.feeAmount); + uint256 messageNonce = teleporterMessenger.messageNonce(); + _sendTestMessageWithFee(DEFAULT_ORIGIN_BLOCKCHAIN_ID, feeRewardInfo.feeAmount); TeleporterMessageReceipt[] memory receipts = new TeleporterMessageReceipt[](1); receipts[0] = TeleporterMessageReceipt({ - receivedMessageID: messageID, + receivedMessageNonce: messageNonce, relayerRewardAddress: feeRewardInfo.relayerRewardAddress }); TeleporterMessage memory messageToReceive = _createMockTeleporterMessage(1, new bytes(0)); + bytes32 receivedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageToReceive.messageNonce + ); messageToReceive.receipts = receipts; WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -120,8 +125,8 @@ contract RedeemRelayerRewardsTest is TeleporterMessengerTest { address expectedRelayerRewardAddress = 0x93753a9eA4C9D6eeed9f64eA92E97ce1f5FBAeDe; vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + receivedMessageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), expectedRelayerRewardAddress, messageToReceive @@ -138,9 +143,9 @@ contract RedeemRelayerRewardsTest is TeleporterMessengerTest { // Check that the message received is considered delivered, and that the relayer reward address is stored. assertEq( - teleporterMessenger.getRelayerRewardAddress(DEFAULT_ORIGIN_CHAIN_ID, 1), + teleporterMessenger.getRelayerRewardAddress(receivedMessageID), expectedRelayerRewardAddress ); - assertTrue(teleporterMessenger.messageReceived(DEFAULT_ORIGIN_CHAIN_ID, 1)); + assertTrue(teleporterMessenger.messageReceived(receivedMessageID)); } } diff --git a/contracts/src/Teleporter/tests/RetryMessageExecutionTests.t.sol b/contracts/src/Teleporter/tests/RetryMessageExecutionTests.t.sol index beeebca4b..9a4374886 100644 --- a/contracts/src/Teleporter/tests/RetryMessageExecutionTests.t.sol +++ b/contracts/src/Teleporter/tests/RetryMessageExecutionTests.t.sol @@ -112,9 +112,9 @@ contract RetryMessageExecutionTest is TeleporterMessengerTest { function testMessageHashNotFound() public { // Retrying a message that never was delivered should always fail. TeleporterMessage memory fakeMessage = TeleporterMessage({ - messageID: 12345, + messageNonce: 12345, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(destinationContract), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), @@ -123,7 +123,7 @@ contract RetryMessageExecutionTest is TeleporterMessengerTest { }); vm.expectRevert(_formatTeleporterErrorMessage("message not found")); - teleporterMessenger.retryMessageExecution(DEFAULT_ORIGIN_CHAIN_ID, fakeMessage); + teleporterMessenger.retryMessageExecution(DEFAULT_ORIGIN_BLOCKCHAIN_ID, fakeMessage); } function testInvalidMessageHash() public { @@ -191,9 +191,9 @@ contract RetryMessageExecutionTest is TeleporterMessengerTest { action = FlakyMessageReceiverAction.ReceiveMessage; } TeleporterMessage memory messageToReceive = TeleporterMessage({ - messageID: 42, + messageNonce: 42, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(destinationContract), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), @@ -201,7 +201,12 @@ contract RetryMessageExecutionTest is TeleporterMessengerTest { message: abi.encode(action, abi.encode(messageString)) }); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); + bytes32 messageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + messageToReceive.messageNonce + ); // Mock the call to the warp precompile to get the message. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -211,16 +216,14 @@ contract RetryMessageExecutionTest is TeleporterMessengerTest { vm.roll(12); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + messageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), DEFAULT_RELAYER_REWARD_ADDRESS, messageToReceive ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); - emit MessageExecutionFailed( - DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID, messageToReceive - ); + emit MessageExecutionFailed(messageID, DEFAULT_ORIGIN_BLOCKCHAIN_ID, messageToReceive); teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); // Check that the message execution didn't have any effect, but @@ -229,16 +232,11 @@ contract RetryMessageExecutionTest is TeleporterMessengerTest { assertEq(destinationContract.latestMessageSenderSubnetID(), bytes32(0)); assertEq(destinationContract.latestMessageSenderAddress(), address(0)); assertEq( - teleporterMessenger.getRelayerRewardAddress( - DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID - ), - DEFAULT_RELAYER_REWARD_ADDRESS - ); - assertTrue( - teleporterMessenger.messageReceived(DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID) + teleporterMessenger.getRelayerRewardAddress(messageID), DEFAULT_RELAYER_REWARD_ADDRESS ); + assertTrue(teleporterMessenger.messageReceived(messageID)); - return (DEFAULT_ORIGIN_CHAIN_ID, messageToReceive, messageString); + return (DEFAULT_ORIGIN_BLOCKCHAIN_ID, messageToReceive, messageString); } function _successfullyRetryMessage() internal returns (bytes32, TeleporterMessage memory) { @@ -249,7 +247,12 @@ contract RetryMessageExecutionTest is TeleporterMessengerTest { // Now retry the message execution in a block with an odd height, which should succeed. vm.roll(13); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); - emit MessageExecuted(originBlockchainID, message.messageID); + emit MessageExecuted( + teleporterMessenger.calculateMessageID( + originBlockchainID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, message.messageNonce + ), + originBlockchainID + ); teleporterMessenger.retryMessageExecution(originBlockchainID, message); // Check that the message had the proper affect on the destination contract. diff --git a/contracts/src/Teleporter/tests/RetrySendCrossChainMessageTests.t.sol b/contracts/src/Teleporter/tests/RetrySendCrossChainMessageTests.t.sol index f07ef7fc3..2ae440a22 100644 --- a/contracts/src/Teleporter/tests/RetrySendCrossChainMessageTests.t.sol +++ b/contracts/src/Teleporter/tests/RetrySendCrossChainMessageTests.t.sol @@ -21,11 +21,12 @@ contract RetrySendCrossChainMessageTest is TeleporterMessengerTest { function testSuccess() public { // Send a message - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, 654456); + uint256 expectedNonce = teleporterMessenger.messageNonce(); + _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, 654456); TeleporterMessage memory expectedMessage = TeleporterMessage({ - messageID: messageID, + messageNonce: expectedNonce, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), @@ -34,16 +35,14 @@ contract RetrySendCrossChainMessageTest is TeleporterMessengerTest { }); // Retry it - teleporterMessenger.retrySendCrossChainMessage( - DEFAULT_DESTINATION_CHAIN_ID, expectedMessage - ); + teleporterMessenger.retrySendCrossChainMessage(expectedMessage); } function testMessageNotFound() public { TeleporterMessage memory fakeMessage = TeleporterMessage({ - messageID: 354, + messageNonce: 345, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), @@ -51,16 +50,17 @@ contract RetrySendCrossChainMessageTest is TeleporterMessengerTest { message: new bytes(0) }); vm.expectRevert(_formatTeleporterErrorMessage("message not found")); - teleporterMessenger.retrySendCrossChainMessage(DEFAULT_DESTINATION_CHAIN_ID, fakeMessage); + teleporterMessenger.retrySendCrossChainMessage(fakeMessage); } function testInvalidMessageHash() public { // Send a message, then try to alter it's contents. - uint256 messageID = _sendTestMessageWithFee(DEFAULT_DESTINATION_CHAIN_ID, 654456); + uint256 expectedNonce = teleporterMessenger.messageNonce(); + _sendTestMessageWithFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, 654456); TeleporterMessage memory alteredMessage = TeleporterMessage({ - messageID: messageID, + messageNonce: expectedNonce, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), @@ -70,6 +70,6 @@ contract RetrySendCrossChainMessageTest is TeleporterMessengerTest { // Retry it - should fail. vm.expectRevert(_formatTeleporterErrorMessage("invalid message hash")); - teleporterMessenger.retrySendCrossChainMessage(DEFAULT_DESTINATION_CHAIN_ID, alteredMessage); + teleporterMessenger.retrySendCrossChainMessage(alteredMessage); } } diff --git a/contracts/src/Teleporter/tests/SendCrossChainMessageTests.t.sol b/contracts/src/Teleporter/tests/SendCrossChainMessageTests.t.sol index 4b65e4087..730fcb875 100644 --- a/contracts/src/Teleporter/tests/SendCrossChainMessageTests.t.sol +++ b/contracts/src/Teleporter/tests/SendCrossChainMessageTests.t.sol @@ -24,10 +24,17 @@ contract SendCrossChainMessageTest is TeleporterMessengerTest { function testSendMessageNoFee() public { // Arrange - TeleporterMessage memory expectedMessage = _createMockTeleporterMessage(1, hex"deadbeef"); + uint256 expectedMessageNonce = teleporterMessenger.messageNonce(); + bytes32 expectedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + expectedMessageNonce + ); + TeleporterMessage memory expectedMessage = + _createMockTeleporterMessage(expectedMessageNonce, hex"deadbeef"); TeleporterFeeInfo memory feeInfo = TeleporterFeeInfo(address(0), 0); TeleporterMessageInput memory messageInput = TeleporterMessageInput({ - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: expectedMessage.destinationAddress, feeInfo: feeInfo, requiredGasLimit: expectedMessage.requiredGasLimit, @@ -51,17 +58,11 @@ contract SendCrossChainMessageTest is TeleporterMessengerTest { // Expect the SendCrossChainMessage event to be emitted. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit SendCrossChainMessage( - messageInput.destinationBlockchainID, - expectedMessage.messageID, - expectedMessage, - feeInfo + expectedMessageID, messageInput.destinationBlockchainID, expectedMessage, feeInfo ); // Act - uint256 messageID = teleporterMessenger.sendCrossChainMessage(messageInput); - - // Assert - assertEq(messageID, 1); + teleporterMessenger.sendCrossChainMessage(messageInput); // Check receipt queue uint256 queueSize = @@ -72,11 +73,13 @@ contract SendCrossChainMessageTest is TeleporterMessengerTest { function testSendMessageWithFee() public { // Arrange // Construct the message to submit. - TeleporterMessage memory expectedMessage = _createMockTeleporterMessage(1, hex"deadbeef"); + uint256 expectedMessageNonce = teleporterMessenger.messageNonce(); + TeleporterMessage memory expectedMessage = + _createMockTeleporterMessage(expectedMessageNonce, hex"deadbeef"); TeleporterFeeInfo memory feeInfo = TeleporterFeeInfo(address(_mockFeeAsset), 13131313131313131313); TeleporterMessageInput memory messageInput = TeleporterMessageInput({ - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: expectedMessage.destinationAddress, feeInfo: feeInfo, requiredGasLimit: expectedMessage.requiredGasLimit, @@ -100,8 +103,12 @@ contract SendCrossChainMessageTest is TeleporterMessengerTest { // Expect the SendCrossChainMessage event to be emitted. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit SendCrossChainMessage( + teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + expectedMessageNonce + ), messageInput.destinationBlockchainID, - expectedMessage.messageID, expectedMessage, feeInfo ); @@ -116,17 +123,14 @@ contract SendCrossChainMessageTest is TeleporterMessengerTest { ); // Act - uint256 messageID = teleporterMessenger.sendCrossChainMessage(messageInput); - - // Assert - assertEq(messageID, 1); + teleporterMessenger.sendCrossChainMessage(messageInput); } function testFeeAssetDoesNotExist() public { address invalidFeeAsset = 0xb8be9140D8717f4a8fd7e8ae23C5668bc3A4B39c; uint256 feeAmount = 4567; TeleporterMessageInput memory messageInput = TeleporterMessageInput({ - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, feeInfo: TeleporterFeeInfo(invalidFeeAsset, feeAmount), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, @@ -147,7 +151,7 @@ contract SendCrossChainMessageTest is TeleporterMessengerTest { function testFeeTransferFailure() public { uint256 feeAmount = 4567; TeleporterMessageInput memory messageInput = TeleporterMessageInput({ - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, feeInfo: TeleporterFeeInfo(address(_mockFeeAsset), feeAmount), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, @@ -176,7 +180,7 @@ contract SendCrossChainMessageTest is TeleporterMessengerTest { address invalidFeeAsset = address(0); uint256 feeAmount = 4567; TeleporterMessageInput memory messageInput = TeleporterMessageInput({ - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, feeInfo: TeleporterFeeInfo(invalidFeeAsset, feeAmount), requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, diff --git a/contracts/src/Teleporter/tests/SendSpecifiedReceiptsTests.t.sol b/contracts/src/Teleporter/tests/SendSpecifiedReceiptsTests.t.sol index a27014bd0..ff528ad83 100644 --- a/contracts/src/Teleporter/tests/SendSpecifiedReceiptsTests.t.sol +++ b/contracts/src/Teleporter/tests/SendSpecifiedReceiptsTests.t.sol @@ -33,52 +33,65 @@ contract SendSpecifiedReceiptsTest is TeleporterMessengerTest { TeleporterMessageReceipt[] memory expectedReceipts = new TeleporterMessageReceipt[](3); for (uint256 i = 0; i < relayerRewardAddresses.length; i++) { _receiveTestMessage( - DEFAULT_DESTINATION_CHAIN_ID, + DEFAULT_ORIGIN_BLOCKCHAIN_ID, i + 1, relayerRewardAddresses[i], new TeleporterMessageReceipt[](0) ); expectedReceipts[i] = TeleporterMessageReceipt({ - receivedMessageID: i + 1, + receivedMessageNonce: i + 1, relayerRewardAddress: relayerRewardAddresses[i] }); } // Mock sending a message back to that chain, which should include the 3 receipts. + uint256 expectedMessageNonce = teleporterMessenger.messageNonce(); TeleporterMessage memory expectedMessage = TeleporterMessage({ - messageID: 1, + messageNonce: expectedMessageNonce, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_ORIGIN_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), receipts: expectedReceipts, message: new bytes(0) }); + bytes32 expectedMessageID = teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, DEFAULT_ORIGIN_BLOCKCHAIN_ID, expectedMessageNonce + ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); TeleporterFeeInfo memory feeInfo = TeleporterFeeInfo(address(0), 0); - emit SendCrossChainMessage(DEFAULT_DESTINATION_CHAIN_ID, 1, expectedMessage, feeInfo); - uint256 outboundMessageID = _sendTestMessageWithNoFee(DEFAULT_DESTINATION_CHAIN_ID); - assertEq(outboundMessageID, 1); + emit SendCrossChainMessage( + expectedMessageID, DEFAULT_ORIGIN_BLOCKCHAIN_ID, expectedMessage, feeInfo + ); + bytes32 outboundMessageID = _sendTestMessageWithNoFee(DEFAULT_ORIGIN_BLOCKCHAIN_ID); + assertEq(outboundMessageID, expectedMessageID); assertEq( - teleporterMessenger.getRelayerRewardAddress(DEFAULT_DESTINATION_CHAIN_ID, 1), + teleporterMessenger.getRelayerRewardAddress( + teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, 1 + ) + ), relayerRewardAddresses[0] ); TeleporterMessageReceipt[] memory newExpectedReceipts = new TeleporterMessageReceipt[](2); newExpectedReceipts[0] = TeleporterMessageReceipt({ - receivedMessageID: 3, + receivedMessageNonce: 3, relayerRewardAddress: relayerRewardAddresses[2] }); newExpectedReceipts[1] = TeleporterMessageReceipt({ - receivedMessageID: 1, + receivedMessageNonce: 1, relayerRewardAddress: relayerRewardAddresses[0] }); + uint256 newExpectedMessageNonce = teleporterMessenger.messageNonce(); + bytes32 newExpectedMessageID = + teleporterMessenger.getNextMessageID(DEFAULT_ORIGIN_BLOCKCHAIN_ID); TeleporterMessage memory newExpectedMessage = TeleporterMessage({ - messageID: 2, + messageNonce: newExpectedMessageNonce, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_ORIGIN_BLOCKCHAIN_ID, destinationAddress: address(0), requiredGasLimit: uint256(0), allowedRelayerAddresses: new address[](0), @@ -87,23 +100,51 @@ contract SendSpecifiedReceiptsTest is TeleporterMessengerTest { }); // Retry sending two of the receipts with {sendSpecifiedReceipts}. - uint256[] memory receiptIDs = new uint256[](2); - receiptIDs[0] = 3; - receiptIDs[1] = 1; + bytes32[] memory receiptIDs = new bytes32[](2); + receiptIDs[0] = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, 3 + ); + receiptIDs[1] = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, 1 + ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); - emit SendCrossChainMessage(DEFAULT_DESTINATION_CHAIN_ID, 2, newExpectedMessage, feeInfo); + emit SendCrossChainMessage( + newExpectedMessageID, DEFAULT_ORIGIN_BLOCKCHAIN_ID, newExpectedMessage, feeInfo + ); outboundMessageID = - _sendSpecifiedReceiptsWithNoFee(DEFAULT_DESTINATION_CHAIN_ID, receiptIDs); + _sendSpecifiedReceiptsWithNoFee(DEFAULT_ORIGIN_BLOCKCHAIN_ID, receiptIDs); - assertEq(outboundMessageID, 2); + assertEq(outboundMessageID, newExpectedMessageID); + } + + function testMessageIDNotFromOriginBlockchain() public { + // Mock receiving a message from another chain + uint256 receivedMessageNonce = 987; + _receiveTestMessage( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, + receivedMessageNonce, + address(0), + new TeleporterMessageReceipt[](0) + ); + bytes32[] memory receiptIDs = new bytes32[](1); + receiptIDs[0] = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, receivedMessageNonce + ); + + // Call sendSpecifiedReceipts to try to send the receipts for those message IDs to a + // different chain than they were delivered by. + bytes32 otherBlockchainID = + bytes32(hex"11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff"); + vm.expectRevert(_formatTeleporterErrorMessage("message ID not from origin blockchain")); + _sendSpecifiedReceiptsWithNoFee(otherBlockchainID, receiptIDs); } function testDuplicateAllowed() public { // Mock receiving a message from another chain _receiveTestMessage( - DEFAULT_DESTINATION_CHAIN_ID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, 1, DEFAULT_RELAYER_REWARD_ADDRESS, new TeleporterMessageReceipt[](0) @@ -111,16 +152,19 @@ contract SendSpecifiedReceiptsTest is TeleporterMessengerTest { // Mock sending a message to that chain, which should include the 2 copies of the same receipt. TeleporterMessageReceipt memory expectedReceipt = TeleporterMessageReceipt({ - receivedMessageID: 1, + receivedMessageNonce: 1, relayerRewardAddress: DEFAULT_RELAYER_REWARD_ADDRESS }); TeleporterMessageReceipt[] memory expectedReceipts = new TeleporterMessageReceipt[](2); expectedReceipts[0] = expectedReceipt; expectedReceipts[1] = expectedReceipt; + uint256 expectedMessageNonce = teleporterMessenger.messageNonce(); + bytes32 expectedMessageID = + teleporterMessenger.getNextMessageID(DEFAULT_DESTINATION_BLOCKCHAIN_ID); TeleporterMessage memory expectedMessage = TeleporterMessage({ - messageID: 1, + messageNonce: expectedMessageNonce, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: address(0), requiredGasLimit: uint256(0), allowedRelayerAddresses: new address[](0), @@ -128,44 +172,53 @@ contract SendSpecifiedReceiptsTest is TeleporterMessengerTest { message: new bytes(0) }); - uint256[] memory messageIDs = new uint256[](2); - messageIDs[0] = 1; - messageIDs[1] = 1; + bytes32[] memory messageIDs = new bytes32[](2); + messageIDs[0] = teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, 1 + ); + messageIDs[1] = teleporterMessenger.calculateMessageID( + DEFAULT_DESTINATION_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, 1 + ); // Test sendSpecifiedReceipts when there are duplicate message IDs in the input. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit SendCrossChainMessage( - DEFAULT_DESTINATION_CHAIN_ID, 1, expectedMessage, TeleporterFeeInfo(address(0), 0) + expectedMessageID, + DEFAULT_DESTINATION_BLOCKCHAIN_ID, + expectedMessage, + TeleporterFeeInfo(address(0), 0) ); - uint256 outboundMessageID = - _sendSpecifiedReceiptsWithNoFee(DEFAULT_DESTINATION_CHAIN_ID, messageIDs); - assertEq(outboundMessageID, 1); + bytes32 outboundMessageID = + _sendSpecifiedReceiptsWithNoFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, messageIDs); + assertEq(outboundMessageID, expectedMessageID); } function testMissingMessage() public { // Mock receiving a message from another chain _receiveTestMessage( - DEFAULT_DESTINATION_CHAIN_ID, + DEFAULT_ORIGIN_BLOCKCHAIN_ID, 1, DEFAULT_RELAYER_REWARD_ADDRESS, new TeleporterMessageReceipt[](0) ); - uint256[] memory missingIDs = new uint256[](1); - missingIDs[0] = 21; + bytes32[] memory missingIDs = new bytes32[](1); + missingIDs[0] = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, 21 + ); // Try to send a receipt for an unreceived message from that chain - should fail. vm.expectRevert(_formatTeleporterErrorMessage("receipt not found")); - _sendSpecifiedReceiptsWithNoFee(DEFAULT_DESTINATION_CHAIN_ID, missingIDs); + _sendSpecifiedReceiptsWithNoFee(DEFAULT_DESTINATION_BLOCKCHAIN_ID, missingIDs); } function _sendSpecifiedReceiptsWithFee( bytes32 blockchainID, - uint256[] memory messageIDs, + bytes32[] memory messageIDs, address feeAddress, uint256 feeAmount - ) private returns (uint256) { + ) private returns (bytes32) { vm.mockCall( WARP_PRECOMPILE_ADDRESS, abi.encode(IWarpMessenger.sendWarpMessage.selector), @@ -201,8 +254,8 @@ contract SendSpecifiedReceiptsTest is TeleporterMessengerTest { function _sendSpecifiedReceiptsWithNoFee( bytes32 blockchainID, - uint256[] memory messageIDs - ) private returns (uint256) { + bytes32[] memory messageIDs + ) private returns (bytes32) { return _sendSpecifiedReceiptsWithFee(blockchainID, messageIDs, address(0), 0); } } diff --git a/contracts/src/Teleporter/tests/TeleporterMessengerTest.t.sol b/contracts/src/Teleporter/tests/TeleporterMessengerTest.t.sol index 07cc0f28a..144e67ccd 100644 --- a/contracts/src/Teleporter/tests/TeleporterMessengerTest.t.sol +++ b/contracts/src/Teleporter/tests/TeleporterMessengerTest.t.sol @@ -24,9 +24,9 @@ import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract TeleporterMessengerTest is Test { TeleporterMessenger public teleporterMessenger; - bytes32 public constant DEFAULT_ORIGIN_CHAIN_ID = + bytes32 public constant DEFAULT_ORIGIN_BLOCKCHAIN_ID = bytes32(hex"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"); - bytes32 public constant DEFAULT_DESTINATION_CHAIN_ID = + bytes32 public constant DEFAULT_DESTINATION_BLOCKCHAIN_ID = bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); address public constant DEFAULT_DESTINATION_ADDRESS = 0xd54e3E251b9b0EEd3ed70A858e927bbC2659587d; uint256 public constant DEFAULT_REQUIRED_GAS_LIMIT = 1e6; @@ -36,40 +36,30 @@ contract TeleporterMessengerTest is Test { UnitTestMockERC20 internal _mockFeeAsset; + event BlockchainIDInitialized(bytes32 indexed blockchainID); + event SendCrossChainMessage( + bytes32 indexed messageID, bytes32 indexed destinationBlockchainID, - uint256 indexed messageID, TeleporterMessage message, TeleporterFeeInfo feeInfo ); - event AddFeeAmount( - bytes32 indexed destinationBlockchainID, - uint256 indexed messageID, - TeleporterFeeInfo updatedFeeInfo - ); + event AddFeeAmount(bytes32 indexed messageID, TeleporterFeeInfo updatedFeeInfo); event ReceiveCrossChainMessage( + bytes32 indexed messageID, bytes32 indexed originBlockchainID, - uint256 indexed messageID, address indexed deliverer, address rewardRedeemer, TeleporterMessage message ); event MessageExecutionFailed( - bytes32 indexed originBlockchainID, uint256 indexed messageID, TeleporterMessage message + bytes32 indexed messageID, bytes32 indexed originBlockchainID, TeleporterMessage message ); - event MessageExecuted(bytes32 indexed originBlockchainID, uint256 indexed messageID); - - event FailedFeePayment( - bytes32 indexed destinationBlockchainID, - uint256 indexed messageID, - address indexed feeAsset, - uint256 feeAmount, - address relayerRewardAddress - ); + event MessageExecuted(bytes32 indexed messageID, bytes32 indexed originBlockchainID); event RelayerRewardsRedeemed(address indexed redeemer, address indexed asset, uint256 amount); @@ -77,7 +67,7 @@ contract TeleporterMessengerTest is Test { vm.mockCall( WARP_PRECOMPILE_ADDRESS, abi.encodeWithSelector(IWarpMessenger.getBlockchainID.selector), - abi.encode(DEFAULT_DESTINATION_CHAIN_ID) + abi.encode(DEFAULT_DESTINATION_BLOCKCHAIN_ID) ); teleporterMessenger = new TeleporterMessenger(); @@ -85,16 +75,22 @@ contract TeleporterMessengerTest is Test { // Blockchain ID should be 0 before it is initialized. assertEq(teleporterMessenger.blockchainID(), bytes32(0)); + // Initialize the blockchain ID. + vm.expectEmit(true, true, true, true, address(teleporterMessenger)); + emit BlockchainIDInitialized(DEFAULT_DESTINATION_BLOCKCHAIN_ID); + teleporterMessenger.initializeBlockchainID(); + assertEq(teleporterMessenger.blockchainID(), DEFAULT_DESTINATION_BLOCKCHAIN_ID); + _mockFeeAsset = new UnitTestMockERC20(); } function testEmptyReceiptQueue() public { - assertEq(teleporterMessenger.getReceiptQueueSize(DEFAULT_DESTINATION_CHAIN_ID), 0); + assertEq(teleporterMessenger.getReceiptQueueSize(DEFAULT_DESTINATION_BLOCKCHAIN_ID), 0); vm.expectRevert("ReceiptQueue: index out of bounds"); TeleporterMessageReceipt memory receipt = - teleporterMessenger.getReceiptAtIndex(DEFAULT_DESTINATION_CHAIN_ID, 0); - assertEq(receipt.receivedMessageID, 0); + teleporterMessenger.getReceiptAtIndex(DEFAULT_DESTINATION_BLOCKCHAIN_ID, 0); + assertEq(receipt.receivedMessageNonce, 0); assertEq(receipt.relayerRewardAddress, address(0)); } @@ -105,7 +101,7 @@ contract TeleporterMessengerTest is Test { function _sendTestMessageWithFee( bytes32 blockchainID, uint256 feeAmount - ) internal returns (uint256) { + ) internal returns (bytes32) { vm.mockCall( WARP_PRECOMPILE_ADDRESS, abi.encode(IWarpMessenger.sendWarpMessage.selector), @@ -141,7 +137,7 @@ contract TeleporterMessengerTest is Test { return teleporterMessenger.sendCrossChainMessage(messageInput); } - function _sendTestMessageWithNoFee(bytes32 blockchainID) internal returns (uint256) { + function _sendTestMessageWithNoFee(bytes32 blockchainID) internal returns (bytes32) { return _sendTestMessageWithFee(blockchainID, 0); } @@ -161,13 +157,13 @@ contract TeleporterMessengerTest is Test { function _receiveTestMessage( bytes32 originBlockchainID, - uint256 messageID, + uint256 messageNonce, address relayerRewardAddress, TeleporterMessageReceipt[] memory receipts ) internal { // Construct the test message to be received. TeleporterMessage memory messageToReceive = - _createMockTeleporterMessage(messageID, new bytes(0)); + _createMockTeleporterMessage(messageNonce, new bytes(0)); messageToReceive.receipts = receipts; // Both the sender and destination address should be the teleporter contract address, @@ -181,8 +177,10 @@ contract TeleporterMessengerTest is Test { // Receive the message. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + teleporterMessenger.calculateMessageID( + originBlockchainID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, messageNonce + ), warpMessage.sourceChainID, - messageToReceive.messageID, address(this), relayerRewardAddress, messageToReceive @@ -200,9 +198,14 @@ contract TeleporterMessengerTest is Test { // Construct the test message to be received. By default, the destination // address will be the DEFAULT_DESTINATION_ADDRESS. - TeleporterMessage memory messageToReceive = _createMockTeleporterMessage(13, messageData); + uint256 messageNonce = 9; + TeleporterMessage memory messageToReceive = + _createMockTeleporterMessage(messageNonce, messageData); WarpMessage memory warpMessage = - _createDefaultWarpMessage(DEFAULT_ORIGIN_CHAIN_ID, abi.encode(messageToReceive)); + _createDefaultWarpMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, abi.encode(messageToReceive)); + bytes32 messageID = teleporterMessenger.calculateMessageID( + DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_BLOCKCHAIN_ID, messageNonce + ); // We have to mock the precompile call so that it doesn't revert in the tests. _setUpSuccessGetVerifiedWarpMessageMock(0, warpMessage); @@ -214,32 +217,30 @@ contract TeleporterMessengerTest is Test { // Receive the message - which should fail execution. vm.expectEmit(true, true, true, true, address(teleporterMessenger)); emit ReceiveCrossChainMessage( + messageID, warpMessage.sourceChainID, - messageToReceive.messageID, address(this), DEFAULT_RELAYER_REWARD_ADDRESS, messageToReceive ); vm.expectEmit(true, true, true, true, address(teleporterMessenger)); - emit MessageExecutionFailed( - DEFAULT_ORIGIN_CHAIN_ID, messageToReceive.messageID, messageToReceive - ); + emit MessageExecutionFailed(messageID, DEFAULT_ORIGIN_BLOCKCHAIN_ID, messageToReceive); teleporterMessenger.receiveCrossChainMessage(0, DEFAULT_RELAYER_REWARD_ADDRESS); - return (DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_DESTINATION_ADDRESS, messageToReceive); + return (DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_DESTINATION_ADDRESS, messageToReceive); } // Create a mock message to be used in tests. It should include no receipts // because receipts are only valid if they refer to messages previously send // to the origin chain. function _createMockTeleporterMessage( - uint256 messageID, + uint256 messageNonce, bytes memory message ) internal view returns (TeleporterMessage memory) { return TeleporterMessage({ - messageID: messageID, + messageNonce: messageNonce, senderAddress: address(this), - destinationBlockchainID: DEFAULT_DESTINATION_CHAIN_ID, + destinationBlockchainID: DEFAULT_DESTINATION_BLOCKCHAIN_ID, destinationAddress: DEFAULT_DESTINATION_ADDRESS, requiredGasLimit: DEFAULT_REQUIRED_GAS_LIMIT, allowedRelayerAddresses: new address[](0), diff --git a/contracts/src/Teleporter/upgrades/tests/PauseTeleporterAddressTests.t.sol b/contracts/src/Teleporter/upgrades/tests/PauseTeleporterAddressTests.t.sol index c4086a5ce..a5bc4274a 100644 --- a/contracts/src/Teleporter/upgrades/tests/PauseTeleporterAddressTests.t.sol +++ b/contracts/src/Teleporter/upgrades/tests/PauseTeleporterAddressTests.t.sol @@ -16,12 +16,12 @@ contract PauseTeleporterAddressTest is TeleporterUpgradeableTest { function testPauseTeleporterAddressBasic() public { // Check that the teleporterAddress is not paused initially vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Check that teleporterAddress can not deliver messages once paused _pauseTeleporterAddressSuccess(app, teleporterAddress); vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("Teleporter address paused")); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testAlreadyPausedTeleporterAddress() public { @@ -29,7 +29,7 @@ contract PauseTeleporterAddressTest is TeleporterUpgradeableTest { _pauseTeleporterAddressSuccess(app, teleporterAddress); vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("Teleporter address paused")); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Check that teleporterAddress can not be paused again vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("address already paused")); app.pauseTeleporterAddress(teleporterAddress); @@ -44,19 +44,19 @@ contract PauseTeleporterAddressTest is TeleporterUpgradeableTest { // Check that the teleporterAddress is not paused initially vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Check that teleporterAddress can not deliver messages once paused _pauseTeleporterAddressSuccess(app, teleporterAddress); vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("Teleporter address paused")); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Check that after updating mininum Teleporter version, the address is still paused _updateMinTeleporterVersionSuccess(app, teleporterRegistry.latestVersion()); vm.prank(teleporterAddress); vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("Teleporter address paused")); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testPauseBeforeRegister() public { @@ -74,7 +74,7 @@ contract PauseTeleporterAddressTest is TeleporterUpgradeableTest { // Check that the new Teleporter address is paused vm.prank(newTeleporterAddress); vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("Teleporter address paused")); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testPauseZeroAddress() public { diff --git a/contracts/src/Teleporter/upgrades/tests/TeleporterOwnerUpgradeableTests.t.sol b/contracts/src/Teleporter/upgrades/tests/TeleporterOwnerUpgradeableTests.t.sol index c391c47b3..fe8d4ba57 100644 --- a/contracts/src/Teleporter/upgrades/tests/TeleporterOwnerUpgradeableTests.t.sol +++ b/contracts/src/Teleporter/upgrades/tests/TeleporterOwnerUpgradeableTests.t.sol @@ -110,17 +110,15 @@ contract TeleporterOwnerUpgradeableTest is TeleporterUpgradeableTest { // Check that the Teleporter address is still paused vm.prank(teleporterAddress); - vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("Teleporter address paused")); - ownerApp.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); - assertTrue(ownerApp.isTeleporterAddressPaused(teleporterAddress)); + vm.expectRevert("TeleporterUpgradeable: Teleporter address paused"); + ownerApp.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Unpause the Teleporter address from owner account _unpauseTeleporterAddressSuccess(ownerApp, teleporterAddress); // Check that the Teleporter address can now deliver messages vm.prank(teleporterAddress); - ownerApp.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); - assertFalse(ownerApp.isTeleporterAddressPaused(teleporterAddress)); + ownerApp.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testOwnerUpgradeAccess() public { diff --git a/contracts/src/Teleporter/upgrades/tests/TeleporterUpgradeableTests.t.sol b/contracts/src/Teleporter/upgrades/tests/TeleporterUpgradeableTests.t.sol index d41c77506..9bd7f66d0 100644 --- a/contracts/src/Teleporter/upgrades/tests/TeleporterUpgradeableTests.t.sol +++ b/contracts/src/Teleporter/upgrades/tests/TeleporterUpgradeableTests.t.sol @@ -8,6 +8,7 @@ pragma solidity 0.8.18; import {TeleporterUpgradeable} from "../TeleporterUpgradeable.sol"; import {TeleporterRegistryTest} from "./TeleporterRegistryTests.t.sol"; import {ITeleporterMessenger} from "../../ITeleporterMessenger.sol"; +import {TeleporterMessenger} from "../../TeleporterMessenger.sol"; contract ExampleUpgradeableApp is TeleporterUpgradeable { constructor(address teleporterRegistryAddress) @@ -34,7 +35,7 @@ contract ExampleUpgradeableApp is TeleporterUpgradeable { contract TeleporterUpgradeableTest is TeleporterRegistryTest { ExampleUpgradeableApp public app; - bytes32 public constant DEFAULT_ORIGIN_CHAIN_ID = + bytes32 public constant DEFAULT_ORIGIN_BLOCKCHAIN_ID = bytes32(hex"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"); address public constant DEFAULT_ORIGIN_ADDRESS = 0xd54e3E251b9b0EEd3ed70A858e927bbC2659587d; @@ -64,10 +65,36 @@ contract TeleporterUpgradeableTest is TeleporterRegistryTest { assertEq(app.getMinTeleporterVersion(), 1); vm.expectRevert(_formatRegistryErrorMessage("protocol address not found")); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + } + + function testUpdateMinTeleporterVersion() public { + // First check that calling with initial teleporter address works + assertEq(app.getMinTeleporterVersion(), 1); + vm.prank(teleporterAddress); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + + // Now add new protocol version to registry and update the app's min version + address newTeleporterAddress = address(new TeleporterMessenger()); + _addProtocolVersion(teleporterRegistry, newTeleporterAddress); + + vm.expectEmit(true, true, true, true, address(app)); + emit MinTeleporterVersionUpdated(1, 2); + + app.updateMinTeleporterVersion(teleporterRegistry.latestVersion()); + assertEq(app.getMinTeleporterVersion(), 2); + + // Check that calling with the old teleporter address fails + vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("invalid Teleporter sender")); + vm.prank(teleporterAddress); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + + // Check that calling with the new teleporter address works + vm.prank(newTeleporterAddress); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testSetMinTeleporterVersion() public { diff --git a/contracts/src/Teleporter/upgrades/tests/UnpauseTeleporterAddressTests.t.sol b/contracts/src/Teleporter/upgrades/tests/UnpauseTeleporterAddressTests.t.sol index 38accbc8a..027874e13 100644 --- a/contracts/src/Teleporter/upgrades/tests/UnpauseTeleporterAddressTests.t.sol +++ b/contracts/src/Teleporter/upgrades/tests/UnpauseTeleporterAddressTests.t.sol @@ -24,7 +24,7 @@ contract UnpauseTeleporterAddressTest is TeleporterUpgradeableTest { // The Teleporter address paused no longer can deliver messages to the app vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("Teleporter address paused")); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Add a new Teleporter address to the registry and update minimum version address newTeleporterAddress = address(new TeleporterMessenger()); @@ -38,27 +38,27 @@ contract UnpauseTeleporterAddressTest is TeleporterUpgradeableTest { // because the minimum version is still greater than the Teleporter address version vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("invalid Teleporter sender")); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Check that the new Teleporter address delivers messages fine vm.prank(newTeleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testUnpauseTeleporterAddressBasic() public { // Check that the teleporterAddress is not paused initially vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Check that teleporterAddress can not deliver messages once paused _pauseTeleporterAddressSuccess(app, teleporterAddress); vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("Teleporter address paused")); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Unpause the teleporterAddress and check that it can deliver messages again _unpauseTeleporterAddressSuccess(app, teleporterAddress); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testAlreadyUnpausedTeleporterAddress() public { @@ -94,7 +94,7 @@ contract UnpauseTeleporterAddressTest is TeleporterUpgradeableTest { // Check that the new Teleporter address is unpaused vm.prank(newTeleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testUnpauseAfterRegister() public { @@ -114,7 +114,7 @@ contract UnpauseTeleporterAddressTest is TeleporterUpgradeableTest { // Check that the new Teleporter address is unpaused vm.prank(newTeleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testUnpauseZeroAddress() public { diff --git a/contracts/src/Teleporter/upgrades/tests/UpdateMinTeleporterVersionTests.t.sol b/contracts/src/Teleporter/upgrades/tests/UpdateMinTeleporterVersionTests.t.sol index 7855fa8a6..9e676d400 100644 --- a/contracts/src/Teleporter/upgrades/tests/UpdateMinTeleporterVersionTests.t.sol +++ b/contracts/src/Teleporter/upgrades/tests/UpdateMinTeleporterVersionTests.t.sol @@ -17,7 +17,7 @@ contract UpdateMinTeleporterVersionTest is TeleporterUpgradeableTest { // First check that calling with initial teleporter address works assertEq(app.getMinTeleporterVersion(), 1); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Now add new protocol version to registry and update the app's min version address newTeleporterAddress = address(new TeleporterMessenger()); @@ -29,11 +29,11 @@ contract UpdateMinTeleporterVersionTest is TeleporterUpgradeableTest { // Check that calling with the old teleporter address fails vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("invalid Teleporter sender")); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Check that calling with the new teleporter address works vm.prank(newTeleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testUpdateToNonRegisteredVersion() public { @@ -74,11 +74,11 @@ contract UpdateMinTeleporterVersionTest is TeleporterUpgradeableTest { // Make sure that the old minimum Teleporter version can not deliver messages vm.expectRevert(_formatTeleporterUpgradeableErrorMessage("invalid Teleporter sender")); vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); // Make sure that the new minimum Teleporter version can still deliver messages vm.prank(newTeleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testUpdateWithCurrentVersion() public { @@ -99,7 +99,7 @@ contract UpdateMinTeleporterVersionTest is TeleporterUpgradeableTest { // Check that calling with the teleporter address works vm.prank(teleporterAddress); - app.receiveTeleporterMessage(DEFAULT_ORIGIN_CHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); + app.receiveTeleporterMessage(DEFAULT_ORIGIN_BLOCKCHAIN_ID, DEFAULT_ORIGIN_ADDRESS, ""); } function testUpdateWithGreaterThanLatestVersion() public { diff --git a/docker/run_setup.sh b/docker/run_setup.sh index 21ce52ff5..2d1e70367 100755 --- a/docker/run_setup.sh +++ b/docker/run_setup.sh @@ -101,10 +101,10 @@ if [ ! -e $dir_prefix/NETWORK_RUNNING ]; then echo $teleporter_deploy_address $teleporter_contract_address echo "Finished reading universal deploy address and transaction" - cast send --private-key $user_private_key --value 50ether $teleporter_deploy_address --rpc-url $subnet_a_rpc_url - cast send --private-key $user_private_key --value 50ether $teleporter_deploy_address --rpc-url $subnet_b_rpc_url - cast send --private-key $user_private_key --value 50ether $teleporter_deploy_address --rpc-url $subnet_c_rpc_url - cast send --private-key $user_private_key --value 50ether $teleporter_deploy_address --rpc-url $c_chain_rpc_url + cast send --private-key $user_private_key --value 10ether $teleporter_deploy_address --rpc-url $subnet_a_rpc_url + cast send --private-key $user_private_key --value 10ether $teleporter_deploy_address --rpc-url $subnet_b_rpc_url + cast send --private-key $user_private_key --value 10ether $teleporter_deploy_address --rpc-url $subnet_c_rpc_url + cast send --private-key $user_private_key --value 10ether $teleporter_deploy_address --rpc-url $c_chain_rpc_url echo "Sent ether to teleporter deployer on each subnet." # Verify that the transaction status was successful for the deployments @@ -133,6 +133,13 @@ if [ ! -e $dir_prefix/NETWORK_RUNNING ]; then fi echo "Deployed TeleporterMessenger to C-chain." + # Initialize the blockchain ID of the Teleporter contract on each chain. + cast send --private-key $user_private_key $teleporter_contract_address "initializeBlockchainID()(bytes32)" --rpc-url $subnet_a_rpc_url + cast send --private-key $user_private_key $teleporter_contract_address "initializeBlockchainID()(bytes32)" --rpc-url $subnet_b_rpc_url + cast send --private-key $user_private_key $teleporter_contract_address "initializeBlockchainID()(bytes32)" --rpc-url $subnet_c_rpc_url + cast send --private-key $user_private_key $teleporter_contract_address "initializeBlockchainID()(bytes32)" --rpc-url $c_chain_rpc_url + echo "Initialized blockchain ID of TeleporterMessenger contracts." + # Deploy TeleporterRegistry to each chain. cd contracts registry_deploy_result_a=$(forge create --private-key $user_private_key \ diff --git a/scripts/local/examples/basic_send_receive.sh b/scripts/local/examples/basic_send_receive.sh index 005da84d7..98f02dbc6 100755 --- a/scripts/local/examples/basic_send_receive.sh +++ b/scripts/local/examples/basic_send_receive.sh @@ -40,7 +40,7 @@ blockchainID=$(cast call $warp_messenger_precompile_addr "getBlockchainID()(byte echo "Got blockchain ID $blockchainID" echo "Sending call to teleporter contract address $teleporter_contract_address $subnet_a_blockchain_id_hex $c_chain_rpc_url" -result=$(cast call $teleporter_contract_address "getNextMessageID(bytes32)(uint256)" $subnet_a_blockchain_id_hex --rpc-url $c_chain_rpc_url) +result=$(cast call $teleporter_contract_address "getNextMessageID(bytes32)(bytes32)" $subnet_a_blockchain_id_hex --rpc-url $c_chain_rpc_url) echo "Next message ID for subnet $subnet_a_blockchain_id_hex is $result" # Directly send a transaction to the teleporter contract sendCrossChainMessage function. @@ -67,13 +67,12 @@ fi echo "Approved the Teleporter contract to spend the test ERC20 token from the user account." -startID=$(cast call $teleporter_contract_address "sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes))(uint256)" "($send_cross_subnet_message_destination_chain_id,$send_cross_subnet_message_destination_address,($erc20_contract_address_c_chain,$send_cross_subnet_message_fee_amount),$send_cross_subnet_message_required_gas_limit,[],$send_cross_subnet_message_message_data)" --from $user_address --rpc-url $c_chain_rpc_url) +startID=$(cast call $teleporter_contract_address "sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes))(bytes32)" "($send_cross_subnet_message_destination_chain_id,$send_cross_subnet_message_destination_address,($erc20_contract_address_c_chain,$send_cross_subnet_message_fee_amount),$send_cross_subnet_message_required_gas_limit,[],$send_cross_subnet_message_message_data)" --from $user_address --rpc-url $c_chain_rpc_url) echo "Got starting ID $startID to teleport address $teleporter_contract_address" -echo "Got Ids $c_chain_blockchain_id_hex $subnet_a_blockchain_id_hex $c_chain_subnet_id $subnet_a_subnet_id" -cast send $teleporter_contract_address "sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes))(uint256)" "($send_cross_subnet_message_destination_chain_id,$send_cross_subnet_message_destination_address,($erc20_contract_address_c_chain,$send_cross_subnet_message_fee_amount),$send_cross_subnet_message_required_gas_limit,[],$send_cross_subnet_message_message_data)" --private-key $user_private_key --rpc-url $c_chain_rpc_url +cast send $teleporter_contract_address "sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes))(bytes32)" "($send_cross_subnet_message_destination_chain_id,$send_cross_subnet_message_destination_address,($erc20_contract_address_c_chain,$send_cross_subnet_message_fee_amount),$send_cross_subnet_message_required_gas_limit,[],$send_cross_subnet_message_message_data)" --private-key $user_private_key --rpc-url $c_chain_rpc_url retry_count=0 -received=$(cast call $teleporter_contract_address "messageReceived(bytes32,uint256)(bool)" $c_chain_blockchain_id_hex $startID --rpc-url $subnet_a_rpc_url) +received=$(cast call $teleporter_contract_address "messageReceived(bytes32)(bool)" $startID --rpc-url $subnet_a_rpc_url) until [[ $received == "true" ]] do if [[ retry_count -ge 10 ]]; then @@ -83,7 +82,7 @@ do echo "Waiting for destination chain on Subnet A to receive message ID $startID. Retry count: $retry_count" sleep 3 - received=$(cast call $teleporter_contract_address "messageReceived(bytes32,uint256)(bool)" $c_chain_blockchain_id_hex $startID --rpc-url $subnet_a_rpc_url) + received=$(cast call $teleporter_contract_address "messageReceived(bytes32)(bool)" $startID --rpc-url $subnet_a_rpc_url) retry_count=$((retry_count+1)) done @@ -98,7 +97,7 @@ blockchainID=$(cast call $warp_messenger_precompile_addr "getBlockchainID()(byte echo "Got blockchain ID $blockchainID" echo "Sending call to teleporter contract address $teleporter_contract_address $c_chain_blockchain_id_hex $subnet_a_subnet_id" -result=$(cast call $teleporter_contract_address "getNextMessageID(bytes32)(uint256)" $c_chain_blockchain_id_hex --rpc-url $subnet_a_rpc_url) +result=$(cast call $teleporter_contract_address "getNextMessageID(bytes32)(bytes32)" $c_chain_blockchain_id_hex --rpc-url $subnet_a_rpc_url) echo "Next message ID for subnet $c_chain_blockchain_id_hex is $result" # Directly send a few transaction to the teleporter contract sendCrossChainMessage function. @@ -119,13 +118,13 @@ fi echo "Approved the Teleporter contract to spend the test ERC20 token from the user account." -startID=$(cast call $teleporter_contract_address "sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes))(uint256)" "($send_cross_subnet_message_destination_chain_id,$send_cross_subnet_message_destination_address,($erc20_contract_address_a,$send_cross_subnet_message_fee_amount),$send_cross_subnet_message_required_gas_limit,[],$send_cross_subnet_message_message_data)" --from $user_address --rpc-url $subnet_a_rpc_url) +startID=$(cast call $teleporter_contract_address "sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes))(bytes32)" "($send_cross_subnet_message_destination_chain_id,$send_cross_subnet_message_destination_address,($erc20_contract_address_a,$send_cross_subnet_message_fee_amount),$send_cross_subnet_message_required_gas_limit,[],$send_cross_subnet_message_message_data)" --from $user_address --rpc-url $subnet_a_rpc_url) echo "Got starting ID $startID to teleport address $teleporter_contract_address" echo "Got Ids $subnet_a_blockchain_id_hex $c_chain_blockchain_id_hex $subnet_a_subnet_id $c_chain_subnet_id" -cast send $teleporter_contract_address "sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes))(uint256)" "($send_cross_subnet_message_destination_chain_id,$send_cross_subnet_message_destination_address,($erc20_contract_address_a,$send_cross_subnet_message_fee_amount),$send_cross_subnet_message_required_gas_limit,[],$send_cross_subnet_message_message_data)" --private-key $user_private_key --rpc-url $subnet_a_rpc_url +cast send $teleporter_contract_address "sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes))(bytes32)" "($send_cross_subnet_message_destination_chain_id,$send_cross_subnet_message_destination_address,($erc20_contract_address_a,$send_cross_subnet_message_fee_amount),$send_cross_subnet_message_required_gas_limit,[],$send_cross_subnet_message_message_data)" --private-key $user_private_key --rpc-url $subnet_a_rpc_url retry_count=0 -received=$(cast call $teleporter_contract_address "messageReceived(bytes32,uint256)(bool)" $subnet_a_blockchain_id_hex $startID --rpc-url $c_chain_rpc_url) +received=$(cast call $teleporter_contract_address "messageReceived(bytes32)(bool)" $startID --rpc-url $c_chain_rpc_url) until [[ $received == "true" ]] do if [[ retry_count -ge 10 ]]; then @@ -135,7 +134,7 @@ do echo "Waiting for the C-Chain to receive message ID $startID. Retry count: $retry_count" sleep 3 - received=$(cast call $teleporter_contract_address "messageReceived(bytes32,uint256)(bool)" $subnet_a_blockchain_id_hex $startID --rpc-url $c_chain_rpc_url) + received=$(cast call $teleporter_contract_address "messageReceived(bytes32)(bool)" $startID --rpc-url $c_chain_rpc_url) retry_count=$((retry_count+1)) done diff --git a/tests/flows/add_fee_amount.go b/tests/flows/add_fee_amount.go index 98d4ccc9d..e53f17de2 100644 --- a/tests/flows/add_fee_amount.go +++ b/tests/flows/add_fee_amount.go @@ -73,7 +73,7 @@ func AddFeeAmount(network interfaces.Network) { // Check Teleporter message received on the destination (SubnetB) delivered, err := - subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetAInfo.BlockchainID, messageID) + subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -95,7 +95,7 @@ func AddFeeAmount(network interfaces.Network) { network.RelayMessage(ctx, sendCrossChainMsgReceipt, subnetBInfo, subnetAInfo, true) // Check message delivered - delivered, err = subnetAInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetBInfo.BlockchainID, messageID) + delivered, err = subnetAInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) diff --git a/tests/flows/basic_send_receive.go b/tests/flows/basic_send_receive.go index 0eafb5611..fe3cfac7e 100644 --- a/tests/flows/basic_send_receive.go +++ b/tests/flows/basic_send_receive.go @@ -73,7 +73,7 @@ func BasicSendReceive(network interfaces.Network) { // Check Teleporter message received on the destination // delivered, err := subnetBInfo.TeleporterMessenger.MessageReceived( - &bind.CallOpts{}, subnetAInfo.BlockchainID, teleporterMessageID, + &bind.CallOpts{}, teleporterMessageID, ) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -100,7 +100,7 @@ func BasicSendReceive(network interfaces.Network) { // Check Teleporter message received on the destination // delivered, err = subnetAInfo.TeleporterMessenger.MessageReceived( - &bind.CallOpts{}, subnetBInfo.BlockchainID, teleporterMessageID, + &bind.CallOpts{}, teleporterMessageID, ) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) diff --git a/tests/flows/deliver_to_nonexistent_contract.go b/tests/flows/deliver_to_nonexistent_contract.go index 9d1fc31d1..24fa6482e 100644 --- a/tests/flows/deliver_to_nonexistent_contract.go +++ b/tests/flows/deliver_to_nonexistent_contract.go @@ -75,7 +75,7 @@ func DeliverToNonExistentContract(network interfaces.Network) { Expect(err).Should(BeNil()) Expect(sendEvent.DestinationBlockchainID[:]).Should(Equal(subnetBInfo.BlockchainID[:])) - teleporterMessageID := sendEvent.Message.MessageID + teleporterMessageID := sendEvent.MessageID // // Relay the message to the destination @@ -85,7 +85,6 @@ func DeliverToNonExistentContract(network interfaces.Network) { receiveEvent, err := utils.GetEventFromLogs(receipt.Logs, subnetAInfo.TeleporterMessenger.ParseReceiveCrossChainMessage) Expect(err).Should(BeNil()) - deliveredTeleporterMessage := receiveEvent.Message // // Check that the message was successfully relayed @@ -93,7 +92,6 @@ func DeliverToNonExistentContract(network interfaces.Network) { log.Info("Checking the message was successfully relayed") delivered, err := subnetBInfo.TeleporterMessenger.MessageReceived( &bind.CallOpts{}, - subnetAInfo.BlockchainID, teleporterMessageID, ) Expect(err).Should(BeNil()) @@ -108,7 +106,7 @@ func DeliverToNonExistentContract(network interfaces.Network) { subnetBInfo.TeleporterMessenger.ParseMessageExecutionFailed, ) Expect(err).Should(BeNil()) - Expect(executionFailedEvent.Message.MessageID).Should(Equal(deliveredTeleporterMessage.MessageID)) + Expect(executionFailedEvent.MessageID).Should(Equal(receiveEvent.MessageID)) // // Deploy the contract on Subnet B @@ -128,7 +126,7 @@ func DeliverToNonExistentContract(network interfaces.Network) { ctx, subnetAInfo.BlockchainID, subnetBInfo, - deliveredTeleporterMessage, + receiveEvent.Message, fundedKey, ) diff --git a/tests/flows/deliver_to_wrong_chain.go b/tests/flows/deliver_to_wrong_chain.go index da8c05a74..1af4303c2 100644 --- a/tests/flows/deliver_to_wrong_chain.go +++ b/tests/flows/deliver_to_wrong_chain.go @@ -82,7 +82,7 @@ func DeliverToWrongChain(network interfaces.Network) { // Check that the message was not received on the Subnet C // delivered, err := subnetCInfo.TeleporterMessenger.MessageReceived( - &bind.CallOpts{}, subnetAInfo.BlockchainID, expectedAtoCMessageID, + &bind.CallOpts{}, expectedAtoCMessageID, ) Expect(err).Should(BeNil()) Expect(delivered).Should(BeFalse()) diff --git a/tests/flows/erc20_bridge_multihop.go b/tests/flows/erc20_bridge_multihop.go index 38db19dc6..de93d4616 100644 --- a/tests/flows/erc20_bridge_multihop.go +++ b/tests/flows/erc20_bridge_multihop.go @@ -86,7 +86,6 @@ func ERC20BridgeMultihop(network interfaces.Network) { // Check Teleporter message received on the destination delivered, err := subnetBTeleporterMessenger.MessageReceived( &bind.CallOpts{}, - subnetAInfo.BlockchainID, messageID, ) Expect(err).Should(BeNil()) @@ -150,7 +149,6 @@ func ERC20BridgeMultihop(network interfaces.Network) { // Check Teleporter message received on the destination delivered, err = subnetCTeleporterMessenger.MessageReceived( &bind.CallOpts{}, - subnetAInfo.BlockchainID, messageID, ) Expect(err).Should(BeNil()) @@ -197,7 +195,7 @@ func ERC20BridgeMultihop(network interfaces.Network) { Expect(err).Should(BeNil()) // Check Teleporter message received on the destination - delivered, err = subnetBTeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetAInfo.BlockchainID, messageID) + delivered, err = subnetBTeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -254,7 +252,6 @@ func ERC20BridgeMultihop(network interfaces.Network) { // Check Teleporter message received on the destination delivered, err = subnetATeleporterMessenger.MessageReceived( &bind.CallOpts{}, - subnetBInfo.BlockchainID, messageID, ) Expect(err).Should(BeNil()) @@ -265,7 +262,7 @@ func ERC20BridgeMultihop(network interfaces.Network) { event, err := utils.GetEventFromLogs(receipt.Logs, subnetATeleporterMessenger.ParseSendCrossChainMessage) Expect(err).Should(BeNil()) Expect(event.DestinationBlockchainID[:]).Should(Equal(subnetCInfo.BlockchainID[:])) - messageID = event.Message.MessageID + messageID = event.MessageID // Check the redeemable reward balance of the relayer if the relayer address was set updatedRewardAmount, err := subnetATeleporterMessenger.CheckRelayerRewardAmount( @@ -284,7 +281,7 @@ func ERC20BridgeMultihop(network interfaces.Network) { Expect(err).Should(BeNil()) // Check Teleporter message received on the destination - delivered, err = subnetCTeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetAInfo.BlockchainID, messageID) + delivered, err = subnetCTeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -335,7 +332,7 @@ func ERC20BridgeMultihop(network interfaces.Network) { network.RelayMessage(ctx, receipt, subnetCInfo, subnetAInfo, true) // Check Teleporter message received on the destination - delivered, err = subnetATeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetCInfo.BlockchainID, messageID) + delivered, err = subnetATeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -367,7 +364,7 @@ func submitCreateBridgeToken( fundedKey *ecdsa.PrivateKey, transactor *erc20bridge.ERC20Bridge, teleporterMessenger *teleportermessenger.TeleporterMessenger, -) (*types.Receipt, *big.Int) { +) (*types.Receipt, ids.ID) { opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, source.EVMChainID) Expect(err).Should(BeNil()) @@ -390,9 +387,9 @@ func submitCreateBridgeToken( log.Info("Successfully SubmitCreateBridgeToken", "txHash", tx.Hash().Hex(), - "messageID", event.Message.MessageID) + "messageID", event.MessageID) - return receipt, event.Message.MessageID + return receipt, event.MessageID } func bridgeToken( @@ -411,7 +408,7 @@ func bridgeToken( isNative bool, nativeTokenChainID ids.ID, teleporterMessenger *teleportermessenger.TeleporterMessenger, -) (*types.Receipt, *big.Int) { +) (*types.Receipt, ids.ID) { opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, source.EVMChainID) Expect(err).Should(BeNil()) @@ -438,7 +435,7 @@ func bridgeToken( Expect(event.DestinationBlockchainID[:]).Should(Equal(nativeTokenChainID[:])) } - return receipt, event.Message.MessageID + return receipt, event.MessageID } func approveBridgeToken( diff --git a/tests/flows/example_messenger.go b/tests/flows/example_messenger.go index a39b6e6d3..a1ed8cd22 100644 --- a/tests/flows/example_messenger.go +++ b/tests/flows/example_messenger.go @@ -51,7 +51,7 @@ func ExampleMessenger(network interfaces.Network) { Expect(err).Should(BeNil()) Expect(event.DestinationBlockchainID[:]).Should(Equal(subnetBInfo.BlockchainID[:])) - teleporterMessageID := event.Message.MessageID + teleporterMessageID := event.MessageID // // Relay the message to the destination @@ -62,7 +62,7 @@ func ExampleMessenger(network interfaces.Network) { // Check Teleporter message received on the destination // delivered, err := subnetBInfo.TeleporterMessenger.MessageReceived( - &bind.CallOpts{}, subnetAInfo.BlockchainID, teleporterMessageID, + &bind.CallOpts{}, teleporterMessageID, ) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) diff --git a/tests/flows/insufficient_gas.go b/tests/flows/insufficient_gas.go index 8dba96319..34f0fd879 100644 --- a/tests/flows/insufficient_gas.go +++ b/tests/flows/insufficient_gas.go @@ -40,14 +40,14 @@ func InsufficientGas(network interfaces.Network) { Expect(err).Should(BeNil()) Expect(event.DestinationBlockchainID[:]).Should(Equal(subnetBInfo.BlockchainID[:])) - messageID := event.Message.MessageID + messageID := event.MessageID // Relay message from SubnetA to SubnetB receipt = network.RelayMessage(ctx, receipt, subnetAInfo, subnetBInfo, true) // Check Teleporter message received on the destination delivered, err := - subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetAInfo.BlockchainID, messageID) + subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -56,7 +56,7 @@ func InsufficientGas(network interfaces.Network) { receipt.Logs, subnetBInfo.TeleporterMessenger.ParseMessageExecutionFailed, ) Expect(err).Should(BeNil()) - Expect(failedMessageExecutionEvent.MessageID).Should(Equal(messageID)) + Expect(failedMessageExecutionEvent.MessageID[:]).Should(Equal(messageID[:])) Expect(failedMessageExecutionEvent.OriginBlockchainID[:]).Should(Equal(subnetAInfo.BlockchainID[:])) // Retry message execution. This will execute the message with as much gas as needed @@ -70,7 +70,7 @@ func InsufficientGas(network interfaces.Network) { ) executedEvent, err := utils.GetEventFromLogs(receipt.Logs, subnetBInfo.TeleporterMessenger.ParseMessageExecuted) Expect(err).Should(BeNil()) - Expect(executedEvent.MessageID).Should(Equal(messageID)) + Expect(executedEvent.MessageID[:]).Should(Equal(messageID[:])) Expect(executedEvent.OriginBlockchainID[:]).Should(Equal(subnetAInfo.BlockchainID[:])) // diff --git a/tests/flows/relay_message_twice.go b/tests/flows/relay_message_twice.go index e11aff349..567609c20 100644 --- a/tests/flows/relay_message_twice.go +++ b/tests/flows/relay_message_twice.go @@ -54,7 +54,7 @@ func RelayMessageTwice(network interfaces.Network) { // log.Info("Checking the message was received on the destination") delivered, err := subnetBInfo.TeleporterMessenger.MessageReceived( - &bind.CallOpts{}, subnetAInfo.BlockchainID, teleporterMessageID, + &bind.CallOpts{}, teleporterMessageID, ) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) diff --git a/tests/flows/relayer_modifies_message.go b/tests/flows/relayer_modifies_message.go index 8e9efa1e9..3ce021e2a 100644 --- a/tests/flows/relayer_modifies_message.go +++ b/tests/flows/relayer_modifies_message.go @@ -56,7 +56,7 @@ func RelayerModifiesMessage(network interfaces.LocalNetwork) { // Check Teleporter message was not received on the destination delivered, err := - subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetAInfo.BlockchainID, messageID) + subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeFalse()) } diff --git a/tests/flows/resubmit_altered_message.go b/tests/flows/resubmit_altered_message.go index b9370d28b..8181da98f 100644 --- a/tests/flows/resubmit_altered_message.go +++ b/tests/flows/resubmit_altered_message.go @@ -41,14 +41,14 @@ func ResubmitAlteredMessage(network interfaces.Network) { log.Info("Checking the message was received on the destination") delivered, err := - subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetAInfo.BlockchainID, messageID) + subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) // Get the Teleporter message from receive event event, err := utils.GetEventFromLogs(receipt.Logs, subnetBInfo.TeleporterMessenger.ParseReceiveCrossChainMessage) Expect(err).Should(BeNil()) - Expect(event.MessageID).Should(Equal(messageID)) + Expect(event.MessageID[:]).Should(Equal(messageID[:])) teleporterMessage := event.Message // Alter the message @@ -63,7 +63,7 @@ func ResubmitAlteredMessage(network interfaces.Network) { opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) Expect(err).Should(BeNil()) tx, err := - subnetAInfo.TeleporterMessenger.RetrySendCrossChainMessage(opts, subnetBInfo.BlockchainID, teleporterMessage) + subnetAInfo.TeleporterMessenger.RetrySendCrossChainMessage(opts, teleporterMessage) Expect(err).ShouldNot(BeNil()) // We expect the tx to be nil because the Warp message failed verification, which happens in the predicate diff --git a/tests/flows/retry_successful_execution.go b/tests/flows/retry_successful_execution.go index 4b4e28d6a..22112d9b4 100644 --- a/tests/flows/retry_successful_execution.go +++ b/tests/flows/retry_successful_execution.go @@ -50,7 +50,7 @@ func RetrySuccessfulExecution(network interfaces.Network) { Expect(err).Should(BeNil()) Expect(event.DestinationBlockchainID[:]).Should(Equal(subnetBInfo.BlockchainID[:])) - teleporterMessageID := event.Message.MessageID + teleporterMessageID := event.MessageID // // Relay the message to the destination @@ -65,7 +65,7 @@ func RetrySuccessfulExecution(network interfaces.Network) { // Check Teleporter message received on the destination // delivered, err := subnetBInfo.TeleporterMessenger.MessageReceived( - &bind.CallOpts{}, subnetAInfo.BlockchainID, teleporterMessageID, + &bind.CallOpts{}, teleporterMessageID, ) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) diff --git a/tests/flows/send_specific_receipts.go b/tests/flows/send_specific_receipts.go index 10c9092d1..62dc80a08 100644 --- a/tests/flows/send_specific_receipts.go +++ b/tests/flows/send_specific_receipts.go @@ -1,6 +1,7 @@ package flows import ( + "bytes" "context" "crypto/ecdsa" "math/big" @@ -71,7 +72,7 @@ func SendSpecificReceipts(network interfaces.Network) { // Check that the first message was delivered delivered, err := - subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetAInfo.BlockchainID, messageID1) + subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID1) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -88,7 +89,7 @@ func SendSpecificReceipts(network interfaces.Network) { // Check that the second message was delivered delivered, err = - subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetAInfo.BlockchainID, messageID2) + subnetBInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID2) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -97,7 +98,7 @@ func SendSpecificReceipts(network interfaces.Network) { ctx, subnetAInfo.BlockchainID, subnetBInfo, - []*big.Int{messageID1, messageID2}, + [][32]byte{messageID1, messageID2}, teleportermessenger.TeleporterFeeInfo{ FeeTokenAddress: mockTokenAddress, Amount: big.NewInt(0), @@ -110,7 +111,7 @@ func SendSpecificReceipts(network interfaces.Network) { network.RelayMessage(ctx, receipt, subnetBInfo, subnetAInfo, true) // Check that the message back to Subnet A was delivered - delivered, err = subnetAInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetBInfo.BlockchainID, messageID) + delivered, err = subnetAInfo.TeleporterMessenger.MessageReceived(&bind.CallOpts{}, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -146,7 +147,6 @@ func SendSpecificReceipts(network interfaces.Network) { // Check delivered delivered, err = subnetAInfo.TeleporterMessenger.MessageReceived( &bind.CallOpts{}, - subnetBInfo.BlockchainID, messageID) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) @@ -155,8 +155,15 @@ func SendSpecificReceipts(network interfaces.Network) { utils.GetEventFromLogs(receipt.Logs, subnetAInfo.TeleporterMessenger.ParseReceiveCrossChainMessage) Expect(err).Should(BeNil()) log.Info("Receipt included", "count", len(receiveEvent.Message.Receipts), "receipts", receiveEvent.Message.Receipts) - Expect(receiptIncluded(messageID1, receiveEvent.Message.Receipts)).Should(BeTrue()) - Expect(receiptIncluded(messageID2, receiveEvent.Message.Receipts)).Should(BeTrue()) + Expect(receiptIncluded( + messageID1, + subnetAInfo, + subnetBInfo, + receiveEvent.Message.Receipts)).Should(BeTrue()) + Expect(receiptIncluded(messageID2, + subnetAInfo, + subnetBInfo, + receiveEvent.Message.Receipts)).Should(BeTrue()) // Check the reward amount remains the same checkExpectedRewardAmounts(subnetAInfo, receiveEvent1, receiveEvent2, mockTokenAddress, relayerFeePerMessage) @@ -208,11 +215,16 @@ func getOutstandingReceiptCount(source interfaces.SubnetTestInfo, destinationBlo // Checks the given message ID is included in the list of receipts. func receiptIncluded( - expectedMessageID *big.Int, + expectedMessageID ids.ID, + sourceSubnet interfaces.SubnetTestInfo, + destinationSubnet interfaces.SubnetTestInfo, receipts []teleportermessenger.TeleporterMessageReceipt, ) bool { for _, receipt := range receipts { - if receipt.ReceivedMessageID.Cmp(expectedMessageID) == 0 { + messageID := utils.CalculateMessageID(sourceSubnet, + destinationSubnet, + receipt.ReceivedMessageNonce) + if bytes.Equal(messageID[:], expectedMessageID[:]) { return true } } diff --git a/tests/flows/unallowed_relayer.go b/tests/flows/unallowed_relayer.go index 6ef165dab..fd9b31b77 100644 --- a/tests/flows/unallowed_relayer.go +++ b/tests/flows/unallowed_relayer.go @@ -55,7 +55,7 @@ func UnallowedRelayer(network interfaces.Network) { // Check Teleporter message was not received on the destination // delivered, err := subnetBInfo.TeleporterMessenger.MessageReceived( - &bind.CallOpts{}, subnetAInfo.BlockchainID, teleporterMessageID, + &bind.CallOpts{}, teleporterMessageID, ) Expect(err).Should(BeNil()) Expect(delivered).Should(BeFalse()) diff --git a/tests/flows/validator_churn.go b/tests/flows/validator_churn.go index 3c3cca406..c9685b4c2 100644 --- a/tests/flows/validator_churn.go +++ b/tests/flows/validator_churn.go @@ -96,7 +96,7 @@ func ValidatorChurn(network interfaces.LocalNetwork) { // Verify the message was not delivered delivered, err := subnetBInfo.TeleporterMessenger.MessageReceived( - &bind.CallOpts{}, subnetAInfo.BlockchainID, teleporterMessageID, + &bind.CallOpts{}, teleporterMessageID, ) Expect(err).Should(BeNil()) Expect(delivered).Should(BeFalse()) @@ -108,7 +108,7 @@ func ValidatorChurn(network interfaces.LocalNetwork) { optsA, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) Expect(err).Should(BeNil()) tx, err := subnetAInfo.TeleporterMessenger.RetrySendCrossChainMessage( - optsA, subnetBInfo.BlockchainID, sentTeleporterMessage, + optsA, sentTeleporterMessage, ) Expect(err).Should(BeNil()) @@ -119,7 +119,7 @@ func ValidatorChurn(network interfaces.LocalNetwork) { // Verify the message was delivered delivered, err = subnetBInfo.TeleporterMessenger.MessageReceived( - &bind.CallOpts{}, subnetAInfo.BlockchainID, teleporterMessageID, + &bind.CallOpts{}, teleporterMessageID, ) Expect(err).Should(BeNil()) Expect(delivered).Should(BeTrue()) diff --git a/tests/testnet/network.go b/tests/testnet/network.go index fa90d1b20..9466f67f4 100644 --- a/tests/testnet/network.go +++ b/tests/testnet/network.go @@ -211,7 +211,7 @@ func (n *testNetwork) RelayMessage(ctx context.Context, ) Expect(err).Should(BeNil()) - teleporterMessageID := sendEvent.Message.MessageID + teleporterMessageID := sendEvent.MessageID receipt, err := n.getMessageDeliveryTransactionReceipt(cctx, source.BlockchainID, destination, teleporterMessageID) Expect(err).Should(BeNil()) @@ -223,7 +223,7 @@ func (n *testNetwork) RelayMessage(ctx context.Context, func (n *testNetwork) checkMessageDelivered( sourceBlockchainID ids.ID, destination interfaces.SubnetTestInfo, - teleporterMessageID *big.Int) (bool, error) { + teleporterMessageID ids.ID) (bool, error) { destinationTeleporterMessenger, err := teleportermessenger.NewTeleporterMessenger( n.teleporterContractAddress, destination.RPCClient) @@ -232,7 +232,7 @@ func (n *testNetwork) checkMessageDelivered( } return destinationTeleporterMessenger.MessageReceived( - &bind.CallOpts{}, sourceBlockchainID, teleporterMessageID, + &bind.CallOpts{}, teleporterMessageID, ) } @@ -240,7 +240,7 @@ func (n *testNetwork) getMessageDeliveryTransactionReceipt( ctx context.Context, sourceBlockchainID ids.ID, destination interfaces.SubnetTestInfo, - teleporterMessageID *big.Int) (*types.Receipt, error) { + teleporterMessageID ids.ID) (*types.Receipt, error) { // Wait until the message is delivered. delivered := false var err error @@ -277,7 +277,7 @@ func (n *testNetwork) getMessageDeliveryTransactionReceipt( Topics: [][]common.Hash{ {abi.Events[receiveCrossChainMessageEventName].ID}, {common.BytesToHash(sourceBlockchainID[:])}, - {common.BigToHash(teleporterMessageID)}, + {common.BytesToHash(teleporterMessageID[:])}, }, }) if err != nil { diff --git a/tests/utils/utils.go b/tests/utils/utils.go index 18427445d..803ecb9fd 100644 --- a/tests/utils/utils.go +++ b/tests/utils/utils.go @@ -58,7 +58,7 @@ func SendAddFeeAmountAndWaitForAcceptance( ctx context.Context, source interfaces.SubnetTestInfo, destination interfaces.SubnetTestInfo, - messageID *big.Int, + messageID ids.ID, amount *big.Int, feeContractAddress common.Address, senderKey *ecdsa.PrivateKey, @@ -68,15 +68,14 @@ func SendAddFeeAmountAndWaitForAcceptance( senderKey, source.EVMChainID) Expect(err).Should(BeNil()) - tx, err := transactor.AddFeeAmount(opts, destination.BlockchainID, messageID, feeContractAddress, amount) + tx, err := transactor.AddFeeAmount(opts, messageID, feeContractAddress, amount) Expect(err).Should(BeNil()) receipt := WaitForTransactionSuccess(ctx, source, tx) addFeeAmountEvent, err := GetEventFromLogs(receipt.Logs, transactor.ParseAddFeeAmount) Expect(err).Should(BeNil()) - Expect(addFeeAmountEvent.MessageID).Should(Equal(messageID)) - Expect(addFeeAmountEvent.DestinationBlockchainID[:]).Should(Equal(destination.BlockchainID[:])) + Expect(addFeeAmountEvent.MessageID[:]).Should(Equal(messageID[:])) log.Info("Send AddFeeAmount transaction on source chain", "messageID", messageID, @@ -156,11 +155,11 @@ func SendSpecifiedReceiptsAndWaitForAcceptance( ctx context.Context, originChainID ids.ID, source interfaces.SubnetTestInfo, - messageIDs []*big.Int, + messageIDs [][32]byte, feeInfo teleportermessenger.TeleporterFeeInfo, allowedRelayerAddresses []common.Address, senderKey *ecdsa.PrivateKey, -) (*types.Receipt, *big.Int) { +) (*types.Receipt, ids.ID) { opts, err := bind.NewKeyedTransactorWithChainID(senderKey, source.EVMChainID) Expect(err).Should(BeNil()) @@ -179,7 +178,7 @@ func SendSpecifiedReceiptsAndWaitForAcceptance( "originChainID", originChainID, "txHash", tx.Hash()) - return receipt, event.Message.MessageID + return receipt, event.MessageID } func HttpToWebsocketURI(uri string, blockchainID string) string { @@ -386,7 +385,7 @@ func SendCrossChainMessageAndWaitForAcceptance( destination interfaces.SubnetTestInfo, input teleportermessenger.TeleporterMessageInput, senderKey *ecdsa.PrivateKey, -) (*types.Receipt, *big.Int) { +) (*types.Receipt, ids.ID) { opts, err := bind.NewKeyedTransactorWithChainID(senderKey, source.EVMChainID) Expect(err).Should(BeNil()) @@ -406,7 +405,7 @@ func SendCrossChainMessageAndWaitForAcceptance( "destinationChainID", destination.BlockchainID, "txHash", tx.Hash()) - return receipt, event.Message.MessageID + return receipt, event.MessageID } // Waits for a transaction to be mined. @@ -700,3 +699,15 @@ func GetTwoSubnets(network interfaces.Network) ( Expect(len(subnets)).Should(BeNumerically(">=", 2)) return subnets[0], subnets[1] } + +func CalculateMessageID( + sourceSubnetInfo interfaces.SubnetTestInfo, + destinationSubnetInfo interfaces.SubnetTestInfo, + messageNonce *big.Int, +) ids.ID { + res, err := sourceSubnetInfo.TeleporterMessenger.CalculateMessageID( + &bind.CallOpts{}, sourceSubnetInfo.BlockchainID, destinationSubnetInfo.BlockchainID, messageNonce, + ) + Expect(err).Should(BeNil()) + return res +}