Address Contract Partially Verified
Address
0xDF5b5ee15CC96ba7d0CB6BD9b2c0fc4417ab6445
Balance
31.9697 ETH ($68763.31)
Nonce
1
Code Size
11910 bytes
Creator
0x3527a204...4e6C at tx 0x4d76669a...9b8d87
Indexed Transactions
0 (1 on-chain, 0.6% indexed)
Contract Bytecode
11910 bytes
0x6080604052600436106102a05760003560e01c806395d89b411161016e578063cfd7b0df116100cb578063e8a3d4851161007f578063ed459df211610064578063ed459df21461086a578063f2fde38b1461088a578063f3e0c290146108aa57600080fd5b8063e8a3d4851461080c578063e985e9c51461082157600080fd5b8063e1bf9c08116100b0578063e1bf9c08146107ac578063e33a5934146107cc578063e4c0aaf4146107ec57600080fd5b8063cfd7b0df1461074b578063d3bb05281461077f57600080fd5b8063b88d4fde11610122578063c7af335211610107578063c7af3352146106eb578063c7c2ade91461070b578063c87b56dd1461072b57600080fd5b8063b88d4fde146106b8578063bd8616ec146106d857600080fd5b8063a015a3d811610153578063a015a3d81461064b578063a22cb4651461066b578063aa0ff6801461068b57600080fd5b806395d89b41146105e25780639e6d134d1461062b57600080fd5b806342842e0e1161021c578063715018a6116101d05780637fd6f15c116101b55780637fd6f15c1461056e5780638da5cb5b146105a25780638f32d59b146105c257600080fd5b8063715018a61461054457806379ba50971461055957600080fd5b80636352211e116102015780636352211e146104e457806368742da61461050457806370a082311461052457600080fd5b806342842e0e14610489578063602787ed146104a957600080fd5b80630c340a241161027357806323b872dd1161025857806323b872dd146103bf578063279c806e146103df57806339a0c6f91461046957600080fd5b80630c340a241461038a57806323452b9c146103aa57600080fd5b806301ffc9a7146102a557806306fdde03146102da578063081812fc14610330578063095ea7b314610368575b600080fd5b3480156102b157600080fd5b506102c56102c0366004612990565b6108ca565b60405190151581526020015b60405180910390f35b3480156102e657600080fd5b506103236040518060400160405280601281526020017f4d6972726f722045646974696f6e73205633000000000000000000000000000081525081565b6040516102d19190612c2d565b34801561033c57600080fd5b5061035061034b366004612a13565b6109af565b6040516001600160a01b0390911681526020016102d1565b34801561037457600080fd5b50610388610383366004612878565b610a5a565b005b34801561039657600080fd5b50600654610350906001600160a01b031681565b3480156103b657600080fd5b50610388610baa565b3480156103cb57600080fd5b506103886103da366004612784565b610c16565b3480156103eb57600080fd5b506104336103fa366004612a13565b60096020526000908152604090208054600182015460028301546003840154600490940154929391926001600160a01b03909116919085565b6040805195865260208601949094526001600160a01b03909216928401929092526060830191909152608082015260a0016102d1565b34801561047557600080fd5b506103886104843660046129ca565b610c9d565b34801561049557600080fd5b506103886104a4366004612784565b610d23565b3480156104b557600080fd5b506104d66104c4366004612a13565b600a6020526000908152604090205481565b6040519081526020016102d1565b3480156104f057600080fd5b506103506104ff366004612a13565b610d3e565b34801561051057600080fd5b5061038861051f36600461270a565b610dc9565b34801561053057600080fd5b506104d661053f36600461270a565b610fc0565b34801561055057600080fd5b5061038861105a565b34801561056557600080fd5b506103886110f3565b34801561057a57600080fd5b506104d67f00000000000000000000000000000000000000000000000000000000000000fa81565b3480156105ae57600080fd5b50600454610350906001600160a01b031681565b3480156105ce57600080fd5b506004546001600160a01b031633146102c5565b3480156105ee57600080fd5b506103236040518060400160405280600b81526020017f45444954494f4e535f563300000000000000000000000000000000000000000081525081565b34801561063757600080fd5b50610388610646366004612a2c565b6111be565b34801561065757600080fd5b50610350610666366004612a13565b61127e565b34801561067757600080fd5b50610388610686366004612845565b611305565b34801561069757600080fd5b506104d66106a636600461270a565b60076020526000908152604090205481565b3480156106c457600080fd5b506103886106d33660046127c5565b6113ca565b6103886106e6366004612a13565b611458565b3480156106f757600080fd5b506006546001600160a01b031633146102c5565b34801561071757600080fd5b506103886107263660046128a4565b611709565b34801561073757600080fd5b50610323610746366004612a13565b6118da565b34801561075757600080fd5b506103507f00000000000000000000000021a93be569666527dae0fdbfbe7715299dec120281565b34801561078b57600080fd5b506104d661079a366004612a13565b600b6020526000908152604090205481565b3480156107b857600080fd5b506104d66107c7366004612a13565b611984565b3480156107d857600080fd5b506103886107e7366004612a51565b6119bd565b3480156107f857600080fd5b5061038861080736600461270a565b611afd565b34801561081857600080fd5b50610323611b8e565b34801561082d57600080fd5b506102c561083c36600461274b565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b34801561087657600080fd5b506005546001600160a01b031633146102c5565b34801561089657600080fd5b506103886108a536600461270a565b611bb6565b3480156108b657600080fd5b506104d66108c5366004612a13565b611c88565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061095d57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806109a957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000818152602081905260408120546001600160a01b0316610a3e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b506000908152600260205260409020546001600160a01b031690565b6000610a6582610d3e565b9050806001600160a01b0316836001600160a01b03161415610aef5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610a35565b336001600160a01b0382161480610b2957506001600160a01b038116600090815260036020908152604080832033845290915290205460ff165b610b9b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610a35565b610ba58383611d06565b505050565b6004546001600160a01b03163314610c045760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e00000000000000006044820152606401610a35565b600580546001600160a01b0319169055565b610c203382611d74565b610c925760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610a35565b610ba5838383611e7c565b6004546001600160a01b0316331480610cc057506006546001600160a01b031633145b610d0c5760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610a35565b8051610d1f906008906020840190612609565b5050565b610ba5838383604051806020016040528060008152506113ca565b6000818152602081905260408120546001600160a01b0316806109a95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610a35565b6002600e541415610e1c5760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c0000000000000000000000000000000000006044820152606401610a35565b6002600e556001600160a01b038116600090815260076020526040812080549082905590610e4982611984565b9050610e558183612ce5565b91507f00000000000000000000000021a93be569666527dae0fdbfbe7715299dec12026001600160a01b03166361d027b36040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610eb257600080fd5b505af1158015610ec6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eea919061272e565b6040517fe75cb3020000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152919091169063e75cb3029083906024016000604051808303818588803b158015610f4957600080fd5b505af1158015610f5d573d6000803e3d6000fd5b5050505050610f6c838361204d565b604080516001600160a01b0385168152602081018490529081018290527ffbc3a599b784fe88772fc5abcc07223f64ca0b13acc341f4fb1e46bef0510eb49060600160405180910390a150506001600e5550565b60006001600160a01b03821661103e5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610a35565b506001600160a01b031660009081526001602052604090205490565b6004546001600160a01b031633146110b45760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e00000000000000006044820152606401610a35565b600480546001600160a01b031916905560405160009081907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3565b6005546001600160a01b031633146111735760405162461bcd60e51b815260206004820152602c60248201527f63757272656e74206f776e6572206d757374207365742063616c6c657220617360448201527f206e657874206f776e65722e00000000000000000000000000000000000000006064820152608401610a35565b600580546001600160a01b0319908116909155600480543392168217905560405181907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3565b6000828152600960205260409020600201546001600160a01b0316331461124d5760405162461bcd60e51b815260206004820152603260248201527f4f6e6c792063757272656e742066756e64696e67526563697069656e7420636160448201527f6e206d6f64696679206974732076616c756500000000000000000000000000006064820152608401610a35565b60009182526009602052604090912060020180546001600160a01b0319166001600160a01b03909216919091179055565b6000818152600a60205260408120546112d95760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e20686173206e6f74206265656e206d696e746564207965740000006044820152606401610a35565b506000908152600a6020908152604080832054835260099091529020600201546001600160a01b031690565b6001600160a01b03821633141561135e5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a35565b3360008181526003602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6113d43383611d74565b6114465760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610a35565b61145284848484612166565b50505050565b6002600e5414156114ab5760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c0000000000000000000000000000000000006044820152606401610a35565b6002600e5560008181526009602052604090205461150b5760405162461bcd60e51b815260206004820152601660248201527f45646974696f6e20646f6573206e6f74206578697374000000000000000000006044820152606401610a35565b60008181526009602052604090208054600390910154106115945760405162461bcd60e51b815260206004820152602160248201527f546869732065646974696f6e20697320616c726561647920736f6c64206f757460448201527f2e000000000000000000000000000000000000000000000000000000000000006064820152608401610a35565b60008181526009602052604090206001015434101561161b5760405162461bcd60e51b815260206004820152602960248201527f4d7573742073656e6420656e6f75676820746f2070757263686173652074686560448201527f2065646974696f6e2e00000000000000000000000000000000000000000000006064820152608401610a35565b600081815260096020526040812060030180549161163883612d63565b90915550506000818152600960209081526040808320600201546001600160a01b03168352600790915281208054349290611674908490612c9a565b9250508190555061168733600c546121ef565b600c80546000908152600a60209081526040808320859055925484835260098252918390206003015483519081523491810191909152339284917f23e6d1a59ae9923eb7b39939b8259c796bc664751ba6b6f64f93027895e9994c910160405180910390a4600c80549060006116fc83612d63565b90915550506001600e5550565b6002600e54141561175c5760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c0000000000000000000000000000000000006044820152606401610a35565b6002600e5560005b82518160ff1610156118d0576000838260ff168151811061178757611787612dde565b60200260200101516000015190506000848360ff16815181106117ac576117ac612dde565b60200260200101516020015190506000858460ff16815181106117d1576117d1612dde565b602090810291909101810151604090810151815160a0810183528681528084018681526001600160a01b038a81168386018181526000606080870182815260808089018a8152600d8054865260098e52948c902099518a55975160018a015593516002890180546001600160a01b0319169190971617909555935160038701559351600490950194909455915485518a815296870189905294860191909152840182905290935090917faf0358e6610affb68df2bc72a3c7cba9f34af8963e36ee890142b81bf3c8ba69910160405180910390a2600d80549060006118b583612d63565b919050555050505080806118c890612d7e565b915050611764565b50506001600e5550565b6000818152600a60205260409020546060906119385760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e20686173206e6f74206265656e20736f6c642079657400000000006044820152606401610a35565b6000828152600a602052604090205460089061195390612333565b61195c84612333565b60405160200161196e93929190612b56565b6040516020818303038152906040529050919050565b60006127106119b37f00000000000000000000000000000000000000000000000000000000000000fa84612cc6565b6109a99190612cb2565b6002600e541415611a105760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c0000000000000000000000000000000000006044820152606401610a35565b6002600e8190556040805160a08101825286815260208082018781526001600160a01b03878116848601818152600060608088018281526080808a018d8152600d8054865260098b52948c90209a518b55975160018b015593519a890180546001600160a01b0319169b9096169a909a17909455975160038701559251600490950194909455945484518a81529283018990529382019290925292830184905290917faf0358e6610affb68df2bc72a3c7cba9f34af8963e36ee890142b81bf3c8ba69910160405180910390a2600d8054906000611aed83612d63565b90915550506001600e5550505050565b6004546001600160a01b0316331480611b2057506006546001600160a01b031633145b611b6c5760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610a35565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b60606008604051602001611ba29190612bb8565b604051602081830303815290604052905090565b6004546001600160a01b03163314611c105760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e00000000000000006044820152606401610a35565b6001600160a01b038116611c665760405162461bcd60e51b815260206004820152601f60248201527f4e657874206f776e657220697320746865207a65726f20616464726573732e006044820152606401610a35565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600a6020526040812054611ce35760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e20686173206e6f74206265656e20736f6c642079657400000000006044820152606401610a35565b506000908152600a60209081526040808320548352600990915290206004015490565b600081815260026020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d3b82610d3e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152602081905260408120546001600160a01b0316611dfe5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610a35565b6000611e0983610d3e565b9050806001600160a01b0316846001600160a01b03161480611e445750836001600160a01b0316611e39846109af565b6001600160a01b0316145b80611e7457506001600160a01b0380821660009081526003602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611e8f82610d3e565b6001600160a01b031614611f0b5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610a35565b6001600160a01b038216611f865760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a35565b611f91600082611d06565b6001600160a01b03831660009081526001602081905260408220805491929091611fbc908490612ce5565b90915550506001600160a01b03821660009081526001602081905260408220805491929091611fec908490612c9a565b909155505060008181526020819052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b8047101561209d5760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742062616c616e636520666f722073656e640000006044820152606401610a35565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146120ea576040519150601f19603f3d011682016040523d82523d6000602084013e6120ef565b606091505b5050905080610ba55760405162461bcd60e51b815260206004820152603160248201527f556e61626c6520746f2073656e642076616c75653a20726563697069656e742060448201527f6d617920686176652072657665727465640000000000000000000000000000006064820152608401610a35565b612171848484611e7c565b61217d84848484612465565b6114525760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a35565b6001600160a01b0382166122455760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a35565b6000818152602081905260409020546001600160a01b0316156122aa5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a35565b6001600160a01b038216600090815260016020819052604082208054919290916122d5908490612c9a565b909155505060008181526020819052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60608161237357505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561239d578061238781612d63565b91506123969050600a83612cb2565b9150612377565b60008167ffffffffffffffff8111156123b8576123b8612df4565b6040519080825280601f01601f1916602001820160405280156123e2576020820181803683370190505b5090505b8415611e74576123f7600183612ce5565b9150612404600a86612d9e565b61240f906030612c9a565b60f81b81838151811061242457612424612dde565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061245e600a86612cb2565b94506123e6565b6000833b156125fe576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a02906124b9903390899088908890600401612bf1565b602060405180830381600087803b1580156124d357600080fd5b505af1925050508015612503575060408051601f3d908101601f19168201909252612500918101906129ad565b60015b6125b3573d808015612531576040519150601f19603f3d011682016040523d82523d6000602084013e612536565b606091505b5080516125ab5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a35565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611e74565b506001949350505050565b82805461261590612d28565b90600052602060002090601f016020900481019282612637576000855561267d565b82601f1061265057805160ff191683800117855561267d565b8280016001018555821561267d579182015b8281111561267d578251825591602001919060010190612662565b5061268992915061268d565b5090565b5b80821115612689576000815560010161268e565b600067ffffffffffffffff8311156126bc576126bc612df4565b6126cf6020601f19601f86011601612c69565b90508281528383830111156126e357600080fd5b828260208301376000602084830101529392505050565b803561270581612e0a565b919050565b60006020828403121561271c57600080fd5b813561272781612e0a565b9392505050565b60006020828403121561274057600080fd5b815161272781612e0a565b6000806040838503121561275e57600080fd5b823561276981612e0a565b9150602083013561277981612e0a565b809150509250929050565b60008060006060848603121561279957600080fd5b83356127a481612e0a565b925060208401356127b481612e0a565b929592945050506040919091013590565b600080600080608085870312156127db57600080fd5b84356127e681612e0a565b935060208501356127f681612e0a565b925060408501359150606085013567ffffffffffffffff81111561281957600080fd5b8501601f8101871361282a57600080fd5b612839878235602084016126a2565b91505092959194509250565b6000806040838503121561285857600080fd5b823561286381612e0a565b91506020830135801515811461277957600080fd5b6000806040838503121561288b57600080fd5b823561289681612e0a565b946020939093013593505050565b60008060408084860312156128b857600080fd5b833567ffffffffffffffff808211156128d057600080fd5b818601915086601f8301126128e457600080fd5b81356020828211156128f8576128f8612df4565b612906818360051b01612c69565b82815281810193508482016060808502870184018c101561292657600080fd5b60009650865b858110156129705781838e031215612942578788fd5b61294a612c40565b833581528584013586820152898401358a8201528752958401959181019160010161292c565b505050809750506129828189016126fa565b955050505050509250929050565b6000602082840312156129a257600080fd5b813561272781612e22565b6000602082840312156129bf57600080fd5b815161272781612e22565b6000602082840312156129dc57600080fd5b813567ffffffffffffffff8111156129f357600080fd5b8201601f81018413612a0457600080fd5b611e74848235602084016126a2565b600060208284031215612a2557600080fd5b5035919050565b60008060408385031215612a3f57600080fd5b82359150602083013561277981612e0a565b60008060008060808587031215612a6757600080fd5b84359350602085013592506040850135612a8081612e0a565b9396929550929360600135925050565b60008151808452612aa8816020860160208601612cfc565b601f01601f19169290920160200192915050565b8054600090600181811c9080831680612ad657607f831692505b6020808410821415612af857634e487b7160e01b600052602260045260246000fd5b818015612b0c5760018114612b1d57612b4a565b60ff19861689528489019650612b4a565b60008881526020902060005b86811015612b425781548b820152908501908301612b29565b505084890196505b50505050505092915050565b6000612b628286612abc565b8451612b72818360208901612cfc565b7f2f0000000000000000000000000000000000000000000000000000000000000091019081528351612bab816001840160208801612cfc565b0160010195945050505050565b6000612bc48284612abc565b7f6d6574616461746100000000000000000000000000000000000000000000000081526008019392505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612c236080830184612a90565b9695505050505050565b6020815260006127276020830184612a90565b6040516060810167ffffffffffffffff81118282101715612c6357612c63612df4565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715612c9257612c92612df4565b604052919050565b60008219821115612cad57612cad612db2565b500190565b600082612cc157612cc1612dc8565b500490565b6000816000190483118215151615612ce057612ce0612db2565b500290565b600082821015612cf757612cf7612db2565b500390565b60005b83811015612d17578181015183820152602001612cff565b838111156114525750506000910152565b600181811c90821680612d3c57607f821691505b60208210811415612d5d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612d7757612d77612db2565b5060010190565b600060ff821660ff811415612d9557612d95612db2565b60010192915050565b600082612dad57612dad612dc8565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612e1f57600080fd5b50565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114612e1f57600080fdfea26469706673582212206fba883d1cab0cdd74d51f8a0af43c1bcc16d3841fa60781ef19fa254758872464736f6c63430008060033
Verified Source Code Partial Match
Compiler: v0.8.6+commit.11564f7e
EVM: berlin
Optimization: Yes (2000 runs)
SingletonEditions.sol 866 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
interface IERC721 {
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId)
external
view
returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Events {
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
event Approval(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
}
interface IERC721Metadata {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return interfaceId == type(IERC165).interfaceId;
}
}
/**
* Based on: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol
*/
contract ERC721 is ERC165, IERC721, IERC721Events {
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner)
public
view
virtual
override
returns (uint256)
{
require(
owner != address(0),
"ERC721: balance query for the zero address"
);
return _balances[owner];
}
function ownerOf(uint256 tokenId)
public
view
virtual
override
returns (address)
{
address owner = _owners[tokenId];
require(
owner != address(0),
"ERC721: owner query for nonexistent token"
);
return owner;
}
function tokenURI(uint256 tokenId)
public
view
virtual
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory baseURI = _baseURI();
return
bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, tokenId))
: "";
}
/**
* @dev Base URI for computing {tokenURI}. Empty by default, can be overriden
* in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
msg.sender == owner || isApprovedForAll(owner, msg.sender),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
require(
_exists(tokenId),
"ERC721: approved query for nonexistent token"
);
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
require(operator != msg.sender, "ERC721: approve to caller");
_operatorApprovals[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(
_isApprovedOrOwner(msg.sender, tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(
_isApprovedOrOwner(msg.sender, tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
virtual
returns (bool)
{
require(
_exists(tokenId),
"ERC721: operator query for nonexistent token"
);
address owner = ERC721.ownerOf(tokenId);
return (spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender));
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
ERC721.ownerOf(tokenId) == from,
"ERC721: transfer of token that is not own"
);
require(to != address(0), "ERC721: transfer to the zero address");
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (isContract(to)) {
try
IERC721Receiver(to).onERC721Received(
msg.sender,
from,
tokenId,
_data
)
returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert(
"ERC721: transfer to non ERC721Receiver implementer"
);
} else {
// solhint-disable-next-line no-inline-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/7f6a1666fac8ecff5dd467d0938069bc221ea9e0/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
}
interface ITreasuryConfig {
function treasury() external returns (address payable);
function distributionModel() external returns (address);
}
interface IMirrorTreasury {
function transferFunds(address payable to, uint256 value) external;
function transferERC20(
address token,
address to,
uint256 value
) external;
function contributeWithTributary(address tributary) external payable;
function contribute(uint256 amount) external payable;
}
contract Ownable {
address public owner;
address private nextOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
// modifiers
modifier onlyOwner() {
require(isOwner(), "caller is not the owner.");
_;
}
modifier onlyNextOwner() {
require(isNextOwner(), "current owner must set caller as next owner.");
_;
}
/**
* @dev Initialize contract by setting transaction submitter as initial owner.
*/
constructor(address owner_) {
owner = owner_;
emit OwnershipTransferred(address(0), owner);
}
/**
* @dev Initiate ownership transfer by setting nextOwner.
*/
function transferOwnership(address nextOwner_) external onlyOwner {
require(nextOwner_ != address(0), "Next owner is the zero address.");
nextOwner = nextOwner_;
}
/**
* @dev Cancel ownership transfer by deleting nextOwner.
*/
function cancelOwnershipTransfer() external onlyOwner {
delete nextOwner;
}
/**
* @dev Accepts ownership transfer by setting owner.
*/
function acceptOwnership() external onlyNextOwner {
delete nextOwner;
owner = msg.sender;
emit OwnershipTransferred(owner, msg.sender);
}
/**
* @dev Renounce ownership by setting owner to zero address.
*/
function renounceOwnership() external onlyOwner {
owner = address(0);
emit OwnershipTransferred(owner, address(0));
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == owner;
}
/**
* @dev Returns true if the caller is the next owner.
*/
function isNextOwner() public view returns (bool) {
return msg.sender == nextOwner;
}
}
interface IGovernable {
function changeGovernor(address governor_) external;
function isGovernor() external view returns (bool);
function governor() external view returns (address);
}
contract Governable is Ownable, IGovernable {
// ============ Mutable Storage ============
// Mirror governance contract.
address public override governor;
// ============ Modifiers ============
modifier onlyGovernance() {
require(isOwner() || isGovernor(), "caller is not governance");
_;
}
modifier onlyGovernor() {
require(isGovernor(), "caller is not governor");
_;
}
// ============ Constructor ============
constructor(address owner_) Ownable(owner_) {}
// ============ Administration ============
function changeGovernor(address governor_) public override onlyGovernance {
governor = governor_;
}
// ============ Utility Functions ============
function isGovernor() public view override returns (bool) {
return msg.sender == governor;
}
}
/**
* @title SingletonEditions
* @author MirrorXYZ
*/
contract SingletonEditions is ERC721, Governable {
// ============ Constants ============
string public constant name = "Mirror Editions V3";
string public constant symbol = "EDITIONS_V3";
uint256 internal constant REENTRANCY_NOT_ENTERED = 1;
uint256 internal constant REENTRANCY_ENTERED = 2;
// ============ Immutable Storage ============
address public immutable treasuryConfig;
uint256 public immutable feePercent = 250;
// ============ Structs ============
struct Edition {
// The maximum number of tokens that can be sold.
uint256 quantity;
// The price at which each token will be sold, in ETH.
uint256 price;
// The account that will receive sales revenue.
address payable fundingRecipient;
// The number of tokens sold so far.
uint256 numSold;
// The content hash of the image being presented.
bytes32 contentHash;
}
// A subset of Edition, for efficient production of multiple editions.
struct EditionTier {
// The maximum number of tokens that can be sold.
uint256 quantity;
// The price at which each token will be sold, in ETH.
uint256 price;
bytes32 contentHash;
}
mapping(address => uint256) public fundingBalance;
// ============ Mutable Storage ============
string internal baseURI;
// Mapping of edition id to descriptive data.
mapping(uint256 => Edition) public editions;
// Mapping of token id to edition id.
mapping(uint256 => uint256) public tokenToEdition;
// The amount of funds that have already been withdrawn for a given edition.
mapping(uint256 => uint256) public withdrawnForEdition;
// `nextTokenId` increments with each token purchased, globally across all editions.
uint256 private nextTokenId;
// Editions start at 1, in order that unsold tokens don't map to the first edition.
uint256 private nextEditionId = 1;
// Reentrancy
uint256 internal reentrancyStatus;
// ============ Events ============
event EditionCreated(
uint256 quantity,
uint256 price,
address fundingRecipient,
uint256 indexed editionId,
bytes32 contentHash
);
event EditionPurchased(
uint256 indexed editionId,
uint256 indexed tokenId,
// `numSold` at time of purchase represents the "serial number" of the NFT.
uint256 numSold,
uint256 amountPaid,
// The account that paid for and received the NFT.
address indexed buyer
);
event FundsWithdrawn(
address fundingRecipient,
uint256 amountWithdrawn,
uint256 feeAmount
);
// ============ Modifiers ============
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(reentrancyStatus != REENTRANCY_ENTERED, "Reentrant call");
// Any calls to nonReentrant after this point will fail
reentrancyStatus = REENTRANCY_ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
reentrancyStatus = REENTRANCY_NOT_ENTERED;
}
// ============ Constructor ============
constructor(
string memory baseURI_,
address owner_,
address treasuryConfig_
) Governable(owner_) {
baseURI = baseURI_;
owner = owner_;
treasuryConfig = treasuryConfig_;
}
// ============ Edition Methods ============
function createEditionTiers(
EditionTier[] memory tiers,
address payable fundingRecipient
) external nonReentrant {
// Execute a loop that creates editions.
for (uint8 i = 0; i < tiers.length; i++) {
uint256 quantity = tiers[i].quantity;
uint256 price = tiers[i].price;
bytes32 contentHash_ = tiers[i].contentHash;
editions[nextEditionId] = Edition({
quantity: quantity,
price: price,
fundingRecipient: fundingRecipient,
numSold: 0,
contentHash: contentHash_
});
emit EditionCreated(
quantity,
price,
fundingRecipient,
nextEditionId,
contentHash_
);
nextEditionId++;
}
}
function createEdition(
// The number of tokens that can be minted and sold.
uint256 quantity,
// The price to purchase a token.
uint256 price,
// The account that should receive the revenue.
address payable fundingRecipient,
// Content hash is emitted in the event, for UI convenience.
bytes32 contentHash_
) external nonReentrant {
editions[nextEditionId] = Edition({
quantity: quantity,
price: price,
fundingRecipient: fundingRecipient,
numSold: 0,
contentHash: contentHash_
});
emit EditionCreated(
quantity,
price,
fundingRecipient,
nextEditionId,
contentHash_
);
nextEditionId++;
}
function buyEdition(uint256 editionId) external payable nonReentrant {
// Check that the edition exists. Note: this is redundant
// with the next check, but it is useful for clearer error messaging.
require(editions[editionId].quantity > 0, "Edition does not exist");
// Check that there are still tokens available to purchase.
require(
editions[editionId].numSold < editions[editionId].quantity,
"This edition is already sold out."
);
// Check that the sender is paying the correct amount.
require(
msg.value >= editions[editionId].price,
"Must send enough to purchase the edition."
);
// Increment the number of tokens sold for this edition.
editions[editionId].numSold++;
fundingBalance[editions[editionId].fundingRecipient] += msg.value;
// Mint a new token for the sender, using the `nextTokenId`.
_mint(msg.sender, nextTokenId);
// Store the mapping of token id to the edition being purchased.
tokenToEdition[nextTokenId] = editionId;
emit EditionPurchased(
editionId,
nextTokenId,
editions[editionId].numSold,
msg.value,
msg.sender
);
nextTokenId++;
}
// ============ Operational Methods ============
function withdrawFunds(address payable fundingRecipient)
external
nonReentrant
{
uint256 balance = fundingBalance[fundingRecipient];
fundingBalance[fundingRecipient] = 0;
// Send the amount that was remaining for the edition, to the funding recipient.
uint256 fee = computeFee(balance);
balance -= fee;
// Send fee to the treasury.
IMirrorTreasury(ITreasuryConfig(treasuryConfig).treasury())
.contributeWithTributary{value: fee}(fundingRecipient);
// Send the remainder to the funding recipient.
_sendFunds(fundingRecipient, balance);
emit FundsWithdrawn(fundingRecipient, balance, fee);
}
function computeFee(uint256 _amount) public pure returns (uint256) {
return (_amount * feePercent) / 10000;
}
// ============ Admin Methods ============
function changeBaseURI(string memory baseURI_) public onlyGovernance {
baseURI = baseURI_;
}
// ============ NFT Methods ============
// Returns e.g. https://mirror-api.com/editions/[editionId]/[tokenId]
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
// If the token does not map to an edition, it'll be 0.
require(tokenToEdition[tokenId] > 0, "Token has not been sold yet");
// Concatenate the components, baseURI, editionId and tokenId, to create URI.
return
string(
abi.encodePacked(
baseURI,
_toString(tokenToEdition[tokenId]),
"/",
_toString(tokenId)
)
);
}
// The hash of the given content for the NFT. Can be used
// for IPFS storage, verifying authenticity, etc.
function contentHash(uint256 tokenId) public view returns (bytes32) {
// If the token does not map to an edition, it'll be 0.
require(tokenToEdition[tokenId] > 0, "Token has not been sold yet");
// Concatenate the components, baseURI, editionId and tokenId, to create URI.
return editions[tokenToEdition[tokenId]].contentHash;
}
// Returns e.g. https://mirror-api.com/editions/metadata
function contractURI() public view returns (string memory) {
// Concatenate the components, baseURI, editionId and tokenId, to create URI.
return string(abi.encodePacked(baseURI, "metadata"));
}
function getRoyaltyRecipient(uint256 tokenId)
public
view
returns (address)
{
require(tokenToEdition[tokenId] > 0, "Token has not been minted yet");
return editions[tokenToEdition[tokenId]].fundingRecipient;
}
function setRoyaltyRecipient(
uint256 editionId,
address payable newFundingRecipient
) public {
require(
editions[editionId].fundingRecipient == msg.sender,
"Only current fundingRecipient can modify its value"
);
editions[editionId].fundingRecipient = newFundingRecipient;
}
// ============ Private Methods ============
function _sendFunds(address payable recipient, uint256 amount) private {
require(
address(this).balance >= amount,
"Insufficient balance for send"
);
(bool success, ) = recipient.call{value: amount}("");
require(success, "Unable to send value: recipient may have reverted");
}
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.sol
function _toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
}
Read Contract
balanceOf 0x70a08231 → uint256
computeFee 0xe1bf9c08 → uint256
contentHash 0xf3e0c290 → bytes32
contractURI 0xe8a3d485 → string
editions 0x279c806e → uint256, uint256, address, uint256, bytes32
feePercent 0x7fd6f15c → uint256
fundingBalance 0xaa0ff680 → uint256
getApproved 0x081812fc → address
getRoyaltyRecipient 0xa015a3d8 → address
governor 0x0c340a24 → address
isApprovedForAll 0xe985e9c5 → bool
isGovernor 0xc7af3352 → bool
isNextOwner 0xed459df2 → bool
isOwner 0x8f32d59b → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenToEdition 0x602787ed → uint256
tokenURI 0xc87b56dd → string
treasuryConfig 0xcfd7b0df → address
withdrawnForEdition 0xd3bb0528 → uint256
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
acceptOwnership 0x79ba5097
No parameters
approve 0x095ea7b3
address to
uint256 tokenId
buyEdition 0xbd8616ec
uint256 editionId
cancelOwnershipTransfer 0x23452b9c
No parameters
changeBaseURI 0x39a0c6f9
string baseURI_
changeGovernor 0xe4c0aaf4
address governor_
createEdition 0xe33a5934
uint256 quantity
uint256 price
address fundingRecipient
bytes32 contentHash_
createEditionTiers 0x844b41b2
tuple[] tiers
address fundingRecipient
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setRoyaltyRecipient 0x9e6d134d
uint256 editionId
address newFundingRecipient
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address nextOwner_
withdrawFunds 0x68742da6
address fundingRecipient
Recent Transactions
This address has 1 on-chain transactions, but only 0.6% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →