From cfc158cc0f742c85bf620e7ac3ac851ac5fd0d3c Mon Sep 17 00:00:00 2001 From: Facu Spagnuolo Date: Tue, 1 Feb 2022 10:12:08 -0300 Subject: [PATCH 1/2] implement event handlers --- .gitignore | 6 +- abis/Artist.json | 805 ++++++++++++++++++++++++++++++++++++++++ abis/ArtistCreator.json | 314 ++++++++++++++++ abis/BeaconProxy.json | 57 --- abis/ERC721.json | 422 --------------------- package.json | 6 +- schema.graphql | 109 ++++-- src/Artist.ts | 252 +++++++++++++ src/ArtistCreator.ts | 19 + src/erc721.ts | 87 ----- src/mapping.ts | 31 -- subgraph.yaml | 58 +-- yarn.lock | 4 +- 13 files changed, 1510 insertions(+), 660 deletions(-) create mode 100644 abis/Artist.json create mode 100644 abis/ArtistCreator.json delete mode 100644 abis/BeaconProxy.json delete mode 100644 abis/ERC721.json create mode 100644 src/Artist.ts create mode 100644 src/ArtistCreator.ts delete mode 100644 src/erc721.ts delete mode 100644 src/mapping.ts diff --git a/.gitignore b/.gitignore index c42003a..acbac95 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -build/ -generated/ -node_modules/ \ No newline at end of file +build +generated +node_modules diff --git a/abis/Artist.json b/abis/Artist.json new file mode 100644 index 0000000..799872d --- /dev/null +++ b/abis/Artist.json @@ -0,0 +1,805 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Artist", + "sourceName": "contracts/Artist.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "editionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "fundingRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "quantity", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "royaltyBPS", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "startTime", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "endTime", + "type": "uint32" + } + ], + "name": "EditionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "editionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "numSold", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "buyer", + "type": "address" + } + ], + "name": "EditionPurchased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_editionId", + "type": "uint256" + } + ], + "name": "buyEdition", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "contractURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_fundingRecipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "_quantity", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_royaltyBPS", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_startTime", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_endTime", + "type": "uint32" + } + ], + "name": "createEdition", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "depositedForEdition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "editions", + "outputs": [ + { + "internalType": "address payable", + "name": "fundingRecipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "numSold", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "quantity", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "royaltyBPS", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "startTime", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "endTime", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_editionId", + "type": "uint256" + } + ], + "name": "getOwnersOfEdition", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_editionId", + "type": "uint256" + } + ], + "name": "getTokenIdsOfEdition", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_artistId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "_baseURI", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_editionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_salePrice", + "type": "uint256" + } + ], + "name": "royaltyInfo", + "outputs": [ + { + "internalType": "address", + "name": "fundingRecipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "royaltyAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_editionId", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "_endTime", + "type": "uint32" + } + ], + "name": "setEndTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_editionId", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "_startTime", + "type": "uint32" + } + ], + "name": "setStartTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "tokenToEdition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_editionId", + "type": "uint256" + } + ], + "name": "withdrawFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "withdrawnForEdition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50612a71806100206000396000f3fe6080604052600436106101d85760003560e01c8063715018a611610102578063bd8616ec11610095578063e8a3d48511610064578063e8a3d4851461064f578063e985e9c514610664578063f2fde38b146106ad578063fbab9e04146106cd57600080fd5b8063bd8616ec146105c2578063c87b56dd146105d5578063d3bb0528146105f5578063e1a3d5731461062257600080fd5b8063a22cb465116100d1578063a22cb46514610542578063abfc83a014610562578063b88d4fde14610582578063bb314ca1146105a257600080fd5b8063715018a6146104cd57806374e79189146104e25780638da5cb5b1461050f57806395d89b411461052d57600080fd5b806323b872dd1161017a57806342842e0e1161014957806342842e0e14610440578063602787ed146104605780636352211e1461048d57806370a08231146104ad57600080fd5b806323b872dd146102fe578063279c806e1461031e5780632a55205a146103e15780633fafef291461042057600080fd5b8063095ea7b3116101b6578063095ea7b31461026c57806313dd29601461028e578063155dd5ee146102bb57806318160ddd146102db57600080fd5b806301ffc9a7146101dd57806306fdde0314610212578063081812fc14610234575b600080fd5b3480156101e957600080fd5b506101fd6101f8366004612496565b6106ed565b60405190151581526020015b60405180910390f35b34801561021e57600080fd5b50610227610718565b6040516102099190612766565b34801561024057600080fd5b5061025461024f3660046124d0565b6107aa565b6040516001600160a01b039091168152602001610209565b34801561027857600080fd5b5061028c6102873660046123c5565b610844565b005b34801561029a57600080fd5b506102ae6102a93660046124d0565b61095a565b60405161020991906126e1565b3480156102c757600080fd5b5061028c6102d63660046124d0565b610a3b565b3480156102e757600080fd5b506102f0610a9b565b604051908152602001610209565b34801561030a57600080fd5b5061028c6103193660046122d1565b610ab7565b34801561032a57600080fd5b506103956103393660046124d0565b60cc602052600090815260409020805460018201546002909201546001600160a01b03909116919063ffffffff808216916401000000008104821691600160401b8204811691600160601b8104821691600160801b9091041687565b604080516001600160a01b039098168852602088019690965263ffffffff94851695870195909552918316606086015282166080850152811660a08401521660c082015260e001610209565b3480156103ed57600080fd5b506104016103fc3660046124e9565b610ae8565b604080516001600160a01b039093168352602083019190915201610209565b34801561042c57600080fd5b5061028c61043b366004612229565b610bb1565b34801561044c57600080fd5b5061028c61045b3660046122d1565b610d9f565b34801561046c57600080fd5b506102f061047b3660046124d0565b60cd6020526000908152604090205481565b34801561049957600080fd5b506102546104a83660046124d0565b610dba565b3480156104b957600080fd5b506102f06104c836600461220c565b610e31565b3480156104d957600080fd5b5061028c610eb8565b3480156104ee57600080fd5b506105026104fd3660046124d0565b610eee565b604051610209919061272e565b34801561051b57600080fd5b506097546001600160a01b0316610254565b34801561053957600080fd5b50610227610fb1565b34801561054e57600080fd5b5061028c61055d366004612392565b610fc0565b34801561056e57600080fd5b5061028c61057d3660046123f1565b610fcb565b34801561058e57600080fd5b5061028c61059d366004612312565b6110ff565b3480156105ae57600080fd5b5061028c6105bd36600461250b565b611137565b61028c6105d03660046124d0565b611197565b3480156105e157600080fd5b506102276105f03660046124d0565b6114b2565b34801561060157600080fd5b506102f06106103660046124d0565b60cf6020526000908152604090205481565b34801561062e57600080fd5b506102f061063d3660046124d0565b60ce6020526000908152604090205481565b34801561065b57600080fd5b5061022761157d565b34801561067057600080fd5b506101fd61067f366004612298565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b3480156106b957600080fd5b5061028c6106c836600461220c565b6115a5565b3480156106d957600080fd5b5061028c6106e836600461250b565b61163d565b600063152a902d60e11b6001600160e01b03198316148061071257506107128261169d565b92915050565b6060606580546107279061292a565b80601f01602080910402602001604051908101604052809291908181526020018280546107539061292a565b80156107a05780601f10610775576101008083540402835291602001916107a0565b820191906000526020600020905b81548152906001019060200180831161078357829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166108285760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b600061084f82610dba565b9050806001600160a01b0316836001600160a01b031614156108bd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161081f565b336001600160a01b03821614806108d957506108d9813361067f565b61094b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161081f565b61095583836116ed565b505050565b600081815260cc60205260408120600201546060919063ffffffff1667ffffffffffffffff81111561098e5761098e6129fa565b6040519080825280602002602001820160405280156109b7578160200160208202803683370190505b509050600060015b60ca54811015610a3257600081815260cd6020526040902054851415610a20576109e881610dba565b8383815181106109fa576109fa6129e4565b6001600160a01b039092166020928302919091019091015281610a1c81612965565b9250505b80610a2a81612965565b9150506109bf565b50909392505050565b600081815260cf602090815260408083205460ce909252822054610a5f91906128e7565b600083815260ce602090815260408083205460cf83528184205560cc909152902054909150610a97906001600160a01b03168261175b565b5050565b60006001610aa860ca5490565b610ab291906128e7565b905090565b610ac13382611868565b610add5760405162461bcd60e51b815260040161081f90612800565b61095583838361195f565b600082815260cc60209081526040808320815160e08101835281546001600160a01b031680825260018301549482019490945260029091015463ffffffff80821693830193909352640100000000810483166060830152600160401b810483166080830152600160601b8104831660a0830152600160801b900490911660c08201528291610b7c5751915060009050610baa565b6080810151815163ffffffff90911690612710610b9983886128c8565b610ba391906128b4565b9350935050505b9250929050565b6097546001600160a01b03163314610bdb5760405162461bcd60e51b815260040161081f906127cb565b6040518060e00160405280876001600160a01b03168152602001868152602001600063ffffffff1681526020018563ffffffff1681526020018463ffffffff1681526020018363ffffffff1681526020018263ffffffff1681525060cc6000610c4360cb5490565b81526020808201929092526040908101600020835181546001600160a01b039091166001600160a01b0319909116178155918301516001830155820151600290910180546060840151608085015160a086015160c09096015163ffffffff908116600160801b0263ffffffff60801b19978216600160601b0263ffffffff60601b19938316600160401b02939093166fffffffffffffffff0000000000000000199483166401000000000267ffffffffffffffff1990961692909716919091179390931791909116939093179290921792909216179055610d2360cb5490565b604080516001600160a01b03891681526020810188905263ffffffff8781168284015286811660608301528581166080830152841660a082015290517fb3131d7d301f8caeb40981cffc627b1fdf324b5e4a23845b61c1a6ad2a25f3859181900360c00190a2610d9760cb80546001019055565b505050505050565b610955838383604051806020016040528060008152506110ff565b6000818152606760205260408120546001600160a01b0316806107125760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161081f565b60006001600160a01b038216610e9c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161081f565b506001600160a01b031660009081526068602052604090205490565b6097546001600160a01b03163314610ee25760405162461bcd60e51b815260040161081f906127cb565b610eec6000611aff565b565b600081815260cc60205260408120600201546060919063ffffffff1667ffffffffffffffff811115610f2257610f226129fa565b604051908082528060200260200182016040528015610f4b578160200160208202803683370190505b509050600060015b60ca54811015610a3257600081815260cd6020526040902054851415610f9f5780838381518110610f8657610f866129e4565b602090810291909101015281610f9b81612965565b9250505b80610fa981612965565b915050610f53565b6060606680546107279061292a565b610a97338383611b51565b600054610100900460ff16610fe65760005460ff1615610fea565b303b155b61104d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161081f565b600054610100900460ff1615801561106f576000805461ffff19166101011790555b6110798484611c20565b611081611c61565b61108a866115a5565b8161109486611c98565b6040516020016110a59291906125fd565b60405160208183030381529060405260c990805190602001906110c99291906120bd565b506110d860ca80546001019055565b6110e660cb80546001019055565b8015610d97576000805461ff0019169055505050505050565b6111093383611868565b6111255760405162461bcd60e51b815260040161081f90612800565b61113184848484611d96565b50505050565b6097546001600160a01b031633146111615760405162461bcd60e51b815260040161081f906127cb565b600091825260cc6020526040909120600201805463ffffffff909216600160801b0263ffffffff60801b19909216919091179055565b600081815260cc6020526040902060020154640100000000900463ffffffff166111fc5760405162461bcd60e51b815260206004820152601660248201527511591a5d1a5bdb88191bd95cc81b9bdd08195e1a5cdd60521b604482015260640161081f565b600081815260cc602052604090206002015463ffffffff640100000000820481169116106112765760405162461bcd60e51b815260206004820152602160248201527f546869732065646974696f6e20697320616c726561647920736f6c64206f75746044820152601760f91b606482015260840161081f565b600081815260cc60205260409020600101543410156112e95760405162461bcd60e51b815260206004820152602960248201527f4d7573742073656e6420656e6f75676820746f207075726368617365207468656044820152681032b234ba34b7b71760b91b606482015260840161081f565b600081815260cc602052604090206002015442600160601b90910463ffffffff16106113505760405162461bcd60e51b8152602060048201526016602482015275105d58dd1a5bdb881a185cdb89dd081cdd185c9d195960521b604482015260640161081f565b600081815260cc602052604090206002015442600160801b90910463ffffffff16116113b25760405162461bcd60e51b8152602060048201526011602482015270105d58dd1a5bdb881a185cc8195b991959607a1b604482015260640161081f565b6113c4336113bf60ca5490565b611dc9565b600081815260ce6020526040812080543492906113e290849061289c565b9091555050600081815260cc60205260408120600201805463ffffffff169161140a83612980565b91906101000a81548163ffffffff021916908363ffffffff160217905550508060cd600061143760ca5490565b81526020810191909152604001600020553361145260ca5490565b600083815260cc602090815260409182902060020154915163ffffffff909216825284917fe38cb07a52e5d88a83de7c9d29c2841118103e462d20f8c526b35872f9977785910160405180910390a46114af60ca80546001019055565b50565b6000818152606760205260409020546060906001600160a01b03166115315760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161081f565b600082815260cd602052604090205460c99061154c90611c98565b61155584611c98565b60405160200161156793929190612638565b6040516020818303038152906040529050919050565b606060c9604051602001611591919061267e565b604051602081830303815290604052905090565b6097546001600160a01b031633146115cf5760405162461bcd60e51b815260040161081f906127cb565b6001600160a01b0381166116345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161081f565b6114af81611aff565b6097546001600160a01b031633146116675760405162461bcd60e51b815260040161081f906127cb565b600091825260cc6020526040909120600201805463ffffffff909216600160601b0263ffffffff60601b19909216919091179055565b60006001600160e01b031982166380ac58cd60e01b14806116ce57506001600160e01b03198216635b5e139f60e01b145b8061071257506301ffc9a760e01b6001600160e01b0319831614610712565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061172282610dba565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b804710156117ab5760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742062616c616e636520666f722073656e64000000604482015260640161081f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146117f8576040519150601f19603f3d011682016040523d82523d6000602084013e6117fd565b606091505b50509050806109555760405162461bcd60e51b815260206004820152603160248201527f556e61626c6520746f2073656e642076616c75653a20726563697069656e74206044820152701b585e481a185d99481c995d995c9d1959607a1b606482015260840161081f565b6000818152606760205260408120546001600160a01b03166118e15760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161081f565b60006118ec83610dba565b9050806001600160a01b0316846001600160a01b031614806119275750836001600160a01b031661191c846107aa565b6001600160a01b0316145b8061195757506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661197282610dba565b6001600160a01b0316146119da5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161081f565b6001600160a01b038216611a3c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161081f565b611a476000826116ed565b6001600160a01b0383166000908152606860205260408120805460019290611a709084906128e7565b90915550506001600160a01b0382166000908152606860205260408120805460019290611a9e90849061289c565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611bb35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161081f565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600054610100900460ff16611c475760405162461bcd60e51b815260040161081f90612851565b611c4f611f0b565b611c57611f0b565b610a978282611f32565b600054610100900460ff16611c885760405162461bcd60e51b815260040161081f90612851565b611c90611f0b565b610eec611f80565b606081611cbc5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611ce65780611cd081612965565b9150611cdf9050600a836128b4565b9150611cc0565b60008167ffffffffffffffff811115611d0157611d016129fa565b6040519080825280601f01601f191660200182016040528015611d2b576020820181803683370190505b5090505b841561195757611d406001836128e7565b9150611d4d600a866129a4565b611d5890603061289c565b60f81b818381518110611d6d57611d6d6129e4565b60200101906001600160f81b031916908160001a905350611d8f600a866128b4565b9450611d2f565b611da184848461195f565b611dad84848484611fb0565b6111315760405162461bcd60e51b815260040161081f90612779565b6001600160a01b038216611e1f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161081f565b6000818152606760205260409020546001600160a01b031615611e845760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161081f565b6001600160a01b0382166000908152606860205260408120805460019290611ead90849061289c565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600054610100900460ff16610eec5760405162461bcd60e51b815260040161081f90612851565b600054610100900460ff16611f595760405162461bcd60e51b815260040161081f90612851565b8151611f6c9060659060208501906120bd565b5080516109559060669060208401906120bd565b600054610100900460ff16611fa75760405162461bcd60e51b815260040161081f90612851565b610eec33611aff565b60006001600160a01b0384163b156120b257604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611ff49033908990889088906004016126a4565b602060405180830381600087803b15801561200e57600080fd5b505af192505050801561203e575060408051601f3d908101601f1916820190925261203b918101906124b3565b60015b612098573d80801561206c576040519150601f19603f3d011682016040523d82523d6000602084013e612071565b606091505b5080516120905760405162461bcd60e51b815260040161081f90612779565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611957565b506001949350505050565b8280546120c99061292a565b90600052602060002090601f0160209004810192826120eb5760008555612131565b82601f1061210457805160ff1916838001178555612131565b82800160010185558215612131579182015b82811115612131578251825591602001919060010190612116565b5061213d929150612141565b5090565b5b8082111561213d5760008155600101612142565b600067ffffffffffffffff80841115612171576121716129fa565b604051601f8501601f19908116603f01168101908282118183101715612199576121996129fa565b816040528093508581528686860111156121b257600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126121dd57600080fd5b6121ec83833560208501612156565b9392505050565b803563ffffffff8116811461220757600080fd5b919050565b60006020828403121561221e57600080fd5b81356121ec81612a10565b60008060008060008060c0878903121561224257600080fd5b863561224d81612a10565b955060208701359450612262604088016121f3565b9350612270606088016121f3565b925061227e608088016121f3565b915061228c60a088016121f3565b90509295509295509295565b600080604083850312156122ab57600080fd5b82356122b681612a10565b915060208301356122c681612a10565b809150509250929050565b6000806000606084860312156122e657600080fd5b83356122f181612a10565b9250602084013561230181612a10565b929592945050506040919091013590565b6000806000806080858703121561232857600080fd5b843561233381612a10565b9350602085013561234381612a10565b925060408501359150606085013567ffffffffffffffff81111561236657600080fd5b8501601f8101871361237757600080fd5b61238687823560208401612156565b91505092959194509250565b600080604083850312156123a557600080fd5b82356123b081612a10565b9150602083013580151581146122c657600080fd5b600080604083850312156123d857600080fd5b82356123e381612a10565b946020939093013593505050565b600080600080600060a0868803121561240957600080fd5b853561241481612a10565b945060208601359350604086013567ffffffffffffffff8082111561243857600080fd5b61244489838a016121cc565b9450606088013591508082111561245a57600080fd5b61246689838a016121cc565b9350608088013591508082111561247c57600080fd5b50612489888289016121cc565b9150509295509295909350565b6000602082840312156124a857600080fd5b81356121ec81612a25565b6000602082840312156124c557600080fd5b81516121ec81612a25565b6000602082840312156124e257600080fd5b5035919050565b600080604083850312156124fc57600080fd5b50508035926020909101359150565b6000806040838503121561251e57600080fd5b8235915061252e602084016121f3565b90509250929050565b6000815180845261254f8160208601602086016128fe565b601f01601f19169290920160200192915050565b8054600090600181811c908083168061257d57607f831692505b602080841082141561259f57634e487b7160e01b600052602260045260246000fd5b8180156125b357600181146125c4576125f1565b60ff198616895284890196506125f1565b60008881526020902060005b868110156125e95781548b8201529085019083016125d0565b505084890196505b50505050505092915050565b6000835161260f8184602088016128fe565b8351908301906126238183602088016128fe565b602f60f81b9101908152600101949350505050565b60006126448286612563565b84516126548183602089016128fe565b602f60f81b910190815283516126718160018401602088016128fe565b0160010195945050505050565b600061268a8284612563565b691cdd1bdc99599c9bdb9d60b21b8152600a019392505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906126d790830184612537565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127225783516001600160a01b0316835292840192918401916001016126fd565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127225783518352928401929184019160010161274a565b6020815260006121ec6020830184612537565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082198211156128af576128af6129b8565b500190565b6000826128c3576128c36129ce565b500490565b60008160001904831182151516156128e2576128e26129b8565b500290565b6000828210156128f9576128f96129b8565b500390565b60005b83811015612919578181015183820152602001612901565b838111156111315750506000910152565b600181811c9082168061293e57607f821691505b6020821081141561295f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612979576129796129b8565b5060010190565b600063ffffffff8083168181141561299a5761299a6129b8565b6001019392505050565b6000826129b3576129b36129ce565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146114af57600080fd5b6001600160e01b0319811681146114af57600080fdfea2646970667358221220688d6bf43e5d68af458be79674990456921e4379f43e1ed568307127798e55d664736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106101d85760003560e01c8063715018a611610102578063bd8616ec11610095578063e8a3d48511610064578063e8a3d4851461064f578063e985e9c514610664578063f2fde38b146106ad578063fbab9e04146106cd57600080fd5b8063bd8616ec146105c2578063c87b56dd146105d5578063d3bb0528146105f5578063e1a3d5731461062257600080fd5b8063a22cb465116100d1578063a22cb46514610542578063abfc83a014610562578063b88d4fde14610582578063bb314ca1146105a257600080fd5b8063715018a6146104cd57806374e79189146104e25780638da5cb5b1461050f57806395d89b411461052d57600080fd5b806323b872dd1161017a57806342842e0e1161014957806342842e0e14610440578063602787ed146104605780636352211e1461048d57806370a08231146104ad57600080fd5b806323b872dd146102fe578063279c806e1461031e5780632a55205a146103e15780633fafef291461042057600080fd5b8063095ea7b3116101b6578063095ea7b31461026c57806313dd29601461028e578063155dd5ee146102bb57806318160ddd146102db57600080fd5b806301ffc9a7146101dd57806306fdde0314610212578063081812fc14610234575b600080fd5b3480156101e957600080fd5b506101fd6101f8366004612496565b6106ed565b60405190151581526020015b60405180910390f35b34801561021e57600080fd5b50610227610718565b6040516102099190612766565b34801561024057600080fd5b5061025461024f3660046124d0565b6107aa565b6040516001600160a01b039091168152602001610209565b34801561027857600080fd5b5061028c6102873660046123c5565b610844565b005b34801561029a57600080fd5b506102ae6102a93660046124d0565b61095a565b60405161020991906126e1565b3480156102c757600080fd5b5061028c6102d63660046124d0565b610a3b565b3480156102e757600080fd5b506102f0610a9b565b604051908152602001610209565b34801561030a57600080fd5b5061028c6103193660046122d1565b610ab7565b34801561032a57600080fd5b506103956103393660046124d0565b60cc602052600090815260409020805460018201546002909201546001600160a01b03909116919063ffffffff808216916401000000008104821691600160401b8204811691600160601b8104821691600160801b9091041687565b604080516001600160a01b039098168852602088019690965263ffffffff94851695870195909552918316606086015282166080850152811660a08401521660c082015260e001610209565b3480156103ed57600080fd5b506104016103fc3660046124e9565b610ae8565b604080516001600160a01b039093168352602083019190915201610209565b34801561042c57600080fd5b5061028c61043b366004612229565b610bb1565b34801561044c57600080fd5b5061028c61045b3660046122d1565b610d9f565b34801561046c57600080fd5b506102f061047b3660046124d0565b60cd6020526000908152604090205481565b34801561049957600080fd5b506102546104a83660046124d0565b610dba565b3480156104b957600080fd5b506102f06104c836600461220c565b610e31565b3480156104d957600080fd5b5061028c610eb8565b3480156104ee57600080fd5b506105026104fd3660046124d0565b610eee565b604051610209919061272e565b34801561051b57600080fd5b506097546001600160a01b0316610254565b34801561053957600080fd5b50610227610fb1565b34801561054e57600080fd5b5061028c61055d366004612392565b610fc0565b34801561056e57600080fd5b5061028c61057d3660046123f1565b610fcb565b34801561058e57600080fd5b5061028c61059d366004612312565b6110ff565b3480156105ae57600080fd5b5061028c6105bd36600461250b565b611137565b61028c6105d03660046124d0565b611197565b3480156105e157600080fd5b506102276105f03660046124d0565b6114b2565b34801561060157600080fd5b506102f06106103660046124d0565b60cf6020526000908152604090205481565b34801561062e57600080fd5b506102f061063d3660046124d0565b60ce6020526000908152604090205481565b34801561065b57600080fd5b5061022761157d565b34801561067057600080fd5b506101fd61067f366004612298565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b3480156106b957600080fd5b5061028c6106c836600461220c565b6115a5565b3480156106d957600080fd5b5061028c6106e836600461250b565b61163d565b600063152a902d60e11b6001600160e01b03198316148061071257506107128261169d565b92915050565b6060606580546107279061292a565b80601f01602080910402602001604051908101604052809291908181526020018280546107539061292a565b80156107a05780601f10610775576101008083540402835291602001916107a0565b820191906000526020600020905b81548152906001019060200180831161078357829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166108285760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b600061084f82610dba565b9050806001600160a01b0316836001600160a01b031614156108bd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161081f565b336001600160a01b03821614806108d957506108d9813361067f565b61094b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161081f565b61095583836116ed565b505050565b600081815260cc60205260408120600201546060919063ffffffff1667ffffffffffffffff81111561098e5761098e6129fa565b6040519080825280602002602001820160405280156109b7578160200160208202803683370190505b509050600060015b60ca54811015610a3257600081815260cd6020526040902054851415610a20576109e881610dba565b8383815181106109fa576109fa6129e4565b6001600160a01b039092166020928302919091019091015281610a1c81612965565b9250505b80610a2a81612965565b9150506109bf565b50909392505050565b600081815260cf602090815260408083205460ce909252822054610a5f91906128e7565b600083815260ce602090815260408083205460cf83528184205560cc909152902054909150610a97906001600160a01b03168261175b565b5050565b60006001610aa860ca5490565b610ab291906128e7565b905090565b610ac13382611868565b610add5760405162461bcd60e51b815260040161081f90612800565b61095583838361195f565b600082815260cc60209081526040808320815160e08101835281546001600160a01b031680825260018301549482019490945260029091015463ffffffff80821693830193909352640100000000810483166060830152600160401b810483166080830152600160601b8104831660a0830152600160801b900490911660c08201528291610b7c5751915060009050610baa565b6080810151815163ffffffff90911690612710610b9983886128c8565b610ba391906128b4565b9350935050505b9250929050565b6097546001600160a01b03163314610bdb5760405162461bcd60e51b815260040161081f906127cb565b6040518060e00160405280876001600160a01b03168152602001868152602001600063ffffffff1681526020018563ffffffff1681526020018463ffffffff1681526020018363ffffffff1681526020018263ffffffff1681525060cc6000610c4360cb5490565b81526020808201929092526040908101600020835181546001600160a01b039091166001600160a01b0319909116178155918301516001830155820151600290910180546060840151608085015160a086015160c09096015163ffffffff908116600160801b0263ffffffff60801b19978216600160601b0263ffffffff60601b19938316600160401b02939093166fffffffffffffffff0000000000000000199483166401000000000267ffffffffffffffff1990961692909716919091179390931791909116939093179290921792909216179055610d2360cb5490565b604080516001600160a01b03891681526020810188905263ffffffff8781168284015286811660608301528581166080830152841660a082015290517fb3131d7d301f8caeb40981cffc627b1fdf324b5e4a23845b61c1a6ad2a25f3859181900360c00190a2610d9760cb80546001019055565b505050505050565b610955838383604051806020016040528060008152506110ff565b6000818152606760205260408120546001600160a01b0316806107125760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161081f565b60006001600160a01b038216610e9c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161081f565b506001600160a01b031660009081526068602052604090205490565b6097546001600160a01b03163314610ee25760405162461bcd60e51b815260040161081f906127cb565b610eec6000611aff565b565b600081815260cc60205260408120600201546060919063ffffffff1667ffffffffffffffff811115610f2257610f226129fa565b604051908082528060200260200182016040528015610f4b578160200160208202803683370190505b509050600060015b60ca54811015610a3257600081815260cd6020526040902054851415610f9f5780838381518110610f8657610f866129e4565b602090810291909101015281610f9b81612965565b9250505b80610fa981612965565b915050610f53565b6060606680546107279061292a565b610a97338383611b51565b600054610100900460ff16610fe65760005460ff1615610fea565b303b155b61104d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161081f565b600054610100900460ff1615801561106f576000805461ffff19166101011790555b6110798484611c20565b611081611c61565b61108a866115a5565b8161109486611c98565b6040516020016110a59291906125fd565b60405160208183030381529060405260c990805190602001906110c99291906120bd565b506110d860ca80546001019055565b6110e660cb80546001019055565b8015610d97576000805461ff0019169055505050505050565b6111093383611868565b6111255760405162461bcd60e51b815260040161081f90612800565b61113184848484611d96565b50505050565b6097546001600160a01b031633146111615760405162461bcd60e51b815260040161081f906127cb565b600091825260cc6020526040909120600201805463ffffffff909216600160801b0263ffffffff60801b19909216919091179055565b600081815260cc6020526040902060020154640100000000900463ffffffff166111fc5760405162461bcd60e51b815260206004820152601660248201527511591a5d1a5bdb88191bd95cc81b9bdd08195e1a5cdd60521b604482015260640161081f565b600081815260cc602052604090206002015463ffffffff640100000000820481169116106112765760405162461bcd60e51b815260206004820152602160248201527f546869732065646974696f6e20697320616c726561647920736f6c64206f75746044820152601760f91b606482015260840161081f565b600081815260cc60205260409020600101543410156112e95760405162461bcd60e51b815260206004820152602960248201527f4d7573742073656e6420656e6f75676820746f207075726368617365207468656044820152681032b234ba34b7b71760b91b606482015260840161081f565b600081815260cc602052604090206002015442600160601b90910463ffffffff16106113505760405162461bcd60e51b8152602060048201526016602482015275105d58dd1a5bdb881a185cdb89dd081cdd185c9d195960521b604482015260640161081f565b600081815260cc602052604090206002015442600160801b90910463ffffffff16116113b25760405162461bcd60e51b8152602060048201526011602482015270105d58dd1a5bdb881a185cc8195b991959607a1b604482015260640161081f565b6113c4336113bf60ca5490565b611dc9565b600081815260ce6020526040812080543492906113e290849061289c565b9091555050600081815260cc60205260408120600201805463ffffffff169161140a83612980565b91906101000a81548163ffffffff021916908363ffffffff160217905550508060cd600061143760ca5490565b81526020810191909152604001600020553361145260ca5490565b600083815260cc602090815260409182902060020154915163ffffffff909216825284917fe38cb07a52e5d88a83de7c9d29c2841118103e462d20f8c526b35872f9977785910160405180910390a46114af60ca80546001019055565b50565b6000818152606760205260409020546060906001600160a01b03166115315760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161081f565b600082815260cd602052604090205460c99061154c90611c98565b61155584611c98565b60405160200161156793929190612638565b6040516020818303038152906040529050919050565b606060c9604051602001611591919061267e565b604051602081830303815290604052905090565b6097546001600160a01b031633146115cf5760405162461bcd60e51b815260040161081f906127cb565b6001600160a01b0381166116345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161081f565b6114af81611aff565b6097546001600160a01b031633146116675760405162461bcd60e51b815260040161081f906127cb565b600091825260cc6020526040909120600201805463ffffffff909216600160601b0263ffffffff60601b19909216919091179055565b60006001600160e01b031982166380ac58cd60e01b14806116ce57506001600160e01b03198216635b5e139f60e01b145b8061071257506301ffc9a760e01b6001600160e01b0319831614610712565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061172282610dba565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b804710156117ab5760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742062616c616e636520666f722073656e64000000604482015260640161081f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146117f8576040519150601f19603f3d011682016040523d82523d6000602084013e6117fd565b606091505b50509050806109555760405162461bcd60e51b815260206004820152603160248201527f556e61626c6520746f2073656e642076616c75653a20726563697069656e74206044820152701b585e481a185d99481c995d995c9d1959607a1b606482015260840161081f565b6000818152606760205260408120546001600160a01b03166118e15760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161081f565b60006118ec83610dba565b9050806001600160a01b0316846001600160a01b031614806119275750836001600160a01b031661191c846107aa565b6001600160a01b0316145b8061195757506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661197282610dba565b6001600160a01b0316146119da5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161081f565b6001600160a01b038216611a3c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161081f565b611a476000826116ed565b6001600160a01b0383166000908152606860205260408120805460019290611a709084906128e7565b90915550506001600160a01b0382166000908152606860205260408120805460019290611a9e90849061289c565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611bb35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161081f565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600054610100900460ff16611c475760405162461bcd60e51b815260040161081f90612851565b611c4f611f0b565b611c57611f0b565b610a978282611f32565b600054610100900460ff16611c885760405162461bcd60e51b815260040161081f90612851565b611c90611f0b565b610eec611f80565b606081611cbc5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611ce65780611cd081612965565b9150611cdf9050600a836128b4565b9150611cc0565b60008167ffffffffffffffff811115611d0157611d016129fa565b6040519080825280601f01601f191660200182016040528015611d2b576020820181803683370190505b5090505b841561195757611d406001836128e7565b9150611d4d600a866129a4565b611d5890603061289c565b60f81b818381518110611d6d57611d6d6129e4565b60200101906001600160f81b031916908160001a905350611d8f600a866128b4565b9450611d2f565b611da184848461195f565b611dad84848484611fb0565b6111315760405162461bcd60e51b815260040161081f90612779565b6001600160a01b038216611e1f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161081f565b6000818152606760205260409020546001600160a01b031615611e845760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161081f565b6001600160a01b0382166000908152606860205260408120805460019290611ead90849061289c565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600054610100900460ff16610eec5760405162461bcd60e51b815260040161081f90612851565b600054610100900460ff16611f595760405162461bcd60e51b815260040161081f90612851565b8151611f6c9060659060208501906120bd565b5080516109559060669060208401906120bd565b600054610100900460ff16611fa75760405162461bcd60e51b815260040161081f90612851565b610eec33611aff565b60006001600160a01b0384163b156120b257604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611ff49033908990889088906004016126a4565b602060405180830381600087803b15801561200e57600080fd5b505af192505050801561203e575060408051601f3d908101601f1916820190925261203b918101906124b3565b60015b612098573d80801561206c576040519150601f19603f3d011682016040523d82523d6000602084013e612071565b606091505b5080516120905760405162461bcd60e51b815260040161081f90612779565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611957565b506001949350505050565b8280546120c99061292a565b90600052602060002090601f0160209004810192826120eb5760008555612131565b82601f1061210457805160ff1916838001178555612131565b82800160010185558215612131579182015b82811115612131578251825591602001919060010190612116565b5061213d929150612141565b5090565b5b8082111561213d5760008155600101612142565b600067ffffffffffffffff80841115612171576121716129fa565b604051601f8501601f19908116603f01168101908282118183101715612199576121996129fa565b816040528093508581528686860111156121b257600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126121dd57600080fd5b6121ec83833560208501612156565b9392505050565b803563ffffffff8116811461220757600080fd5b919050565b60006020828403121561221e57600080fd5b81356121ec81612a10565b60008060008060008060c0878903121561224257600080fd5b863561224d81612a10565b955060208701359450612262604088016121f3565b9350612270606088016121f3565b925061227e608088016121f3565b915061228c60a088016121f3565b90509295509295509295565b600080604083850312156122ab57600080fd5b82356122b681612a10565b915060208301356122c681612a10565b809150509250929050565b6000806000606084860312156122e657600080fd5b83356122f181612a10565b9250602084013561230181612a10565b929592945050506040919091013590565b6000806000806080858703121561232857600080fd5b843561233381612a10565b9350602085013561234381612a10565b925060408501359150606085013567ffffffffffffffff81111561236657600080fd5b8501601f8101871361237757600080fd5b61238687823560208401612156565b91505092959194509250565b600080604083850312156123a557600080fd5b82356123b081612a10565b9150602083013580151581146122c657600080fd5b600080604083850312156123d857600080fd5b82356123e381612a10565b946020939093013593505050565b600080600080600060a0868803121561240957600080fd5b853561241481612a10565b945060208601359350604086013567ffffffffffffffff8082111561243857600080fd5b61244489838a016121cc565b9450606088013591508082111561245a57600080fd5b61246689838a016121cc565b9350608088013591508082111561247c57600080fd5b50612489888289016121cc565b9150509295509295909350565b6000602082840312156124a857600080fd5b81356121ec81612a25565b6000602082840312156124c557600080fd5b81516121ec81612a25565b6000602082840312156124e257600080fd5b5035919050565b600080604083850312156124fc57600080fd5b50508035926020909101359150565b6000806040838503121561251e57600080fd5b8235915061252e602084016121f3565b90509250929050565b6000815180845261254f8160208601602086016128fe565b601f01601f19169290920160200192915050565b8054600090600181811c908083168061257d57607f831692505b602080841082141561259f57634e487b7160e01b600052602260045260246000fd5b8180156125b357600181146125c4576125f1565b60ff198616895284890196506125f1565b60008881526020902060005b868110156125e95781548b8201529085019083016125d0565b505084890196505b50505050505092915050565b6000835161260f8184602088016128fe565b8351908301906126238183602088016128fe565b602f60f81b9101908152600101949350505050565b60006126448286612563565b84516126548183602089016128fe565b602f60f81b910190815283516126718160018401602088016128fe565b0160010195945050505050565b600061268a8284612563565b691cdd1bdc99599c9bdb9d60b21b8152600a019392505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906126d790830184612537565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127225783516001600160a01b0316835292840192918401916001016126fd565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127225783518352928401929184019160010161274a565b6020815260006121ec6020830184612537565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082198211156128af576128af6129b8565b500190565b6000826128c3576128c36129ce565b500490565b60008160001904831182151516156128e2576128e26129b8565b500290565b6000828210156128f9576128f96129b8565b500390565b60005b83811015612919578181015183820152602001612901565b838111156111315750506000910152565b600181811c9082168061293e57607f821691505b6020821081141561295f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612979576129796129b8565b5060010190565b600063ffffffff8083168181141561299a5761299a6129b8565b6001019392505050565b6000826129b3576129b36129ce565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146114af57600080fd5b6001600160e01b0319811681146114af57600080fdfea2646970667358221220688d6bf43e5d68af458be79674990456921e4379f43e1ed568307127798e55d664736f6c63430008070033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/ArtistCreator.json b/abis/ArtistCreator.json new file mode 100644 index 0000000..9d0b33e --- /dev/null +++ b/abis/ArtistCreator.json @@ -0,0 +1,314 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ArtistCreator", + "sourceName": "contracts/ArtistCreator.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "artistId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "artistAddress", + "type": "address" + } + ], + "name": "CreatedArtist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINTER_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "artistContracts", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beaconAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "_baseURI", + "type": "string" + } + ], + "name": "createArtist", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "getSigner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newAdmin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x60a06040523060601b60805234801561001757600080fd5b5060805160601c61522461004b600039600081816104d101528181610514015281816105a601526105e901526152246000f3fe608060405260043610620000ef5760003560e01c80638129fc1c1162000089578063e6adabfd1162000060578063e6adabfd1462000257578063f2fde38b146200027c578063f851a44014620002a1578063fa4d280c14620002c357600080fd5b80638129fc1c14620001fa5780638da5cb5b1462000212578063b16a43f0146200023257600080fd5b80634f1ef28611620000ca5780634f1ef2861462000184578063704b6c02146200019b578063715018a614620001c05780637e2ec6d014620001d857600080fd5b8063233654eb14620000f45780633644e51514620001365780633659cfe6146200015d575b600080fd5b3480156200010157600080fd5b50620001196200011336600462001572565b620002f9565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200014357600080fd5b506200014e60cb5481565b6040519081526020016200012d565b3480156200016a57600080fd5b50620001826200017c366004620014a5565b620004c6565b005b6200018262000195366004620014c3565b6200059b565b348015620001a857600080fd5b5062000182620001ba366004620014a5565b62000661565b348015620001cd57600080fd5b5062000182620006ed565b348015620001e557600080fd5b5060cc5462000119906001600160a01b031681565b3480156200020757600080fd5b506200018262000728565b3480156200021f57600080fd5b506097546001600160a01b031662000119565b3480156200023f57600080fd5b50620001196200025136600462001632565b62000946565b3480156200026457600080fd5b5062000119620002763660046200152c565b62000971565b3480156200028957600080fd5b50620001826200029b366004620014a5565b62000aa7565b348015620002ae57600080fd5b5060ca5462000119906001600160a01b031681565b348015620002d057600080fd5b506200014e7f5925e35aebbeb7738ae3e97ad24e3b4cc09001c8668d81f3365213a0ec1e85b281565b60ca546000906001600160a01b031662000314878762000971565b6001600160a01b031614620003705760405162461bcd60e51b815260206004820152601f60248201527f696e76616c696420617574686f72697a6174696f6e207369676e61747572650060448201526064015b60405180910390fd5b60cc546000906001600160a01b031663055fe41d60e51b336200039260c95490565b888888604051602401620003ab959493929190620016c6565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620003ea9062001379565b620003f792919062001698565b604051809103906000f08015801562000414573d6000803e3d6000fd5b5060cd80546001810182556000919091527f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db2e0180546001600160a01b0383166001600160a01b031990911681179091559091507f23748b43b77f98380e738976c6324996908ffc1989994dd3c68631c87a65a7c06200049260c95490565b8787604051620004a59392919062001807565b60405180910390a2620004bc60c980546001019055565b9695505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005125760405162461bcd60e51b815260040162000367906200173a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200054662000b46565b6001600160a01b0316146200056f5760405162461bcd60e51b8152600401620003679062001786565b6200057a8162000b74565b60408051600080825260208201909252620005989183919062000ba1565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005e75760405162461bcd60e51b815260040162000367906200173a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200061b62000b46565b6001600160a01b031614620006445760405162461bcd60e51b8152600401620003679062001786565b6200064f8262000b74565b6200065d8282600162000ba1565b5050565b6097546001600160a01b031633148062000685575060ca546001600160a01b031633145b620006cb5760405162461bcd60e51b815260206004820152601560248201527434b73b30b634b21030baba3437b934bd30ba34b7b760591b604482015260640162000367565b60ca80546001600160a01b0319166001600160a01b0392909216919091179055565b6097546001600160a01b031633146200071a5760405162461bcd60e51b81526004016200036790620017d2565b62000726600062000cfd565b565b600054610100900460ff16620007455760005460ff161562000749565b303b155b620007ae5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000367565b600054610100900460ff16158015620007d1576000805461ffff19166101011790555b620007db62000d4f565b60ca80546001600160a01b031916331790556040516200082a907fc49a8e302e3e5d6753b2bb3dbc3c28deba5e16e2572a92aef568063c963e3465904690602001918252602082015260400190565b60408051601f1981840301815290829052805160209091012060cb55600090620008549062001387565b604051809103906000f08015801562000871573d6000803e3d6000fd5b50604051620008809062001395565b6001600160a01b039091168152602001604051809103906000f080158015620008ad573d6000803e3d6000fd5b5060405163f2fde38b60e01b81523360048201529091506001600160a01b0382169063f2fde38b90602401600060405180830381600087803b158015620008f357600080fd5b505af115801562000908573d6000803e3d6000fd5b505060cc80546001600160a01b0319166001600160a01b038516179055505060c98054600101905550801562000598576000805461ff001916905550565b60cd81815481106200095757600080fd5b6000918252602090912001546001600160a01b0316905081565b60ca546000906001600160a01b0316620009c65760405162461bcd60e51b81526020600482015260156024820152741dda1a5d195b1a5cdd081b9bdd08195b98589b1959605a1b604482015260640162000367565b60cb54604080517f5925e35aebbeb7738ae3e97ad24e3b4cc09001c8668d81f3365213a0ec1e85b260208201523391810191909152600091906060016040516020818303038152906040528051906020012060405160200162000a4092919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600062000a9e85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250869392505062000dc79050565b95945050505050565b6097546001600160a01b0316331462000ad45760405162461bcd60e51b81526004016200036790620017d2565b6001600160a01b03811662000b3b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000367565b620005988162000cfd565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6097546001600160a01b03163314620005985760405162461bcd60e51b81526004016200036790620017d2565b600062000bad62000b46565b905062000bba8462000def565b60008351118062000bc85750815b1562000bdc5762000bda848462000e96565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1662000cf657805460ff191660011781556040516001600160a01b038316602482015262000c5e90869060440160408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b17905262000e96565b50805460ff1916815562000c7162000b46565b6001600160a01b0316826001600160a01b03161462000ceb5760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b606482015260840162000367565b62000cf68562000f81565b5050505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1662000dbc5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840162000367565b620007263362000cfd565b600080600062000dd8858562000fc3565b9150915062000de7816200103b565b509392505050565b803b62000e555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000367565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060823b62000ef75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840162000367565b600080846001600160a01b03168460405162000f1491906200167a565b600060405180830381855af49150503d806000811462000f51576040519150601f19603f3d011682016040523d82523d6000602084013e62000f56565b606091505b509150915062000a9e8282604051806060016040528060278152602001620051c8602791396200120e565b62000f8c8162000def565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60008082516041141562000ffe5760208301516040840151606085015160001a62000ff18782858562001253565b9450945050505062001034565b8251604014156200102c57602083015160408401516200102086838362001348565b93509350505062001034565b506000905060025b9250929050565b600081600481111562001052576200105262001869565b14156200105c5750565b600181600481111562001073576200107362001869565b1415620010c35760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640162000367565b6002816004811115620010da57620010da62001869565b14156200112a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640162000367565b600381600481111562001141576200114162001869565b14156200119c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840162000367565b6004816004811115620011b357620011b362001869565b1415620005985760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840162000367565b606083156200121f5750816200124c565b825115620012305782518084602001fd5b8160405162461bcd60e51b815260040162000367919062001725565b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156200128c57506000905060036200133f565b8460ff16601b14158015620012a557508460ff16601c14155b15620012b857506000905060046200133f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156200130d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811662001338576000600192509250506200133f565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016200136b8782888562001253565b935093505050935093915050565b610993806200189683390190565b612a91806200222983390190565b61050e8062004cba83390190565b600067ffffffffffffffff80841115620013c157620013c16200187f565b604051601f8501601f19908116603f01168101908282118183101715620013ec57620013ec6200187f565b816040528093508581528686860111156200140657600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146200143857600080fd5b919050565b60008083601f8401126200145057600080fd5b50813567ffffffffffffffff8111156200146957600080fd5b6020830191508360208285010111156200103457600080fd5b600082601f8301126200149457600080fd5b6200124c83833560208501620013a3565b600060208284031215620014b857600080fd5b6200124c8262001420565b60008060408385031215620014d757600080fd5b620014e28362001420565b9150602083013567ffffffffffffffff811115620014ff57600080fd5b8301601f810185136200151157600080fd5b6200152285823560208401620013a3565b9150509250929050565b600080602083850312156200154057600080fd5b823567ffffffffffffffff8111156200155857600080fd5b62001566858286016200143d565b90969095509350505050565b6000806000806000608086880312156200158b57600080fd5b853567ffffffffffffffff80821115620015a457600080fd5b620015b289838a016200143d565b90975095506020880135915080821115620015cc57600080fd5b620015da89838a0162001482565b94506040880135915080821115620015f157600080fd5b620015ff89838a0162001482565b935060608801359150808211156200161657600080fd5b50620016258882890162001482565b9150509295509295909350565b6000602082840312156200164557600080fd5b5035919050565b600081518084526200166681602086016020860162001836565b601f01601f19169290920160200192915050565b600082516200168e81846020870162001836565b9190910192915050565b6001600160a01b0383168152604060208201819052600090620016be908301846200164c565b949350505050565b60018060a01b038616815284602082015260a060408201526000620016ef60a08301866200164c565b82810360608401526200170381866200164c565b905082810360808401526200171981856200164c565b98975050505050505050565b6020815260006200124c60208301846200164c565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b8381526060602082015260006200182260608301856200164c565b8281036040840152620004bc81856200164c565b60005b838110156200185357818101518382015260200162001839565b8381111562001863576000848401525b50505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052604160045260246000fdfe608060405260405161099338038061099383398101604081905261002291610470565b61004d60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5161057f565b60008051602061094c83398151915214610069576100696105d0565b6100758282600061007c565b50506105fc565b61008583610156565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100c65750805b156101515761014f836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561010757600080fd5b505afa15801561011b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013f9190610455565b836102f660201b6100291760201c565b505b505050565b6101698161032260201b6100551760201c565b6101c85760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61024b816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561020457600080fd5b505afa158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190610455565b61032260201b6100551760201c565b6102b05760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101bf565b806102d560008051602061094c83398151915260001b61032860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061031b838360405180606001604052806027815260200161096c6027913961032b565b9392505050565b3b151590565b90565b6060833b61038a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101bf565b600080856001600160a01b0316856040516103a59190610530565b600060405180830381855af49150503d80600081146103e0576040519150601f19603f3d011682016040523d82523d6000602084013e6103e5565b606091505b5090925090506103f6828286610400565b9695505050505050565b6060831561040f57508161031b565b82511561041f5782518084602001fd5b8160405162461bcd60e51b81526004016101bf919061054c565b80516001600160a01b038116811461045057600080fd5b919050565b60006020828403121561046757600080fd5b61031b82610439565b6000806040838503121561048357600080fd5b61048c83610439565b60208401519092506001600160401b03808211156104a957600080fd5b818501915085601f8301126104bd57600080fd5b8151818111156104cf576104cf6105e6565b604051601f8201601f19908116603f011681019083821181831017156104f7576104f76105e6565b8160405282815288602084870101111561051057600080fd5b6105218360208301602088016105a4565b80955050505050509250929050565b600082516105428184602087016105a4565b9190910192915050565b602081526000825180602084015261056b8160408501602087016105a4565b601f01601f19169190910160400192915050565b60008282101561059f57634e487b7160e01b600052601160045260246000fd5b500390565b60005b838110156105bf5781810151838201526020016105a7565b8381111561014f5750506000910152565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6103418061060b6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e56027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610265565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b81526004016101859190610281565b60006020828403121561024e57600080fd5b81516001600160a01b038116811461004e57600080fd5b600082516102778184602087016102b4565b9190910192915050565b60208152600082518060208401526102a08160408501602087016102b4565b601f01601f19169190910160400192915050565b60005b838110156102cf5781810151838201526020016102b7565b838111156102de576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122081b7b94d38e2d760ee5a082c4fb8d9b73ee0e1b3037eb8379ad4a6143c47071a64736f6c63430008070033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564608060405234801561001057600080fd5b50612a71806100206000396000f3fe6080604052600436106101d85760003560e01c8063715018a611610102578063bd8616ec11610095578063e8a3d48511610064578063e8a3d4851461064f578063e985e9c514610664578063f2fde38b146106ad578063fbab9e04146106cd57600080fd5b8063bd8616ec146105c2578063c87b56dd146105d5578063d3bb0528146105f5578063e1a3d5731461062257600080fd5b8063a22cb465116100d1578063a22cb46514610542578063abfc83a014610562578063b88d4fde14610582578063bb314ca1146105a257600080fd5b8063715018a6146104cd57806374e79189146104e25780638da5cb5b1461050f57806395d89b411461052d57600080fd5b806323b872dd1161017a57806342842e0e1161014957806342842e0e14610440578063602787ed146104605780636352211e1461048d57806370a08231146104ad57600080fd5b806323b872dd146102fe578063279c806e1461031e5780632a55205a146103e15780633fafef291461042057600080fd5b8063095ea7b3116101b6578063095ea7b31461026c57806313dd29601461028e578063155dd5ee146102bb57806318160ddd146102db57600080fd5b806301ffc9a7146101dd57806306fdde0314610212578063081812fc14610234575b600080fd5b3480156101e957600080fd5b506101fd6101f8366004612496565b6106ed565b60405190151581526020015b60405180910390f35b34801561021e57600080fd5b50610227610718565b6040516102099190612766565b34801561024057600080fd5b5061025461024f3660046124d0565b6107aa565b6040516001600160a01b039091168152602001610209565b34801561027857600080fd5b5061028c6102873660046123c5565b610844565b005b34801561029a57600080fd5b506102ae6102a93660046124d0565b61095a565b60405161020991906126e1565b3480156102c757600080fd5b5061028c6102d63660046124d0565b610a3b565b3480156102e757600080fd5b506102f0610a9b565b604051908152602001610209565b34801561030a57600080fd5b5061028c6103193660046122d1565b610ab7565b34801561032a57600080fd5b506103956103393660046124d0565b60cc602052600090815260409020805460018201546002909201546001600160a01b03909116919063ffffffff808216916401000000008104821691600160401b8204811691600160601b8104821691600160801b9091041687565b604080516001600160a01b039098168852602088019690965263ffffffff94851695870195909552918316606086015282166080850152811660a08401521660c082015260e001610209565b3480156103ed57600080fd5b506104016103fc3660046124e9565b610ae8565b604080516001600160a01b039093168352602083019190915201610209565b34801561042c57600080fd5b5061028c61043b366004612229565b610bb1565b34801561044c57600080fd5b5061028c61045b3660046122d1565b610d9f565b34801561046c57600080fd5b506102f061047b3660046124d0565b60cd6020526000908152604090205481565b34801561049957600080fd5b506102546104a83660046124d0565b610dba565b3480156104b957600080fd5b506102f06104c836600461220c565b610e31565b3480156104d957600080fd5b5061028c610eb8565b3480156104ee57600080fd5b506105026104fd3660046124d0565b610eee565b604051610209919061272e565b34801561051b57600080fd5b506097546001600160a01b0316610254565b34801561053957600080fd5b50610227610fb1565b34801561054e57600080fd5b5061028c61055d366004612392565b610fc0565b34801561056e57600080fd5b5061028c61057d3660046123f1565b610fcb565b34801561058e57600080fd5b5061028c61059d366004612312565b6110ff565b3480156105ae57600080fd5b5061028c6105bd36600461250b565b611137565b61028c6105d03660046124d0565b611197565b3480156105e157600080fd5b506102276105f03660046124d0565b6114b2565b34801561060157600080fd5b506102f06106103660046124d0565b60cf6020526000908152604090205481565b34801561062e57600080fd5b506102f061063d3660046124d0565b60ce6020526000908152604090205481565b34801561065b57600080fd5b5061022761157d565b34801561067057600080fd5b506101fd61067f366004612298565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b3480156106b957600080fd5b5061028c6106c836600461220c565b6115a5565b3480156106d957600080fd5b5061028c6106e836600461250b565b61163d565b600063152a902d60e11b6001600160e01b03198316148061071257506107128261169d565b92915050565b6060606580546107279061292a565b80601f01602080910402602001604051908101604052809291908181526020018280546107539061292a565b80156107a05780601f10610775576101008083540402835291602001916107a0565b820191906000526020600020905b81548152906001019060200180831161078357829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166108285760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b600061084f82610dba565b9050806001600160a01b0316836001600160a01b031614156108bd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161081f565b336001600160a01b03821614806108d957506108d9813361067f565b61094b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161081f565b61095583836116ed565b505050565b600081815260cc60205260408120600201546060919063ffffffff1667ffffffffffffffff81111561098e5761098e6129fa565b6040519080825280602002602001820160405280156109b7578160200160208202803683370190505b509050600060015b60ca54811015610a3257600081815260cd6020526040902054851415610a20576109e881610dba565b8383815181106109fa576109fa6129e4565b6001600160a01b039092166020928302919091019091015281610a1c81612965565b9250505b80610a2a81612965565b9150506109bf565b50909392505050565b600081815260cf602090815260408083205460ce909252822054610a5f91906128e7565b600083815260ce602090815260408083205460cf83528184205560cc909152902054909150610a97906001600160a01b03168261175b565b5050565b60006001610aa860ca5490565b610ab291906128e7565b905090565b610ac13382611868565b610add5760405162461bcd60e51b815260040161081f90612800565b61095583838361195f565b600082815260cc60209081526040808320815160e08101835281546001600160a01b031680825260018301549482019490945260029091015463ffffffff80821693830193909352640100000000810483166060830152600160401b810483166080830152600160601b8104831660a0830152600160801b900490911660c08201528291610b7c5751915060009050610baa565b6080810151815163ffffffff90911690612710610b9983886128c8565b610ba391906128b4565b9350935050505b9250929050565b6097546001600160a01b03163314610bdb5760405162461bcd60e51b815260040161081f906127cb565b6040518060e00160405280876001600160a01b03168152602001868152602001600063ffffffff1681526020018563ffffffff1681526020018463ffffffff1681526020018363ffffffff1681526020018263ffffffff1681525060cc6000610c4360cb5490565b81526020808201929092526040908101600020835181546001600160a01b039091166001600160a01b0319909116178155918301516001830155820151600290910180546060840151608085015160a086015160c09096015163ffffffff908116600160801b0263ffffffff60801b19978216600160601b0263ffffffff60601b19938316600160401b02939093166fffffffffffffffff0000000000000000199483166401000000000267ffffffffffffffff1990961692909716919091179390931791909116939093179290921792909216179055610d2360cb5490565b604080516001600160a01b03891681526020810188905263ffffffff8781168284015286811660608301528581166080830152841660a082015290517fb3131d7d301f8caeb40981cffc627b1fdf324b5e4a23845b61c1a6ad2a25f3859181900360c00190a2610d9760cb80546001019055565b505050505050565b610955838383604051806020016040528060008152506110ff565b6000818152606760205260408120546001600160a01b0316806107125760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161081f565b60006001600160a01b038216610e9c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161081f565b506001600160a01b031660009081526068602052604090205490565b6097546001600160a01b03163314610ee25760405162461bcd60e51b815260040161081f906127cb565b610eec6000611aff565b565b600081815260cc60205260408120600201546060919063ffffffff1667ffffffffffffffff811115610f2257610f226129fa565b604051908082528060200260200182016040528015610f4b578160200160208202803683370190505b509050600060015b60ca54811015610a3257600081815260cd6020526040902054851415610f9f5780838381518110610f8657610f866129e4565b602090810291909101015281610f9b81612965565b9250505b80610fa981612965565b915050610f53565b6060606680546107279061292a565b610a97338383611b51565b600054610100900460ff16610fe65760005460ff1615610fea565b303b155b61104d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161081f565b600054610100900460ff1615801561106f576000805461ffff19166101011790555b6110798484611c20565b611081611c61565b61108a866115a5565b8161109486611c98565b6040516020016110a59291906125fd565b60405160208183030381529060405260c990805190602001906110c99291906120bd565b506110d860ca80546001019055565b6110e660cb80546001019055565b8015610d97576000805461ff0019169055505050505050565b6111093383611868565b6111255760405162461bcd60e51b815260040161081f90612800565b61113184848484611d96565b50505050565b6097546001600160a01b031633146111615760405162461bcd60e51b815260040161081f906127cb565b600091825260cc6020526040909120600201805463ffffffff909216600160801b0263ffffffff60801b19909216919091179055565b600081815260cc6020526040902060020154640100000000900463ffffffff166111fc5760405162461bcd60e51b815260206004820152601660248201527511591a5d1a5bdb88191bd95cc81b9bdd08195e1a5cdd60521b604482015260640161081f565b600081815260cc602052604090206002015463ffffffff640100000000820481169116106112765760405162461bcd60e51b815260206004820152602160248201527f546869732065646974696f6e20697320616c726561647920736f6c64206f75746044820152601760f91b606482015260840161081f565b600081815260cc60205260409020600101543410156112e95760405162461bcd60e51b815260206004820152602960248201527f4d7573742073656e6420656e6f75676820746f207075726368617365207468656044820152681032b234ba34b7b71760b91b606482015260840161081f565b600081815260cc602052604090206002015442600160601b90910463ffffffff16106113505760405162461bcd60e51b8152602060048201526016602482015275105d58dd1a5bdb881a185cdb89dd081cdd185c9d195960521b604482015260640161081f565b600081815260cc602052604090206002015442600160801b90910463ffffffff16116113b25760405162461bcd60e51b8152602060048201526011602482015270105d58dd1a5bdb881a185cc8195b991959607a1b604482015260640161081f565b6113c4336113bf60ca5490565b611dc9565b600081815260ce6020526040812080543492906113e290849061289c565b9091555050600081815260cc60205260408120600201805463ffffffff169161140a83612980565b91906101000a81548163ffffffff021916908363ffffffff160217905550508060cd600061143760ca5490565b81526020810191909152604001600020553361145260ca5490565b600083815260cc602090815260409182902060020154915163ffffffff909216825284917fe38cb07a52e5d88a83de7c9d29c2841118103e462d20f8c526b35872f9977785910160405180910390a46114af60ca80546001019055565b50565b6000818152606760205260409020546060906001600160a01b03166115315760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161081f565b600082815260cd602052604090205460c99061154c90611c98565b61155584611c98565b60405160200161156793929190612638565b6040516020818303038152906040529050919050565b606060c9604051602001611591919061267e565b604051602081830303815290604052905090565b6097546001600160a01b031633146115cf5760405162461bcd60e51b815260040161081f906127cb565b6001600160a01b0381166116345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161081f565b6114af81611aff565b6097546001600160a01b031633146116675760405162461bcd60e51b815260040161081f906127cb565b600091825260cc6020526040909120600201805463ffffffff909216600160601b0263ffffffff60601b19909216919091179055565b60006001600160e01b031982166380ac58cd60e01b14806116ce57506001600160e01b03198216635b5e139f60e01b145b8061071257506301ffc9a760e01b6001600160e01b0319831614610712565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061172282610dba565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b804710156117ab5760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742062616c616e636520666f722073656e64000000604482015260640161081f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146117f8576040519150601f19603f3d011682016040523d82523d6000602084013e6117fd565b606091505b50509050806109555760405162461bcd60e51b815260206004820152603160248201527f556e61626c6520746f2073656e642076616c75653a20726563697069656e74206044820152701b585e481a185d99481c995d995c9d1959607a1b606482015260840161081f565b6000818152606760205260408120546001600160a01b03166118e15760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161081f565b60006118ec83610dba565b9050806001600160a01b0316846001600160a01b031614806119275750836001600160a01b031661191c846107aa565b6001600160a01b0316145b8061195757506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661197282610dba565b6001600160a01b0316146119da5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161081f565b6001600160a01b038216611a3c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161081f565b611a476000826116ed565b6001600160a01b0383166000908152606860205260408120805460019290611a709084906128e7565b90915550506001600160a01b0382166000908152606860205260408120805460019290611a9e90849061289c565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611bb35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161081f565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600054610100900460ff16611c475760405162461bcd60e51b815260040161081f90612851565b611c4f611f0b565b611c57611f0b565b610a978282611f32565b600054610100900460ff16611c885760405162461bcd60e51b815260040161081f90612851565b611c90611f0b565b610eec611f80565b606081611cbc5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611ce65780611cd081612965565b9150611cdf9050600a836128b4565b9150611cc0565b60008167ffffffffffffffff811115611d0157611d016129fa565b6040519080825280601f01601f191660200182016040528015611d2b576020820181803683370190505b5090505b841561195757611d406001836128e7565b9150611d4d600a866129a4565b611d5890603061289c565b60f81b818381518110611d6d57611d6d6129e4565b60200101906001600160f81b031916908160001a905350611d8f600a866128b4565b9450611d2f565b611da184848461195f565b611dad84848484611fb0565b6111315760405162461bcd60e51b815260040161081f90612779565b6001600160a01b038216611e1f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161081f565b6000818152606760205260409020546001600160a01b031615611e845760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161081f565b6001600160a01b0382166000908152606860205260408120805460019290611ead90849061289c565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600054610100900460ff16610eec5760405162461bcd60e51b815260040161081f90612851565b600054610100900460ff16611f595760405162461bcd60e51b815260040161081f90612851565b8151611f6c9060659060208501906120bd565b5080516109559060669060208401906120bd565b600054610100900460ff16611fa75760405162461bcd60e51b815260040161081f90612851565b610eec33611aff565b60006001600160a01b0384163b156120b257604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611ff49033908990889088906004016126a4565b602060405180830381600087803b15801561200e57600080fd5b505af192505050801561203e575060408051601f3d908101601f1916820190925261203b918101906124b3565b60015b612098573d80801561206c576040519150601f19603f3d011682016040523d82523d6000602084013e612071565b606091505b5080516120905760405162461bcd60e51b815260040161081f90612779565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611957565b506001949350505050565b8280546120c99061292a565b90600052602060002090601f0160209004810192826120eb5760008555612131565b82601f1061210457805160ff1916838001178555612131565b82800160010185558215612131579182015b82811115612131578251825591602001919060010190612116565b5061213d929150612141565b5090565b5b8082111561213d5760008155600101612142565b600067ffffffffffffffff80841115612171576121716129fa565b604051601f8501601f19908116603f01168101908282118183101715612199576121996129fa565b816040528093508581528686860111156121b257600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126121dd57600080fd5b6121ec83833560208501612156565b9392505050565b803563ffffffff8116811461220757600080fd5b919050565b60006020828403121561221e57600080fd5b81356121ec81612a10565b60008060008060008060c0878903121561224257600080fd5b863561224d81612a10565b955060208701359450612262604088016121f3565b9350612270606088016121f3565b925061227e608088016121f3565b915061228c60a088016121f3565b90509295509295509295565b600080604083850312156122ab57600080fd5b82356122b681612a10565b915060208301356122c681612a10565b809150509250929050565b6000806000606084860312156122e657600080fd5b83356122f181612a10565b9250602084013561230181612a10565b929592945050506040919091013590565b6000806000806080858703121561232857600080fd5b843561233381612a10565b9350602085013561234381612a10565b925060408501359150606085013567ffffffffffffffff81111561236657600080fd5b8501601f8101871361237757600080fd5b61238687823560208401612156565b91505092959194509250565b600080604083850312156123a557600080fd5b82356123b081612a10565b9150602083013580151581146122c657600080fd5b600080604083850312156123d857600080fd5b82356123e381612a10565b946020939093013593505050565b600080600080600060a0868803121561240957600080fd5b853561241481612a10565b945060208601359350604086013567ffffffffffffffff8082111561243857600080fd5b61244489838a016121cc565b9450606088013591508082111561245a57600080fd5b61246689838a016121cc565b9350608088013591508082111561247c57600080fd5b50612489888289016121cc565b9150509295509295909350565b6000602082840312156124a857600080fd5b81356121ec81612a25565b6000602082840312156124c557600080fd5b81516121ec81612a25565b6000602082840312156124e257600080fd5b5035919050565b600080604083850312156124fc57600080fd5b50508035926020909101359150565b6000806040838503121561251e57600080fd5b8235915061252e602084016121f3565b90509250929050565b6000815180845261254f8160208601602086016128fe565b601f01601f19169290920160200192915050565b8054600090600181811c908083168061257d57607f831692505b602080841082141561259f57634e487b7160e01b600052602260045260246000fd5b8180156125b357600181146125c4576125f1565b60ff198616895284890196506125f1565b60008881526020902060005b868110156125e95781548b8201529085019083016125d0565b505084890196505b50505050505092915050565b6000835161260f8184602088016128fe565b8351908301906126238183602088016128fe565b602f60f81b9101908152600101949350505050565b60006126448286612563565b84516126548183602089016128fe565b602f60f81b910190815283516126718160018401602088016128fe565b0160010195945050505050565b600061268a8284612563565b691cdd1bdc99599c9bdb9d60b21b8152600a019392505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906126d790830184612537565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127225783516001600160a01b0316835292840192918401916001016126fd565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127225783518352928401929184019160010161274a565b6020815260006121ec6020830184612537565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082198211156128af576128af6129b8565b500190565b6000826128c3576128c36129ce565b500490565b60008160001904831182151516156128e2576128e26129b8565b500290565b6000828210156128f9576128f96129b8565b500390565b60005b83811015612919578181015183820152602001612901565b838111156111315750506000910152565b600181811c9082168061293e57607f821691505b6020821081141561295f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612979576129796129b8565b5060010190565b600063ffffffff8083168181141561299a5761299a6129b8565b6001019392505050565b6000826129b3576129b36129ce565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146114af57600080fd5b6001600160e01b0319811681146114af57600080fdfea2646970667358221220688d6bf43e5d68af458be79674990456921e4379f43e1ed568307127798e55d664736f6c63430008070033608060405234801561001057600080fd5b5060405161050e38038061050e83398101604081905261002f91610148565b61003833610047565b61004181610097565b50610178565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100aa8161014260201b61020a1760201c565b6101205760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b3b151590565b60006020828403121561015a57600080fd5b81516001600160a01b038116811461017157600080fd5b9392505050565b610387806101876000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80633659cfe61461005c5780635c60da1b14610071578063715018a61461009a5780638da5cb5b146100a2578063f2fde38b146100b3575b600080fd5b61006f61006a3660046102ec565b6100c6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006f610139565b6000546001600160a01b031661007e565b61006f6100c13660046102ec565b61016f565b6000546001600160a01b031633146100f95760405162461bcd60e51b81526004016100f09061031c565b60405180910390fd5b61010281610210565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6000546001600160a01b031633146101635760405162461bcd60e51b81526004016100f09061031c565b61016d600061029c565b565b6000546001600160a01b031633146101995760405162461bcd60e51b81526004016100f09061031c565b6001600160a01b0381166101fe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100f0565b6102078161029c565b50565b3b151590565b803b61027a5760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b60648201526084016100f0565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156102fe57600080fd5b81356001600160a01b038116811461031557600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220f118eb414a6e2818df67771501def6895f30169ec351de47781ca190a332f3c164736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220a07447cde8668c2e554848f587d1183feba69ca6e32a39aa633a93899deec0c064736f6c63430008070033", + "deployedBytecode": "0x608060405260043610620000ef5760003560e01c80638129fc1c1162000089578063e6adabfd1162000060578063e6adabfd1462000257578063f2fde38b146200027c578063f851a44014620002a1578063fa4d280c14620002c357600080fd5b80638129fc1c14620001fa5780638da5cb5b1462000212578063b16a43f0146200023257600080fd5b80634f1ef28611620000ca5780634f1ef2861462000184578063704b6c02146200019b578063715018a614620001c05780637e2ec6d014620001d857600080fd5b8063233654eb14620000f45780633644e51514620001365780633659cfe6146200015d575b600080fd5b3480156200010157600080fd5b50620001196200011336600462001572565b620002f9565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200014357600080fd5b506200014e60cb5481565b6040519081526020016200012d565b3480156200016a57600080fd5b50620001826200017c366004620014a5565b620004c6565b005b6200018262000195366004620014c3565b6200059b565b348015620001a857600080fd5b5062000182620001ba366004620014a5565b62000661565b348015620001cd57600080fd5b5062000182620006ed565b348015620001e557600080fd5b5060cc5462000119906001600160a01b031681565b3480156200020757600080fd5b506200018262000728565b3480156200021f57600080fd5b506097546001600160a01b031662000119565b3480156200023f57600080fd5b50620001196200025136600462001632565b62000946565b3480156200026457600080fd5b5062000119620002763660046200152c565b62000971565b3480156200028957600080fd5b50620001826200029b366004620014a5565b62000aa7565b348015620002ae57600080fd5b5060ca5462000119906001600160a01b031681565b348015620002d057600080fd5b506200014e7f5925e35aebbeb7738ae3e97ad24e3b4cc09001c8668d81f3365213a0ec1e85b281565b60ca546000906001600160a01b031662000314878762000971565b6001600160a01b031614620003705760405162461bcd60e51b815260206004820152601f60248201527f696e76616c696420617574686f72697a6174696f6e207369676e61747572650060448201526064015b60405180910390fd5b60cc546000906001600160a01b031663055fe41d60e51b336200039260c95490565b888888604051602401620003ab959493929190620016c6565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620003ea9062001379565b620003f792919062001698565b604051809103906000f08015801562000414573d6000803e3d6000fd5b5060cd80546001810182556000919091527f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db2e0180546001600160a01b0383166001600160a01b031990911681179091559091507f23748b43b77f98380e738976c6324996908ffc1989994dd3c68631c87a65a7c06200049260c95490565b8787604051620004a59392919062001807565b60405180910390a2620004bc60c980546001019055565b9695505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005125760405162461bcd60e51b815260040162000367906200173a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200054662000b46565b6001600160a01b0316146200056f5760405162461bcd60e51b8152600401620003679062001786565b6200057a8162000b74565b60408051600080825260208201909252620005989183919062000ba1565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005e75760405162461bcd60e51b815260040162000367906200173a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200061b62000b46565b6001600160a01b031614620006445760405162461bcd60e51b8152600401620003679062001786565b6200064f8262000b74565b6200065d8282600162000ba1565b5050565b6097546001600160a01b031633148062000685575060ca546001600160a01b031633145b620006cb5760405162461bcd60e51b815260206004820152601560248201527434b73b30b634b21030baba3437b934bd30ba34b7b760591b604482015260640162000367565b60ca80546001600160a01b0319166001600160a01b0392909216919091179055565b6097546001600160a01b031633146200071a5760405162461bcd60e51b81526004016200036790620017d2565b62000726600062000cfd565b565b600054610100900460ff16620007455760005460ff161562000749565b303b155b620007ae5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000367565b600054610100900460ff16158015620007d1576000805461ffff19166101011790555b620007db62000d4f565b60ca80546001600160a01b031916331790556040516200082a907fc49a8e302e3e5d6753b2bb3dbc3c28deba5e16e2572a92aef568063c963e3465904690602001918252602082015260400190565b60408051601f1981840301815290829052805160209091012060cb55600090620008549062001387565b604051809103906000f08015801562000871573d6000803e3d6000fd5b50604051620008809062001395565b6001600160a01b039091168152602001604051809103906000f080158015620008ad573d6000803e3d6000fd5b5060405163f2fde38b60e01b81523360048201529091506001600160a01b0382169063f2fde38b90602401600060405180830381600087803b158015620008f357600080fd5b505af115801562000908573d6000803e3d6000fd5b505060cc80546001600160a01b0319166001600160a01b038516179055505060c98054600101905550801562000598576000805461ff001916905550565b60cd81815481106200095757600080fd5b6000918252602090912001546001600160a01b0316905081565b60ca546000906001600160a01b0316620009c65760405162461bcd60e51b81526020600482015260156024820152741dda1a5d195b1a5cdd081b9bdd08195b98589b1959605a1b604482015260640162000367565b60cb54604080517f5925e35aebbeb7738ae3e97ad24e3b4cc09001c8668d81f3365213a0ec1e85b260208201523391810191909152600091906060016040516020818303038152906040528051906020012060405160200162000a4092919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600062000a9e85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250869392505062000dc79050565b95945050505050565b6097546001600160a01b0316331462000ad45760405162461bcd60e51b81526004016200036790620017d2565b6001600160a01b03811662000b3b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000367565b620005988162000cfd565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6097546001600160a01b03163314620005985760405162461bcd60e51b81526004016200036790620017d2565b600062000bad62000b46565b905062000bba8462000def565b60008351118062000bc85750815b1562000bdc5762000bda848462000e96565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1662000cf657805460ff191660011781556040516001600160a01b038316602482015262000c5e90869060440160408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b17905262000e96565b50805460ff1916815562000c7162000b46565b6001600160a01b0316826001600160a01b03161462000ceb5760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b606482015260840162000367565b62000cf68562000f81565b5050505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1662000dbc5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840162000367565b620007263362000cfd565b600080600062000dd8858562000fc3565b9150915062000de7816200103b565b509392505050565b803b62000e555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000367565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060823b62000ef75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840162000367565b600080846001600160a01b03168460405162000f1491906200167a565b600060405180830381855af49150503d806000811462000f51576040519150601f19603f3d011682016040523d82523d6000602084013e62000f56565b606091505b509150915062000a9e8282604051806060016040528060278152602001620051c8602791396200120e565b62000f8c8162000def565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60008082516041141562000ffe5760208301516040840151606085015160001a62000ff18782858562001253565b9450945050505062001034565b8251604014156200102c57602083015160408401516200102086838362001348565b93509350505062001034565b506000905060025b9250929050565b600081600481111562001052576200105262001869565b14156200105c5750565b600181600481111562001073576200107362001869565b1415620010c35760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640162000367565b6002816004811115620010da57620010da62001869565b14156200112a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640162000367565b600381600481111562001141576200114162001869565b14156200119c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840162000367565b6004816004811115620011b357620011b362001869565b1415620005985760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840162000367565b606083156200121f5750816200124c565b825115620012305782518084602001fd5b8160405162461bcd60e51b815260040162000367919062001725565b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156200128c57506000905060036200133f565b8460ff16601b14158015620012a557508460ff16601c14155b15620012b857506000905060046200133f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156200130d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811662001338576000600192509250506200133f565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016200136b8782888562001253565b935093505050935093915050565b610993806200189683390190565b612a91806200222983390190565b61050e8062004cba83390190565b600067ffffffffffffffff80841115620013c157620013c16200187f565b604051601f8501601f19908116603f01168101908282118183101715620013ec57620013ec6200187f565b816040528093508581528686860111156200140657600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146200143857600080fd5b919050565b60008083601f8401126200145057600080fd5b50813567ffffffffffffffff8111156200146957600080fd5b6020830191508360208285010111156200103457600080fd5b600082601f8301126200149457600080fd5b6200124c83833560208501620013a3565b600060208284031215620014b857600080fd5b6200124c8262001420565b60008060408385031215620014d757600080fd5b620014e28362001420565b9150602083013567ffffffffffffffff811115620014ff57600080fd5b8301601f810185136200151157600080fd5b6200152285823560208401620013a3565b9150509250929050565b600080602083850312156200154057600080fd5b823567ffffffffffffffff8111156200155857600080fd5b62001566858286016200143d565b90969095509350505050565b6000806000806000608086880312156200158b57600080fd5b853567ffffffffffffffff80821115620015a457600080fd5b620015b289838a016200143d565b90975095506020880135915080821115620015cc57600080fd5b620015da89838a0162001482565b94506040880135915080821115620015f157600080fd5b620015ff89838a0162001482565b935060608801359150808211156200161657600080fd5b50620016258882890162001482565b9150509295509295909350565b6000602082840312156200164557600080fd5b5035919050565b600081518084526200166681602086016020860162001836565b601f01601f19169290920160200192915050565b600082516200168e81846020870162001836565b9190910192915050565b6001600160a01b0383168152604060208201819052600090620016be908301846200164c565b949350505050565b60018060a01b038616815284602082015260a060408201526000620016ef60a08301866200164c565b82810360608401526200170381866200164c565b905082810360808401526200171981856200164c565b98975050505050505050565b6020815260006200124c60208301846200164c565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b8381526060602082015260006200182260608301856200164c565b8281036040840152620004bc81856200164c565b60005b838110156200185357818101518382015260200162001839565b8381111562001863576000848401525b50505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052604160045260246000fdfe608060405260405161099338038061099383398101604081905261002291610470565b61004d60017fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5161057f565b60008051602061094c83398151915214610069576100696105d0565b6100758282600061007c565b50506105fc565b61008583610156565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a26000825111806100c65750805b156101515761014f836001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561010757600080fd5b505afa15801561011b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013f9190610455565b836102f660201b6100291760201c565b505b505050565b6101698161032260201b6100551760201c565b6101c85760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b61024b816001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561020457600080fd5b505afa158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190610455565b61032260201b6100551760201c565b6102b05760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b60648201526084016101bf565b806102d560008051602061094c83398151915260001b61032860201b61005b1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b606061031b838360405180606001604052806027815260200161096c6027913961032b565b9392505050565b3b151590565b90565b6060833b61038a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101bf565b600080856001600160a01b0316856040516103a59190610530565b600060405180830381855af49150503d80600081146103e0576040519150601f19603f3d011682016040523d82523d6000602084013e6103e5565b606091505b5090925090506103f6828286610400565b9695505050505050565b6060831561040f57508161031b565b82511561041f5782518084602001fd5b8160405162461bcd60e51b81526004016101bf919061054c565b80516001600160a01b038116811461045057600080fd5b919050565b60006020828403121561046757600080fd5b61031b82610439565b6000806040838503121561048357600080fd5b61048c83610439565b60208401519092506001600160401b03808211156104a957600080fd5b818501915085601f8301126104bd57600080fd5b8151818111156104cf576104cf6105e6565b604051601f8201601f19908116603f011681019083821181831017156104f7576104f76105e6565b8160405282815288602084870101111561051057600080fd5b6105218360208301602088016105a4565b80955050505050509250929050565b600082516105428184602087016105a4565b9190910192915050565b602081526000825180602084015261056b8160408501602087016105a4565b601f01601f19169190910160400192915050565b60008282101561059f57634e487b7160e01b600052601160045260246000fd5b500390565b60005b838110156105bf5781810151838201526020016105a7565b8381111561014f5750506000910152565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6103418061060b6000396000f3fe60806040523661001357610011610017565b005b6100115b61002761002261005e565b610106565b565b606061004e83836040518060600160405280602781526020016102e56027913961012a565b9392505050565b3b151590565b90565b60006100917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c957600080fd5b505afa1580156100dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610101919061023c565b905090565b3660008037600080366000845af43d6000803e808015610125573d6000f35b3d6000fd5b6060833b61018e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a99190610265565b600060405180830381855af49150503d80600081146101e4576040519150601f19603f3d011682016040523d82523d6000602084013e6101e9565b606091505b50915091506101f9828286610203565b9695505050505050565b6060831561021257508161004e565b8251156102225782518084602001fd5b8160405162461bcd60e51b81526004016101859190610281565b60006020828403121561024e57600080fd5b81516001600160a01b038116811461004e57600080fd5b600082516102778184602087016102b4565b9190910192915050565b60208152600082518060208401526102a08160408501602087016102b4565b601f01601f19169190910160400192915050565b60005b838110156102cf5781810151838201526020016102b7565b838111156102de576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122081b7b94d38e2d760ee5a082c4fb8d9b73ee0e1b3037eb8379ad4a6143c47071a64736f6c63430008070033a3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564608060405234801561001057600080fd5b50612a71806100206000396000f3fe6080604052600436106101d85760003560e01c8063715018a611610102578063bd8616ec11610095578063e8a3d48511610064578063e8a3d4851461064f578063e985e9c514610664578063f2fde38b146106ad578063fbab9e04146106cd57600080fd5b8063bd8616ec146105c2578063c87b56dd146105d5578063d3bb0528146105f5578063e1a3d5731461062257600080fd5b8063a22cb465116100d1578063a22cb46514610542578063abfc83a014610562578063b88d4fde14610582578063bb314ca1146105a257600080fd5b8063715018a6146104cd57806374e79189146104e25780638da5cb5b1461050f57806395d89b411461052d57600080fd5b806323b872dd1161017a57806342842e0e1161014957806342842e0e14610440578063602787ed146104605780636352211e1461048d57806370a08231146104ad57600080fd5b806323b872dd146102fe578063279c806e1461031e5780632a55205a146103e15780633fafef291461042057600080fd5b8063095ea7b3116101b6578063095ea7b31461026c57806313dd29601461028e578063155dd5ee146102bb57806318160ddd146102db57600080fd5b806301ffc9a7146101dd57806306fdde0314610212578063081812fc14610234575b600080fd5b3480156101e957600080fd5b506101fd6101f8366004612496565b6106ed565b60405190151581526020015b60405180910390f35b34801561021e57600080fd5b50610227610718565b6040516102099190612766565b34801561024057600080fd5b5061025461024f3660046124d0565b6107aa565b6040516001600160a01b039091168152602001610209565b34801561027857600080fd5b5061028c6102873660046123c5565b610844565b005b34801561029a57600080fd5b506102ae6102a93660046124d0565b61095a565b60405161020991906126e1565b3480156102c757600080fd5b5061028c6102d63660046124d0565b610a3b565b3480156102e757600080fd5b506102f0610a9b565b604051908152602001610209565b34801561030a57600080fd5b5061028c6103193660046122d1565b610ab7565b34801561032a57600080fd5b506103956103393660046124d0565b60cc602052600090815260409020805460018201546002909201546001600160a01b03909116919063ffffffff808216916401000000008104821691600160401b8204811691600160601b8104821691600160801b9091041687565b604080516001600160a01b039098168852602088019690965263ffffffff94851695870195909552918316606086015282166080850152811660a08401521660c082015260e001610209565b3480156103ed57600080fd5b506104016103fc3660046124e9565b610ae8565b604080516001600160a01b039093168352602083019190915201610209565b34801561042c57600080fd5b5061028c61043b366004612229565b610bb1565b34801561044c57600080fd5b5061028c61045b3660046122d1565b610d9f565b34801561046c57600080fd5b506102f061047b3660046124d0565b60cd6020526000908152604090205481565b34801561049957600080fd5b506102546104a83660046124d0565b610dba565b3480156104b957600080fd5b506102f06104c836600461220c565b610e31565b3480156104d957600080fd5b5061028c610eb8565b3480156104ee57600080fd5b506105026104fd3660046124d0565b610eee565b604051610209919061272e565b34801561051b57600080fd5b506097546001600160a01b0316610254565b34801561053957600080fd5b50610227610fb1565b34801561054e57600080fd5b5061028c61055d366004612392565b610fc0565b34801561056e57600080fd5b5061028c61057d3660046123f1565b610fcb565b34801561058e57600080fd5b5061028c61059d366004612312565b6110ff565b3480156105ae57600080fd5b5061028c6105bd36600461250b565b611137565b61028c6105d03660046124d0565b611197565b3480156105e157600080fd5b506102276105f03660046124d0565b6114b2565b34801561060157600080fd5b506102f06106103660046124d0565b60cf6020526000908152604090205481565b34801561062e57600080fd5b506102f061063d3660046124d0565b60ce6020526000908152604090205481565b34801561065b57600080fd5b5061022761157d565b34801561067057600080fd5b506101fd61067f366004612298565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b3480156106b957600080fd5b5061028c6106c836600461220c565b6115a5565b3480156106d957600080fd5b5061028c6106e836600461250b565b61163d565b600063152a902d60e11b6001600160e01b03198316148061071257506107128261169d565b92915050565b6060606580546107279061292a565b80601f01602080910402602001604051908101604052809291908181526020018280546107539061292a565b80156107a05780601f10610775576101008083540402835291602001916107a0565b820191906000526020600020905b81548152906001019060200180831161078357829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166108285760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b600061084f82610dba565b9050806001600160a01b0316836001600160a01b031614156108bd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161081f565b336001600160a01b03821614806108d957506108d9813361067f565b61094b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161081f565b61095583836116ed565b505050565b600081815260cc60205260408120600201546060919063ffffffff1667ffffffffffffffff81111561098e5761098e6129fa565b6040519080825280602002602001820160405280156109b7578160200160208202803683370190505b509050600060015b60ca54811015610a3257600081815260cd6020526040902054851415610a20576109e881610dba565b8383815181106109fa576109fa6129e4565b6001600160a01b039092166020928302919091019091015281610a1c81612965565b9250505b80610a2a81612965565b9150506109bf565b50909392505050565b600081815260cf602090815260408083205460ce909252822054610a5f91906128e7565b600083815260ce602090815260408083205460cf83528184205560cc909152902054909150610a97906001600160a01b03168261175b565b5050565b60006001610aa860ca5490565b610ab291906128e7565b905090565b610ac13382611868565b610add5760405162461bcd60e51b815260040161081f90612800565b61095583838361195f565b600082815260cc60209081526040808320815160e08101835281546001600160a01b031680825260018301549482019490945260029091015463ffffffff80821693830193909352640100000000810483166060830152600160401b810483166080830152600160601b8104831660a0830152600160801b900490911660c08201528291610b7c5751915060009050610baa565b6080810151815163ffffffff90911690612710610b9983886128c8565b610ba391906128b4565b9350935050505b9250929050565b6097546001600160a01b03163314610bdb5760405162461bcd60e51b815260040161081f906127cb565b6040518060e00160405280876001600160a01b03168152602001868152602001600063ffffffff1681526020018563ffffffff1681526020018463ffffffff1681526020018363ffffffff1681526020018263ffffffff1681525060cc6000610c4360cb5490565b81526020808201929092526040908101600020835181546001600160a01b039091166001600160a01b0319909116178155918301516001830155820151600290910180546060840151608085015160a086015160c09096015163ffffffff908116600160801b0263ffffffff60801b19978216600160601b0263ffffffff60601b19938316600160401b02939093166fffffffffffffffff0000000000000000199483166401000000000267ffffffffffffffff1990961692909716919091179390931791909116939093179290921792909216179055610d2360cb5490565b604080516001600160a01b03891681526020810188905263ffffffff8781168284015286811660608301528581166080830152841660a082015290517fb3131d7d301f8caeb40981cffc627b1fdf324b5e4a23845b61c1a6ad2a25f3859181900360c00190a2610d9760cb80546001019055565b505050505050565b610955838383604051806020016040528060008152506110ff565b6000818152606760205260408120546001600160a01b0316806107125760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161081f565b60006001600160a01b038216610e9c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161081f565b506001600160a01b031660009081526068602052604090205490565b6097546001600160a01b03163314610ee25760405162461bcd60e51b815260040161081f906127cb565b610eec6000611aff565b565b600081815260cc60205260408120600201546060919063ffffffff1667ffffffffffffffff811115610f2257610f226129fa565b604051908082528060200260200182016040528015610f4b578160200160208202803683370190505b509050600060015b60ca54811015610a3257600081815260cd6020526040902054851415610f9f5780838381518110610f8657610f866129e4565b602090810291909101015281610f9b81612965565b9250505b80610fa981612965565b915050610f53565b6060606680546107279061292a565b610a97338383611b51565b600054610100900460ff16610fe65760005460ff1615610fea565b303b155b61104d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161081f565b600054610100900460ff1615801561106f576000805461ffff19166101011790555b6110798484611c20565b611081611c61565b61108a866115a5565b8161109486611c98565b6040516020016110a59291906125fd565b60405160208183030381529060405260c990805190602001906110c99291906120bd565b506110d860ca80546001019055565b6110e660cb80546001019055565b8015610d97576000805461ff0019169055505050505050565b6111093383611868565b6111255760405162461bcd60e51b815260040161081f90612800565b61113184848484611d96565b50505050565b6097546001600160a01b031633146111615760405162461bcd60e51b815260040161081f906127cb565b600091825260cc6020526040909120600201805463ffffffff909216600160801b0263ffffffff60801b19909216919091179055565b600081815260cc6020526040902060020154640100000000900463ffffffff166111fc5760405162461bcd60e51b815260206004820152601660248201527511591a5d1a5bdb88191bd95cc81b9bdd08195e1a5cdd60521b604482015260640161081f565b600081815260cc602052604090206002015463ffffffff640100000000820481169116106112765760405162461bcd60e51b815260206004820152602160248201527f546869732065646974696f6e20697320616c726561647920736f6c64206f75746044820152601760f91b606482015260840161081f565b600081815260cc60205260409020600101543410156112e95760405162461bcd60e51b815260206004820152602960248201527f4d7573742073656e6420656e6f75676820746f207075726368617365207468656044820152681032b234ba34b7b71760b91b606482015260840161081f565b600081815260cc602052604090206002015442600160601b90910463ffffffff16106113505760405162461bcd60e51b8152602060048201526016602482015275105d58dd1a5bdb881a185cdb89dd081cdd185c9d195960521b604482015260640161081f565b600081815260cc602052604090206002015442600160801b90910463ffffffff16116113b25760405162461bcd60e51b8152602060048201526011602482015270105d58dd1a5bdb881a185cc8195b991959607a1b604482015260640161081f565b6113c4336113bf60ca5490565b611dc9565b600081815260ce6020526040812080543492906113e290849061289c565b9091555050600081815260cc60205260408120600201805463ffffffff169161140a83612980565b91906101000a81548163ffffffff021916908363ffffffff160217905550508060cd600061143760ca5490565b81526020810191909152604001600020553361145260ca5490565b600083815260cc602090815260409182902060020154915163ffffffff909216825284917fe38cb07a52e5d88a83de7c9d29c2841118103e462d20f8c526b35872f9977785910160405180910390a46114af60ca80546001019055565b50565b6000818152606760205260409020546060906001600160a01b03166115315760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161081f565b600082815260cd602052604090205460c99061154c90611c98565b61155584611c98565b60405160200161156793929190612638565b6040516020818303038152906040529050919050565b606060c9604051602001611591919061267e565b604051602081830303815290604052905090565b6097546001600160a01b031633146115cf5760405162461bcd60e51b815260040161081f906127cb565b6001600160a01b0381166116345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161081f565b6114af81611aff565b6097546001600160a01b031633146116675760405162461bcd60e51b815260040161081f906127cb565b600091825260cc6020526040909120600201805463ffffffff909216600160601b0263ffffffff60601b19909216919091179055565b60006001600160e01b031982166380ac58cd60e01b14806116ce57506001600160e01b03198216635b5e139f60e01b145b8061071257506301ffc9a760e01b6001600160e01b0319831614610712565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061172282610dba565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b804710156117ab5760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742062616c616e636520666f722073656e64000000604482015260640161081f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146117f8576040519150601f19603f3d011682016040523d82523d6000602084013e6117fd565b606091505b50509050806109555760405162461bcd60e51b815260206004820152603160248201527f556e61626c6520746f2073656e642076616c75653a20726563697069656e74206044820152701b585e481a185d99481c995d995c9d1959607a1b606482015260840161081f565b6000818152606760205260408120546001600160a01b03166118e15760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161081f565b60006118ec83610dba565b9050806001600160a01b0316846001600160a01b031614806119275750836001600160a01b031661191c846107aa565b6001600160a01b0316145b8061195757506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661197282610dba565b6001600160a01b0316146119da5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161081f565b6001600160a01b038216611a3c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161081f565b611a476000826116ed565b6001600160a01b0383166000908152606860205260408120805460019290611a709084906128e7565b90915550506001600160a01b0382166000908152606860205260408120805460019290611a9e90849061289c565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611bb35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161081f565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600054610100900460ff16611c475760405162461bcd60e51b815260040161081f90612851565b611c4f611f0b565b611c57611f0b565b610a978282611f32565b600054610100900460ff16611c885760405162461bcd60e51b815260040161081f90612851565b611c90611f0b565b610eec611f80565b606081611cbc5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611ce65780611cd081612965565b9150611cdf9050600a836128b4565b9150611cc0565b60008167ffffffffffffffff811115611d0157611d016129fa565b6040519080825280601f01601f191660200182016040528015611d2b576020820181803683370190505b5090505b841561195757611d406001836128e7565b9150611d4d600a866129a4565b611d5890603061289c565b60f81b818381518110611d6d57611d6d6129e4565b60200101906001600160f81b031916908160001a905350611d8f600a866128b4565b9450611d2f565b611da184848461195f565b611dad84848484611fb0565b6111315760405162461bcd60e51b815260040161081f90612779565b6001600160a01b038216611e1f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161081f565b6000818152606760205260409020546001600160a01b031615611e845760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161081f565b6001600160a01b0382166000908152606860205260408120805460019290611ead90849061289c565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600054610100900460ff16610eec5760405162461bcd60e51b815260040161081f90612851565b600054610100900460ff16611f595760405162461bcd60e51b815260040161081f90612851565b8151611f6c9060659060208501906120bd565b5080516109559060669060208401906120bd565b600054610100900460ff16611fa75760405162461bcd60e51b815260040161081f90612851565b610eec33611aff565b60006001600160a01b0384163b156120b257604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611ff49033908990889088906004016126a4565b602060405180830381600087803b15801561200e57600080fd5b505af192505050801561203e575060408051601f3d908101601f1916820190925261203b918101906124b3565b60015b612098573d80801561206c576040519150601f19603f3d011682016040523d82523d6000602084013e612071565b606091505b5080516120905760405162461bcd60e51b815260040161081f90612779565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611957565b506001949350505050565b8280546120c99061292a565b90600052602060002090601f0160209004810192826120eb5760008555612131565b82601f1061210457805160ff1916838001178555612131565b82800160010185558215612131579182015b82811115612131578251825591602001919060010190612116565b5061213d929150612141565b5090565b5b8082111561213d5760008155600101612142565b600067ffffffffffffffff80841115612171576121716129fa565b604051601f8501601f19908116603f01168101908282118183101715612199576121996129fa565b816040528093508581528686860111156121b257600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126121dd57600080fd5b6121ec83833560208501612156565b9392505050565b803563ffffffff8116811461220757600080fd5b919050565b60006020828403121561221e57600080fd5b81356121ec81612a10565b60008060008060008060c0878903121561224257600080fd5b863561224d81612a10565b955060208701359450612262604088016121f3565b9350612270606088016121f3565b925061227e608088016121f3565b915061228c60a088016121f3565b90509295509295509295565b600080604083850312156122ab57600080fd5b82356122b681612a10565b915060208301356122c681612a10565b809150509250929050565b6000806000606084860312156122e657600080fd5b83356122f181612a10565b9250602084013561230181612a10565b929592945050506040919091013590565b6000806000806080858703121561232857600080fd5b843561233381612a10565b9350602085013561234381612a10565b925060408501359150606085013567ffffffffffffffff81111561236657600080fd5b8501601f8101871361237757600080fd5b61238687823560208401612156565b91505092959194509250565b600080604083850312156123a557600080fd5b82356123b081612a10565b9150602083013580151581146122c657600080fd5b600080604083850312156123d857600080fd5b82356123e381612a10565b946020939093013593505050565b600080600080600060a0868803121561240957600080fd5b853561241481612a10565b945060208601359350604086013567ffffffffffffffff8082111561243857600080fd5b61244489838a016121cc565b9450606088013591508082111561245a57600080fd5b61246689838a016121cc565b9350608088013591508082111561247c57600080fd5b50612489888289016121cc565b9150509295509295909350565b6000602082840312156124a857600080fd5b81356121ec81612a25565b6000602082840312156124c557600080fd5b81516121ec81612a25565b6000602082840312156124e257600080fd5b5035919050565b600080604083850312156124fc57600080fd5b50508035926020909101359150565b6000806040838503121561251e57600080fd5b8235915061252e602084016121f3565b90509250929050565b6000815180845261254f8160208601602086016128fe565b601f01601f19169290920160200192915050565b8054600090600181811c908083168061257d57607f831692505b602080841082141561259f57634e487b7160e01b600052602260045260246000fd5b8180156125b357600181146125c4576125f1565b60ff198616895284890196506125f1565b60008881526020902060005b868110156125e95781548b8201529085019083016125d0565b505084890196505b50505050505092915050565b6000835161260f8184602088016128fe565b8351908301906126238183602088016128fe565b602f60f81b9101908152600101949350505050565b60006126448286612563565b84516126548183602089016128fe565b602f60f81b910190815283516126718160018401602088016128fe565b0160010195945050505050565b600061268a8284612563565b691cdd1bdc99599c9bdb9d60b21b8152600a019392505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906126d790830184612537565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127225783516001600160a01b0316835292840192918401916001016126fd565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127225783518352928401929184019160010161274a565b6020815260006121ec6020830184612537565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082198211156128af576128af6129b8565b500190565b6000826128c3576128c36129ce565b500490565b60008160001904831182151516156128e2576128e26129b8565b500290565b6000828210156128f9576128f96129b8565b500390565b60005b83811015612919578181015183820152602001612901565b838111156111315750506000910152565b600181811c9082168061293e57607f821691505b6020821081141561295f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612979576129796129b8565b5060010190565b600063ffffffff8083168181141561299a5761299a6129b8565b6001019392505050565b6000826129b3576129b36129ce565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146114af57600080fd5b6001600160e01b0319811681146114af57600080fdfea2646970667358221220688d6bf43e5d68af458be79674990456921e4379f43e1ed568307127798e55d664736f6c63430008070033608060405234801561001057600080fd5b5060405161050e38038061050e83398101604081905261002f91610148565b61003833610047565b61004181610097565b50610178565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100aa8161014260201b61020a1760201c565b6101205760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b3b151590565b60006020828403121561015a57600080fd5b81516001600160a01b038116811461017157600080fd5b9392505050565b610387806101876000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80633659cfe61461005c5780635c60da1b14610071578063715018a61461009a5780638da5cb5b146100a2578063f2fde38b146100b3575b600080fd5b61006f61006a3660046102ec565b6100c6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006f610139565b6000546001600160a01b031661007e565b61006f6100c13660046102ec565b61016f565b6000546001600160a01b031633146100f95760405162461bcd60e51b81526004016100f09061031c565b60405180910390fd5b61010281610210565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6000546001600160a01b031633146101635760405162461bcd60e51b81526004016100f09061031c565b61016d600061029c565b565b6000546001600160a01b031633146101995760405162461bcd60e51b81526004016100f09061031c565b6001600160a01b0381166101fe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100f0565b6102078161029c565b50565b3b151590565b803b61027a5760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b60648201526084016100f0565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156102fe57600080fd5b81356001600160a01b038116811461031557600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220f118eb414a6e2818df67771501def6895f30169ec351de47781ca190a332f3c164736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220a07447cde8668c2e554848f587d1183feba69ca6e32a39aa633a93899deec0c064736f6c63430008070033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/BeaconProxy.json b/abis/BeaconProxy.json deleted file mode 100644 index 4e8648a..0000000 --- a/abis/BeaconProxy.json +++ /dev/null @@ -1,57 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "beacon", "type": "address" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { "stateMutability": "payable", "type": "fallback" }, - { "stateMutability": "payable", "type": "receive" } -] diff --git a/abis/ERC721.json b/abis/ERC721.json deleted file mode 100644 index 66e7178..0000000 --- a/abis/ERC721.json +++ /dev/null @@ -1,422 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "baseURI", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "baseURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/package.json b/package.json index 01a4abe..d43330d 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,11 @@ "scripts": { "codegen": "graph codegen", "build": "graph build", - "deploy": "graph deploy --node https://api.thegraph.com/deploy/ schmidsi/sound-subgraph", - "create-local": "graph create --node http://localhost:8020/ schmidsi/sound-subgraph", - "remove-local": "graph remove --node http://localhost:8020/ schmidsi/sound-subgraph", - "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 schmidsi/sound-subgraph" + "deploy": "graph deploy --node https://api.thegraph.com/deploy/ facupagnuolo/sound" }, "dependencies": { "@graphprotocol/graph-cli": "0.26.0", "@graphprotocol/graph-ts": "0.24.1" } } + diff --git a/schema.graphql b/schema.graphql index 3542f0b..20333a1 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,49 +1,102 @@ -type AdminChanged @entity { +type Artist @entity { id: ID! - previousAdmin: Bytes! # address - newAdmin: Bytes! # address + uri: String! + artistId: BigInt! + name: String! + symbol: String! + totalSupply: BigInt! + owner: Account! + creator: Account! + editions: [Edition!]! @derivedFrom(field: "artist") + tokens: [Token!]! @derivedFrom(field: "artist") + sales: [Sale!]! @derivedFrom(field: "artist") + transfers: [Transfer!]! @derivedFrom(field: "artist") } -type BeaconUpgraded @entity { +type Edition @entity { id: ID! - beacon: Bytes! # address -} - -type Upgraded @entity { - id: ID! - implementation: Bytes! # address + uri: String! + artist: Artist! + editionId: BigInt! + fundingRecipient: Bytes! + price: BigInt! + numSold: BigInt! + quantity: BigInt! + royaltyBPS: BigInt! + startTime: BigInt! + endTime: BigInt! + tokens: [Token!]! @derivedFrom(field: "edition") + sales: [Sale!]! @derivedFrom(field: "edition") + transfers: [Transfer!]! @derivedFrom(field: "edition") } type Token @entity { id: ID! - owner: Owner - uri: String + uri: String! + artist: Artist! + edition: Edition! + tokenId: BigInt! + owner: Account! + creator: Account! + sales: [Sale!]! @derivedFrom(field: "token") transfers: [Transfer!]! @derivedFrom(field: "token") - contract: Contract } -type Owner @entity { +interface Event { id: ID! - ownedTokens: [Token!]! @derivedFrom(field: "owner") - balance: BigInt + artist: Artist! + edition: Edition! + token: Token! + blockNumber: BigInt! + blockHhash: Bytes! + txHash: Bytes! + timestamp: BigInt! } -type Contract @entity { +type Sale implements Event @entity { id: ID! - name: String - symbol: String - totalSupply: BigInt - mintedTokens: [Token!]! @derivedFrom(field: "contract") + artist: Artist! + edition: Edition! + token: Token! + blockNumber: BigInt! + blockHhash: Bytes! + txHash: Bytes! + timestamp: BigInt! + currency: Bytes! + amount: BigInt! + seller: Account! + buyer: Account! } -type Transfer @entity { +type Transfer implements Event @entity { id: ID! + artist: Artist! + edition: Edition! token: Token! - # Empty from is minting - from: Owner - # Empty to is burning - to: Owner + blockNumber: BigInt! + blockHhash: Bytes! + txHash: Bytes! timestamp: BigInt! - block: BigInt! - transactionHash: String! + from: Account! + to: Account! +} + +type Balance @entity { + id: ID! + artist: Artist! + account: Account! + amount: BigInt! +} + +type Account @entity { + id: ID! + ownedArtists: [Artist!]! @derivedFrom(field: "owner") + createdArtists: [Artist!]! @derivedFrom(field: "owner") + ownedTokens: [Token!]! @derivedFrom(field: "owner") + createdTokens: [Token!]! @derivedFrom(field: "creator") + balances: [Balance!]! @derivedFrom(field: "account") + bought: [Sale!]! @derivedFrom(field: "buyer") + sold: [Sale!]! @derivedFrom(field: "seller") + sent: [Transfer!]! @derivedFrom(field: "from") + received: [Transfer!]! @derivedFrom(field: "to") } diff --git a/src/Artist.ts b/src/Artist.ts new file mode 100644 index 0000000..d82561e --- /dev/null +++ b/src/Artist.ts @@ -0,0 +1,252 @@ +import { Address, BigInt, log, ethereum } from '@graphprotocol/graph-ts' + +import { Artist as ArtistContract } from '../generated/ArtistCreator/Artist' +import { + Account as AccountEntity, + Artist as ArtistEntity, + Balance as BalanceEntity, + Edition as EditionEntity, + Token as TokenEntity, + Sale as SaleEntity, + Transfer as TransferEntity +} from '../generated/schema' +import { + EditionCreated as EditionCreatedEvent, + EditionPurchased as EditionPurchasedEvent, + OwnershipTransferred as OwnershipTransferredEvent, + Transfer as TransferEvent +} from '../generated/templates/Artist/Artist' + +const ZERO_ADDRESS = Address.fromString('0x0000000000000000000000000000000000000000') + +export function handleOwnershipTransferred(event: OwnershipTransferredEvent): void { + let owner = loadOrCreateAccount(event.params.newOwner) + owner.save() + + let artist = loadOrCreateArtist(event.address) + artist.owner = owner.id + artist.save() +} + +export function handleEditionCreated(event: EditionCreatedEvent): void { + let edition = loadOrCreateEdition(event.address, event.params.editionId) + edition.artist = buildArtistId(event.address) + edition.editionId = event.params.editionId + edition.fundingRecipient = event.params.fundingRecipient + edition.price = event.params.price + edition.quantity = event.params.quantity + edition.royaltyBPS = event.params.royaltyBPS + edition.startTime = event.params.startTime + edition.endTime = event.params.endTime + edition.numSold = BigInt.zero() + edition.uri = getEditionUri(event.address, event.params.editionId) + edition.save() +} + +export function handleEditionPurchased(event: EditionPurchasedEvent): void { + let artist = loadOrCreateArtist(event.address) + artist.totalSupply = artist.totalSupply.plus(BigInt.fromI32(1)) + artist.save() + + let edition = loadOrCreateEdition(event.address, event.params.editionId) + edition.numSold = edition.numSold.plus(BigInt.fromI32(1)) + edition.save() + + let buyer = loadOrCreateAccount(event.params.buyer) + buyer.save() + + let creator = loadOrCreateAccount(event.transaction.from) + creator.save() + + let balance = loadOrCreateBalance(event.address, event.params.buyer) + balance.amount = balance.amount.plus(BigInt.fromI32(1)) + balance.save() + + let token = loadOrCreateToken(event.address, event.params.editionId, event.params.tokenId) + token.owner = buyer.id + token.creator = creator.id + token.uri = getTokenUri(event.address, event.params.tokenId) + token.save() + + let id = buildEventId(event) + let sale = new SaleEntity(id) + sale.artist = buildArtistId(event.address) + sale.edition = buildEditionId(event.address, event.params.editionId) + sale.token = buildTokenId(event.address, event.params.editionId, event.params.tokenId) + sale.seller = creator.id + sale.buyer = buyer.id + sale.amount = edition.price + sale.currency = ZERO_ADDRESS + sale.blockNumber = event.block.number + sale.blockHhash = event.block.hash + sale.timestamp = event.block.timestamp + sale.txHash = event.transaction.hash + sale.save() +} + +export function handleTransfer(event: TransferEvent): void { + let from = loadOrCreateAccount(event.params.from) + from.save() + + let to = loadOrCreateAccount(event.params.to) + to.save() + + let balanceSender = loadOrCreateBalance(event.address, event.params.from) + balanceSender.amount = balanceSender.amount.minus(BigInt.fromI32(1)) + balanceSender.save() + + let balanceRecipient = loadOrCreateBalance(event.address, event.params.from) + balanceRecipient.amount = balanceRecipient.amount.plus(BigInt.fromI32(1)) + balanceRecipient.save() + + let editionId = getEditionIdForToken(event.address, event.params.tokenId) + let token = loadOrCreateToken(event.address, editionId, event.params.tokenId) + token.owner = to.id + token.save() + + let id = buildEventId(event) + let transfer = new TransferEntity(id) + transfer.artist = buildArtistId(event.address) + transfer.edition = buildEditionId(event.address, editionId) + transfer.token = buildTokenId(event.address, editionId, event.params.tokenId) + transfer.from = from.id + transfer.to = to.id + transfer.blockNumber = event.block.number + transfer.blockHhash = event.block.hash + transfer.timestamp = event.block.timestamp + transfer.txHash = event.transaction.hash + transfer.save() +} + +export function loadOrCreateAccount(address: Address): AccountEntity { + let id = buildAccountId(address) + let account = AccountEntity.load(id) + return account === null ? new AccountEntity(id) : account +} + +export function loadOrCreateArtist(address: Address): ArtistEntity { + let id = buildArtistId(address) + let artist = ArtistEntity.load(id) + + if (artist === null) { + artist = new ArtistEntity(id) + artist.uri = '' + artist.totalSupply = BigInt.zero() + } else if (artist.uri == '') { + artist.uri = getArtistBaseUri(address) + } + + return artist +} + +function loadOrCreateEdition(artist: Address, editionId: BigInt): EditionEntity { + let id = buildEditionId(artist, editionId) + let edition = EditionEntity.load(id) + + if (edition === null) { + edition = new EditionEntity(id) + edition.artist = buildArtistId(artist) + } + + return edition +} + +function loadOrCreateToken(artist: Address, editionId: BigInt, tokenId: BigInt): TokenEntity { + let id = buildTokenId(artist, editionId, tokenId) + let token = TokenEntity.load(id) + + if (token === null) { + token = new TokenEntity(id) + token.tokenId = tokenId + token.artist = buildArtistId(artist) + token.edition = buildEditionId(artist, editionId) + } + + return token +} + +function loadOrCreateBalance(artist: Address, account: Address): BalanceEntity { + let id = buildBalanceId(artist, account) + let balance = BalanceEntity.load(id) + + if (balance === null) { + balance = new BalanceEntity(id) + balance.artist = buildArtistId(artist) + balance.account = buildAccountId(account) + balance.amount = BigInt.zero() + } + + return balance +} + +function getArtistBaseUri(artist: Address): string { + let artistContract = ArtistContract.bind(artist) + let contractUriCall = artistContract.try_contractURI() + + if (!contractUriCall.reverted) { + return contractUriCall.value.replace('storefront', '') + } + + log.warning('contractURI() call reverted for {}', [artist.toHexString()]) + return 'unknown' +} + +function getEditionUri(artist: Address, editionId: BigInt): string { + let artistContract = ArtistContract.bind(artist) + let contractUriCall = artistContract.try_contractURI() + + if (!contractUriCall.reverted) { + return contractUriCall.value.replace('storefront', editionId.toString()) + } + + log.warning('contractURI() call reverted for {}', [artist.toHexString()]) + return 'unknown' +} + +function getTokenUri(artist: Address, tokenId: BigInt): string { + let artistContract = ArtistContract.bind(artist) + let tokenUriCall = artistContract.try_tokenURI(tokenId) + + if (!tokenUriCall.reverted) { + return tokenUriCall.value + } + + log.warning('tokenURI() call reverted for {} and token #{}', [artist.toHexString(), tokenId.toString()]) + return 'unknown' +} + +function getEditionIdForToken(artist: Address, tokenId: BigInt): BigInt { + let artistContract = ArtistContract.bind(artist) + let tokenToEditionCall = artistContract.try_tokenToEdition(tokenId) + + if (!tokenToEditionCall.reverted) { + return tokenToEditionCall.value + } + + log.warning('tokenToEdition() call reverted for {} and token #{}', [artist.toHexString(), tokenId.toString()]) + return BigInt.zero() +} + +function buildArtistId(artist: Address): string { + return artist.toHexString() +} + +function buildAccountId(account: Address): string { + return account.toHexString() +} + +function buildEditionId(artist: Address, editionId: BigInt): string { + return artist.toHexString() + '/' + editionId.toString() +} + +function buildTokenId(artist: Address, editionId: BigInt, tokenId: BigInt): string { + return artist.toHexString() + '/' + editionId.toString() + '/' + tokenId.toString() +} + +function buildBalanceId(artist: Address, owner: Address): string { + return artist.toHexString() + '/' + owner.toHexString() +} + +function buildEventId(event: ethereum.Event): string { + return event.transaction.hash.toHexString() + ':' + event.transactionLogIndex.toHexString() +} diff --git a/src/ArtistCreator.ts b/src/ArtistCreator.ts new file mode 100644 index 0000000..440ae98 --- /dev/null +++ b/src/ArtistCreator.ts @@ -0,0 +1,19 @@ +import { Artist as ArtistTemplate } from '../generated/templates' +import { CreatedArtist as CreatedArtistEvent } from '../generated/ArtistCreator/ArtistCreator' + +import { loadOrCreateAccount, loadOrCreateArtist } from './Artist' + +export function handleCreatedArtist(event: CreatedArtistEvent): void { + ArtistTemplate.create(event.params.artistAddress) + + let owner = loadOrCreateAccount(event.transaction.from) + owner.save() + + let artist = loadOrCreateArtist(event.params.artistAddress) + artist.owner = owner.id + artist.creator = owner.id + artist.name = event.params.name + artist.symbol = event.params.symbol + artist.artistId = event.params.artistId + artist.save() +} diff --git a/src/erc721.ts b/src/erc721.ts deleted file mode 100644 index 4e3cea2..0000000 --- a/src/erc721.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { log, BigInt } from "@graphprotocol/graph-ts"; -import { ERC721, Transfer as TransferEvent } from "../generated/HENO/ERC721"; -import { Token, Owner, Contract, Transfer } from "../generated/schema"; - -export function handleTransfer(event: TransferEvent): void { - log.debug("Transfer detected. From: {} | To: {} | TokenID: {}", [ - event.params.from.toHexString(), - event.params.to.toHexString(), - event.params.tokenId.toHexString(), - ]); - - let previousOwner = Owner.load(event.params.from.toHexString()); - let newOwner = Owner.load(event.params.to.toHexString()); - let token = Token.load(event.params.tokenId.toHexString()); - let transferId = event.transaction.hash - .toHexString() - .concat(":".concat(event.transactionLogIndex.toHexString())); - let transfer = Transfer.load(transferId); - let contract = Contract.load(event.address.toHexString()); - let instance = ERC721.bind(event.address); - - if (previousOwner == null) { - previousOwner = new Owner(event.params.from.toHexString()); - - previousOwner.balance = BigInt.fromI32(0); - } else { - let prevBalance = previousOwner.balance; - if (prevBalance > BigInt.fromI32(0)) { - previousOwner.balance = prevBalance - BigInt.fromI32(1); - } - } - - if (newOwner == null) { - newOwner = new Owner(event.params.to.toHexString()); - newOwner.balance = BigInt.fromI32(1); - } else { - let prevBalance = newOwner.balance; - newOwner.balance = prevBalance + BigInt.fromI32(1); - } - - if (token == null) { - token = new Token(event.params.tokenId.toHexString()); - token.contract = event.address.toHexString(); - - let uri = instance.try_tokenURI(event.params.tokenId); - if (!uri.reverted) { - token.uri = uri.value; - } - } - - token.owner = event.params.to.toHexString(); - - if (transfer == null) { - transfer = new Transfer(transferId); - transfer.token = event.params.tokenId.toHexString(); - transfer.from = event.params.from.toHexString(); - transfer.to = event.params.to.toHexString(); - transfer.timestamp = event.block.timestamp; - transfer.block = event.block.number; - transfer.transactionHash = event.transaction.hash.toHexString(); - } - - if (contract == null) { - contract = new Contract(event.address.toHexString()); - } - - let name = instance.try_name(); - if (!name.reverted) { - contract.name = name.value; - } - - let symbol = instance.try_symbol(); - if (!symbol.reverted) { - contract.symbol = symbol.value; - } - - let totalSupply = instance.try_totalSupply(); - if (!totalSupply.reverted) { - contract.totalSupply = totalSupply.value; - } - - previousOwner.save(); - newOwner.save(); - token.save(); - contract.save(); - transfer.save(); -} diff --git a/src/mapping.ts b/src/mapping.ts deleted file mode 100644 index 2275578..0000000 --- a/src/mapping.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { - AdminChanged as AdminChangedEvent, - BeaconUpgraded as BeaconUpgradedEvent, - Upgraded as UpgradedEvent, -} from "../generated/BeaconProxy/BeaconProxy"; -import { AdminChanged, BeaconUpgraded, Upgraded } from "../generated/schema"; - -export function handleAdminChanged(event: AdminChangedEvent): void { - let entity = new AdminChanged( - event.transaction.hash.toHex() + "-" + event.logIndex.toString() - ); - entity.previousAdmin = event.params.previousAdmin; - entity.newAdmin = event.params.newAdmin; - entity.save(); -} - -export function handleBeaconUpgraded(event: BeaconUpgradedEvent): void { - let entity = new BeaconUpgraded( - event.transaction.hash.toHex() + "-" + event.logIndex.toString() - ); - entity.beacon = event.params.beacon; - entity.save(); -} - -export function handleUpgraded(event: UpgradedEvent): void { - let entity = new Upgraded( - event.transaction.hash.toHex() + "-" + event.logIndex.toString() - ); - entity.implementation = event.params.implementation; - entity.save(); -} diff --git a/subgraph.yaml b/subgraph.yaml index 52c6826..bda937e 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -1,53 +1,59 @@ specVersion: 0.0.2 +description: Sound schema: file: ./schema.graphql dataSources: - - kind: ethereum - name: BeaconProxy + - kind: ethereum/contract + name: ArtistCreator network: mainnet source: - address: "0x0edF898b526203776Ee799eD5F58a3d2651ab39b" - abi: BeaconProxy - startBlock: 13819618 + address: '0x78e3adc0e811e4f93bd9f1f9389b923c9a3355c2' + abi: ArtistCreator + startBlock: 13725566 mapping: kind: ethereum/events apiVersion: 0.0.5 language: wasm/assemblyscript entities: - - AdminChanged - - BeaconUpgraded - - Upgraded + - Artist + - Account abis: - - name: BeaconProxy - file: ./abis/BeaconProxy.json + - name: ArtistCreator + file: ./abis/ArtistCreator.json + - name: Artist + file: ./abis/Artist.json eventHandlers: - - event: AdminChanged(address,address) - handler: handleAdminChanged - - event: BeaconUpgraded(indexed address) - handler: handleBeaconUpgraded - - event: Upgraded(indexed address) - handler: handleUpgraded - file: ./src/mapping.ts + - event: CreatedArtist(uint256,string,string,indexed address) + handler: handleCreatedArtist + file: ./src/ArtistCreator.ts +templates: - kind: ethereum/contract - name: Heno + name: Artist network: mainnet source: - address: "0x87853A0b58F2C36FeAf0F9183953D9319e598c16" - abi: ERC721 - startBlock: 13882090 + abi: Artist mapping: kind: ethereum/events apiVersion: 0.0.5 language: wasm/assemblyscript entities: + - Artist + - Edition - Token - - Owner - - Contract + - Sale - Transfer + - Account + - Balance abis: - - name: ERC721 - file: ./abis/ERC721.json + - name: Artist + file: ./abis/Artist.json eventHandlers: + - event: EditionCreated(indexed uint256,address,uint256,uint32,uint32,uint32,uint32) + handler: handleEditionCreated + - event: EditionPurchased(indexed uint256,indexed uint256,uint32,indexed address) + handler: handleEditionPurchased + - event: OwnershipTransferred(indexed address,indexed address) + handler: handleOwnershipTransferred - event: Transfer(indexed address,indexed address,indexed uint256) handler: handleTransfer - file: ./src/erc721.ts + file: ./src/Artist.ts diff --git a/yarn.lock b/yarn.lock index b7158b7..46e9a06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1070,9 +1070,9 @@ glob@^7.1.2, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -"gluegun@git+https://github.com/edgeandnode/gluegun.git#v4.3.1-pin-colors-dep": +"gluegun@https://github.com/edgeandnode/gluegun#v4.3.1-pin-colors-dep": version "4.3.1" - resolved "git+https://github.com/edgeandnode/gluegun.git#b34b9003d7bf556836da41b57ef36eb21570620a" + resolved "https://github.com/edgeandnode/gluegun#b34b9003d7bf556836da41b57ef36eb21570620a" dependencies: apisauce "^1.0.1" app-module-path "^2.2.0" From fa9097ac4191d5be7b2de4ee1d041b98a74f82cd Mon Sep 17 00:00:00 2001 From: Facu Spagnuolo Date: Tue, 1 Feb 2022 12:27:01 -0300 Subject: [PATCH 2/2] fix typo --- schema.graphql | 6 +++--- src/Artist.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/schema.graphql b/schema.graphql index 20333a1..f2fe6c4 100644 --- a/schema.graphql +++ b/schema.graphql @@ -48,7 +48,7 @@ interface Event { edition: Edition! token: Token! blockNumber: BigInt! - blockHhash: Bytes! + blockHash: Bytes! txHash: Bytes! timestamp: BigInt! } @@ -59,7 +59,7 @@ type Sale implements Event @entity { edition: Edition! token: Token! blockNumber: BigInt! - blockHhash: Bytes! + blockHash: Bytes! txHash: Bytes! timestamp: BigInt! currency: Bytes! @@ -74,7 +74,7 @@ type Transfer implements Event @entity { edition: Edition! token: Token! blockNumber: BigInt! - blockHhash: Bytes! + blockHash: Bytes! txHash: Bytes! timestamp: BigInt! from: Account! diff --git a/src/Artist.ts b/src/Artist.ts index d82561e..6379a8c 100644 --- a/src/Artist.ts +++ b/src/Artist.ts @@ -78,7 +78,7 @@ export function handleEditionPurchased(event: EditionPurchasedEvent): void { sale.amount = edition.price sale.currency = ZERO_ADDRESS sale.blockNumber = event.block.number - sale.blockHhash = event.block.hash + sale.blockHash = event.block.hash sale.timestamp = event.block.timestamp sale.txHash = event.transaction.hash sale.save() @@ -112,7 +112,7 @@ export function handleTransfer(event: TransferEvent): void { transfer.from = from.id transfer.to = to.id transfer.blockNumber = event.block.number - transfer.blockHhash = event.block.hash + transfer.blockHash = event.block.hash transfer.timestamp = event.block.timestamp transfer.txHash = event.transaction.hash transfer.save()