Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xc02697c417DdAcfbe5EdbF23eDad956BC883F4fb
Balance 0 ETH
Nonce 1
Code Size 11538 bytes
Last Active
Indexed Transactions 6 (10,609,66210,654,173)
Gas Used (indexed) 2,919,317
External Etherscan · Sourcify

Contract Bytecode

11538 bytes
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c806370a082311161011a578063a2d2b773116100ad578063cd5965831161007c578063cd5965831461081b578063e5d316b514610823578063e985e9c514610840578063f2fde38b1461086e578063f3b8379114610894576101fb565b8063a2d2b7731461072a578063b88d4fde14610732578063be3b625b146107f6578063c87b56dd146107fe576101fb565b80638da5cb5b116100e95780638da5cb5b146106cf57806395d89b41146106d75780639a4a4395146106df578063a22cb465146106fc576101fb565b806370a08231146105f5578063715018a61461061b5780637352fb9b14610623578063871c0760146106c7576101fb565b80632f745c59116101925780635933998211610161578063593399821461058d5780636352211e146105aa5780636c0360eb146105c75780636e5d6bea146105cf576101fb565b80632f745c591461043b5780632fb102cf1461046757806342842e0e1461053a5780634f6ccce714610570576101fb565b80630b26cf66116101ce5780630b26cf661461031f57806318160ddd146103455780631a5dfa9a1461035f57806323b872dd14610405576101fb565b806301ffc9a71461020057806306fdde031461023b578063081812fc146102b8578063095ea7b3146102f1575b600080fd5b6102276004803603602081101561021657600080fd5b50356001600160e01b0319166108b1565b604080519115158252519081900360200190f35b6102436108d4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561027d578181015183820152602001610265565b50505050905090810190601f1680156102aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102d5600480360360208110156102ce57600080fd5b503561096b565b604080516001600160a01b039092168252519081900360200190f35b61031d6004803603604081101561030757600080fd5b506001600160a01b0381351690602001356109cd565b005b61031d6004803603602081101561033557600080fd5b50356001600160a01b0316610aa8565b61034d610b0c565b60408051918252519081900360200190f35b61034d6004803603604081101561037557600080fd5b810190602081018135600160201b81111561038f57600080fd5b8201836020820111156103a157600080fd5b803590602001918460018302840111600160201b831117156103c257600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610b1d915050565b61031d6004803603606081101561041b57600080fd5b506001600160a01b03813581169160208101359091169060400135610b92565b61034d6004803603604081101561045157600080fd5b506001600160a01b038135169060200135610be9565b61034d6004803603608081101561047d57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ac57600080fd5b8201836020820111156104be57600080fd5b803590602001918460018302840111600160201b831117156104df57600080fd5b919390929091602081019035600160201b8111156104fc57600080fd5b82018360208201111561050e57600080fd5b803590602001918460018302840111600160201b8311171561052f57600080fd5b509092509050610c11565b61031d6004803603606081101561055057600080fd5b506001600160a01b03813581169160208101359091169060400135610e32565b61034d6004803603602081101561058657600080fd5b5035610e4d565b610227600480360360208110156105a357600080fd5b5035610e69565b6102d5600480360360208110156105c057600080fd5b5035610e7e565b610243610eac565b61031d600480360360208110156105e557600080fd5b50356001600160a01b0316610f0d565b61034d6004803603602081101561060b57600080fd5b50356001600160a01b0316610f6e565b61031d610fd6565b61034d6004803603602081101561063957600080fd5b810190602081018135600160201b81111561065357600080fd5b82018360208201111561066557600080fd5b803590602001918460018302840111600160201b8311171561068657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611078945050505050565b6102d56110eb565b6102d56110fa565b610243611109565b61031d600480360360208110156106f557600080fd5b503561116a565b61031d6004803603604081101561071257600080fd5b506001600160a01b03813516906020013515156114d1565b6102d56115d6565b61031d6004803603608081101561074857600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561078257600080fd5b82018360208201111561079457600080fd5b803590602001918460018302840111600160201b831117156107b557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506115e5945050505050565b61034d611643565b6102436004803603602081101561081457600080fd5b5035611649565b6102d56118f0565b6102436004803603602081101561083957600080fd5b50356118ff565b6102276004803603604081101561085657600080fd5b506001600160a01b038135811691602001351661199a565b61031d6004803603602081101561088457600080fd5b50356001600160a01b03166119c8565b61031d600480360360208110156108aa57600080fd5b5035611ac1565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109605780601f1061093557610100808354040283529160200191610960565b820191906000526020600020905b81548152906001019060200180831161094357829003601f168201915b505050505090505b90565b600061097682611b22565b6109b15760405162461bcd60e51b815260040180806020018281038252602c815260200180612bbb602c913960400191505060405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006109d882610e7e565b9050806001600160a01b0316836001600160a01b03161415610a2b5760405162461bcd60e51b8152600401808060200182810382526021815260200180612c8b6021913960400191505060405180910390fd5b806001600160a01b0316610a3d611b35565b6001600160a01b03161480610a5e5750610a5e81610a59611b35565b61199a565b610a995760405162461bcd60e51b8152600401808060200182810382526038815260200180612b0e6038913960400191505060405180910390fd5b610aa38383611b39565b505050565b610ab0611b35565b600a546001600160a01b03908116911614610b00576040805162461bcd60e51b81526020600482018190526024820152600080516020612c13833981519152604482015290519081900360640190fd5b610b0981611ba7565b50565b6000610b186002611c16565b905090565b6000610b8982600f856040518082805190602001908083835b60208310610b555780518252601f199092019160209182019101610b36565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050611c21565b90505b92915050565b610ba3610b9d611b35565b82611c2d565b610bde5760405162461bcd60e51b8152600401808060200182810382526031815260200180612cac6031913960400191505060405180910390fd5b610aa3838383611cd1565b6001600160a01b0382166000908152600160205260408120610b89908363ffffffff611c2116565b6000610c1b6118f0565b6001600160a01b0316336001600160a01b031614610c3857600080fd5b610c406110eb565b6001600160a01b0316610c516118f0565b6001600160a01b031663d67bdd256040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8957600080fd5b505afa158015610c9d573d6000803e3d6000fd5b505050506040513d6020811015610cb357600080fd5b50516001600160a01b031614610cc857600080fd5b610cff86600f878760405180838380828437919091019485525050604051928390036020019092209291505063ffffffff611e2f16565b506000868152601060205260409020610d199086866128f0565b50610d248787611e3b565b610d648684848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611e5992505050565b6000610d6e611ebc565b90507fff3d54487587c93cb1ae9f7cdf276d964a392926b20900aacb0852a6c12e014b87878787878d87604051808881526020018060200180602001856001600160a01b03166001600160a01b031681526020018481526020018381038352898982818152602001925080828437600083820152601f01601f191690910184810383528781526020019050878780828437600083820152604051601f909101601f19169092018290039b50909950505050505050505050a150949695505050505050565b610aa3838383604051806020016040528060008152506115e5565b600080610e6160028463ffffffff611f2f16565b509392505050565b600e6020526000908152604090205460ff1681565b6000610b8c82604051806060016040528060298152602001612b70602991396002919063ffffffff611f4b16565b60098054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109605780601f1061093557610100808354040283529160200191610960565b610f15611b35565b600a546001600160a01b03908116911614610f65576040805162461bcd60e51b81526020600482018190526024820152600080516020612c13833981519152604482015290519081900360640190fd5b610b0981611f58565b60006001600160a01b038216610fb55760405162461bcd60e51b815260040180806020018281038252602a815260200180612b46602a913960400191505060405180910390fd5b6001600160a01b0382166000908152600160205260409020610b8c90611c16565b610fde611b35565b600a546001600160a01b0390811691161461102e576040805162461bcd60e51b81526020600482018190526024820152600080516020612c13833981519152604482015290519081900360640190fd5b600a546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600a80546001600160a01b0319169055565b6000806110e4600f846040518082805190602001908083835b602083106110b05780518252601f199092019160209182019101611091565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209150611c169050565b9392505050565b600c546001600160a01b031690565b600a546001600160a01b031690565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109605780601f1061093557610100808354040283529160200191610960565b6111726118f0565b6001600160a01b031663cb08a10c826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156111b557600080fd5b505afa1580156111c9573d6000803e3d6000fd5b505050506040513d60208110156111df57600080fd5b5051156111eb57600080fd5b306111f46118f0565b6001600160a01b0316633f9a8e7e836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561123757600080fd5b505afa15801561124b573d6000803e3d6000fd5b505050506040513d602081101561126157600080fd5b50516001600160a01b03161461127657600080fd5b61127e6110eb565b6001600160a01b031661128f6118f0565b6001600160a01b0316634a610b04836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156112d257600080fd5b505afa1580156112e6573d6000803e3d6000fd5b505050506040513d60208110156112fc57600080fd5b50516001600160a01b03161461131157600080fd5b600061131b6118f0565b6001600160a01b031663e37c3289836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561135e57600080fd5b505afa158015611372573d6000803e3d6000fd5b505050506040513d602081101561138857600080fd5b50516040805160248082018490528251808303909101815260449091019091526020810180516001600160e01b0316630950d51560e01b9081179091529192506113d06118f0565b6001600160a01b031663dc8601b36113e66110eb565b600d546040516001600160e01b031960e085901b1681526001600160a01b038316600482019081526044820183905260606024830190815287516064840152875188949360840190602086019080838360005b83811015611451578181015183820152602001611439565b50505050905090810190601f16801561147e5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b15801561149f57600080fd5b505af11580156114b3573d6000803e3d6000fd5b505050506040513d60208110156114c957600080fd5b505050505050565b6114d9611b35565b6001600160a01b0316826001600160a01b0316141561153f576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b806005600061154c611b35565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611590611b35565b60408051841515815290516001600160a01b0392909216917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319181900360200190a35050565b600b546001600160a01b031681565b6115f66115f0611b35565b83611c2d565b6116315760405162461bcd60e51b8152600401808060200182810382526031815260200180612cac6031913960400191505060405180910390fd5b61163d84848484611f7a565b50505050565b600d5481565b606061165482611b22565b61168f5760405162461bcd60e51b815260040180806020018281038252602f815260200180612c5c602f913960400191505060405180910390fd5b60008281526008602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156117245780601f106116f957610100808354040283529160200191611724565b820191906000526020600020905b81548152906001019060200180831161170757829003601f168201915b50506009549394505050506002600019610100600184161502019091160461174d5790506108cf565b80511561181e5760098160405160200180838054600181600116156101000203166002900480156117b55780601f106117935761010080835404028352918201916117b5565b820191906000526020600020905b8154815290600101906020018083116117a1575b5050825160208401908083835b602083106117e15780518252601f1990920191602091820191016117c2565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529150506108cf565b600961182984611fcc565b60405160200180838054600181600116156101000203166002900480156118875780601f10611865576101008083540402835291820191611887565b820191906000526020600020905b815481529060010190602001808311611873575b5050825160208401908083835b602083106118b35780518252601f199092019160209182019101611894565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050919050565b600b546001600160a01b031690565b60106020908152600091825260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156119925780601f1061196757610100808354040283529160200191611992565b820191906000526020600020905b81548152906001019060200180831161197557829003601f168201915b505050505081565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6119d0611b35565b600a546001600160a01b03908116911614611a20576040805162461bcd60e51b81526020600482018190526024820152600080516020612c13833981519152604482015290519081900360640190fd5b6001600160a01b038116611a655760405162461bcd60e51b8152600401808060200182810382526026815260200180612a4b6026913960400191505060405180910390fd5b600a546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600a80546001600160a01b0319166001600160a01b0392909216919091179055565b611ac9611b35565b600a546001600160a01b03908116911614611b19576040805162461bcd60e51b81526020600482018190526024820152600080516020612c13833981519152604482015290519081900360640190fd5b610b09816120a7565b6000610b8c60028363ffffffff61215616565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611b6e82610e7e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611bb9816001600160a01b0316612162565b611bf45760405162461bcd60e51b8152600401808060200182810382526022815260200180612ac06022913960400191505060405180910390fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610b8c8261219b565b6000610b89838361219f565b6000611c3882611b22565b611c735760405162461bcd60e51b815260040180806020018281038252602c815260200180612ae2602c913960400191505060405180910390fd5b6000611c7e83610e7e565b9050806001600160a01b0316846001600160a01b03161480611cb95750836001600160a01b0316611cae8461096b565b6001600160a01b0316145b80611cc95750611cc9818561199a565b949350505050565b826001600160a01b0316611ce482610e7e565b6001600160a01b031614611d295760405162461bcd60e51b8152600401808060200182810382526029815260200180612c336029913960400191505060405180910390fd5b6001600160a01b038216611d6e5760405162461bcd60e51b8152600401808060200182810382526024815260200180612a9c6024913960400191505060405180910390fd5b611d79838383610aa3565b611d84600082611b39565b6001600160a01b0383166000908152600160205260409020611dac908263ffffffff61220316565b506001600160a01b0382166000908152600160205260409020611dd5908263ffffffff611e2f16565b50611de86002828463ffffffff61220f16565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000610b898383612225565b611e5582826040518060200160405280600081525061226f565b5050565b611e6282611b22565b611e9d5760405162461bcd60e51b815260040180806020018281038252602c815260200180612be7602c913960400191505060405180910390fd5b60008281526008602090815260409091208251610aa39284019061296e565b6000611ec66118f0565b6001600160a01b031663669f618b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611efe57600080fd5b505afa158015611f12573d6000803e3d6000fd5b505050506040513d6020811015611f2857600080fd5b5051905090565b6000808080611f3e86866122c1565b9097909650945050505050565b6000611cc984848461233c565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b611f85848484611cd1565b611f9184848484612406565b61163d5760405162461bcd60e51b8152600401808060200182810382526032815260200180612a196032913960400191505060405180910390fd5b606081611ff157506040805180820190915260018152600360fc1b60208201526108cf565b8160005b811561200957600101600a82049150611ff5565b60608167ffffffffffffffff8111801561202257600080fd5b506040519080825280601f01601f19166020018201604052801561204d576020820181803683370190505b50859350905060001982015b831561209e57600a840660300160f81b8282806001900393508151811061207c57fe5b60200101906001600160f81b031916908160001a905350600a84049350612059565b50949350505050565b6120af6118f0565b6001600160a01b031663e5789d036040518163ffffffff1660e01b815260040160206040518083038186803b1580156120e757600080fd5b505afa1580156120fb573d6000803e3d6000fd5b505050506040513d602081101561211157600080fd5b50518111156121515760405162461bcd60e51b815260040180806020018281038252602b815260200180612a71602b913960400191505060405180910390fd5b600d55565b6000610b898383612641565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611cc9575050151592915050565b5490565b815460009082106121e15760405162461bcd60e51b81526004018080602001828103825260228152602001806129f76022913960400191505060405180910390fd5b8260000182815481106121f057fe5b9060005260206000200154905092915050565b6000610b898383612659565b6000611cc984846001600160a01b03851661271f565b60006122318383612641565b61226757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610b8c565b506000610b8c565b61227983836127b6565b6122866000848484612406565b610aa35760405162461bcd60e51b8152600401808060200182810382526032815260200180612a196032913960400191505060405180910390fd5b8154600090819083106123055760405162461bcd60e51b8152600401808060200182810382526022815260200180612b996022913960400191505060405180910390fd5b600084600001848154811061231657fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b600082815260018401602052604081205482816123d75760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561239c578181015183820152602001612384565b50505050905090810190601f1680156123c95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b508460000160018203815481106123ea57fe5b9060005260206000209060020201600101549150509392505050565b600061241a846001600160a01b0316612162565b61242657506001611cc9565b600060606001600160a01b038616630a85bd0160e11b612444611b35565b89888860405160240180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156124bd5781810151838201526020016124a5565b50505050905090810190601f1680156124ea5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909a16999099178952518151919890975087965094509250829150849050835b602083106125525780518252601f199092019160209182019101612533565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146125b4576040519150601f19603f3d011682016040523d82523d6000602084013e6125b9565b606091505b50915091508161260a578051156125d35780518082602001fd5b60405162461bcd60e51b8152600401808060200182810382526032815260200180612a196032913960400191505060405180910390fd5b600081806020019051602081101561262157600080fd5b50516001600160e01b031916630a85bd0160e11b149350611cc992505050565b60009081526001919091016020526040902054151590565b60008181526001830160205260408120548015612715578354600019808301919081019060009087908390811061268c57fe5b90600052602060002001549050808760000184815481106126a957fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806126d957fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610b8c565b6000915050610b8c565b6000828152600184016020526040812054806127845750506040805180820182528381526020808201848152865460018181018955600089815284812095516002909302909501918255915190820155865486845281880190925292909120556110e4565b8285600001600183038154811061279757fe5b90600052602060002090600202016001018190555060009150506110e4565b6001600160a01b038216612811576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b61281a81611b22565b1561286c576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b61287860008383610aa3565b6001600160a01b03821660009081526001602052604090206128a0908263ffffffff611e2f16565b506128b36002828463ffffffff61220f16565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106129315782800160ff1982351617855561295e565b8280016001018555821561295e579182015b8281111561295e578235825591602001919060010190612943565b5061296a9291506129dc565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106129af57805160ff191683800117855561295e565b8280016001018555821561295e579182015b8281111561295e5782518255916020019190600101906129c1565b61096891905b8082111561296a57600081556001016129e256fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373676173206c696d697420697320686967686572207468616e2074686520427269646765206d6178696d756d4552433732313a207472616e7366657220746f20746865207a65726f206164647265737370726f76696465642061646472657373206973206e6f74206120636f6e74726163744552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e64734552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732314d657461646174613a2055524920736574206f66206e6f6e6578697374656e7420746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564a2646970667358221220a82239511c51fe712f87f06acc53b448614b30f42aa24aa3da01adef9293167464736f6c63430006060033

Verified Source Code Partial Match

Compiler: v0.6.6+commit.6c089d02 EVM: istanbul Optimization: Yes (200 runs)
NiftyMain.sol 3772 lines
// Sources flattened with buidler v1.3.3-rc.0 https://buidler.dev

// File contracts/IAMB.sol

pragma solidity >=0.6.0 <0.7.0;

interface IAMB {
    function messageSender() external view returns (address);
    function maxGasPerTx() external view returns (uint256);
    function transactionHash() external view returns (bytes32);
    function messageId() external view returns (bytes32);
    function messageSourceChainId() external view returns (bytes32);
    function messageCallStatus(bytes32 _messageId) external view returns (bool);
    function failedMessageDataHash(bytes32 _messageId) external view returns (bytes32);
    function failedMessageReceiver(bytes32 _messageId) external view returns (address);
    function failedMessageSender(bytes32 _messageId) external view returns (address);
    function requireToPassMessage(address _contract, bytes calldata _data, uint256 _gas) external returns (bytes32);
}


// File contracts/ITokenManagement.sol

pragma solidity >=0.6.0 <0.7.0;

interface ITokenManagement {

  function mint(address to, uint256 tokenId, string calldata inkUrl, string calldata jsonUrl) external returns (uint256);
  function fixFailedMessage(bytes32 _dataHash) external;

}


// File @openzeppelin/contracts/GSN/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }

    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}


// File @openzeppelin/contracts/access/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}


// File @openzeppelin/contracts/utils/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }
}


// File contracts/AMBMediator.sol

pragma solidity >=0.6.0 <0.7.0;





contract AMBMediator is Ownable {
    using Address for address;

    constructor() public {
    }

    address public bridgeContractAddress;
    address private otherSideContractAddress;
    uint256 public requestGasLimit;

    mapping (bytes32 => bool) public messageFixed;

    function setBridgeContract(address _bridgeContract) external onlyOwner {
        _setBridgeContract(_bridgeContract);
    }

    function _setBridgeContract(address _bridgeContract) internal {
        require(_bridgeContract.isContract(), 'provided address is not a contract');
        bridgeContractAddress = _bridgeContract;
    }

    function bridgeContract() public view returns (IAMB) {
        return IAMB(bridgeContractAddress);
    }

    function setMediatorContractOnOtherSide(address _mediatorContract) external onlyOwner {
        _setMediatorContractOnOtherSide(_mediatorContract);
    }

    function _setMediatorContractOnOtherSide(address _mediatorContract) internal {
        otherSideContractAddress = _mediatorContract;
    }

    function mediatorContractOnOtherSide() public view returns (address) {
        return otherSideContractAddress;
    }

    function setRequestGasLimit(uint256 _requestGasLimit) external onlyOwner {
        _setRequestGasLimit(_requestGasLimit);
    }

    function _setRequestGasLimit(uint256 _requestGasLimit) internal {
        require(_requestGasLimit <= bridgeContract().maxGasPerTx(),'gas limit is higher than the Bridge maximum');
        requestGasLimit = _requestGasLimit;
    }

    /**
    * @dev Tells the address that generated the message on the other network that is currently being executed by
    * the AMB bridge.
    * @return the address of the message sender.
    */
    function messageSender() internal view returns (address) {
        return bridgeContract().messageSender();
    }

    /**
    * @dev Tells the id of the message originated on the other network.
    * @return the id of the message originated on the other network.
    */
    function messageId() internal view returns (bytes32) {
        return bridgeContract().messageId();
    }


    function setMessageFixed(bytes32 _txHash) internal {
        messageFixed[_txHash] = true;
    }

    function requestFailedMessageFix(bytes32 _txHash) external {
        require(!bridgeContract().messageCallStatus(_txHash));
        require(bridgeContract().failedMessageReceiver(_txHash) == address(this));
        require(bridgeContract().failedMessageSender(_txHash) == mediatorContractOnOtherSide());
        bytes32 dataHash = bridgeContract().failedMessageDataHash(_txHash);

        bytes4 methodSelector = ITokenManagement(address(0)).fixFailedMessage.selector;
        bytes memory data = abi.encodeWithSelector(methodSelector, dataHash);
        bridgeContract().requireToPassMessage(mediatorContractOnOtherSide(), data, requestGasLimit);
    }

}


// File @openzeppelin/contracts/math/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}


// File @openzeppelin/contracts/utils/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;


/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}
 * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
 * directly accessed.
 */
library Counters {
    using SafeMath for uint256;

    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        // The {SafeMath} overflow check can be skipped here, see the comment at the top
        counter._value += 1;
    }

    function decrement(Counter storage counter) internal {
        counter._value = counter._value.sub(1);
    }
}


// File @opengsn/gsn/contracts/0x/errors/[email protected]

// SPDX-License-Identifier:APACHE-2.0
/*

  Copyright 2020 ZeroEx Intl.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

*/

pragma solidity ^0.6.2;


library LibBytesRichErrorsV06 {

    enum InvalidByteOperationErrorCodes {
        FromLessThanOrEqualsToRequired,
        ToLessThanOrEqualsLengthRequired,
        LengthGreaterThanZeroRequired,
        LengthGreaterThanOrEqualsFourRequired,
        LengthGreaterThanOrEqualsTwentyRequired,
        LengthGreaterThanOrEqualsThirtyTwoRequired,
        LengthGreaterThanOrEqualsNestedBytesLengthRequired,
        DestinationLengthGreaterThanOrEqualSourceLengthRequired
    }

    // bytes4(keccak256("InvalidByteOperationError(uint8,uint256,uint256)"))
    bytes4 internal constant INVALID_BYTE_OPERATION_ERROR_SELECTOR =
        0x28006595;

    // solhint-disable func-name-mixedcase
    function InvalidByteOperationError(
        InvalidByteOperationErrorCodes errorCode,
        uint256 offset,
        uint256 required
    )
        internal
        pure
        returns (bytes memory)
    {
        return abi.encodeWithSelector(
            INVALID_BYTE_OPERATION_ERROR_SELECTOR,
            errorCode,
            offset,
            required
        );
    }
}


// File @opengsn/gsn/contracts/0x/errors/[email protected]

// SPDX-License-Identifier:APACHE-2.0
/*

  Copyright 2020 ZeroEx Intl.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

*/

pragma solidity ^0.6.2;


library LibRichErrorsV06 {

    // bytes4(keccak256("Error(string)"))
    bytes4 internal constant STANDARD_ERROR_SELECTOR = 0x08c379a0;

    // solhint-disable func-name-mixedcase
    /// @dev ABI encode a standard, string revert error payload.
    ///      This is the same payload that would be included by a `revert(string)`
    ///      solidity statement. It has the function signature `Error(string)`.
    /// @param message The error string.
    /// @return The ABI encoded error.
    function StandardError(string memory message)
        internal
        pure
        returns (bytes memory)
    {
        return abi.encodeWithSelector(
            STANDARD_ERROR_SELECTOR,
            bytes(message)
        );
    }
    // solhint-enable func-name-mixedcase

    /// @dev Reverts an encoded rich revert reason `errorData`.
    /// @param errorData ABI encoded error data.
    function rrevert(bytes memory errorData)
        internal
        pure
    {
        assembly {
            revert(add(errorData, 0x20), mload(errorData))
        }
    }
}


// File @opengsn/gsn/contracts/0x/[email protected]

// SPDX-License-Identifier:APACHE-2.0
/*

  Copyright 2020 ZeroEx Intl.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

*/

pragma solidity ^0.6.2;




library LibBytesV06 {

    using LibBytesV06 for bytes;

    /// @dev Gets the memory address for a byte array.
    /// @param input Byte array to lookup.
    /// @return memoryAddress Memory address of byte array. This
    ///         points to the header of the byte array which contains
    ///         the length.
    function rawAddress(bytes memory input)
        internal
        pure
        returns (uint256 memoryAddress)
    {
        assembly {
            memoryAddress := input
        }
        return memoryAddress;
    }

    /// @dev Gets the memory address for the contents of a byte array.
    /// @param input Byte array to lookup.
    /// @return memoryAddress Memory address of the contents of the byte array.
    function contentAddress(bytes memory input)
        internal
        pure
        returns (uint256 memoryAddress)
    {
        assembly {
            memoryAddress := add(input, 32)
        }
        return memoryAddress;
    }

    /// @dev Copies `length` bytes from memory location `source` to `dest`.
    /// @param dest memory address to copy bytes to.
    /// @param source memory address to copy bytes from.
    /// @param length number of bytes to copy.
    function memCopy(
        uint256 dest,
        uint256 source,
        uint256 length
    )
        internal
        pure
    {
        if (length < 32) {
            // Handle a partial word by reading destination and masking
            // off the bits we are interested in.
            // This correctly handles overlap, zero lengths and source == dest
            assembly {
                let mask := sub(exp(256, sub(32, length)), 1)
                let s := and(mload(source), not(mask))
                let d := and(mload(dest), mask)
                mstore(dest, or(s, d))
            }
        } else {
            // Skip the O(length) loop when source == dest.
            if (source == dest) {
                return;
            }

            // For large copies we copy whole words at a time. The final
            // word is aligned to the end of the range (instead of after the
            // previous) to handle partial words. So a copy will look like this:
            //
            //  ####
            //      ####
            //          ####
            //            ####
            //
            // We handle overlap in the source and destination range by
            // changing the copying direction. This prevents us from
            // overwriting parts of source that we still need to copy.
            //
            // This correctly handles source == dest
            //
            if (source > dest) {
                assembly {
                    // We subtract 32 from `sEnd` and `dEnd` because it
                    // is easier to compare with in the loop, and these
                    // are also the addresses we need for copying the
                    // last bytes.
                    length := sub(length, 32)
                    let sEnd := add(source, length)
                    let dEnd := add(dest, length)

                    // Remember the last 32 bytes of source
                    // This needs to be done here and not after the loop
                    // because we may have overwritten the last bytes in
                    // source already due to overlap.
                    let last := mload(sEnd)

                    // Copy whole words front to back
                    // Note: the first check is always true,
                    // this could have been a do-while loop.
                    // solhint-disable-next-line no-empty-blocks
                    for {} lt(source, sEnd) {} {
                        mstore(dest, mload(source))
                        source := add(source, 32)
                        dest := add(dest, 32)
                    }

                    // Write the last 32 bytes
                    mstore(dEnd, last)
                }
            } else {
                assembly {
                    // We subtract 32 from `sEnd` and `dEnd` because those
                    // are the starting points when copying a word at the end.
                    length := sub(length, 32)
                    let sEnd := add(source, length)
                    let dEnd := add(dest, length)

                    // Remember the first 32 bytes of source
                    // This needs to be done here and not after the loop
                    // because we may have overwritten the first bytes in
                    // source already due to overlap.
                    let first := mload(source)

                    // Copy whole words back to front
                    // We use a signed comparisson here to allow dEnd to become
                    // negative (happens when source and dest < 32). Valid
                    // addresses in local memory will never be larger than
                    // 2**255, so they can be safely re-interpreted as signed.
                    // Note: the first check is always true,
                    // this could have been a do-while loop.
                    // solhint-disable-next-line no-empty-blocks
                    for {} slt(dest, dEnd) {} {
                        mstore(dEnd, mload(sEnd))
                        sEnd := sub(sEnd, 32)
                        dEnd := sub(dEnd, 32)
                    }

                    // Write the first 32 bytes
                    mstore(dest, first)
                }
            }
        }
    }

    /// @dev Returns a slices from a byte array.
    /// @param b The byte array to take a slice from.
    /// @param from The starting index for the slice (inclusive).
    /// @param to The final index for the slice (exclusive).
    /// @return result The slice containing bytes at indices [from, to)
    function slice(
        bytes memory b,
        uint256 from,
        uint256 to
    )
        internal
        pure
        returns (bytes memory result)
    {
        // Ensure that the from and to positions are valid positions for a slice within
        // the byte array that is being used.
        if (from > to) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.FromLessThanOrEqualsToRequired,
                from,
                to
            ));
        }
        if (to > b.length) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.ToLessThanOrEqualsLengthRequired,
                to,
                b.length
            ));
        }

        // Create a new bytes structure and copy contents
        result = new bytes(to - from);
        memCopy(
            result.contentAddress(),
            b.contentAddress() + from,
            result.length
        );
        return result;
    }

    /// @dev Returns a slice from a byte array without preserving the input.
    ///      When `from == 0`, the original array will match the slice.
    ///      In other cases its state will be corrupted.
    /// @param b The byte array to take a slice from. Will be destroyed in the process.
    /// @param from The starting index for the slice (inclusive).
    /// @param to The final index for the slice (exclusive).
    /// @return result The slice containing bytes at indices [from, to)
    function sliceDestructive(
        bytes memory b,
        uint256 from,
        uint256 to
    )
        internal
        pure
        returns (bytes memory result)
    {
        // Ensure that the from and to positions are valid positions for a slice within
        // the byte array that is being used.
        if (from > to) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.FromLessThanOrEqualsToRequired,
                from,
                to
            ));
        }
        if (to > b.length) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.ToLessThanOrEqualsLengthRequired,
                to,
                b.length
            ));
        }

        // Create a new bytes structure around [from, to) in-place.
        assembly {
            result := add(b, from)
            mstore(result, sub(to, from))
        }
        return result;
    }

    /// @dev Pops the last byte off of a byte array by modifying its length.
    /// @param b Byte array that will be modified.
    /// @return result The byte that was popped off.
    function popLastByte(bytes memory b)
        internal
        pure
        returns (bytes1 result)
    {
        if (b.length == 0) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanZeroRequired,
                b.length,
                0
            ));
        }

        // Store last byte.
        result = b[b.length - 1];

        assembly {
            // Decrement length of byte array.
            let newLen := sub(mload(b), 1)
            mstore(b, newLen)
        }
        return result;
    }

    /// @dev Tests equality of two byte arrays.
    /// @param lhs First byte array to compare.
    /// @param rhs Second byte array to compare.
    /// @return equal True if arrays are the same. False otherwise.
    function equals(
        bytes memory lhs,
        bytes memory rhs
    )
        internal
        pure
        returns (bool equal)
    {
        // Keccak gas cost is 30 + numWords * 6. This is a cheap way to compare.
        // We early exit on unequal lengths, but keccak would also correctly
        // handle this.
        return lhs.length == rhs.length && keccak256(lhs) == keccak256(rhs);
    }

    /// @dev Reads an address from a position in a byte array.
    /// @param b Byte array containing an address.
    /// @param index Index in byte array of address.
    /// @return result address from byte array.
    function readAddress(
        bytes memory b,
        uint256 index
    )
        internal
        pure
        returns (address result)
    {
        if (b.length < index + 20) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsTwentyRequired,
                b.length,
                index + 20 // 20 is length of address
            ));
        }

        // Add offset to index:
        // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)
        // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)
        index += 20;

        // Read address from array memory
        assembly {
            // 1. Add index to address of bytes array
            // 2. Load 32-byte word from memory
            // 3. Apply 20-byte mask to obtain address
            result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)
        }
        return result;
    }

    /// @dev Writes an address into a specific position in a byte array.
    /// @param b Byte array to insert address into.
    /// @param index Index in byte array of address.
    /// @param input Address to put into byte array.
    function writeAddress(
        bytes memory b,
        uint256 index,
        address input
    )
        internal
        pure
    {
        if (b.length < index + 20) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsTwentyRequired,
                b.length,
                index + 20 // 20 is length of address
            ));
        }

        // Add offset to index:
        // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)
        // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)
        index += 20;

        // Store address into array memory
        assembly {
            // The address occupies 20 bytes and mstore stores 32 bytes.
            // First fetch the 32-byte word where we'll be storing the address, then
            // apply a mask so we have only the bytes in the word that the address will not occupy.
            // Then combine these bytes with the address and store the 32 bytes back to memory with mstore.

            // 1. Add index to address of bytes array
            // 2. Load 32-byte word from memory
            // 3. Apply 12-byte mask to obtain extra bytes occupying word of memory where we'll store the address
            let neighbors := and(
                mload(add(b, index)),
                0xffffffffffffffffffffffff0000000000000000000000000000000000000000
            )

            // Make sure input address is clean.
            // (Solidity does not guarantee this)
            input := and(input, 0xffffffffffffffffffffffffffffffffffffffff)

            // Store the neighbors and address into memory
            mstore(add(b, index), xor(input, neighbors))
        }
    }

    /// @dev Reads a bytes32 value from a position in a byte array.
    /// @param b Byte array containing a bytes32 value.
    /// @param index Index in byte array of bytes32 value.
    /// @return result bytes32 value from byte array.
    function readBytes32(
        bytes memory b,
        uint256 index
    )
        internal
        pure
        returns (bytes32 result)
    {
        if (b.length < index + 32) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsThirtyTwoRequired,
                b.length,
                index + 32
            ));
        }

        // Arrays are prefixed by a 256 bit length parameter
        index += 32;

        // Read the bytes32 from array memory
        assembly {
            result := mload(add(b, index))
        }
        return result;
    }

    /// @dev Writes a bytes32 into a specific position in a byte array.
    /// @param b Byte array to insert <input> into.
    /// @param index Index in byte array of <input>.
    /// @param input bytes32 to put into byte array.
    function writeBytes32(
        bytes memory b,
        uint256 index,
        bytes32 input
    )
        internal
        pure
    {
        if (b.length < index + 32) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsThirtyTwoRequired,
                b.length,
                index + 32
            ));
        }

        // Arrays are prefixed by a 256 bit length parameter
        index += 32;

        // Read the bytes32 from array memory
        assembly {
            mstore(add(b, index), input)
        }
    }

    /// @dev Reads a uint256 value from a position in a byte array.
    /// @param b Byte array containing a uint256 value.
    /// @param index Index in byte array of uint256 value.
    /// @return result uint256 value from byte array.
    function readUint256(
        bytes memory b,
        uint256 index
    )
        internal
        pure
        returns (uint256 result)
    {
        result = uint256(readBytes32(b, index));
        return result;
    }

    /// @dev Writes a uint256 into a specific position in a byte array.
    /// @param b Byte array to insert <input> into.
    /// @param index Index in byte array of <input>.
    /// @param input uint256 to put into byte array.
    function writeUint256(
        bytes memory b,
        uint256 index,
        uint256 input
    )
        internal
        pure
    {
        writeBytes32(b, index, bytes32(input));
    }

    /// @dev Reads an unpadded bytes4 value from a position in a byte array.
    /// @param b Byte array containing a bytes4 value.
    /// @param index Index in byte array of bytes4 value.
    /// @return result bytes4 value from byte array.
    function readBytes4(
        bytes memory b,
        uint256 index
    )
        internal
        pure
        returns (bytes4 result)
    {
        if (b.length < index + 4) {
            LibRichErrorsV06.rrevert(LibBytesRichErrorsV06.InvalidByteOperationError(
                LibBytesRichErrorsV06.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsFourRequired,
                b.length,
                index + 4
            ));
        }

        // Arrays are prefixed by a 32 byte length field
        index += 32;

        // Read the bytes4 from array memory
        assembly {
            result := mload(add(b, index))
            // Solidity does not require us to clean the trailing bytes.
            // We do it anyway
            result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)
        }
        return result;
    }

    /// @dev Writes a new length to a byte array.
    ///      Decreasing length will lead to removing the corresponding lower order bytes from the byte array.
    ///      Increasing length may lead to appending adjacent in-memory bytes to the end of the byte array.
    /// @param b Bytes array to write new length to.
    /// @param length New length of byte array.
    function writeLength(bytes memory b, uint256 length)
        internal
        pure
    {
        assembly {
            mstore(b, length)
        }
    }
}


// File @opengsn/gsn/contracts/interfaces/[email protected]

// SPDX-License-Identifier:MIT
pragma solidity ^0.6.2;

/**
 * a contract must implement this interface in order to support relayed transaction.
 * It is better to inherit the BaseRelayRecipient as its implementation.
 */
abstract contract IRelayRecipient {

    /**
     * return if the forwarder is trusted to forward relayed transactions to us.
     * the forwarder is required to verify the sender's signature, and verify
     * the call is not a replay.
     */
    function isTrustedForwarder(address forwarder) public virtual view returns(bool);

    /**
     * return the sender of this call.
     * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes
     * of the msg.data.
     * otherwise, return `msg.sender`
     * should be used in the contract anywhere instead of msg.sender
     */
    function _msgSender() internal virtual view returns (address payable);

    function versionRecipient() external virtual view returns (string memory);
}


// File @opengsn/gsn/contracts/[email protected]

// SPDX-License-Identifier:MIT
pragma solidity ^0.6.2;



/**
 * A base contract to be inherited by any contract that want to receive relayed transactions
 * A subclass must use "_msgSender()" instead of "msg.sender"
 */
abstract contract BaseRelayRecipient is IRelayRecipient {

    /// the TrustedForwarder singleton we accept calls from.
    // we trust it to verify the caller's signature, and pass the caller's address as last 20 bytes
    address internal trustedForwarder;

    /*
     * require a function to be called through GSN only
     */
    modifier trustedForwarderOnly() {
        require(msg.sender == address(trustedForwarder), "Function can only be called through trustedForwarder");
        _;
    }

    function isTrustedForwarder(address forwarder) public override view returns(bool) {
        return forwarder == trustedForwarder;
    }

    /**
     * return the sender of this call.
     * if the call came through our trusted forwarder, return the original sender.
     * otherwise, return `msg.sender`.
     * should be used in the contract anywhere instead of msg.sender
     */
    function _msgSender() internal override virtual view returns (address payable) {
        if (msg.data.length >= 24 && isTrustedForwarder(msg.sender)) {
            // At this point we know that the sender is a trusted forwarder,
            // so we trust that the last bytes of msg.data are the verified sender address.
            // extract sender address from the end of msg.data
            return address(uint160(LibBytesV06.readAddress(msg.data, msg.data.length - 20)));
        }
        return msg.sender;
    }
}


// File @openzeppelin/contracts/utils/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
 * (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint256(_at(set._inner, index)));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if t...

// [truncated — 135347 bytes total]

Read Contract

balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
bridgeContract 0xcd596583 → address
bridgeContractAddress 0xa2d2b773 → address
getApproved 0x081812fc → address
inkTokenByIndex 0x1a5dfa9a → uint256
inkTokenCount 0x7352fb9b → uint256
isApprovedForAll 0xe985e9c5 → bool
mediatorContractOnOtherSide 0x871c0760 → address
messageFixed 0x59339982 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
requestGasLimit 0xbe3b625b → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenInk 0xe5d316b5 → string
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256

Write Contract 12 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address to
uint256 tokenId
mint 0x2fb102cf
address to
uint256 tokenId
string inkUrl
string jsonUrl
returns: uint256
renounceOwnership 0x715018a6
No parameters
requestFailedMessageFix 0x9a4a4395
bytes32 _txHash
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBridgeContract 0x0b26cf66
address _bridgeContract
setMediatorContractOnOtherSide 0x6e5d6bea
address _mediatorContract
setRequestGasLimit 0xf3b83791
uint256 _requestGasLimit
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner

Top Interactions

AddressTxnsSentReceived
0xBCaF0C98...969C 6 6

Recent Transactions

CSV
|
Hash Method Block Age From/To Value Txn Fee Type
0x47282335...948dfd 0x6e5d6bea 10,654,173 IN 0xBCaF0C98...969C 0 ETH 0.00430998 ETH Legacy
0xb0a970d4...85a2d6 0x6e5d6bea 10,646,236 IN 0xBCaF0C98...969C 0 ETH 0.00676304 ETH Legacy
0xfc470a2e...7ec7ee 0x6e5d6bea 10,609,667 IN 0xBCaF0C98...969C 0 ETH 0.00178448 ETH Legacy
0x43660612...902a1a 0xf3b83791 10,609,666 IN 0xBCaF0C98...969C 0 ETH 0.00199334 ETH Legacy
0x59260c50...4bec9c 0x0b26cf66 10,609,663 IN 0xBCaF0C98...969C 0 ETH 0.00181540 ETH Legacy
0x586fa815...31196e 0x60806040 10,609,662 IN 0xBCaF0C98...969C 0 ETH 0.11175981 ETH Legacy