diff --git a/README.md b/README.md index e988b903..306716a1 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ Note: Do not modify this section! It is auto-generated by `cobra` using `make ge - [polycli signer](doc/polycli_signer.md) - Utilities for security signing transactions +- [polycli ulxly](doc/polycli_ulxly.md) - Utilities for interacting with the lxly bridge + - [polycli version](doc/polycli_version.md) - Get the current version of this application - [polycli wallet](doc/polycli_wallet.md) - Create or inspect BIP39(ish) wallets. diff --git a/bindings/ulxly/PolygonZkEVMBridge.abi b/bindings/ulxly/PolygonZkEVMBridge.abi new file mode 100644 index 00000000..345a3922 --- /dev/null +++ b/bindings/ulxly/PolygonZkEVMBridge.abi @@ -0,0 +1,774 @@ +[ + { + "type": "function", + "name": "activateEmergencyState", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "bridgeAsset", + "inputs": [ + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "forceUpdateGlobalExitRoot", + "type": "bool", + "internalType": "bool" + }, + { + "name": "permitData", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "bridgeMessage", + "inputs": [ + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "forceUpdateGlobalExitRoot", + "type": "bool", + "internalType": "bool" + }, + { + "name": "metadata", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "claimAsset", + "inputs": [ + { + "name": "smtProof", + "type": "bytes32[32]", + "internalType": "bytes32[32]" + }, + { + "name": "index", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "mainnetExitRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "rollupExitRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "metadata", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "claimMessage", + "inputs": [ + { + "name": "smtProof", + "type": "bytes32[32]", + "internalType": "bytes32[32]" + }, + { + "name": "index", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "mainnetExitRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "rollupExitRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "metadata", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "claimedBitMap", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "deactivateEmergencyState", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "depositCount", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getDepositRoot", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getLeafValue", + "inputs": [ + { + "name": "leafType", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "metadataHash", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "getTokenWrappedAddress", + "inputs": [ + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "globalExitRootManager", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IBasePolygonZkEVMGlobalExitRoot" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_networkID", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "_globalExitRootManager", + "type": "address", + "internalType": "contract IBasePolygonZkEVMGlobalExitRoot" + }, + { + "name": "_polygonZkEVMaddress", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "isClaimed", + "inputs": [ + { + "name": "index", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isEmergencyState", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "lastUpdatedDepositCount", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "networkID", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "polygonZkEVMaddress", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "precalculatedWrapperAddress", + "inputs": [ + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "name", + "type": "string", + "internalType": "string" + }, + { + "name": "symbol", + "type": "string", + "internalType": "string" + }, + { + "name": "decimals", + "type": "uint8", + "internalType": "uint8" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "tokenInfoToWrappedToken", + "inputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "updateGlobalExitRoot", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "verifyMerkleProof", + "inputs": [ + { + "name": "leafHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "smtProof", + "type": "bytes32[32]", + "internalType": "bytes32[32]" + }, + { + "name": "index", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "root", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "wrappedTokenToTokenInfo", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "BridgeEvent", + "inputs": [ + { + "name": "leafType", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + }, + { + "name": "originNetwork", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "originAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "destinationNetwork", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "metadata", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + }, + { + "name": "depositCount", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ClaimEvent", + "inputs": [ + { + "name": "index", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "originNetwork", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "originAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "destinationAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "EmergencyStateActivated", + "inputs": [], + "anonymous": false + }, + { + "type": "event", + "name": "EmergencyStateDeactivated", + "inputs": [], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "NewWrappedToken", + "inputs": [ + { + "name": "originNetwork", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "wrappedTokenAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "metadata", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AlreadyClaimed", + "inputs": [] + }, + { + "type": "error", + "name": "AmountDoesNotMatchMsgValue", + "inputs": [] + }, + { + "type": "error", + "name": "DestinationNetworkInvalid", + "inputs": [] + }, + { + "type": "error", + "name": "EtherTransferFailed", + "inputs": [] + }, + { + "type": "error", + "name": "GlobalExitRootInvalid", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidSmtProof", + "inputs": [] + }, + { + "type": "error", + "name": "MerkleTreeFull", + "inputs": [] + }, + { + "type": "error", + "name": "MessageFailed", + "inputs": [] + }, + { + "type": "error", + "name": "MsgValueNotZero", + "inputs": [] + }, + { + "type": "error", + "name": "NotValidAmount", + "inputs": [] + }, + { + "type": "error", + "name": "NotValidOwner", + "inputs": [] + }, + { + "type": "error", + "name": "NotValidSignature", + "inputs": [] + }, + { + "type": "error", + "name": "NotValidSpender", + "inputs": [] + }, + { + "type": "error", + "name": "OnlyEmergencyState", + "inputs": [] + }, + { + "type": "error", + "name": "OnlyNotEmergencyState", + "inputs": [] + }, + { + "type": "error", + "name": "OnlyPolygonZkEVM", + "inputs": [] + } +] diff --git a/bindings/ulxly/PolygonZkEVMBridge.bin b/bindings/ulxly/PolygonZkEVMBridge.bin new file mode 100644 index 00000000..f0b4afa0 --- /dev/null +++ b/bindings/ulxly/PolygonZkEVMBridge.bin @@ -0,0 +1 @@ +0x608060405234801561001057600080fd5b50614743806100206000396000f3fe6080604052600436106200015b5760003560e01c8063647c576c11620000c5578063be5831c71162000078578063be5831c7146200045a578063cd5865791462000480578063d02103ca1462000497578063dbc1697614620004c0578063ee25560b14620004d8578063fb570834146200050957600080fd5b8063647c576c146200033f57806379e2cf97146200036457806381b1c174146200037c5780639e34070f14620003b6578063aaa13cc214620003fb578063bab161bf146200042057600080fd5b80632d2c9d94116200011e5780632d2c9d9414620002255780632dfdf0b5146200024a578063318aee3d146200027157806334ac9cf214620002e05780633ae0504714620003025780633e197043146200031a57600080fd5b806315064c9614620001605780632072f6c5146200019157806322e95f2c14620001ab578063240ff37814620001e95780632cffd02e1462000200575b600080fd5b3480156200016d57600080fd5b506068546200017c9060ff1681565b60405190151581526020015b60405180910390f35b3480156200019e57600080fd5b50620001a96200052e565b005b348015620001b857600080fd5b50620001d0620001ca36600462002424565b62000566565b6040516001600160a01b03909116815260200162000188565b620001a9620001fa366004620024bb565b620005b9565b3480156200020d57600080fd5b50620001a96200021f36600462002552565b620006e0565b3480156200023257600080fd5b50620001a96200024436600462002552565b62000ae5565b3480156200025757600080fd5b506200026260535481565b60405190815260200162000188565b3480156200027e57600080fd5b50620002bb6200029036600462002638565b606b6020526000908152604090205463ffffffff81169064010000000090046001600160a01b031682565b6040805163ffffffff90931683526001600160a01b0390911660208301520162000188565b348015620002ed57600080fd5b50606c54620001d0906001600160a01b031681565b3480156200030f57600080fd5b506200026262000c34565b3480156200032757600080fd5b5062000262620003393660046200266f565b62000d1a565b3480156200034c57600080fd5b50620001a96200035e366004620026f9565b62000da7565b3480156200037157600080fd5b50620001a962000f24565b3480156200038957600080fd5b50620001d06200039b36600462002749565b606a602052600090815260409020546001600160a01b031681565b348015620003c357600080fd5b506200017c620003d536600462002749565b600881901c600090815260696020526040902054600160ff9092169190911b9081161490565b3480156200040857600080fd5b50620001d06200041a36600462002763565b62000f48565b3480156200042d57600080fd5b506068546200044490610100900463ffffffff1681565b60405163ffffffff909116815260200162000188565b3480156200046757600080fd5b506068546200044490600160c81b900463ffffffff1681565b620001a96200049136600462002817565b6200105f565b348015620004a457600080fd5b50606854620001d090600160281b90046001600160a01b031681565b348015620004cd57600080fd5b50620001a9620013f7565b348015620004e557600080fd5b5062000262620004f736600462002749565b60696020526000908152604090205481565b3480156200051657600080fd5b506200017c62000528366004620028b9565b6200142d565b606c546001600160a01b031633146200055a5760405163e2e8106b60e01b815260040160405180910390fd5b6200056462001516565b565b6000606a600084846040516020016200058192919062002906565b60408051601f19818403018152918152815160209283012083529082019290925201600020546001600160a01b031690505b92915050565b60685460ff1615620005de57604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff868116610100909204161480620006045750600263ffffffff861610155b1562000623576040516302caf51760e11b815260040160405180910390fd5b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b6001606860019054906101000a900463ffffffff16338888348888605354604051620006799998979695949392919062002959565b60405180910390a1620006c8620006c26001606860019054906101000a900463ffffffff16338989348989604051620006b4929190620029c8565b604051809103902062000d1a565b62001573565b8215620006d957620006d962001671565b5050505050565b60685460ff16156200070557604051630bc011ff60e21b815260040160405180910390fd5b6200071c8b8b8b8b8b8b8b8b8b8b8b600062001709565b6001600160a01b038616620007c557604080516000808252602082019092526001600160a01b03861690859060405162000757919062002a14565b60006040518083038185875af1925050503d806000811462000796576040519150601f19603f3d011682016040523d82523d6000602084013e6200079b565b606091505b5050905080620007be57604051630ce8f45160e31b815260040160405180910390fd5b5062000a97565b60685463ffffffff610100909104811690881603620007fa57620007f46001600160a01b038716858562001887565b62000a97565b600087876040516020016200081192919062002906565b60408051601f1981840301815291815281516020928301206000818152606a9093529120549091506001600160a01b03168062000a2f57600080806200085a8688018862002aed565b9250925092506000858484846040516200087490620023e8565b620008829392919062002b91565b8190604051809103906000f5905080158015620008a3573d6000803e3d6000fd5b506040516340c10f1960e01b81526001600160a01b038c81166004830152602482018c9052919250908216906340c10f1990604401600060405180830381600087803b158015620008f357600080fd5b505af115801562000908573d6000803e3d6000fd5b5050505080606a600088815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060405180604001604052808e63ffffffff1681526020018d6001600160a01b0316815250606b6000836001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816001600160a01b0302191690836001600160a01b031602179055509050507f490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a398d8d838b8b60405162000a1d95949392919062002bce565b60405180910390a15050505062000a94565b6040516340c10f1960e01b81526001600160a01b038781166004830152602482018790528216906340c10f1990604401600060405180830381600087803b15801562000a7a57600080fd5b505af115801562000a8f573d6000803e3d6000fd5b505050505b50505b7f25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe275459838a8888878760405162000ad095949392919062002c09565b60405180910390a15050505050505050505050565b60685460ff161562000b0a57604051630bc011ff60e21b815260040160405180910390fd5b62000b218b8b8b8b8b8b8b8b8b8b8b600162001709565b6000846001600160a01b031684888a868660405160240162000b47949392919062002c40565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b1790525162000b7e919062002a14565b60006040518083038185875af1925050503d806000811462000bbd576040519150601f19603f3d011682016040523d82523d6000602084013e62000bc2565b606091505b505090508062000be5576040516337e391c360e01b815260040160405180910390fd5b7f25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe275459838b8989888860405162000c1e95949392919062002c09565b60405180910390a1505050505050505050505050565b605354600090819081805b602081101562000d11578083901c60011660010362000ca2576033816020811062000c6e5762000c6e62002c7d565b0154604080516020810192909252810185905260600160405160208183030381529060405280519060200120935062000ccf565b60408051602081018690529081018390526060016040516020818303038152906040528051906020012093505b6040805160208101849052908101839052606001604051602081830303815290604052805190602001209150808062000d089062002ca9565b91505062000c3f565b50919392505050565b6040516001600160f81b031960f889901b1660208201526001600160e01b031960e088811b821660218401526001600160601b0319606089811b821660258601529188901b909216603984015285901b16603d8201526051810183905260718101829052600090609101604051602081830303815290604052805190602001209050979650505050505050565b600054610100900460ff161580801562000dc85750600054600160ff909116105b8062000de45750303b15801562000de4575060005460ff166001145b62000e4d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000e71576000805461ff0019166101001790555b60688054610100600160c81b03191661010063ffffffff87160265010000000000600160c81b03191617600160281b6001600160a01b038681169190910291909117909155606c80546001600160a01b03191691841691909117905562000ed7620018ec565b801562000f1e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b605354606854600160c81b900463ffffffff16101562000564576200056462001671565b600080888860405160200162000f6092919062002906565b604051602081830303815290604052805190602001209050600060ff60f81b30836040518060200162000f9390620023e8565b601f1982820381018352601f90910116604081905262000fc0908d908d908d908d908d9060200162002cc5565b60408051601f198184030181529082905262000fe0929160200162002d06565b604051602081830303815290604052805190602001206040516020016200103994939291906001600160f81b031994909416845260609290921b6001600160601b03191660018401526015830152603582015260550190565b60408051808303601f1901815291905280516020909101209a9950505050505050505050565b60685460ff16156200108457604051630bc011ff60e21b815260040160405180910390fd5b6200108e62001920565b60685463ffffffff888116610100909204161480620010b45750600263ffffffff881610155b15620010d3576040516302caf51760e11b815260040160405180910390fd5b6000806060876001600160a01b0388166200111357883414620011095760405163b89240f560e01b815260040160405180910390fd5b6000925062001368565b3415620011335760405163798ee6f160e01b815260040160405180910390fd5b6001600160a01b038089166000908152606b602090815260409182902082518084019093525463ffffffff8116835264010000000090049092169181018290529015620011f057604051632770a7eb60e21b8152336004820152602481018b90526001600160a01b038a1690639dc29fac90604401600060405180830381600087803b158015620011c357600080fd5b505af1158015620011d8573d6000803e3d6000fd5b50505050806020015194508060000151935062001366565b8515620012055762001205898b89896200197b565b6040516370a0823160e01b81523060048201526000906001600160a01b038b16906370a0823190602401602060405180830381865afa1580156200124d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001273919062002d39565b90506200128c6001600160a01b038b1633308e62001cdd565b6040516370a0823160e01b81523060048201526000906001600160a01b038c16906370a0823190602401602060405180830381865afa158015620012d4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620012fa919062002d39565b905062001308828262002d53565b6068548c9850610100900463ffffffff1696509350620013288762001d17565b620013338c62001dde565b6200133e8d62001e9c565b604051602001620013529392919062002b91565b604051602081830303815290604052945050505b505b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b600084868e8e8688605354604051620013aa98979695949392919062002d69565b60405180910390a1620013cf620006c2600085878f8f87898051906020012062000d1a565b8615620013e057620013e062001671565b50505050620013ee60018055565b50505050505050565b606c546001600160a01b03163314620014235760405163e2e8106b60e01b815260040160405180910390fd5b6200056462001f63565b600084815b60208110156200150857600163ffffffff8616821c81169003620014a45785816020811062001465576200146562002c7d565b60200201358260405160200162001486929190918252602082015260400190565b604051602081830303815290604052805190602001209150620014f3565b81868260208110620014ba57620014ba62002c7d565b6020020135604051602001620014da929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b80620014ff8162002ca9565b91505062001432565b50821490505b949350505050565b60685460ff16156200153b57604051630bc011ff60e21b815260040160405180910390fd5b6068805460ff191660011790556040517f2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a549790600090a1565b806001620015846020600262002ed3565b62001590919062002d53565b60535410620015b2576040516377ae67b360e11b815260040160405180910390fd5b6000605360008154620015c59062002ca9565b9182905550905060005b602081101562001661578082901c60011660010362001607578260338260208110620015ff57620015ff62002c7d565b015550505050565b603381602081106200161d576200161d62002c7d565b015460408051602081019290925281018490526060016040516020818303038152906040528051906020012092508080620016589062002ca9565b915050620015cf565b506200166c62002ee1565b505050565b6053546068805463ffffffff909216600160c81b0263ffffffff60c81b1990921691909117908190556001600160a01b03600160281b909104166333d6247d620016ba62000c34565b6040518263ffffffff1660e01b8152600401620016d991815260200190565b600060405180830381600087803b158015620016f457600080fd5b505af115801562000f1e573d6000803e3d6000fd5b6200171a8b63ffffffff1662001fbc565b6068546040805160208082018e90528183018d9052825180830384018152606083019384905280519101206312bd9b1960e11b9092526064810191909152600091600160281b90046001600160a01b03169063257b3632906084016020604051808303816000875af115801562001795573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620017bb919062002d39565b905080600003620017de57604051622f6fad60e01b815260040160405180910390fd5b60685463ffffffff88811661010090920416146200180f576040516302caf51760e11b815260040160405180910390fd5b606854600090610100900463ffffffff166200182d57508962001830565b508a5b6200185962001850848c8c8c8c8c8c8c604051620006b4929190620029c8565b8f8f846200142d565b62001877576040516338105f3b60e21b815260040160405180910390fd5b5050505050505050505050505050565b6040516001600160a01b0383166024820152604481018290526200166c90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262002008565b600054610100900460ff16620019165760405162461bcd60e51b815260040162000e449062002ef7565b62000564620020e1565b600260015403620019745760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000e44565b6002600155565b60006200198c600482848662002f42565b620019979162002f6e565b9050632afa533160e01b6001600160e01b031982160162001b38576000808080808080620019c9896004818d62002f42565b810190620019d8919062002f9f565b9650965096509650965096509650336001600160a01b0316876001600160a01b03161462001a195760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b038616301462001a435760405163750643af60e01b815260040160405180910390fd5b8a851462001a64576040516303fffc4b60e01b815260040160405180910390fd5b604080516001600160a01b0389811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180516001600160e01b031663d505accf60e01b1790529151918e169162001ae4919062002a14565b6000604051808303816000865af19150503d806000811462001b23576040519150601f19603f3d011682016040523d82523d6000602084013e62001b28565b606091505b50505050505050505050620006d9565b6001600160e01b031981166323f2ebc360e21b1462001b6a57604051637141605d60e11b815260040160405180910390fd5b60008080808080808062001b828a6004818e62002f42565b81019062001b91919062002ffa565b97509750975097509750975097509750336001600160a01b0316886001600160a01b03161462001bd45760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b038716301462001bfe5760405163750643af60e01b815260040160405180910390fd5b604080516001600160a01b038a811660248301528981166044830152606482018990526084820188905286151560a483015260ff861660c483015260e482018590526101048083018590528351808403909101815261012490920183526020820180516001600160e01b03166323f2ebc360e21b1790529151918f169162001c87919062002a14565b6000604051808303816000865af19150503d806000811462001cc6576040519150601f19603f3d011682016040523d82523d6000602084013e62001ccb565b606091505b50505050505050505050505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905262000f1e9085906323b872dd60e01b90608401620018b4565b60408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b179052905160609160009182916001600160a01b0386169162001d60919062002a14565b600060405180830381855afa9150503d806000811462001d9d576040519150601f19603f3d011682016040523d82523d6000602084013e62001da2565b606091505b50915091508162001dd357604051806040016040528060078152602001664e4f5f4e414d4560c81b8152506200150e565b6200150e816200210b565b60408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b179052905160609160009182916001600160a01b0386169162001e27919062002a14565b600060405180830381855afa9150503d806000811462001e64576040519150601f19603f3d011682016040523d82523d6000602084013e62001e69565b606091505b50915091508162001dd357604051806040016040528060098152602001681393d7d4d6535093d360ba1b8152506200150e565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b0386169162001ee4919062002a14565b600060405180830381855afa9150503d806000811462001f21576040519150601f19603f3d011682016040523d82523d6000602084013e62001f26565b606091505b509150915081801562001f3a575080516020145b62001f475760126200150e565b808060200190518101906200150e919062003086565b60018055565b60685460ff1662001f8757604051635386698160e01b815260040160405180910390fd5b6068805460ff191690556040517f1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b390600090a1565b600881901c60008181526069602052604081208054600160ff861690811b91821892839055929091908183169003620006d957604051630c8d9eab60e31b815260040160405180910390fd5b60006200205f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620022b59092919063ffffffff16565b8051909150156200166c5780806020019051810190620020809190620030a6565b6200166c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000e44565b600054610100900460ff1662001f5d5760405162461bcd60e51b815260040162000e449062002ef7565b606060408251106200212d5781806020019051810190620005b39190620030c6565b8151602003620022825760005b6020811080156200216d57508281815181106200215b576200215b62002c7d565b01602001516001600160f81b03191615155b156200218857806200217f8162002ca9565b9150506200213a565b80600003620021c15750506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b6020820152919050565b60008167ffffffffffffffff811115620021df57620021df620029d8565b6040519080825280601f01601f1916602001820160405280156200220a576020820181803683370190505b50905060005b828110156200227a578481815181106200222e576200222e62002c7d565b602001015160f81c60f81b8282815181106200224e576200224e62002c7d565b60200101906001600160f81b031916908160001a90535080620022718162002ca9565b91505062002210565b509392505050565b50506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b602082015290565b919050565b60606200150e848460008585600080866001600160a01b03168587604051620022df919062002a14565b60006040518083038185875af1925050503d80600081146200231e576040519150601f19603f3d011682016040523d82523d6000602084013e62002323565b606091505b5091509150620023368783838762002341565b979650505050505050565b60608315620023b5578251600003620023ad576001600160a01b0385163b620023ad5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000e44565b50816200150e565b6200150e8383815115620023cc5781518083602001fd5b8060405162461bcd60e51b815260040162000e44919062003146565b6115b2806200315c83390190565b803563ffffffff81168114620022b057600080fd5b6001600160a01b03811681146200242157600080fd5b50565b600080604083850312156200243857600080fd5b6200244383620023f6565b9150602083013562002455816200240b565b809150509250929050565b80151581146200242157600080fd5b60008083601f8401126200248257600080fd5b50813567ffffffffffffffff8111156200249b57600080fd5b602083019150836020828501011115620024b457600080fd5b9250929050565b600080600080600060808688031215620024d457600080fd5b620024df86620023f6565b94506020860135620024f1816200240b565b93506040860135620025038162002460565b9250606086013567ffffffffffffffff8111156200252057600080fd5b6200252e888289016200246f565b969995985093965092949392505050565b806104008101831015620005b357600080fd5b60008060008060008060008060008060006105208c8e0312156200257557600080fd5b620025818d8d6200253f565b9a50620025926104008d01620023f6565b99506104208c013598506104408c01359750620025b36104608d01620023f6565b96506104808c0135620025c6816200240b565b9550620025d76104a08d01620023f6565b94506104c08c0135620025ea816200240b565b93506104e08c013592506105008c013567ffffffffffffffff8111156200261057600080fd5b6200261e8e828f016200246f565b915080935050809150509295989b509295989b9093969950565b6000602082840312156200264b57600080fd5b813562002658816200240b565b9392505050565b60ff811681146200242157600080fd5b600080600080600080600060e0888a0312156200268b57600080fd5b873562002698816200265f565b9650620026a860208901620023f6565b95506040880135620026ba816200240b565b9450620026ca60608901620023f6565b93506080880135620026dc816200240b565b9699959850939692959460a0840135945060c09093013592915050565b6000806000606084860312156200270f57600080fd5b6200271a84620023f6565b925060208401356200272c816200240b565b915060408401356200273e816200240b565b809150509250925092565b6000602082840312156200275c57600080fd5b5035919050565b600080600080600080600060a0888a0312156200277f57600080fd5b6200278a88620023f6565b965060208801356200279c816200240b565b9550604088013567ffffffffffffffff80821115620027ba57600080fd5b620027c88b838c016200246f565b909750955060608a0135915080821115620027e257600080fd5b50620027f18a828b016200246f565b909450925050608088013562002807816200265f565b8091505092959891949750929550565b600080600080600080600060c0888a0312156200283357600080fd5b6200283e88620023f6565b9650602088013562002850816200240b565b955060408801359450606088013562002869816200240b565b935060808801356200287b8162002460565b925060a088013567ffffffffffffffff8111156200289857600080fd5b620028a68a828b016200246f565b989b979a50959850939692959293505050565b6000806000806104608587031215620028d157600080fd5b84359350620028e486602087016200253f565b9250620028f56104208601620023f6565b939692955092936104400135925050565b60e09290921b6001600160e01b031916825260601b6001600160601b031916600482015260180190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60ff8a16815263ffffffff89811660208301526001600160a01b03898116604084015288821660608401528716608083015260a0820186905261010060c08301819052600091620029ae848301878962002930565b925080851660e085015250509a9950505050505050505050565b8183823760009101908152919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562002a0b578181015183820152602001620029f1565b50506000910152565b6000825162002a28818460208701620029ee565b9190910192915050565b604051601f8201601f1916810167ffffffffffffffff8111828210171562002a5e5762002a5e620029d8565b604052919050565b600067ffffffffffffffff82111562002a835762002a83620029d8565b50601f01601f191660200190565b600082601f83011262002aa357600080fd5b813562002aba62002ab48262002a66565b62002a32565b81815284602083860101111562002ad057600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121562002b0357600080fd5b833567ffffffffffffffff8082111562002b1c57600080fd5b62002b2a8783880162002a91565b9450602086013591508082111562002b4157600080fd5b5062002b508682870162002a91565b92505060408401356200273e816200265f565b6000815180845262002b7d816020860160208601620029ee565b601f01601f19169290920160200192915050565b60608152600062002ba6606083018662002b63565b828103602084015262002bba818662002b63565b91505060ff83166040830152949350505050565b63ffffffff861681526001600160a01b0385811660208301528416604082015260806060820181905260009062002336908301848662002930565b63ffffffff95861681529390941660208401526001600160a01b039182166040840152166060820152608081019190915260a00190565b6001600160a01b038516815263ffffffff8416602082015260606040820181905260009062002c73908301848662002930565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820162002cbe5762002cbe62002c93565b5060010190565b60608152600062002cdb60608301878962002930565b828103602084015262002cf081868862002930565b91505060ff831660408301529695505050505050565b6000835162002d1a818460208801620029ee565b83519083019062002d30818360208801620029ee565b01949350505050565b60006020828403121562002d4c57600080fd5b5051919050565b81810381811115620005b357620005b362002c93565b60ff8916815263ffffffff88811660208301526001600160a01b03888116604084015287821660608401528616608083015260a0820185905261010060c0830181905260009162002dbd8483018762002b63565b925080851660e085015250509998505050505050505050565b600181815b8085111562002e1757816000190482111562002dfb5762002dfb62002c93565b8085161562002e0957918102915b93841c939080029062002ddb565b509250929050565b60008262002e3057506001620005b3565b8162002e3f57506000620005b3565b816001811462002e58576002811462002e635762002e83565b6001915050620005b3565b60ff84111562002e775762002e7762002c93565b50506001821b620005b3565b5060208310610133831016604e8410600b841016171562002ea8575081810a620005b3565b62002eb4838362002dd6565b806000190482111562002ecb5762002ecb62002c93565b029392505050565b600062002658838362002e1f565b634e487b7160e01b600052600160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000808585111562002f5357600080fd5b8386111562002f6157600080fd5b5050820193919092039150565b6001600160e01b0319813581811691600485101562002f975780818660040360031b1b83161692505b505092915050565b600080600080600080600060e0888a03121562002fbb57600080fd5b873562002fc8816200240b565b9650602088013562002fda816200240b565b955060408801359450606088013593506080880135620026dc816200265f565b600080600080600080600080610100898b0312156200301857600080fd5b883562003025816200240b565b9750602089013562003037816200240b565b965060408901359550606089013594506080890135620030578162002460565b935060a089013562003069816200265f565b979a969950949793969295929450505060c08201359160e0013590565b6000602082840312156200309957600080fd5b815162002658816200265f565b600060208284031215620030b957600080fd5b8151620026588162002460565b600060208284031215620030d957600080fd5b815167ffffffffffffffff811115620030f157600080fd5b8201601f810184136200310357600080fd5b80516200311462002ab48262002a66565b8181528560208385010111156200312a57600080fd5b6200313d826020830160208601620029ee565b95945050505050565b60208152600062002658602083018462002b6356fe6101006040523480156200001257600080fd5b50604051620015b2380380620015b283398101604081905262000035916200028d565b82826003620000458382620003a1565b506004620000548282620003a1565b50503360c0525060ff811660e052466080819052620000739062000080565b60a052506200046d915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620000ad6200012e565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6060600380546200013f9062000312565b80601f01602080910402602001604051908101604052809291908181526020018280546200016d9062000312565b8015620001be5780601f106200019257610100808354040283529160200191620001be565b820191906000526020600020905b815481529060010190602001808311620001a057829003601f168201915b5050505050905090565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f057600080fd5b81516001600160401b03808211156200020d576200020d620001c8565b604051601f8301601f19908116603f01168101908282118183101715620002385762000238620001c8565b816040528381526020925086838588010111156200025557600080fd5b600091505b838210156200027957858201830151818301840152908201906200025a565b600093810190920192909252949350505050565b600080600060608486031215620002a357600080fd5b83516001600160401b0380821115620002bb57600080fd5b620002c987838801620001de565b94506020860151915080821115620002e057600080fd5b50620002ef86828701620001de565b925050604084015160ff811681146200030757600080fd5b809150509250925092565b600181811c908216806200032757607f821691505b6020821081036200034857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200039c57600081815260208120601f850160051c81016020861015620003775750805b601f850160051c820191505b81811015620003985782815560010162000383565b5050505b505050565b81516001600160401b03811115620003bd57620003bd620001c8565b620003d581620003ce845462000312565b846200034e565b602080601f8311600181146200040d5760008415620003f45750858301515b600019600386901b1c1916600185901b17855562000398565b600085815260208120601f198616915b828110156200043e578886015182559484019460019091019084016200041d565b50858210156200045d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e0516110f6620004bc60003960006101f70152600081816102ba015281816104e0015261054e0152600061049101526000818161031f015261045b01526110f66000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063a457c2d71161007c578063a457c2d7146102f4578063a9059cbb14610307578063cd0d00961461031a578063d505accf14610341578063dd62ed3e14610354578063ffa1ad741461036757600080fd5b806370a08231146102515780637ecebe001461027a57806395d89b411461029a5780639dc29fac146102a2578063a3c573eb146102b557600080fd5b806330adf81f116100ff57806330adf81f146101c9578063313ce567146101f05780633644e51514610221578063395093511461022957806340c10f191461023c57600080fd5b806306fdde031461013c578063095ea7b31461015a57806318160ddd1461017d57806320606b701461018f57806323b872dd146101b6575b600080fd5b610144610387565b6040516101519190610e5c565b60405180910390f35b61016d610168366004610ec6565b610419565b6040519015158152602001610151565b6002545b604051908152602001610151565b6101817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b61016d6101c4366004610ef0565b610433565b6101817f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610151565b610181610457565b61016d610237366004610ec6565b6104b3565b61024f61024a366004610ec6565b6104d5565b005b61018161025f366004610f2c565b6001600160a01b031660009081526020819052604090205490565b610181610288366004610f2c565b60056020526000908152604090205481565b610144610534565b61024f6102b0366004610ec6565b610543565b6102dc7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610151565b61016d610302366004610ec6565b610595565b61016d610315366004610ec6565b610610565b6101817f000000000000000000000000000000000000000000000000000000000000000081565b61024f61034f366004610f4e565b61061e565b610181610362366004610fc1565b610859565b610144604051806040016040528060018152602001603160f81b81525081565b60606003805461039690610ff4565b80601f01602080910402602001604051908101604052809291908181526020018280546103c290610ff4565b801561040f5780601f106103e45761010080835404028352916020019161040f565b820191906000526020600020905b8154815290600101906020018083116103f257829003601f168201915b5050505050905090565b600033610427818585610884565b60019150505b92915050565b6000336104418582856109a9565b61044c858585610a23565b506001949350505050565b60007f0000000000000000000000000000000000000000000000000000000000000000461461048e5761048946610bc7565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6000336104278185856104c68383610859565b6104d09190611044565b610884565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105265760405162461bcd60e51b815260040161051d90611057565b60405180910390fd5b6105308282610c73565b5050565b60606004805461039690610ff4565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461058b5760405162461bcd60e51b815260040161051d90611057565b6105308282610d32565b600033816105a38286610859565b9050838110156106035760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161051d565b61044c8286868403610884565b600033610427818585610a23565b8342111561067a5760405162461bcd60e51b8152602060048201526024808201527f546f6b656e577261707065643a3a7065726d69743a20457870697265642070656044820152631c9b5a5d60e21b606482015260840161051d565b6001600160a01b038716600090815260056020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a9190866106c7836110a7565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610725610457565b60405161190160f01b602082015260228101919091526042810183905260620160408051601f198184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa1580156107b0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906107e65750896001600160a01b0316816001600160a01b0316145b6108425760405162461bcd60e51b815260206004820152602760248201527f546f6b656e577261707065643a3a7065726d69743a20496e76616c6964207369604482015266676e617475726560c81b606482015260840161051d565b61084d8a8a8a610884565b50505050505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166108e65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161051d565b6001600160a01b0382166109475760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161051d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006109b58484610859565b90506000198114610a1d5781811015610a105760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161051d565b610a1d8484848403610884565b50505050565b6001600160a01b038316610a875760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161051d565b6001600160a01b038216610ae95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161051d565b6001600160a01b03831660009081526020819052604090205481811015610b615760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161051d565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610a1d565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f610bf2610387565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6001600160a01b038216610cc95760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161051d565b8060026000828254610cdb9190611044565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b038216610d925760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161051d565b6001600160a01b03821660009081526020819052604090205481811015610e065760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161051d565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910161099c565b600060208083528351808285015260005b81811015610e8957858101830151858201604001528201610e6d565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610ec157600080fd5b919050565b60008060408385031215610ed957600080fd5b610ee283610eaa565b946020939093013593505050565b600080600060608486031215610f0557600080fd5b610f0e84610eaa565b9250610f1c60208501610eaa565b9150604084013590509250925092565b600060208284031215610f3e57600080fd5b610f4782610eaa565b9392505050565b600080600080600080600060e0888a031215610f6957600080fd5b610f7288610eaa565b9650610f8060208901610eaa565b95506040880135945060608801359350608088013560ff81168114610fa457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610fd457600080fd5b610fdd83610eaa565b9150610feb60208401610eaa565b90509250929050565b600181811c9082168061100857607f821691505b60208210810361102857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561042d5761042d61102e565b60208082526030908201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60408201526f6c79676f6e5a6b45564d42726964676560801b606082015260800190565b6000600182016110b9576110b961102e565b506001019056fea2646970667358221220e578d8e4b71a5c98739e7f11de9b62b5bff7c0ec9d1c2013a5019efa3df3a96d64736f6c63430008140033a2646970667358221220a5db4ca599c25af724716ede251c43e562514e0970d03b930b42a70d351d54b164736f6c63430008140033 diff --git a/bindings/ulxly/PolygonZkEVMBridge.go b/bindings/ulxly/PolygonZkEVMBridge.go new file mode 100644 index 00000000..fee5c11b --- /dev/null +++ b/bindings/ulxly/PolygonZkEVMBridge.go @@ -0,0 +1,1666 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ulxly + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// LegacyMetaData contains all meta data concerning the Legacy contract. +var LegacyMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"activateEmergencyState\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeAsset\",\"inputs\":[{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"forceUpdateGlobalExitRoot\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"permitData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"bridgeMessage\",\"inputs\":[{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"forceUpdateGlobalExitRoot\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"claimAsset\",\"inputs\":[{\"name\":\"smtProof\",\"type\":\"bytes32[32]\",\"internalType\":\"bytes32[32]\"},{\"name\":\"index\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"mainnetExitRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rollupExitRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"claimMessage\",\"inputs\":[{\"name\":\"smtProof\",\"type\":\"bytes32[32]\",\"internalType\":\"bytes32[32]\"},{\"name\":\"index\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"mainnetExitRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rollupExitRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"claimedBitMap\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deactivateEmergencyState\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDepositRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLeafValue\",\"inputs\":[{\"name\":\"leafType\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"metadataHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getTokenWrappedAddress\",\"inputs\":[{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"globalExitRootManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBasePolygonZkEVMGlobalExitRoot\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_networkID\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_globalExitRootManager\",\"type\":\"address\",\"internalType\":\"contractIBasePolygonZkEVMGlobalExitRoot\"},{\"name\":\"_polygonZkEVMaddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isClaimed\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEmergencyState\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"lastUpdatedDepositCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"networkID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"polygonZkEVMaddress\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"precalculatedWrapperAddress\",\"inputs\":[{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"symbol\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"decimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"tokenInfoToWrappedToken\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateGlobalExitRoot\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyMerkleProof\",\"inputs\":[{\"name\":\"leafHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"smtProof\",\"type\":\"bytes32[32]\",\"internalType\":\"bytes32[32]\"},{\"name\":\"index\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"wrappedTokenToTokenInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"BridgeEvent\",\"inputs\":[{\"name\":\"leafType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"originAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"depositCount\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ClaimEvent\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"originAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EmergencyStateActivated\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EmergencyStateDeactivated\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewWrappedToken\",\"inputs\":[{\"name\":\"originNetwork\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"wrappedTokenAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AlreadyClaimed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AmountDoesNotMatchMsgValue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DestinationNetworkInvalid\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EtherTransferFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"GlobalExitRootInvalid\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSmtProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MerkleTreeFull\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MsgValueNotZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotValidAmount\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotValidOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotValidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotValidSpender\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyEmergencyState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyNotEmergencyState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyPolygonZkEVM\",\"inputs\":[]}]", + Bin: "0x608060405234801561001057600080fd5b50614743806100206000396000f3fe6080604052600436106200015b5760003560e01c8063647c576c11620000c5578063be5831c71162000078578063be5831c7146200045a578063cd5865791462000480578063d02103ca1462000497578063dbc1697614620004c0578063ee25560b14620004d8578063fb570834146200050957600080fd5b8063647c576c146200033f57806379e2cf97146200036457806381b1c174146200037c5780639e34070f14620003b6578063aaa13cc214620003fb578063bab161bf146200042057600080fd5b80632d2c9d94116200011e5780632d2c9d9414620002255780632dfdf0b5146200024a578063318aee3d146200027157806334ac9cf214620002e05780633ae0504714620003025780633e197043146200031a57600080fd5b806315064c9614620001605780632072f6c5146200019157806322e95f2c14620001ab578063240ff37814620001e95780632cffd02e1462000200575b600080fd5b3480156200016d57600080fd5b506068546200017c9060ff1681565b60405190151581526020015b60405180910390f35b3480156200019e57600080fd5b50620001a96200052e565b005b348015620001b857600080fd5b50620001d0620001ca36600462002424565b62000566565b6040516001600160a01b03909116815260200162000188565b620001a9620001fa366004620024bb565b620005b9565b3480156200020d57600080fd5b50620001a96200021f36600462002552565b620006e0565b3480156200023257600080fd5b50620001a96200024436600462002552565b62000ae5565b3480156200025757600080fd5b506200026260535481565b60405190815260200162000188565b3480156200027e57600080fd5b50620002bb6200029036600462002638565b606b6020526000908152604090205463ffffffff81169064010000000090046001600160a01b031682565b6040805163ffffffff90931683526001600160a01b0390911660208301520162000188565b348015620002ed57600080fd5b50606c54620001d0906001600160a01b031681565b3480156200030f57600080fd5b506200026262000c34565b3480156200032757600080fd5b5062000262620003393660046200266f565b62000d1a565b3480156200034c57600080fd5b50620001a96200035e366004620026f9565b62000da7565b3480156200037157600080fd5b50620001a962000f24565b3480156200038957600080fd5b50620001d06200039b36600462002749565b606a602052600090815260409020546001600160a01b031681565b348015620003c357600080fd5b506200017c620003d536600462002749565b600881901c600090815260696020526040902054600160ff9092169190911b9081161490565b3480156200040857600080fd5b50620001d06200041a36600462002763565b62000f48565b3480156200042d57600080fd5b506068546200044490610100900463ffffffff1681565b60405163ffffffff909116815260200162000188565b3480156200046757600080fd5b506068546200044490600160c81b900463ffffffff1681565b620001a96200049136600462002817565b6200105f565b348015620004a457600080fd5b50606854620001d090600160281b90046001600160a01b031681565b348015620004cd57600080fd5b50620001a9620013f7565b348015620004e557600080fd5b5062000262620004f736600462002749565b60696020526000908152604090205481565b3480156200051657600080fd5b506200017c62000528366004620028b9565b6200142d565b606c546001600160a01b031633146200055a5760405163e2e8106b60e01b815260040160405180910390fd5b6200056462001516565b565b6000606a600084846040516020016200058192919062002906565b60408051601f19818403018152918152815160209283012083529082019290925201600020546001600160a01b031690505b92915050565b60685460ff1615620005de57604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff868116610100909204161480620006045750600263ffffffff861610155b1562000623576040516302caf51760e11b815260040160405180910390fd5b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b6001606860019054906101000a900463ffffffff16338888348888605354604051620006799998979695949392919062002959565b60405180910390a1620006c8620006c26001606860019054906101000a900463ffffffff16338989348989604051620006b4929190620029c8565b604051809103902062000d1a565b62001573565b8215620006d957620006d962001671565b5050505050565b60685460ff16156200070557604051630bc011ff60e21b815260040160405180910390fd5b6200071c8b8b8b8b8b8b8b8b8b8b8b600062001709565b6001600160a01b038616620007c557604080516000808252602082019092526001600160a01b03861690859060405162000757919062002a14565b60006040518083038185875af1925050503d806000811462000796576040519150601f19603f3d011682016040523d82523d6000602084013e6200079b565b606091505b5050905080620007be57604051630ce8f45160e31b815260040160405180910390fd5b5062000a97565b60685463ffffffff610100909104811690881603620007fa57620007f46001600160a01b038716858562001887565b62000a97565b600087876040516020016200081192919062002906565b60408051601f1981840301815291815281516020928301206000818152606a9093529120549091506001600160a01b03168062000a2f57600080806200085a8688018862002aed565b9250925092506000858484846040516200087490620023e8565b620008829392919062002b91565b8190604051809103906000f5905080158015620008a3573d6000803e3d6000fd5b506040516340c10f1960e01b81526001600160a01b038c81166004830152602482018c9052919250908216906340c10f1990604401600060405180830381600087803b158015620008f357600080fd5b505af115801562000908573d6000803e3d6000fd5b5050505080606a600088815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060405180604001604052808e63ffffffff1681526020018d6001600160a01b0316815250606b6000836001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816001600160a01b0302191690836001600160a01b031602179055509050507f490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a398d8d838b8b60405162000a1d95949392919062002bce565b60405180910390a15050505062000a94565b6040516340c10f1960e01b81526001600160a01b038781166004830152602482018790528216906340c10f1990604401600060405180830381600087803b15801562000a7a57600080fd5b505af115801562000a8f573d6000803e3d6000fd5b505050505b50505b7f25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe275459838a8888878760405162000ad095949392919062002c09565b60405180910390a15050505050505050505050565b60685460ff161562000b0a57604051630bc011ff60e21b815260040160405180910390fd5b62000b218b8b8b8b8b8b8b8b8b8b8b600162001709565b6000846001600160a01b031684888a868660405160240162000b47949392919062002c40565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b1790525162000b7e919062002a14565b60006040518083038185875af1925050503d806000811462000bbd576040519150601f19603f3d011682016040523d82523d6000602084013e62000bc2565b606091505b505090508062000be5576040516337e391c360e01b815260040160405180910390fd5b7f25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe275459838b8989888860405162000c1e95949392919062002c09565b60405180910390a1505050505050505050505050565b605354600090819081805b602081101562000d11578083901c60011660010362000ca2576033816020811062000c6e5762000c6e62002c7d565b0154604080516020810192909252810185905260600160405160208183030381529060405280519060200120935062000ccf565b60408051602081018690529081018390526060016040516020818303038152906040528051906020012093505b6040805160208101849052908101839052606001604051602081830303815290604052805190602001209150808062000d089062002ca9565b91505062000c3f565b50919392505050565b6040516001600160f81b031960f889901b1660208201526001600160e01b031960e088811b821660218401526001600160601b0319606089811b821660258601529188901b909216603984015285901b16603d8201526051810183905260718101829052600090609101604051602081830303815290604052805190602001209050979650505050505050565b600054610100900460ff161580801562000dc85750600054600160ff909116105b8062000de45750303b15801562000de4575060005460ff166001145b62000e4d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000e71576000805461ff0019166101001790555b60688054610100600160c81b03191661010063ffffffff87160265010000000000600160c81b03191617600160281b6001600160a01b038681169190910291909117909155606c80546001600160a01b03191691841691909117905562000ed7620018ec565b801562000f1e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b605354606854600160c81b900463ffffffff16101562000564576200056462001671565b600080888860405160200162000f6092919062002906565b604051602081830303815290604052805190602001209050600060ff60f81b30836040518060200162000f9390620023e8565b601f1982820381018352601f90910116604081905262000fc0908d908d908d908d908d9060200162002cc5565b60408051601f198184030181529082905262000fe0929160200162002d06565b604051602081830303815290604052805190602001206040516020016200103994939291906001600160f81b031994909416845260609290921b6001600160601b03191660018401526015830152603582015260550190565b60408051808303601f1901815291905280516020909101209a9950505050505050505050565b60685460ff16156200108457604051630bc011ff60e21b815260040160405180910390fd5b6200108e62001920565b60685463ffffffff888116610100909204161480620010b45750600263ffffffff881610155b15620010d3576040516302caf51760e11b815260040160405180910390fd5b6000806060876001600160a01b0388166200111357883414620011095760405163b89240f560e01b815260040160405180910390fd5b6000925062001368565b3415620011335760405163798ee6f160e01b815260040160405180910390fd5b6001600160a01b038089166000908152606b602090815260409182902082518084019093525463ffffffff8116835264010000000090049092169181018290529015620011f057604051632770a7eb60e21b8152336004820152602481018b90526001600160a01b038a1690639dc29fac90604401600060405180830381600087803b158015620011c357600080fd5b505af1158015620011d8573d6000803e3d6000fd5b50505050806020015194508060000151935062001366565b8515620012055762001205898b89896200197b565b6040516370a0823160e01b81523060048201526000906001600160a01b038b16906370a0823190602401602060405180830381865afa1580156200124d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001273919062002d39565b90506200128c6001600160a01b038b1633308e62001cdd565b6040516370a0823160e01b81523060048201526000906001600160a01b038c16906370a0823190602401602060405180830381865afa158015620012d4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620012fa919062002d39565b905062001308828262002d53565b6068548c9850610100900463ffffffff1696509350620013288762001d17565b620013338c62001dde565b6200133e8d62001e9c565b604051602001620013529392919062002b91565b604051602081830303815290604052945050505b505b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b600084868e8e8688605354604051620013aa98979695949392919062002d69565b60405180910390a1620013cf620006c2600085878f8f87898051906020012062000d1a565b8615620013e057620013e062001671565b50505050620013ee60018055565b50505050505050565b606c546001600160a01b03163314620014235760405163e2e8106b60e01b815260040160405180910390fd5b6200056462001f63565b600084815b60208110156200150857600163ffffffff8616821c81169003620014a45785816020811062001465576200146562002c7d565b60200201358260405160200162001486929190918252602082015260400190565b604051602081830303815290604052805190602001209150620014f3565b81868260208110620014ba57620014ba62002c7d565b6020020135604051602001620014da929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b80620014ff8162002ca9565b91505062001432565b50821490505b949350505050565b60685460ff16156200153b57604051630bc011ff60e21b815260040160405180910390fd5b6068805460ff191660011790556040517f2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a549790600090a1565b806001620015846020600262002ed3565b62001590919062002d53565b60535410620015b2576040516377ae67b360e11b815260040160405180910390fd5b6000605360008154620015c59062002ca9565b9182905550905060005b602081101562001661578082901c60011660010362001607578260338260208110620015ff57620015ff62002c7d565b015550505050565b603381602081106200161d576200161d62002c7d565b015460408051602081019290925281018490526060016040516020818303038152906040528051906020012092508080620016589062002ca9565b915050620015cf565b506200166c62002ee1565b505050565b6053546068805463ffffffff909216600160c81b0263ffffffff60c81b1990921691909117908190556001600160a01b03600160281b909104166333d6247d620016ba62000c34565b6040518263ffffffff1660e01b8152600401620016d991815260200190565b600060405180830381600087803b158015620016f457600080fd5b505af115801562000f1e573d6000803e3d6000fd5b6200171a8b63ffffffff1662001fbc565b6068546040805160208082018e90528183018d9052825180830384018152606083019384905280519101206312bd9b1960e11b9092526064810191909152600091600160281b90046001600160a01b03169063257b3632906084016020604051808303816000875af115801562001795573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620017bb919062002d39565b905080600003620017de57604051622f6fad60e01b815260040160405180910390fd5b60685463ffffffff88811661010090920416146200180f576040516302caf51760e11b815260040160405180910390fd5b606854600090610100900463ffffffff166200182d57508962001830565b508a5b6200185962001850848c8c8c8c8c8c8c604051620006b4929190620029c8565b8f8f846200142d565b62001877576040516338105f3b60e21b815260040160405180910390fd5b5050505050505050505050505050565b6040516001600160a01b0383166024820152604481018290526200166c90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262002008565b600054610100900460ff16620019165760405162461bcd60e51b815260040162000e449062002ef7565b62000564620020e1565b600260015403620019745760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000e44565b6002600155565b60006200198c600482848662002f42565b620019979162002f6e565b9050632afa533160e01b6001600160e01b031982160162001b38576000808080808080620019c9896004818d62002f42565b810190620019d8919062002f9f565b9650965096509650965096509650336001600160a01b0316876001600160a01b03161462001a195760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b038616301462001a435760405163750643af60e01b815260040160405180910390fd5b8a851462001a64576040516303fffc4b60e01b815260040160405180910390fd5b604080516001600160a01b0389811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180516001600160e01b031663d505accf60e01b1790529151918e169162001ae4919062002a14565b6000604051808303816000865af19150503d806000811462001b23576040519150601f19603f3d011682016040523d82523d6000602084013e62001b28565b606091505b50505050505050505050620006d9565b6001600160e01b031981166323f2ebc360e21b1462001b6a57604051637141605d60e11b815260040160405180910390fd5b60008080808080808062001b828a6004818e62002f42565b81019062001b91919062002ffa565b97509750975097509750975097509750336001600160a01b0316886001600160a01b03161462001bd45760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b038716301462001bfe5760405163750643af60e01b815260040160405180910390fd5b604080516001600160a01b038a811660248301528981166044830152606482018990526084820188905286151560a483015260ff861660c483015260e482018590526101048083018590528351808403909101815261012490920183526020820180516001600160e01b03166323f2ebc360e21b1790529151918f169162001c87919062002a14565b6000604051808303816000865af19150503d806000811462001cc6576040519150601f19603f3d011682016040523d82523d6000602084013e62001ccb565b606091505b50505050505050505050505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905262000f1e9085906323b872dd60e01b90608401620018b4565b60408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b179052905160609160009182916001600160a01b0386169162001d60919062002a14565b600060405180830381855afa9150503d806000811462001d9d576040519150601f19603f3d011682016040523d82523d6000602084013e62001da2565b606091505b50915091508162001dd357604051806040016040528060078152602001664e4f5f4e414d4560c81b8152506200150e565b6200150e816200210b565b60408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b179052905160609160009182916001600160a01b0386169162001e27919062002a14565b600060405180830381855afa9150503d806000811462001e64576040519150601f19603f3d011682016040523d82523d6000602084013e62001e69565b606091505b50915091508162001dd357604051806040016040528060098152602001681393d7d4d6535093d360ba1b8152506200150e565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b0386169162001ee4919062002a14565b600060405180830381855afa9150503d806000811462001f21576040519150601f19603f3d011682016040523d82523d6000602084013e62001f26565b606091505b509150915081801562001f3a575080516020145b62001f475760126200150e565b808060200190518101906200150e919062003086565b60018055565b60685460ff1662001f8757604051635386698160e01b815260040160405180910390fd5b6068805460ff191690556040517f1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b390600090a1565b600881901c60008181526069602052604081208054600160ff861690811b91821892839055929091908183169003620006d957604051630c8d9eab60e31b815260040160405180910390fd5b60006200205f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620022b59092919063ffffffff16565b8051909150156200166c5780806020019051810190620020809190620030a6565b6200166c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000e44565b600054610100900460ff1662001f5d5760405162461bcd60e51b815260040162000e449062002ef7565b606060408251106200212d5781806020019051810190620005b39190620030c6565b8151602003620022825760005b6020811080156200216d57508281815181106200215b576200215b62002c7d565b01602001516001600160f81b03191615155b156200218857806200217f8162002ca9565b9150506200213a565b80600003620021c15750506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b6020820152919050565b60008167ffffffffffffffff811115620021df57620021df620029d8565b6040519080825280601f01601f1916602001820160405280156200220a576020820181803683370190505b50905060005b828110156200227a578481815181106200222e576200222e62002c7d565b602001015160f81c60f81b8282815181106200224e576200224e62002c7d565b60200101906001600160f81b031916908160001a90535080620022718162002ca9565b91505062002210565b509392505050565b50506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b602082015290565b919050565b60606200150e848460008585600080866001600160a01b03168587604051620022df919062002a14565b60006040518083038185875af1925050503d80600081146200231e576040519150601f19603f3d011682016040523d82523d6000602084013e62002323565b606091505b5091509150620023368783838762002341565b979650505050505050565b60608315620023b5578251600003620023ad576001600160a01b0385163b620023ad5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000e44565b50816200150e565b6200150e8383815115620023cc5781518083602001fd5b8060405162461bcd60e51b815260040162000e44919062003146565b6115b2806200315c83390190565b803563ffffffff81168114620022b057600080fd5b6001600160a01b03811681146200242157600080fd5b50565b600080604083850312156200243857600080fd5b6200244383620023f6565b9150602083013562002455816200240b565b809150509250929050565b80151581146200242157600080fd5b60008083601f8401126200248257600080fd5b50813567ffffffffffffffff8111156200249b57600080fd5b602083019150836020828501011115620024b457600080fd5b9250929050565b600080600080600060808688031215620024d457600080fd5b620024df86620023f6565b94506020860135620024f1816200240b565b93506040860135620025038162002460565b9250606086013567ffffffffffffffff8111156200252057600080fd5b6200252e888289016200246f565b969995985093965092949392505050565b806104008101831015620005b357600080fd5b60008060008060008060008060008060006105208c8e0312156200257557600080fd5b620025818d8d6200253f565b9a50620025926104008d01620023f6565b99506104208c013598506104408c01359750620025b36104608d01620023f6565b96506104808c0135620025c6816200240b565b9550620025d76104a08d01620023f6565b94506104c08c0135620025ea816200240b565b93506104e08c013592506105008c013567ffffffffffffffff8111156200261057600080fd5b6200261e8e828f016200246f565b915080935050809150509295989b509295989b9093969950565b6000602082840312156200264b57600080fd5b813562002658816200240b565b9392505050565b60ff811681146200242157600080fd5b600080600080600080600060e0888a0312156200268b57600080fd5b873562002698816200265f565b9650620026a860208901620023f6565b95506040880135620026ba816200240b565b9450620026ca60608901620023f6565b93506080880135620026dc816200240b565b9699959850939692959460a0840135945060c09093013592915050565b6000806000606084860312156200270f57600080fd5b6200271a84620023f6565b925060208401356200272c816200240b565b915060408401356200273e816200240b565b809150509250925092565b6000602082840312156200275c57600080fd5b5035919050565b600080600080600080600060a0888a0312156200277f57600080fd5b6200278a88620023f6565b965060208801356200279c816200240b565b9550604088013567ffffffffffffffff80821115620027ba57600080fd5b620027c88b838c016200246f565b909750955060608a0135915080821115620027e257600080fd5b50620027f18a828b016200246f565b909450925050608088013562002807816200265f565b8091505092959891949750929550565b600080600080600080600060c0888a0312156200283357600080fd5b6200283e88620023f6565b9650602088013562002850816200240b565b955060408801359450606088013562002869816200240b565b935060808801356200287b8162002460565b925060a088013567ffffffffffffffff8111156200289857600080fd5b620028a68a828b016200246f565b989b979a50959850939692959293505050565b6000806000806104608587031215620028d157600080fd5b84359350620028e486602087016200253f565b9250620028f56104208601620023f6565b939692955092936104400135925050565b60e09290921b6001600160e01b031916825260601b6001600160601b031916600482015260180190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60ff8a16815263ffffffff89811660208301526001600160a01b03898116604084015288821660608401528716608083015260a0820186905261010060c08301819052600091620029ae848301878962002930565b925080851660e085015250509a9950505050505050505050565b8183823760009101908152919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562002a0b578181015183820152602001620029f1565b50506000910152565b6000825162002a28818460208701620029ee565b9190910192915050565b604051601f8201601f1916810167ffffffffffffffff8111828210171562002a5e5762002a5e620029d8565b604052919050565b600067ffffffffffffffff82111562002a835762002a83620029d8565b50601f01601f191660200190565b600082601f83011262002aa357600080fd5b813562002aba62002ab48262002a66565b62002a32565b81815284602083860101111562002ad057600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121562002b0357600080fd5b833567ffffffffffffffff8082111562002b1c57600080fd5b62002b2a8783880162002a91565b9450602086013591508082111562002b4157600080fd5b5062002b508682870162002a91565b92505060408401356200273e816200265f565b6000815180845262002b7d816020860160208601620029ee565b601f01601f19169290920160200192915050565b60608152600062002ba6606083018662002b63565b828103602084015262002bba818662002b63565b91505060ff83166040830152949350505050565b63ffffffff861681526001600160a01b0385811660208301528416604082015260806060820181905260009062002336908301848662002930565b63ffffffff95861681529390941660208401526001600160a01b039182166040840152166060820152608081019190915260a00190565b6001600160a01b038516815263ffffffff8416602082015260606040820181905260009062002c73908301848662002930565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820162002cbe5762002cbe62002c93565b5060010190565b60608152600062002cdb60608301878962002930565b828103602084015262002cf081868862002930565b91505060ff831660408301529695505050505050565b6000835162002d1a818460208801620029ee565b83519083019062002d30818360208801620029ee565b01949350505050565b60006020828403121562002d4c57600080fd5b5051919050565b81810381811115620005b357620005b362002c93565b60ff8916815263ffffffff88811660208301526001600160a01b03888116604084015287821660608401528616608083015260a0820185905261010060c0830181905260009162002dbd8483018762002b63565b925080851660e085015250509998505050505050505050565b600181815b8085111562002e1757816000190482111562002dfb5762002dfb62002c93565b8085161562002e0957918102915b93841c939080029062002ddb565b509250929050565b60008262002e3057506001620005b3565b8162002e3f57506000620005b3565b816001811462002e58576002811462002e635762002e83565b6001915050620005b3565b60ff84111562002e775762002e7762002c93565b50506001821b620005b3565b5060208310610133831016604e8410600b841016171562002ea8575081810a620005b3565b62002eb4838362002dd6565b806000190482111562002ecb5762002ecb62002c93565b029392505050565b600062002658838362002e1f565b634e487b7160e01b600052600160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000808585111562002f5357600080fd5b8386111562002f6157600080fd5b5050820193919092039150565b6001600160e01b0319813581811691600485101562002f975780818660040360031b1b83161692505b505092915050565b600080600080600080600060e0888a03121562002fbb57600080fd5b873562002fc8816200240b565b9650602088013562002fda816200240b565b955060408801359450606088013593506080880135620026dc816200265f565b600080600080600080600080610100898b0312156200301857600080fd5b883562003025816200240b565b9750602089013562003037816200240b565b965060408901359550606089013594506080890135620030578162002460565b935060a089013562003069816200265f565b979a969950949793969295929450505060c08201359160e0013590565b6000602082840312156200309957600080fd5b815162002658816200265f565b600060208284031215620030b957600080fd5b8151620026588162002460565b600060208284031215620030d957600080fd5b815167ffffffffffffffff811115620030f157600080fd5b8201601f810184136200310357600080fd5b80516200311462002ab48262002a66565b8181528560208385010111156200312a57600080fd5b6200313d826020830160208601620029ee565b95945050505050565b60208152600062002658602083018462002b6356fe6101006040523480156200001257600080fd5b50604051620015b2380380620015b283398101604081905262000035916200028d565b82826003620000458382620003a1565b506004620000548282620003a1565b50503360c0525060ff811660e052466080819052620000739062000080565b60a052506200046d915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620000ad6200012e565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6060600380546200013f9062000312565b80601f01602080910402602001604051908101604052809291908181526020018280546200016d9062000312565b8015620001be5780601f106200019257610100808354040283529160200191620001be565b820191906000526020600020905b815481529060010190602001808311620001a057829003601f168201915b5050505050905090565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f057600080fd5b81516001600160401b03808211156200020d576200020d620001c8565b604051601f8301601f19908116603f01168101908282118183101715620002385762000238620001c8565b816040528381526020925086838588010111156200025557600080fd5b600091505b838210156200027957858201830151818301840152908201906200025a565b600093810190920192909252949350505050565b600080600060608486031215620002a357600080fd5b83516001600160401b0380821115620002bb57600080fd5b620002c987838801620001de565b94506020860151915080821115620002e057600080fd5b50620002ef86828701620001de565b925050604084015160ff811681146200030757600080fd5b809150509250925092565b600181811c908216806200032757607f821691505b6020821081036200034857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200039c57600081815260208120601f850160051c81016020861015620003775750805b601f850160051c820191505b81811015620003985782815560010162000383565b5050505b505050565b81516001600160401b03811115620003bd57620003bd620001c8565b620003d581620003ce845462000312565b846200034e565b602080601f8311600181146200040d5760008415620003f45750858301515b600019600386901b1c1916600185901b17855562000398565b600085815260208120601f198616915b828110156200043e578886015182559484019460019091019084016200041d565b50858210156200045d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e0516110f6620004bc60003960006101f70152600081816102ba015281816104e0015261054e0152600061049101526000818161031f015261045b01526110f66000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063a457c2d71161007c578063a457c2d7146102f4578063a9059cbb14610307578063cd0d00961461031a578063d505accf14610341578063dd62ed3e14610354578063ffa1ad741461036757600080fd5b806370a08231146102515780637ecebe001461027a57806395d89b411461029a5780639dc29fac146102a2578063a3c573eb146102b557600080fd5b806330adf81f116100ff57806330adf81f146101c9578063313ce567146101f05780633644e51514610221578063395093511461022957806340c10f191461023c57600080fd5b806306fdde031461013c578063095ea7b31461015a57806318160ddd1461017d57806320606b701461018f57806323b872dd146101b6575b600080fd5b610144610387565b6040516101519190610e5c565b60405180910390f35b61016d610168366004610ec6565b610419565b6040519015158152602001610151565b6002545b604051908152602001610151565b6101817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b61016d6101c4366004610ef0565b610433565b6101817f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610151565b610181610457565b61016d610237366004610ec6565b6104b3565b61024f61024a366004610ec6565b6104d5565b005b61018161025f366004610f2c565b6001600160a01b031660009081526020819052604090205490565b610181610288366004610f2c565b60056020526000908152604090205481565b610144610534565b61024f6102b0366004610ec6565b610543565b6102dc7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610151565b61016d610302366004610ec6565b610595565b61016d610315366004610ec6565b610610565b6101817f000000000000000000000000000000000000000000000000000000000000000081565b61024f61034f366004610f4e565b61061e565b610181610362366004610fc1565b610859565b610144604051806040016040528060018152602001603160f81b81525081565b60606003805461039690610ff4565b80601f01602080910402602001604051908101604052809291908181526020018280546103c290610ff4565b801561040f5780601f106103e45761010080835404028352916020019161040f565b820191906000526020600020905b8154815290600101906020018083116103f257829003601f168201915b5050505050905090565b600033610427818585610884565b60019150505b92915050565b6000336104418582856109a9565b61044c858585610a23565b506001949350505050565b60007f0000000000000000000000000000000000000000000000000000000000000000461461048e5761048946610bc7565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6000336104278185856104c68383610859565b6104d09190611044565b610884565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105265760405162461bcd60e51b815260040161051d90611057565b60405180910390fd5b6105308282610c73565b5050565b60606004805461039690610ff4565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461058b5760405162461bcd60e51b815260040161051d90611057565b6105308282610d32565b600033816105a38286610859565b9050838110156106035760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161051d565b61044c8286868403610884565b600033610427818585610a23565b8342111561067a5760405162461bcd60e51b8152602060048201526024808201527f546f6b656e577261707065643a3a7065726d69743a20457870697265642070656044820152631c9b5a5d60e21b606482015260840161051d565b6001600160a01b038716600090815260056020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a9190866106c7836110a7565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610725610457565b60405161190160f01b602082015260228101919091526042810183905260620160408051601f198184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa1580156107b0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906107e65750896001600160a01b0316816001600160a01b0316145b6108425760405162461bcd60e51b815260206004820152602760248201527f546f6b656e577261707065643a3a7065726d69743a20496e76616c6964207369604482015266676e617475726560c81b606482015260840161051d565b61084d8a8a8a610884565b50505050505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166108e65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161051d565b6001600160a01b0382166109475760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161051d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006109b58484610859565b90506000198114610a1d5781811015610a105760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161051d565b610a1d8484848403610884565b50505050565b6001600160a01b038316610a875760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161051d565b6001600160a01b038216610ae95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161051d565b6001600160a01b03831660009081526020819052604090205481811015610b615760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161051d565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610a1d565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f610bf2610387565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6001600160a01b038216610cc95760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161051d565b8060026000828254610cdb9190611044565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b038216610d925760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161051d565b6001600160a01b03821660009081526020819052604090205481811015610e065760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161051d565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910161099c565b600060208083528351808285015260005b81811015610e8957858101830151858201604001528201610e6d565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610ec157600080fd5b919050565b60008060408385031215610ed957600080fd5b610ee283610eaa565b946020939093013593505050565b600080600060608486031215610f0557600080fd5b610f0e84610eaa565b9250610f1c60208501610eaa565b9150604084013590509250925092565b600060208284031215610f3e57600080fd5b610f4782610eaa565b9392505050565b600080600080600080600060e0888a031215610f6957600080fd5b610f7288610eaa565b9650610f8060208901610eaa565b95506040880135945060608801359350608088013560ff81168114610fa457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610fd457600080fd5b610fdd83610eaa565b9150610feb60208401610eaa565b90509250929050565b600181811c9082168061100857607f821691505b60208210810361102857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561042d5761042d61102e565b60208082526030908201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60408201526f6c79676f6e5a6b45564d42726964676560801b606082015260800190565b6000600182016110b9576110b961102e565b506001019056fea2646970667358221220e578d8e4b71a5c98739e7f11de9b62b5bff7c0ec9d1c2013a5019efa3df3a96d64736f6c63430008140033a2646970667358221220a5db4ca599c25af724716ede251c43e562514e0970d03b930b42a70d351d54b164736f6c63430008140033", +} + +// LegacyABI is the input ABI used to generate the binding from. +// Deprecated: Use LegacyMetaData.ABI instead. +var LegacyABI = LegacyMetaData.ABI + +// LegacyBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use LegacyMetaData.Bin instead. +var LegacyBin = LegacyMetaData.Bin + +// DeployLegacy deploys a new Ethereum contract, binding an instance of Legacy to it. +func DeployLegacy(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Legacy, error) { + parsed, err := LegacyMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(LegacyBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Legacy{LegacyCaller: LegacyCaller{contract: contract}, LegacyTransactor: LegacyTransactor{contract: contract}, LegacyFilterer: LegacyFilterer{contract: contract}}, nil +} + +// Legacy is an auto generated Go binding around an Ethereum contract. +type Legacy struct { + LegacyCaller // Read-only binding to the contract + LegacyTransactor // Write-only binding to the contract + LegacyFilterer // Log filterer for contract events +} + +// LegacyCaller is an auto generated read-only Go binding around an Ethereum contract. +type LegacyCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// LegacyTransactor is an auto generated write-only Go binding around an Ethereum contract. +type LegacyTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// LegacyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type LegacyFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// LegacySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type LegacySession struct { + Contract *Legacy // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// LegacyCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type LegacyCallerSession struct { + Contract *LegacyCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// LegacyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type LegacyTransactorSession struct { + Contract *LegacyTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// LegacyRaw is an auto generated low-level Go binding around an Ethereum contract. +type LegacyRaw struct { + Contract *Legacy // Generic contract binding to access the raw methods on +} + +// LegacyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type LegacyCallerRaw struct { + Contract *LegacyCaller // Generic read-only contract binding to access the raw methods on +} + +// LegacyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type LegacyTransactorRaw struct { + Contract *LegacyTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewLegacy creates a new instance of Legacy, bound to a specific deployed contract. +func NewLegacy(address common.Address, backend bind.ContractBackend) (*Legacy, error) { + contract, err := bindLegacy(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Legacy{LegacyCaller: LegacyCaller{contract: contract}, LegacyTransactor: LegacyTransactor{contract: contract}, LegacyFilterer: LegacyFilterer{contract: contract}}, nil +} + +// NewLegacyCaller creates a new read-only instance of Legacy, bound to a specific deployed contract. +func NewLegacyCaller(address common.Address, caller bind.ContractCaller) (*LegacyCaller, error) { + contract, err := bindLegacy(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &LegacyCaller{contract: contract}, nil +} + +// NewLegacyTransactor creates a new write-only instance of Legacy, bound to a specific deployed contract. +func NewLegacyTransactor(address common.Address, transactor bind.ContractTransactor) (*LegacyTransactor, error) { + contract, err := bindLegacy(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &LegacyTransactor{contract: contract}, nil +} + +// NewLegacyFilterer creates a new log filterer instance of Legacy, bound to a specific deployed contract. +func NewLegacyFilterer(address common.Address, filterer bind.ContractFilterer) (*LegacyFilterer, error) { + contract, err := bindLegacy(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &LegacyFilterer{contract: contract}, nil +} + +// bindLegacy binds a generic wrapper to an already deployed contract. +func bindLegacy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := LegacyMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Legacy *LegacyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Legacy.Contract.LegacyCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Legacy *LegacyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Legacy.Contract.LegacyTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Legacy *LegacyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Legacy.Contract.LegacyTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Legacy *LegacyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Legacy.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Legacy *LegacyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Legacy.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Legacy *LegacyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Legacy.Contract.contract.Transact(opts, method, params...) +} + +// ClaimedBitMap is a free data retrieval call binding the contract method 0xee25560b. +// +// Solidity: function claimedBitMap(uint256 ) view returns(uint256) +func (_Legacy *LegacyCaller) ClaimedBitMap(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "claimedBitMap", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ClaimedBitMap is a free data retrieval call binding the contract method 0xee25560b. +// +// Solidity: function claimedBitMap(uint256 ) view returns(uint256) +func (_Legacy *LegacySession) ClaimedBitMap(arg0 *big.Int) (*big.Int, error) { + return _Legacy.Contract.ClaimedBitMap(&_Legacy.CallOpts, arg0) +} + +// ClaimedBitMap is a free data retrieval call binding the contract method 0xee25560b. +// +// Solidity: function claimedBitMap(uint256 ) view returns(uint256) +func (_Legacy *LegacyCallerSession) ClaimedBitMap(arg0 *big.Int) (*big.Int, error) { + return _Legacy.Contract.ClaimedBitMap(&_Legacy.CallOpts, arg0) +} + +// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. +// +// Solidity: function depositCount() view returns(uint256) +func (_Legacy *LegacyCaller) DepositCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "depositCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. +// +// Solidity: function depositCount() view returns(uint256) +func (_Legacy *LegacySession) DepositCount() (*big.Int, error) { + return _Legacy.Contract.DepositCount(&_Legacy.CallOpts) +} + +// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. +// +// Solidity: function depositCount() view returns(uint256) +func (_Legacy *LegacyCallerSession) DepositCount() (*big.Int, error) { + return _Legacy.Contract.DepositCount(&_Legacy.CallOpts) +} + +// GetDepositRoot is a free data retrieval call binding the contract method 0x3ae05047. +// +// Solidity: function getDepositRoot() view returns(bytes32) +func (_Legacy *LegacyCaller) GetDepositRoot(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "getDepositRoot") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetDepositRoot is a free data retrieval call binding the contract method 0x3ae05047. +// +// Solidity: function getDepositRoot() view returns(bytes32) +func (_Legacy *LegacySession) GetDepositRoot() ([32]byte, error) { + return _Legacy.Contract.GetDepositRoot(&_Legacy.CallOpts) +} + +// GetDepositRoot is a free data retrieval call binding the contract method 0x3ae05047. +// +// Solidity: function getDepositRoot() view returns(bytes32) +func (_Legacy *LegacyCallerSession) GetDepositRoot() ([32]byte, error) { + return _Legacy.Contract.GetDepositRoot(&_Legacy.CallOpts) +} + +// GetLeafValue is a free data retrieval call binding the contract method 0x3e197043. +// +// Solidity: function getLeafValue(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes32 metadataHash) pure returns(bytes32) +func (_Legacy *LegacyCaller) GetLeafValue(opts *bind.CallOpts, leafType uint8, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadataHash [32]byte) ([32]byte, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "getLeafValue", leafType, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadataHash) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetLeafValue is a free data retrieval call binding the contract method 0x3e197043. +// +// Solidity: function getLeafValue(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes32 metadataHash) pure returns(bytes32) +func (_Legacy *LegacySession) GetLeafValue(leafType uint8, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadataHash [32]byte) ([32]byte, error) { + return _Legacy.Contract.GetLeafValue(&_Legacy.CallOpts, leafType, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadataHash) +} + +// GetLeafValue is a free data retrieval call binding the contract method 0x3e197043. +// +// Solidity: function getLeafValue(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes32 metadataHash) pure returns(bytes32) +func (_Legacy *LegacyCallerSession) GetLeafValue(leafType uint8, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadataHash [32]byte) ([32]byte, error) { + return _Legacy.Contract.GetLeafValue(&_Legacy.CallOpts, leafType, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadataHash) +} + +// GetTokenWrappedAddress is a free data retrieval call binding the contract method 0x22e95f2c. +// +// Solidity: function getTokenWrappedAddress(uint32 originNetwork, address originTokenAddress) view returns(address) +func (_Legacy *LegacyCaller) GetTokenWrappedAddress(opts *bind.CallOpts, originNetwork uint32, originTokenAddress common.Address) (common.Address, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "getTokenWrappedAddress", originNetwork, originTokenAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetTokenWrappedAddress is a free data retrieval call binding the contract method 0x22e95f2c. +// +// Solidity: function getTokenWrappedAddress(uint32 originNetwork, address originTokenAddress) view returns(address) +func (_Legacy *LegacySession) GetTokenWrappedAddress(originNetwork uint32, originTokenAddress common.Address) (common.Address, error) { + return _Legacy.Contract.GetTokenWrappedAddress(&_Legacy.CallOpts, originNetwork, originTokenAddress) +} + +// GetTokenWrappedAddress is a free data retrieval call binding the contract method 0x22e95f2c. +// +// Solidity: function getTokenWrappedAddress(uint32 originNetwork, address originTokenAddress) view returns(address) +func (_Legacy *LegacyCallerSession) GetTokenWrappedAddress(originNetwork uint32, originTokenAddress common.Address) (common.Address, error) { + return _Legacy.Contract.GetTokenWrappedAddress(&_Legacy.CallOpts, originNetwork, originTokenAddress) +} + +// GlobalExitRootManager is a free data retrieval call binding the contract method 0xd02103ca. +// +// Solidity: function globalExitRootManager() view returns(address) +func (_Legacy *LegacyCaller) GlobalExitRootManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "globalExitRootManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GlobalExitRootManager is a free data retrieval call binding the contract method 0xd02103ca. +// +// Solidity: function globalExitRootManager() view returns(address) +func (_Legacy *LegacySession) GlobalExitRootManager() (common.Address, error) { + return _Legacy.Contract.GlobalExitRootManager(&_Legacy.CallOpts) +} + +// GlobalExitRootManager is a free data retrieval call binding the contract method 0xd02103ca. +// +// Solidity: function globalExitRootManager() view returns(address) +func (_Legacy *LegacyCallerSession) GlobalExitRootManager() (common.Address, error) { + return _Legacy.Contract.GlobalExitRootManager(&_Legacy.CallOpts) +} + +// IsClaimed is a free data retrieval call binding the contract method 0x9e34070f. +// +// Solidity: function isClaimed(uint256 index) view returns(bool) +func (_Legacy *LegacyCaller) IsClaimed(opts *bind.CallOpts, index *big.Int) (bool, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "isClaimed", index) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsClaimed is a free data retrieval call binding the contract method 0x9e34070f. +// +// Solidity: function isClaimed(uint256 index) view returns(bool) +func (_Legacy *LegacySession) IsClaimed(index *big.Int) (bool, error) { + return _Legacy.Contract.IsClaimed(&_Legacy.CallOpts, index) +} + +// IsClaimed is a free data retrieval call binding the contract method 0x9e34070f. +// +// Solidity: function isClaimed(uint256 index) view returns(bool) +func (_Legacy *LegacyCallerSession) IsClaimed(index *big.Int) (bool, error) { + return _Legacy.Contract.IsClaimed(&_Legacy.CallOpts, index) +} + +// IsEmergencyState is a free data retrieval call binding the contract method 0x15064c96. +// +// Solidity: function isEmergencyState() view returns(bool) +func (_Legacy *LegacyCaller) IsEmergencyState(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "isEmergencyState") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsEmergencyState is a free data retrieval call binding the contract method 0x15064c96. +// +// Solidity: function isEmergencyState() view returns(bool) +func (_Legacy *LegacySession) IsEmergencyState() (bool, error) { + return _Legacy.Contract.IsEmergencyState(&_Legacy.CallOpts) +} + +// IsEmergencyState is a free data retrieval call binding the contract method 0x15064c96. +// +// Solidity: function isEmergencyState() view returns(bool) +func (_Legacy *LegacyCallerSession) IsEmergencyState() (bool, error) { + return _Legacy.Contract.IsEmergencyState(&_Legacy.CallOpts) +} + +// LastUpdatedDepositCount is a free data retrieval call binding the contract method 0xbe5831c7. +// +// Solidity: function lastUpdatedDepositCount() view returns(uint32) +func (_Legacy *LegacyCaller) LastUpdatedDepositCount(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "lastUpdatedDepositCount") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// LastUpdatedDepositCount is a free data retrieval call binding the contract method 0xbe5831c7. +// +// Solidity: function lastUpdatedDepositCount() view returns(uint32) +func (_Legacy *LegacySession) LastUpdatedDepositCount() (uint32, error) { + return _Legacy.Contract.LastUpdatedDepositCount(&_Legacy.CallOpts) +} + +// LastUpdatedDepositCount is a free data retrieval call binding the contract method 0xbe5831c7. +// +// Solidity: function lastUpdatedDepositCount() view returns(uint32) +func (_Legacy *LegacyCallerSession) LastUpdatedDepositCount() (uint32, error) { + return _Legacy.Contract.LastUpdatedDepositCount(&_Legacy.CallOpts) +} + +// NetworkID is a free data retrieval call binding the contract method 0xbab161bf. +// +// Solidity: function networkID() view returns(uint32) +func (_Legacy *LegacyCaller) NetworkID(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "networkID") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// NetworkID is a free data retrieval call binding the contract method 0xbab161bf. +// +// Solidity: function networkID() view returns(uint32) +func (_Legacy *LegacySession) NetworkID() (uint32, error) { + return _Legacy.Contract.NetworkID(&_Legacy.CallOpts) +} + +// NetworkID is a free data retrieval call binding the contract method 0xbab161bf. +// +// Solidity: function networkID() view returns(uint32) +func (_Legacy *LegacyCallerSession) NetworkID() (uint32, error) { + return _Legacy.Contract.NetworkID(&_Legacy.CallOpts) +} + +// PolygonZkEVMaddress is a free data retrieval call binding the contract method 0x34ac9cf2. +// +// Solidity: function polygonZkEVMaddress() view returns(address) +func (_Legacy *LegacyCaller) PolygonZkEVMaddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "polygonZkEVMaddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PolygonZkEVMaddress is a free data retrieval call binding the contract method 0x34ac9cf2. +// +// Solidity: function polygonZkEVMaddress() view returns(address) +func (_Legacy *LegacySession) PolygonZkEVMaddress() (common.Address, error) { + return _Legacy.Contract.PolygonZkEVMaddress(&_Legacy.CallOpts) +} + +// PolygonZkEVMaddress is a free data retrieval call binding the contract method 0x34ac9cf2. +// +// Solidity: function polygonZkEVMaddress() view returns(address) +func (_Legacy *LegacyCallerSession) PolygonZkEVMaddress() (common.Address, error) { + return _Legacy.Contract.PolygonZkEVMaddress(&_Legacy.CallOpts) +} + +// PrecalculatedWrapperAddress is a free data retrieval call binding the contract method 0xaaa13cc2. +// +// Solidity: function precalculatedWrapperAddress(uint32 originNetwork, address originTokenAddress, string name, string symbol, uint8 decimals) view returns(address) +func (_Legacy *LegacyCaller) PrecalculatedWrapperAddress(opts *bind.CallOpts, originNetwork uint32, originTokenAddress common.Address, name string, symbol string, decimals uint8) (common.Address, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "precalculatedWrapperAddress", originNetwork, originTokenAddress, name, symbol, decimals) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PrecalculatedWrapperAddress is a free data retrieval call binding the contract method 0xaaa13cc2. +// +// Solidity: function precalculatedWrapperAddress(uint32 originNetwork, address originTokenAddress, string name, string symbol, uint8 decimals) view returns(address) +func (_Legacy *LegacySession) PrecalculatedWrapperAddress(originNetwork uint32, originTokenAddress common.Address, name string, symbol string, decimals uint8) (common.Address, error) { + return _Legacy.Contract.PrecalculatedWrapperAddress(&_Legacy.CallOpts, originNetwork, originTokenAddress, name, symbol, decimals) +} + +// PrecalculatedWrapperAddress is a free data retrieval call binding the contract method 0xaaa13cc2. +// +// Solidity: function precalculatedWrapperAddress(uint32 originNetwork, address originTokenAddress, string name, string symbol, uint8 decimals) view returns(address) +func (_Legacy *LegacyCallerSession) PrecalculatedWrapperAddress(originNetwork uint32, originTokenAddress common.Address, name string, symbol string, decimals uint8) (common.Address, error) { + return _Legacy.Contract.PrecalculatedWrapperAddress(&_Legacy.CallOpts, originNetwork, originTokenAddress, name, symbol, decimals) +} + +// TokenInfoToWrappedToken is a free data retrieval call binding the contract method 0x81b1c174. +// +// Solidity: function tokenInfoToWrappedToken(bytes32 ) view returns(address) +func (_Legacy *LegacyCaller) TokenInfoToWrappedToken(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "tokenInfoToWrappedToken", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// TokenInfoToWrappedToken is a free data retrieval call binding the contract method 0x81b1c174. +// +// Solidity: function tokenInfoToWrappedToken(bytes32 ) view returns(address) +func (_Legacy *LegacySession) TokenInfoToWrappedToken(arg0 [32]byte) (common.Address, error) { + return _Legacy.Contract.TokenInfoToWrappedToken(&_Legacy.CallOpts, arg0) +} + +// TokenInfoToWrappedToken is a free data retrieval call binding the contract method 0x81b1c174. +// +// Solidity: function tokenInfoToWrappedToken(bytes32 ) view returns(address) +func (_Legacy *LegacyCallerSession) TokenInfoToWrappedToken(arg0 [32]byte) (common.Address, error) { + return _Legacy.Contract.TokenInfoToWrappedToken(&_Legacy.CallOpts, arg0) +} + +// VerifyMerkleProof is a free data retrieval call binding the contract method 0xfb570834. +// +// Solidity: function verifyMerkleProof(bytes32 leafHash, bytes32[32] smtProof, uint32 index, bytes32 root) pure returns(bool) +func (_Legacy *LegacyCaller) VerifyMerkleProof(opts *bind.CallOpts, leafHash [32]byte, smtProof [32][32]byte, index uint32, root [32]byte) (bool, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "verifyMerkleProof", leafHash, smtProof, index, root) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// VerifyMerkleProof is a free data retrieval call binding the contract method 0xfb570834. +// +// Solidity: function verifyMerkleProof(bytes32 leafHash, bytes32[32] smtProof, uint32 index, bytes32 root) pure returns(bool) +func (_Legacy *LegacySession) VerifyMerkleProof(leafHash [32]byte, smtProof [32][32]byte, index uint32, root [32]byte) (bool, error) { + return _Legacy.Contract.VerifyMerkleProof(&_Legacy.CallOpts, leafHash, smtProof, index, root) +} + +// VerifyMerkleProof is a free data retrieval call binding the contract method 0xfb570834. +// +// Solidity: function verifyMerkleProof(bytes32 leafHash, bytes32[32] smtProof, uint32 index, bytes32 root) pure returns(bool) +func (_Legacy *LegacyCallerSession) VerifyMerkleProof(leafHash [32]byte, smtProof [32][32]byte, index uint32, root [32]byte) (bool, error) { + return _Legacy.Contract.VerifyMerkleProof(&_Legacy.CallOpts, leafHash, smtProof, index, root) +} + +// WrappedTokenToTokenInfo is a free data retrieval call binding the contract method 0x318aee3d. +// +// Solidity: function wrappedTokenToTokenInfo(address ) view returns(uint32 originNetwork, address originTokenAddress) +func (_Legacy *LegacyCaller) WrappedTokenToTokenInfo(opts *bind.CallOpts, arg0 common.Address) (struct { + OriginNetwork uint32 + OriginTokenAddress common.Address +}, error) { + var out []interface{} + err := _Legacy.contract.Call(opts, &out, "wrappedTokenToTokenInfo", arg0) + + outstruct := new(struct { + OriginNetwork uint32 + OriginTokenAddress common.Address + }) + if err != nil { + return *outstruct, err + } + + outstruct.OriginNetwork = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.OriginTokenAddress = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + + return *outstruct, err + +} + +// WrappedTokenToTokenInfo is a free data retrieval call binding the contract method 0x318aee3d. +// +// Solidity: function wrappedTokenToTokenInfo(address ) view returns(uint32 originNetwork, address originTokenAddress) +func (_Legacy *LegacySession) WrappedTokenToTokenInfo(arg0 common.Address) (struct { + OriginNetwork uint32 + OriginTokenAddress common.Address +}, error) { + return _Legacy.Contract.WrappedTokenToTokenInfo(&_Legacy.CallOpts, arg0) +} + +// WrappedTokenToTokenInfo is a free data retrieval call binding the contract method 0x318aee3d. +// +// Solidity: function wrappedTokenToTokenInfo(address ) view returns(uint32 originNetwork, address originTokenAddress) +func (_Legacy *LegacyCallerSession) WrappedTokenToTokenInfo(arg0 common.Address) (struct { + OriginNetwork uint32 + OriginTokenAddress common.Address +}, error) { + return _Legacy.Contract.WrappedTokenToTokenInfo(&_Legacy.CallOpts, arg0) +} + +// ActivateEmergencyState is a paid mutator transaction binding the contract method 0x2072f6c5. +// +// Solidity: function activateEmergencyState() returns() +func (_Legacy *LegacyTransactor) ActivateEmergencyState(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Legacy.contract.Transact(opts, "activateEmergencyState") +} + +// ActivateEmergencyState is a paid mutator transaction binding the contract method 0x2072f6c5. +// +// Solidity: function activateEmergencyState() returns() +func (_Legacy *LegacySession) ActivateEmergencyState() (*types.Transaction, error) { + return _Legacy.Contract.ActivateEmergencyState(&_Legacy.TransactOpts) +} + +// ActivateEmergencyState is a paid mutator transaction binding the contract method 0x2072f6c5. +// +// Solidity: function activateEmergencyState() returns() +func (_Legacy *LegacyTransactorSession) ActivateEmergencyState() (*types.Transaction, error) { + return _Legacy.Contract.ActivateEmergencyState(&_Legacy.TransactOpts) +} + +// BridgeAsset is a paid mutator transaction binding the contract method 0xcd586579. +// +// Solidity: function bridgeAsset(uint32 destinationNetwork, address destinationAddress, uint256 amount, address token, bool forceUpdateGlobalExitRoot, bytes permitData) payable returns() +func (_Legacy *LegacyTransactor) BridgeAsset(opts *bind.TransactOpts, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, token common.Address, forceUpdateGlobalExitRoot bool, permitData []byte) (*types.Transaction, error) { + return _Legacy.contract.Transact(opts, "bridgeAsset", destinationNetwork, destinationAddress, amount, token, forceUpdateGlobalExitRoot, permitData) +} + +// BridgeAsset is a paid mutator transaction binding the contract method 0xcd586579. +// +// Solidity: function bridgeAsset(uint32 destinationNetwork, address destinationAddress, uint256 amount, address token, bool forceUpdateGlobalExitRoot, bytes permitData) payable returns() +func (_Legacy *LegacySession) BridgeAsset(destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, token common.Address, forceUpdateGlobalExitRoot bool, permitData []byte) (*types.Transaction, error) { + return _Legacy.Contract.BridgeAsset(&_Legacy.TransactOpts, destinationNetwork, destinationAddress, amount, token, forceUpdateGlobalExitRoot, permitData) +} + +// BridgeAsset is a paid mutator transaction binding the contract method 0xcd586579. +// +// Solidity: function bridgeAsset(uint32 destinationNetwork, address destinationAddress, uint256 amount, address token, bool forceUpdateGlobalExitRoot, bytes permitData) payable returns() +func (_Legacy *LegacyTransactorSession) BridgeAsset(destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, token common.Address, forceUpdateGlobalExitRoot bool, permitData []byte) (*types.Transaction, error) { + return _Legacy.Contract.BridgeAsset(&_Legacy.TransactOpts, destinationNetwork, destinationAddress, amount, token, forceUpdateGlobalExitRoot, permitData) +} + +// BridgeMessage is a paid mutator transaction binding the contract method 0x240ff378. +// +// Solidity: function bridgeMessage(uint32 destinationNetwork, address destinationAddress, bool forceUpdateGlobalExitRoot, bytes metadata) payable returns() +func (_Legacy *LegacyTransactor) BridgeMessage(opts *bind.TransactOpts, destinationNetwork uint32, destinationAddress common.Address, forceUpdateGlobalExitRoot bool, metadata []byte) (*types.Transaction, error) { + return _Legacy.contract.Transact(opts, "bridgeMessage", destinationNetwork, destinationAddress, forceUpdateGlobalExitRoot, metadata) +} + +// BridgeMessage is a paid mutator transaction binding the contract method 0x240ff378. +// +// Solidity: function bridgeMessage(uint32 destinationNetwork, address destinationAddress, bool forceUpdateGlobalExitRoot, bytes metadata) payable returns() +func (_Legacy *LegacySession) BridgeMessage(destinationNetwork uint32, destinationAddress common.Address, forceUpdateGlobalExitRoot bool, metadata []byte) (*types.Transaction, error) { + return _Legacy.Contract.BridgeMessage(&_Legacy.TransactOpts, destinationNetwork, destinationAddress, forceUpdateGlobalExitRoot, metadata) +} + +// BridgeMessage is a paid mutator transaction binding the contract method 0x240ff378. +// +// Solidity: function bridgeMessage(uint32 destinationNetwork, address destinationAddress, bool forceUpdateGlobalExitRoot, bytes metadata) payable returns() +func (_Legacy *LegacyTransactorSession) BridgeMessage(destinationNetwork uint32, destinationAddress common.Address, forceUpdateGlobalExitRoot bool, metadata []byte) (*types.Transaction, error) { + return _Legacy.Contract.BridgeMessage(&_Legacy.TransactOpts, destinationNetwork, destinationAddress, forceUpdateGlobalExitRoot, metadata) +} + +// ClaimAsset is a paid mutator transaction binding the contract method 0x2cffd02e. +// +// Solidity: function claimAsset(bytes32[32] smtProof, uint32 index, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originTokenAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Legacy *LegacyTransactor) ClaimAsset(opts *bind.TransactOpts, smtProof [32][32]byte, index uint32, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originTokenAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Legacy.contract.Transact(opts, "claimAsset", smtProof, index, mainnetExitRoot, rollupExitRoot, originNetwork, originTokenAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimAsset is a paid mutator transaction binding the contract method 0x2cffd02e. +// +// Solidity: function claimAsset(bytes32[32] smtProof, uint32 index, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originTokenAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Legacy *LegacySession) ClaimAsset(smtProof [32][32]byte, index uint32, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originTokenAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Legacy.Contract.ClaimAsset(&_Legacy.TransactOpts, smtProof, index, mainnetExitRoot, rollupExitRoot, originNetwork, originTokenAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimAsset is a paid mutator transaction binding the contract method 0x2cffd02e. +// +// Solidity: function claimAsset(bytes32[32] smtProof, uint32 index, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originTokenAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Legacy *LegacyTransactorSession) ClaimAsset(smtProof [32][32]byte, index uint32, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originTokenAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Legacy.Contract.ClaimAsset(&_Legacy.TransactOpts, smtProof, index, mainnetExitRoot, rollupExitRoot, originNetwork, originTokenAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimMessage is a paid mutator transaction binding the contract method 0x2d2c9d94. +// +// Solidity: function claimMessage(bytes32[32] smtProof, uint32 index, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Legacy *LegacyTransactor) ClaimMessage(opts *bind.TransactOpts, smtProof [32][32]byte, index uint32, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Legacy.contract.Transact(opts, "claimMessage", smtProof, index, mainnetExitRoot, rollupExitRoot, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimMessage is a paid mutator transaction binding the contract method 0x2d2c9d94. +// +// Solidity: function claimMessage(bytes32[32] smtProof, uint32 index, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Legacy *LegacySession) ClaimMessage(smtProof [32][32]byte, index uint32, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Legacy.Contract.ClaimMessage(&_Legacy.TransactOpts, smtProof, index, mainnetExitRoot, rollupExitRoot, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimMessage is a paid mutator transaction binding the contract method 0x2d2c9d94. +// +// Solidity: function claimMessage(bytes32[32] smtProof, uint32 index, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Legacy *LegacyTransactorSession) ClaimMessage(smtProof [32][32]byte, index uint32, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Legacy.Contract.ClaimMessage(&_Legacy.TransactOpts, smtProof, index, mainnetExitRoot, rollupExitRoot, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// DeactivateEmergencyState is a paid mutator transaction binding the contract method 0xdbc16976. +// +// Solidity: function deactivateEmergencyState() returns() +func (_Legacy *LegacyTransactor) DeactivateEmergencyState(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Legacy.contract.Transact(opts, "deactivateEmergencyState") +} + +// DeactivateEmergencyState is a paid mutator transaction binding the contract method 0xdbc16976. +// +// Solidity: function deactivateEmergencyState() returns() +func (_Legacy *LegacySession) DeactivateEmergencyState() (*types.Transaction, error) { + return _Legacy.Contract.DeactivateEmergencyState(&_Legacy.TransactOpts) +} + +// DeactivateEmergencyState is a paid mutator transaction binding the contract method 0xdbc16976. +// +// Solidity: function deactivateEmergencyState() returns() +func (_Legacy *LegacyTransactorSession) DeactivateEmergencyState() (*types.Transaction, error) { + return _Legacy.Contract.DeactivateEmergencyState(&_Legacy.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x647c576c. +// +// Solidity: function initialize(uint32 _networkID, address _globalExitRootManager, address _polygonZkEVMaddress) returns() +func (_Legacy *LegacyTransactor) Initialize(opts *bind.TransactOpts, _networkID uint32, _globalExitRootManager common.Address, _polygonZkEVMaddress common.Address) (*types.Transaction, error) { + return _Legacy.contract.Transact(opts, "initialize", _networkID, _globalExitRootManager, _polygonZkEVMaddress) +} + +// Initialize is a paid mutator transaction binding the contract method 0x647c576c. +// +// Solidity: function initialize(uint32 _networkID, address _globalExitRootManager, address _polygonZkEVMaddress) returns() +func (_Legacy *LegacySession) Initialize(_networkID uint32, _globalExitRootManager common.Address, _polygonZkEVMaddress common.Address) (*types.Transaction, error) { + return _Legacy.Contract.Initialize(&_Legacy.TransactOpts, _networkID, _globalExitRootManager, _polygonZkEVMaddress) +} + +// Initialize is a paid mutator transaction binding the contract method 0x647c576c. +// +// Solidity: function initialize(uint32 _networkID, address _globalExitRootManager, address _polygonZkEVMaddress) returns() +func (_Legacy *LegacyTransactorSession) Initialize(_networkID uint32, _globalExitRootManager common.Address, _polygonZkEVMaddress common.Address) (*types.Transaction, error) { + return _Legacy.Contract.Initialize(&_Legacy.TransactOpts, _networkID, _globalExitRootManager, _polygonZkEVMaddress) +} + +// UpdateGlobalExitRoot is a paid mutator transaction binding the contract method 0x79e2cf97. +// +// Solidity: function updateGlobalExitRoot() returns() +func (_Legacy *LegacyTransactor) UpdateGlobalExitRoot(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Legacy.contract.Transact(opts, "updateGlobalExitRoot") +} + +// UpdateGlobalExitRoot is a paid mutator transaction binding the contract method 0x79e2cf97. +// +// Solidity: function updateGlobalExitRoot() returns() +func (_Legacy *LegacySession) UpdateGlobalExitRoot() (*types.Transaction, error) { + return _Legacy.Contract.UpdateGlobalExitRoot(&_Legacy.TransactOpts) +} + +// UpdateGlobalExitRoot is a paid mutator transaction binding the contract method 0x79e2cf97. +// +// Solidity: function updateGlobalExitRoot() returns() +func (_Legacy *LegacyTransactorSession) UpdateGlobalExitRoot() (*types.Transaction, error) { + return _Legacy.Contract.UpdateGlobalExitRoot(&_Legacy.TransactOpts) +} + +// LegacyBridgeEventIterator is returned from FilterBridgeEvent and is used to iterate over the raw logs and unpacked data for BridgeEvent events raised by the Legacy contract. +type LegacyBridgeEventIterator struct { + Event *LegacyBridgeEvent // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LegacyBridgeEventIterator) 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(LegacyBridgeEvent) + 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(LegacyBridgeEvent) + 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 *LegacyBridgeEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LegacyBridgeEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LegacyBridgeEvent represents a BridgeEvent event raised by the Legacy contract. +type LegacyBridgeEvent struct { + LeafType uint8 + OriginNetwork uint32 + OriginAddress common.Address + DestinationNetwork uint32 + DestinationAddress common.Address + Amount *big.Int + Metadata []byte + DepositCount uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBridgeEvent is a free log retrieval operation binding the contract event 0x501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b. +// +// Solidity: event BridgeEvent(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata, uint32 depositCount) +func (_Legacy *LegacyFilterer) FilterBridgeEvent(opts *bind.FilterOpts) (*LegacyBridgeEventIterator, error) { + + logs, sub, err := _Legacy.contract.FilterLogs(opts, "BridgeEvent") + if err != nil { + return nil, err + } + return &LegacyBridgeEventIterator{contract: _Legacy.contract, event: "BridgeEvent", logs: logs, sub: sub}, nil +} + +// WatchBridgeEvent is a free log subscription operation binding the contract event 0x501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b. +// +// Solidity: event BridgeEvent(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata, uint32 depositCount) +func (_Legacy *LegacyFilterer) WatchBridgeEvent(opts *bind.WatchOpts, sink chan<- *LegacyBridgeEvent) (event.Subscription, error) { + + logs, sub, err := _Legacy.contract.WatchLogs(opts, "BridgeEvent") + 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(LegacyBridgeEvent) + if err := _Legacy.contract.UnpackLog(event, "BridgeEvent", 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 +} + +// ParseBridgeEvent is a log parse operation binding the contract event 0x501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b. +// +// Solidity: event BridgeEvent(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata, uint32 depositCount) +func (_Legacy *LegacyFilterer) ParseBridgeEvent(log types.Log) (*LegacyBridgeEvent, error) { + event := new(LegacyBridgeEvent) + if err := _Legacy.contract.UnpackLog(event, "BridgeEvent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// LegacyClaimEventIterator is returned from FilterClaimEvent and is used to iterate over the raw logs and unpacked data for ClaimEvent events raised by the Legacy contract. +type LegacyClaimEventIterator struct { + Event *LegacyClaimEvent // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LegacyClaimEventIterator) 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(LegacyClaimEvent) + 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(LegacyClaimEvent) + 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 *LegacyClaimEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LegacyClaimEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LegacyClaimEvent represents a ClaimEvent event raised by the Legacy contract. +type LegacyClaimEvent struct { + Index uint32 + OriginNetwork uint32 + OriginAddress common.Address + DestinationAddress common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterClaimEvent is a free log retrieval operation binding the contract event 0x25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe27545983. +// +// Solidity: event ClaimEvent(uint32 index, uint32 originNetwork, address originAddress, address destinationAddress, uint256 amount) +func (_Legacy *LegacyFilterer) FilterClaimEvent(opts *bind.FilterOpts) (*LegacyClaimEventIterator, error) { + + logs, sub, err := _Legacy.contract.FilterLogs(opts, "ClaimEvent") + if err != nil { + return nil, err + } + return &LegacyClaimEventIterator{contract: _Legacy.contract, event: "ClaimEvent", logs: logs, sub: sub}, nil +} + +// WatchClaimEvent is a free log subscription operation binding the contract event 0x25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe27545983. +// +// Solidity: event ClaimEvent(uint32 index, uint32 originNetwork, address originAddress, address destinationAddress, uint256 amount) +func (_Legacy *LegacyFilterer) WatchClaimEvent(opts *bind.WatchOpts, sink chan<- *LegacyClaimEvent) (event.Subscription, error) { + + logs, sub, err := _Legacy.contract.WatchLogs(opts, "ClaimEvent") + 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(LegacyClaimEvent) + if err := _Legacy.contract.UnpackLog(event, "ClaimEvent", 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 +} + +// ParseClaimEvent is a log parse operation binding the contract event 0x25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe27545983. +// +// Solidity: event ClaimEvent(uint32 index, uint32 originNetwork, address originAddress, address destinationAddress, uint256 amount) +func (_Legacy *LegacyFilterer) ParseClaimEvent(log types.Log) (*LegacyClaimEvent, error) { + event := new(LegacyClaimEvent) + if err := _Legacy.contract.UnpackLog(event, "ClaimEvent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// LegacyEmergencyStateActivatedIterator is returned from FilterEmergencyStateActivated and is used to iterate over the raw logs and unpacked data for EmergencyStateActivated events raised by the Legacy contract. +type LegacyEmergencyStateActivatedIterator struct { + Event *LegacyEmergencyStateActivated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LegacyEmergencyStateActivatedIterator) 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(LegacyEmergencyStateActivated) + 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(LegacyEmergencyStateActivated) + 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 *LegacyEmergencyStateActivatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LegacyEmergencyStateActivatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LegacyEmergencyStateActivated represents a EmergencyStateActivated event raised by the Legacy contract. +type LegacyEmergencyStateActivated struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEmergencyStateActivated is a free log retrieval operation binding the contract event 0x2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a5497. +// +// Solidity: event EmergencyStateActivated() +func (_Legacy *LegacyFilterer) FilterEmergencyStateActivated(opts *bind.FilterOpts) (*LegacyEmergencyStateActivatedIterator, error) { + + logs, sub, err := _Legacy.contract.FilterLogs(opts, "EmergencyStateActivated") + if err != nil { + return nil, err + } + return &LegacyEmergencyStateActivatedIterator{contract: _Legacy.contract, event: "EmergencyStateActivated", logs: logs, sub: sub}, nil +} + +// WatchEmergencyStateActivated is a free log subscription operation binding the contract event 0x2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a5497. +// +// Solidity: event EmergencyStateActivated() +func (_Legacy *LegacyFilterer) WatchEmergencyStateActivated(opts *bind.WatchOpts, sink chan<- *LegacyEmergencyStateActivated) (event.Subscription, error) { + + logs, sub, err := _Legacy.contract.WatchLogs(opts, "EmergencyStateActivated") + 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(LegacyEmergencyStateActivated) + if err := _Legacy.contract.UnpackLog(event, "EmergencyStateActivated", 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 +} + +// ParseEmergencyStateActivated is a log parse operation binding the contract event 0x2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a5497. +// +// Solidity: event EmergencyStateActivated() +func (_Legacy *LegacyFilterer) ParseEmergencyStateActivated(log types.Log) (*LegacyEmergencyStateActivated, error) { + event := new(LegacyEmergencyStateActivated) + if err := _Legacy.contract.UnpackLog(event, "EmergencyStateActivated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// LegacyEmergencyStateDeactivatedIterator is returned from FilterEmergencyStateDeactivated and is used to iterate over the raw logs and unpacked data for EmergencyStateDeactivated events raised by the Legacy contract. +type LegacyEmergencyStateDeactivatedIterator struct { + Event *LegacyEmergencyStateDeactivated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LegacyEmergencyStateDeactivatedIterator) 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(LegacyEmergencyStateDeactivated) + 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(LegacyEmergencyStateDeactivated) + 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 *LegacyEmergencyStateDeactivatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LegacyEmergencyStateDeactivatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LegacyEmergencyStateDeactivated represents a EmergencyStateDeactivated event raised by the Legacy contract. +type LegacyEmergencyStateDeactivated struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEmergencyStateDeactivated is a free log retrieval operation binding the contract event 0x1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b3. +// +// Solidity: event EmergencyStateDeactivated() +func (_Legacy *LegacyFilterer) FilterEmergencyStateDeactivated(opts *bind.FilterOpts) (*LegacyEmergencyStateDeactivatedIterator, error) { + + logs, sub, err := _Legacy.contract.FilterLogs(opts, "EmergencyStateDeactivated") + if err != nil { + return nil, err + } + return &LegacyEmergencyStateDeactivatedIterator{contract: _Legacy.contract, event: "EmergencyStateDeactivated", logs: logs, sub: sub}, nil +} + +// WatchEmergencyStateDeactivated is a free log subscription operation binding the contract event 0x1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b3. +// +// Solidity: event EmergencyStateDeactivated() +func (_Legacy *LegacyFilterer) WatchEmergencyStateDeactivated(opts *bind.WatchOpts, sink chan<- *LegacyEmergencyStateDeactivated) (event.Subscription, error) { + + logs, sub, err := _Legacy.contract.WatchLogs(opts, "EmergencyStateDeactivated") + 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(LegacyEmergencyStateDeactivated) + if err := _Legacy.contract.UnpackLog(event, "EmergencyStateDeactivated", 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 +} + +// ParseEmergencyStateDeactivated is a log parse operation binding the contract event 0x1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b3. +// +// Solidity: event EmergencyStateDeactivated() +func (_Legacy *LegacyFilterer) ParseEmergencyStateDeactivated(log types.Log) (*LegacyEmergencyStateDeactivated, error) { + event := new(LegacyEmergencyStateDeactivated) + if err := _Legacy.contract.UnpackLog(event, "EmergencyStateDeactivated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// LegacyInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Legacy contract. +type LegacyInitializedIterator struct { + Event *LegacyInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LegacyInitializedIterator) 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(LegacyInitialized) + 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(LegacyInitialized) + 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 *LegacyInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LegacyInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LegacyInitialized represents a Initialized event raised by the Legacy contract. +type LegacyInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Legacy *LegacyFilterer) FilterInitialized(opts *bind.FilterOpts) (*LegacyInitializedIterator, error) { + + logs, sub, err := _Legacy.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &LegacyInitializedIterator{contract: _Legacy.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Legacy *LegacyFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *LegacyInitialized) (event.Subscription, error) { + + logs, sub, err := _Legacy.contract.WatchLogs(opts, "Initialized") + 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(LegacyInitialized) + if err := _Legacy.contract.UnpackLog(event, "Initialized", 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 +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Legacy *LegacyFilterer) ParseInitialized(log types.Log) (*LegacyInitialized, error) { + event := new(LegacyInitialized) + if err := _Legacy.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// LegacyNewWrappedTokenIterator is returned from FilterNewWrappedToken and is used to iterate over the raw logs and unpacked data for NewWrappedToken events raised by the Legacy contract. +type LegacyNewWrappedTokenIterator struct { + Event *LegacyNewWrappedToken // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LegacyNewWrappedTokenIterator) 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(LegacyNewWrappedToken) + 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(LegacyNewWrappedToken) + 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 *LegacyNewWrappedTokenIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LegacyNewWrappedTokenIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LegacyNewWrappedToken represents a NewWrappedToken event raised by the Legacy contract. +type LegacyNewWrappedToken struct { + OriginNetwork uint32 + OriginTokenAddress common.Address + WrappedTokenAddress common.Address + Metadata []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewWrappedToken is a free log retrieval operation binding the contract event 0x490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a39. +// +// Solidity: event NewWrappedToken(uint32 originNetwork, address originTokenAddress, address wrappedTokenAddress, bytes metadata) +func (_Legacy *LegacyFilterer) FilterNewWrappedToken(opts *bind.FilterOpts) (*LegacyNewWrappedTokenIterator, error) { + + logs, sub, err := _Legacy.contract.FilterLogs(opts, "NewWrappedToken") + if err != nil { + return nil, err + } + return &LegacyNewWrappedTokenIterator{contract: _Legacy.contract, event: "NewWrappedToken", logs: logs, sub: sub}, nil +} + +// WatchNewWrappedToken is a free log subscription operation binding the contract event 0x490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a39. +// +// Solidity: event NewWrappedToken(uint32 originNetwork, address originTokenAddress, address wrappedTokenAddress, bytes metadata) +func (_Legacy *LegacyFilterer) WatchNewWrappedToken(opts *bind.WatchOpts, sink chan<- *LegacyNewWrappedToken) (event.Subscription, error) { + + logs, sub, err := _Legacy.contract.WatchLogs(opts, "NewWrappedToken") + 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(LegacyNewWrappedToken) + if err := _Legacy.contract.UnpackLog(event, "NewWrappedToken", 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 +} + +// ParseNewWrappedToken is a log parse operation binding the contract event 0x490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a39. +// +// Solidity: event NewWrappedToken(uint32 originNetwork, address originTokenAddress, address wrappedTokenAddress, bytes metadata) +func (_Legacy *LegacyFilterer) ParseNewWrappedToken(log types.Log) (*LegacyNewWrappedToken, error) { + event := new(LegacyNewWrappedToken) + if err := _Legacy.contract.UnpackLog(event, "NewWrappedToken", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/bindings/ulxly/PolygonZkEVMBridgeV2.abi b/bindings/ulxly/PolygonZkEVMBridgeV2.abi new file mode 100644 index 00000000..51d9e1fe --- /dev/null +++ b/bindings/ulxly/PolygonZkEVMBridgeV2.abi @@ -0,0 +1,1004 @@ +[ + { + "type": "constructor", + "inputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "BASE_INIT_BYTECODE_WRAPPED_TOKEN", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "WETHToken", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract TokenWrapped" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "activateEmergencyState", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "bridgeAsset", + "inputs": [ + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "forceUpdateGlobalExitRoot", + "type": "bool", + "internalType": "bool" + }, + { + "name": "permitData", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "bridgeMessage", + "inputs": [ + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "forceUpdateGlobalExitRoot", + "type": "bool", + "internalType": "bool" + }, + { + "name": "metadata", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "bridgeMessageWETH", + "inputs": [ + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "amountWETH", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "forceUpdateGlobalExitRoot", + "type": "bool", + "internalType": "bool" + }, + { + "name": "metadata", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "calculateRoot", + "inputs": [ + { + "name": "leafHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "smtProof", + "type": "bytes32[32]", + "internalType": "bytes32[32]" + }, + { + "name": "index", + "type": "uint32", + "internalType": "uint32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "calculateTokenWrapperAddress", + "inputs": [ + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "claimAsset", + "inputs": [ + { + "name": "smtProofLocalExitRoot", + "type": "bytes32[32]", + "internalType": "bytes32[32]" + }, + { + "name": "smtProofRollupExitRoot", + "type": "bytes32[32]", + "internalType": "bytes32[32]" + }, + { + "name": "globalIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "mainnetExitRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "rollupExitRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "metadata", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "claimMessage", + "inputs": [ + { + "name": "smtProofLocalExitRoot", + "type": "bytes32[32]", + "internalType": "bytes32[32]" + }, + { + "name": "smtProofRollupExitRoot", + "type": "bytes32[32]", + "internalType": "bytes32[32]" + }, + { + "name": "globalIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "mainnetExitRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "rollupExitRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "metadata", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "claimedBitMap", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "deactivateEmergencyState", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "depositCount", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "gasTokenAddress", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "gasTokenMetadata", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "gasTokenNetwork", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getLeafValue", + "inputs": [ + { + "name": "leafType", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "destinationNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "metadataHash", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "getRoot", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTokenMetadata", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTokenWrappedAddress", + "inputs": [ + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "globalExitRootManager", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IBasePolygonZkEVMGlobalExitRoot" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_networkID", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "_gasTokenAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "_gasTokenNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "_globalExitRootManager", + "type": "address", + "internalType": "contract IBasePolygonZkEVMGlobalExitRoot" + }, + { + "name": "_polygonRollupManager", + "type": "address", + "internalType": "address" + }, + { + "name": "_gasTokenMetadata", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "isClaimed", + "inputs": [ + { + "name": "leafIndex", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "sourceBridgeNetwork", + "type": "uint32", + "internalType": "uint32" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isEmergencyState", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "lastUpdatedDepositCount", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "networkID", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "polygonRollupManager", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "precalculatedWrapperAddress", + "inputs": [ + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "name", + "type": "string", + "internalType": "string" + }, + { + "name": "symbol", + "type": "string", + "internalType": "string" + }, + { + "name": "decimals", + "type": "uint8", + "internalType": "uint8" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "tokenInfoToWrappedToken", + "inputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "updateGlobalExitRoot", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "verifyMerkleProof", + "inputs": [ + { + "name": "leafHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "smtProof", + "type": "bytes32[32]", + "internalType": "bytes32[32]" + }, + { + "name": "index", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "root", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "wrappedTokenToTokenInfo", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "originNetwork", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "BridgeEvent", + "inputs": [ + { + "name": "leafType", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + }, + { + "name": "originNetwork", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "originAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "destinationNetwork", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "destinationAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "metadata", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + }, + { + "name": "depositCount", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ClaimEvent", + "inputs": [ + { + "name": "globalIndex", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "originNetwork", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "originAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "destinationAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "EmergencyStateActivated", + "inputs": [], + "anonymous": false + }, + { + "type": "event", + "name": "EmergencyStateDeactivated", + "inputs": [], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "NewWrappedToken", + "inputs": [ + { + "name": "originNetwork", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "originTokenAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "wrappedTokenAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "metadata", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AlreadyClaimed", + "inputs": [] + }, + { + "type": "error", + "name": "AmountDoesNotMatchMsgValue", + "inputs": [] + }, + { + "type": "error", + "name": "DestinationNetworkInvalid", + "inputs": [] + }, + { + "type": "error", + "name": "EtherTransferFailed", + "inputs": [] + }, + { + "type": "error", + "name": "FailedTokenWrappedDeployment", + "inputs": [] + }, + { + "type": "error", + "name": "GasTokenNetworkMustBeZeroOnEther", + "inputs": [] + }, + { + "type": "error", + "name": "GlobalExitRootInvalid", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidSmtProof", + "inputs": [] + }, + { + "type": "error", + "name": "MerkleTreeFull", + "inputs": [] + }, + { + "type": "error", + "name": "MessageFailed", + "inputs": [] + }, + { + "type": "error", + "name": "MsgValueNotZero", + "inputs": [] + }, + { + "type": "error", + "name": "NativeTokenIsEther", + "inputs": [] + }, + { + "type": "error", + "name": "NoValueInMessagesOnGasTokenNetworks", + "inputs": [] + }, + { + "type": "error", + "name": "NotValidAmount", + "inputs": [] + }, + { + "type": "error", + "name": "NotValidOwner", + "inputs": [] + }, + { + "type": "error", + "name": "NotValidSignature", + "inputs": [] + }, + { + "type": "error", + "name": "NotValidSpender", + "inputs": [] + }, + { + "type": "error", + "name": "OnlyEmergencyState", + "inputs": [] + }, + { + "type": "error", + "name": "OnlyNotEmergencyState", + "inputs": [] + }, + { + "type": "error", + "name": "OnlyRollupManager", + "inputs": [] + } +] diff --git a/bindings/ulxly/PolygonZkEVMBridgeV2.bin b/bindings/ulxly/PolygonZkEVMBridgeV2.bin new file mode 100644 index 00000000..0ad3409f --- /dev/null +++ b/bindings/ulxly/PolygonZkEVMBridgeV2.bin @@ -0,0 +1 @@ +0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61565c80620000f46000396000f3fe6080604052600436106101e35760003560e01c806383f2440311610102578063ccaa2d1111610095578063ee25560b11610064578063ee25560b146105cc578063f5efcd79146105f9578063f811bff714610619578063fb5708341461063957600080fd5b8063ccaa2d111461055d578063cd5865791461057d578063d02103ca14610590578063dbc16976146105b757600080fd5b8063bab161bf116100d1578063bab161bf146104d7578063be5831c7146104f9578063c00f14ab1461051d578063cc4616321461053d57600080fd5b806383f24403146104575780638ed7e3f214610477578063aaa13cc214610497578063b8b284d0146104b757600080fd5b80633cbc795b1161017a5780637843298b116101495780637843298b146103d757806379e2cf97146103f757806381b1c1741461040c57806383c43a551461044257600080fd5b80633cbc795b146103495780633e197043146103825780634b2f336d146103a25780635ca1e165146103c257600080fd5b806327aef4e8116101b657806327aef4e8146102795780632dfdf0b51461029b578063318aee3d146102bf5780633c351e101461032957600080fd5b806315064c96146101e85780632072f6c51461021757806322e95f2c1461022e578063240ff37814610266575b600080fd5b3480156101f457600080fd5b506068546102029060ff1681565b60405190151581526020015b60405180910390f35b34801561022357600080fd5b5061022c610659565b005b34801561023a57600080fd5b5061024e610249366004612c00565b61068e565b6040516001600160a01b03909116815260200161020e565b61022c610274366004612c8e565b6106df565b34801561028557600080fd5b5061028e61074f565b60405161020e9190612d58565b3480156102a757600080fd5b506102b160535481565b60405190815260200161020e565b3480156102cb57600080fd5b506103056102da366004612d72565b606b6020526000908152604090205463ffffffff81169064010000000090046001600160a01b031682565b6040805163ffffffff90931683526001600160a01b0390911660208301520161020e565b34801561033557600080fd5b50606d5461024e906001600160a01b031681565b34801561035557600080fd5b50606d5461036d90600160a01b900463ffffffff1681565b60405163ffffffff909116815260200161020e565b34801561038e57600080fd5b506102b161039d366004612d9e565b6107dd565b3480156103ae57600080fd5b50606f5461024e906001600160a01b031681565b3480156103ce57600080fd5b506102b161086a565b3480156103e357600080fd5b5061024e6103f2366004612e1d565b610947565b34801561040357600080fd5b5061022c610971565b34801561041857600080fd5b5061024e610427366004612e66565b606a602052600090815260409020546001600160a01b031681565b34801561044e57600080fd5b5061028e610992565b34801561046357600080fd5b506102b1610472366004612e91565b6109b1565b34801561048357600080fd5b50606c5461024e906001600160a01b031681565b3480156104a357600080fd5b5061024e6104b2366004612f9d565b610a87565b3480156104c357600080fd5b5061022c6104d2366004613039565b610b89565b3480156104e357600080fd5b5060685461036d90610100900463ffffffff1681565b34801561050557600080fd5b5060685461036d90600160c81b900463ffffffff1681565b34801561052957600080fd5b5061028e610538366004612d72565b610c50565b34801561054957600080fd5b506102026105583660046130bc565b610c95565b34801561056957600080fd5b5061022c6105783660046130ef565b610d1f565b61022c61058b3660046131db565b611238565b34801561059c57600080fd5b5060685461024e90600160281b90046001600160a01b031681565b3480156105c357600080fd5b5061022c611689565b3480156105d857600080fd5b506102b16105e7366004612e66565b60696020526000908152604090205481565b34801561060557600080fd5b5061022c6106143660046130ef565b6116bc565b34801561062557600080fd5b5061022c610634366004613271565b611976565b34801561064557600080fd5b5061020261065436600461331a565b611be9565b606c546001600160a01b0316331461068457604051631736745960e31b815260040160405180910390fd5b61068c611c01565b565b6000606a600084846040516020016106a7929190613362565b60408051601f19818403018152918152815160209283012083529082019290925201600020546001600160a01b031690505b92915050565b60685460ff161561070357604051630bc011ff60e21b815260040160405180910390fd5b341580159061071c5750606f546001600160a01b031615155b1561073a576040516301bd897160e61b815260040160405180910390fd5b610748858534868686611c5d565b5050505050565b606e805461075c9061338c565b80601f01602080910402602001604051908101604052809291908181526020018280546107889061338c565b80156107d55780601f106107aa576101008083540402835291602001916107d5565b820191906000526020600020905b8154815290600101906020018083116107b857829003601f168201915b505050505081565b6040516001600160f81b031960f889901b1660208201526001600160e01b031960e088811b821660218401526001600160601b0319606089811b821660258601529188901b909216603984015285901b16603d8201526051810183905260718101829052600090609101604051602081830303815290604052805190602001209050979650505050505050565b605354600090819081805b602081101561093e578083901c6001166001036108d2576033816020811061089f5761089f6133c6565b015460408051602081019290925281018590526060016040516020818303038152906040528051906020012093506108ff565b60408051602081018690529081018390526060016040516020818303038152906040528051906020012093505b60408051602081018490529081018390526060016040516020818303038152906040528051906020012091508080610936906133f2565b915050610875565b50919392505050565b6000610969848461095785611d27565b61096086611de6565b6104b287611e9e565b949350505050565b605354606854600160c81b900463ffffffff16101561068c5761068c611f56565b60405180611ba00160405280611b668152602001613ac1611b66913981565b600083815b6020811015610a7e57600163ffffffff8516821c81169003610a21578481602081106109e4576109e46133c6565b602002013582604051602001610a04929190918252602082015260400190565b604051602081830303815290604052805190602001209150610a6c565b81858260208110610a3457610a346133c6565b6020020135604051602001610a53929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b80610a76816133f2565b9150506109b6565b50949350505050565b6000808686604051602001610a9d929190613362565b604051602081830303815290604052805190602001209050600060ff60f81b308360405180611ba00160405280611b668152602001613ac1611b669139898989604051602001610aef9392919061340b565b60408051601f1981840301815290829052610b0d9291602001613444565b60405160208183030381529060405280519060200120604051602001610b6594939291906001600160f81b031994909416845260609290921b6001600160601b03191660018401526015830152603582015260550190565b60408051808303601f19018152919052805160209091012098975050505050505050565b60685460ff1615610bad57604051630bc011ff60e21b815260040160405180910390fd5b606f546001600160a01b0316610bd65760405163dde3cda760e01b815260040160405180910390fd5b606f54604051632770a7eb60e21b8152336004820152602481018690526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b50505050610c48868686868686611c5d565b505050505050565b6060610c5b82611d27565b610c6483611de6565b610c6d84611e9e565b604051602001610c7f9392919061340b565b6040516020818303038152906040529050919050565b6068546000908190610100900463ffffffff16158015610cbb575063ffffffff83166001145b15610ccd575063ffffffff8316610cf5565b610ce264010000000063ffffffff8516613473565b610cf29063ffffffff861661348a565b90505b600881901c600090815260696020526040902054600160ff9092169190911b908116149392505050565b60685460ff1615610d4357604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff8681166101009092041614610d73576040516302caf51760e11b815260040160405180910390fd5b610da78c8c8c8c8c610da260008e8e8e8e8e8e8e604051610d9592919061349d565b60405180910390206107dd565b611fef565b6001600160a01b038616610ee157606f546001600160a01b0316610e765760006001600160a01b03851684825b6040519080825280601f01601f191660200182016040528015610dfe576020820181803683370190505b50604051610e0c91906134ad565b60006040518083038185875af1925050503d8060008114610e49576040519150601f19603f3d011682016040523d82523d6000602084013e610e4e565b606091505b5050905080610e7057604051630ce8f45160e31b815260040160405180910390fd5b506111ce565b606f546040516340c10f1960e01b81526001600160a01b03868116600483015260248201869052909116906340c10f1990604401600060405180830381600087803b158015610ec457600080fd5b505af1158015610ed8573d6000803e3d6000fd5b505050506111ce565b606d546001600160a01b038781169116148015610f0f5750606d5463ffffffff888116600160a01b90920416145b15610f275760006001600160a01b0385168482610dd4565b60685463ffffffff610100909104811690881603610f5857610f536001600160a01b0387168585612153565b6111ce565b60008787604051602001610f6d929190613362565b60408051601f1981840301815291815281516020928301206000818152606a9093529120549091506001600160a01b031680611168576000610fe58386868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506121bb92505050565b6040516340c10f1960e01b81526001600160a01b03898116600483015260248201899052919250908216906340c10f1990604401600060405180830381600087803b15801561103357600080fd5b505af1158015611047573d6000803e3d6000fd5b5050505080606a600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060405180604001604052808b63ffffffff1681526020018a6001600160a01b0316815250606b6000836001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816001600160a01b0302191690836001600160a01b031602179055509050507f490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a398a8a83888860405161115a9594939291906134f2565b60405180910390a1506111cb565b6040516340c10f1960e01b81526001600160a01b038781166004830152602482018790528216906340c10f1990604401600060405180830381600087803b1580156111b257600080fd5b505af11580156111c6573d6000803e3d6000fd5b505050505b50505b604080518b815263ffffffff891660208201526001600160a01b0388811682840152861660608201526080810185905290517f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d9181900360a00190a1505050505050505050505050565b60685460ff161561125c57604051630bc011ff60e21b815260040160405180910390fd5b611264612237565b60685463ffffffff610100909104811690881603611295576040516302caf51760e11b815260040160405180910390fd5b6000806060876001600160a01b03881661137b578834146112c95760405163b89240f560e01b815260040160405180910390fd5b606d54606e80546001600160a01b0383169650600160a01b90920463ffffffff169450906112f69061338c565b80601f01602080910402602001604051908101604052809291908181526020018280546113229061338c565b801561136f5780601f106113445761010080835404028352916020019161136f565b820191906000526020600020905b81548152906001019060200180831161135257829003601f168201915b505050505091506115fe565b341561139a5760405163798ee6f160e01b815260040160405180910390fd5b606f546001600160a01b039081169089160361141557604051632770a7eb60e21b8152336004820152602481018a90526001600160a01b03891690639dc29fac90604401600060405180830381600087803b1580156113f857600080fd5b505af115801561140c573d6000803e3d6000fd5b505050506115fe565b6001600160a01b038089166000908152606b602090815260409182902082518084019093525463ffffffff81168352640100000000900490921691810182905290156114ce57604051632770a7eb60e21b8152336004820152602481018b90526001600160a01b038a1690639dc29fac90604401600060405180830381600087803b1580156114a357600080fd5b505af11580156114b7573d6000803e3d6000fd5b5050505080602001519450806000015193506115f1565b85156114e0576114e0898b8989612290565b6040516370a0823160e01b81523060048201526000906001600160a01b038b16906370a0823190602401602060405180830381865afa158015611527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154b919061352b565b90506115626001600160a01b038b1633308e6125d6565b6040516370a0823160e01b81523060048201526000906001600160a01b038c16906370a0823190602401602060405180830381865afa1580156115a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cd919061352b565b90506115d98282613544565b6068548c9850610100900463ffffffff169650935050505b6115fa89610c50565b9250505b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b600084868e8e868860535460405161163e989796959493929190613557565b60405180910390a1611665611660600085878f8f8789805190602001206107dd565b61260e565b861561167357611673611f56565b5050505061168060018055565b50505050505050565b606c546001600160a01b031633146116b457604051631736745960e31b815260040160405180910390fd5b61068c6126f9565b60685460ff16156116e057604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff8681166101009092041614611710576040516302caf51760e11b815260040160405180910390fd5b6117328c8c8c8c8c610da260018e8e8e8e8e8e8e604051610d9592919061349d565b606f546000906001600160a01b03166117e957846001600160a01b031684888a868660405160240161176794939291906135c2565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b1790525161179c91906134ad565b60006040518083038185875af1925050503d80600081146117d9576040519150601f19603f3d011682016040523d82523d6000602084013e6117de565b606091505b5050809150506118ed565b606f546040516340c10f1960e01b81526001600160a01b03878116600483015260248201879052909116906340c10f1990604401600060405180830381600087803b15801561183757600080fd5b505af115801561184b573d6000803e3d6000fd5b50505050846001600160a01b03168789858560405160240161187094939291906135c2565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b179052516118a591906134ad565b6000604051808303816000865af19150503d80600081146118e2576040519150601f19603f3d011682016040523d82523d6000602084013e6118e7565b606091505b50909150505b8061190b576040516337e391c360e01b815260040160405180910390fd5b604080518c815263ffffffff8a1660208201526001600160a01b0389811682840152871660608201526080810186905290517f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d9181900360a00190a150505050505050505050505050565b600054610100900460ff16158080156119965750600054600160ff909116105b806119b05750303b1580156119b0575060005460ff166001145b611a185760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015611a3b576000805461ff0019166101001790555b60688054610100600160c81b03191661010063ffffffff8a160265010000000000600160c81b03191617600160281b6001600160a01b038781169190910291909117909155606c80546001600160a01b0319168583161790558616611ac45763ffffffff851615611abf57604051630d43a60960e11b815260040160405180910390fd5b611b93565b606d805463ffffffff8716600160a01b026001600160c01b03199091166001600160a01b03891617179055606e611afb8382613643565b50611b726000801b6012604051602001611b5e91906060808252600d908201526c2bb930b83832b21022ba3432b960991b608082015260a060208201819052600490820152630ae8aa8960e31b60c082015260ff91909116604082015260e00190565b6040516020818303038152906040526121bb565b606f80546001600160a01b0319166001600160a01b03929092169190911790555b611b9b612751565b8015611680576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050565b600081611bf78686866109b1565b1495945050505050565b60685460ff1615611c2557604051630bc011ff60e21b815260040160405180910390fd5b6068805460ff191660011790556040517f2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a549790600090a1565b60685463ffffffff610100909104811690871603611c8e576040516302caf51760e11b815260040160405180910390fd5b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b6001606860019054906101000a900463ffffffff16338989898888605354604051611ce299989796959493929190613703565b60405180910390a1611d196116606001606860019054906101000a900463ffffffff16338a8a8a8989604051610d9592919061349d565b8215610c4857610c48611f56565b60408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b179052905160609160009182916001600160a01b03861691611d6e91906134ad565b600060405180830381855afa9150503d8060008114611da9576040519150601f19603f3d011682016040523d82523d6000602084013e611dae565b606091505b509150915081611ddd57604051806040016040528060078152602001664e4f5f4e414d4560c81b815250610969565b61096981612780565b60408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b179052905160609160009182916001600160a01b03861691611e2d91906134ad565b600060405180830381855afa9150503d8060008114611e68576040519150601f19603f3d011682016040523d82523d6000602084013e611e6d565b606091505b509150915081611ddd57604051806040016040528060098152602001681393d7d4d6535093d360ba1b815250610969565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691611ee491906134ad565b600060405180830381855afa9150503d8060008114611f1f576040519150601f19603f3d011682016040523d82523d6000602084013e611f24565b606091505b5091509150818015611f37575080516020145b611f42576012610969565b808060200190518101906109699190613770565b6053546068805463ffffffff909216600160c81b0263ffffffff60c81b1990921691909117908190556001600160a01b03600160281b909104166333d6247d611f9d61086a565b6040518263ffffffff1660e01b8152600401611fbb91815260200190565b600060405180830381600087803b158015611fd557600080fd5b505af1158015611fe9573d6000803e3d6000fd5b50505050565b606854604080516020808201879052818301869052825180830384018152606083019384905280519101206312bd9b1960e11b9092526064810191909152600091600160281b90046001600160a01b03169063257b3632906084016020604051808303816000875af1158015612069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208d919061352b565b9050806000036120af57604051622f6fad60e01b815260040160405180910390fd5b600080680100000000000000008716156120f4578691506120d2848a8489611be9565b6120ef576040516338105f3b60e21b815260040160405180910390fd5b61213e565b602087901c61210481600161378d565b915087925061211f612117868c866109b1565b8a8389611be9565b61213c576040516338105f3b60e21b815260040160405180910390fd5b505b612148828261290f565b505050505050505050565b6040516001600160a01b0383166024820152604481018290526121b690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526129b8565b505050565b60008060405180611ba00160405280611b668152602001613ac1611b669139836040516020016121ec929190613444565b6040516020818303038152906040529050838151602083016000f591506001600160a01b038216612230576040516305f7d84960e51b815260040160405180910390fd5b5092915050565b6002600154036122895760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611a0f565b6002600155565b600061229f60048284866137aa565b6122a8916137d4565b9050632afa533160e01b6001600160e01b031982160161243c5760008080808080806122d7896004818d6137aa565b8101906122e49190613804565b9650965096509650965096509650336001600160a01b0316876001600160a01b0316146123245760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b038616301461234d5760405163750643af60e01b815260040160405180910390fd5b8a851461236d576040516303fffc4b60e01b815260040160405180910390fd5b604080516001600160a01b0389811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180516001600160e01b031663d505accf60e01b1790529151918e16916123eb91906134ad565b6000604051808303816000865af19150503d8060008114612428576040519150601f19603f3d011682016040523d82523d6000602084013e61242d565b606091505b50505050505050505050610748565b6001600160e01b031981166323f2ebc360e21b1461246d57604051637141605d60e11b815260040160405180910390fd5b6000808080808080806124838a6004818e6137aa565b8101906124909190613858565b97509750975097509750975097509750336001600160a01b0316886001600160a01b0316146124d25760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b03871630146124fb5760405163750643af60e01b815260040160405180910390fd5b604080516001600160a01b038a811660248301528981166044830152606482018990526084820188905286151560a483015260ff861660c483015260e482018590526101048083018590528351808403909101815261012490920183526020820180516001600160e01b03166323f2ebc360e21b1790529151918f169161258291906134ad565b6000604051808303816000865af19150503d80600081146125bf576040519150601f19603f3d011682016040523d82523d6000602084013e6125c4565b606091505b50505050505050505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611fe99085906323b872dd60e01b9060840161217f565b80600161261d602060026139bf565b6126279190613544565b60535410612648576040516377ae67b360e11b815260040160405180910390fd5b6000605360008154612659906133f2565b9182905550905060005b60208110156126ea578082901c60011660010361269657826033826020811061268e5761268e6133c6565b015550505050565b603381602081106126a9576126a96133c6565b0154604080516020810192909252810184905260600160405160208183030381529060405280519060200120925080806126e2906133f2565b915050612663565b506121b66139cb565b60018055565b60685460ff1661271c57604051635386698160e01b815260040160405180910390fd5b6068805460ff191690556040517f1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b390600090a1565b600054610100900460ff166127785760405162461bcd60e51b8152600401611a0f906139e1565b61068c612a8a565b6060604082511061279f57818060200190518101906106d99190613a2c565b81516020036128dc5760005b6020811080156127da57508281815181106127c8576127c86133c6565b01602001516001600160f81b03191615155b156127f157806127e9816133f2565b9150506127ab565b806000036128295750506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b6020820152919050565b60008167ffffffffffffffff81111561284457612844612ed0565b6040519080825280601f01601f19166020018201604052801561286e576020820181803683370190505b50905060005b828110156128d45784818151811061288e5761288e6133c6565b602001015160f81c60f81b8282815181106128ab576128ab6133c6565b60200101906001600160f81b031916908160001a905350806128cc816133f2565b915050612874565b509392505050565b50506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b602082015290565b919050565b606854600090610100900463ffffffff16158015612933575063ffffffff82166001145b15612945575063ffffffff821661296d565b61295a64010000000063ffffffff8416613473565b61296a9063ffffffff851661348a565b90505b600881901c60008181526069602052604081208054600160ff861690811b9182189283905592909190818316900361168057604051630c8d9eab60e31b815260040160405180910390fd5b6000612a0d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612ab19092919063ffffffff16565b8051909150156121b65780806020019051810190612a2b9190613aa3565b6121b65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611a0f565b600054610100900460ff166126f35760405162461bcd60e51b8152600401611a0f906139e1565b6060610969848460008585600080866001600160a01b03168587604051612ad891906134ad565b60006040518083038185875af1925050503d8060008114612b15576040519150601f19603f3d011682016040523d82523d6000602084013e612b1a565b606091505b5091509150612b2b87838387612b36565b979650505050505050565b60608315612ba5578251600003612b9e576001600160a01b0385163b612b9e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611a0f565b5081610969565b6109698383815115612bba5781518083602001fd5b8060405162461bcd60e51b8152600401611a0f9190612d58565b803563ffffffff8116811461290a57600080fd5b6001600160a01b0381168114612bfd57600080fd5b50565b60008060408385031215612c1357600080fd5b612c1c83612bd4565b91506020830135612c2c81612be8565b809150509250929050565b8015158114612bfd57600080fd5b60008083601f840112612c5757600080fd5b50813567ffffffffffffffff811115612c6f57600080fd5b602083019150836020828501011115612c8757600080fd5b9250929050565b600080600080600060808688031215612ca657600080fd5b612caf86612bd4565b94506020860135612cbf81612be8565b93506040860135612ccf81612c37565b9250606086013567ffffffffffffffff811115612ceb57600080fd5b612cf788828901612c45565b969995985093965092949392505050565b60005b83811015612d23578181015183820152602001612d0b565b50506000910152565b60008151808452612d44816020860160208601612d08565b601f01601f19169290920160200192915050565b602081526000612d6b6020830184612d2c565b9392505050565b600060208284031215612d8457600080fd5b8135612d6b81612be8565b60ff81168114612bfd57600080fd5b600080600080600080600060e0888a031215612db957600080fd5b8735612dc481612d8f565b9650612dd260208901612bd4565b95506040880135612de281612be8565b9450612df060608901612bd4565b93506080880135612e0081612be8565b9699959850939692959460a0840135945060c09093013592915050565b600080600060608486031215612e3257600080fd5b612e3b84612bd4565b92506020840135612e4b81612be8565b91506040840135612e5b81612be8565b809150509250925092565b600060208284031215612e7857600080fd5b5035919050565b8061040081018310156106d957600080fd5b60008060006104408486031215612ea757600080fd5b83359250612eb88560208601612e7f565b9150612ec76104208501612bd4565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612f0f57612f0f612ed0565b604052919050565b600067ffffffffffffffff821115612f3157612f31612ed0565b50601f01601f191660200190565b6000612f52612f4d84612f17565b612ee6565b9050828152838383011115612f6657600080fd5b828260208301376000602084830101529392505050565b600082601f830112612f8e57600080fd5b612d6b83833560208501612f3f565b600080600080600060a08688031215612fb557600080fd5b612fbe86612bd4565b94506020860135612fce81612be8565b9350604086013567ffffffffffffffff80821115612feb57600080fd5b612ff789838a01612f7d565b9450606088013591508082111561300d57600080fd5b5061301a88828901612f7d565b925050608086013561302b81612d8f565b809150509295509295909350565b60008060008060008060a0878903121561305257600080fd5b61305b87612bd4565b9550602087013561306b81612be8565b945060408701359350606087013561308281612c37565b9250608087013567ffffffffffffffff81111561309e57600080fd5b6130aa89828a01612c45565b979a9699509497509295939492505050565b600080604083850312156130cf57600080fd5b6130d883612bd4565b91506130e660208401612bd4565b90509250929050565b6000806000806000806000806000806000806109208d8f03121561311257600080fd5b61311c8e8e612e7f565b9b5061312c8e6104008f01612e7f565b9a506108008d013599506108208d013598506108408d013597506131536108608e01612bd4565b96506131636108808e0135612be8565b6108808d013595506131786108a08e01612bd4565b94506131886108c08e0135612be8565b6108c08d013593506108e08d0135925067ffffffffffffffff6109008e013511156131b257600080fd5b6131c38e6109008f01358f01612c45565b81935080925050509295989b509295989b509295989b565b600080600080600080600060c0888a0312156131f657600080fd5b6131ff88612bd4565b9650602088013561320f81612be8565b955060408801359450606088013561322681612be8565b9350608088013561323681612c37565b925060a088013567ffffffffffffffff81111561325257600080fd5b61325e8a828b01612c45565b989b979a50959850939692959293505050565b60008060008060008060c0878903121561328a57600080fd5b61329387612bd4565b955060208701356132a381612be8565b94506132b160408801612bd4565b935060608701356132c181612be8565b925060808701356132d181612be8565b915060a087013567ffffffffffffffff8111156132ed57600080fd5b8701601f810189136132fe57600080fd5b61330d89823560208401612f3f565b9150509295509295509295565b600080600080610460858703121561333157600080fd5b843593506133428660208701612e7f565b92506133516104208601612bd4565b939692955092936104400135925050565b60e09290921b6001600160e01b031916825260601b6001600160601b031916600482015260180190565b600181811c908216806133a057607f821691505b6020821081036133c057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201613404576134046133dc565b5060010190565b60608152600061341e6060830186612d2c565b82810360208401526134308186612d2c565b91505060ff83166040830152949350505050565b60008351613456818460208801612d08565b83519083019061346a818360208801612d08565b01949350505050565b80820281158282048414176106d9576106d96133dc565b808201808211156106d9576106d96133dc565b8183823760009101908152919050565b600082516134bf818460208701612d08565b9190910192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b63ffffffff861681526001600160a01b03858116602083015284166040820152608060608201819052600090612b2b90830184866134c9565b60006020828403121561353d57600080fd5b5051919050565b818103818111156106d9576106d96133dc565b60ff8916815263ffffffff88811660208301526001600160a01b03888116604084015287821660608401528616608083015260a0820185905261010060c083018190526000916135a984830187612d2c565b925080851660e085015250509998505050505050505050565b6001600160a01b038516815263ffffffff841660208201526060604082018190526000906135f390830184866134c9565b9695505050505050565b601f8211156121b657600081815260208120601f850160051c810160208610156136245750805b601f850160051c820191505b81811015610c4857828155600101613630565b815167ffffffffffffffff81111561365d5761365d612ed0565b6136718161366b845461338c565b846135fd565b602080601f8311600181146136a6576000841561368e5750858301515b600019600386901b1c1916600185901b178555610c48565b600085815260208120601f198616915b828110156136d5578886015182559484019460019091019084016136b6565b50858210156136f35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60ff8a16815263ffffffff89811660208301526001600160a01b03898116604084015288821660608401528716608083015260a0820186905261010060c0830181905260009161375684830187896134c9565b925080851660e085015250509a9950505050505050505050565b60006020828403121561378257600080fd5b8151612d6b81612d8f565b63ffffffff818116838216019080821115612230576122306133dc565b600080858511156137ba57600080fd5b838611156137c757600080fd5b5050820193919092039150565b6001600160e01b031981358181169160048510156137fc5780818660040360031b1b83161692505b505092915050565b600080600080600080600060e0888a03121561381f57600080fd5b873561382a81612be8565b9650602088013561383a81612be8565b955060408801359450606088013593506080880135612e0081612d8f565b600080600080600080600080610100898b03121561387557600080fd5b883561388081612be8565b9750602089013561389081612be8565b9650604089013595506060890135945060808901356138ae81612c37565b935060a08901356138be81612d8f565b979a969950949793969295929450505060c08201359160e0013590565b600181815b808511156139165781600019048211156138fc576138fc6133dc565b8085161561390957918102915b93841c93908002906138e0565b509250929050565b60008261392d575060016106d9565b8161393a575060006106d9565b8160018114613950576002811461395a57613976565b60019150506106d9565b60ff84111561396b5761396b6133dc565b50506001821b6106d9565b5060208310610133831016604e8410600b8410161715613999575081810a6106d9565b6139a383836138db565b80600019048211156139b7576139b76133dc565b029392505050565b6000612d6b838361391e565b634e487b7160e01b600052600160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060208284031215613a3e57600080fd5b815167ffffffffffffffff811115613a5557600080fd5b8201601f81018413613a6657600080fd5b8051613a74612f4d82612f17565b818152856020838501011115613a8957600080fd5b613a9a826020830160208601612d08565b95945050505050565b600060208284031215613ab557600080fd5b8151612d6b81612c3756fe6101006040523480156200001257600080fd5b5060405162001b6638038062001b6683398101604081905262000035916200028d565b82826003620000458382620003a1565b506004620000548282620003a1565b50503360c0525060ff811660e052466080819052620000739062000080565b60a052506200046d915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620000ad6200012e565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6060600380546200013f9062000312565b80601f01602080910402602001604051908101604052809291908181526020018280546200016d9062000312565b8015620001be5780601f106200019257610100808354040283529160200191620001be565b820191906000526020600020905b815481529060010190602001808311620001a057829003601f168201915b5050505050905090565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f057600080fd5b81516001600160401b03808211156200020d576200020d620001c8565b604051601f8301601f19908116603f01168101908282118183101715620002385762000238620001c8565b816040528381526020925086838588010111156200025557600080fd5b600091505b838210156200027957858201830151818301840152908201906200025a565b600093810190920192909252949350505050565b600080600060608486031215620002a357600080fd5b83516001600160401b0380821115620002bb57600080fd5b620002c987838801620001de565b94506020860151915080821115620002e057600080fd5b50620002ef86828701620001de565b925050604084015160ff811681146200030757600080fd5b809150509250925092565b600181811c908216806200032757607f821691505b6020821081036200034857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200039c57600081815260208120601f850160051c81016020861015620003775750805b601f850160051c820191505b81811015620003985782815560010162000383565b5050505b505050565b81516001600160401b03811115620003bd57620003bd620001c8565b620003d581620003ce845462000312565b846200034e565b602080601f8311600181146200040d5760008415620003f45750858301515b600019600386901b1c1916600185901b17855562000398565b600085815260208120601f198616915b828110156200043e578886015182559484019460019091019084016200041d565b50858210156200045d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e0516116aa620004bc6000396000610237015260008181610307015281816105c001526106a70152600061053a015260008181610379015261050401526116aa6000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806370a08231116100d8578063a457c2d71161008c578063d505accf11610066578063d505accf1461039b578063dd62ed3e146103ae578063ffa1ad74146103f457600080fd5b8063a457c2d71461034e578063a9059cbb14610361578063cd0d00961461037457600080fd5b806395d89b41116100bd57806395d89b41146102e75780639dc29fac146102ef578063a3c573eb1461030257600080fd5b806370a08231146102915780637ecebe00146102c757600080fd5b806330adf81f1161012f5780633644e515116101145780633644e51514610261578063395093511461026957806340c10f191461027c57600080fd5b806330adf81f14610209578063313ce5671461023057600080fd5b806318160ddd1161016057806318160ddd146101bd57806320606b70146101cf57806323b872dd146101f657600080fd5b806306fdde031461017c578063095ea7b31461019a575b600080fd5b610184610430565b60405161019191906113e4565b60405180910390f35b6101ad6101a8366004611479565b6104c2565b6040519015158152602001610191565b6002545b604051908152602001610191565b6101c17f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6101ad6102043660046114a3565b6104dc565b6101c17f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610191565b6101c1610500565b6101ad610277366004611479565b61055c565b61028f61028a366004611479565b6105a8565b005b6101c161029f3660046114df565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101c16102d53660046114df565b60056020526000908152604090205481565b610184610680565b61028f6102fd366004611479565b61068f565b6103297f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610191565b6101ad61035c366004611479565b61075e565b6101ad61036f366004611479565b61082f565b6101c17f000000000000000000000000000000000000000000000000000000000000000081565b61028f6103a9366004611501565b61083d565b6101c16103bc366004611574565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101846040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525081565b60606003805461043f906115a7565b80601f016020809104026020016040519081016040528092919081815260200182805461046b906115a7565b80156104b85780601f1061048d576101008083540402835291602001916104b8565b820191906000526020600020905b81548152906001019060200180831161049b57829003601f168201915b5050505050905090565b6000336104d0818585610b73565b60019150505b92915050565b6000336104ea858285610d27565b6104f5858585610dfe565b506001949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614610537576105324661106d565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906104d090829086906105a3908790611629565b610b73565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d4272696467650000000000000000000000000000000060648201526084015b60405180910390fd5b61067c8282611135565b5050565b60606004805461043f906115a7565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d427269646765000000000000000000000000000000006064820152608401610669565b61067c8282611228565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610822576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610669565b6104f58286868403610b73565b6000336104d0818585610dfe565b834211156108cc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6b656e577261707065643a3a7065726d69743a204578706972656420706560448201527f726d6974000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8716600090815260056020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a9190866109268361163c565b9091555060408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610991610500565b6040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281019190915260428101839052606201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa158015610a55573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590610ad057508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b610b5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546f6b656e577261707065643a3a7065726d69743a20496e76616c696420736960448201527f676e6174757265000000000000000000000000000000000000000000000000006064820152608401610669565b610b678a8a8a610b73565b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8316610c15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8216610cb8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610df85781811015610deb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610669565b610df88484848403610b73565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610ea1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8216610f44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610ffa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610df8565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611098610430565b8051602091820120604080518082018252600181527f310000000000000000000000000000000000000000000000000000000000000090840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b73ffffffffffffffffffffffffffffffffffffffff82166111b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610669565b80600260008282546111c49190611629565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff82166112cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015611381576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610d1a565b600060208083528351808285015260005b81811015611411578581018301518582016040015282016113f5565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461147457600080fd5b919050565b6000806040838503121561148c57600080fd5b61149583611450565b946020939093013593505050565b6000806000606084860312156114b857600080fd5b6114c184611450565b92506114cf60208501611450565b9150604084013590509250925092565b6000602082840312156114f157600080fd5b6114fa82611450565b9392505050565b600080600080600080600060e0888a03121561151c57600080fd5b61152588611450565b965061153360208901611450565b95506040880135945060608801359350608088013560ff8116811461155757600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561158757600080fd5b61159083611450565b915061159e60208401611450565b90509250929050565b600181811c908216806115bb57607f821691505b6020821081036115f4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156104d6576104d66115fa565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361166d5761166d6115fa565b506001019056fea26469706673582212208d88fee561cff7120d381c345cfc534cef8229a272dc5809d4bbb685ad67141164736f6c63430008110033a264697066735822122082405b2b21a65efc74f67ed80924b72065405d6bcd7505ac13b3280304fa253264736f6c63430008140033 diff --git a/bindings/ulxly/PolygonZkEVMBridgeV2.go b/bindings/ulxly/PolygonZkEVMBridgeV2.go new file mode 100644 index 00000000..0699052f --- /dev/null +++ b/bindings/ulxly/PolygonZkEVMBridgeV2.go @@ -0,0 +1,1935 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ulxly + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// UlxlyMetaData contains all meta data concerning the Ulxly contract. +var UlxlyMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"BASE_INIT_BYTECODE_WRAPPED_TOKEN\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WETHToken\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractTokenWrapped\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"activateEmergencyState\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bridgeAsset\",\"inputs\":[{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"forceUpdateGlobalExitRoot\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"permitData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"bridgeMessage\",\"inputs\":[{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"forceUpdateGlobalExitRoot\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"bridgeMessageWETH\",\"inputs\":[{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amountWETH\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"forceUpdateGlobalExitRoot\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"calculateRoot\",\"inputs\":[{\"name\":\"leafHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"smtProof\",\"type\":\"bytes32[32]\",\"internalType\":\"bytes32[32]\"},{\"name\":\"index\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"calculateTokenWrapperAddress\",\"inputs\":[{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimAsset\",\"inputs\":[{\"name\":\"smtProofLocalExitRoot\",\"type\":\"bytes32[32]\",\"internalType\":\"bytes32[32]\"},{\"name\":\"smtProofRollupExitRoot\",\"type\":\"bytes32[32]\",\"internalType\":\"bytes32[32]\"},{\"name\":\"globalIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"mainnetExitRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rollupExitRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"claimMessage\",\"inputs\":[{\"name\":\"smtProofLocalExitRoot\",\"type\":\"bytes32[32]\",\"internalType\":\"bytes32[32]\"},{\"name\":\"smtProofRollupExitRoot\",\"type\":\"bytes32[32]\",\"internalType\":\"bytes32[32]\"},{\"name\":\"globalIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"mainnetExitRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rollupExitRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"claimedBitMap\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deactivateEmergencyState\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gasTokenAddress\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gasTokenMetadata\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gasTokenNetwork\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLeafValue\",\"inputs\":[{\"name\":\"leafType\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"metadataHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenMetadata\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokenWrappedAddress\",\"inputs\":[{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"globalExitRootManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBasePolygonZkEVMGlobalExitRoot\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_networkID\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_gasTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_gasTokenNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_globalExitRootManager\",\"type\":\"address\",\"internalType\":\"contractIBasePolygonZkEVMGlobalExitRoot\"},{\"name\":\"_polygonRollupManager\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_gasTokenMetadata\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isClaimed\",\"inputs\":[{\"name\":\"leafIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"sourceBridgeNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEmergencyState\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"lastUpdatedDepositCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"networkID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"polygonRollupManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"precalculatedWrapperAddress\",\"inputs\":[{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"symbol\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"decimals\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"tokenInfoToWrappedToken\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateGlobalExitRoot\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyMerkleProof\",\"inputs\":[{\"name\":\"leafHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"smtProof\",\"type\":\"bytes32[32]\",\"internalType\":\"bytes32[32]\"},{\"name\":\"index\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"wrappedTokenToTokenInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"originNetwork\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"BridgeEvent\",\"inputs\":[{\"name\":\"leafType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"originAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"destinationNetwork\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"depositCount\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ClaimEvent\",\"inputs\":[{\"name\":\"globalIndex\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"originNetwork\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"originAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"destinationAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EmergencyStateActivated\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EmergencyStateDeactivated\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewWrappedToken\",\"inputs\":[{\"name\":\"originNetwork\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"originTokenAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"wrappedTokenAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"metadata\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AlreadyClaimed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AmountDoesNotMatchMsgValue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DestinationNetworkInvalid\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EtherTransferFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedTokenWrappedDeployment\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"GasTokenNetworkMustBeZeroOnEther\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"GlobalExitRootInvalid\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSmtProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MerkleTreeFull\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MessageFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MsgValueNotZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NativeTokenIsEther\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoValueInMessagesOnGasTokenNetworks\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotValidAmount\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotValidOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotValidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotValidSpender\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyEmergencyState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyNotEmergencyState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyRollupManager\",\"inputs\":[]}]", + Bin: "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61565c80620000f46000396000f3fe6080604052600436106101e35760003560e01c806383f2440311610102578063ccaa2d1111610095578063ee25560b11610064578063ee25560b146105cc578063f5efcd79146105f9578063f811bff714610619578063fb5708341461063957600080fd5b8063ccaa2d111461055d578063cd5865791461057d578063d02103ca14610590578063dbc16976146105b757600080fd5b8063bab161bf116100d1578063bab161bf146104d7578063be5831c7146104f9578063c00f14ab1461051d578063cc4616321461053d57600080fd5b806383f24403146104575780638ed7e3f214610477578063aaa13cc214610497578063b8b284d0146104b757600080fd5b80633cbc795b1161017a5780637843298b116101495780637843298b146103d757806379e2cf97146103f757806381b1c1741461040c57806383c43a551461044257600080fd5b80633cbc795b146103495780633e197043146103825780634b2f336d146103a25780635ca1e165146103c257600080fd5b806327aef4e8116101b657806327aef4e8146102795780632dfdf0b51461029b578063318aee3d146102bf5780633c351e101461032957600080fd5b806315064c96146101e85780632072f6c51461021757806322e95f2c1461022e578063240ff37814610266575b600080fd5b3480156101f457600080fd5b506068546102029060ff1681565b60405190151581526020015b60405180910390f35b34801561022357600080fd5b5061022c610659565b005b34801561023a57600080fd5b5061024e610249366004612c00565b61068e565b6040516001600160a01b03909116815260200161020e565b61022c610274366004612c8e565b6106df565b34801561028557600080fd5b5061028e61074f565b60405161020e9190612d58565b3480156102a757600080fd5b506102b160535481565b60405190815260200161020e565b3480156102cb57600080fd5b506103056102da366004612d72565b606b6020526000908152604090205463ffffffff81169064010000000090046001600160a01b031682565b6040805163ffffffff90931683526001600160a01b0390911660208301520161020e565b34801561033557600080fd5b50606d5461024e906001600160a01b031681565b34801561035557600080fd5b50606d5461036d90600160a01b900463ffffffff1681565b60405163ffffffff909116815260200161020e565b34801561038e57600080fd5b506102b161039d366004612d9e565b6107dd565b3480156103ae57600080fd5b50606f5461024e906001600160a01b031681565b3480156103ce57600080fd5b506102b161086a565b3480156103e357600080fd5b5061024e6103f2366004612e1d565b610947565b34801561040357600080fd5b5061022c610971565b34801561041857600080fd5b5061024e610427366004612e66565b606a602052600090815260409020546001600160a01b031681565b34801561044e57600080fd5b5061028e610992565b34801561046357600080fd5b506102b1610472366004612e91565b6109b1565b34801561048357600080fd5b50606c5461024e906001600160a01b031681565b3480156104a357600080fd5b5061024e6104b2366004612f9d565b610a87565b3480156104c357600080fd5b5061022c6104d2366004613039565b610b89565b3480156104e357600080fd5b5060685461036d90610100900463ffffffff1681565b34801561050557600080fd5b5060685461036d90600160c81b900463ffffffff1681565b34801561052957600080fd5b5061028e610538366004612d72565b610c50565b34801561054957600080fd5b506102026105583660046130bc565b610c95565b34801561056957600080fd5b5061022c6105783660046130ef565b610d1f565b61022c61058b3660046131db565b611238565b34801561059c57600080fd5b5060685461024e90600160281b90046001600160a01b031681565b3480156105c357600080fd5b5061022c611689565b3480156105d857600080fd5b506102b16105e7366004612e66565b60696020526000908152604090205481565b34801561060557600080fd5b5061022c6106143660046130ef565b6116bc565b34801561062557600080fd5b5061022c610634366004613271565b611976565b34801561064557600080fd5b5061020261065436600461331a565b611be9565b606c546001600160a01b0316331461068457604051631736745960e31b815260040160405180910390fd5b61068c611c01565b565b6000606a600084846040516020016106a7929190613362565b60408051601f19818403018152918152815160209283012083529082019290925201600020546001600160a01b031690505b92915050565b60685460ff161561070357604051630bc011ff60e21b815260040160405180910390fd5b341580159061071c5750606f546001600160a01b031615155b1561073a576040516301bd897160e61b815260040160405180910390fd5b610748858534868686611c5d565b5050505050565b606e805461075c9061338c565b80601f01602080910402602001604051908101604052809291908181526020018280546107889061338c565b80156107d55780601f106107aa576101008083540402835291602001916107d5565b820191906000526020600020905b8154815290600101906020018083116107b857829003601f168201915b505050505081565b6040516001600160f81b031960f889901b1660208201526001600160e01b031960e088811b821660218401526001600160601b0319606089811b821660258601529188901b909216603984015285901b16603d8201526051810183905260718101829052600090609101604051602081830303815290604052805190602001209050979650505050505050565b605354600090819081805b602081101561093e578083901c6001166001036108d2576033816020811061089f5761089f6133c6565b015460408051602081019290925281018590526060016040516020818303038152906040528051906020012093506108ff565b60408051602081018690529081018390526060016040516020818303038152906040528051906020012093505b60408051602081018490529081018390526060016040516020818303038152906040528051906020012091508080610936906133f2565b915050610875565b50919392505050565b6000610969848461095785611d27565b61096086611de6565b6104b287611e9e565b949350505050565b605354606854600160c81b900463ffffffff16101561068c5761068c611f56565b60405180611ba00160405280611b668152602001613ac1611b66913981565b600083815b6020811015610a7e57600163ffffffff8516821c81169003610a21578481602081106109e4576109e46133c6565b602002013582604051602001610a04929190918252602082015260400190565b604051602081830303815290604052805190602001209150610a6c565b81858260208110610a3457610a346133c6565b6020020135604051602001610a53929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b80610a76816133f2565b9150506109b6565b50949350505050565b6000808686604051602001610a9d929190613362565b604051602081830303815290604052805190602001209050600060ff60f81b308360405180611ba00160405280611b668152602001613ac1611b669139898989604051602001610aef9392919061340b565b60408051601f1981840301815290829052610b0d9291602001613444565b60405160208183030381529060405280519060200120604051602001610b6594939291906001600160f81b031994909416845260609290921b6001600160601b03191660018401526015830152603582015260550190565b60408051808303601f19018152919052805160209091012098975050505050505050565b60685460ff1615610bad57604051630bc011ff60e21b815260040160405180910390fd5b606f546001600160a01b0316610bd65760405163dde3cda760e01b815260040160405180910390fd5b606f54604051632770a7eb60e21b8152336004820152602481018690526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b50505050610c48868686868686611c5d565b505050505050565b6060610c5b82611d27565b610c6483611de6565b610c6d84611e9e565b604051602001610c7f9392919061340b565b6040516020818303038152906040529050919050565b6068546000908190610100900463ffffffff16158015610cbb575063ffffffff83166001145b15610ccd575063ffffffff8316610cf5565b610ce264010000000063ffffffff8516613473565b610cf29063ffffffff861661348a565b90505b600881901c600090815260696020526040902054600160ff9092169190911b908116149392505050565b60685460ff1615610d4357604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff8681166101009092041614610d73576040516302caf51760e11b815260040160405180910390fd5b610da78c8c8c8c8c610da260008e8e8e8e8e8e8e604051610d9592919061349d565b60405180910390206107dd565b611fef565b6001600160a01b038616610ee157606f546001600160a01b0316610e765760006001600160a01b03851684825b6040519080825280601f01601f191660200182016040528015610dfe576020820181803683370190505b50604051610e0c91906134ad565b60006040518083038185875af1925050503d8060008114610e49576040519150601f19603f3d011682016040523d82523d6000602084013e610e4e565b606091505b5050905080610e7057604051630ce8f45160e31b815260040160405180910390fd5b506111ce565b606f546040516340c10f1960e01b81526001600160a01b03868116600483015260248201869052909116906340c10f1990604401600060405180830381600087803b158015610ec457600080fd5b505af1158015610ed8573d6000803e3d6000fd5b505050506111ce565b606d546001600160a01b038781169116148015610f0f5750606d5463ffffffff888116600160a01b90920416145b15610f275760006001600160a01b0385168482610dd4565b60685463ffffffff610100909104811690881603610f5857610f536001600160a01b0387168585612153565b6111ce565b60008787604051602001610f6d929190613362565b60408051601f1981840301815291815281516020928301206000818152606a9093529120549091506001600160a01b031680611168576000610fe58386868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506121bb92505050565b6040516340c10f1960e01b81526001600160a01b03898116600483015260248201899052919250908216906340c10f1990604401600060405180830381600087803b15801561103357600080fd5b505af1158015611047573d6000803e3d6000fd5b5050505080606a600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060405180604001604052808b63ffffffff1681526020018a6001600160a01b0316815250606b6000836001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816001600160a01b0302191690836001600160a01b031602179055509050507f490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a398a8a83888860405161115a9594939291906134f2565b60405180910390a1506111cb565b6040516340c10f1960e01b81526001600160a01b038781166004830152602482018790528216906340c10f1990604401600060405180830381600087803b1580156111b257600080fd5b505af11580156111c6573d6000803e3d6000fd5b505050505b50505b604080518b815263ffffffff891660208201526001600160a01b0388811682840152861660608201526080810185905290517f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d9181900360a00190a1505050505050505050505050565b60685460ff161561125c57604051630bc011ff60e21b815260040160405180910390fd5b611264612237565b60685463ffffffff610100909104811690881603611295576040516302caf51760e11b815260040160405180910390fd5b6000806060876001600160a01b03881661137b578834146112c95760405163b89240f560e01b815260040160405180910390fd5b606d54606e80546001600160a01b0383169650600160a01b90920463ffffffff169450906112f69061338c565b80601f01602080910402602001604051908101604052809291908181526020018280546113229061338c565b801561136f5780601f106113445761010080835404028352916020019161136f565b820191906000526020600020905b81548152906001019060200180831161135257829003601f168201915b505050505091506115fe565b341561139a5760405163798ee6f160e01b815260040160405180910390fd5b606f546001600160a01b039081169089160361141557604051632770a7eb60e21b8152336004820152602481018a90526001600160a01b03891690639dc29fac90604401600060405180830381600087803b1580156113f857600080fd5b505af115801561140c573d6000803e3d6000fd5b505050506115fe565b6001600160a01b038089166000908152606b602090815260409182902082518084019093525463ffffffff81168352640100000000900490921691810182905290156114ce57604051632770a7eb60e21b8152336004820152602481018b90526001600160a01b038a1690639dc29fac90604401600060405180830381600087803b1580156114a357600080fd5b505af11580156114b7573d6000803e3d6000fd5b5050505080602001519450806000015193506115f1565b85156114e0576114e0898b8989612290565b6040516370a0823160e01b81523060048201526000906001600160a01b038b16906370a0823190602401602060405180830381865afa158015611527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154b919061352b565b90506115626001600160a01b038b1633308e6125d6565b6040516370a0823160e01b81523060048201526000906001600160a01b038c16906370a0823190602401602060405180830381865afa1580156115a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cd919061352b565b90506115d98282613544565b6068548c9850610100900463ffffffff169650935050505b6115fa89610c50565b9250505b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b600084868e8e868860535460405161163e989796959493929190613557565b60405180910390a1611665611660600085878f8f8789805190602001206107dd565b61260e565b861561167357611673611f56565b5050505061168060018055565b50505050505050565b606c546001600160a01b031633146116b457604051631736745960e31b815260040160405180910390fd5b61068c6126f9565b60685460ff16156116e057604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff8681166101009092041614611710576040516302caf51760e11b815260040160405180910390fd5b6117328c8c8c8c8c610da260018e8e8e8e8e8e8e604051610d9592919061349d565b606f546000906001600160a01b03166117e957846001600160a01b031684888a868660405160240161176794939291906135c2565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b1790525161179c91906134ad565b60006040518083038185875af1925050503d80600081146117d9576040519150601f19603f3d011682016040523d82523d6000602084013e6117de565b606091505b5050809150506118ed565b606f546040516340c10f1960e01b81526001600160a01b03878116600483015260248201879052909116906340c10f1990604401600060405180830381600087803b15801561183757600080fd5b505af115801561184b573d6000803e3d6000fd5b50505050846001600160a01b03168789858560405160240161187094939291906135c2565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b179052516118a591906134ad565b6000604051808303816000865af19150503d80600081146118e2576040519150601f19603f3d011682016040523d82523d6000602084013e6118e7565b606091505b50909150505b8061190b576040516337e391c360e01b815260040160405180910390fd5b604080518c815263ffffffff8a1660208201526001600160a01b0389811682840152871660608201526080810186905290517f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d9181900360a00190a150505050505050505050505050565b600054610100900460ff16158080156119965750600054600160ff909116105b806119b05750303b1580156119b0575060005460ff166001145b611a185760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015611a3b576000805461ff0019166101001790555b60688054610100600160c81b03191661010063ffffffff8a160265010000000000600160c81b03191617600160281b6001600160a01b038781169190910291909117909155606c80546001600160a01b0319168583161790558616611ac45763ffffffff851615611abf57604051630d43a60960e11b815260040160405180910390fd5b611b93565b606d805463ffffffff8716600160a01b026001600160c01b03199091166001600160a01b03891617179055606e611afb8382613643565b50611b726000801b6012604051602001611b5e91906060808252600d908201526c2bb930b83832b21022ba3432b960991b608082015260a060208201819052600490820152630ae8aa8960e31b60c082015260ff91909116604082015260e00190565b6040516020818303038152906040526121bb565b606f80546001600160a01b0319166001600160a01b03929092169190911790555b611b9b612751565b8015611680576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050565b600081611bf78686866109b1565b1495945050505050565b60685460ff1615611c2557604051630bc011ff60e21b815260040160405180910390fd5b6068805460ff191660011790556040517f2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a549790600090a1565b60685463ffffffff610100909104811690871603611c8e576040516302caf51760e11b815260040160405180910390fd5b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b6001606860019054906101000a900463ffffffff16338989898888605354604051611ce299989796959493929190613703565b60405180910390a1611d196116606001606860019054906101000a900463ffffffff16338a8a8a8989604051610d9592919061349d565b8215610c4857610c48611f56565b60408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b179052905160609160009182916001600160a01b03861691611d6e91906134ad565b600060405180830381855afa9150503d8060008114611da9576040519150601f19603f3d011682016040523d82523d6000602084013e611dae565b606091505b509150915081611ddd57604051806040016040528060078152602001664e4f5f4e414d4560c81b815250610969565b61096981612780565b60408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b179052905160609160009182916001600160a01b03861691611e2d91906134ad565b600060405180830381855afa9150503d8060008114611e68576040519150601f19603f3d011682016040523d82523d6000602084013e611e6d565b606091505b509150915081611ddd57604051806040016040528060098152602001681393d7d4d6535093d360ba1b815250610969565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691611ee491906134ad565b600060405180830381855afa9150503d8060008114611f1f576040519150601f19603f3d011682016040523d82523d6000602084013e611f24565b606091505b5091509150818015611f37575080516020145b611f42576012610969565b808060200190518101906109699190613770565b6053546068805463ffffffff909216600160c81b0263ffffffff60c81b1990921691909117908190556001600160a01b03600160281b909104166333d6247d611f9d61086a565b6040518263ffffffff1660e01b8152600401611fbb91815260200190565b600060405180830381600087803b158015611fd557600080fd5b505af1158015611fe9573d6000803e3d6000fd5b50505050565b606854604080516020808201879052818301869052825180830384018152606083019384905280519101206312bd9b1960e11b9092526064810191909152600091600160281b90046001600160a01b03169063257b3632906084016020604051808303816000875af1158015612069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208d919061352b565b9050806000036120af57604051622f6fad60e01b815260040160405180910390fd5b600080680100000000000000008716156120f4578691506120d2848a8489611be9565b6120ef576040516338105f3b60e21b815260040160405180910390fd5b61213e565b602087901c61210481600161378d565b915087925061211f612117868c866109b1565b8a8389611be9565b61213c576040516338105f3b60e21b815260040160405180910390fd5b505b612148828261290f565b505050505050505050565b6040516001600160a01b0383166024820152604481018290526121b690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526129b8565b505050565b60008060405180611ba00160405280611b668152602001613ac1611b669139836040516020016121ec929190613444565b6040516020818303038152906040529050838151602083016000f591506001600160a01b038216612230576040516305f7d84960e51b815260040160405180910390fd5b5092915050565b6002600154036122895760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611a0f565b6002600155565b600061229f60048284866137aa565b6122a8916137d4565b9050632afa533160e01b6001600160e01b031982160161243c5760008080808080806122d7896004818d6137aa565b8101906122e49190613804565b9650965096509650965096509650336001600160a01b0316876001600160a01b0316146123245760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b038616301461234d5760405163750643af60e01b815260040160405180910390fd5b8a851461236d576040516303fffc4b60e01b815260040160405180910390fd5b604080516001600160a01b0389811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180516001600160e01b031663d505accf60e01b1790529151918e16916123eb91906134ad565b6000604051808303816000865af19150503d8060008114612428576040519150601f19603f3d011682016040523d82523d6000602084013e61242d565b606091505b50505050505050505050610748565b6001600160e01b031981166323f2ebc360e21b1461246d57604051637141605d60e11b815260040160405180910390fd5b6000808080808080806124838a6004818e6137aa565b8101906124909190613858565b97509750975097509750975097509750336001600160a01b0316886001600160a01b0316146124d25760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b03871630146124fb5760405163750643af60e01b815260040160405180910390fd5b604080516001600160a01b038a811660248301528981166044830152606482018990526084820188905286151560a483015260ff861660c483015260e482018590526101048083018590528351808403909101815261012490920183526020820180516001600160e01b03166323f2ebc360e21b1790529151918f169161258291906134ad565b6000604051808303816000865af19150503d80600081146125bf576040519150601f19603f3d011682016040523d82523d6000602084013e6125c4565b606091505b50505050505050505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611fe99085906323b872dd60e01b9060840161217f565b80600161261d602060026139bf565b6126279190613544565b60535410612648576040516377ae67b360e11b815260040160405180910390fd5b6000605360008154612659906133f2565b9182905550905060005b60208110156126ea578082901c60011660010361269657826033826020811061268e5761268e6133c6565b015550505050565b603381602081106126a9576126a96133c6565b0154604080516020810192909252810184905260600160405160208183030381529060405280519060200120925080806126e2906133f2565b915050612663565b506121b66139cb565b60018055565b60685460ff1661271c57604051635386698160e01b815260040160405180910390fd5b6068805460ff191690556040517f1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b390600090a1565b600054610100900460ff166127785760405162461bcd60e51b8152600401611a0f906139e1565b61068c612a8a565b6060604082511061279f57818060200190518101906106d99190613a2c565b81516020036128dc5760005b6020811080156127da57508281815181106127c8576127c86133c6565b01602001516001600160f81b03191615155b156127f157806127e9816133f2565b9150506127ab565b806000036128295750506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b6020820152919050565b60008167ffffffffffffffff81111561284457612844612ed0565b6040519080825280601f01601f19166020018201604052801561286e576020820181803683370190505b50905060005b828110156128d45784818151811061288e5761288e6133c6565b602001015160f81c60f81b8282815181106128ab576128ab6133c6565b60200101906001600160f81b031916908160001a905350806128cc816133f2565b915050612874565b509392505050565b50506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b602082015290565b919050565b606854600090610100900463ffffffff16158015612933575063ffffffff82166001145b15612945575063ffffffff821661296d565b61295a64010000000063ffffffff8416613473565b61296a9063ffffffff851661348a565b90505b600881901c60008181526069602052604081208054600160ff861690811b9182189283905592909190818316900361168057604051630c8d9eab60e31b815260040160405180910390fd5b6000612a0d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612ab19092919063ffffffff16565b8051909150156121b65780806020019051810190612a2b9190613aa3565b6121b65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611a0f565b600054610100900460ff166126f35760405162461bcd60e51b8152600401611a0f906139e1565b6060610969848460008585600080866001600160a01b03168587604051612ad891906134ad565b60006040518083038185875af1925050503d8060008114612b15576040519150601f19603f3d011682016040523d82523d6000602084013e612b1a565b606091505b5091509150612b2b87838387612b36565b979650505050505050565b60608315612ba5578251600003612b9e576001600160a01b0385163b612b9e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611a0f565b5081610969565b6109698383815115612bba5781518083602001fd5b8060405162461bcd60e51b8152600401611a0f9190612d58565b803563ffffffff8116811461290a57600080fd5b6001600160a01b0381168114612bfd57600080fd5b50565b60008060408385031215612c1357600080fd5b612c1c83612bd4565b91506020830135612c2c81612be8565b809150509250929050565b8015158114612bfd57600080fd5b60008083601f840112612c5757600080fd5b50813567ffffffffffffffff811115612c6f57600080fd5b602083019150836020828501011115612c8757600080fd5b9250929050565b600080600080600060808688031215612ca657600080fd5b612caf86612bd4565b94506020860135612cbf81612be8565b93506040860135612ccf81612c37565b9250606086013567ffffffffffffffff811115612ceb57600080fd5b612cf788828901612c45565b969995985093965092949392505050565b60005b83811015612d23578181015183820152602001612d0b565b50506000910152565b60008151808452612d44816020860160208601612d08565b601f01601f19169290920160200192915050565b602081526000612d6b6020830184612d2c565b9392505050565b600060208284031215612d8457600080fd5b8135612d6b81612be8565b60ff81168114612bfd57600080fd5b600080600080600080600060e0888a031215612db957600080fd5b8735612dc481612d8f565b9650612dd260208901612bd4565b95506040880135612de281612be8565b9450612df060608901612bd4565b93506080880135612e0081612be8565b9699959850939692959460a0840135945060c09093013592915050565b600080600060608486031215612e3257600080fd5b612e3b84612bd4565b92506020840135612e4b81612be8565b91506040840135612e5b81612be8565b809150509250925092565b600060208284031215612e7857600080fd5b5035919050565b8061040081018310156106d957600080fd5b60008060006104408486031215612ea757600080fd5b83359250612eb88560208601612e7f565b9150612ec76104208501612bd4565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612f0f57612f0f612ed0565b604052919050565b600067ffffffffffffffff821115612f3157612f31612ed0565b50601f01601f191660200190565b6000612f52612f4d84612f17565b612ee6565b9050828152838383011115612f6657600080fd5b828260208301376000602084830101529392505050565b600082601f830112612f8e57600080fd5b612d6b83833560208501612f3f565b600080600080600060a08688031215612fb557600080fd5b612fbe86612bd4565b94506020860135612fce81612be8565b9350604086013567ffffffffffffffff80821115612feb57600080fd5b612ff789838a01612f7d565b9450606088013591508082111561300d57600080fd5b5061301a88828901612f7d565b925050608086013561302b81612d8f565b809150509295509295909350565b60008060008060008060a0878903121561305257600080fd5b61305b87612bd4565b9550602087013561306b81612be8565b945060408701359350606087013561308281612c37565b9250608087013567ffffffffffffffff81111561309e57600080fd5b6130aa89828a01612c45565b979a9699509497509295939492505050565b600080604083850312156130cf57600080fd5b6130d883612bd4565b91506130e660208401612bd4565b90509250929050565b6000806000806000806000806000806000806109208d8f03121561311257600080fd5b61311c8e8e612e7f565b9b5061312c8e6104008f01612e7f565b9a506108008d013599506108208d013598506108408d013597506131536108608e01612bd4565b96506131636108808e0135612be8565b6108808d013595506131786108a08e01612bd4565b94506131886108c08e0135612be8565b6108c08d013593506108e08d0135925067ffffffffffffffff6109008e013511156131b257600080fd5b6131c38e6109008f01358f01612c45565b81935080925050509295989b509295989b509295989b565b600080600080600080600060c0888a0312156131f657600080fd5b6131ff88612bd4565b9650602088013561320f81612be8565b955060408801359450606088013561322681612be8565b9350608088013561323681612c37565b925060a088013567ffffffffffffffff81111561325257600080fd5b61325e8a828b01612c45565b989b979a50959850939692959293505050565b60008060008060008060c0878903121561328a57600080fd5b61329387612bd4565b955060208701356132a381612be8565b94506132b160408801612bd4565b935060608701356132c181612be8565b925060808701356132d181612be8565b915060a087013567ffffffffffffffff8111156132ed57600080fd5b8701601f810189136132fe57600080fd5b61330d89823560208401612f3f565b9150509295509295509295565b600080600080610460858703121561333157600080fd5b843593506133428660208701612e7f565b92506133516104208601612bd4565b939692955092936104400135925050565b60e09290921b6001600160e01b031916825260601b6001600160601b031916600482015260180190565b600181811c908216806133a057607f821691505b6020821081036133c057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201613404576134046133dc565b5060010190565b60608152600061341e6060830186612d2c565b82810360208401526134308186612d2c565b91505060ff83166040830152949350505050565b60008351613456818460208801612d08565b83519083019061346a818360208801612d08565b01949350505050565b80820281158282048414176106d9576106d96133dc565b808201808211156106d9576106d96133dc565b8183823760009101908152919050565b600082516134bf818460208701612d08565b9190910192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b63ffffffff861681526001600160a01b03858116602083015284166040820152608060608201819052600090612b2b90830184866134c9565b60006020828403121561353d57600080fd5b5051919050565b818103818111156106d9576106d96133dc565b60ff8916815263ffffffff88811660208301526001600160a01b03888116604084015287821660608401528616608083015260a0820185905261010060c083018190526000916135a984830187612d2c565b925080851660e085015250509998505050505050505050565b6001600160a01b038516815263ffffffff841660208201526060604082018190526000906135f390830184866134c9565b9695505050505050565b601f8211156121b657600081815260208120601f850160051c810160208610156136245750805b601f850160051c820191505b81811015610c4857828155600101613630565b815167ffffffffffffffff81111561365d5761365d612ed0565b6136718161366b845461338c565b846135fd565b602080601f8311600181146136a6576000841561368e5750858301515b600019600386901b1c1916600185901b178555610c48565b600085815260208120601f198616915b828110156136d5578886015182559484019460019091019084016136b6565b50858210156136f35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60ff8a16815263ffffffff89811660208301526001600160a01b03898116604084015288821660608401528716608083015260a0820186905261010060c0830181905260009161375684830187896134c9565b925080851660e085015250509a9950505050505050505050565b60006020828403121561378257600080fd5b8151612d6b81612d8f565b63ffffffff818116838216019080821115612230576122306133dc565b600080858511156137ba57600080fd5b838611156137c757600080fd5b5050820193919092039150565b6001600160e01b031981358181169160048510156137fc5780818660040360031b1b83161692505b505092915050565b600080600080600080600060e0888a03121561381f57600080fd5b873561382a81612be8565b9650602088013561383a81612be8565b955060408801359450606088013593506080880135612e0081612d8f565b600080600080600080600080610100898b03121561387557600080fd5b883561388081612be8565b9750602089013561389081612be8565b9650604089013595506060890135945060808901356138ae81612c37565b935060a08901356138be81612d8f565b979a969950949793969295929450505060c08201359160e0013590565b600181815b808511156139165781600019048211156138fc576138fc6133dc565b8085161561390957918102915b93841c93908002906138e0565b509250929050565b60008261392d575060016106d9565b8161393a575060006106d9565b8160018114613950576002811461395a57613976565b60019150506106d9565b60ff84111561396b5761396b6133dc565b50506001821b6106d9565b5060208310610133831016604e8410600b8410161715613999575081810a6106d9565b6139a383836138db565b80600019048211156139b7576139b76133dc565b029392505050565b6000612d6b838361391e565b634e487b7160e01b600052600160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060208284031215613a3e57600080fd5b815167ffffffffffffffff811115613a5557600080fd5b8201601f81018413613a6657600080fd5b8051613a74612f4d82612f17565b818152856020838501011115613a8957600080fd5b613a9a826020830160208601612d08565b95945050505050565b600060208284031215613ab557600080fd5b8151612d6b81612c3756fe6101006040523480156200001257600080fd5b5060405162001b6638038062001b6683398101604081905262000035916200028d565b82826003620000458382620003a1565b506004620000548282620003a1565b50503360c0525060ff811660e052466080819052620000739062000080565b60a052506200046d915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620000ad6200012e565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6060600380546200013f9062000312565b80601f01602080910402602001604051908101604052809291908181526020018280546200016d9062000312565b8015620001be5780601f106200019257610100808354040283529160200191620001be565b820191906000526020600020905b815481529060010190602001808311620001a057829003601f168201915b5050505050905090565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f057600080fd5b81516001600160401b03808211156200020d576200020d620001c8565b604051601f8301601f19908116603f01168101908282118183101715620002385762000238620001c8565b816040528381526020925086838588010111156200025557600080fd5b600091505b838210156200027957858201830151818301840152908201906200025a565b600093810190920192909252949350505050565b600080600060608486031215620002a357600080fd5b83516001600160401b0380821115620002bb57600080fd5b620002c987838801620001de565b94506020860151915080821115620002e057600080fd5b50620002ef86828701620001de565b925050604084015160ff811681146200030757600080fd5b809150509250925092565b600181811c908216806200032757607f821691505b6020821081036200034857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200039c57600081815260208120601f850160051c81016020861015620003775750805b601f850160051c820191505b81811015620003985782815560010162000383565b5050505b505050565b81516001600160401b03811115620003bd57620003bd620001c8565b620003d581620003ce845462000312565b846200034e565b602080601f8311600181146200040d5760008415620003f45750858301515b600019600386901b1c1916600185901b17855562000398565b600085815260208120601f198616915b828110156200043e578886015182559484019460019091019084016200041d565b50858210156200045d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e0516116aa620004bc6000396000610237015260008181610307015281816105c001526106a70152600061053a015260008181610379015261050401526116aa6000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806370a08231116100d8578063a457c2d71161008c578063d505accf11610066578063d505accf1461039b578063dd62ed3e146103ae578063ffa1ad74146103f457600080fd5b8063a457c2d71461034e578063a9059cbb14610361578063cd0d00961461037457600080fd5b806395d89b41116100bd57806395d89b41146102e75780639dc29fac146102ef578063a3c573eb1461030257600080fd5b806370a08231146102915780637ecebe00146102c757600080fd5b806330adf81f1161012f5780633644e515116101145780633644e51514610261578063395093511461026957806340c10f191461027c57600080fd5b806330adf81f14610209578063313ce5671461023057600080fd5b806318160ddd1161016057806318160ddd146101bd57806320606b70146101cf57806323b872dd146101f657600080fd5b806306fdde031461017c578063095ea7b31461019a575b600080fd5b610184610430565b60405161019191906113e4565b60405180910390f35b6101ad6101a8366004611479565b6104c2565b6040519015158152602001610191565b6002545b604051908152602001610191565b6101c17f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6101ad6102043660046114a3565b6104dc565b6101c17f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610191565b6101c1610500565b6101ad610277366004611479565b61055c565b61028f61028a366004611479565b6105a8565b005b6101c161029f3660046114df565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101c16102d53660046114df565b60056020526000908152604090205481565b610184610680565b61028f6102fd366004611479565b61068f565b6103297f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610191565b6101ad61035c366004611479565b61075e565b6101ad61036f366004611479565b61082f565b6101c17f000000000000000000000000000000000000000000000000000000000000000081565b61028f6103a9366004611501565b61083d565b6101c16103bc366004611574565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101846040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525081565b60606003805461043f906115a7565b80601f016020809104026020016040519081016040528092919081815260200182805461046b906115a7565b80156104b85780601f1061048d576101008083540402835291602001916104b8565b820191906000526020600020905b81548152906001019060200180831161049b57829003601f168201915b5050505050905090565b6000336104d0818585610b73565b60019150505b92915050565b6000336104ea858285610d27565b6104f5858585610dfe565b506001949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614610537576105324661106d565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906104d090829086906105a3908790611629565b610b73565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d4272696467650000000000000000000000000000000060648201526084015b60405180910390fd5b61067c8282611135565b5050565b60606004805461043f906115a7565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d427269646765000000000000000000000000000000006064820152608401610669565b61067c8282611228565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610822576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610669565b6104f58286868403610b73565b6000336104d0818585610dfe565b834211156108cc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6b656e577261707065643a3a7065726d69743a204578706972656420706560448201527f726d6974000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8716600090815260056020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a9190866109268361163c565b9091555060408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610991610500565b6040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281019190915260428101839052606201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa158015610a55573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590610ad057508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b610b5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546f6b656e577261707065643a3a7065726d69743a20496e76616c696420736960448201527f676e6174757265000000000000000000000000000000000000000000000000006064820152608401610669565b610b678a8a8a610b73565b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8316610c15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8216610cb8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610df85781811015610deb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610669565b610df88484848403610b73565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610ea1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8216610f44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610ffa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610df8565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611098610430565b8051602091820120604080518082018252600181527f310000000000000000000000000000000000000000000000000000000000000090840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b73ffffffffffffffffffffffffffffffffffffffff82166111b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610669565b80600260008282546111c49190611629565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff82166112cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015611381576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610d1a565b600060208083528351808285015260005b81811015611411578581018301518582016040015282016113f5565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461147457600080fd5b919050565b6000806040838503121561148c57600080fd5b61149583611450565b946020939093013593505050565b6000806000606084860312156114b857600080fd5b6114c184611450565b92506114cf60208501611450565b9150604084013590509250925092565b6000602082840312156114f157600080fd5b6114fa82611450565b9392505050565b600080600080600080600060e0888a03121561151c57600080fd5b61152588611450565b965061153360208901611450565b95506040880135945060608801359350608088013560ff8116811461155757600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561158757600080fd5b61159083611450565b915061159e60208401611450565b90509250929050565b600181811c908216806115bb57607f821691505b6020821081036115f4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156104d6576104d66115fa565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361166d5761166d6115fa565b506001019056fea26469706673582212208d88fee561cff7120d381c345cfc534cef8229a272dc5809d4bbb685ad67141164736f6c63430008110033a264697066735822122082405b2b21a65efc74f67ed80924b72065405d6bcd7505ac13b3280304fa253264736f6c63430008140033", +} + +// UlxlyABI is the input ABI used to generate the binding from. +// Deprecated: Use UlxlyMetaData.ABI instead. +var UlxlyABI = UlxlyMetaData.ABI + +// UlxlyBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use UlxlyMetaData.Bin instead. +var UlxlyBin = UlxlyMetaData.Bin + +// DeployUlxly deploys a new Ethereum contract, binding an instance of Ulxly to it. +func DeployUlxly(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Ulxly, error) { + parsed, err := UlxlyMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(UlxlyBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Ulxly{UlxlyCaller: UlxlyCaller{contract: contract}, UlxlyTransactor: UlxlyTransactor{contract: contract}, UlxlyFilterer: UlxlyFilterer{contract: contract}}, nil +} + +// Ulxly is an auto generated Go binding around an Ethereum contract. +type Ulxly struct { + UlxlyCaller // Read-only binding to the contract + UlxlyTransactor // Write-only binding to the contract + UlxlyFilterer // Log filterer for contract events +} + +// UlxlyCaller is an auto generated read-only Go binding around an Ethereum contract. +type UlxlyCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// UlxlyTransactor is an auto generated write-only Go binding around an Ethereum contract. +type UlxlyTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// UlxlyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type UlxlyFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// UlxlySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type UlxlySession struct { + Contract *Ulxly // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// UlxlyCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type UlxlyCallerSession struct { + Contract *UlxlyCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// UlxlyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type UlxlyTransactorSession struct { + Contract *UlxlyTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// UlxlyRaw is an auto generated low-level Go binding around an Ethereum contract. +type UlxlyRaw struct { + Contract *Ulxly // Generic contract binding to access the raw methods on +} + +// UlxlyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type UlxlyCallerRaw struct { + Contract *UlxlyCaller // Generic read-only contract binding to access the raw methods on +} + +// UlxlyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type UlxlyTransactorRaw struct { + Contract *UlxlyTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewUlxly creates a new instance of Ulxly, bound to a specific deployed contract. +func NewUlxly(address common.Address, backend bind.ContractBackend) (*Ulxly, error) { + contract, err := bindUlxly(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Ulxly{UlxlyCaller: UlxlyCaller{contract: contract}, UlxlyTransactor: UlxlyTransactor{contract: contract}, UlxlyFilterer: UlxlyFilterer{contract: contract}}, nil +} + +// NewUlxlyCaller creates a new read-only instance of Ulxly, bound to a specific deployed contract. +func NewUlxlyCaller(address common.Address, caller bind.ContractCaller) (*UlxlyCaller, error) { + contract, err := bindUlxly(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &UlxlyCaller{contract: contract}, nil +} + +// NewUlxlyTransactor creates a new write-only instance of Ulxly, bound to a specific deployed contract. +func NewUlxlyTransactor(address common.Address, transactor bind.ContractTransactor) (*UlxlyTransactor, error) { + contract, err := bindUlxly(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &UlxlyTransactor{contract: contract}, nil +} + +// NewUlxlyFilterer creates a new log filterer instance of Ulxly, bound to a specific deployed contract. +func NewUlxlyFilterer(address common.Address, filterer bind.ContractFilterer) (*UlxlyFilterer, error) { + contract, err := bindUlxly(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &UlxlyFilterer{contract: contract}, nil +} + +// bindUlxly binds a generic wrapper to an already deployed contract. +func bindUlxly(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := UlxlyMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Ulxly *UlxlyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Ulxly.Contract.UlxlyCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Ulxly *UlxlyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Ulxly.Contract.UlxlyTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Ulxly *UlxlyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Ulxly.Contract.UlxlyTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Ulxly *UlxlyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Ulxly.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Ulxly *UlxlyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Ulxly.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Ulxly *UlxlyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Ulxly.Contract.contract.Transact(opts, method, params...) +} + +// BASEINITBYTECODEWRAPPEDTOKEN is a free data retrieval call binding the contract method 0x83c43a55. +// +// Solidity: function BASE_INIT_BYTECODE_WRAPPED_TOKEN() view returns(bytes) +func (_Ulxly *UlxlyCaller) BASEINITBYTECODEWRAPPEDTOKEN(opts *bind.CallOpts) ([]byte, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "BASE_INIT_BYTECODE_WRAPPED_TOKEN") + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// BASEINITBYTECODEWRAPPEDTOKEN is a free data retrieval call binding the contract method 0x83c43a55. +// +// Solidity: function BASE_INIT_BYTECODE_WRAPPED_TOKEN() view returns(bytes) +func (_Ulxly *UlxlySession) BASEINITBYTECODEWRAPPEDTOKEN() ([]byte, error) { + return _Ulxly.Contract.BASEINITBYTECODEWRAPPEDTOKEN(&_Ulxly.CallOpts) +} + +// BASEINITBYTECODEWRAPPEDTOKEN is a free data retrieval call binding the contract method 0x83c43a55. +// +// Solidity: function BASE_INIT_BYTECODE_WRAPPED_TOKEN() view returns(bytes) +func (_Ulxly *UlxlyCallerSession) BASEINITBYTECODEWRAPPEDTOKEN() ([]byte, error) { + return _Ulxly.Contract.BASEINITBYTECODEWRAPPEDTOKEN(&_Ulxly.CallOpts) +} + +// WETHToken is a free data retrieval call binding the contract method 0x4b2f336d. +// +// Solidity: function WETHToken() view returns(address) +func (_Ulxly *UlxlyCaller) WETHToken(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "WETHToken") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// WETHToken is a free data retrieval call binding the contract method 0x4b2f336d. +// +// Solidity: function WETHToken() view returns(address) +func (_Ulxly *UlxlySession) WETHToken() (common.Address, error) { + return _Ulxly.Contract.WETHToken(&_Ulxly.CallOpts) +} + +// WETHToken is a free data retrieval call binding the contract method 0x4b2f336d. +// +// Solidity: function WETHToken() view returns(address) +func (_Ulxly *UlxlyCallerSession) WETHToken() (common.Address, error) { + return _Ulxly.Contract.WETHToken(&_Ulxly.CallOpts) +} + +// CalculateRoot is a free data retrieval call binding the contract method 0x83f24403. +// +// Solidity: function calculateRoot(bytes32 leafHash, bytes32[32] smtProof, uint32 index) pure returns(bytes32) +func (_Ulxly *UlxlyCaller) CalculateRoot(opts *bind.CallOpts, leafHash [32]byte, smtProof [32][32]byte, index uint32) ([32]byte, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "calculateRoot", leafHash, smtProof, index) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateRoot is a free data retrieval call binding the contract method 0x83f24403. +// +// Solidity: function calculateRoot(bytes32 leafHash, bytes32[32] smtProof, uint32 index) pure returns(bytes32) +func (_Ulxly *UlxlySession) CalculateRoot(leafHash [32]byte, smtProof [32][32]byte, index uint32) ([32]byte, error) { + return _Ulxly.Contract.CalculateRoot(&_Ulxly.CallOpts, leafHash, smtProof, index) +} + +// CalculateRoot is a free data retrieval call binding the contract method 0x83f24403. +// +// Solidity: function calculateRoot(bytes32 leafHash, bytes32[32] smtProof, uint32 index) pure returns(bytes32) +func (_Ulxly *UlxlyCallerSession) CalculateRoot(leafHash [32]byte, smtProof [32][32]byte, index uint32) ([32]byte, error) { + return _Ulxly.Contract.CalculateRoot(&_Ulxly.CallOpts, leafHash, smtProof, index) +} + +// CalculateTokenWrapperAddress is a free data retrieval call binding the contract method 0x7843298b. +// +// Solidity: function calculateTokenWrapperAddress(uint32 originNetwork, address originTokenAddress, address token) view returns(address) +func (_Ulxly *UlxlyCaller) CalculateTokenWrapperAddress(opts *bind.CallOpts, originNetwork uint32, originTokenAddress common.Address, token common.Address) (common.Address, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "calculateTokenWrapperAddress", originNetwork, originTokenAddress, token) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// CalculateTokenWrapperAddress is a free data retrieval call binding the contract method 0x7843298b. +// +// Solidity: function calculateTokenWrapperAddress(uint32 originNetwork, address originTokenAddress, address token) view returns(address) +func (_Ulxly *UlxlySession) CalculateTokenWrapperAddress(originNetwork uint32, originTokenAddress common.Address, token common.Address) (common.Address, error) { + return _Ulxly.Contract.CalculateTokenWrapperAddress(&_Ulxly.CallOpts, originNetwork, originTokenAddress, token) +} + +// CalculateTokenWrapperAddress is a free data retrieval call binding the contract method 0x7843298b. +// +// Solidity: function calculateTokenWrapperAddress(uint32 originNetwork, address originTokenAddress, address token) view returns(address) +func (_Ulxly *UlxlyCallerSession) CalculateTokenWrapperAddress(originNetwork uint32, originTokenAddress common.Address, token common.Address) (common.Address, error) { + return _Ulxly.Contract.CalculateTokenWrapperAddress(&_Ulxly.CallOpts, originNetwork, originTokenAddress, token) +} + +// ClaimedBitMap is a free data retrieval call binding the contract method 0xee25560b. +// +// Solidity: function claimedBitMap(uint256 ) view returns(uint256) +func (_Ulxly *UlxlyCaller) ClaimedBitMap(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "claimedBitMap", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ClaimedBitMap is a free data retrieval call binding the contract method 0xee25560b. +// +// Solidity: function claimedBitMap(uint256 ) view returns(uint256) +func (_Ulxly *UlxlySession) ClaimedBitMap(arg0 *big.Int) (*big.Int, error) { + return _Ulxly.Contract.ClaimedBitMap(&_Ulxly.CallOpts, arg0) +} + +// ClaimedBitMap is a free data retrieval call binding the contract method 0xee25560b. +// +// Solidity: function claimedBitMap(uint256 ) view returns(uint256) +func (_Ulxly *UlxlyCallerSession) ClaimedBitMap(arg0 *big.Int) (*big.Int, error) { + return _Ulxly.Contract.ClaimedBitMap(&_Ulxly.CallOpts, arg0) +} + +// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. +// +// Solidity: function depositCount() view returns(uint256) +func (_Ulxly *UlxlyCaller) DepositCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "depositCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. +// +// Solidity: function depositCount() view returns(uint256) +func (_Ulxly *UlxlySession) DepositCount() (*big.Int, error) { + return _Ulxly.Contract.DepositCount(&_Ulxly.CallOpts) +} + +// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. +// +// Solidity: function depositCount() view returns(uint256) +func (_Ulxly *UlxlyCallerSession) DepositCount() (*big.Int, error) { + return _Ulxly.Contract.DepositCount(&_Ulxly.CallOpts) +} + +// GasTokenAddress is a free data retrieval call binding the contract method 0x3c351e10. +// +// Solidity: function gasTokenAddress() view returns(address) +func (_Ulxly *UlxlyCaller) GasTokenAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "gasTokenAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GasTokenAddress is a free data retrieval call binding the contract method 0x3c351e10. +// +// Solidity: function gasTokenAddress() view returns(address) +func (_Ulxly *UlxlySession) GasTokenAddress() (common.Address, error) { + return _Ulxly.Contract.GasTokenAddress(&_Ulxly.CallOpts) +} + +// GasTokenAddress is a free data retrieval call binding the contract method 0x3c351e10. +// +// Solidity: function gasTokenAddress() view returns(address) +func (_Ulxly *UlxlyCallerSession) GasTokenAddress() (common.Address, error) { + return _Ulxly.Contract.GasTokenAddress(&_Ulxly.CallOpts) +} + +// GasTokenMetadata is a free data retrieval call binding the contract method 0x27aef4e8. +// +// Solidity: function gasTokenMetadata() view returns(bytes) +func (_Ulxly *UlxlyCaller) GasTokenMetadata(opts *bind.CallOpts) ([]byte, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "gasTokenMetadata") + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// GasTokenMetadata is a free data retrieval call binding the contract method 0x27aef4e8. +// +// Solidity: function gasTokenMetadata() view returns(bytes) +func (_Ulxly *UlxlySession) GasTokenMetadata() ([]byte, error) { + return _Ulxly.Contract.GasTokenMetadata(&_Ulxly.CallOpts) +} + +// GasTokenMetadata is a free data retrieval call binding the contract method 0x27aef4e8. +// +// Solidity: function gasTokenMetadata() view returns(bytes) +func (_Ulxly *UlxlyCallerSession) GasTokenMetadata() ([]byte, error) { + return _Ulxly.Contract.GasTokenMetadata(&_Ulxly.CallOpts) +} + +// GasTokenNetwork is a free data retrieval call binding the contract method 0x3cbc795b. +// +// Solidity: function gasTokenNetwork() view returns(uint32) +func (_Ulxly *UlxlyCaller) GasTokenNetwork(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "gasTokenNetwork") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// GasTokenNetwork is a free data retrieval call binding the contract method 0x3cbc795b. +// +// Solidity: function gasTokenNetwork() view returns(uint32) +func (_Ulxly *UlxlySession) GasTokenNetwork() (uint32, error) { + return _Ulxly.Contract.GasTokenNetwork(&_Ulxly.CallOpts) +} + +// GasTokenNetwork is a free data retrieval call binding the contract method 0x3cbc795b. +// +// Solidity: function gasTokenNetwork() view returns(uint32) +func (_Ulxly *UlxlyCallerSession) GasTokenNetwork() (uint32, error) { + return _Ulxly.Contract.GasTokenNetwork(&_Ulxly.CallOpts) +} + +// GetLeafValue is a free data retrieval call binding the contract method 0x3e197043. +// +// Solidity: function getLeafValue(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes32 metadataHash) pure returns(bytes32) +func (_Ulxly *UlxlyCaller) GetLeafValue(opts *bind.CallOpts, leafType uint8, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadataHash [32]byte) ([32]byte, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "getLeafValue", leafType, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadataHash) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetLeafValue is a free data retrieval call binding the contract method 0x3e197043. +// +// Solidity: function getLeafValue(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes32 metadataHash) pure returns(bytes32) +func (_Ulxly *UlxlySession) GetLeafValue(leafType uint8, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadataHash [32]byte) ([32]byte, error) { + return _Ulxly.Contract.GetLeafValue(&_Ulxly.CallOpts, leafType, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadataHash) +} + +// GetLeafValue is a free data retrieval call binding the contract method 0x3e197043. +// +// Solidity: function getLeafValue(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes32 metadataHash) pure returns(bytes32) +func (_Ulxly *UlxlyCallerSession) GetLeafValue(leafType uint8, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadataHash [32]byte) ([32]byte, error) { + return _Ulxly.Contract.GetLeafValue(&_Ulxly.CallOpts, leafType, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadataHash) +} + +// GetRoot is a free data retrieval call binding the contract method 0x5ca1e165. +// +// Solidity: function getRoot() view returns(bytes32) +func (_Ulxly *UlxlyCaller) GetRoot(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "getRoot") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetRoot is a free data retrieval call binding the contract method 0x5ca1e165. +// +// Solidity: function getRoot() view returns(bytes32) +func (_Ulxly *UlxlySession) GetRoot() ([32]byte, error) { + return _Ulxly.Contract.GetRoot(&_Ulxly.CallOpts) +} + +// GetRoot is a free data retrieval call binding the contract method 0x5ca1e165. +// +// Solidity: function getRoot() view returns(bytes32) +func (_Ulxly *UlxlyCallerSession) GetRoot() ([32]byte, error) { + return _Ulxly.Contract.GetRoot(&_Ulxly.CallOpts) +} + +// GetTokenMetadata is a free data retrieval call binding the contract method 0xc00f14ab. +// +// Solidity: function getTokenMetadata(address token) view returns(bytes) +func (_Ulxly *UlxlyCaller) GetTokenMetadata(opts *bind.CallOpts, token common.Address) ([]byte, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "getTokenMetadata", token) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// GetTokenMetadata is a free data retrieval call binding the contract method 0xc00f14ab. +// +// Solidity: function getTokenMetadata(address token) view returns(bytes) +func (_Ulxly *UlxlySession) GetTokenMetadata(token common.Address) ([]byte, error) { + return _Ulxly.Contract.GetTokenMetadata(&_Ulxly.CallOpts, token) +} + +// GetTokenMetadata is a free data retrieval call binding the contract method 0xc00f14ab. +// +// Solidity: function getTokenMetadata(address token) view returns(bytes) +func (_Ulxly *UlxlyCallerSession) GetTokenMetadata(token common.Address) ([]byte, error) { + return _Ulxly.Contract.GetTokenMetadata(&_Ulxly.CallOpts, token) +} + +// GetTokenWrappedAddress is a free data retrieval call binding the contract method 0x22e95f2c. +// +// Solidity: function getTokenWrappedAddress(uint32 originNetwork, address originTokenAddress) view returns(address) +func (_Ulxly *UlxlyCaller) GetTokenWrappedAddress(opts *bind.CallOpts, originNetwork uint32, originTokenAddress common.Address) (common.Address, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "getTokenWrappedAddress", originNetwork, originTokenAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetTokenWrappedAddress is a free data retrieval call binding the contract method 0x22e95f2c. +// +// Solidity: function getTokenWrappedAddress(uint32 originNetwork, address originTokenAddress) view returns(address) +func (_Ulxly *UlxlySession) GetTokenWrappedAddress(originNetwork uint32, originTokenAddress common.Address) (common.Address, error) { + return _Ulxly.Contract.GetTokenWrappedAddress(&_Ulxly.CallOpts, originNetwork, originTokenAddress) +} + +// GetTokenWrappedAddress is a free data retrieval call binding the contract method 0x22e95f2c. +// +// Solidity: function getTokenWrappedAddress(uint32 originNetwork, address originTokenAddress) view returns(address) +func (_Ulxly *UlxlyCallerSession) GetTokenWrappedAddress(originNetwork uint32, originTokenAddress common.Address) (common.Address, error) { + return _Ulxly.Contract.GetTokenWrappedAddress(&_Ulxly.CallOpts, originNetwork, originTokenAddress) +} + +// GlobalExitRootManager is a free data retrieval call binding the contract method 0xd02103ca. +// +// Solidity: function globalExitRootManager() view returns(address) +func (_Ulxly *UlxlyCaller) GlobalExitRootManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "globalExitRootManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GlobalExitRootManager is a free data retrieval call binding the contract method 0xd02103ca. +// +// Solidity: function globalExitRootManager() view returns(address) +func (_Ulxly *UlxlySession) GlobalExitRootManager() (common.Address, error) { + return _Ulxly.Contract.GlobalExitRootManager(&_Ulxly.CallOpts) +} + +// GlobalExitRootManager is a free data retrieval call binding the contract method 0xd02103ca. +// +// Solidity: function globalExitRootManager() view returns(address) +func (_Ulxly *UlxlyCallerSession) GlobalExitRootManager() (common.Address, error) { + return _Ulxly.Contract.GlobalExitRootManager(&_Ulxly.CallOpts) +} + +// IsClaimed is a free data retrieval call binding the contract method 0xcc461632. +// +// Solidity: function isClaimed(uint32 leafIndex, uint32 sourceBridgeNetwork) view returns(bool) +func (_Ulxly *UlxlyCaller) IsClaimed(opts *bind.CallOpts, leafIndex uint32, sourceBridgeNetwork uint32) (bool, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "isClaimed", leafIndex, sourceBridgeNetwork) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsClaimed is a free data retrieval call binding the contract method 0xcc461632. +// +// Solidity: function isClaimed(uint32 leafIndex, uint32 sourceBridgeNetwork) view returns(bool) +func (_Ulxly *UlxlySession) IsClaimed(leafIndex uint32, sourceBridgeNetwork uint32) (bool, error) { + return _Ulxly.Contract.IsClaimed(&_Ulxly.CallOpts, leafIndex, sourceBridgeNetwork) +} + +// IsClaimed is a free data retrieval call binding the contract method 0xcc461632. +// +// Solidity: function isClaimed(uint32 leafIndex, uint32 sourceBridgeNetwork) view returns(bool) +func (_Ulxly *UlxlyCallerSession) IsClaimed(leafIndex uint32, sourceBridgeNetwork uint32) (bool, error) { + return _Ulxly.Contract.IsClaimed(&_Ulxly.CallOpts, leafIndex, sourceBridgeNetwork) +} + +// IsEmergencyState is a free data retrieval call binding the contract method 0x15064c96. +// +// Solidity: function isEmergencyState() view returns(bool) +func (_Ulxly *UlxlyCaller) IsEmergencyState(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "isEmergencyState") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsEmergencyState is a free data retrieval call binding the contract method 0x15064c96. +// +// Solidity: function isEmergencyState() view returns(bool) +func (_Ulxly *UlxlySession) IsEmergencyState() (bool, error) { + return _Ulxly.Contract.IsEmergencyState(&_Ulxly.CallOpts) +} + +// IsEmergencyState is a free data retrieval call binding the contract method 0x15064c96. +// +// Solidity: function isEmergencyState() view returns(bool) +func (_Ulxly *UlxlyCallerSession) IsEmergencyState() (bool, error) { + return _Ulxly.Contract.IsEmergencyState(&_Ulxly.CallOpts) +} + +// LastUpdatedDepositCount is a free data retrieval call binding the contract method 0xbe5831c7. +// +// Solidity: function lastUpdatedDepositCount() view returns(uint32) +func (_Ulxly *UlxlyCaller) LastUpdatedDepositCount(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "lastUpdatedDepositCount") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// LastUpdatedDepositCount is a free data retrieval call binding the contract method 0xbe5831c7. +// +// Solidity: function lastUpdatedDepositCount() view returns(uint32) +func (_Ulxly *UlxlySession) LastUpdatedDepositCount() (uint32, error) { + return _Ulxly.Contract.LastUpdatedDepositCount(&_Ulxly.CallOpts) +} + +// LastUpdatedDepositCount is a free data retrieval call binding the contract method 0xbe5831c7. +// +// Solidity: function lastUpdatedDepositCount() view returns(uint32) +func (_Ulxly *UlxlyCallerSession) LastUpdatedDepositCount() (uint32, error) { + return _Ulxly.Contract.LastUpdatedDepositCount(&_Ulxly.CallOpts) +} + +// NetworkID is a free data retrieval call binding the contract method 0xbab161bf. +// +// Solidity: function networkID() view returns(uint32) +func (_Ulxly *UlxlyCaller) NetworkID(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "networkID") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// NetworkID is a free data retrieval call binding the contract method 0xbab161bf. +// +// Solidity: function networkID() view returns(uint32) +func (_Ulxly *UlxlySession) NetworkID() (uint32, error) { + return _Ulxly.Contract.NetworkID(&_Ulxly.CallOpts) +} + +// NetworkID is a free data retrieval call binding the contract method 0xbab161bf. +// +// Solidity: function networkID() view returns(uint32) +func (_Ulxly *UlxlyCallerSession) NetworkID() (uint32, error) { + return _Ulxly.Contract.NetworkID(&_Ulxly.CallOpts) +} + +// PolygonRollupManager is a free data retrieval call binding the contract method 0x8ed7e3f2. +// +// Solidity: function polygonRollupManager() view returns(address) +func (_Ulxly *UlxlyCaller) PolygonRollupManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "polygonRollupManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PolygonRollupManager is a free data retrieval call binding the contract method 0x8ed7e3f2. +// +// Solidity: function polygonRollupManager() view returns(address) +func (_Ulxly *UlxlySession) PolygonRollupManager() (common.Address, error) { + return _Ulxly.Contract.PolygonRollupManager(&_Ulxly.CallOpts) +} + +// PolygonRollupManager is a free data retrieval call binding the contract method 0x8ed7e3f2. +// +// Solidity: function polygonRollupManager() view returns(address) +func (_Ulxly *UlxlyCallerSession) PolygonRollupManager() (common.Address, error) { + return _Ulxly.Contract.PolygonRollupManager(&_Ulxly.CallOpts) +} + +// PrecalculatedWrapperAddress is a free data retrieval call binding the contract method 0xaaa13cc2. +// +// Solidity: function precalculatedWrapperAddress(uint32 originNetwork, address originTokenAddress, string name, string symbol, uint8 decimals) view returns(address) +func (_Ulxly *UlxlyCaller) PrecalculatedWrapperAddress(opts *bind.CallOpts, originNetwork uint32, originTokenAddress common.Address, name string, symbol string, decimals uint8) (common.Address, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "precalculatedWrapperAddress", originNetwork, originTokenAddress, name, symbol, decimals) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PrecalculatedWrapperAddress is a free data retrieval call binding the contract method 0xaaa13cc2. +// +// Solidity: function precalculatedWrapperAddress(uint32 originNetwork, address originTokenAddress, string name, string symbol, uint8 decimals) view returns(address) +func (_Ulxly *UlxlySession) PrecalculatedWrapperAddress(originNetwork uint32, originTokenAddress common.Address, name string, symbol string, decimals uint8) (common.Address, error) { + return _Ulxly.Contract.PrecalculatedWrapperAddress(&_Ulxly.CallOpts, originNetwork, originTokenAddress, name, symbol, decimals) +} + +// PrecalculatedWrapperAddress is a free data retrieval call binding the contract method 0xaaa13cc2. +// +// Solidity: function precalculatedWrapperAddress(uint32 originNetwork, address originTokenAddress, string name, string symbol, uint8 decimals) view returns(address) +func (_Ulxly *UlxlyCallerSession) PrecalculatedWrapperAddress(originNetwork uint32, originTokenAddress common.Address, name string, symbol string, decimals uint8) (common.Address, error) { + return _Ulxly.Contract.PrecalculatedWrapperAddress(&_Ulxly.CallOpts, originNetwork, originTokenAddress, name, symbol, decimals) +} + +// TokenInfoToWrappedToken is a free data retrieval call binding the contract method 0x81b1c174. +// +// Solidity: function tokenInfoToWrappedToken(bytes32 ) view returns(address) +func (_Ulxly *UlxlyCaller) TokenInfoToWrappedToken(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "tokenInfoToWrappedToken", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// TokenInfoToWrappedToken is a free data retrieval call binding the contract method 0x81b1c174. +// +// Solidity: function tokenInfoToWrappedToken(bytes32 ) view returns(address) +func (_Ulxly *UlxlySession) TokenInfoToWrappedToken(arg0 [32]byte) (common.Address, error) { + return _Ulxly.Contract.TokenInfoToWrappedToken(&_Ulxly.CallOpts, arg0) +} + +// TokenInfoToWrappedToken is a free data retrieval call binding the contract method 0x81b1c174. +// +// Solidity: function tokenInfoToWrappedToken(bytes32 ) view returns(address) +func (_Ulxly *UlxlyCallerSession) TokenInfoToWrappedToken(arg0 [32]byte) (common.Address, error) { + return _Ulxly.Contract.TokenInfoToWrappedToken(&_Ulxly.CallOpts, arg0) +} + +// VerifyMerkleProof is a free data retrieval call binding the contract method 0xfb570834. +// +// Solidity: function verifyMerkleProof(bytes32 leafHash, bytes32[32] smtProof, uint32 index, bytes32 root) pure returns(bool) +func (_Ulxly *UlxlyCaller) VerifyMerkleProof(opts *bind.CallOpts, leafHash [32]byte, smtProof [32][32]byte, index uint32, root [32]byte) (bool, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "verifyMerkleProof", leafHash, smtProof, index, root) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// VerifyMerkleProof is a free data retrieval call binding the contract method 0xfb570834. +// +// Solidity: function verifyMerkleProof(bytes32 leafHash, bytes32[32] smtProof, uint32 index, bytes32 root) pure returns(bool) +func (_Ulxly *UlxlySession) VerifyMerkleProof(leafHash [32]byte, smtProof [32][32]byte, index uint32, root [32]byte) (bool, error) { + return _Ulxly.Contract.VerifyMerkleProof(&_Ulxly.CallOpts, leafHash, smtProof, index, root) +} + +// VerifyMerkleProof is a free data retrieval call binding the contract method 0xfb570834. +// +// Solidity: function verifyMerkleProof(bytes32 leafHash, bytes32[32] smtProof, uint32 index, bytes32 root) pure returns(bool) +func (_Ulxly *UlxlyCallerSession) VerifyMerkleProof(leafHash [32]byte, smtProof [32][32]byte, index uint32, root [32]byte) (bool, error) { + return _Ulxly.Contract.VerifyMerkleProof(&_Ulxly.CallOpts, leafHash, smtProof, index, root) +} + +// WrappedTokenToTokenInfo is a free data retrieval call binding the contract method 0x318aee3d. +// +// Solidity: function wrappedTokenToTokenInfo(address ) view returns(uint32 originNetwork, address originTokenAddress) +func (_Ulxly *UlxlyCaller) WrappedTokenToTokenInfo(opts *bind.CallOpts, arg0 common.Address) (struct { + OriginNetwork uint32 + OriginTokenAddress common.Address +}, error) { + var out []interface{} + err := _Ulxly.contract.Call(opts, &out, "wrappedTokenToTokenInfo", arg0) + + outstruct := new(struct { + OriginNetwork uint32 + OriginTokenAddress common.Address + }) + if err != nil { + return *outstruct, err + } + + outstruct.OriginNetwork = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.OriginTokenAddress = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + + return *outstruct, err + +} + +// WrappedTokenToTokenInfo is a free data retrieval call binding the contract method 0x318aee3d. +// +// Solidity: function wrappedTokenToTokenInfo(address ) view returns(uint32 originNetwork, address originTokenAddress) +func (_Ulxly *UlxlySession) WrappedTokenToTokenInfo(arg0 common.Address) (struct { + OriginNetwork uint32 + OriginTokenAddress common.Address +}, error) { + return _Ulxly.Contract.WrappedTokenToTokenInfo(&_Ulxly.CallOpts, arg0) +} + +// WrappedTokenToTokenInfo is a free data retrieval call binding the contract method 0x318aee3d. +// +// Solidity: function wrappedTokenToTokenInfo(address ) view returns(uint32 originNetwork, address originTokenAddress) +func (_Ulxly *UlxlyCallerSession) WrappedTokenToTokenInfo(arg0 common.Address) (struct { + OriginNetwork uint32 + OriginTokenAddress common.Address +}, error) { + return _Ulxly.Contract.WrappedTokenToTokenInfo(&_Ulxly.CallOpts, arg0) +} + +// ActivateEmergencyState is a paid mutator transaction binding the contract method 0x2072f6c5. +// +// Solidity: function activateEmergencyState() returns() +func (_Ulxly *UlxlyTransactor) ActivateEmergencyState(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Ulxly.contract.Transact(opts, "activateEmergencyState") +} + +// ActivateEmergencyState is a paid mutator transaction binding the contract method 0x2072f6c5. +// +// Solidity: function activateEmergencyState() returns() +func (_Ulxly *UlxlySession) ActivateEmergencyState() (*types.Transaction, error) { + return _Ulxly.Contract.ActivateEmergencyState(&_Ulxly.TransactOpts) +} + +// ActivateEmergencyState is a paid mutator transaction binding the contract method 0x2072f6c5. +// +// Solidity: function activateEmergencyState() returns() +func (_Ulxly *UlxlyTransactorSession) ActivateEmergencyState() (*types.Transaction, error) { + return _Ulxly.Contract.ActivateEmergencyState(&_Ulxly.TransactOpts) +} + +// BridgeAsset is a paid mutator transaction binding the contract method 0xcd586579. +// +// Solidity: function bridgeAsset(uint32 destinationNetwork, address destinationAddress, uint256 amount, address token, bool forceUpdateGlobalExitRoot, bytes permitData) payable returns() +func (_Ulxly *UlxlyTransactor) BridgeAsset(opts *bind.TransactOpts, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, token common.Address, forceUpdateGlobalExitRoot bool, permitData []byte) (*types.Transaction, error) { + return _Ulxly.contract.Transact(opts, "bridgeAsset", destinationNetwork, destinationAddress, amount, token, forceUpdateGlobalExitRoot, permitData) +} + +// BridgeAsset is a paid mutator transaction binding the contract method 0xcd586579. +// +// Solidity: function bridgeAsset(uint32 destinationNetwork, address destinationAddress, uint256 amount, address token, bool forceUpdateGlobalExitRoot, bytes permitData) payable returns() +func (_Ulxly *UlxlySession) BridgeAsset(destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, token common.Address, forceUpdateGlobalExitRoot bool, permitData []byte) (*types.Transaction, error) { + return _Ulxly.Contract.BridgeAsset(&_Ulxly.TransactOpts, destinationNetwork, destinationAddress, amount, token, forceUpdateGlobalExitRoot, permitData) +} + +// BridgeAsset is a paid mutator transaction binding the contract method 0xcd586579. +// +// Solidity: function bridgeAsset(uint32 destinationNetwork, address destinationAddress, uint256 amount, address token, bool forceUpdateGlobalExitRoot, bytes permitData) payable returns() +func (_Ulxly *UlxlyTransactorSession) BridgeAsset(destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, token common.Address, forceUpdateGlobalExitRoot bool, permitData []byte) (*types.Transaction, error) { + return _Ulxly.Contract.BridgeAsset(&_Ulxly.TransactOpts, destinationNetwork, destinationAddress, amount, token, forceUpdateGlobalExitRoot, permitData) +} + +// BridgeMessage is a paid mutator transaction binding the contract method 0x240ff378. +// +// Solidity: function bridgeMessage(uint32 destinationNetwork, address destinationAddress, bool forceUpdateGlobalExitRoot, bytes metadata) payable returns() +func (_Ulxly *UlxlyTransactor) BridgeMessage(opts *bind.TransactOpts, destinationNetwork uint32, destinationAddress common.Address, forceUpdateGlobalExitRoot bool, metadata []byte) (*types.Transaction, error) { + return _Ulxly.contract.Transact(opts, "bridgeMessage", destinationNetwork, destinationAddress, forceUpdateGlobalExitRoot, metadata) +} + +// BridgeMessage is a paid mutator transaction binding the contract method 0x240ff378. +// +// Solidity: function bridgeMessage(uint32 destinationNetwork, address destinationAddress, bool forceUpdateGlobalExitRoot, bytes metadata) payable returns() +func (_Ulxly *UlxlySession) BridgeMessage(destinationNetwork uint32, destinationAddress common.Address, forceUpdateGlobalExitRoot bool, metadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.BridgeMessage(&_Ulxly.TransactOpts, destinationNetwork, destinationAddress, forceUpdateGlobalExitRoot, metadata) +} + +// BridgeMessage is a paid mutator transaction binding the contract method 0x240ff378. +// +// Solidity: function bridgeMessage(uint32 destinationNetwork, address destinationAddress, bool forceUpdateGlobalExitRoot, bytes metadata) payable returns() +func (_Ulxly *UlxlyTransactorSession) BridgeMessage(destinationNetwork uint32, destinationAddress common.Address, forceUpdateGlobalExitRoot bool, metadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.BridgeMessage(&_Ulxly.TransactOpts, destinationNetwork, destinationAddress, forceUpdateGlobalExitRoot, metadata) +} + +// BridgeMessageWETH is a paid mutator transaction binding the contract method 0xb8b284d0. +// +// Solidity: function bridgeMessageWETH(uint32 destinationNetwork, address destinationAddress, uint256 amountWETH, bool forceUpdateGlobalExitRoot, bytes metadata) returns() +func (_Ulxly *UlxlyTransactor) BridgeMessageWETH(opts *bind.TransactOpts, destinationNetwork uint32, destinationAddress common.Address, amountWETH *big.Int, forceUpdateGlobalExitRoot bool, metadata []byte) (*types.Transaction, error) { + return _Ulxly.contract.Transact(opts, "bridgeMessageWETH", destinationNetwork, destinationAddress, amountWETH, forceUpdateGlobalExitRoot, metadata) +} + +// BridgeMessageWETH is a paid mutator transaction binding the contract method 0xb8b284d0. +// +// Solidity: function bridgeMessageWETH(uint32 destinationNetwork, address destinationAddress, uint256 amountWETH, bool forceUpdateGlobalExitRoot, bytes metadata) returns() +func (_Ulxly *UlxlySession) BridgeMessageWETH(destinationNetwork uint32, destinationAddress common.Address, amountWETH *big.Int, forceUpdateGlobalExitRoot bool, metadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.BridgeMessageWETH(&_Ulxly.TransactOpts, destinationNetwork, destinationAddress, amountWETH, forceUpdateGlobalExitRoot, metadata) +} + +// BridgeMessageWETH is a paid mutator transaction binding the contract method 0xb8b284d0. +// +// Solidity: function bridgeMessageWETH(uint32 destinationNetwork, address destinationAddress, uint256 amountWETH, bool forceUpdateGlobalExitRoot, bytes metadata) returns() +func (_Ulxly *UlxlyTransactorSession) BridgeMessageWETH(destinationNetwork uint32, destinationAddress common.Address, amountWETH *big.Int, forceUpdateGlobalExitRoot bool, metadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.BridgeMessageWETH(&_Ulxly.TransactOpts, destinationNetwork, destinationAddress, amountWETH, forceUpdateGlobalExitRoot, metadata) +} + +// ClaimAsset is a paid mutator transaction binding the contract method 0xccaa2d11. +// +// Solidity: function claimAsset(bytes32[32] smtProofLocalExitRoot, bytes32[32] smtProofRollupExitRoot, uint256 globalIndex, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originTokenAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Ulxly *UlxlyTransactor) ClaimAsset(opts *bind.TransactOpts, smtProofLocalExitRoot [32][32]byte, smtProofRollupExitRoot [32][32]byte, globalIndex *big.Int, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originTokenAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Ulxly.contract.Transact(opts, "claimAsset", smtProofLocalExitRoot, smtProofRollupExitRoot, globalIndex, mainnetExitRoot, rollupExitRoot, originNetwork, originTokenAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimAsset is a paid mutator transaction binding the contract method 0xccaa2d11. +// +// Solidity: function claimAsset(bytes32[32] smtProofLocalExitRoot, bytes32[32] smtProofRollupExitRoot, uint256 globalIndex, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originTokenAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Ulxly *UlxlySession) ClaimAsset(smtProofLocalExitRoot [32][32]byte, smtProofRollupExitRoot [32][32]byte, globalIndex *big.Int, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originTokenAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.ClaimAsset(&_Ulxly.TransactOpts, smtProofLocalExitRoot, smtProofRollupExitRoot, globalIndex, mainnetExitRoot, rollupExitRoot, originNetwork, originTokenAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimAsset is a paid mutator transaction binding the contract method 0xccaa2d11. +// +// Solidity: function claimAsset(bytes32[32] smtProofLocalExitRoot, bytes32[32] smtProofRollupExitRoot, uint256 globalIndex, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originTokenAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Ulxly *UlxlyTransactorSession) ClaimAsset(smtProofLocalExitRoot [32][32]byte, smtProofRollupExitRoot [32][32]byte, globalIndex *big.Int, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originTokenAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.ClaimAsset(&_Ulxly.TransactOpts, smtProofLocalExitRoot, smtProofRollupExitRoot, globalIndex, mainnetExitRoot, rollupExitRoot, originNetwork, originTokenAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimMessage is a paid mutator transaction binding the contract method 0xf5efcd79. +// +// Solidity: function claimMessage(bytes32[32] smtProofLocalExitRoot, bytes32[32] smtProofRollupExitRoot, uint256 globalIndex, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Ulxly *UlxlyTransactor) ClaimMessage(opts *bind.TransactOpts, smtProofLocalExitRoot [32][32]byte, smtProofRollupExitRoot [32][32]byte, globalIndex *big.Int, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Ulxly.contract.Transact(opts, "claimMessage", smtProofLocalExitRoot, smtProofRollupExitRoot, globalIndex, mainnetExitRoot, rollupExitRoot, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimMessage is a paid mutator transaction binding the contract method 0xf5efcd79. +// +// Solidity: function claimMessage(bytes32[32] smtProofLocalExitRoot, bytes32[32] smtProofRollupExitRoot, uint256 globalIndex, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Ulxly *UlxlySession) ClaimMessage(smtProofLocalExitRoot [32][32]byte, smtProofRollupExitRoot [32][32]byte, globalIndex *big.Int, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.ClaimMessage(&_Ulxly.TransactOpts, smtProofLocalExitRoot, smtProofRollupExitRoot, globalIndex, mainnetExitRoot, rollupExitRoot, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// ClaimMessage is a paid mutator transaction binding the contract method 0xf5efcd79. +// +// Solidity: function claimMessage(bytes32[32] smtProofLocalExitRoot, bytes32[32] smtProofRollupExitRoot, uint256 globalIndex, bytes32 mainnetExitRoot, bytes32 rollupExitRoot, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata) returns() +func (_Ulxly *UlxlyTransactorSession) ClaimMessage(smtProofLocalExitRoot [32][32]byte, smtProofRollupExitRoot [32][32]byte, globalIndex *big.Int, mainnetExitRoot [32]byte, rollupExitRoot [32]byte, originNetwork uint32, originAddress common.Address, destinationNetwork uint32, destinationAddress common.Address, amount *big.Int, metadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.ClaimMessage(&_Ulxly.TransactOpts, smtProofLocalExitRoot, smtProofRollupExitRoot, globalIndex, mainnetExitRoot, rollupExitRoot, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadata) +} + +// DeactivateEmergencyState is a paid mutator transaction binding the contract method 0xdbc16976. +// +// Solidity: function deactivateEmergencyState() returns() +func (_Ulxly *UlxlyTransactor) DeactivateEmergencyState(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Ulxly.contract.Transact(opts, "deactivateEmergencyState") +} + +// DeactivateEmergencyState is a paid mutator transaction binding the contract method 0xdbc16976. +// +// Solidity: function deactivateEmergencyState() returns() +func (_Ulxly *UlxlySession) DeactivateEmergencyState() (*types.Transaction, error) { + return _Ulxly.Contract.DeactivateEmergencyState(&_Ulxly.TransactOpts) +} + +// DeactivateEmergencyState is a paid mutator transaction binding the contract method 0xdbc16976. +// +// Solidity: function deactivateEmergencyState() returns() +func (_Ulxly *UlxlyTransactorSession) DeactivateEmergencyState() (*types.Transaction, error) { + return _Ulxly.Contract.DeactivateEmergencyState(&_Ulxly.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0xf811bff7. +// +// Solidity: function initialize(uint32 _networkID, address _gasTokenAddress, uint32 _gasTokenNetwork, address _globalExitRootManager, address _polygonRollupManager, bytes _gasTokenMetadata) returns() +func (_Ulxly *UlxlyTransactor) Initialize(opts *bind.TransactOpts, _networkID uint32, _gasTokenAddress common.Address, _gasTokenNetwork uint32, _globalExitRootManager common.Address, _polygonRollupManager common.Address, _gasTokenMetadata []byte) (*types.Transaction, error) { + return _Ulxly.contract.Transact(opts, "initialize", _networkID, _gasTokenAddress, _gasTokenNetwork, _globalExitRootManager, _polygonRollupManager, _gasTokenMetadata) +} + +// Initialize is a paid mutator transaction binding the contract method 0xf811bff7. +// +// Solidity: function initialize(uint32 _networkID, address _gasTokenAddress, uint32 _gasTokenNetwork, address _globalExitRootManager, address _polygonRollupManager, bytes _gasTokenMetadata) returns() +func (_Ulxly *UlxlySession) Initialize(_networkID uint32, _gasTokenAddress common.Address, _gasTokenNetwork uint32, _globalExitRootManager common.Address, _polygonRollupManager common.Address, _gasTokenMetadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.Initialize(&_Ulxly.TransactOpts, _networkID, _gasTokenAddress, _gasTokenNetwork, _globalExitRootManager, _polygonRollupManager, _gasTokenMetadata) +} + +// Initialize is a paid mutator transaction binding the contract method 0xf811bff7. +// +// Solidity: function initialize(uint32 _networkID, address _gasTokenAddress, uint32 _gasTokenNetwork, address _globalExitRootManager, address _polygonRollupManager, bytes _gasTokenMetadata) returns() +func (_Ulxly *UlxlyTransactorSession) Initialize(_networkID uint32, _gasTokenAddress common.Address, _gasTokenNetwork uint32, _globalExitRootManager common.Address, _polygonRollupManager common.Address, _gasTokenMetadata []byte) (*types.Transaction, error) { + return _Ulxly.Contract.Initialize(&_Ulxly.TransactOpts, _networkID, _gasTokenAddress, _gasTokenNetwork, _globalExitRootManager, _polygonRollupManager, _gasTokenMetadata) +} + +// UpdateGlobalExitRoot is a paid mutator transaction binding the contract method 0x79e2cf97. +// +// Solidity: function updateGlobalExitRoot() returns() +func (_Ulxly *UlxlyTransactor) UpdateGlobalExitRoot(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Ulxly.contract.Transact(opts, "updateGlobalExitRoot") +} + +// UpdateGlobalExitRoot is a paid mutator transaction binding the contract method 0x79e2cf97. +// +// Solidity: function updateGlobalExitRoot() returns() +func (_Ulxly *UlxlySession) UpdateGlobalExitRoot() (*types.Transaction, error) { + return _Ulxly.Contract.UpdateGlobalExitRoot(&_Ulxly.TransactOpts) +} + +// UpdateGlobalExitRoot is a paid mutator transaction binding the contract method 0x79e2cf97. +// +// Solidity: function updateGlobalExitRoot() returns() +func (_Ulxly *UlxlyTransactorSession) UpdateGlobalExitRoot() (*types.Transaction, error) { + return _Ulxly.Contract.UpdateGlobalExitRoot(&_Ulxly.TransactOpts) +} + +// UlxlyBridgeEventIterator is returned from FilterBridgeEvent and is used to iterate over the raw logs and unpacked data for BridgeEvent events raised by the Ulxly contract. +type UlxlyBridgeEventIterator struct { + Event *UlxlyBridgeEvent // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *UlxlyBridgeEventIterator) 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(UlxlyBridgeEvent) + 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(UlxlyBridgeEvent) + 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 *UlxlyBridgeEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *UlxlyBridgeEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// UlxlyBridgeEvent represents a BridgeEvent event raised by the Ulxly contract. +type UlxlyBridgeEvent struct { + LeafType uint8 + OriginNetwork uint32 + OriginAddress common.Address + DestinationNetwork uint32 + DestinationAddress common.Address + Amount *big.Int + Metadata []byte + DepositCount uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBridgeEvent is a free log retrieval operation binding the contract event 0x501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b. +// +// Solidity: event BridgeEvent(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata, uint32 depositCount) +func (_Ulxly *UlxlyFilterer) FilterBridgeEvent(opts *bind.FilterOpts) (*UlxlyBridgeEventIterator, error) { + + logs, sub, err := _Ulxly.contract.FilterLogs(opts, "BridgeEvent") + if err != nil { + return nil, err + } + return &UlxlyBridgeEventIterator{contract: _Ulxly.contract, event: "BridgeEvent", logs: logs, sub: sub}, nil +} + +// WatchBridgeEvent is a free log subscription operation binding the contract event 0x501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b. +// +// Solidity: event BridgeEvent(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata, uint32 depositCount) +func (_Ulxly *UlxlyFilterer) WatchBridgeEvent(opts *bind.WatchOpts, sink chan<- *UlxlyBridgeEvent) (event.Subscription, error) { + + logs, sub, err := _Ulxly.contract.WatchLogs(opts, "BridgeEvent") + 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(UlxlyBridgeEvent) + if err := _Ulxly.contract.UnpackLog(event, "BridgeEvent", 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 +} + +// ParseBridgeEvent is a log parse operation binding the contract event 0x501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b. +// +// Solidity: event BridgeEvent(uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata, uint32 depositCount) +func (_Ulxly *UlxlyFilterer) ParseBridgeEvent(log types.Log) (*UlxlyBridgeEvent, error) { + event := new(UlxlyBridgeEvent) + if err := _Ulxly.contract.UnpackLog(event, "BridgeEvent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// UlxlyClaimEventIterator is returned from FilterClaimEvent and is used to iterate over the raw logs and unpacked data for ClaimEvent events raised by the Ulxly contract. +type UlxlyClaimEventIterator struct { + Event *UlxlyClaimEvent // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *UlxlyClaimEventIterator) 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(UlxlyClaimEvent) + 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(UlxlyClaimEvent) + 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 *UlxlyClaimEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *UlxlyClaimEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// UlxlyClaimEvent represents a ClaimEvent event raised by the Ulxly contract. +type UlxlyClaimEvent struct { + GlobalIndex *big.Int + OriginNetwork uint32 + OriginAddress common.Address + DestinationAddress common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterClaimEvent is a free log retrieval operation binding the contract event 0x1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d. +// +// Solidity: event ClaimEvent(uint256 globalIndex, uint32 originNetwork, address originAddress, address destinationAddress, uint256 amount) +func (_Ulxly *UlxlyFilterer) FilterClaimEvent(opts *bind.FilterOpts) (*UlxlyClaimEventIterator, error) { + + logs, sub, err := _Ulxly.contract.FilterLogs(opts, "ClaimEvent") + if err != nil { + return nil, err + } + return &UlxlyClaimEventIterator{contract: _Ulxly.contract, event: "ClaimEvent", logs: logs, sub: sub}, nil +} + +// WatchClaimEvent is a free log subscription operation binding the contract event 0x1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d. +// +// Solidity: event ClaimEvent(uint256 globalIndex, uint32 originNetwork, address originAddress, address destinationAddress, uint256 amount) +func (_Ulxly *UlxlyFilterer) WatchClaimEvent(opts *bind.WatchOpts, sink chan<- *UlxlyClaimEvent) (event.Subscription, error) { + + logs, sub, err := _Ulxly.contract.WatchLogs(opts, "ClaimEvent") + 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(UlxlyClaimEvent) + if err := _Ulxly.contract.UnpackLog(event, "ClaimEvent", 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 +} + +// ParseClaimEvent is a log parse operation binding the contract event 0x1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d. +// +// Solidity: event ClaimEvent(uint256 globalIndex, uint32 originNetwork, address originAddress, address destinationAddress, uint256 amount) +func (_Ulxly *UlxlyFilterer) ParseClaimEvent(log types.Log) (*UlxlyClaimEvent, error) { + event := new(UlxlyClaimEvent) + if err := _Ulxly.contract.UnpackLog(event, "ClaimEvent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// UlxlyEmergencyStateActivatedIterator is returned from FilterEmergencyStateActivated and is used to iterate over the raw logs and unpacked data for EmergencyStateActivated events raised by the Ulxly contract. +type UlxlyEmergencyStateActivatedIterator struct { + Event *UlxlyEmergencyStateActivated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *UlxlyEmergencyStateActivatedIterator) 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(UlxlyEmergencyStateActivated) + 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(UlxlyEmergencyStateActivated) + 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 *UlxlyEmergencyStateActivatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *UlxlyEmergencyStateActivatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// UlxlyEmergencyStateActivated represents a EmergencyStateActivated event raised by the Ulxly contract. +type UlxlyEmergencyStateActivated struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEmergencyStateActivated is a free log retrieval operation binding the contract event 0x2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a5497. +// +// Solidity: event EmergencyStateActivated() +func (_Ulxly *UlxlyFilterer) FilterEmergencyStateActivated(opts *bind.FilterOpts) (*UlxlyEmergencyStateActivatedIterator, error) { + + logs, sub, err := _Ulxly.contract.FilterLogs(opts, "EmergencyStateActivated") + if err != nil { + return nil, err + } + return &UlxlyEmergencyStateActivatedIterator{contract: _Ulxly.contract, event: "EmergencyStateActivated", logs: logs, sub: sub}, nil +} + +// WatchEmergencyStateActivated is a free log subscription operation binding the contract event 0x2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a5497. +// +// Solidity: event EmergencyStateActivated() +func (_Ulxly *UlxlyFilterer) WatchEmergencyStateActivated(opts *bind.WatchOpts, sink chan<- *UlxlyEmergencyStateActivated) (event.Subscription, error) { + + logs, sub, err := _Ulxly.contract.WatchLogs(opts, "EmergencyStateActivated") + 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(UlxlyEmergencyStateActivated) + if err := _Ulxly.contract.UnpackLog(event, "EmergencyStateActivated", 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 +} + +// ParseEmergencyStateActivated is a log parse operation binding the contract event 0x2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a5497. +// +// Solidity: event EmergencyStateActivated() +func (_Ulxly *UlxlyFilterer) ParseEmergencyStateActivated(log types.Log) (*UlxlyEmergencyStateActivated, error) { + event := new(UlxlyEmergencyStateActivated) + if err := _Ulxly.contract.UnpackLog(event, "EmergencyStateActivated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// UlxlyEmergencyStateDeactivatedIterator is returned from FilterEmergencyStateDeactivated and is used to iterate over the raw logs and unpacked data for EmergencyStateDeactivated events raised by the Ulxly contract. +type UlxlyEmergencyStateDeactivatedIterator struct { + Event *UlxlyEmergencyStateDeactivated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *UlxlyEmergencyStateDeactivatedIterator) 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(UlxlyEmergencyStateDeactivated) + 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(UlxlyEmergencyStateDeactivated) + 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 *UlxlyEmergencyStateDeactivatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *UlxlyEmergencyStateDeactivatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// UlxlyEmergencyStateDeactivated represents a EmergencyStateDeactivated event raised by the Ulxly contract. +type UlxlyEmergencyStateDeactivated struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEmergencyStateDeactivated is a free log retrieval operation binding the contract event 0x1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b3. +// +// Solidity: event EmergencyStateDeactivated() +func (_Ulxly *UlxlyFilterer) FilterEmergencyStateDeactivated(opts *bind.FilterOpts) (*UlxlyEmergencyStateDeactivatedIterator, error) { + + logs, sub, err := _Ulxly.contract.FilterLogs(opts, "EmergencyStateDeactivated") + if err != nil { + return nil, err + } + return &UlxlyEmergencyStateDeactivatedIterator{contract: _Ulxly.contract, event: "EmergencyStateDeactivated", logs: logs, sub: sub}, nil +} + +// WatchEmergencyStateDeactivated is a free log subscription operation binding the contract event 0x1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b3. +// +// Solidity: event EmergencyStateDeactivated() +func (_Ulxly *UlxlyFilterer) WatchEmergencyStateDeactivated(opts *bind.WatchOpts, sink chan<- *UlxlyEmergencyStateDeactivated) (event.Subscription, error) { + + logs, sub, err := _Ulxly.contract.WatchLogs(opts, "EmergencyStateDeactivated") + 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(UlxlyEmergencyStateDeactivated) + if err := _Ulxly.contract.UnpackLog(event, "EmergencyStateDeactivated", 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 +} + +// ParseEmergencyStateDeactivated is a log parse operation binding the contract event 0x1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b3. +// +// Solidity: event EmergencyStateDeactivated() +func (_Ulxly *UlxlyFilterer) ParseEmergencyStateDeactivated(log types.Log) (*UlxlyEmergencyStateDeactivated, error) { + event := new(UlxlyEmergencyStateDeactivated) + if err := _Ulxly.contract.UnpackLog(event, "EmergencyStateDeactivated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// UlxlyInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Ulxly contract. +type UlxlyInitializedIterator struct { + Event *UlxlyInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *UlxlyInitializedIterator) 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(UlxlyInitialized) + 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(UlxlyInitialized) + 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 *UlxlyInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *UlxlyInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// UlxlyInitialized represents a Initialized event raised by the Ulxly contract. +type UlxlyInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Ulxly *UlxlyFilterer) FilterInitialized(opts *bind.FilterOpts) (*UlxlyInitializedIterator, error) { + + logs, sub, err := _Ulxly.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &UlxlyInitializedIterator{contract: _Ulxly.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Ulxly *UlxlyFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *UlxlyInitialized) (event.Subscription, error) { + + logs, sub, err := _Ulxly.contract.WatchLogs(opts, "Initialized") + 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(UlxlyInitialized) + if err := _Ulxly.contract.UnpackLog(event, "Initialized", 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 +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Ulxly *UlxlyFilterer) ParseInitialized(log types.Log) (*UlxlyInitialized, error) { + event := new(UlxlyInitialized) + if err := _Ulxly.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// UlxlyNewWrappedTokenIterator is returned from FilterNewWrappedToken and is used to iterate over the raw logs and unpacked data for NewWrappedToken events raised by the Ulxly contract. +type UlxlyNewWrappedTokenIterator struct { + Event *UlxlyNewWrappedToken // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *UlxlyNewWrappedTokenIterator) 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(UlxlyNewWrappedToken) + 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(UlxlyNewWrappedToken) + 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 *UlxlyNewWrappedTokenIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *UlxlyNewWrappedTokenIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// UlxlyNewWrappedToken represents a NewWrappedToken event raised by the Ulxly contract. +type UlxlyNewWrappedToken struct { + OriginNetwork uint32 + OriginTokenAddress common.Address + WrappedTokenAddress common.Address + Metadata []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewWrappedToken is a free log retrieval operation binding the contract event 0x490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a39. +// +// Solidity: event NewWrappedToken(uint32 originNetwork, address originTokenAddress, address wrappedTokenAddress, bytes metadata) +func (_Ulxly *UlxlyFilterer) FilterNewWrappedToken(opts *bind.FilterOpts) (*UlxlyNewWrappedTokenIterator, error) { + + logs, sub, err := _Ulxly.contract.FilterLogs(opts, "NewWrappedToken") + if err != nil { + return nil, err + } + return &UlxlyNewWrappedTokenIterator{contract: _Ulxly.contract, event: "NewWrappedToken", logs: logs, sub: sub}, nil +} + +// WatchNewWrappedToken is a free log subscription operation binding the contract event 0x490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a39. +// +// Solidity: event NewWrappedToken(uint32 originNetwork, address originTokenAddress, address wrappedTokenAddress, bytes metadata) +func (_Ulxly *UlxlyFilterer) WatchNewWrappedToken(opts *bind.WatchOpts, sink chan<- *UlxlyNewWrappedToken) (event.Subscription, error) { + + logs, sub, err := _Ulxly.contract.WatchLogs(opts, "NewWrappedToken") + 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(UlxlyNewWrappedToken) + if err := _Ulxly.contract.UnpackLog(event, "NewWrappedToken", 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 +} + +// ParseNewWrappedToken is a log parse operation binding the contract event 0x490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a39. +// +// Solidity: event NewWrappedToken(uint32 originNetwork, address originTokenAddress, address wrappedTokenAddress, bytes metadata) +func (_Ulxly *UlxlyFilterer) ParseNewWrappedToken(log types.Log) (*UlxlyNewWrappedToken, error) { + event := new(UlxlyNewWrappedToken) + if err := _Ulxly.contract.UnpackLog(event, "NewWrappedToken", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/cmd/root.go b/cmd/root.go index 2e5ae918..b8c7f06e 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "github.com/maticnetwork/polygon-cli/cmd/ulxly" "os" "github.com/maticnetwork/polygon-cli/cmd/fork" @@ -122,6 +123,7 @@ func NewPolycliCommand() *cobra.Command { parseethwallet.ParseETHWalletCmd, rpcfuzz.RPCFuzzCmd, signer.SignerCmd, + ulxly.ULxLyCmd, version.VersionCmd, wallet.WalletCmd, ) diff --git a/cmd/ulxly/depositClaimUsage.md b/cmd/ulxly/depositClaimUsage.md new file mode 100644 index 00000000..bfe1706c --- /dev/null +++ b/cmd/ulxly/depositClaimUsage.md @@ -0,0 +1,76 @@ +This command will attempt to send a claim transaction to the bridge contract. + +```solidity + /** + * @notice Verify merkle proof and withdraw tokens/ether + * @param smtProofLocalExitRoot Smt proof to proof the leaf against the network exit root + * @param smtProofRollupExitRoot Smt proof to proof the rollupLocalExitRoot against the rollups exit root + * @param globalIndex Global index is defined as: + * | 191 bits | 1 bit | 32 bits | 32 bits | + * | 0 | mainnetFlag | rollupIndex | localRootIndex | + * note that only the rollup index will be used only in case the mainnet flag is 0 + * note that global index do not assert the unused bits to 0. + * This means that when synching the events, the globalIndex must be decoded the same way that in the Smart contract + * to avoid possible synch attacks + * @param mainnetExitRoot Mainnet exit root + * @param rollupExitRoot Rollup exit root + * @param originNetwork Origin network + * @param originTokenAddress Origin token address, 0 address is reserved for ether + * @param destinationNetwork Network destination + * @param destinationAddress Address destination + * @param amount Amount of tokens + * @param metadata Abi encoded metadata if any, empty otherwise + */ + function claimAsset( + bytes32[_DEPOSIT_CONTRACT_TREE_DEPTH] calldata smtProofLocalExitRoot, + bytes32[_DEPOSIT_CONTRACT_TREE_DEPTH] calldata smtProofRollupExitRoot, + uint256 globalIndex, + bytes32 mainnetExitRoot, + bytes32 rollupExitRoot, + uint32 originNetwork, + address originTokenAddress, + uint32 destinationNetwork, + address destinationAddress, + uint256 amount, + bytes calldata metadata + ) + +``` + +Each transaction will require manual input of parameters. Example usage: + +```bash +polycli ulxly deposit-claim \ + --bridge-address 0xD71f8F956AD979Cc2988381B8A743a2fE280537D \ + --private-key 12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625 \ + --claim-index 0 \ + --claim-address 0xE34aaF64b29273B7D567FCFc40544c014EEe9970 \ + --claim-network 0 \ + --rpc-url http://127.0.0.1:32790 \ + --bridge-service-url http://127.0.0.1:32804 +``` + +This command would use the supplied private key and attempt to send a claim transaction to the bridge contract address with the input flags. +Successful deposit transaction will output logs like below: + +```bash +Claim Transaction Successful: 0x7180201b19e1aa596503d8541137d6f341e682835bf7a54aab6422c89158866b +``` + +Upon successful claim, the transferred funds can be queried in the destination network using tools like `cast balance --rpc-url ` + + +Failed deposit transactions will output logs like below: + +```bash +Claim Transaction Failed: 0x32ac34797159c79e57ae801c350bccfe5f8105d4dd3b717e31d811397e98036a +``` + +The reason for failing may be very difficult to debug. I have personally spun up a bridge-ui and compared the byte data of a successful transaction to the byte data of a failing claim transaction queried using: + +```! +curl http://127.0.0.1:32790 \ +-X POST \ +-H "Content-Type: application/json" \ +--data '{"method":"debug_traceTransaction","params":["0x32ac34797159c79e57ae801c350bccfe5f8105d4dd3b717e31d811397e98036a", {"tracer": "callTracer"}], "id":1,"jsonrpc":"2.0"}' | jq '.' +``` diff --git a/cmd/ulxly/depositGetUsage.md b/cmd/ulxly/depositGetUsage.md new file mode 100644 index 00000000..409467fb --- /dev/null +++ b/cmd/ulxly/depositGetUsage.md @@ -0,0 +1,46 @@ +This command will attempt to scan a range of blocks and look for uLxLy +Bridge Events. This is is the specific signature that we're interested +in: + +```solidity + /** + * @dev Emitted when bridge assets or messages to another network + */ + event BridgeEvent( + uint8 leafType, + uint32 originNetwork, + address originAddress, + uint32 destinationNetwork, + address destinationAddress, + uint256 amount, + bytes metadata, + uint32 depositCount + ); + +``` + +If you're looking at the raw topics from on chain or in an explorer, this is the associated value: + +`0x501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b` + +Each event that we counter will be parsed and written as JSON to +stdout. Example usage: + +```bash +polycli ulxly deposit-get \ + --bridge-address 0x528e26b25a34a4A5d0dbDa1d57D318153d2ED582 \ + --rpc-url https://eth-sepolia.g.alchemy.com/v2/demo \ + --from-block 4880876 \ + --to-block 6028159 \ + --filter-size 9999 > cardona-4880876-to-6028159.ndjson +``` + +This command would look for bridge events from block `4880876` to +block `6028159` in increments of `9999` blocks at a time for the +contract address `0x528e26b25a34a4A5d0dbDa1d57D318153d2ED582`. The +output will be written as newline delimited JSON. + +This command is very specific for the ulxly bridge and it's meant to +serve as the input to the proof command. + + diff --git a/cmd/ulxly/depositNewUsage.md b/cmd/ulxly/depositNewUsage.md new file mode 100644 index 00000000..de9d842a --- /dev/null +++ b/cmd/ulxly/depositNewUsage.md @@ -0,0 +1,61 @@ +This command will attempt to send a deposit transaction to the bridge contract. + +```solidity + /** + * @notice Deposit add a new leaf to the merkle tree + * note If this function is called with a reentrant token, it would be possible to `claimTokens` in the same call + * Reducing the supply of tokens on this contract, and actually locking tokens in the contract. + * Therefore we recommend to third parties bridges that if they do implement reentrant call of `beforeTransfer` of some reentrant tokens + * do not call any external address in that case + * note User/UI must be aware of the existing/available networks when choosing the destination network + * @param destinationNetwork Network destination + * @param destinationAddress Address destination + * @param amount Amount of tokens + * @param token Token address, 0 address is reserved for ether + * @param forceUpdateGlobalExitRoot Indicates if the new global exit root is updated or not + * @param permitData Raw data of the call `permit` of the token + */ + function bridgeAsset( + uint32 destinationNetwork, + address destinationAddress, + uint256 amount, + address token, + bool forceUpdateGlobalExitRoot, + bytes calldata permitData + ); + +``` + +Each transaction will require manual input of parameters. Example usage: + +```bash +polycli ulxly deposit-new \ + --private-key 12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625 \ + --gas-limit 300000 \ + --amount 1000000000000000000 \ + --rpc-url http://127.0.0.1:8545 \ + --bridge-address 0xD71f8F956AD979Cc2988381B8A743a2fE280537D \ + --destination-network 1 \ + --destination-address 0xE34aaF64b29273B7D567FCFc40544c014EEe9970 +``` + +This command would use the supplied private key and attempt to send a deposit transaction to the bridge contract address with the input flags. +Successful deposit transaction will output logs like below: + +```bash +Deposit Transaction Successful: 0x8c9b82e8abdfb4aad5fccd91879397acfa73e4261282c8dc634734d05ad889d3 +``` + +Upon successful deposit, the transaction can be queried using `polycli ulxly deposit-get` command + + +Failed deposit transactions will output logs like below: + +```bash +Deposit Transaction Failed: 0x60385209b0e9db359c24c88c2fb8a5c9e4628fffe8d5fb2b5e64dfac3a2b7639 +Try increasing the gas limit: +Current gas limit: 100000 +Cumulative gas used for transaction: 98641 +``` + +The reason for failing may likely be due to the `out of gas` error. Increasing the `--gas-limit` flag value will likely resolve this. diff --git a/cmd/ulxly/proofUsage.md b/cmd/ulxly/proofUsage.md new file mode 100644 index 00000000..3b493530 --- /dev/null +++ b/cmd/ulxly/proofUsage.md @@ -0,0 +1,72 @@ +This command will attempt to create a merkle proof based on the bridge +events that are provided. + +Example usage: + +```bash +polycli ulxly proof \ + --file-name cardona-4880876-to-6028159.ndjson \ + --deposit-number 24386 | jq '.' +``` + +In this case we are assuming we have a file +`cardona-4880876-to-6028159.ndjson` that would have been generated +with a call to `polycli ulxly deposits`. The output will be the +sibling hashes necessary to prove inclusion of deposit `24386`. + +This is a real verifiable deposit if you'd like to sanity check: + +- Deposit Transaction: https://sepolia.etherscan.io/tx/0x1f950d076ad534fe588bd6a8f58904395c907df4738f92bd8aea513c19d1fa5f +- Mainnet Root: `4516CA2A793B8E20F56EC6BA8CA6033A672330670A3772F76F2ADE9BC2125150` +- Actual Claim Tx: https://cardona-zkevm.polygonscan.com/tx/0x5d4fbaca896f015801f1049b383932eaa9363d344c36b1c51e5f2e3ce20f9dc3 + +This is the proof response from polycli: + +```json +{ + "Siblings": [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x18dd49d4ac3b31a6468446597686e7164bfb88a09685d3cd31f8f4b0b91e7d86", + "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", + "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", + "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", + "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", + "0x3822fc0c89d0438d84cb8b41b6a9eecd5d9d369ce5022b6d0817d96e695fca08", + "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", + "0xd1f352a4bd8bdd17b172d7a39c2406672c4644a624fd3c5ac30111cb716c6a79", + "0x8549075281f6770dc405ba232aa39c16992a441b2e88b01742a35bb949cb4e54", + "0xec88c2530a54d444e5212e08a65c5b7ee7ce34ef0acd31e1eb2c1ab5aa91772b", + "0x9b2bc070d68635596a9e3cefef6c5c7530751b415fe63cfa3c01de5d8253379c", + "0x25e2d43e7f5545a5808a41875dc6485c4bd9e2df61396b682685d00a00ca1e88", + "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", + "0x893f7fe87020f40c2edd5239c1b4be2f16862adb151deea1e379b33f35ce8bd3", + "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", + "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", + "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", + "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", + "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", + "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", + "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", + "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", + "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", + "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", + "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", + "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", + "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", + "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", + "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", + "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", + "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" + ], + "Root": "0x4516ca2a793b8e20f56ec6ba8ca6033a672330670a3772f76f2ade9bc2125150", + "DepositCount": 24386, + "LeafHash": "0x2c42c143213fd0e36d843d9d40866ce7be02c671beec0eae3ffd3d2638acc87c" +} +``` + +![Sample Tree](./tree-diagram.png) + +When we're creating the proof here, we're essentially storing all of +the paths to the various leafs. When we want to generate a proof, we +essentially find the appropriate sibling node in the tree to prove +that the leaf is part of the given merkle root. diff --git a/cmd/ulxly/tree-diagram.png b/cmd/ulxly/tree-diagram.png new file mode 100644 index 00000000..a6674dc5 Binary files /dev/null and b/cmd/ulxly/tree-diagram.png differ diff --git a/cmd/ulxly/tree-diagram.tex b/cmd/ulxly/tree-diagram.tex new file mode 100755 index 00000000..40d8cc53 --- /dev/null +++ b/cmd/ulxly/tree-diagram.tex @@ -0,0 +1,218 @@ +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage{tikz, pgfplots} +\usepackage[landscape,margin=1in]{geometry} +\usetikzlibrary{positioning,shapes,fit} + +% GNOME HIG Blue Palette +\definecolor{blue1}{RGB}{153, 193, 241} +\definecolor{blue2}{RGB}{98, 160, 234} +\definecolor{blue3}{RGB}{53, 132, 228} +\definecolor{blue4}{RGB}{28, 113, 216} +\definecolor{blue5}{RGB}{26, 95, 180} + +% GNOME HIG Green Palette +\definecolor{green1}{RGB}{143, 240, 164} +\definecolor{green2}{RGB}{87, 227, 137} +\definecolor{green3}{RGB}{51, 209, 122} +\definecolor{green4}{RGB}{46, 194, 126} +\definecolor{green5}{RGB}{38, 162, 105} + +% GNOME HIG Yellow Palette +\definecolor{yellow1}{RGB}{249, 240, 107} +\definecolor{yellow2}{RGB}{248, 228, 92} +\definecolor{yellow3}{RGB}{246, 211, 45} +\definecolor{yellow4}{RGB}{245, 194, 17} +\definecolor{yellow5}{RGB}{229, 165, 10} + +% GNOME HIG Orange Palette +\definecolor{orange1}{RGB}{255, 190, 111} +\definecolor{orange2}{RGB}{255, 163, 72} +\definecolor{orange3}{RGB}{255, 120, 0} +\definecolor{orange4}{RGB}{230, 97, 0} +\definecolor{orange5}{RGB}{198, 70, 0} + +% GNOME HIG Red Palette +\definecolor{red1}{RGB}{246, 97, 81} +\definecolor{red2}{RGB}{237, 51, 59} +\definecolor{red3}{RGB}{224, 27, 36} +\definecolor{red4}{RGB}{192, 28, 40} +\definecolor{red5}{RGB}{165, 29, 45} + +% GNOME HIG Purple Palette +\definecolor{purple1}{RGB}{220, 138, 221} +\definecolor{purple2}{RGB}{192, 97, 203} +\definecolor{purple3}{RGB}{145, 65, 172} +\definecolor{purple4}{RGB}{129, 61, 156} +\definecolor{purple5}{RGB}{97, 53, 131} + +% GNOME HIG Brown Palette +\definecolor{brown1}{RGB}{205, 171, 143} +\definecolor{brown2}{RGB}{181, 131, 90} +\definecolor{brown3}{RGB}{152, 106, 68} +\definecolor{brown4}{RGB}{134, 94, 60} +\definecolor{brown5}{RGB}{99, 69, 44} + +% GNOME HIG Light Palette +\definecolor{light1}{RGB}{255, 255, 255} +\definecolor{light2}{RGB}{246, 245, 244} +\definecolor{light3}{RGB}{222, 221, 218} +\definecolor{light4}{RGB}{192, 191, 188} +\definecolor{light5}{RGB}{154, 153, 150} + +% GNOME HIG Dark Palette +\definecolor{dark1}{RGB}{119, 118, 123} +\definecolor{dark2}{RGB}{94, 92, 100} +\definecolor{dark3}{RGB}{61, 56, 70} +\definecolor{dark4}{RGB}{36, 31, 49} +\definecolor{dark5}{RGB}{0, 0, 0} + + +\begin{document} + +\begin{center} + \begin{tikzpicture}[ + intermediate-node/.style={rectangle, draw=yellow5, fill=yellow1, minimum width=0.25in, minimum height=0.25in}, + root-node/.style={rectangle, draw=green5, fill=green1, minimum width=0.25in, minimum height=0.25in}, + leaf-node/.style={rectangle, draw=purple5, fill=purple1, minimum width=0.25in, minimum height=0.25in}, + bin-value/.style={rectangle}, + level/.style={rectangle}, + ] + + \begin{scope}[transform canvas={scale=0.70}] + + \node[root-node](root0){$H(H(H(H(H(0),H(1)),H(H(2),H(3))),H(H(H(4),H(5)),H(H(6),H(7)))),H(H(H(H(8),H(9)),H(H(10),H(11))),H(H(H(12),H(13)),H(H(14),H(15)))))$}; + + \node[intermediate-node](b-0-abcdefgh)[below left=1in and -3.75in of root0]{$H(H(H(H(0),H(1)),H(H(2),H(3))),H(H(H(4),H(5)),H(H(6),H(7))))$}; + \node[intermediate-node](b-0-ijklmnop)[below right=1in and -3.75in of root0]{$H(H(H(H(8),H(9)),H(H(10),H(11))),H(H(H(12),H(13)),H(H(14),H(15))))$}; + + \node[intermediate-node](b-0-abcd)[below left=1.0in and -1.75in of b-0-abcdefgh]{$H(H(H(0),H(1)),H(H(2),H(3)))$}; + \node[intermediate-node](b-0-efgh)[below right=1.0in and -1.75in of b-0-abcdefgh]{$H(H(H(4),H(5)),H(H(6),H(7)))$}; + \node[intermediate-node](b-0-ijkl)[below left=1.0in and -1.75in of b-0-ijklmnop]{$H(H(H(8),H(9)),H(H(10),H(11)))$}; + \node[intermediate-node](b-0-mnop)[below right=1.0in and -1.75in of b-0-ijklmnop]{$H(H(H(12),H(13)),H(H(14),H(15)))$}; + + \node[intermediate-node](b-0-ab)[below left=1.0in and -0.75in of b-0-abcd]{$H(H(0),H(1))$}; + \node[intermediate-node](b-0-cd)[below right=1.0in and -0.75in of b-0-abcd]{$H(H(2),H(3))$}; + \node[intermediate-node](b-0-ef)[below left=1.0in and -0.75in of b-0-efgh]{$H(H(4),H(5))$}; + \node[intermediate-node](b-0-gh)[below right=1.0in and -0.75in of b-0-efgh]{$H(H(6),H(7))$}; + \node[intermediate-node](b-0-ij)[below left=1.0in and -0.75in of b-0-ijkl]{$H(H(8),H(9))$}; + \node[intermediate-node](b-0-kl)[below right=1.0in and -0.75in of b-0-ijkl]{$H(H(10),H(11))$}; + \node[intermediate-node](b-0-mn)[below left=1.0in and -0.75in of b-0-mnop]{$H(H(12),H(13))$}; + \node[intermediate-node](b-0-op)[below right=1.0in and -0.75in of b-0-mnop]{$H(H(14),H(15))$}; + + \node[intermediate-node](l-0-0)[below left=1.0in and -0.30in of b-0-ab]{$H(0)$}; + \node[intermediate-node](l-0-1)[below right=1.0in and -0.30in of b-0-ab]{$H(1)$}; + \node[intermediate-node](l-0-2)[below left=1.0in and -0.30in of b-0-cd]{$H(2)$}; + \node[intermediate-node](l-0-3)[below right=1.0in and -0.30in of b-0-cd]{$H(3)$}; + \node[intermediate-node](l-0-4)[below left=1.0in and -0.30in of b-0-ef]{$H(4)$}; + \node[intermediate-node](l-0-5)[below right=1.0in and -0.30in of b-0-ef]{$H(5)$}; + \node[intermediate-node](l-0-6)[below left=1.0in and -0.30in of b-0-gh]{$H(6)$}; + \node[intermediate-node](l-0-7)[below right=1.0in and -0.30in of b-0-gh]{$H(7)$}; + \node[intermediate-node](l-0-8)[below left=1.0in and -0.30in of b-0-ij]{$H(8)$}; + \node[intermediate-node](l-0-9)[below right=1.0in and -0.30in of b-0-ij]{$H(9)$}; + \node[intermediate-node](l-0-10)[below left=1.0in and -0.30in of b-0-kl]{$H(10)$}; + \node[intermediate-node](l-0-11)[below right=1.0in and -0.30in of b-0-kl]{$H(11)$}; + \node[intermediate-node](l-0-12)[below left=1.0in and -0.30in of b-0-mn]{$H(12)$}; + \node[intermediate-node](l-0-13)[below right=1.0in and -0.30in of b-0-mn]{$H(13)$}; + \node[intermediate-node](l-0-14)[below left=1.0in and -0.30in of b-0-op]{$H(14)$}; + \node[intermediate-node](l-0-15)[below right=1.0in and -0.30in of b-0-op]{$H(15)$}; + + \node[leaf-node](l-1-0)[below=0.5in of l-0-0]{$0$}; + \node[leaf-node](l-1-1)[below=0.5in of l-0-1]{$1$}; + \node[leaf-node](l-1-2)[below=0.5in of l-0-2]{$2$}; + \node[leaf-node](l-1-3)[below=0.5in of l-0-3]{$3$}; + \node[leaf-node](l-1-4)[below=0.5in of l-0-4]{$4$}; + \node[leaf-node](l-1-5)[below=0.5in of l-0-5]{$5$}; + \node[leaf-node](l-1-6)[below=0.5in of l-0-6]{$6$}; + \node[leaf-node](l-1-7)[below=0.5in of l-0-7]{$7$}; + \node[leaf-node](l-1-8)[below=0.5in of l-0-8]{$8$}; + \node[leaf-node](l-1-9)[below=0.5in of l-0-9]{$9$}; + \node[leaf-node](l-1-10)[below=0.5in of l-0-10]{$10$}; + \node[leaf-node](l-1-11)[below=0.5in of l-0-11]{$11$}; + \node[leaf-node](l-1-12)[below=0.5in of l-0-12]{$12$}; + \node[leaf-node](l-1-13)[below=0.5in of l-0-13]{$13$}; + \node[leaf-node](l-1-14)[below=0.5in of l-0-14]{$14$}; + \node[leaf-node](l-1-15)[below=0.5in of l-0-15]{$15$}; + + \node[bin-value](l-2-0)[below=0.25in of l-1-0]{\texttt{0000}}; + \node[bin-value](l-2-1)[below=0.25in of l-1-1]{\texttt{0001}}; + \node[bin-value](l-2-2)[below=0.25in of l-1-2]{\texttt{0010}}; + \node[bin-value](l-2-3)[below=0.25in of l-1-3]{\texttt{0011}}; + \node[bin-value](l-2-4)[below=0.25in of l-1-4]{\texttt{0100}}; + \node[bin-value](l-2-5)[below=0.25in of l-1-5]{\texttt{0101}}; + \node[bin-value](l-2-6)[below=0.25in of l-1-6]{\texttt{0110}}; + \node[bin-value](l-2-7)[below=0.25in of l-1-7]{\texttt{0111}}; + \node[bin-value](l-2-8)[below=0.25in of l-1-8]{\texttt{1000}}; + \node[bin-value](l-2-9)[below=0.25in of l-1-9]{\texttt{1001}}; + \node[bin-value](l-2-10)[below=0.25in of l-1-10]{\texttt{1010}}; + \node[bin-value](l-2-11)[below=0.25in of l-1-11]{\texttt{1011}}; + \node[bin-value](l-2-12)[below=0.25in of l-1-12]{\texttt{1100}}; + \node[bin-value](l-2-13)[below=0.25in of l-1-13]{\texttt{1101}}; + \node[bin-value](l-2-14)[below=0.25in of l-1-14]{\texttt{1110}}; + \node[bin-value](l-2-15)[below=0.25in of l-1-15]{\texttt{1111}}; + + \node[level](level-0)[left=0.5in of l-0-0]{Level 0 - $2^4$}; + \node[level](level-1)[above=1.05in of level-0]{Level 1 - $2^3$}; + \node[level](level-2)[above=1.05in of level-1]{Level 2 - $2^2$}; + \node[level](level-3)[above=1.05in of level-2]{Level 3 - $2^1$}; + \node[level](level-4)[above=1.05in of level-3]{Level 4 - $2^0$}; + \node[level](leaf-value)[below=0.6in of level-0]{Leaf}; + + \draw[-] (root0) to node [midway] {0} (b-0-abcdefgh) ; + \draw[-] (root0) to node [midway] {1} (b-0-ijklmnop); + + \draw[-] (b-0-abcdefgh) to node [midway] {0} (b-0-abcd); + \draw[-] (b-0-abcdefgh) to node [midway] {1} (b-0-efgh); + \draw[-] (b-0-ijklmnop) to node [midway] {0} (b-0-ijkl); + \draw[-] (b-0-ijklmnop) to node [midway] {1} (b-0-mnop); + + \draw[-] (b-0-abcd) to node [midway] {0} (b-0-ab); + \draw[-] (b-0-abcd) to node [midway] {1} (b-0-cd); + \draw[-] (b-0-efgh) to node [midway] {0} (b-0-ef); + \draw[-] (b-0-efgh) to node [midway] {1} (b-0-gh); + \draw[-] (b-0-ijkl) to node [midway] {0} (b-0-ij); + \draw[-] (b-0-ijkl) to node [midway] {1} (b-0-kl); + \draw[-] (b-0-mnop) to node [midway] {0} (b-0-mn); + \draw[-] (b-0-mnop) to node [midway] {1} (b-0-op); + + \draw[-] (b-0-ab) to node [midway] {0} (l-0-0); + \draw[-] (b-0-ab) to node [midway] {1} (l-0-1); + \draw[-] (b-0-cd) to node [midway] {0} (l-0-2); + \draw[-] (b-0-cd) to node [midway] {1} (l-0-3); + \draw[-] (b-0-ef) to node [midway] {0} (l-0-4); + \draw[-] (b-0-ef) to node [midway] {1} (l-0-5); + \draw[-] (b-0-gh) to node [midway] {0} (l-0-6); + \draw[-] (b-0-gh) to node [midway] {1} (l-0-7); + \draw[-] (b-0-ij) to node [midway] {0} (l-0-8); + \draw[-] (b-0-ij) to node [midway] {1} (l-0-9); + \draw[-] (b-0-kl) to node [midway] {0} (l-0-10); + \draw[-] (b-0-kl) to node [midway] {1} (l-0-11); + \draw[-] (b-0-mn) to node [midway] {0} (l-0-12); + \draw[-] (b-0-mn) to node [midway] {1} (l-0-13); + \draw[-] (b-0-op) to node [midway] {0} (l-0-14); + \draw[-] (b-0-op) to node [midway] {1} (l-0-15); + + \draw[-] (l-0-0) to (l-1-0); + \draw[-] (l-0-1) to (l-1-1); + \draw[-] (l-0-2) to (l-1-2); + \draw[-] (l-0-3) to (l-1-3); + \draw[-] (l-0-4) to (l-1-4); + \draw[-] (l-0-5) to (l-1-5); + \draw[-] (l-0-6) to (l-1-6); + \draw[-] (l-0-7) to (l-1-7); + \draw[-] (l-0-8) to (l-1-8); + \draw[-] (l-0-9) to (l-1-9); + \draw[-] (l-0-10) to (l-1-10); + \draw[-] (l-0-11) to (l-1-11); + \draw[-] (l-0-12) to (l-1-12); + \draw[-] (l-0-13) to (l-1-13); + \draw[-] (l-0-14) to (l-1-14); + \draw[-] (l-0-15) to (l-1-15); + + \end{scope} + + \end{tikzpicture} + +\end{center} + +\end{document} diff --git a/cmd/ulxly/ulxly.go b/cmd/ulxly/ulxly.go new file mode 100644 index 00000000..e91022af --- /dev/null +++ b/cmd/ulxly/ulxly.go @@ -0,0 +1,929 @@ +package ulxly + +import ( + "bufio" + "bytes" + "context" + "crypto/ecdsa" + _ "embed" + "encoding/binary" + "encoding/json" + "errors" + "fmt" + "io" + "math/big" + "net/http" + "os" + "strconv" + "strings" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + ethclient "github.com/ethereum/go-ethereum/ethclient" + ethrpc "github.com/ethereum/go-ethereum/rpc" + + "github.com/maticnetwork/polygon-cli/bindings/ulxly" + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" +) + +const ( + // TreeDepth of 32 is pulled directly from the + // _DEPOSIT_CONTRACT_TREE_DEPTH from the smart contract. We + // could make this a variable as well + // https://github.com/0xPolygonHermez/zkevm-contracts/blob/54f58c8b64806429bc4d5c52248f29cf80ba401c/contracts/v2/lib/DepositContractBase.sol#L15 + TreeDepth = 32 +) + +type uLxLyArgs struct { + FromBlock *uint64 + ToBlock *uint64 + RPCURL *string + BridgeAddress *string + FilterSize *uint64 + + ClaimIndex *string + ClaimAddress *string + ClaimOriginNetwork *string + ClaimDestinationNetwork *string + BridgeServiceRPCURL *string + ClaimRPCURL *string + ClaimPrivateKey *string + ClaimBridgeAddress *string + ClaimGasLimit *uint64 + ClaimChainID *string + ClaimTimeoutTxnReceipt *uint32 + ClaimMessage *bool + ClaimWETH *bool + + InputFileName *string + DepositNum *uint32 + DepositPrivateKey *string + DepositGasLimit *uint64 + Amount *int64 // HACK: This should be big.Int but depositNewCmd.PersistentFlags() doesn't support that type. + DestinationNetwork *uint32 + DestinationAddress *string + DepositRPCURL *string + DepositBridgeAddress *string + DepositChainID *string + TokenAddress *string + IsForced *bool + CallData *string + DepositTimeoutTxnReceipt *uint32 + DepositMessage *bool + DepositWETH *bool +} + +type IMT struct { + Branches map[uint32][]common.Hash + Leaves map[uint32]common.Hash + Roots []common.Hash + ZeroHashes []common.Hash + Proofs map[uint32]Proof +} + +type Proof struct { + Siblings [TreeDepth]common.Hash + Root common.Hash + DepositCount uint32 + LeafHash common.Hash +} + +type BridgeProof struct { + Proof struct { + MerkleProof []string `json:"merkle_proof"` + RollupMerkleProof []string `json:"rollup_merkle_proof"` + MainExitRoot string `json:"main_exit_root"` + RollupExitRoot string `json:"rollup_exit_root"` + } `json:"proof"` +} + +type BridgeDeposits struct { + Deposit []struct { + LeafType int `json:"leaf_type"` + OrigNet int `json:"orig_net"` + OrigAddr string `json:"orig_addr"` + Amount string `json:"amount"` + DestNet int `json:"dest_net"` + DestAddr string `json:"dest_addr"` + BlockNum string `json:"block_num"` + DepositCnt string `json:"deposit_cnt"` + NetworkID int `json:"network_id"` + TxHash string `json:"tx_hash"` + ClaimTxHash string `json:"claim_tx_hash"` + Metadata string `json:"metadata"` + ReadyForClaim bool `json:"ready_for_claim"` + GlobalIndex string `json:"global_index"` + } `json:"deposits"` + TotalCnt string `json:"total_cnt"` +} + +var ulxlyInputArgs uLxLyArgs + +var ULxLyCmd = &cobra.Command{ + Use: "ulxly", + Short: "Utilities for interacting with the lxly bridge", + Long: "These are low level tools for directly scanning bridge events and constructing proofs.", + Args: cobra.NoArgs, +} + +//go:embed depositGetUsage.md +var depositGetUsage string +var depositGetCmd = &cobra.Command{ + Use: "deposit-get", + Short: "Get a range of deposits", + Long: depositGetUsage, + Args: cobra.NoArgs, + PreRunE: checkGetDepositArgs, + RunE: func(cmd *cobra.Command, args []string) error { + ctx := cmd.Context() + // Dial the Ethereum RPC server. + rpc, err := ethrpc.DialContext(ctx, *ulxlyInputArgs.RPCURL) + if err != nil { + log.Error().Err(err).Msg("Unable to Dial RPC") + return err + } + defer rpc.Close() + ec := ethclient.NewClient(rpc) + + bridgeV2, err := ulxly.NewUlxly(common.HexToAddress(*ulxlyInputArgs.BridgeAddress), ec) + if err != nil { + return err + } + fromBlock := *ulxlyInputArgs.FromBlock + toBlock := *ulxlyInputArgs.ToBlock + currentBlock := fromBlock + for currentBlock < toBlock { + endBlock := currentBlock + *ulxlyInputArgs.FilterSize + if endBlock > toBlock { + endBlock = toBlock + } + + opts := bind.FilterOpts{ + Start: currentBlock, + End: &endBlock, + Context: ctx, + } + evtV2Iterator, err := bridgeV2.FilterBridgeEvent(&opts) + if err != nil { + return err + } + + for evtV2Iterator.Next() { + evt := evtV2Iterator.Event + log.Info().Uint32("deposit", evt.DepositCount).Uint64("block-number", evt.Raw.BlockNumber).Msg("Found ulxly Deposit") + var jBytes []byte + jBytes, err = json.Marshal(evt) + if err != nil { + return err + } + fmt.Println(string(jBytes)) + } + err = evtV2Iterator.Close() + if err != nil { + log.Error().Err(err).Msg("error closing event iterator") + } + currentBlock = endBlock + } + + return nil + }, +} + +//go:embed depositNewUsage.md +var depositNewUsage string +var depositNewCmd = &cobra.Command{ + Use: "deposit-new", + Short: "Make a uLxLy deposit transaction", + Long: depositNewUsage, + Args: cobra.NoArgs, + PreRunE: checkDepositArgs, + RunE: func(cmd *cobra.Command, args []string) error { + ctx := cmd.Context() + // Dial the Ethereum RPC server. + client, err := ethclient.DialContext(ctx, *ulxlyInputArgs.DepositRPCURL) + if err != nil { + log.Error().Err(err).Msg("Unable to Dial RPC") + return err + } + defer client.Close() + // Initialize and assign variables required to send transaction payload + bridgeV2, privateKey, fromAddress, gasLimit, gasPrice, toAddress, signer := generateTransactionPayload(ctx, client, *ulxlyInputArgs.DepositBridgeAddress, *ulxlyInputArgs.DepositPrivateKey, *ulxlyInputArgs.DepositGasLimit, *ulxlyInputArgs.DestinationAddress, *ulxlyInputArgs.DepositChainID) + + value := big.NewInt(*ulxlyInputArgs.Amount) + tokenAddress := common.HexToAddress(*ulxlyInputArgs.TokenAddress) + callData := common.Hex2Bytes(*ulxlyInputArgs.CallData) + + tops := &bind.TransactOpts{ + Signer: func(address common.Address, transaction *types.Transaction) (*types.Transaction, error) { + return types.SignTx(transaction, signer, privateKey) + }, + From: fromAddress, + Context: ctx, + GasLimit: gasLimit, + GasPrice: gasPrice, + GasFeeCap: nil, + GasTipCap: nil, + } + if tokenAddress == common.HexToAddress("0x0000000000000000000000000000000000000000") { + tops = &bind.TransactOpts{ + Signer: func(address common.Address, transaction *types.Transaction) (*types.Transaction, error) { + return types.SignTx(transaction, signer, privateKey) + }, + Value: value, + From: fromAddress, + Context: ctx, + GasLimit: gasLimit, + GasPrice: gasPrice, + GasFeeCap: nil, + GasTipCap: nil, + } + } + + var bridgeTxn *types.Transaction + switch { + case *ulxlyInputArgs.DepositMessage: + bridgeTxn, err = bridgeV2.BridgeMessage(tops, *ulxlyInputArgs.DestinationNetwork, toAddress, *ulxlyInputArgs.IsForced, callData) + if err != nil { + log.Error().Err(err).Msg("Unable to interact with bridge contract") + return err + } + case *ulxlyInputArgs.DepositWETH: + bridgeTxn, err = bridgeV2.BridgeMessageWETH(tops, *ulxlyInputArgs.DestinationNetwork, toAddress, value, *ulxlyInputArgs.IsForced, callData) + if err != nil { + log.Error().Err(err).Msg("Unable to interact with bridge contract") + return err + } + default: + bridgeTxn, err = bridgeV2.BridgeAsset(tops, *ulxlyInputArgs.DestinationNetwork, toAddress, value, tokenAddress, *ulxlyInputArgs.IsForced, callData) + if err != nil { + log.Error().Err(err).Msg("Unable to interact with bridge contract") + return err + } + } + + // Wait for the transaction to be mined + // TODO: Consider creating a function for this section + txnMinedTimer := time.NewTimer(time.Duration(*ulxlyInputArgs.DepositTimeoutTxnReceipt) * time.Second) + defer txnMinedTimer.Stop() + for { + select { + case <-txnMinedTimer.C: + fmt.Printf("Wait timer for transaction receipt exceeded!") + return nil + default: + r, err := client.TransactionReceipt(ctx, bridgeTxn.Hash()) + if err != nil { + if err.Error() != "not found" { + log.Error().Err(err) + return err + } + time.Sleep(1 * time.Second) + continue + } + if r.Status != 0 { + fmt.Printf("Deposit Transaction Successful: %s\n", r.TxHash) + return nil + } else if r.Status == 0 { + fmt.Printf("Deposit Transaction Failed: %s\n", r.TxHash) + fmt.Printf("Perhaps try increasing the gas limit:\n") + fmt.Printf("Current gas limit: %d\n", gasLimit) + fmt.Printf("Cumulative gas used for transaction: %d\n", r.CumulativeGasUsed) + return nil + } + time.Sleep(1 * time.Second) + } + } + }, +} + +//go:embed depositClaimUsage.md +var depositClaimUsage string +var depositClaimCmd = &cobra.Command{ + Use: "deposit-claim", + Short: "Make a uLxLy claim transaction", + Long: depositClaimUsage, + Args: cobra.NoArgs, + PreRunE: checkClaimArgs, + RunE: func(cmd *cobra.Command, args []string) error { + ctx := cmd.Context() + // Dial Ethereum client + client, err := ethclient.DialContext(ctx, *ulxlyInputArgs.ClaimRPCURL) + if err != nil { + log.Error().Err(err).Msg("Unable to Dial RPC") + return err + } + defer client.Close() + // Initialize and assign variables required to send transaction payload + bridgeV2, privateKey, fromAddress, gasLimit, gasPrice, toAddress, signer := generateTransactionPayload(ctx, client, *ulxlyInputArgs.ClaimBridgeAddress, *ulxlyInputArgs.ClaimPrivateKey, *ulxlyInputArgs.ClaimGasLimit, *ulxlyInputArgs.ClaimAddress, *ulxlyInputArgs.ClaimChainID) + + // Call the bridge service RPC URL to get the merkle proofs and exit roots and parses them to the correct formats. + bridgeServiceProofEndpoint := fmt.Sprintf("%s/merkle-proof?deposit_cnt=%s&net_id=%s", *ulxlyInputArgs.BridgeServiceRPCURL, *ulxlyInputArgs.ClaimIndex, *ulxlyInputArgs.ClaimOriginNetwork) + merkleProofArray, rollupMerkleProofArray, mainExitRoot, rollupExitRoot := getMerkleProofsExitRoots(bridgeServiceProofEndpoint) + + tops := &bind.TransactOpts{ + Signer: func(address common.Address, transaction *types.Transaction) (*types.Transaction, error) { + return types.SignTx(transaction, signer, privateKey) + }, + // Value: value, + From: fromAddress, + Context: ctx, + GasLimit: gasLimit, + GasPrice: gasPrice, + GasFeeCap: nil, + GasTipCap: nil, + } + + // Call the bridge service RPC URL to get the deposits data and parses them to the correct formats. + bridgeServiceDepositsEndpoint := fmt.Sprintf("%s/bridges/%s", *ulxlyInputArgs.BridgeServiceRPCURL, *ulxlyInputArgs.ClaimAddress) + globalIndex, originAddress, amount, metadata, err := getDeposits(bridgeServiceDepositsEndpoint) + if err != nil { + log.Error().Err(err) + return err + } + + claimOriginNetwork, _ := strconv.Atoi(*ulxlyInputArgs.ClaimOriginNetwork) // Convert ClaimOriginNetwork to int + claimDestinationNetwork, _ := strconv.Atoi(*ulxlyInputArgs.ClaimDestinationNetwork) // Convert ClaimDestinationNetwork to int + var claimTxn *types.Transaction + switch { + case *ulxlyInputArgs.ClaimMessage: + claimTxn, err = bridgeV2.ClaimMessage(tops, merkleProofArray, rollupMerkleProofArray, globalIndex, [32]byte(mainExitRoot), [32]byte(rollupExitRoot), uint32(claimOriginNetwork), originAddress, uint32(claimDestinationNetwork), toAddress, amount, metadata) + if err != nil { + log.Error().Err(err).Msg("Unable to interact with bridge contract") + return err + } + default: + claimTxn, err = bridgeV2.ClaimAsset(tops, merkleProofArray, rollupMerkleProofArray, globalIndex, [32]byte(mainExitRoot), [32]byte(rollupExitRoot), uint32(claimOriginNetwork), originAddress, uint32(claimDestinationNetwork), toAddress, amount, metadata) + if err != nil { + log.Error().Err(err).Msg("Unable to interact with bridge contract") + return err + } + } + + // Wait for the transaction to be mined + // TODO: Consider creating a function for this section + txnMinedTimer := time.NewTimer(time.Duration(*ulxlyInputArgs.ClaimTimeoutTxnReceipt) * time.Second) + defer txnMinedTimer.Stop() + for { + select { + case <-txnMinedTimer.C: + fmt.Printf("Wait timer for transaction receipt exceeded!") + return nil + default: + r, err := client.TransactionReceipt(ctx, claimTxn.Hash()) + if err != nil { + if err.Error() != "not found" { + log.Error().Err(err) + return err + } + time.Sleep(1 * time.Second) + continue + } + if r.Status != 0 { + fmt.Printf("Claim Transaction Successful: %s\n", r.TxHash) + return nil + } else if r.Status == 0 { + fmt.Printf("Claim Transaction Failed: %s\n", r.TxHash) + return nil + } + time.Sleep(1 * time.Second) + } + } + }, +} + +//go:embed proofUsage.md +var proofUsage string +var ProofCmd = &cobra.Command{ + Use: "proof", + Short: "generate a merkle proof", + Long: proofUsage, + Args: cobra.NoArgs, + PreRunE: checkProofArgs, + RunE: func(cmd *cobra.Command, args []string) error { + rawDepositData, err := getInputData(cmd, args) + if err != nil { + return err + } + return readDeposits(rawDepositData) + }, +} + +var EmptyProofCmd = &cobra.Command{ + Use: "empty-proof", + Short: "print an empty proof structure", + Long: `Use this command to print an empty proof response that's filled with +zero-valued siblings like +0x0000000000000000000000000000000000000000000000000000000000000000. This +can be useful when you need to submit a dummy proof.`, + Args: cobra.NoArgs, + PreRunE: checkProofArgs, + RunE: func(cmd *cobra.Command, args []string) error { + p := new(Proof) + + e := generateEmptyHashes(TreeDepth) + copy(p.Siblings[:], e) + fmt.Println(p.String()) + return nil + }, +} + +var ZeroProofCmd = &cobra.Command{ + Use: "zero-proof", + Short: "print a proof structure with the zero hashes", + Long: `Use this command to print a proof response that's filled with the zero +hashes. This values are very helpful for debugging because it would +tell you how populated the tree is and roughly which leaves and +siblings are empty. It's also helpful for sanity checking a proof +response to understand if the hashed value is part of the zero hashes +or if it's actually an intermediate hash.`, + Args: cobra.NoArgs, + PreRunE: checkProofArgs, + RunE: func(cmd *cobra.Command, args []string) error { + p := new(Proof) + + e := generateZeroHashes(TreeDepth) + copy(p.Siblings[:], e) + fmt.Println(p.String()) + return nil + }, +} + +func checkProofArgs(cmd *cobra.Command, args []string) error { + return nil +} +func getInputData(cmd *cobra.Command, args []string) ([]byte, error) { + if ulxlyInputArgs.InputFileName != nil && *ulxlyInputArgs.InputFileName != "" { + return os.ReadFile(*ulxlyInputArgs.InputFileName) + } + + if len(args) > 1 { + concat := strings.Join(args[1:], " ") + return []byte(concat), nil + } + + return io.ReadAll(os.Stdin) +} +func readDeposits(rawDeposits []byte) error { + buf := bytes.NewBuffer(rawDeposits) + scanner := bufio.NewScanner(buf) + imt := new(IMT) + imt.Init() + seenDeposit := make(map[uint32]common.Hash, 0) + lastDeposit := uint32(0) + for scanner.Scan() { + evt := new(ulxly.UlxlyBridgeEvent) + err := json.Unmarshal(scanner.Bytes(), evt) + if err != nil { + return err + } + if _, hasBeenSeen := seenDeposit[evt.DepositCount]; hasBeenSeen { + log.Warn().Uint32("deposit", evt.DepositCount).Str("tx-hash", evt.Raw.TxHash.String()).Msg("Skipping duplicate deposit") + continue + } + seenDeposit[evt.DepositCount] = evt.Raw.TxHash + if lastDeposit+1 != evt.DepositCount && lastDeposit != 0 { + log.Error().Uint32("missing-deposit", lastDeposit+1).Uint32("current-deposit", evt.DepositCount).Msg("Missing deposit") + return fmt.Errorf("missing deposit: %d", lastDeposit+1) + } + lastDeposit = evt.DepositCount + imt.AddLeaf(evt) + log.Info(). + Uint64("block-number", evt.Raw.BlockNumber). + Uint32("deposit-count", evt.DepositCount). + Str("tx-hash", evt.Raw.TxHash.String()). + Str("root", common.Hash(imt.Roots[len(imt.Roots)-1]).String()). + Msg("adding event to tree") + // There's no point adding more leaves if we can prove the deposit already? + if evt.DepositCount >= *ulxlyInputArgs.DepositNum { + break + } + } + + p := imt.GetProof(*ulxlyInputArgs.DepositNum) + + fmt.Println(p.String()) + return nil +} + +// String will create the json representation of the proof +func (p *Proof) String() string { + jsonBytes, err := json.Marshal(p) + if err != nil { + log.Error().Err(err).Msg("error marshalling proof to json") + return "" + } + return string(jsonBytes) + +} + +// hashDeposit create the leaf hash value for a particular deposit +func hashDeposit(deposit *ulxly.UlxlyBridgeEvent) common.Hash { + var res common.Hash + origNet := make([]byte, 4) //nolint:gomnd + binary.BigEndian.PutUint32(origNet, deposit.OriginNetwork) + destNet := make([]byte, 4) //nolint:gomnd + binary.BigEndian.PutUint32(destNet, deposit.DestinationNetwork) + var buf common.Hash + metaHash := crypto.Keccak256Hash(deposit.Metadata) + copy(res[:], crypto.Keccak256Hash([]byte{deposit.LeafType}, origNet, deposit.OriginAddress.Bytes(), destNet, deposit.DestinationAddress[:], deposit.Amount.FillBytes(buf[:]), metaHash.Bytes()).Bytes()) + return res +} + +// Init will allocate the objects in the IMT +func (s *IMT) Init() { + s.Branches = make(map[uint32][]common.Hash) + s.Leaves = make(map[uint32]common.Hash) + s.ZeroHashes = generateZeroHashes(TreeDepth) + s.Proofs = make(map[uint32]Proof) +} + +// AddLeaf will take a given deposit and add it to the collection of leaves. It will also update the +func (s *IMT) AddLeaf(deposit *ulxly.UlxlyBridgeEvent) { + leaf := hashDeposit(deposit) + log.Debug().Str("leaf-hash", common.Bytes2Hex(leaf[:])).Msg("Leaf hash calculated") + // just keep a copy of the leaf indexed by deposit count for now + s.Leaves[deposit.DepositCount] = leaf + + node := leaf + size := uint64(deposit.DepositCount) + 1 + + // copy the previous set of branches as a starting point. We're going to make copies of the branches at each deposit + branches := make([]common.Hash, TreeDepth) + if deposit.DepositCount == 0 { + branches = generateEmptyHashes(TreeDepth) + } else { + copy(branches, s.Branches[deposit.DepositCount-1]) + } + + for height := uint64(0); height < TreeDepth; height += 1 { + if ((size >> height) & 1) == 1 { + copy(branches[height][:], node[:]) + break + } + node = crypto.Keccak256Hash(branches[height][:], node[:]) + } + s.Branches[deposit.DepositCount] = branches + s.Roots = append(s.Roots, s.GetRoot(deposit.DepositCount)) +} + +// GetRoot will return the root for a particular deposit +func (s *IMT) GetRoot(depositNum uint32) common.Hash { + node := common.Hash{} + size := depositNum + 1 + currentZeroHashHeight := common.Hash{} + + for height := 0; height < TreeDepth; height++ { + if ((size >> height) & 1) == 1 { + node = crypto.Keccak256Hash(s.Branches[depositNum][height][:], node.Bytes()) + + } else { + node = crypto.Keccak256Hash(node.Bytes(), currentZeroHashHeight.Bytes()) + } + currentZeroHashHeight = crypto.Keccak256Hash(currentZeroHashHeight.Bytes(), currentZeroHashHeight.Bytes()) + } + return node +} + +// GetProof will return an object containing the proof data necessary for verification +func (s *IMT) GetProof(depositNum uint32) Proof { + node := common.Hash{} + size := depositNum + 1 + currentZeroHashHeight := common.Hash{} + + siblings := [TreeDepth]common.Hash{} + for height := 0; height < TreeDepth; height++ { + siblingDepositNum := getSiblingDepositNumber(depositNum, uint32(height)) + sibling := currentZeroHashHeight + if _, hasKey := s.Branches[siblingDepositNum]; hasKey { + sibling = s.Branches[siblingDepositNum][height] + } else { + sibling = currentZeroHashHeight + } + + log.Info().Str("sibling", sibling.String()).Msg("Proof Inputs") + siblings[height] = sibling + if ((size >> height) & 1) == 1 { + // node = keccak256(abi.encodePacked(_branch[height], node)); + node = crypto.Keccak256Hash(sibling.Bytes(), node.Bytes()) + } else { + // node = keccak256(abi.encodePacked(node, currentZeroHashHeight)); + node = crypto.Keccak256Hash(node.Bytes(), sibling.Bytes()) + } + currentZeroHashHeight = crypto.Keccak256Hash(currentZeroHashHeight.Bytes(), currentZeroHashHeight.Bytes()) + } + p := &Proof{ + Siblings: siblings, + DepositCount: depositNum, + LeafHash: s.Leaves[depositNum], + } + + r, err := p.Check(s.Roots) + if err != nil { + log.Error().Err(err).Msg("failed to validate proof") + } + p.Root = r + s.Proofs[depositNum] = *p + return *p +} + +// getSiblingDepositNumber returns the sibling number of a given number at a specified level in an incremental Merkle tree. +// +// In an incremental Merkle tree, each node has a sibling node at each level of the tree. +// The sibling node can be determined by flipping the bit at the current level and setting all bits to the right of the current level to 1. +// This function calculates the sibling number based on the deposit number and the specified level. +// +// Parameters: +// - depositNumber: the original number for which the sibling is to be found. +// - level: the level in the Merkle tree at which to find the sibling. +// +// The logic works as follows: +// 1. `1 << level` creates a binary number with a single 1 bit at the position corresponding to the level. +// 2. `depositNumber ^ (1 << level)` flips the bit at the position corresponding to the level in the depositNumber. +// 3. `(1 << level) - 1` creates a binary number with all bits to the right of the current level set to 1. +// 4. `| ((1 << level) - 1)` ensures that all bits to the right of the current level are set to 1 in the result. +// +// The function effectively finds the sibling deposit number at each level of the Merkle tree by manipulating the bits accordingly. +func getSiblingDepositNumber(depositNumber, level uint32) uint32 { + return depositNumber ^ (1 << level) | ((1 << level) - 1) +} + +// Check is a sanity check of a proof in order to make sure that the +// proof that was generated creates a root that we recognize. This was +// useful while testing in order to avoid verifying that the proof +// works or doesn't work onchain +func (p *Proof) Check(roots []common.Hash) (common.Hash, error) { + node := p.LeafHash + index := p.DepositCount + for height := 0; height < TreeDepth; height++ { + if ((index >> height) & 1) == 1 { + node = crypto.Keccak256Hash(p.Siblings[height][:], node[:]) + } else { + node = crypto.Keccak256Hash(node[:], p.Siblings[height][:]) + } + } + + isProofValid := false + for i := len(roots) - 1; i >= 0; i-- { + if roots[i].Cmp(node) == 0 { + isProofValid = true + break + } + } + + log.Info(). + Bool("is-proof-valid", isProofValid). + Uint32("deposit-count", p.DepositCount). + Str("leaf-hash", p.LeafHash.String()). + Str("checked-root", node.String()).Msg("checking proof") + if !isProofValid { + return common.Hash{}, fmt.Errorf("invalid proof") + } + + return node, nil +} + +// https://eth2book.info/capella/part2/deposits-withdrawals/contract/ +func generateZeroHashes(height uint8) []common.Hash { + zeroHashes := make([]common.Hash, height) + zeroHashes[0] = common.Hash{} + for i := 1; i < int(height); i++ { + zeroHashes[i] = crypto.Keccak256Hash(zeroHashes[i-1][:], zeroHashes[i-1][:]) + } + return zeroHashes +} + +func generateEmptyHashes(height uint8) []common.Hash { + zeroHashes := make([]common.Hash, height) + zeroHashes[0] = common.Hash{} + for i := 1; i < int(height); i++ { + zeroHashes[i] = common.Hash{} + } + return zeroHashes +} + +func generateTransactionPayload(ctx context.Context, client *ethclient.Client, ulxlyInputArgBridge string, ulxlyInputArgPvtKey string, ulxlyInputArgGasLimit uint64, ulxlyInputArgDestAddr string, ulxlyInputArgChainID string) (bridgeV2 *ulxly.Ulxly, privateKey *ecdsa.PrivateKey, fromAddress common.Address, gasLimit uint64, gasPrice *big.Int, toAddress common.Address, signer types.Signer) { + var err error + bridgeV2, err = ulxly.NewUlxly(common.HexToAddress(ulxlyInputArgBridge), client) + if err != nil { + return + } + + privateKey, err = crypto.HexToECDSA(ulxlyInputArgPvtKey) + if err != nil { + log.Error().Err(err).Msg("Unable to retrieve private key") + } + + publicKey := privateKey.Public() + publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey) + if !ok { + log.Error().Msg("Error casting public key to ECDSA") + } + + fromAddress = crypto.PubkeyToAddress(*publicKeyECDSA) + + // value := big.NewInt(*ulxlyInputArgs.Amount) + gasLimit = ulxlyInputArgGasLimit + gasPrice, err = client.SuggestGasPrice(ctx) + if err != nil { + log.Error().Err(err).Msg("Cannot get suggested gas price") + } + // gasTipCap, err := client.SuggestGasTipCap(ctx) + // if err != nil { + // log.Error().Err(err).Msg("Cannot get suggested gas tip cap") + // } + + toAddress = common.HexToAddress(ulxlyInputArgDestAddr) + + chainID := new(big.Int) + // For manual input of chainID, use the user's input + if ulxlyInputArgChainID != "" { + chainID.SetString(ulxlyInputArgChainID, 10) + } else { // If there is no user input for chainID, infer it from context + chainID, err = client.NetworkID(ctx) + if err != nil { + log.Error().Err(err).Msg("Cannot get chain ID") + return + } + } + + signer = types.LatestSignerForChainID(chainID) + + return bridgeV2, privateKey, fromAddress, gasLimit, gasPrice, toAddress, signer +} + +func getMerkleProofsExitRoots(bridgeServiceProofEndpoint string) (merkleProofArray [32][32]byte, rollupMerkleProofArray [32][32]byte, mainExitRoot []byte, rollupExitRoot []byte) { + reqBridgeProof, err := http.Get(bridgeServiceProofEndpoint) + if err != nil { + log.Error().Err(err) + return + } + bodyBridgeProof, err := io.ReadAll(reqBridgeProof.Body) // Response body is []byte + if err != nil { + log.Error().Err(err) + return + } + var bridgeProof BridgeProof + err = json.Unmarshal(bodyBridgeProof, &bridgeProof) // Parse []byte to go struct pointer, and shadow err variable + if err != nil { + log.Error().Err(err).Msg("Can not unmarshal JSON") + return + } + + merkleProof := [][32]byte{} // HACK: usage of common.Hash may be more consistent and considered best practice + rollupMerkleProof := [][32]byte{} // HACK: usage of common.Hash may be more consistent and considered best practice + + for _, mp := range bridgeProof.Proof.MerkleProof { + byteMP, _ := hexutil.Decode(mp) + merkleProof = append(merkleProof, [32]byte(byteMP)) + } + if len(merkleProof) == 0 { + log.Error().Msg("The Merkle Proofs cannot be retrieved, double check the input arguments and try again.") + return + } + merkleProofArray = [32][32]byte(merkleProof) + for _, rmp := range bridgeProof.Proof.RollupMerkleProof { + byteRMP, _ := hexutil.Decode(rmp) + rollupMerkleProof = append(rollupMerkleProof, [32]byte(byteRMP)) + } + if len(rollupMerkleProof) == 0 { + log.Error().Msg("The Rollup Merkle Proofs cannot be retrieved, double check the input arguments and try again.") + return + } + rollupMerkleProofArray = [32][32]byte(rollupMerkleProof) + + mainExitRoot, _ = hexutil.Decode(bridgeProof.Proof.MainExitRoot) + rollupExitRoot, _ = hexutil.Decode(bridgeProof.Proof.RollupExitRoot) + + defer reqBridgeProof.Body.Close() + + return merkleProofArray, rollupMerkleProofArray, mainExitRoot, rollupExitRoot +} + +func getDeposits(bridgeServiceDepositsEndpoint string) (globalIndex *big.Int, originAddress common.Address, amount *big.Int, metadata []byte, err error) { + reqBridgeDeposits, err := http.Get(bridgeServiceDepositsEndpoint) + if err != nil { + log.Error().Err(err) + return + } + bodyBridgeDeposit, err := io.ReadAll(reqBridgeDeposits.Body) // Response body is []byte + if err != nil { + log.Error().Err(err) + return + } + var bridgeDeposit BridgeDeposits + err = json.Unmarshal(bodyBridgeDeposit, &bridgeDeposit) // Parse []byte to go struct pointer, and shadow err variable + if err != nil { + log.Error().Err(err).Msg("Can not unmarshal JSON") + return + } + + globalIndex = new(big.Int) + amount = new(big.Int) + + intClaimIndex, _ := strconv.Atoi(*ulxlyInputArgs.ClaimIndex) // Convert deposit_cnt to int + for index, deposit := range bridgeDeposit.Deposit { + intDepositCnt, _ := strconv.Atoi(deposit.DepositCnt) // Convert deposit_cnt to int + if intDepositCnt == intClaimIndex { // deposit_cnt must match the user's input value + if !bridgeDeposit.Deposit[index].ReadyForClaim { + log.Error().Msg("The claim transaction is not yet ready to be claimed. Try again in a few blocks.") + return nil, common.HexToAddress("0x0"), nil, nil, errors.New("The claim transaction is not yet ready to be claimed. Try again in a few blocks.") + } else if bridgeDeposit.Deposit[index].ClaimTxHash != "" { + fmt.Printf("The claim transaction has already been claimed at %s.", bridgeDeposit.Deposit[index].ClaimTxHash) + return nil, common.HexToAddress("0x0"), nil, nil, errors.New("The claim transaction has already been claimed.") + } + originAddress = common.HexToAddress(bridgeDeposit.Deposit[index].OrigAddr) + globalIndex.SetString(bridgeDeposit.Deposit[index].GlobalIndex, 10) + amount.SetString(bridgeDeposit.Deposit[index].Amount, 10) + metadata = common.Hex2Bytes(bridgeDeposit.Deposit[index].Metadata) + return globalIndex, originAddress, amount, metadata, nil + } + } + defer reqBridgeDeposits.Body.Close() + + return nil, common.HexToAddress("0x0"), nil, nil, errors.New("Failed to correctly get deposits...") +} + +func checkGetDepositArgs(cmd *cobra.Command, args []string) error { + if *ulxlyInputArgs.BridgeAddress == "" { + return fmt.Errorf("please provide the bridge address") + } + if *ulxlyInputArgs.FromBlock > *ulxlyInputArgs.ToBlock { + return fmt.Errorf("the from block should be less than the to block") + } + return nil +} + +func checkDepositArgs(cmd *cobra.Command, args []string) error { + if *ulxlyInputArgs.DepositBridgeAddress == "" { + return fmt.Errorf("please provide the bridge address") + } + if *ulxlyInputArgs.DepositGasLimit < 130000 && *ulxlyInputArgs.DepositGasLimit != 0 { + return fmt.Errorf("the gas limit may be too low for the transaction to pass") + } + if *ulxlyInputArgs.DepositMessage && *ulxlyInputArgs.DepositWETH { + return fmt.Errorf("choose a single deposit mode (asset, message, or WETH)") + } + return nil +} + +func checkClaimArgs(cmd *cobra.Command, args []string) error { + if *ulxlyInputArgs.ClaimGasLimit < 150000 && *ulxlyInputArgs.ClaimGasLimit != 0 { + return fmt.Errorf("the gas limit may be too low for the transaction to pass") + } + if *ulxlyInputArgs.ClaimMessage && *ulxlyInputArgs.ClaimWETH { + return fmt.Errorf("choose a single claim mode (asset, message, or WETH)") + } + return nil +} + +func init() { + ULxLyCmd.AddCommand(depositClaimCmd) + ULxLyCmd.AddCommand(depositNewCmd) + ULxLyCmd.AddCommand(depositGetCmd) + ULxLyCmd.AddCommand(ProofCmd) + ULxLyCmd.AddCommand(EmptyProofCmd) + ULxLyCmd.AddCommand(ZeroProofCmd) + + ulxlyInputArgs.ClaimIndex = depositClaimCmd.PersistentFlags().String("claim-index", "0", "The deposit count, or index to initiate a claim transaction for.") + ulxlyInputArgs.ClaimAddress = depositClaimCmd.PersistentFlags().String("claim-address", "", "The address that is receiving the bridged asset.") + ulxlyInputArgs.ClaimOriginNetwork = depositClaimCmd.PersistentFlags().String("origin-network", "0", "The network ID of the origin network.") + ulxlyInputArgs.ClaimDestinationNetwork = depositClaimCmd.PersistentFlags().String("destination-network", "1", "The network ID of the destination network.") + ulxlyInputArgs.ClaimRPCURL = depositClaimCmd.PersistentFlags().String("rpc-url", "http://127.0.0.1:8545", "The RPC endpoint of the destination network") + ulxlyInputArgs.BridgeServiceRPCURL = depositClaimCmd.PersistentFlags().String("bridge-service-url", "", "The RPC endpoint of the bridge service component.") + ulxlyInputArgs.ClaimPrivateKey = depositClaimCmd.PersistentFlags().String("private-key", "", "The private key of the sender account.") + ulxlyInputArgs.ClaimBridgeAddress = depositClaimCmd.PersistentFlags().String("bridge-address", "", "The address of the bridge contract.") + ulxlyInputArgs.ClaimGasLimit = depositClaimCmd.PersistentFlags().Uint64("gas-limit", 0, "The gas limit for the transaction. Setting this value to 0 will estimate the gas limit.") + ulxlyInputArgs.ClaimChainID = depositClaimCmd.PersistentFlags().String("chain-id", "", "The chainID.") + ulxlyInputArgs.ClaimTimeoutTxnReceipt = depositClaimCmd.PersistentFlags().Uint32("transaction-receipt-timeout", 60, "The timeout limit to check for the transaction receipt of the claim.") + ulxlyInputArgs.ClaimMessage = depositClaimCmd.PersistentFlags().Bool("claim-message", false, "Claim a message instead of an asset.") + ulxlyInputArgs.ClaimWETH = depositClaimCmd.PersistentFlags().Bool("claim-weth", false, "Claim a weth instead of an asset.") + + ulxlyInputArgs.DepositGasLimit = depositNewCmd.PersistentFlags().Uint64("gas-limit", 0, "The gas limit for the transaction. Setting this value to 0 will estimate the gas limit.") + ulxlyInputArgs.DepositChainID = depositNewCmd.PersistentFlags().String("chain-id", "", "The chainID.") + ulxlyInputArgs.DepositPrivateKey = depositNewCmd.PersistentFlags().String("private-key", "", "The private key of the sender account.") + ulxlyInputArgs.Amount = depositNewCmd.PersistentFlags().Int64("amount", 0, "The amount to send.") + ulxlyInputArgs.DepositRPCURL = depositNewCmd.PersistentFlags().String("rpc-url", "http://127.0.0.1:8545", "The RPC endpoint of the network") + ulxlyInputArgs.DepositBridgeAddress = depositNewCmd.PersistentFlags().String("bridge-address", "", "The address of the bridge contract.") + ulxlyInputArgs.DestinationNetwork = depositNewCmd.PersistentFlags().Uint32("destination-network", 1, "The destination network number.") + ulxlyInputArgs.DestinationAddress = depositNewCmd.PersistentFlags().String("destination-address", "", "The address of receiver in destination network.") + ulxlyInputArgs.TokenAddress = depositNewCmd.PersistentFlags().String("token-address", "0x0000000000000000000000000000000000000000", "The address of the token to send.") + ulxlyInputArgs.IsForced = depositNewCmd.PersistentFlags().Bool("force-update-root", true, "Force the update of the Global Exit Root.") + ulxlyInputArgs.CallData = depositNewCmd.PersistentFlags().String("call-data", "0x", "For bridging assets - raw data of the call `permit` of the token. For bridging messages - the metadata.") + ulxlyInputArgs.DepositTimeoutTxnReceipt = depositNewCmd.PersistentFlags().Uint32("transaction-receipt-timeout", 60, "The timeout limit to check for the transaction receipt of the deposit.") + ulxlyInputArgs.DepositMessage = depositNewCmd.PersistentFlags().Bool("bridge-message", false, "Bridge a message instead of an asset.") + ulxlyInputArgs.DepositWETH = depositNewCmd.PersistentFlags().Bool("bridge-weth", false, "Bridge a weth instead of an asset.") + + ulxlyInputArgs.FromBlock = depositGetCmd.PersistentFlags().Uint64("from-block", 0, "The block height to start query at.") + ulxlyInputArgs.ToBlock = depositGetCmd.PersistentFlags().Uint64("to-block", 0, "The block height to start query at.") + ulxlyInputArgs.RPCURL = depositGetCmd.PersistentFlags().String("rpc-url", "http://127.0.0.1:8545", "The RPC to query for events") + ulxlyInputArgs.FilterSize = depositGetCmd.PersistentFlags().Uint64("filter-size", 1000, "The batch size for individual filter queries") + + ulxlyInputArgs.BridgeAddress = depositGetCmd.Flags().String("bridge-address", "", "The address of the lxly bridge") + ulxlyInputArgs.InputFileName = ProofCmd.PersistentFlags().String("file-name", "", "The filename with ndjson data of deposits") + ulxlyInputArgs.DepositNum = ProofCmd.PersistentFlags().Uint32("deposit-number", 0, "The deposit that we would like to prove") +} diff --git a/contracts/Makefile b/contracts/Makefile index fb841119..ba171add 100644 --- a/contracts/Makefile +++ b/contracts/Makefile @@ -43,5 +43,19 @@ gen-tokens-go-bindings: ## Generate go bindings for the tokens contracts. abigen --abi ../bindings/tokens/ERC721.abi --bin ../bindings/tokens/ERC721.bin --pkg tokens --type ERC721 --out ../bindings/tokens/ERC721.go @echo "✅ tokens/ERC721.go generated" +.PHONY: gen-ulxly-go-bindings +gen-ulxly-go-bindings: + mkdir -p ../bindings/ulxly/ + cat ./out/PolygonZkEVMBridgeV2.sol/PolygonZkEVMBridgeV2.json | jq -r '.abi' > ../bindings/ulxly/PolygonZkEVMBridgeV2.abi + cat ./out/PolygonZkEVMBridgeV2.sol/PolygonZkEVMBridgeV2.json | jq -r '.bytecode.object' > ../bindings/ulxly/PolygonZkEVMBridgeV2.bin + abigen --abi ../bindings/ulxly/PolygonZkEVMBridgeV2.abi --bin ../bindings/ulxly/PolygonZkEVMBridgeV2.bin --pkg ulxly --type ulxly --out ../bindings/ulxly/PolygonZkEVMBridgeV2.go + @echo "✅ ulxly/PolygonZkEVMBridgeV2.go generated" + + cat ./out/PolygonZkEVMBridge.sol/PolygonZkEVMBridge.json | jq -r '.abi' > ../bindings/ulxly/PolygonZkEVMBridge.abi + cat ./out/PolygonZkEVMBridge.sol/PolygonZkEVMBridge.json | jq -r '.bytecode.object' > ../bindings/ulxly/PolygonZkEVMBridge.bin + abigen --abi ../bindings/ulxly/PolygonZkEVMBridge.abi --bin ../bindings/ulxly/PolygonZkEVMBridge.bin --pkg ulxly --type legacy --out ../bindings/ulxly/PolygonZkEVMBridge.go + @echo "✅ ulxly/PolygonZkEVMBridge.go generated" + + .PHONY: gen-go-bindings gen-go-bindings: build gen-funder-go-bindings gen-tester-go-bindings gen-tokens-go-bindings ## Generate go bindings. diff --git a/doc/polycli.md b/doc/polycli.md index b212c4fd..f778d215 100644 --- a/doc/polycli.md +++ b/doc/polycli.md @@ -69,6 +69,8 @@ Polycli is a collection of tools that are meant to be useful while building, tes - [polycli signer](polycli_signer.md) - Utilities for security signing transactions +- [polycli ulxly](polycli_ulxly.md) - Utilities for interacting with the lxly bridge + - [polycli version](polycli_version.md) - Get the current version of this application - [polycli wallet](polycli_wallet.md) - Create or inspect BIP39(ish) wallets. diff --git a/doc/polycli_ulxly.md b/doc/polycli_ulxly.md new file mode 100644 index 00000000..f7f37912 --- /dev/null +++ b/doc/polycli_ulxly.md @@ -0,0 +1,54 @@ +# `polycli ulxly` + +> Auto-generated documentation. + +## Table of Contents + +- [Description](#description) +- [Usage](#usage) +- [Flags](#flags) +- [See Also](#see-also) + +## Description + +Utilities for interacting with the lxly bridge + +## Usage + +These are low level tools for directly scanning bridge events and constructing proofs. +## Flags + +```bash + -h, --help help for ulxly +``` + +The command also inherits flags from parent commands. + +```bash + --config string config file (default is $HOME/.polygon-cli.yaml) + --pretty-logs Should logs be in pretty format or JSON (default true) + -v, --verbosity int 0 - Silent + 100 Panic + 200 Fatal + 300 Error + 400 Warning + 500 Info + 600 Debug + 700 Trace (default 500) +``` + +## See also + +- [polycli](polycli.md) - A Swiss Army knife of blockchain tools. +- [polycli ulxly deposit-claim](polycli_ulxly_deposit-claim.md) - Make a uLxLy claim transaction + +- [polycli ulxly deposit-get](polycli_ulxly_deposit-get.md) - Get a range of deposits + +- [polycli ulxly deposit-new](polycli_ulxly_deposit-new.md) - Make a uLxLy deposit transaction + +- [polycli ulxly empty-proof](polycli_ulxly_empty-proof.md) - print an empty proof structure + +- [polycli ulxly proof](polycli_ulxly_proof.md) - generate a merkle proof + +- [polycli ulxly zero-proof](polycli_ulxly_zero-proof.md) - print a proof structure with the zero hashes + diff --git a/doc/polycli_ulxly_deposit-claim.md b/doc/polycli_ulxly_deposit-claim.md new file mode 100644 index 00000000..10415192 --- /dev/null +++ b/doc/polycli_ulxly_deposit-claim.md @@ -0,0 +1,135 @@ +# `polycli ulxly deposit-claim` + +> Auto-generated documentation. + +## Table of Contents + +- [Description](#description) +- [Usage](#usage) +- [Flags](#flags) +- [See Also](#see-also) + +## Description + +Make a uLxLy claim transaction + +```bash +polycli ulxly deposit-claim [flags] +``` + +## Usage + +This command will attempt to send a claim transaction to the bridge contract. + +```solidity + /** + * @notice Verify merkle proof and withdraw tokens/ether + * @param smtProofLocalExitRoot Smt proof to proof the leaf against the network exit root + * @param smtProofRollupExitRoot Smt proof to proof the rollupLocalExitRoot against the rollups exit root + * @param globalIndex Global index is defined as: + * | 191 bits | 1 bit | 32 bits | 32 bits | + * | 0 | mainnetFlag | rollupIndex | localRootIndex | + * note that only the rollup index will be used only in case the mainnet flag is 0 + * note that global index do not assert the unused bits to 0. + * This means that when synching the events, the globalIndex must be decoded the same way that in the Smart contract + * to avoid possible synch attacks + * @param mainnetExitRoot Mainnet exit root + * @param rollupExitRoot Rollup exit root + * @param originNetwork Origin network + * @param originTokenAddress Origin token address, 0 address is reserved for ether + * @param destinationNetwork Network destination + * @param destinationAddress Address destination + * @param amount Amount of tokens + * @param metadata Abi encoded metadata if any, empty otherwise + */ + function claimAsset( + bytes32[_DEPOSIT_CONTRACT_TREE_DEPTH] calldata smtProofLocalExitRoot, + bytes32[_DEPOSIT_CONTRACT_TREE_DEPTH] calldata smtProofRollupExitRoot, + uint256 globalIndex, + bytes32 mainnetExitRoot, + bytes32 rollupExitRoot, + uint32 originNetwork, + address originTokenAddress, + uint32 destinationNetwork, + address destinationAddress, + uint256 amount, + bytes calldata metadata + ) + +``` + +Each transaction will require manual input of parameters. Example usage: + +```bash +polycli ulxly deposit-claim \ + --bridge-address 0xD71f8F956AD979Cc2988381B8A743a2fE280537D \ + --private-key 12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625 \ + --claim-index 0 \ + --claim-address 0xE34aaF64b29273B7D567FCFc40544c014EEe9970 \ + --claim-network 0 \ + --rpc-url http://127.0.0.1:32790 \ + --bridge-service-url http://127.0.0.1:32804 +``` + +This command would use the supplied private key and attempt to send a claim transaction to the bridge contract address with the input flags. +Successful deposit transaction will output logs like below: + +```bash +Claim Transaction Successful: 0x7180201b19e1aa596503d8541137d6f341e682835bf7a54aab6422c89158866b +``` + +Upon successful claim, the transferred funds can be queried in the destination network using tools like `cast balance --rpc-url ` + + +Failed deposit transactions will output logs like below: + +```bash +Claim Transaction Failed: 0x32ac34797159c79e57ae801c350bccfe5f8105d4dd3b717e31d811397e98036a +``` + +The reason for failing may be very difficult to debug. I have personally spun up a bridge-ui and compared the byte data of a successful transaction to the byte data of a failing claim transaction queried using: + +```! +curl http://127.0.0.1:32790 \ +-X POST \ +-H "Content-Type: application/json" \ +--data '{"method":"debug_traceTransaction","params":["0x32ac34797159c79e57ae801c350bccfe5f8105d4dd3b717e31d811397e98036a", {"tracer": "callTracer"}], "id":1,"jsonrpc":"2.0"}' | jq '.' +``` + +## Flags + +```bash + --bridge-address string The address of the bridge contract. + --bridge-service-url string The RPC endpoint of the bridge service component. + --chain-id string The chainID. + --claim-address string The address that is receiving the bridged asset. + --claim-index string The deposit count, or index to initiate a claim transaction for. (default "0") + --claim-message Claim a message instead of an asset. + --claim-weth Claim a weth instead of an asset. + --destination-network string The network ID of the destination network. (default "1") + --gas-limit uint The gas limit for the transaction. Setting this value to 0 will estimate the gas limit. + -h, --help help for deposit-claim + --origin-network string The network ID of the origin network. (default "0") + --private-key string The private key of the sender account. + --rpc-url string The RPC endpoint of the destination network (default "http://127.0.0.1:8545") + --transaction-receipt-timeout uint32 The timeout limit to check for the transaction receipt of the claim. (default 60) +``` + +The command also inherits flags from parent commands. + +```bash + --config string config file (default is $HOME/.polygon-cli.yaml) + --pretty-logs Should logs be in pretty format or JSON (default true) + -v, --verbosity int 0 - Silent + 100 Panic + 200 Fatal + 300 Error + 400 Warning + 500 Info + 600 Debug + 700 Trace (default 500) +``` + +## See also + +- [polycli ulxly](polycli_ulxly.md) - Utilities for interacting with the lxly bridge diff --git a/doc/polycli_ulxly_deposit-get.md b/doc/polycli_ulxly_deposit-get.md new file mode 100644 index 00000000..8eb99a1c --- /dev/null +++ b/doc/polycli_ulxly_deposit-get.md @@ -0,0 +1,97 @@ +# `polycli ulxly deposit-get` + +> Auto-generated documentation. + +## Table of Contents + +- [Description](#description) +- [Usage](#usage) +- [Flags](#flags) +- [See Also](#see-also) + +## Description + +Get a range of deposits + +```bash +polycli ulxly deposit-get [flags] +``` + +## Usage + +This command will attempt to scan a range of blocks and look for uLxLy +Bridge Events. This is is the specific signature that we're interested +in: + +```solidity + /** + * @dev Emitted when bridge assets or messages to another network + */ + event BridgeEvent( + uint8 leafType, + uint32 originNetwork, + address originAddress, + uint32 destinationNetwork, + address destinationAddress, + uint256 amount, + bytes metadata, + uint32 depositCount + ); + +``` + +If you're looking at the raw topics from on chain or in an explorer, this is the associated value: + +`0x501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b` + +Each event that we counter will be parsed and written as JSON to +stdout. Example usage: + +```bash +polycli ulxly deposit-get \ + --bridge-address 0x528e26b25a34a4A5d0dbDa1d57D318153d2ED582 \ + --rpc-url https://eth-sepolia.g.alchemy.com/v2/demo \ + --from-block 4880876 \ + --to-block 6028159 \ + --filter-size 9999 > cardona-4880876-to-6028159.ndjson +``` + +This command would look for bridge events from block `4880876` to +block `6028159` in increments of `9999` blocks at a time for the +contract address `0x528e26b25a34a4A5d0dbDa1d57D318153d2ED582`. The +output will be written as newline delimited JSON. + +This command is very specific for the ulxly bridge and it's meant to +serve as the input to the proof command. + + + +## Flags + +```bash + --bridge-address string The address of the lxly bridge + --filter-size uint The batch size for individual filter queries (default 1000) + --from-block uint The block height to start query at. + -h, --help help for deposit-get + --rpc-url string The RPC to query for events (default "http://127.0.0.1:8545") + --to-block uint The block height to start query at. +``` + +The command also inherits flags from parent commands. + +```bash + --config string config file (default is $HOME/.polygon-cli.yaml) + --pretty-logs Should logs be in pretty format or JSON (default true) + -v, --verbosity int 0 - Silent + 100 Panic + 200 Fatal + 300 Error + 400 Warning + 500 Info + 600 Debug + 700 Trace (default 500) +``` + +## See also + +- [polycli ulxly](polycli_ulxly.md) - Utilities for interacting with the lxly bridge diff --git a/doc/polycli_ulxly_deposit-new.md b/doc/polycli_ulxly_deposit-new.md new file mode 100644 index 00000000..5a726aa0 --- /dev/null +++ b/doc/polycli_ulxly_deposit-new.md @@ -0,0 +1,121 @@ +# `polycli ulxly deposit-new` + +> Auto-generated documentation. + +## Table of Contents + +- [Description](#description) +- [Usage](#usage) +- [Flags](#flags) +- [See Also](#see-also) + +## Description + +Make a uLxLy deposit transaction + +```bash +polycli ulxly deposit-new [flags] +``` + +## Usage + +This command will attempt to send a deposit transaction to the bridge contract. + +```solidity + /** + * @notice Deposit add a new leaf to the merkle tree + * note If this function is called with a reentrant token, it would be possible to `claimTokens` in the same call + * Reducing the supply of tokens on this contract, and actually locking tokens in the contract. + * Therefore we recommend to third parties bridges that if they do implement reentrant call of `beforeTransfer` of some reentrant tokens + * do not call any external address in that case + * note User/UI must be aware of the existing/available networks when choosing the destination network + * @param destinationNetwork Network destination + * @param destinationAddress Address destination + * @param amount Amount of tokens + * @param token Token address, 0 address is reserved for ether + * @param forceUpdateGlobalExitRoot Indicates if the new global exit root is updated or not + * @param permitData Raw data of the call `permit` of the token + */ + function bridgeAsset( + uint32 destinationNetwork, + address destinationAddress, + uint256 amount, + address token, + bool forceUpdateGlobalExitRoot, + bytes calldata permitData + ); + +``` + +Each transaction will require manual input of parameters. Example usage: + +```bash +polycli ulxly deposit-new \ + --private-key 12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625 \ + --gas-limit 300000 \ + --amount 1000000000000000000 \ + --rpc-url http://127.0.0.1:8545 \ + --bridge-address 0xD71f8F956AD979Cc2988381B8A743a2fE280537D \ + --destination-network 1 \ + --destination-address 0xE34aaF64b29273B7D567FCFc40544c014EEe9970 +``` + +This command would use the supplied private key and attempt to send a deposit transaction to the bridge contract address with the input flags. +Successful deposit transaction will output logs like below: + +```bash +Deposit Transaction Successful: 0x8c9b82e8abdfb4aad5fccd91879397acfa73e4261282c8dc634734d05ad889d3 +``` + +Upon successful deposit, the transaction can be queried using `polycli ulxly deposit-get` command + + +Failed deposit transactions will output logs like below: + +```bash +Deposit Transaction Failed: 0x60385209b0e9db359c24c88c2fb8a5c9e4628fffe8d5fb2b5e64dfac3a2b7639 +Try increasing the gas limit: +Current gas limit: 100000 +Cumulative gas used for transaction: 98641 +``` + +The reason for failing may likely be due to the `out of gas` error. Increasing the `--gas-limit` flag value will likely resolve this. + +## Flags + +```bash + --amount int The amount to send. + --bridge-address string The address of the bridge contract. + --bridge-message Bridge a message instead of an asset. + --bridge-weth Bridge a weth instead of an asset. + --call-data permit For bridging assets - raw data of the call permit of the token. For bridging messages - the metadata. (default "0x") + --chain-id string The chainID. + --destination-address string The address of receiver in destination network. + --destination-network uint32 The destination network number. (default 1) + --force-update-root Force the update of the Global Exit Root. (default true) + --gas-limit uint The gas limit for the transaction. Setting this value to 0 will estimate the gas limit. + -h, --help help for deposit-new + --private-key string The private key of the sender account. + --rpc-url string The RPC endpoint of the network (default "http://127.0.0.1:8545") + --token-address string The address of the token to send. (default "0x0000000000000000000000000000000000000000") + --transaction-receipt-timeout uint32 The timeout limit to check for the transaction receipt of the deposit. (default 60) +``` + +The command also inherits flags from parent commands. + +```bash + --config string config file (default is $HOME/.polygon-cli.yaml) + --pretty-logs Should logs be in pretty format or JSON (default true) + -v, --verbosity int 0 - Silent + 100 Panic + 200 Fatal + 300 Error + 400 Warning + 500 Info + 600 Debug + 700 Trace (default 500) +``` + +## See also + +- [polycli ulxly](polycli_ulxly.md) - Utilities for interacting with the lxly bridge diff --git a/doc/polycli_ulxly_empty-proof.md b/doc/polycli_ulxly_empty-proof.md new file mode 100644 index 00000000..0d138202 --- /dev/null +++ b/doc/polycli_ulxly_empty-proof.md @@ -0,0 +1,49 @@ +# `polycli ulxly empty-proof` + +> Auto-generated documentation. + +## Table of Contents + +- [Description](#description) +- [Usage](#usage) +- [Flags](#flags) +- [See Also](#see-also) + +## Description + +print an empty proof structure + +```bash +polycli ulxly empty-proof [flags] +``` + +## Usage + +Use this command to print an empty proof response that's filled with +zero-valued siblings like +0x0000000000000000000000000000000000000000000000000000000000000000. This +can be useful when you need to submit a dummy proof. +## Flags + +```bash + -h, --help help for empty-proof +``` + +The command also inherits flags from parent commands. + +```bash + --config string config file (default is $HOME/.polygon-cli.yaml) + --pretty-logs Should logs be in pretty format or JSON (default true) + -v, --verbosity int 0 - Silent + 100 Panic + 200 Fatal + 300 Error + 400 Warning + 500 Info + 600 Debug + 700 Trace (default 500) +``` + +## See also + +- [polycli ulxly](polycli_ulxly.md) - Utilities for interacting with the lxly bridge diff --git a/doc/polycli_ulxly_proof.md b/doc/polycli_ulxly_proof.md new file mode 100644 index 00000000..5e7e0072 --- /dev/null +++ b/doc/polycli_ulxly_proof.md @@ -0,0 +1,120 @@ +# `polycli ulxly proof` + +> Auto-generated documentation. + +## Table of Contents + +- [Description](#description) +- [Usage](#usage) +- [Flags](#flags) +- [See Also](#see-also) + +## Description + +generate a merkle proof + +```bash +polycli ulxly proof [flags] +``` + +## Usage + +This command will attempt to create a merkle proof based on the bridge +events that are provided. + +Example usage: + +```bash +polycli ulxly proof \ + --file-name cardona-4880876-to-6028159.ndjson \ + --deposit-number 24386 | jq '.' +``` + +In this case we are assuming we have a file +`cardona-4880876-to-6028159.ndjson` that would have been generated +with a call to `polycli ulxly deposits`. The output will be the +sibling hashes necessary to prove inclusion of deposit `24386`. + +This is a real verifiable deposit if you'd like to sanity check: + +- Deposit Transaction: https://sepolia.etherscan.io/tx/0x1f950d076ad534fe588bd6a8f58904395c907df4738f92bd8aea513c19d1fa5f +- Mainnet Root: `4516CA2A793B8E20F56EC6BA8CA6033A672330670A3772F76F2ADE9BC2125150` +- Actual Claim Tx: https://cardona-zkevm.polygonscan.com/tx/0x5d4fbaca896f015801f1049b383932eaa9363d344c36b1c51e5f2e3ce20f9dc3 + +This is the proof response from polycli: + +```json +{ + "Siblings": [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x18dd49d4ac3b31a6468446597686e7164bfb88a09685d3cd31f8f4b0b91e7d86", + "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", + "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", + "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", + "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", + "0x3822fc0c89d0438d84cb8b41b6a9eecd5d9d369ce5022b6d0817d96e695fca08", + "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", + "0xd1f352a4bd8bdd17b172d7a39c2406672c4644a624fd3c5ac30111cb716c6a79", + "0x8549075281f6770dc405ba232aa39c16992a441b2e88b01742a35bb949cb4e54", + "0xec88c2530a54d444e5212e08a65c5b7ee7ce34ef0acd31e1eb2c1ab5aa91772b", + "0x9b2bc070d68635596a9e3cefef6c5c7530751b415fe63cfa3c01de5d8253379c", + "0x25e2d43e7f5545a5808a41875dc6485c4bd9e2df61396b682685d00a00ca1e88", + "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", + "0x893f7fe87020f40c2edd5239c1b4be2f16862adb151deea1e379b33f35ce8bd3", + "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", + "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", + "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", + "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", + "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", + "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", + "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", + "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", + "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", + "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", + "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", + "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", + "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", + "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", + "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", + "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", + "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" + ], + "Root": "0x4516ca2a793b8e20f56ec6ba8ca6033a672330670a3772f76f2ade9bc2125150", + "DepositCount": 24386, + "LeafHash": "0x2c42c143213fd0e36d843d9d40866ce7be02c671beec0eae3ffd3d2638acc87c" +} +``` + +![Sample Tree](./tree-diagram.png) + +When we're creating the proof here, we're essentially storing all of +the paths to the various leafs. When we want to generate a proof, we +essentially find the appropriate sibling node in the tree to prove +that the leaf is part of the given merkle root. + +## Flags + +```bash + --deposit-number uint32 The deposit that we would like to prove + --file-name string The filename with ndjson data of deposits + -h, --help help for proof +``` + +The command also inherits flags from parent commands. + +```bash + --config string config file (default is $HOME/.polygon-cli.yaml) + --pretty-logs Should logs be in pretty format or JSON (default true) + -v, --verbosity int 0 - Silent + 100 Panic + 200 Fatal + 300 Error + 400 Warning + 500 Info + 600 Debug + 700 Trace (default 500) +``` + +## See also + +- [polycli ulxly](polycli_ulxly.md) - Utilities for interacting with the lxly bridge diff --git a/doc/polycli_ulxly_zero-proof.md b/doc/polycli_ulxly_zero-proof.md new file mode 100644 index 00000000..c9bd4296 --- /dev/null +++ b/doc/polycli_ulxly_zero-proof.md @@ -0,0 +1,51 @@ +# `polycli ulxly zero-proof` + +> Auto-generated documentation. + +## Table of Contents + +- [Description](#description) +- [Usage](#usage) +- [Flags](#flags) +- [See Also](#see-also) + +## Description + +print a proof structure with the zero hashes + +```bash +polycli ulxly zero-proof [flags] +``` + +## Usage + +Use this command to print a proof response that's filled with the zero +hashes. This values are very helpful for debugging because it would +tell you how populated the tree is and roughly which leaves and +siblings are empty. It's also helpful for sanity checking a proof +response to understand if the hashed value is part of the zero hashes +or if it's actually an intermediate hash. +## Flags + +```bash + -h, --help help for zero-proof +``` + +The command also inherits flags from parent commands. + +```bash + --config string config file (default is $HOME/.polygon-cli.yaml) + --pretty-logs Should logs be in pretty format or JSON (default true) + -v, --verbosity int 0 - Silent + 100 Panic + 200 Fatal + 300 Error + 400 Warning + 500 Info + 600 Debug + 700 Trace (default 500) +``` + +## See also + +- [polycli ulxly](polycli_ulxly.md) - Utilities for interacting with the lxly bridge