Address Contract Verified
Address
0x4539F7898f0d78B0EAF96cCE86Df78f178AB904F
Balance
0 ETH
Nonce
1
Code Size
18068 bytes
Creator
0x206795e0...BA16 at tx 0x772b696a...d9585a
Indexed Transactions
0
Contract Bytecode
18068 bytes
0x6080604052600436106102465760003560e01c806380b1733511610139578063a4513e92116100b6578063c99b991c1161007a578063c99b991c14610842578063ca43b3051461085e578063e8a3d48514610889578063e985e9c5146108b4578063f2fde38b146108f1578063ff5a6e921461091a57610246565b8063a4513e921461075d578063b88d4fde14610786578063c002d23d146107af578063c05f486e146107da578063c87b56dd1461080557610246565b806395d89b41116100fd57806395d89b41146106885780639858cf19146106b357806399ec6765146106de578063a0e389de14610709578063a22cb4651461073457610246565b806380b17335146105b35780638b907be2146105de5780638da5cb5b14610609578063922079c514610634578063933c3aa71461065d57610246565b80632bad322c116101c757806355f804b31161018b57806355f804b3146104e25780636352211e1461050b57806370a0823114610548578063715018a6146105855780637c69e2071461059c57610246565b80632bad322c1461041357806338e21cce1461043c5780633ccfd60b1461047957806342842e0e1461049057806354fee61f146104b957610246565b806318160ddd1161020e57806318160ddd146103425780631d6f6a2e1461036d5780631ec927781461039657806320568c99146103bf57806323b872dd146103ea57610246565b8063012b393f1461024b57806301ffc9a71461027457806306fdde03146102b1578063081812fc146102dc578063095ea7b314610319575b600080fd5b34801561025757600080fd5b50610272600480360381019061026d9190613185565b610936565b005b34801561028057600080fd5b5061029b6004803603810190610296919061320a565b610a86565b6040516102a89190613252565b60405180910390f35b3480156102bd57600080fd5b506102c6610b18565b6040516102d39190613306565b60405180910390f35b3480156102e857600080fd5b5061030360048036038101906102fe919061335e565b610ba6565b604051610310919061339a565b60405180910390f35b34801561032557600080fd5b50610340600480360381019061033b91906133b5565b610c22565b005b34801561034e57600080fd5b50610357610e78565b6040516103649190613404565b60405180910390f35b34801561037957600080fd5b50610394600480360381019061038f9190613185565b610e81565b005b3480156103a257600080fd5b506103bd60048036038101906103b89190613185565b610fd1565b005b3480156103cb57600080fd5b506103d4611122565b6040516103e19190613404565b60405180910390f35b3480156103f657600080fd5b50610411600480360381019061040c919061341f565b611128565b005b34801561041f57600080fd5b5061043a60048036038101906104359190613185565b611138565b005b34801561044857600080fd5b50610463600480360381019061045e9190613185565b611288565b6040516104709190613252565b60405180910390f35b34801561048557600080fd5b5061048e6112d7565b005b34801561049c57600080fd5b506104b760048036038101906104b2919061341f565b611452565b005b3480156104c557600080fd5b506104e060048036038101906104db919061335e565b611472565b005b3480156104ee57600080fd5b50610509600480360381019061050491906134d7565b6114f8565b005b34801561051757600080fd5b50610532600480360381019061052d919061335e565b61158a565b60405161053f919061339a565b60405180910390f35b34801561055457600080fd5b5061056f600480360381019061056a9190613185565b6115c7565b60405161057c9190613404565b60405180910390f35b34801561059157600080fd5b5061059a611679565b005b3480156105a857600080fd5b506105b1611701565b005b3480156105bf57600080fd5b506105c86117e9565b6040516105d59190613404565b60405180910390f35b3480156105ea57600080fd5b506105f36117ef565b6040516106009190613404565b60405180910390f35b34801561061557600080fd5b5061061e6117f5565b60405161062b919061339a565b60405180910390f35b34801561064057600080fd5b5061065b60048036038101906106569190613185565b61181f565b005b34801561066957600080fd5b5061067261191d565b60405161067f9190613404565b60405180910390f35b34801561069457600080fd5b5061069d611923565b6040516106aa9190613306565b60405180910390f35b3480156106bf57600080fd5b506106c86119b1565b6040516106d59190613404565b60405180910390f35b3480156106ea57600080fd5b506106f36119b6565b6040516107009190613404565b60405180910390f35b34801561071557600080fd5b5061071e6119bc565b60405161072b9190613404565b60405180910390f35b34801561074057600080fd5b5061075b60048036038101906107569190613550565b6119c2565b005b34801561076957600080fd5b50610784600480360381019061077f91906135e6565b611b24565b005b34801561079257600080fd5b506107ad60048036038101906107a89190613763565b611d62565b005b3480156107bb57600080fd5b506107c4611dd5565b6040516107d19190613404565b60405180910390f35b3480156107e657600080fd5b506107ef611de1565b6040516107fc9190613404565b60405180910390f35b34801561081157600080fd5b5061082c6004803603810190610827919061335e565b611de6565b6040516108399190613306565b60405180910390f35b61085c600480360381019061085791906135e6565b611e1a565b005b34801561086a57600080fd5b506108736120bb565b6040516108809190613404565b60405180910390f35b34801561089557600080fd5b5061089e6120c1565b6040516108ab9190613306565b60405180910390f35b3480156108c057600080fd5b506108db60048036038101906108d691906137e6565b6120e9565b6040516108e89190613252565b60405180910390f35b3480156108fd57600080fd5b5061091860048036038101906109139190613185565b61217d565b005b610934600480360381019061092f91906135e6565b612274565b005b61093e612522565b73ffffffffffffffffffffffffffffffffffffffff1661095c6117f5565b73ffffffffffffffffffffffffffffffffffffffff16146109b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a990613872565b60405180910390fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610a42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a39906138de565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610ae157506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610b115750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60018054610b259061392d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b519061392d565b8015610b9e5780601f10610b7357610100808354040283529160200191610b9e565b820191906000526020600020905b815481529060010190602001808311610b8157829003601f168201915b505050505081565b6000610bb18261252a565b610be7576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610cba576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d9457610d5d6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16336120e9565b610d93576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b816006600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008054905090565b610e89612522565b73ffffffffffffffffffffffffffffffffffffffff16610ea76117f5565b73ffffffffffffffffffffffffffffffffffffffff1614610efd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef490613872565b60405180910390fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f84906138de565b60405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610fd9612522565b73ffffffffffffffffffffffffffffffffffffffff16610ff76117f5565b73ffffffffffffffffffffffffffffffffffffffff161461104d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104490613872565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d5906139aa565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610c8081565b611133838383612537565b505050565b611140612522565b73ffffffffffffffffffffffffffffffffffffffff1661115e6117f5565b73ffffffffffffffffffffffffffffffffffffffff16146111b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ab90613872565b60405180910390fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611244576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123b906138de565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080611000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205416119050919050565b6112df612522565b73ffffffffffffffffffffffffffffffffffffffff166112fd6117f5565b73ffffffffffffffffffffffffffffffffffffffff1614611353576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134a90613872565b60405180910390fd5b60004790506000811161139b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139290613a16565b60405180910390fd5b60006113a56117f5565b73ffffffffffffffffffffffffffffffffffffffff16826040516113c890613a67565b60006040518083038185875af1925050503d8060008114611405576040519150601f19603f3d011682016040523d82523d6000602084013e61140a565b606091505b505090508061144e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144590613ac8565b60405180910390fd5b5050565b61146d83838360405180602001604052806000815250611d62565b505050565b61147a612522565b73ffffffffffffffffffffffffffffffffffffffff166114986117f5565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613872565b60405180910390fd5b80600d8190555050565b611500612522565b73ffffffffffffffffffffffffffffffffffffffff1661151e6117f5565b73ffffffffffffffffffffffffffffffffffffffff1614611574576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156b90613872565b60405180910390fd5b818160039190611585929190613070565b505050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361162e576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b611681612522565b73ffffffffffffffffffffffffffffffffffffffff1661169f6117f5565b73ffffffffffffffffffffffffffffffffffffffff16146116f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ec90613872565b60405180910390fd5b6116ff6000612877565b565b611709612522565b73ffffffffffffffffffffffffffffffffffffffff166117276117f5565b73ffffffffffffffffffffffffffffffffffffffff161461177d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177490613872565b60405180910390fd5b6004600f548181106117c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bb90613b5a565b60405180910390fd5b600f60008154809291906117d790613ba9565b91905055506117e53361293d565b5050565b60105481565b60115481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a690613c3d565b60405180910390fd5b610c806011548181106118f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ee90613b5a565b60405180910390fd5b6011600081548092919061190a90613ba9565b91905055506119188361293d565b505050565b600e5481565b600280546119309061392d565b80601f016020809104026020016040519081016040528092919081815260200182805461195c9061392d565b80156119a95780601f1061197e576101008083540402835291602001916119a9565b820191906000526020600020905b81548152906001019060200180831161198c57829003601f168201915b505050505081565b601981565b61019081565b600d5481565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611a27576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611b189190613252565b60405180910390a35050565b600d544210158015611b37575060008054115b611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ca9565b60405180910390fd5b611b7f33611288565b15611bbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb690613d15565b60405180910390fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168282600033604051602001611bf79190613d7d565b60405160208183030381529060405280519060200120604051602001611c1d9190613e1a565b6040516020818303038152906040528051906020012090508373ffffffffffffffffffffffffffffffffffffffff16611c9a8285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050612aee565b73ffffffffffffffffffffffffffffffffffffffff1614611cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce790613eb2565b60405180910390fd5b6019601054818110611d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2e90613b5a565b60405180910390fd5b60106000815480929190611d4a90613ba9565b9190505550611d583361293d565b5050505050505050565b611d6d848484612537565b60008373ffffffffffffffffffffffffffffffffffffffff163b14611dcf57611d9884848484612b15565b611dce576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b6704064976a8dd000081565b600481565b60606003611df383612c5e565b604051602001611e04929190613fe3565b6040516020818303038152906040529050919050565b600d544210158015611e2d575060008054115b611e6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6390613ca9565b60405180910390fd5b611e7533611288565b15611eb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eac90613d15565b60405180910390fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168282600033604051602001611eed9190613d7d565b60405160208183030381529060405280519060200120604051602001611f139190613e1a565b6040516020818303038152906040528051906020012090508373ffffffffffffffffffffffffffffffffffffffff16611f908285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050612aee565b73ffffffffffffffffffffffffffffffffffffffff1614611fe6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fdd90613eb2565b60405180910390fd5b601054600f5460196004610190611ffd9190614012565b6120079190614012565b6120119190614046565b61201b9190614046565b806000541061205f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612056906140e8565b60405180910390fd5b6704064976a8dd000034146120a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a090614154565b60405180910390fd5b6120b23361293d565b50505050505050565b600f5481565b606060036040516020016120d591906141c0565b604051602081830303815290604052905090565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b612185612522565b73ffffffffffffffffffffffffffffffffffffffff166121a36117f5565b73ffffffffffffffffffffffffffffffffffffffff16146121f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f090613872565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161225f90614254565b60405180910390fd5b61227181612877565b50565b600e54600d546122849190614046565b4210158015612294575060008054115b6122d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ca906142c0565b60405180910390fd5b6122dc33611288565b1561231c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231390613d15565b60405180910390fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682826000336040516020016123549190613d7d565b6040516020818303038152906040528051906020012060405160200161237a9190613e1a565b6040516020818303038152906040528051906020012090508373ffffffffffffffffffffffffffffffffffffffff166123f78285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050612aee565b73ffffffffffffffffffffffffffffffffffffffff161461244d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244490613eb2565b60405180910390fd5b601054600f54601960046101906124649190614012565b61246e9190614012565b6124789190614046565b6124829190614046565b80600054106124c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bd906140e8565b60405180910390fd5b6704064976a8dd00003414612510576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250790614154565b60405180910390fd5b6125193361293d565b50505050505050565b600033905090565b6000805482109050919050565b8273ffffffffffffffffffffffffffffffffffffffff166004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125cf576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612635576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015612678575061267683336120e9565b155b80156126b857503373ffffffffffffffffffffffffffffffffffffffff1661269f82610ba6565b73ffffffffffffffffffffffffffffffffffffffff1614155b156126ef576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600190039190505550600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600190039190505550816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036129a3576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110006001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540117600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600460008054815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600080815480929190600101919050558173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450565b6000806000612afd8585612cb8565b91509150612b0a81612d39565b819250505092915050565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a02338786866040518563ffffffff1660e01b8152600401612b569493929190614335565b6020604051808303816000875af1925050508015612b9257506040513d601f19601f82011682018060405250810190612b8f9190614396565b60015b612c0b573d8060008114612bc2576040519150601f19603f3d011682016040523d82523d6000602084013e612bc7565b606091505b506000815103612c03576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b60606080604051019050806040528082600183039250600a81066030018353600a810490505b8015612ca457600183039250600a81066030018353600a81049050612c84565b508181036020830392508083525050919050565b6000806041835103612cf95760008060006020860151925060408601519150606086015160001a9050612ced87828585612f05565b94509450505050612d32565b6040835103612d29576000806020850151915060408501519050612d1e868383613011565b935093505050612d32565b60006002915091505b9250929050565b60006004811115612d4d57612d4c6143c3565b5b816004811115612d6057612d5f6143c3565b5b0315612f025760016004811115612d7a57612d796143c3565b5b816004811115612d8d57612d8c6143c3565b5b03612dcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dc49061443e565b60405180910390fd5b60026004811115612de157612de06143c3565b5b816004811115612df457612df36143c3565b5b03612e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e2b906144aa565b60405180910390fd5b60036004811115612e4857612e476143c3565b5b816004811115612e5b57612e5a6143c3565b5b03612e9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e929061453c565b60405180910390fd5b600480811115612eae57612ead6143c3565b5b816004811115612ec157612ec06143c3565b5b03612f01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ef8906145ce565b60405180910390fd5b5b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c1115612f40576000600391509150613008565b601b8560ff1614158015612f585750601c8560ff1614155b15612f6a576000600491509150613008565b600060018787878760405160008152602001604052604051612f8f9493929190614619565b6020604051602081039080840390855afa158015612fb1573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612fff57600060019250925050613008565b80600092509250505b94509492505050565b60008060007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60001b841690506000601b60ff8660001c901c6130549190614046565b905061306287828885612f05565b935093505050935093915050565b82805461307c9061392d565b90600052602060002090601f01602090048101928261309e57600085556130e5565b82601f106130b757803560ff19168380011785556130e5565b828001600101855582156130e5579182015b828111156130e45782358255916020019190600101906130c9565b5b5090506130f291906130f6565b5090565b5b8082111561310f5760008160009055506001016130f7565b5090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061315282613127565b9050919050565b61316281613147565b811461316d57600080fd5b50565b60008135905061317f81613159565b92915050565b60006020828403121561319b5761319a61311d565b5b60006131a984828501613170565b91505092915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6131e7816131b2565b81146131f257600080fd5b50565b600081359050613204816131de565b92915050565b6000602082840312156132205761321f61311d565b5b600061322e848285016131f5565b91505092915050565b60008115159050919050565b61324c81613237565b82525050565b60006020820190506132676000830184613243565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156132a757808201518184015260208101905061328c565b838111156132b6576000848401525b50505050565b6000601f19601f8301169050919050565b60006132d88261326d565b6132e28185613278565b93506132f2818560208601613289565b6132fb816132bc565b840191505092915050565b6000602082019050818103600083015261332081846132cd565b905092915050565b6000819050919050565b61333b81613328565b811461334657600080fd5b50565b60008135905061335881613332565b92915050565b6000602082840312156133745761337361311d565b5b600061338284828501613349565b91505092915050565b61339481613147565b82525050565b60006020820190506133af600083018461338b565b92915050565b600080604083850312156133cc576133cb61311d565b5b60006133da85828601613170565b92505060206133eb85828601613349565b9150509250929050565b6133fe81613328565b82525050565b600060208201905061341960008301846133f5565b92915050565b6000806000606084860312156134385761343761311d565b5b600061344686828701613170565b935050602061345786828701613170565b925050604061346886828701613349565b9150509250925092565b600080fd5b600080fd5b600080fd5b60008083601f84011261349757613496613472565b5b8235905067ffffffffffffffff8111156134b4576134b3613477565b5b6020830191508360018202830111156134d0576134cf61347c565b5b9250929050565b600080602083850312156134ee576134ed61311d565b5b600083013567ffffffffffffffff81111561350c5761350b613122565b5b61351885828601613481565b92509250509250929050565b61352d81613237565b811461353857600080fd5b50565b60008135905061354a81613524565b92915050565b600080604083850312156135675761356661311d565b5b600061357585828601613170565b92505060206135868582860161353b565b9150509250929050565b60008083601f8401126135a6576135a5613472565b5b8235905067ffffffffffffffff8111156135c3576135c2613477565b5b6020830191508360018202830111156135df576135de61347c565b5b9250929050565b600080602083850312156135fd576135fc61311d565b5b600083013567ffffffffffffffff81111561361b5761361a613122565b5b61362785828601613590565b92509250509250929050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613670826132bc565b810181811067ffffffffffffffff8211171561368f5761368e613638565b5b80604052505050565b60006136a2613113565b90506136ae8282613667565b919050565b600067ffffffffffffffff8211156136ce576136cd613638565b5b6136d7826132bc565b9050602081019050919050565b82818337600083830152505050565b6000613706613701846136b3565b613698565b90508281526020810184848401111561372257613721613633565b5b61372d8482856136e4565b509392505050565b600082601f83011261374a57613749613472565b5b813561375a8482602086016136f3565b91505092915050565b6000806000806080858703121561377d5761377c61311d565b5b600061378b87828801613170565b945050602061379c87828801613170565b93505060406137ad87828801613349565b925050606085013567ffffffffffffffff8111156137ce576137cd613122565b5b6137da87828801613735565b91505092959194509250565b600080604083850312156137fd576137fc61311d565b5b600061380b85828601613170565b925050602061381c85828601613170565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061385c602083613278565b915061386782613826565b602082019050919050565b6000602082019050818103600083015261388b8161384f565b9050919050565b7f4e6f7468696e6720746f206368616e6765000000000000000000000000000000600082015250565b60006138c8601183613278565b91506138d382613892565b602082019050919050565b600060208201905081810360008301526138f7816138bb565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061394557607f821691505b602082108103613958576139576138fe565b5b50919050565b7f47656e322077617320616c726561647920696e697469616c697a656400000000600082015250565b6000613994601c83613278565b915061399f8261395e565b602082019050919050565b600060208201905081810360008301526139c381613987565b9050919050565b7f49276d2042726f6b652100000000000000000000000000000000000000000000600082015250565b6000613a00600a83613278565b9150613a0b826139ca565b602082019050919050565b60006020820190508181036000830152613a2f816139f3565b9050919050565b600081905092915050565b50565b6000613a51600083613a36565b9150613a5c82613a41565b600082019050919050565b6000613a7282613a44565b9150819050919050565b7f47657420426c616e6b6564210000000000000000000000000000000000000000600082015250565b6000613ab2600c83613278565b9150613abd82613a7c565b602082019050919050565b60006020820190508181036000830152613ae181613aa5565b9050919050565b7f4d696e7420737570706c79207265616368656420666f7220746869732063617460008201527f65676f7279000000000000000000000000000000000000000000000000000000602082015250565b6000613b44602583613278565b9150613b4f82613ae8565b604082019050919050565b60006020820190508181036000830152613b7381613b37565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613bb482613328565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613be657613be5613b7a565b5b600182019050919050565b7f43616c6c6572206d75737420626520426c616e6b2047656e2032000000000000600082015250565b6000613c27601a83613278565b9150613c3282613bf1565b602082019050919050565b60006020820190508181036000830152613c5681613c1a565b9050919050565b7f4d696e7420686173206e6f742073746172746564000000000000000000000000600082015250565b6000613c93601483613278565b9150613c9e82613c5d565b602082019050919050565b60006020820190508181036000830152613cc281613c86565b9050919050565b7f596f752063616e206f6e6c79206d696e74206f6e636500000000000000000000600082015250565b6000613cff601683613278565b9150613d0a82613cc9565b602082019050919050565b60006020820190508181036000830152613d2e81613cf2565b9050919050565b60008160601b9050919050565b6000613d4d82613d35565b9050919050565b6000613d5f82613d42565b9050919050565b613d77613d7282613147565b613d54565b82525050565b6000613d898284613d66565b60148201915081905092915050565b600081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b6000613dd9601c83613d98565b9150613de482613da3565b601c82019050919050565b6000819050919050565b6000819050919050565b613e14613e0f82613def565b613df9565b82525050565b6000613e2582613dcc565b9150613e318284613e03565b60208201915081905092915050565b7f596f752068617665206e6f74206265656e20617070726f76656420666f72207460008201527f686973206d696e74000000000000000000000000000000000000000000000000602082015250565b6000613e9c602883613278565b9150613ea782613e40565b604082019050919050565b60006020820190508181036000830152613ecb81613e8f565b9050919050565b60008190508160005260206000209050919050565b60008154613ef48161392d565b613efe8186613d98565b94506001821660008114613f195760018114613f2a57613f5d565b60ff19831686528186019350613f5d565b613f3385613ed2565b60005b83811015613f5557815481890152600182019150602081019050613f36565b838801955050505b50505092915050565b6000613f718261326d565b613f7b8185613d98565b9350613f8b818560208601613289565b80840191505092915050565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000600082015250565b6000613fcd600583613d98565b9150613fd882613f97565b600582019050919050565b6000613fef8285613ee7565b9150613ffb8284613f66565b915061400682613fc0565b91508190509392505050565b600061401d82613328565b915061402883613328565b92508282101561403b5761403a613b7a565b5b828203905092915050565b600061405182613328565b915061405c83613328565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561409157614090613b7a565b5b828201905092915050565b7f4d696e7420737570706c79207265616368656400000000000000000000000000600082015250565b60006140d2601383613278565b91506140dd8261409c565b602082019050919050565b60006020820190508181036000830152614101816140c5565b9050919050565b7f596f75206d7573742073656e642074686520726967687420616d6f756e740000600082015250565b600061413e601e83613278565b915061414982614108565b602082019050919050565b6000602082019050818103600083015261416d81614131565b9050919050565b7f636f6e74726163742e6a736f6e00000000000000000000000000000000000000600082015250565b60006141aa600d83613d98565b91506141b582614174565b600d82019050919050565b60006141cc8284613ee7565b91506141d78261419d565b915081905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061423e602683613278565b9150614249826141e2565b604082019050919050565b6000602082019050818103600083015261426d81614231565b9050919050565b7f52657365727665204d696e7420686173206e6f74207374617274656400000000600082015250565b60006142aa601c83613278565b91506142b582614274565b602082019050919050565b600060208201905081810360008301526142d98161429d565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000614307826142e0565b61431181856142eb565b9350614321818560208601613289565b61432a816132bc565b840191505092915050565b600060808201905061434a600083018761338b565b614357602083018661338b565b61436460408301856133f5565b818103606083015261437681846142fc565b905095945050505050565b600081519050614390816131de565b92915050565b6000602082840312156143ac576143ab61311d565b5b60006143ba84828501614381565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b6000614428601883613278565b9150614433826143f2565b602082019050919050565b600060208201905081810360008301526144578161441b565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b6000614494601f83613278565b915061449f8261445e565b602082019050919050565b600060208201905081810360008301526144c381614487565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b6000614526602283613278565b9150614531826144ca565b604082019050919050565b6000602082019050818103600083015261455581614519565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b60006145b8602283613278565b91506145c38261455c565b604082019050919050565b600060208201905081810360008301526145e7816145ab565b9050919050565b6145f781613def565b82525050565b600060ff82169050919050565b614613816145fd565b82525050565b600060808201905061462e60008301876145ee565b61463b602083018661460a565b61464860408301856145ee565b61465560608301846145ee565b9594505050505056fea2646970667358221220d9d850b96d8611952d5a350ef8388f77f8e5e47bf21dbc55b0694019f0635ced64736f6c634300080e0033
Verified Source Code Full Match
Compiler: v0.8.14+commit.80d49f37
EVM: london
Optimization: No
Blank.sol 77 lines
// SPDX-License-Identifier: MIT
// @author mouradif.eth
pragma solidity 0.8.14;
import "../interfaces/IBlank.sol";
import "./BlankGenesis.sol";
contract Blank is IBlank, BlankGenesis {
// ################################################################ //
// . //
// .::=+*##%%%%*. //
// -=*%@@@@@@@@@@@@= //
// :=*%@@@@@@@%##%@@@@+. //
// :=#@@@@@@#+-:. :%@@@*. //
// -*@@@@@#+-. :%@@@#. //
// -*@@@@@+: =%@@@*. //
// .*@@@@%=. =#@@@%- //
// -%@@@@*: :+%@@@@+: //
// +@@@@#- :+#@@@@@@#: //
// +@@@@+. .-===++%@@@@%: //
// +@@@@= .*@@@@= //
// +@@@@= -%@@@@= //
// +@@@@= =#@@@@#- //
// -%@@@*. :=*%@@@@#= //
// :#@@@#: ..:-=*#%@@@@@@*- //
// +@@@@=-*%%@@@@@@@@@@#+: //
// :%@@@@@@@@@@@@%##+-:. //
// +@@@@@@@@*+-:. //
// :%@@@@@%+: //
// =@@@@@#. //
// .#@@@@#. //
// -%@@@*. //
// *@@@@- Blank. //
// Made with <3 by a team of //
// passionate innovators //
// *@@@@@- //
// *@@@@@- Smart Contract by: //
// +%%%%%- Mouradif //
// //
// //
// ################################################################ //
/**
* Blank Studio Genesis NFT Contracts
*
* Blank.sol: The Blank contract
* BlankGenesis.sol: Public mint functions and withdraw
* BlankBase.sol: Minting rules, validation functions
* ERC721.sol: NFT implementation heavily inspired from the latest ERC721A
*
* The Heart
*
* Blank. is forging a new frontier of innovation and creativity in the rapidly
* emerging NFT space.
* Blank. will encourage pure expression and provide ways for this expression to
* be seen and appreciated.
* With our unique curation and innovative style, it is never impossible.
*
* Mutual Trust & Respect
*
* Blank. is built on trust and respect. We know innovation takes time to
* understand and adapt. Side by side, we can build and grow the Blank. ecosystem.
*
* Xpression
*
* We welcome every thought and idea from the community that shapes us. Express yourself
* without reserve or shame, and show your creativity unapologetically. Blank. is an open
* canvas for bringing your Xpression to life.
*
* Degens vs Innovators
*
* There is a fine line between degens and innovators. At Blank. no one is afraid to live
* on the apex.
* We test the limits and, as the space evolves, need to grow and innovate alongside it.
*
**/
}
ERC721.sol 415 lines
// SPDX-License-Identifier: MIT
// ERC721 Contract
// Creator: Blank Studio
// Based on ERC721A by Chiru Labs
pragma solidity 0.8.14;
import '../interfaces/IERC721A.sol';
/**
* @dev ERC721 token receiver interface.
*/
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension. Built to optimize for lower gas.
*
* - Each mint is indivitual (no batch mint)
* - Any given address can only mint once
* - Tokens are sequentially minted starting at 0
* - Tokens are not burnable
*/
abstract contract ERC721 is IERC721A {
// last 12 bits (Where the total balance including Gen2 should fit)
uint256 private constant BALANCE_BITMASK = 0xfff;
// 13th bit that will be active if the address already minted
uint256 private constant ALREADY_MINTED_BITMASK = 0x1000;
// The tokenId of the next token to be minted.
uint256 internal _currentIndex;
// Token name
string public name;
// Token symbol
string public symbol;
// Metadata Base URI
string internal _baseURI;
// Mapping from token ID to owner's address
mapping(uint256 => address) private _owners;
// Mapping owner address to balance
// Bits Layout:
// - [0..12] `balance`
// - [13] `alreadyMinted`
mapping(address => uint256) private _packedAddressData;
// Mapping from token ID to approved address.
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory _name, string memory _symbol) {
name = _name;
symbol = _symbol;
}
/**
* @dev Returns the total number of tokens in existence.
*/
function totalSupply() public view override returns (uint256) {
return _currentIndex;
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return _packedAddressData[owner] & BALANCE_BITMASK;
}
/**
* @dev Returns true if an address has already minted
*/
function hasMinted(address owner) public view returns (bool) {
return (_packedAddressData[owner] & ALREADY_MINTED_BITMASK) > 0;
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return _owners[tokenId];
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public override {
if (to == _owners[tokenId]) revert ApprovalToCurrentOwner();
if (msg.sender != _owners[tokenId])
if (!isApprovedForAll(_owners[tokenId], msg.sender)) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId] = to;
emit Approval(_owners[tokenId], to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
if (operator == msg.sender) revert ApproveToCaller();
_operatorApprovals[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See https://docs.opensea.io/docs/contract-level-metadata
*/
function contractURI() public view virtual returns (string memory) {
return string(abi.encodePacked(_baseURI, "contract.json"));
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view returns (string memory)
{
return string(abi.encodePacked(_baseURI, _toString(tokenId), ".json"));
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, '');
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
_transfer(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
// The interface IDs are constants representing the first 4 bytes of the XOR of
// all function selectors in the interface. See: https://eips.ethereum.org/EIPS/eip-165
// e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`
return
interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < _currentIndex; // If within bounds
}
/**
* @dev Equivalent to `_safeMint(to, '')`.
*/
function _safeMint(address to) internal {
_safeMint(to, '');
}
/**
* @dev Safely mints 1 token and transfers it to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
bytes memory _data
) internal {
if (to == address(0)) revert MintToZeroAddress();
// Overflows are incredibly unrealistic.
// balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
// updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
unchecked {
// Updates:
// - balance++
// - alreadyMinted = true
_packedAddressData[to] = (_packedAddressData[to] + 1) | ALREADY_MINTED_BITMASK;
// Updates:
// - `address` to the owner.
_owners[_currentIndex] = to;
if (to.code.length != 0) {
emit Transfer(address(0), to, _currentIndex);
if (!_checkContractOnERC721Received(address(0), to, _currentIndex++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
} else {
emit Transfer(address(0), to, _currentIndex++);
}
}
}
/**
* @dev Mints 1 token and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/
function _mint(address to) internal {
if (to == address(0)) revert MintToZeroAddress();
// Overflows are incredibly unrealistic.
// balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
// updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
unchecked {
// Updates:
// - balance++
// - alreadyMinted = true
_packedAddressData[to] = (_packedAddressData[to] + 1) | ALREADY_MINTED_BITMASK;
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `nextInitialized` to `quantity == 1`.
_owners[_currentIndex] = to;
emit Transfer(address(0), to, _currentIndex++);
}
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) private {
if (_owners[tokenId] != from) revert TransferFromIncorrectOwner();
if (to == address(0)) revert TransferToZeroAddress();
if (
msg.sender != from &&
!isApprovedForAll(from, msg.sender) &&
getApproved(tokenId) != msg.sender
) revert TransferCallerNotOwnerNorApproved();
// Clear approvals from the previous owner.
delete _tokenApprovals[tokenId];
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
unchecked {
// We can directly increment and decrement the balances.
_packedAddressData[from]--; // Updates: `balance -= 1`.
_packedAddressData[to]--; // Updates: `balance += 1`.
// Updates:
// - `address` to the next owner.
// - `startTimestamp` to the timestamp of transfering.
// - `nextInitialized` to `true`.
_owners[tokenId] = to;
}
emit Transfer(from, to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
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 TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function _toString(uint256 value) internal pure returns (string memory ptr) {
assembly {
// The maximum value of a uint256 contains 78 digits (1 byte per digit),
// but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged.
// We will need 1 32-byte word to store the length,
// and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128.
ptr := add(mload(0x40), 128)
// Update the free memory pointer to allocate.
mstore(0x40, ptr)
// Cache the end of the memory to calculate the length later.
let end := ptr
// We write the string from the rightmost digit to the leftmost digit.
// The following is essentially a do-while loop that also handles the zero case.
// Costs a bit more than early returning for the zero case,
// but cheaper in terms of deployment and overall runtime costs.
for {
// Initialize and perform the first pass without check.
let temp := value
// Move the pointer 1 byte leftwards to point to an empty character slot.
ptr := sub(ptr, 1)
// Write the character to the pointer. 48 is the ASCII index of '0'.
mstore8(ptr, add(48, mod(temp, 10)))
temp := div(temp, 10)
} temp {
// Keep dividing `temp` until zero.
temp := div(temp, 10)
} { // Body of the for loop.
ptr := sub(ptr, 1)
mstore8(ptr, add(48, mod(temp, 10)))
}
let length := sub(end, ptr)
// Move the pointer 32 bytes leftwards to make room for the length.
ptr := sub(ptr, 32)
// Store the length.
mstore(ptr, length)
}
}
}
IBlank.sol 8 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "./IERC721A.sol";
interface IBlank is IERC721A {
// TODO:
}
BlankBase.sol 147 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "./ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract BlankBase is ERC721, Ownable {
/// @dev Addresses that can approve restricted mints
address internal freeMintApprover = 0xb681cFf9A2Ed00756A7144afd9378455751b0A8e;
address internal blankApprover = 0x074631a146ABF0103453507094084f29982F7e0e;
address internal reserveApprover = 0x3a192C386db33C3d65c1a34dBE562860A61BEA4b;
/// @dev Infos of the Gen2 contract
address internal gen2Contract;
/// @notice Mint configuration
uint256 public constant MINT_PRICE = 0.29 ether;
uint256 public constant GENESIS_SUPPLY = 400;
uint256 public constant DEV_SUPPLY = 4;
uint256 public constant FREE_SUPPLY = 25;
uint256 public constant GEN2_SUPPLY = 3200; // 12800 divided by 4;
/// @notice Mint start timestamp
uint256 public mintStartTimestamp = 1653987600; // May 31st 2022, 10AM BST
uint256 public whitelistMintDuration = 12 hours;
/// @notice Mint counters for subgroups with dedicated supply
uint256 public devMints;
uint256 public freeMints;
uint256 public gen2Mints;
/// @dev Modifier to ensure the message signer is the one expected
modifier isMintApproved(address approver, bytes calldata signature) {
bytes32 hash = keccak256(
abi.encodePacked(
"\x19Ethereum Signed Message:\n32",
keccak256(abi.encodePacked(msg.sender))
)
);
require(
ECDSA.recover(hash, signature) == approver,
"You have not been approved for this mint"
);
_;
}
/// @dev Modifier to ensure the caller hasn't already minted
modifier canStillMint() {
require(!hasMinted(msg.sender), "You can only mint once"); // YOMO: You Only Mint Once
_;
}
/// @dev Modifier to ensure the max supply won't be exceeded by a genesis mint transaction
modifier hasTokenSupply(uint256 supply) {
require(_currentIndex < supply, "Mint supply reached");
_;
}
/// @dev Modifier to ensure the max supply won't be exceeded by a genesis mint transaction
modifier hasSubgroupSupply(uint256 supply, uint256 current) {
require(current < supply, "Mint supply reached for this category");
_;
}
/// @dev Modifier that checks that the mint has started and that devs have already minted token 0
modifier mintHasStarted() {
require(
block.timestamp >= mintStartTimestamp && _currentIndex > 0,
"Mint has not started"
);
_;
}
/// @dev Modifier that checks that the reserve list can mint
modifier reserveHasStarted() {
require(
block.timestamp >= mintStartTimestamp + whitelistMintDuration && _currentIndex > 0,
"Reserve Mint has not started"
);
_;
}
/// @dev Modifier to ensure the right amount has been sent (no more, no less)
modifier hasTheRightAmount() {
require(msg.value == MINT_PRICE, "You must send the right amount");
_;
}
/// @dev Modifier to ensure the call was made by the Gen2 contract
modifier onlyGen2Contract() {
require(msg.sender == gen2Contract, "Caller must be Blank Gen 2");
_;
}
/// @dev Contract constructor. Initializes the base URI that serves Metadata
constructor() ERC721("Blank.", "BLNK") {
_baseURI = "https://api.blankstudio.art/metadata/";
}
/// @notice Update the base URI that serves the Metadata
function setBaseURI(string calldata uri) public onlyOwner {
_baseURI = uri;
}
/// @notice Change the Freemint Approver
function setFreeMintApprover(address approver) public onlyOwner {
require(approver != freeMintApprover, "Nothing to change");
freeMintApprover = approver;
}
/// @notice Change the BlankList Approver
function setBlankApprover(address approver) public onlyOwner {
require(approver != blankApprover, "Nothing to change");
blankApprover = approver;
}
/// @notice Change the Reserve Approver
function setReserveApprover(address approver) public onlyOwner {
require(approver != reserveApprover, "Nothing to change");
reserveApprover = approver;
}
/// @notice Updates the mint start timestamp
function setMintStartTimestamp(uint256 timestamp) public onlyOwner {
mintStartTimestamp = timestamp;
}
/// @notice Sets the address of the Gen2 contract
function setGen2(address gen2) public onlyOwner
{
require(gen2Contract == address(0), "Gen2 was already initialized");
gen2Contract = gen2;
}
/// @notice
function withdraw()
public
onlyOwner
{
uint256 balance = address(this).balance;
require(balance > 0, "I'm Broke!");
(bool success, ) = payable(owner()).call{value: balance}("");
require(success, "Get Blanked!");
}
}
IERC721A.sol 255 lines
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.0.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of an ERC721A compliant contract.
*/
interface IERC721A {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* The caller cannot approve to their own address.
*/
error ApproveToCaller();
/**
* The caller cannot approve to the current owner.
*/
error ApprovalToCurrentOwner();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps track of the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
}
/**
* @dev Returns the total amount of tokens stored by the contract.
*
* Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.
*/
function totalSupply() external view returns (uint256);
// ==============================
// 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);
// ==============================
// IERC721
// ==============================
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
// ==============================
// IERC721Metadata
// ==============================
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
BlankGenesis.sol 82 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "./BlankBase.sol";
contract BlankGenesis is BlankBase {
/// @notice Free Mint for the devs
/// - Only Role Admin (deployer)
/// - Can't exceed the genesis supply
/// - Can't devMint more than DEV_SUPPLY
function devMint()
public
onlyOwner
hasSubgroupSupply(DEV_SUPPLY, devMints)
{
devMints++;
_mint(msg.sender);
}
/// @notice Free Mint for the project owners
/// - After mint has started
/// - One mint per address
/// - Can't exceed the freeMints supply
/// - Caller address must be signed by the Free Mint Approver
function freeMint(bytes calldata signature)
public
mintHasStarted
canStillMint
isMintApproved(freeMintApprover, signature)
hasSubgroupSupply(FREE_SUPPLY, freeMints)
{
freeMints++;
_mint(msg.sender);
}
/// @notice Regular Mint for the blanklisted addresses
/// - After mint has started
/// - One mint per address
/// - Can't exceed the Genesis supply minus reserved tokens (free and dev mints)
/// - Caller address must be signed by the Blank List Approver
function blankListMint(bytes calldata signature)
public
payable
mintHasStarted
canStillMint
isMintApproved(blankApprover, signature)
hasTokenSupply(GENESIS_SUPPLY - DEV_SUPPLY - FREE_SUPPLY + devMints + freeMints)
hasTheRightAmount
{
_mint(msg.sender);
}
/// @notice Regular Mint for the blanklisted addresses
/// - After mint has started
/// - One mint per address
/// - Can't exceed the Genesis supply minus reserved tokens (free and dev mints)
/// - Caller address must be signed by the Reserve List Approver
function reserveListMint(bytes calldata signature)
public
payable
reserveHasStarted
canStillMint
isMintApproved(reserveApprover, signature)
hasTokenSupply(GENESIS_SUPPLY - DEV_SUPPLY - FREE_SUPPLY + devMints + freeMints)
hasTheRightAmount
{
_mint(msg.sender);
}
/// @notice This function will be called by the Gen2 contract to burn 4 32x32 canvases into one 64x64
/// All the validation will be made in there (checking that the 4 tokens are in the right spot mainly)
/// It will burn the 4 tokens on the Gen2 and mint one here allowing their owner to ascend into genesis
function burnIntoGenesis(address ascendant)
public
onlyGen2Contract
hasSubgroupSupply(GEN2_SUPPLY, gen2Mints)
{
gen2Mints++;
_mint(ascendant);
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// 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;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// 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);
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @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);
}
}
ECDSA.sol 230 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
Read Contract
DEV_SUPPLY 0xc05f486e → uint256
FREE_SUPPLY 0x9858cf19 → uint256
GEN2_SUPPLY 0x20568c99 → uint256
GENESIS_SUPPLY 0x99ec6765 → uint256
MINT_PRICE 0xc002d23d → uint256
balanceOf 0x70a08231 → uint256
contractURI 0xe8a3d485 → string
devMints 0xca43b305 → uint256
freeMints 0x80b17335 → uint256
gen2Mints 0x8b907be2 → uint256
getApproved 0x081812fc → address
hasMinted 0x38e21cce → bool
isApprovedForAll 0xe985e9c5 → bool
mintStartTimestamp 0xa0e389de → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
whitelistMintDuration 0x933c3aa7 → uint256
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
blankListMint 0xc99b991c
bytes signature
burnIntoGenesis 0x922079c5
address ascendant
devMint 0x7c69e207
No parameters
freeMint 0xa4513e92
bytes signature
renounceOwnership 0x715018a6
No parameters
reserveListMint 0xff5a6e92
bytes signature
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string uri
setBlankApprover 0x2bad322c
address approver
setFreeMintApprover 0x1d6f6a2e
address approver
setGen2 0x1ec92778
address gen2
setMintStartTimestamp 0x54fee61f
uint256 timestamp
setReserveApprover 0x012b393f
address approver
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address