Address Contract Partially Verified
Address
0x814350140f16A44fE71a7FAd4BFC613f64407320
Balance
0 ETH
Nonce
1
Code Size
17218 bytes
Creator
0x38749187...868D at tx 0x83159dad...ab354b
Indexed Transactions
0
Contract Bytecode
17218 bytes
0x6080604052600436106102715760003560e01c80636b20c4541161014f578063bd85b039116100c1578063e8a3d4851161007a578063e8a3d485146107a0578063e985e9c5146107b5578063ea25e176146107fe578063f242432a14610811578063f2fde38b14610831578063f5298aca1461085157600080fd5b8063bd85b039146106c2578063c0e72740146106ef578063c195a4ef14610704578063d547741f1461074b578063d81d0a151461076b578063e2b9e1861461078b57600080fd5b806391d148541161011357806391d1485414610623578063938e3d7b1461064357806395d89b4114610663578063a217fddf14610678578063a22cb4651461068d578063af17dea6146106ad57600080fd5b80636b20c45414610591578063715018a6146105b15780638456cb59146105c657806385a222ae146105db5780638da5cb5b146105fb57600080fd5b80632eb2c2d6116101e85780634e1273f4116101ac5780634e1273f4146104ca5780634f558e79146104f7578063522f6815146105265780635c975abb146105465780635f0440521461055e578063632c6f1f1461057e57600080fd5b80632eb2c2d6146104225780632f2ff15d1461044257806336568abe146104625780633f4ba83a146104825780634044556d1461049757600080fd5b806313af40351161023a57806313af40351461033d578063156e29f61461035d5780631d0a43941461037d578063248a9ca31461039d578063279c806e146103cd5780632913ebc01461040257600080fd5b8062fdd58e1461027657806301ffc9a7146102a957806302fe5305146102d957806306fdde03146102fb5780630e89341c1461031d575b600080fd5b34801561028257600080fd5b50610296610291366004613431565b610871565b6040519081526020015b60405180910390f35b3480156102b557600080fd5b506102c96102c4366004613aad565b61090a565b60405190151581526020016102a0565b3480156102e557600080fd5b506102f96102f4366004613ae7565b61091b565b005b34801561030757600080fd5b50610310610951565b6040516102a09190613e03565b34801561032957600080fd5b50610310610338366004613948565b6109e3565b34801561034957600080fd5b506102f9610358366004613414565b610adc565b34801561036957600080fd5b506102f96103783660046136d7565b610b0f565b34801561038957600080fd5b506102f9610398366004613986565b610b59565b3480156103a957600080fd5b506102966103b8366004613948565b60009081526020819052604090206001015490565b3480156103d957600080fd5b506103ed6103e8366004613948565b610c0f565b6040516102a099989796959493929190613daa565b34801561040e57600080fd5b506102f961041d366004613a03565b610cec565b34801561042e57600080fd5b506102f961043d366004613496565b610eed565b34801561044e57600080fd5b506102f961045d366004613961565b610f84565b34801561046e57600080fd5b506102f961047d366004613961565b610faa565b34801561048e57600080fd5b506102f9611028565b3480156104a357600080fd5b506102c96104b2366004613948565b6000908152600a602052604090206001015460ff1690565b3480156104d657600080fd5b506104ea6104e536600461370c565b61105c565b6040516102a09190613d69565b34801561050357600080fd5b506102c9610512366004613948565b600090815260056020526040902054151590565b34801561053257600080fd5b506102f9610541366004613431565b611185565b34801561055257600080fd5b5060045460ff166102c9565b34801561056a57600080fd5b506102c96105793660046137de565b6111e5565b6102f961058c366004613885565b611233565b34801561059d57600080fd5b506102f96105ac36600461362d565b6116b3565b3480156105bd57600080fd5b506102f96116f6565b3480156105d257600080fd5b506102f961172a565b3480156105e757600080fd5b506102f96105f6366004613b1b565b61175c565b34801561060757600080fd5b506006546040516001600160a01b0390911681526020016102a0565b34801561062f57600080fd5b506102c961063e366004613961565b6117a9565b34801561064f57600080fd5b506102f961065e366004613ae7565b6117d2565b34801561066f57600080fd5b5061031061180f565b34801561068457600080fd5b50610296600081565b34801561069957600080fd5b506102f96106a83660046136a2565b61181e565b3480156106b957600080fd5b50610310611829565b3480156106ce57600080fd5b506102966106dd366004613948565b60009081526005602052604090205490565b3480156106fb57600080fd5b506103106118b7565b34801561071057600080fd5b5061029661071f366004613961565b6000828152600a602090815260408083206001600160a01b038516845260080190915290205492915050565b34801561075757600080fd5b506102f9610766366004613961565b6118c4565b34801561077757600080fd5b506102f96107863660046135ab565b6118ea565b34801561079757600080fd5b50610310611990565b3480156107ac57600080fd5b5061031061199d565b3480156107c157600080fd5b506102c96107d036600461345d565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6102f961080c366004613b3e565b6119ac565b34801561081d57600080fd5b506102f961082c366004613543565b611a67565b34801561083d57600080fd5b506102f961084c366004613414565b611aac565b34801561085d57600080fd5b506102f961086c3660046136d7565b611b44565b60006001600160a01b0383166108e25760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060009081526001602090815260408083206001600160a01b03949094168352929052205490565b600061091582611b87565b92915050565b6006546001600160a01b031633146109455760405162461bcd60e51b81526004016108d990613fbd565b61094e81611bc7565b50565b60606007805461096090614178565b80601f016020809104026020016040519081016040528092919081815260200182805461098c90614178565b80156109d95780601f106109ae576101008083540402835291602001916109d9565b820191906000526020600020905b8154815290600101906020018083116109bc57829003601f168201915b5050505050905090565b60008181526005602052604081205460609110610a3b5760405162461bcd60e51b81526020600482015260166024820152752aa9249d103737b732bc34b9ba32b73a103a37b5b2b760511b60448201526064016108d9565b6000828152600a602052604090206006018054610a5790614178565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8390614178565b8015610ad05780601f10610aa557610100808354040283529160200191610ad0565b820191906000526020600020905b815481529060010190602001808311610ab357829003601f168201915b50505050509050919050565b6006546001600160a01b03163314610b065760405162461bcd60e51b81526004016108d990613fbd565b61094e81611aac565b6006546001600160a01b03163314610b395760405162461bcd60e51b81526004016108d990613fbd565b610b5483838360405180602001604052806000815250611bda565b505050565b6006546001600160a01b03163314610b835760405162461bcd60e51b81526004016108d990613fbd565b6000600a6000610b9260095490565b815260208082019290925260400160002060018101805460ff19169055898155600281018990556003810188905560058101879055600481018590558551909250610be591600684019190870190613231565b5060078101805461ffff191683151561ff0019161790556009805460010190555050505050505050565b600a602052600090815260409020805460018201546002830154600384015460048501546005860154600687018054969760ff909616969495939492939192610c5790614178565b80601f0160208091040260200160405190810160405280929190818152602001828054610c8390614178565b8015610cd05780601f10610ca557610100808354040283529160200191610cd0565b820191906000526020600020905b815481529060010190602001808311610cb357829003601f168201915b5050506007909301549192505060ff8082169161010090041689565b6006546001600160a01b03163314610d165760405162461bcd60e51b81526004016108d990613fbd565b6000858152600a60205260409020548a14610d3d576000858152600a602052604090208a90555b6000858152600a60205260409020600201548914610d6a576000858152600a602052604090206002018990555b6000858152600a60205260409020600301548814610d97576000858152600a602052604090206003018890555b6000858152600a60205260409020600501548714610dc4576000858152600a602052604090206005018790555b6000858152600a602090815260409091208751610de992600690920191890190613231565b506000858152600a602052604090206001015460ff16151584151514610e27576000858152600a60205260409020600101805460ff19168515151790555b6000858152600a60205260409020600401548314610e54576000858152600a602052604090206004018390555b6000858152600a602052604090206007015460ff16151582151514610e91576000858152600a60205260409020600701805460ff19168315151790555b6000858152600a602052604090206007018054821580156101000261ff001990921691909117909155610ee1576000858152600a60205260409020600701805461ff001916610100831515021790555b50505050505050505050565b6001600160a01b038516331480610f095750610f0985336107d0565b610f705760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016108d9565b610f7d8585858585611bec565b5050505050565b600082815260208190526040902060010154610fa08133611d99565b610b548383611dfd565b6001600160a01b038116331461101a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016108d9565b6110248282611e81565b5050565b6006546001600160a01b031633146110525760405162461bcd60e51b81526004016108d990613fbd565b61105a611ee6565b565b606081518351146110c15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016108d9565b600083516001600160401b038111156110dc576110dc614226565b604051908082528060200260200182016040528015611105578160200160208202803683370190505b50905060005b845181101561117d5761115085828151811061112957611129614210565b602002602001015185838151811061114357611143614210565b6020026020010151610871565b82828151811061116257611162614210565b6020908102919091010152611176816141df565b905061110b565b509392505050565b6006546001600160a01b031633146111af5760405162461bcd60e51b81526004016108d990613fbd565b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610b54573d6000803e3d6000fd5b6040516bffffffffffffffffffffffff193360601b166020820152600090819060340160405160208183030381529060405280519060200120905061122b848483611f79565b949350505050565b60045460ff16156112825760405162461bcd60e51b815260206004820152601960248201527810db185a5b4e8818db185a5b5a5b99c81a5cc81c185d5cd959603a1b60448201526064016108d9565b6000805b8481101561144f576113058a8a838181106112a3576112a3614210565b905060200201358989848181106112bc576112bc614210565b905060200201358888858181106112d5576112d5614210565b905060200201358787868181106112ee576112ee614210565b9050602002810190611300919061407b565b611f8f565b6113515760405162461bcd60e51b815260206004820152601e60248201527f4f6e65206f72206d6f726520636c61696d732061726520696e76616c6964000060448201526064016108d9565b600a600087878481811061136757611367614210565b90506020020135815260200190815260200160002060070160019054906101000a900460ff166113d95760405162461bcd60e51b815260206004820152601b60248201527f436c61696d206d756c7469706c65206e6f7420656e61626c65642e000000000060448201526064016108d9565b61143c611435600a60008989868181106113f5576113f5614210565b905060200201358152602001908152602001600020600201548c8c8581811061142057611420614210565b905060200201356123d490919063ffffffff16565b83906123e7565b5080611447816141df565b915050611286565b50803410156114b35760405162461bcd60e51b815260206004820152602a60248201527f56616c7565206e6f7420656e6f75676820746f20636f76657220616c6c207472604482015269616e73616374696f6e7360b01b60648201526084016108d9565b60005b848110156115d3576114d38a8a838181106112a3576112a3614210565b61151f5760405162461bcd60e51b815260206004820152601e60248201527f4f6e65206f72206d6f726520636c61696d732061726520696e76616c6964000060448201526064016108d9565b6115818a8a8381811061153457611534614210565b90506020020135600a600089898681811061155157611551614210565b602090810292909201358352508181019290925260409081016000908120338252600801909252902054906123e7565b600a600088888581811061159757611597614210565b602090810292909201358352508181019290925260409081016000908120338252600801909252902055806115cb816141df565b9150506114b6565b5061166133868680806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508b8b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250604080516020810190915290815292506123f3915050565b336001600160a01b03167f1f36743b8f77937c5a06ebeca4819ea0c795222f7ecf5a42583ff5d0063adabf86868c8c6040516116a09493929190613d42565b60405180910390a2505050505050505050565b6001600160a01b0383163314806116cf57506116cf83336107d0565b6116eb5760405162461bcd60e51b81526004016108d990613ea2565b610b548383836123ff565b6006546001600160a01b031633146117205760405162461bcd60e51b81526004016108d990613fbd565b61105a600061240a565b6006546001600160a01b031633146117545760405162461bcd60e51b81526004016108d990613fbd565b61105a61245c565b6006546001600160a01b031633146117865760405162461bcd60e51b81526004016108d990613fbd565b6000918252600a6020526040909120600101805460ff1916911515919091179055565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6006546001600160a01b031633146117fc5760405162461bcd60e51b81526004016108d990613fbd565b805161102490600b906020840190613231565b60606008805461096090614178565b6110243383836124d7565b6008805461183690614178565b80601f016020809104026020016040519081016040528092919081815260200182805461186290614178565b80156118af5780601f10611884576101008083540402835291602001916118af565b820191906000526020600020905b81548152906001019060200180831161189257829003601f168201915b505050505081565b600b805461183690614178565b6000828152602081905260409020600101546118e08133611d99565b610b548383611e81565b6006546001600160a01b031633146119145760405162461bcd60e51b81526004016108d990613fbd565b610f7d85858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920182905250604080516020810190915290815292506123f3915050565b6007805461183690614178565b6060600b805461096090614178565b6119b98585858585611f8f565b6119c257600080fd5b6119dd33848760405180602001604052806000815250611bda565b6000838152600a60209081526040808320338452600801909152902054611a0490866123e7565b6000848152600a6020908152604080832033808552600890910183529281902093909355825186815290810188905290917f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026910160405180910390a25050505050565b6001600160a01b038516331480611a835750611a8385336107d0565b611a9f5760405162461bcd60e51b81526004016108d990613ea2565b610f7d85858585856125b8565b6006546001600160a01b03163314611ad65760405162461bcd60e51b81526004016108d990613fbd565b6001600160a01b038116611b3b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108d9565b61094e8161240a565b6001600160a01b038316331480611b605750611b6083336107d0565b611b7c5760405162461bcd60e51b81526004016108d990613ea2565b610b548383836126e8565b60006001600160e01b03198216636cdb3d1360e11b1480611bb857506001600160e01b031982166303a24d0760e21b145b806109155750610915826126f3565b8051611024906003906020840190613231565b611be684848484612728565b50505050565b8151835114611c0d5760405162461bcd60e51b81526004016108d990613ff2565b6001600160a01b038416611c335760405162461bcd60e51b81526004016108d990613eeb565b33611c428187878787876127f1565b60005b8451811015611d2b576000858281518110611c6257611c62614210565b602002602001015190506000858381518110611c8057611c80614210565b60209081029190910181015160008481526001835260408082206001600160a01b038e168352909352919091205490915081811015611cd15760405162461bcd60e51b81526004016108d990613f73565b60008381526001602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611d109084906140e7565b9250508190555050505080611d24906141df565b9050611c45565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611d7b929190613d7c565b60405180910390a4611d918187878787876127ff565b505050505050565b611da382826117a9565b61102457611dbb816001600160a01b0316601461296a565b611dc683602061296a565b604051602001611dd7929190613c2a565b60408051601f198184030181529082905262461bcd60e51b82526108d991600401613e03565b611e0782826117a9565b611024576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611e3d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611e8b82826117a9565b15611024576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60045460ff16611f2f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108d9565b6004805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600082611f868584612b05565b14949350505050565b6000611f9d60045460ff1690565b15611fe65760405162461bcd60e51b815260206004820152601960248201527810db185a5b4e8818db185a5b5a5b99c81a5cc81c185d5cd959603a1b60448201526064016108d9565b6000848152600a60205260409020600301546120445760405162461bcd60e51b815260206004820152601d60248201527f436c61696d3a2045646974696f6e20646f6573206e6f7420657869737400000060448201526064016108d9565b6000848152600a602052604090206001015460ff166120965760405162461bcd60e51b815260206004820152600e60248201526d14d85b19481a5cc81c185d5cd95960921b60448201526064016108d9565b6000848152600a60205260409020600201546120b39087906123d4565b3410156121025760405162461bcd60e51b815260206004820152601c60248201527f436c61696d3a2045746865722076616c756520696e636f72726563740000000060448201526064016108d9565b6000848152600a60209081526040808320338452600801909152902054859061212b90886123e7565b111561218a5760405162461bcd60e51b815260206004820152602860248201527f436c61696d3a204e6f7420616c6c6f77656420746f20636c61696d20676976656044820152671b88185b5bdd5b9d60c21b60648201526084016108d9565b6000848152600a6020908152604080832060048101543385526008909101909252909120546121b990886123e7565b11156122255760405162461bcd60e51b815260206004820152603560248201527f436c61696d3a204e6f7420616c6c6f77656420746f20636c61696d2074686174604482015274081b585b9e48199c9bdb481bdb99481dd85b1b195d605a1b60648201526084016108d9565b6000848152600a60205260409020600501548611156122945760405162461bcd60e51b815260206004820152602560248201527f4d6178207175616e7469747920706572207472616e73616374696f6e20657863604482015264195959195960da1b60648201526084016108d9565b6000848152600a60209081526040808320600301546005909252909120546122bd9088906140e7565b111561230b5760405162461bcd60e51b815260206004820181905260248201527f507572636861736520776f756c6420657863656564206d617820737570706c7960448201526064016108d9565b6000848152600a602052604090206007015460019060ff16156123ca5761237184848080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508a8152600a602052604090205492506111e5915050565b9050806123ca5760405162461bcd60e51b815260206004820152602160248201527f4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f666044820152601760f91b60648201526084016108d9565b9695505050505050565b60006123e082846140ff565b9392505050565b60006123e082846140e7565b611be684848484612ba9565b610b54838383612d04565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60045460ff16156124a25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108d9565b6004805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f5c3390565b816001600160a01b0316836001600160a01b0316141561254b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016108d9565b6001600160a01b03838116600081815260026020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166125de5760405162461bcd60e51b81526004016108d990613eeb565b336125fd8187876125ee88612e95565b6125f788612e95565b876127f1565b60008481526001602090815260408083206001600160a01b038a168452909152902054838110156126405760405162461bcd60e51b81526004016108d990613f73565b60008581526001602090815260408083206001600160a01b038b811685529252808320878503905590881682528120805486929061267f9084906140e7565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46126df828888888888612ee0565b50505050505050565b610b54838383612faa565b60006001600160e01b03198216637965db0b60e01b148061091557506301ffc9a760e01b6001600160e01b0319831614610915565b6001600160a01b03841661274e5760405162461bcd60e51b81526004016108d99061403a565b3361275f816000876125ee88612e95565b60008481526001602090815260408083206001600160a01b0389168452909152812080548592906127919084906140e7565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610f7d81600087878787612ee0565b611d918686868686866130af565b6001600160a01b0384163b15611d915760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906128439089908990889088908890600401613c9f565b602060405180830381600087803b15801561285d57600080fd5b505af192505050801561288d575060408051601f3d908101601f1916820190925261288a91810190613aca565b60015b61293a5761289961423c565b806308c379a014156128d357506128ae614258565b806128b957506128d5565b8060405162461bcd60e51b81526004016108d99190613e03565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016108d9565b6001600160e01b0319811663bc197c8160e01b146126df5760405162461bcd60e51b81526004016108d990613e16565b606060006129798360026140ff565b6129849060026140e7565b6001600160401b0381111561299b5761299b614226565b6040519080825280601f01601f1916602001820160405280156129c5576020820181803683370190505b509050600360fc1b816000815181106129e0576129e0614210565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612a0f57612a0f614210565b60200101906001600160f81b031916908160001a9053506000612a338460026140ff565b612a3e9060016140e7565b90505b6001811115612ab6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612a7257612a72614210565b1a60f81b828281518110612a8857612a88614210565b60200101906001600160f81b031916908160001a90535060049490941c93612aaf81614161565b9050612a41565b5083156123e05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108d9565b600081815b845181101561117d576000858281518110612b2757612b27614210565b60200260200101519050808311612b69576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250612b96565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080612ba1816141df565b915050612b0a565b6001600160a01b038416612bcf5760405162461bcd60e51b81526004016108d99061403a565b8151835114612bf05760405162461bcd60e51b81526004016108d990613ff2565b33612c00816000878787876127f1565b60005b8451811015612c9c57838181518110612c1e57612c1e614210565b602002602001015160016000878481518110612c3c57612c3c614210565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254612c8491906140e7565b90915550819050612c94816141df565b915050612c03565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612ced929190613d7c565b60405180910390a4610f7d816000878787876127ff565b6001600160a01b038316612d2a5760405162461bcd60e51b81526004016108d990613f30565b8051825114612d4b5760405162461bcd60e51b81526004016108d990613ff2565b6000339050612d6e818560008686604051806020016040528060008152506127f1565b60005b8351811015612e36576000848281518110612d8e57612d8e614210565b602002602001015190506000848381518110612dac57612dac614210565b60209081029190910181015160008481526001835260408082206001600160a01b038c168352909352919091205490915081811015612dfd5760405162461bcd60e51b81526004016108d990613e5e565b60009283526001602090815260408085206001600160a01b038b1686529091529092209103905580612e2e816141df565b915050612d71565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612e87929190613d7c565b60405180910390a450505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612ecf57612ecf614210565b602090810291909101015292915050565b6001600160a01b0384163b15611d915760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612f249089908990889088908890600401613cfd565b602060405180830381600087803b158015612f3e57600080fd5b505af1925050508015612f6e575060408051601f3d908101601f19168201909252612f6b91810190613aca565b60015b612f7a5761289961423c565b6001600160e01b0319811663f23a6e6160e01b146126df5760405162461bcd60e51b81526004016108d990613e16565b6001600160a01b038316612fd05760405162461bcd60e51b81526004016108d990613f30565b33612fff81856000612fe187612e95565b612fea87612e95565b604051806020016040528060008152506127f1565b60008381526001602090815260408083206001600160a01b0388168452909152902054828110156130425760405162461bcd60e51b81526004016108d990613e5e565b60008481526001602090815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6130bd8686868686866131c9565b6001600160a01b0385166131445760005b8351811015613142578281815181106130e9576130e9614210565b60200260200101516005600086848151811061310757613107614210565b60200260200101518152602001908152602001600020600082825461312c91906140e7565b9091555061313b9050816141df565b90506130ce565b505b6001600160a01b038416611d915760005b83518110156126df5782818151811061317057613170614210565b60200260200101516005600086848151811061318e5761318e614210565b6020026020010151815260200190815260200160002060008282546131b3919061411e565b909155506131c29050816141df565b9050613155565b60045460ff1615611d915760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201526b1dda1a5b19481c185d5cd95960a21b60648201526084016108d9565b82805461323d90614178565b90600052602060002090601f01602090048101928261325f57600085556132a5565b82601f1061327857805160ff19168380011785556132a5565b828001600101855582156132a5579182015b828111156132a557825182559160200191906001019061328a565b506132b19291506132b5565b5090565b5b808211156132b157600081556001016132b6565b60008083601f8401126132dc57600080fd5b5081356001600160401b038111156132f357600080fd5b6020830191508360208260051b850101111561330e57600080fd5b9250929050565b600082601f83011261332657600080fd5b81356020613333826140c4565b60405161334082826141b3565b8381528281019150858301600585901b8701840188101561336057600080fd5b60005b8581101561337f57813584529284019290840190600101613363565b5090979650505050505050565b8035801515811461339c57600080fd5b919050565b600082601f8301126133b257600080fd5b81356001600160401b038111156133cb576133cb614226565b6040516133e2601f8301601f1916602001826141b3565b8181528460208386010111156133f757600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561342657600080fd5b81356123e0816142e1565b6000806040838503121561344457600080fd5b823561344f816142e1565b946020939093013593505050565b6000806040838503121561347057600080fd5b823561347b816142e1565b9150602083013561348b816142e1565b809150509250929050565b600080600080600060a086880312156134ae57600080fd5b85356134b9816142e1565b945060208601356134c9816142e1565b935060408601356001600160401b03808211156134e557600080fd5b6134f189838a01613315565b9450606088013591508082111561350757600080fd5b61351389838a01613315565b9350608088013591508082111561352957600080fd5b50613536888289016133a1565b9150509295509295909350565b600080600080600060a0868803121561355b57600080fd5b8535613566816142e1565b94506020860135613576816142e1565b9350604086013592506060860135915060808601356001600160401b0381111561359f57600080fd5b613536888289016133a1565b6000806000806000606086880312156135c357600080fd5b85356135ce816142e1565b945060208601356001600160401b03808211156135ea57600080fd5b6135f689838a016132ca565b9096509450604088013591508082111561360f57600080fd5b5061361c888289016132ca565b969995985093965092949392505050565b60008060006060848603121561364257600080fd5b833561364d816142e1565b925060208401356001600160401b038082111561366957600080fd5b61367587838801613315565b9350604086013591508082111561368b57600080fd5b5061369886828701613315565b9150509250925092565b600080604083850312156136b557600080fd5b82356136c0816142e1565b91506136ce6020840161338c565b90509250929050565b6000806000606084860312156136ec57600080fd5b83356136f7816142e1565b95602085013595506040909401359392505050565b6000806040838503121561371f57600080fd5b82356001600160401b038082111561373657600080fd5b818501915085601f83011261374a57600080fd5b81356020613757826140c4565b60405161376482826141b3565b8381528281019150858301600585901b870184018b101561378457600080fd5b600096505b848710156137b057803561379c816142e1565b835260019690960195918301918301613789565b50965050860135925050808211156137c757600080fd5b506137d485828601613315565b9150509250929050565b600080604083850312156137f157600080fd5b82356001600160401b0381111561380757600080fd5b8301601f8101851361381857600080fd5b80356020613825826140c4565b60405161383282826141b3565b8381528281019150848301600585901b860184018a101561385257600080fd5b600095505b84861015613875578035835260019590950194918301918301613857565b5098969091013596505050505050565b6000806000806000806000806080898b0312156138a157600080fd5b88356001600160401b03808211156138b857600080fd5b6138c48c838d016132ca565b909a50985060208b01359150808211156138dd57600080fd5b6138e98c838d016132ca565b909850965060408b013591508082111561390257600080fd5b61390e8c838d016132ca565b909650945060608b013591508082111561392757600080fd5b506139348b828c016132ca565b999c989b5096995094979396929594505050565b60006020828403121561395a57600080fd5b5035919050565b6000806040838503121561397457600080fd5b82359150602083013561348b816142e1565b600080600080600080600060e0888a0312156139a157600080fd5b8735965060208801359550604088013594506060880135935060808801356001600160401b038111156139d357600080fd5b6139df8a828b016133a1565b93505060a088013591506139f560c0890161338c565b905092959891949750929550565b6000806000806000806000806000806101408b8d031215613a2357600080fd5b8a35995060208b0135985060408b0135975060608b0135965060808b01356001600160401b03811115613a5557600080fd5b613a618d828e016133a1565b96505060a08b01359450613a7760c08c0161338c565b935060e08b01359250613a8d6101008c0161338c565b9150613a9c6101208c0161338c565b90509295989b9194979a5092959850565b600060208284031215613abf57600080fd5b81356123e0816142f6565b600060208284031215613adc57600080fd5b81516123e0816142f6565b600060208284031215613af957600080fd5b81356001600160401b03811115613b0f57600080fd5b61122b848285016133a1565b60008060408385031215613b2e57600080fd5b823591506136ce6020840161338c565b600080600080600060808688031215613b5657600080fd5b85359450602086013593506040860135925060608601356001600160401b03811115613b8157600080fd5b61361c888289016132ca565b81835260006001600160fb1b03831115613ba657600080fd5b8260051b8083602087013760009401602001938452509192915050565b600081518084526020808501945080840160005b83811015613bf357815187529582019590820190600101613bd7565b509495945050505050565b60008151808452613c16816020860160208601614135565b601f01601f19169290920160200192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613c62816017850160208801614135565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613c93816028840160208801614135565b01602801949350505050565b6001600160a01b0386811682528516602082015260a060408201819052600090613ccb90830186613bc3565b8281036060840152613cdd8186613bc3565b90508281036080840152613cf18185613bfe565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613d3790830184613bfe565b979650505050505050565b604081526000613d56604083018688613b8d565b8281036020840152613d37818587613b8d565b6020815260006123e06020830184613bc3565b604081526000613d8f6040830185613bc3565b8281036020840152613da18185613bc3565b95945050505050565b60006101208b83528a151560208401528960408401528860608401528760808401528660a08401528060c0840152613de481840187613bfe565b94151560e0840152505090151561010090910152979650505050505050565b6020815260006123e06020830184613bfe565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b6000808335601e1984360301811261409257600080fd5b8301803591506001600160401b038211156140ac57600080fd5b6020019150600581901b360382131561330e57600080fd5b60006001600160401b038211156140dd576140dd614226565b5060051b60200190565b600082198211156140fa576140fa6141fa565b500190565b6000816000190483118215151615614119576141196141fa565b500290565b600082821015614130576141306141fa565b500390565b60005b83811015614150578181015183820152602001614138565b83811115611be65750506000910152565b600081614170576141706141fa565b506000190190565b600181811c9082168061418c57607f821691505b602082108114156141ad57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b03811182821017156141d8576141d8614226565b6040525050565b60006000198214156141f3576141f36141fa565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156142555760046000803e5060005160e01c5b90565b600060443d10156142665790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561429557505050505090565b82850191508151818111156142ad5750505050505090565b843d87010160208285010111156142c75750505050505090565b6142d6602082860101876141b3565b509095945050505050565b6001600160a01b038116811461094e57600080fd5b6001600160e01b03198116811461094e57600080fdfea2646970667358221220bd7d8ebe47d7580f12079dac325d04cf03adeace8a00a244066c7776cd11ab0e64736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: Yes (200 runs)
KalebsEditions.sol 2350 lines
// File: @openzeppelin/contracts/access/IAccessControl.sol
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
// File: @openzeppelin/contracts/utils/Counters.sol
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
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);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
return computedHash;
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/security/Pausable.sol
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/access/AccessControl.sol
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
// File: @openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
@dev Handles the receipt of a single ERC1155 token type. This function is
called at the end of a `safeTransferFrom` after the balance has been updated.
To accept the transfer, this must return
`bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
(i.e. 0xf23a6e61, or its own function selector).
@param operator The address which initiated the transfer (i.e. msg.sender)
@param from The address which previously owned the token
@param id The ID of the token being transferred
@param value The amount of tokens being transferred
@param data Additional data with no specified format
@return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
@dev Handles the receipt of a multiple ERC1155 token types. This function
is called at the end of a `safeBatchTransferFrom` after the balances have
been updated. To accept the transfer(s), this must return
`bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
(i.e. 0xbc197c81, or its own function selector).
@param operator The address which initiated the batch transfer (i.e. msg.sender)
@param from The address which previously owned the token
@param ids An array containing ids of each token being transferred (order and length must match values array)
@param values An array containing amounts of each token being transferred (order and length must match ids array)
@param data Additional data with no specified format
@return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/token/ERC1155/IERC1155.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
// File: @openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}
// File: @openzeppelin/contracts/token/ERC1155/ERC1155.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
retur...
// [truncated — 77522 bytes total]
Read Contract
DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
_contractURI 0xc0e72740 → string
balanceOf 0x00fdd58e → uint256
balanceOfBatch 0x4e1273f4 → uint256[]
contractURI 0xe8a3d485 → string
editions 0x279c806e → bytes32, bool, uint256, uint256, uint256, uint256, string, bool, bool
exists 0x4f558e79 → bool
getClaimedMps 0xc195a4ef → uint256
getRoleAdmin 0x248a9ca3 → bytes32
hasRole 0x91d14854 → bool
isApprovedForAll 0xe985e9c5 → bool
isSaleOpen 0x4044556d → bool
name 0x06fdde03 → string
name_ 0xe2b9e186 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
symbol_ 0xaf17dea6 → string
totalSupply 0xbd85b039 → uint256
uri 0x0e89341c → string
verifyMerkleProof 0x5f044052 → bool
Write Contract 23 functions
These functions modify contract state and require a wallet transaction to execute.
addEdition 0x1d0a4394
bytes32 _merkleRoot
uint256 _mintPrice
uint256 _maxSupply
uint256 _maxMintPerTxn
string _metadataLink
uint256 _maxPerWallet
bool _merkleProtect
burn 0xf5298aca
address account
uint256 id
uint256 value
burnBatch 0x6b20c454
address account
uint256[] ids
uint256[] values
claim 0xea25e176
uint256 numPieces
uint256 amount
uint256 editionIndex
bytes32[] merkleProof
claimMultiple 0x632c6f1f
uint256[] numPieces
uint256[] amounts
uint256[] editionIndexes
bytes32[][] merkleProofs
editEdition 0x2913ebc0
bytes32 _merkleRoot
uint256 _mintPrice
uint256 _maxSupply
uint256 _maxMintPerTxn
string _metadataLink
uint256 _editionIndex
bool _saleIsOpen
uint256 _maxPerWallet
bool _merkleProtect
bool _claimMultiple
grantRole 0x2f2ff15d
bytes32 role
address account
mint 0x156e29f6
address to
uint256 editionIndex
uint256 numPieces
mintBatch 0xd81d0a15
address to
uint256[] editionIndexes
uint256[] numPieces
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
renounceRole 0x36568abe
bytes32 role
address account
revokeRole 0xd547741f
bytes32 role
address account
safeBatchTransferFrom 0x2eb2c2d6
address from
address to
uint256[] ids
uint256[] amounts
bytes data
safeTransferFrom 0xf242432a
address from
address to
uint256 id
uint256 amount
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setContractURI 0x938e3d7b
string newURI
setOwner 0x13af4035
address _addr
setSaleState 0x85a222ae
uint256 editionIndex
bool state
setURI 0x02fe5305
string baseURI
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
withdrawEther 0x522f6815
address _to
uint256 _amount
Recent Transactions
No transactions found for this address