Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xFa042F7214e17d6104272A359FE231c2A155cd00
Balance 0 ETH
Nonce 1
Code Size 18552 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

18552 bytes
0x608060405234801561001057600080fd5b50600436106102745760003560e01c80639503987911610151578063c87b56dd116100c3578063e735b48a11610087578063e735b48a14610773578063e8a3d4851461078f578063e985e9c5146107ad578063eebb5907146107dd578063f1b54ff91461080d578063f2fde38b1461082957610274565b8063c87b56dd146106a9578063d060ab44146106d9578063dbbc5a75146106f7578063dbc119d714610713578063dbe7e3bd1461074357610274565b8063b88d4fde11610115578063b88d4fde146105d2578063b99edfb2146105ee578063bb3bafd61461060c578063be985ac91461063d578063beb0a4161461066d578063c63adb2b1461068b57610274565b8063950398791461054057806395d89b411461055e578063a22cb4651461057c578063aa4eb4fd14610598578063b5c1b7ab146105b657610274565b806358b3fcbf116101ea578063715018a6116101ae578063715018a6146104a45780637284e416146104ae5780637de1e536146104cc57806388db96e7146104ea57806389d3e307146105065780638da5cb5b1461052257610274565b806358b3fcbf146103ee5780635a09d8171461040c5780636352211e1461042857806368929c941461045857806370a082311461047457610274565b8063217c3cc21161023c578063217c3cc21461032f57806323b872dd1461034b5780632a55205a1461036757806342842e0e1461039857806343bc1612146103b4578063549261c1146103d257610274565b806301ffc9a71461027957806306fdde03146102a9578063081812fc146102c7578063095ea7b3146102f7578063165afc2614610313575b600080fd5b610293600480360381019061028e91906132a3565b610845565b6040516102a091906139d5565b60405180910390f35b6102b1610927565b6040516102be9190613a0b565b60405180910390f35b6102e160048036038101906102dc91906133bc565b6109b9565b6040516102ee9190613945565b60405180910390f35b610311600480360381019061030c9190613236565b6109ff565b005b61032d600480360381019061032891906133bc565b610b17565b005b6103496004803603810190610344919061338f565b610b29565b005b61036560048036038101906103609190613120565b610de6565b005b610381600480360381019061037c91906133e9565b610e46565b60405161038f9291906139ac565b60405180910390f35b6103b260048036038101906103ad9190613120565b610e92565b005b6103bc610eb2565b6040516103c99190613a0b565b60405180910390f35b6103ec60048036038101906103e791906132fd565b610f40565b005b6103f6610f62565b6040516104039190613945565b60405180910390f35b6104266004803603810190610421919061338f565b610f88565b005b610442600480360381019061043d91906133bc565b610f9e565b60405161044f9190613945565b60405180910390f35b610472600480360381019061046d9190613086565b611050565b005b61048e60048036038101906104899190613086565b61109c565b60405161049b9190613d81565b60405180910390f35b6104ac611154565b005b6104b6611168565b6040516104c39190613a0b565b60405180910390f35b6104d46111f6565b6040516104e19190613a0b565b60405180910390f35b61050460048036038101906104ff919061338f565b611284565b005b610520600480360381019061051b9190613086565b611665565b005b61052a611707565b6040516105379190613945565b60405180910390f35b610548611731565b60405161055591906139d5565b60405180910390f35b610566611744565b6040516105739190613a0b565b60405180910390f35b610596600480360381019061059191906131f6565b6117d6565b005b6105a06117ec565b6040516105ad9190613d81565b60405180910390f35b6105d060048036038101906105cb91906133bc565b6117f2565b005b6105ec60048036038101906105e79190613173565b61185c565b005b6105f66118be565b6040516106039190613a0b565b60405180910390f35b610626600480360381019061062191906133bc565b61194c565b6040516106349291906139ac565b60405180910390f35b610657600480360381019061065291906133bc565b61197e565b6040516106649190613a0b565b60405180910390f35b610675611bc3565b6040516106829190613a0b565b60405180910390f35b610693611c51565b6040516106a09190613d81565b60405180910390f35b6106c360048036038101906106be91906133bc565b611c57565b6040516106d09190613a0b565b60405180910390f35b6106e1611e9c565b6040516106ee9190613945565b60405180910390f35b610711600480360381019061070c91906132fd565b611ec2565b005b61072d600480360381019061072891906133bc565b611ee4565b60405161073a9190613d81565b60405180910390f35b61075d600480360381019061075891906133bc565b611efc565b60405161076a9190613e42565b60405180910390f35b61078d600480360381019061078891906132fd565b611f27565b005b610797611f49565b6040516107a49190613a0b565b60405180910390f35b6107c760048036038101906107c291906130e0565b612044565b6040516107d491906139d5565b60405180910390f35b6107f760048036038101906107f291906133bc565b6120d8565b60405161080491906139f0565b60405180910390f35b610827600480360381019061082291906132fd565b6120f0565b005b610843600480360381019061083e9190613086565b612112565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061091057507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610920575061091f82612196565b5b9050919050565b60606000805461093690614188565b80601f016020809104026020016040519081016040528092919081815260200182805461096290614188565b80156109af5780601f10610984576101008083540402835291602001916109af565b820191906000526020600020905b81548152906001019060200180831161099257829003601f168201915b5050505050905090565b60006109c482612200565b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610a0a82610f9e565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7290613cc1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610a9a61224b565b73ffffffffffffffffffffffffffffffffffffffff161480610ac95750610ac881610ac361224b565b612044565b5b610b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aff90613be1565b60405180910390fd5b610b128383612253565b505050565b610b1f61230c565b8060338190555050565b610b3161230c565b6000600b8261ffff166103e88110610b4c57610b4b614282565b5b602091828204019190069054906101000a900460ff1660ff1614610ba5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9c90613ca1565b60405180910390fd5b6000603260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e630ac9d7408461ffff16610bf99190613f92565b6040518263ffffffff1660e01b8152600401610c159190613e27565b60206040518083038186803b158015610c2d57600080fd5b505afa158015610c41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6591906130b3565b90506000603260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663621a1f74630ac9d7408561ffff16610cbb9190613f92565b6040518263ffffffff1660e01b8152600401610cd79190613e27565b60206040518083038186803b158015610cef57600080fd5b505afa158015610d03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d279190613276565b90506000801b811415610d6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6690613d41565b60405180910390fd5b80600a60008561ffff16815260200190815260200160002081905550610d988361ffff1661238a565b6001600b8461ffff166103e88110610db357610db2614282565b5b602091828204019190066101000a81548160ff021916908360ff160217905550610de1828461ffff166123dd565b505050565b610df7610df161224b565b826123fb565b610e36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2d90613d01565b60405180910390fd5b610e41838383612490565b505050565b600080603060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661271060335485610e7d9190613ffd565b610e879190613fcc565b915091509250929050565b610ead8383836040518060200160405280600081525061185c565b505050565b602b8054610ebf90614188565b80601f0160208091040260200160405190810160405280929190818152602001828054610eeb90614188565b8015610f385780601f10610f0d57610100808354040283529160200191610f38565b820191906000526020600020905b815481529060010190602001808311610f1b57829003601f168201915b505050505081565b610f4861230c565b80602d9080519060200190610f5e929190612deb565b5050565b603060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f9061230c565b8061ffff1660348190555050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103e90613c81565b60405180910390fd5b80915050919050565b61105861230c565b80603060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561110d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110490613ba1565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61115c61230c565b61116660006126f7565b565b602c805461117590614188565b80601f01602080910402602001604051908101604052809291908181526020018280546111a190614188565b80156111ee5780601f106111c3576101008083540402835291602001916111ee565b820191906000526020600020905b8154815290600101906020018083116111d157829003601f168201915b505050505081565b602d805461120390614188565b80601f016020809104026020016040519081016040528092919081815260200182805461122f90614188565b801561127c5780601f106112515761010080835404028352916020019161127c565b820191906000526020600020905b81548152906001019060200180831161125f57829003601f168201915b505050505081565b600260075414156112ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c190613d21565b60405180910390fd5b60026007819055503373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614611340576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133790613d61565b60405180910390fd5b6000600b8261ffff166103e8811061135b5761135a614282565b5b602091828204019190069054906101000a900460ff1660ff16146113b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ab90613ca1565b60405180910390fd5b603260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e630ac9d7408361ffff166114069190613f92565b6040518263ffffffff1660e01b81526004016114229190613e27565b60206040518083038186803b15801561143a57600080fd5b505afa15801561144e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147291906130b3565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d690613c61565b60405180910390fd5b6000603260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663621a1f74630ac9d7408461ffff166115339190613f92565b6040518263ffffffff1660e01b815260040161154f9190613e27565b60206040518083038186803b15801561156757600080fd5b505afa15801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f9190613276565b90506000801b8114156115e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115de90613d41565b60405180910390fd5b80600a60008461ffff168152602001908152602001600020819055506116108261ffff1661238a565b6001600b8361ffff166103e8811061162b5761162a614282565b5b602091828204019190066101000a81548160ff021916908360ff160217905550611659338361ffff166123dd565b50600160078190555050565b61166d61230c565b60001515600860009054906101000a900460ff161515146116c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ba90613ce1565b60405180910390fd5b80603160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600860009054906101000a900460ff1681565b60606001805461175390614188565b80601f016020809104026020016040519081016040528092919081815260200182805461177f90614188565b80156117cc5780601f106117a1576101008083540402835291602001916117cc565b820191906000526020600020905b8154815290600101906020018083116117af57829003601f168201915b5050505050905090565b6117e86117e161224b565b83836127bd565b5050565b60345481565b6117fa61230c565b6104d2811461183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613c21565b60405180910390fd5b6001600860006101000a81548160ff02191690831515021790555050565b61186d61186761224b565b836123fb565b6118ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a390613d01565b60405180910390fd5b6118b88484848461292a565b50505050565b602f80546118cb90614188565b80601f01602080910402602001604051908101604052809291908181526020018280546118f790614188565b80156119445780601f1061191957610100808354040283529160200191611944565b820191906000526020600020905b81548152906001019060200180831161192757829003601f168201915b505050505081565b600080603060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660335491509150915091565b60606001600b836103e8811061199757611996614282565b5b602091828204019190069054906101000a900460ff1660ff16146119f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e790613bc1565b60405180910390fd5b6000603160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638ecfc5e484602c603060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16603354602d602e602f6040518863ffffffff1660e01b8152600401611a819796959493929190613d9c565b60006040518083038186803b158015611a9957600080fd5b505afa158015611aad573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611ad69190613346565b90506000603160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166344994468836009600088815260200190815260200160002054600a60008981526020019081526020016000205460016040518563ffffffff1660e01b8152600401611b629493929190613a2d565b60006040518083038186803b158015611b7a57600080fd5b505afa158015611b8e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611bb79190613346565b90508092505050919050565b602e8054611bd090614188565b80601f0160208091040260200160405190810160405280929190818152602001828054611bfc90614188565b8015611c495780601f10611c1e57610100808354040283529160200191611c49565b820191906000526020600020905b815481529060010190602001808311611c2c57829003601f168201915b505050505081565b60335481565b60606001600b836103e88110611c7057611c6f614282565b5b602091828204019190069054906101000a900460ff1660ff1614611cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc090613bc1565b60405180910390fd5b6000603160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638ecfc5e484602c603060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16603354602d602e602f6040518863ffffffff1660e01b8152600401611d5a9796959493929190613d9c565b60006040518083038186803b158015611d7257600080fd5b505afa158015611d86573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611daf9190613346565b90506000603160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166344994468836009600088815260200190815260200160002054600a60008981526020019081526020016000205460006040518563ffffffff1660e01b8152600401611e3b9493929190613a2d565b60006040518083038186803b158015611e5357600080fd5b505afa158015611e67573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611e909190613346565b90508092505050919050565b603160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611eca61230c565b80602f9080519060200190611ee0929190612deb565b5050565b60096020528060005260406000206000915090505481565b600b816103e88110611f0d57600080fd5b60209182820401919006915054906101000a900460ff1681565b611f2f61230c565b80602c9080519060200190611f45929190612deb565b5050565b60606000611f5860345461197e565b90506000603160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635b265342602c602f603354603060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16876040518663ffffffff1660e01b8152600401611fe5959493929190613a79565b60006040518083038186803b158015611ffd57600080fd5b505afa158015612011573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061203a9190613346565b9050809250505090565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600a6020528060005260406000206000915090505481565b6120f861230c565b80602e908051906020019061210e929190612deb565b5050565b61211a61230c565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561218a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218190613b01565b60405180910390fd5b612193816126f7565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61220981612986565b612248576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223f90613c81565b60405180910390fd5b50565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166122c683610f9e565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61231461224b565b73ffffffffffffffffffffffffffffffffffffffff16612332611707565b73ffffffffffffffffffffffffffffffffffffffff1614612388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237f90613c41565b60405180910390fd5b565b6000602b824342446040516020016123a69594939291906138ea565b6040516020818303038152906040528051906020012060001c90508060096000848152602001908152602001600020819055505050565b6123f78282604051806020016040528060008152506129f2565b5050565b60008061240783610f9e565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061244957506124488185612044565b5b8061248757508373ffffffffffffffffffffffffffffffffffffffff1661246f846109b9565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166124b082610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614612506576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fd90613b21565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256d90613b61565b60405180910390fd5b612581838383612a4d565b61258c600082612253565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546125dc9190614057565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546126339190613f3c565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46126f2838383612a52565b505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561282c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161282390613b81565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161291d91906139d5565b60405180910390a3505050565b612935848484612490565b61294184848484612a57565b612980576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161297790613ae1565b60405180910390fd5b50505050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6129fc8383612bee565b612a096000848484612a57565b612a48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3f90613ae1565b60405180910390fd5b505050565b505050565b505050565b6000612a788473ffffffffffffffffffffffffffffffffffffffff16612dc8565b15612be1578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612aa161224b565b8786866040518563ffffffff1660e01b8152600401612ac39493929190613960565b602060405180830381600087803b158015612add57600080fd5b505af1925050508015612b0e57506040513d601f19601f82011682018060405250810190612b0b91906132d0565b60015b612b91573d8060008114612b3e576040519150601f19603f3d011682016040523d82523d6000602084013e612b43565b606091505b50600081511415612b89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8090613ae1565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612be6565b600190505b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c5590613c01565b60405180910390fd5b612c6781612986565b15612ca7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c9e90613b41565b60405180910390fd5b612cb360008383612a4d565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612d039190613f3c565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612dc460008383612a52565b5050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b828054612df790614188565b90600052602060002090601f016020900481019282612e195760008555612e60565b82601f10612e3257805160ff1916838001178555612e60565b82800160010185558215612e60579182015b82811115612e5f578251825591602001919060010190612e44565b5b509050612e6d9190612e71565b5090565b5b80821115612e8a576000816000905550600101612e72565b5090565b6000612ea1612e9c84613e82565b613e5d565b905082815260208101848484011115612ebd57612ebc6142e5565b5b612ec8848285614146565b509392505050565b6000612ee3612ede84613eb3565b613e5d565b905082815260208101848484011115612eff57612efe6142e5565b5b612f0a848285614146565b509392505050565b6000612f25612f2084613eb3565b613e5d565b905082815260208101848484011115612f4157612f406142e5565b5b612f4c848285614155565b509392505050565b600081359050612f63816147b8565b92915050565b600081519050612f78816147b8565b92915050565b600081359050612f8d816147cf565b92915050565b600081519050612fa2816147e6565b92915050565b600081359050612fb7816147fd565b92915050565b600081519050612fcc816147fd565b92915050565b600082601f830112612fe757612fe66142e0565b5b8135612ff7848260208601612e8e565b91505092915050565b600082601f830112613015576130146142e0565b5b8135613025848260208601612ed0565b91505092915050565b600082601f830112613043576130426142e0565b5b8151613053848260208601612f12565b91505092915050565b60008135905061306b81614814565b92915050565b6000813590506130808161482b565b92915050565b60006020828403121561309c5761309b6142ef565b5b60006130aa84828501612f54565b91505092915050565b6000602082840312156130c9576130c86142ef565b5b60006130d784828501612f69565b91505092915050565b600080604083850312156130f7576130f66142ef565b5b600061310585828601612f54565b925050602061311685828601612f54565b9150509250929050565b600080600060608486031215613139576131386142ef565b5b600061314786828701612f54565b935050602061315886828701612f54565b925050604061316986828701613071565b9150509250925092565b6000806000806080858703121561318d5761318c6142ef565b5b600061319b87828801612f54565b94505060206131ac87828801612f54565b93505060406131bd87828801613071565b925050606085013567ffffffffffffffff8111156131de576131dd6142ea565b5b6131ea87828801612fd2565b91505092959194509250565b6000806040838503121561320d5761320c6142ef565b5b600061321b85828601612f54565b925050602061322c85828601612f7e565b9150509250929050565b6000806040838503121561324d5761324c6142ef565b5b600061325b85828601612f54565b925050602061326c85828601613071565b9150509250929050565b60006020828403121561328c5761328b6142ef565b5b600061329a84828501612f93565b91505092915050565b6000602082840312156132b9576132b86142ef565b5b60006132c784828501612fa8565b91505092915050565b6000602082840312156132e6576132e56142ef565b5b60006132f484828501612fbd565b91505092915050565b600060208284031215613313576133126142ef565b5b600082013567ffffffffffffffff811115613331576133306142ea565b5b61333d84828501613000565b91505092915050565b60006020828403121561335c5761335b6142ef565b5b600082015167ffffffffffffffff81111561337a576133796142ea565b5b6133868482850161302e565b91505092915050565b6000602082840312156133a5576133a46142ef565b5b60006133b38482850161305c565b91505092915050565b6000602082840312156133d2576133d16142ef565b5b60006133e084828501613071565b91505092915050565b60008060408385031215613400576133ff6142ef565b5b600061340e85828601613071565b925050602061341f85828601613071565b9150509250929050565b6134328161408b565b82525050565b6134418161409d565b82525050565b613450816140a9565b82525050565b600061346182613ef9565b61346b8185613f0f565b935061347b818560208601614155565b613484816142f4565b840191505092915050565b600061349a82613f04565b6134a48185613f20565b93506134b4818560208601614155565b6134bd816142f4565b840191505092915050565b600081546134d581614188565b6134df8186613f20565b945060018216600081146134fa576001811461350c5761353f565b60ff198316865260208601935061353f565b61351585613ee4565b60005b8381101561353757815481890152600182019150602081019050613518565b808801955050505b50505092915050565b6000815461355581614188565b61355f8186613f31565b9450600182166000811461357a576001811461358b576135be565b60ff198316865281860193506135be565b61359485613ee4565b60005b838110156135b657815481890152600182019150602081019050613597565b838801955050505b50505092915050565b60006135d4603283613f20565b91506135df82614305565b604082019050919050565b60006135f7602683613f20565b915061360282614354565b604082019050919050565b600061361a602583613f20565b9150613625826143a3565b604082019050919050565b600061363d601c83613f20565b9150613648826143f2565b602082019050919050565b6000613660602483613f20565b915061366b8261441b565b604082019050919050565b6000613683601983613f20565b915061368e8261446a565b602082019050919050565b60006136a6602983613f20565b91506136b182614493565b604082019050919050565b60006136c9601883613f20565b91506136d4826144e2565b602082019050919050565b60006136ec603e83613f20565b91506136f78261450b565b604082019050919050565b600061370f602083613f20565b915061371a8261455a565b602082019050919050565b6000613732600f83613f20565b915061373d82614583565b602082019050919050565b6000613755602083613f20565b9150613760826145ac565b602082019050919050565b6000613778602683613f20565b9150613783826145d5565b604082019050919050565b600061379b601883613f20565b91506137a682614624565b602082019050919050565b60006137be601e83613f20565b91506137c98261464d565b602082019050919050565b60006137e1602183613f20565b91506137ec82614676565b604082019050919050565b6000613804601383613f20565b915061380f826146c5565b602082019050919050565b6000613827602e83613f20565b9150613832826146ee565b604082019050919050565b600061384a601f83613f20565b91506138558261473d565b602082019050919050565b600061386d601983613f20565b915061387882614766565b602082019050919050565b6000613890600c83613f20565b915061389b8261478f565b602082019050919050565b6138af8161410d565b82525050565b6138c66138c18261410d565b6141eb565b82525050565b6138d581614134565b82525050565b6138e481614127565b82525050565b60006138f68288613548565b915061390282876138b5565b60208201915061391282866138b5565b60208201915061392282856138b5565b60208201915061393282846138b5565b6020820191508190509695505050505050565b600060208201905061395a6000830184613429565b92915050565b60006080820190506139756000830187613429565b6139826020830186613429565b61398f60408301856138a6565b81810360608301526139a18184613456565b905095945050505050565b60006040820190506139c16000830185613429565b6139ce60208301846138a6565b9392505050565b60006020820190506139ea6000830184613438565b92915050565b6000602082019050613a056000830184613447565b92915050565b60006020820190508181036000830152613a25818461348f565b905092915050565b60006080820190508181036000830152613a47818761348f565b9050613a5660208301866138a6565b613a636040830185613447565b613a706060830184613438565b95945050505050565b600060a0820190508181036000830152613a9381886134c8565b90508181036020830152613aa781876134c8565b9050613ab660408301866138a6565b613ac36060830185613429565b8181036080830152613ad5818461348f565b90509695505050505050565b60006020820190508181036000830152613afa816135c7565b9050919050565b60006020820190508181036000830152613b1a816135ea565b9050919050565b60006020820190508181036000830152613b3a8161360d565b9050919050565b60006020820190508181036000830152613b5a81613630565b9050919050565b60006020820190508181036000830152613b7a81613653565b9050919050565b60006020820190508181036000830152613b9a81613676565b9050919050565b60006020820190508181036000830152613bba81613699565b9050919050565b60006020820190508181036000830152613bda816136bc565b9050919050565b60006020820190508181036000830152613bfa816136df565b9050919050565b60006020820190508181036000830152613c1a81613702565b9050919050565b60006020820190508181036000830152613c3a81613725565b9050919050565b60006020820190508181036000830152613c5a81613748565b9050919050565b60006020820190508181036000830152613c7a8161376b565b9050919050565b60006020820190508181036000830152613c9a8161378e565b9050919050565b60006020820190508181036000830152613cba816137b1565b9050919050565b60006020820190508181036000830152613cda816137d4565b9050919050565b60006020820190508181036000830152613cfa816137f7565b9050919050565b60006020820190508181036000830152613d1a8161381a565b9050919050565b60006020820190508181036000830152613d3a8161383d565b9050919050565b60006020820190508181036000830152613d5a81613860565b9050919050565b60006020820190508181036000830152613d7a81613883565b9050919050565b6000602082019050613d9660008301846138a6565b92915050565b600060e082019050613db1600083018a6138a6565b8181036020830152613dc381896134c8565b9050613dd26040830188613429565b613ddf60608301876138a6565b8181036080830152613df181866134c8565b905081810360a0830152613e0581856134c8565b905081810360c0830152613e1981846134c8565b905098975050505050505050565b6000602082019050613e3c60008301846138cc565b92915050565b6000602082019050613e5760008301846138db565b92915050565b6000613e67613e78565b9050613e7382826141ba565b919050565b6000604051905090565b600067ffffffffffffffff821115613e9d57613e9c6142b1565b5b613ea6826142f4565b9050602081019050919050565b600067ffffffffffffffff821115613ece57613ecd6142b1565b5b613ed7826142f4565b9050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000613f478261410d565b9150613f528361410d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613f8757613f866141f5565b5b828201905092915050565b6000613f9d82614117565b9150613fa883614117565b92508263ffffffff03821115613fc157613fc06141f5565b5b828201905092915050565b6000613fd78261410d565b9150613fe28361410d565b925082613ff257613ff1614224565b5b828204905092915050565b60006140088261410d565b91506140138361410d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561404c5761404b6141f5565b5b828202905092915050565b60006140628261410d565b915061406d8361410d565b9250828210156140805761407f6141f5565b5b828203905092915050565b6000614096826140ed565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b600061413f82614117565b9050919050565b82818337600083830152505050565b60005b83811015614173578082015181840152602081019050614158565b83811115614182576000848401525b50505050565b600060028204905060018216806141a057607f821691505b602082108114156141b4576141b3614253565b5b50919050565b6141c3826142f4565b810181811067ffffffffffffffff821117156141e2576141e16142b1565b5b80604052505050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b7f5468617420746f6b656e20646f65736e27742065786973740000000000000000600082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f57726f6e672070617373776f7264210000000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f52657175657374696e67206163636f756e74206d757374206f776e207468652060008201527f464f4355532e0000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b7f5468617420464f43555320686173206265656e206465464f43555365642e0000600082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f55524920636f6e7472616374206c6f636b656400000000000000000000000000600082015250565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206e6f7220617070726f766564000000000000000000000000000000000000602082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b7f5468617420464f43555320646f65736e27742065786973742e00000000000000600082015250565b7f4e6f20636f6e7472616374730000000000000000000000000000000000000000600082015250565b6147c18161408b565b81146147cc57600080fd5b50565b6147d88161409d565b81146147e357600080fd5b50565b6147ef816140a9565b81146147fa57600080fd5b50565b614806816140b3565b811461481157600080fd5b50565b61481d816140df565b811461482857600080fd5b50565b6148348161410d565b811461483f57600080fd5b5056fea2646970667358221220659eb07bedeed790077f440f0c99897fdc5576609a612981d6030717424389b864736f6c63430008070033

Verified Source Code Full Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: No
deFOCUSed.sol 227 lines
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

interface i_deFOCUSedURI {
  function buildMetaPart(uint256 _tokenId, string memory _description, address _artistAddy, uint256 _royaltyBps, string memory _collection, string memory _website, string memory _externalURL)
    external
    view
    returns (string memory);

  function buildContractURI(string memory _description, string memory _externalURL, uint256 _royaltyBps, address _artistAddy, string memory _svg)
    external
    view
    returns (string memory);


  function buildTokenURI(string memory _metaP, uint256 _tokenEntropy, bytes32 _abEntropy, bool _svgMode)
    external
    view
    returns (string memory);
}

interface i_ArtBlocks {
  function tokenIdToHash(uint256 fullTokenId)
    external
    view
    returns (bytes32);

  function ownerOf(uint256 fullTokenId)
    external
    view
    returns (address);
}

/// @title deFOCUSed Main Contract
/// @author Matto
/// @notice This is a customized ERC-721 contract for deFOCUSed NFTs.
/// @dev SVG image and metadata is generated fully on-chain.
/// @custom:security-contact [email protected]
contract deFOCUSed is ERC721, Ownable, ReentrancyGuard {
  using Strings for string;
  bool public URIcontractLocked = false;
  mapping(uint256 => uint256) public tokenEntropyMap;
  mapping(uint256 => bytes32) public abEntropyMap;
  uint8[1000] public claimed;
  string public artist = "Matto";
  string public description;
  string public collection = "deFOCUSed";
  string public website = "https://matto.xyz/project/defocused/";
  string public externalURL;
  address public artistAddy = 0x983f10B69c6C8d72539750786911359619DF313d;
  address public URIcontract;
  address private abContract = 0xa7d8d9ef8D8Ce8992Df33D8b8CF4Aebabd5bD270;
  uint256 public royaltyBps = 750;
  uint256 public exampleId = 0;
	
  constructor() ERC721("deFOCUSed", "deFOC") {}

  modifier callerIsUser() {
    require(tx.origin == msg.sender, "No contracts");
    _;
  }
	
	function deFOCUSthatFOCUS(uint16 FOCUSnumber_forExample_1)
	external
    nonReentrant
    callerIsUser
	{
    require(claimed[FOCUSnumber_forExample_1] == 0, "That FOCUS has been deFOCUSed.");
    require(msg.sender == i_ArtBlocks(abContract).ownerOf(FOCUSnumber_forExample_1 + 181000000), "Requesting account must own the FOCUS.");
    bytes32 abEntropy = i_ArtBlocks(abContract).tokenIdToHash(FOCUSnumber_forExample_1 + 181000000);
    require(abEntropy != 0x0000000000000000000000000000000000000000000000000000000000000000, "That FOCUS doesn't exist.");
    abEntropyMap[FOCUSnumber_forExample_1] = abEntropy;
    createTokenEntropy(FOCUSnumber_forExample_1);
    claimed[FOCUSnumber_forExample_1] = 1;
    _safeMint(msg.sender, FOCUSnumber_forExample_1);
	}

  function Matto_deFOCUS(uint16 _FOCUSnumber)
	external 
	onlyOwner
	{
    require(claimed[_FOCUSnumber] == 0, "That FOCUS has been deFOCUSed.");
    address _addy = i_ArtBlocks(abContract).ownerOf(_FOCUSnumber + 181000000);
    bytes32 abEntropy = i_ArtBlocks(abContract).tokenIdToHash(_FOCUSnumber + 181000000);
    require(abEntropy != 0x0000000000000000000000000000000000000000000000000000000000000000, "That FOCUS doesn't exist.");
    abEntropyMap[_FOCUSnumber] = abEntropy;
    createTokenEntropy(_FOCUSnumber);
    claimed[_FOCUSnumber] = 1;
    _safeMint(_addy, _FOCUSnumber);
	}

	function createTokenEntropy(uint256 _tokenId)
	internal
	{
    uint256 tE = uint256(keccak256(abi.encodePacked(
      artist, 
      _tokenId,
      block.number,
      block.timestamp,
      block.difficulty)));
    tokenEntropyMap[_tokenId] = tE;
  }

  function contractURI()
    public
    view
    virtual
    returns (string memory) 
  {
    string memory svg = getSVG(exampleId);
    string memory contractURIstring = i_deFOCUSedURI(URIcontract).buildContractURI(description, externalURL, royaltyBps, artistAddy, svg);
    return contractURIstring;
  }

  function tokenURI(uint256 _tokenId) 
    public
    view
    virtual
    override
    returns (string memory)
  {
    require(claimed[_tokenId] == 1, "That token doesn't exist");
    string memory metaPart = i_deFOCUSedURI(URIcontract).buildMetaPart(_tokenId, description, artistAddy, royaltyBps, collection, website, externalURL);
    string memory URIBase64 = i_deFOCUSedURI(URIcontract).buildTokenURI(metaPart, tokenEntropyMap[_tokenId], abEntropyMap[_tokenId], false);
    return URIBase64;
  }

	function getSVG(uint256 _tokenId)
		public
		view
		virtual
		returns (string memory)
	{
    require(claimed[_tokenId] == 1, "That token doesn't exist");
    string memory metaPart = i_deFOCUSedURI(URIcontract).buildMetaPart(_tokenId, description, artistAddy, royaltyBps, collection, website, externalURL);
    string memory svg = i_deFOCUSedURI(URIcontract).buildTokenURI(metaPart, tokenEntropyMap[_tokenId], abEntropyMap[_tokenId], true);
    return svg;
	}

  function getRoyalties(uint256 _tokenId)
    external
    view
    returns (address, uint256)
  {
    return (artistAddy, royaltyBps);
  }

  function royaltyInfo(uint256 _tokenId, uint256 value)
		public
		view
		returns (address, uint256)
	{
    return (artistAddy, value * royaltyBps / 10000);
	}

  // The following functions are contract controls.

  function DANGER_LockURIcontract(uint256 _password)
        external
        onlyOwner
    {
        require(_password == 1234, "Wrong password!");
        URIcontractLocked = true;
  }
	
	function updateArtistAddy(address _artistAddy)
		external 
		onlyOwner 
	{
    artistAddy = _artistAddy;
  }

	function updateRoyaltyBps(uint256 _royaltyBps)
		external 
		onlyOwner 
	{
    royaltyBps = _royaltyBps;
  }

	function updateDescription(string memory _description)
		external 
		onlyOwner 
	{
    description = _description;
  }

	function updateCollection(string memory _collection)
		external 
		onlyOwner 
	{
    collection = _collection;
  }

	function updateWebsite(string memory _website)
		external 
		onlyOwner 
	{
    website = _website;
  }

	function updateExternalURL(string memory _externalURL)
		external 
		onlyOwner 
	{
    externalURL = _externalURL;
  }

	function updateExampleId(uint16 _example)
		external 
		onlyOwner 
	{
    exampleId = _example;
  }

  function updateURIcontract(address _URIcontract)
		external 
		onlyOwner 
	{
    require(URIcontractLocked == false, "URI contract locked");
    URIcontract = _URIcontract;
  }
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
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 75 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @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);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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);
    }
}
ERC721.sol 454 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // 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;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");

        _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 {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @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.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @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`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * 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
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a 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 _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @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 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);
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @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;
    }
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// 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);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @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);
}

Read Contract

URIcontract 0xd060ab44 → address
URIcontractLocked 0x95039879 → bool
abEntropyMap 0xeebb5907 → bytes32
artist 0x43bc1612 → string
artistAddy 0x58b3fcbf → address
balanceOf 0x70a08231 → uint256
claimed 0xdbe7e3bd → uint8
collection 0x7de1e536 → string
contractURI 0xe8a3d485 → string
description 0x7284e416 → string
exampleId 0xaa4eb4fd → uint256
externalURL 0xb99edfb2 → string
getApproved 0x081812fc → address
getRoyalties 0xbb3bafd6 → address, uint256
getSVG 0xbe985ac9 → string
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
royaltyBps 0xc63adb2b → uint256
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenEntropyMap 0xdbc119d7 → uint256
tokenURI 0xc87b56dd → string
website 0xbeb0a416 → string

Write Contract 18 functions

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

DANGER_LockURIcontract 0xb5c1b7ab
uint256 _password
Matto_deFOCUS 0x217c3cc2
uint16 _FOCUSnumber
approve 0x095ea7b3
address to
uint256 tokenId
deFOCUSthatFOCUS 0x88db96e7
uint16 FOCUSnumber_forExample_1
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
updateArtistAddy 0x68929c94
address _artistAddy
updateCollection 0x549261c1
string _collection
updateDescription 0xe735b48a
string _description
updateExampleId 0x5a09d817
uint16 _example
updateExternalURL 0xdbbc5a75
string _externalURL
updateRoyaltyBps 0x165afc26
uint256 _royaltyBps
updateURIcontract 0x89d3e307
address _URIcontract
updateWebsite 0xf1b54ff9
string _website

Recent Transactions

No transactions found for this address