Address Contract Partially Verified
Address
0x63c8282C8705E7873B3302bd623b2Bc8eBCdDDD3
Balance
0 ETH
Nonce
1
Code Size
21192 bytes
Creator
0x1d05cf6c...5ad6 at tx 0x42a6978f...03c56d
Indexed Transactions
0
Contract Bytecode
21192 bytes
0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063715018a611610130578063c87b56dd116100b8578063ea211d7c1161007c578063ea211d7c146106da578063ec9cbb44146106f8578063f2fde38b14610716578063fdf97cb214610732578063fe2a3bf31461075057610232565b8063c87b56dd14610622578063d0d1ea7014610652578063e4a233e11461066e578063e8a3d4851461068c578063e985e9c5146106aa57610232565b80638ef79e91116100ff5780638ef79e911461058057806395d89b411461059c578063a22cb465146105ba578063b4883703146105d6578063b88d4fde1461060657610232565b8063715018a61461051e5780637f34c0dd1461052857806384ad61af146105445780638da5cb5b1461056257610232565b80633afb021a116101be5780634f6ccce7116101825780634f6ccce71461042d57806362fe21311461045d5780636352211e1461048e578063641b18e9146104be57806370a08231146104ee57610232565b80633afb021a146103885780633f6805ba146103a457806342842e0e146103c257806345aeefde146103de5780634b602673146103fa57610232565b80630cfcb5f1116102055780630cfcb5f1146102d157806318160ddd146102ed57806323b872dd1461030b5780632a55205a146103275780632f745c591461035857610232565b806301ffc9a71461023757806306fdde0314610267578063081812fc14610285578063095ea7b3146102b5575b600080fd5b610251600480360381019061024c91906138c1565b610780565b60405161025e9190614961565b60405180910390f35b61026f6107fa565b60405161027c919061497c565b60405180910390f35b61029f600480360381019061029a91906139ff565b61088c565b6040516102ac91906148d1565b60405180910390f35b6102cf60048036038101906102ca9190613885565b610911565b005b6102eb60048036038101906102e69190613a28565b610a29565b005b6102f5610c11565b6040516103029190614e38565b60405180910390f35b6103256004803603810190610320919061377f565b610c1e565b005b610341600480360381019061033c9190613a7c565b610c7e565b60405161034f929190614938565b60405180910390f35b610372600480360381019061036d9190613885565b610d30565b60405161037f9190614e38565b60405180910390f35b6103a2600480360381019061039d9190613954565b610dd5565b005b6103ac61116f565b6040516103b991906148d1565b60405180910390f35b6103dc60048036038101906103d7919061377f565b611195565b005b6103f860048036038101906103f3919061371a565b6111b5565b005b610414600480360381019061040f91906139ff565b611300565b604051610424949392919061499e565b60405180910390f35b610447600480360381019061044291906139ff565b6114c8565b6040516104549190614e38565b60405180910390f35b610477600480360381019061047291906139ff565b61155f565b604051610485929190614e53565b60405180910390f35b6104a860048036038101906104a391906139ff565b61160b565b6040516104b591906148d1565b60405180910390f35b6104d860048036038101906104d39190613a7c565b6116bd565b6040516104e59190614e38565b60405180910390f35b6105086004803603810190610503919061371a565b611731565b6040516105159190614e38565b60405180910390f35b6105266117e9565b005b610542600480360381019061053d9190613ab8565b611871565b005b61054c611cac565b6040516105599190614e38565b60405180910390f35b61056a611cd0565b60405161057791906148d1565b60405180910390f35b61059a60048036038101906105959190613913565b611cfa565b005b6105a4611dab565b6040516105b1919061497c565b60405180910390f35b6105d460048036038101906105cf9190613849565b611e3d565b005b6105f060048036038101906105eb91906139ff565b611fbe565b6040516105fd9190614e38565b60405180910390f35b610620600480360381019061061b91906137ce565b612055565b005b61063c600480360381019061063791906139ff565b6120b7565b604051610649919061497c565b60405180910390f35b61066c6004803603810190610667919061371a565b612212565b005b6106766122d2565b6040516106839190614e38565b60405180910390f35b6106946122df565b6040516106a1919061497c565b60405180910390f35b6106c460048036038101906106bf9190613743565b612371565b6040516106d19190614961565b60405180910390f35b6106e2612405565b6040516106ef9190614e38565b60405180910390f35b610700612429565b60405161070d9190614e38565b60405180910390f35b610730600480360381019061072b919061371a565b61242f565b005b61073a612527565b60405161074791906148d1565b60405180910390f35b61076a600480360381019061076591906139ff565b61254d565b6040516107779190614e38565b60405180910390f35b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107f357506107f28261256d565b5b9050919050565b60606000805461080990615137565b80601f016020809104026020016040519081016040528092919081815260200182805461083590615137565b80156108825780601f1061085757610100808354040283529160200191610882565b820191906000526020600020905b81548152906001019060200180831161086557829003601f168201915b5050505050905090565b6000610897826125e7565b6108d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cd90614c78565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061091c8261160b565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098490614d58565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166109ac612653565b73ffffffffffffffffffffffffffffffffffffffff1614806109db57506109da816109d5612653565b612371565b5b610a1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1190614bd8565b60405180910390fd5b610a24838361265b565b505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ab75750610a88611cd0565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ac057600080fd5b610ac9826125e7565b610b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aff90614bb8565b60405180910390fd5b601481604051610b189190614874565b908152602001604051809103902060009054906101000a900460ff1615610b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6b90614df8565b60405180910390fd5b6000601160008481526020019081526020016000209050601481600101604051610b9e91906148ba565b908152602001604051809103902060006101000a81549060ff02191690556001601483604051610bce9190614874565b908152602001604051809103902060006101000a81548160ff02191690831515021790555081816001019080519060200190610c0b92919061353e565b50505050565b6000600880549050905090565b610c2f610c29612653565b82612714565b610c6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6590614d78565b60405180910390fd5b610c798383836127f2565b505050565b600080610c8a846125e7565b610cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc090614a58565b60405180910390fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691506127107f00000000000000000000000000000000000000000000000000000000000005dc84610d1d9190614ff3565b610d279190614fc2565b90509250929050565b6000610d3b83611731565b8210610d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7390614a18565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e635750610e34611cd0565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e6c57600080fd5b600083511415610eb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea890614b98565b60405180910390fd5b600082511415610ef6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eed90614b58565b60405180910390fd5b600084511415610f3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3290614dd8565b60405180910390fd5b60008111610f7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7590614e18565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000005a811115610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890614a78565b60405180910390fd5b600084604051602001610ff4919061497c565b6040516020818303038152906040528051906020012060001c9050600060106000838152602001908152602001600020600201805461103290615137565b905014611074576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106b90614cd8565b60405180910390fd5b60006040518060800160405280878152602001868152602001858152602001848152509050600f829080600181540180825580915050600190039060005260206000200160009091909190915055806010600084815260200190815260200160002060008201518160000190805190602001906110f292919061353e565b50602082015181600101908051906020019061110f92919061353e565b50604082015181600201908051906020019061112c92919061353e565b5060608201518160030155905050817f22350b25f1b72bb3621199a79abefeb4fcd77bb1e65638cd09350666e4db089160405160405180910390a2505050505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6111b083838360405180602001604052806000815250612055565b505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806112435750611214611cd0565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61124c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b390614ad8565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601060205280600052604060002060009150905080600001805461132390615137565b80601f016020809104026020016040519081016040528092919081815260200182805461134f90615137565b801561139c5780601f106113715761010080835404028352916020019161139c565b820191906000526020600020905b81548152906001019060200180831161137f57829003601f168201915b5050505050908060010180546113b190615137565b80601f01602080910402602001604051908101604052809291908181526020018280546113dd90615137565b801561142a5780601f106113ff5761010080835404028352916020019161142a565b820191906000526020600020905b81548152906001019060200180831161140d57829003601f168201915b50505050509080600201805461143f90615137565b80601f016020809104026020016040519081016040528092919081815260200182805461146b90615137565b80156114b85780601f1061148d576101008083540402835291602001916114b8565b820191906000526020600020905b81548152906001019060200180831161149b57829003601f168201915b5050505050908060030154905084565b60006114d2610c11565b8210611513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150a90614d98565b60405180910390fd5b6008828154811061154d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b601160205280600052604060002060009150905080600001549080600101805461158890615137565b80601f01602080910402602001604051908101604052809291908181526020018280546115b490615137565b80156116015780601f106115d657610100808354040283529160200191611601565b820191906000526020600020905b8154815290600101906020018083116115e457829003601f168201915b5050505050905082565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ab90614c18565b60405180910390fd5b80915050919050565b60006116c88361254d565b82106116d357600080fd5b60126000848152602001908152602001600020828154811061171e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179990614bf8565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6117f1612653565b73ffffffffffffffffffffffffffffffffffffffff1661180f611cd0565b73ffffffffffffffffffffffffffffffffffffffff1614611865576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185c90614c98565b60405180910390fd5b61186f6000612a4e565b565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806118ff57506118d0611cd0565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61190857600080fd5b6000601060008781526020019081526020016000206003015411611961576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195890614af8565b60405180910390fd5b60106000868152602001908152602001600020600301548311156119ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b190614d18565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a21906149f8565b60405180910390fd5b6013600085815260200190815260200160002060009054906101000a900460ff1615611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8290614d38565b60405180910390fd5b601481604051611a9b9190614874565b908152602001604051809103902060009054906101000a900460ff1615611af7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aee90614df8565b60405180910390fd5b60008386611b059190614f6c565b90506000601160008381526020019081526020016000206000015414611b60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5790614c38565b60405180910390fd5b600060405180604001604052808381526020018481525090508060116000848152602001908152602001600020600082015181600001556020820151816001019080519060200190611bb392919061353e565b509050506012600088815260200190815260200160002082908060018154018082558091505060019003906000526020600020016000909190919091505560016013600088815260200190815260200160002060006101000a81548160ff0219169083151502179055506001601484604051611c2f9190614874565b908152602001604051809103902060006101000a81548160ff021916908315150217905550611c5e8483612b14565b81878573ffffffffffffffffffffffffffffffffffffffff167f4f21e8cd53f1df1da42ec94ba03f881c1185607b26e4dcb81941535157d73dd460405160405180910390a450505050505050565b7f000000000000000000000000000000000000000000000000000000000000005a81565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611d885750611d59611cd0565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611d9157600080fd5b80600d9080519060200190611da792919061353e565b5050565b606060018054611dba90615137565b80601f0160208091040260200160405190810160405280929190818152602001828054611de690615137565b8015611e335780601f10611e0857610100808354040283529160200191611e33565b820191906000526020600020905b815481529060010190602001808311611e1657829003601f168201915b5050505050905090565b611e45612653565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaa90614b38565b60405180910390fd5b8060056000611ec0612653565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611f6d612653565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611fb29190614961565b60405180910390a35050565b6000611fc86122d2565b8210612009576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200090614db8565b60405180910390fd5b600f8281548110612043577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b612066612060612653565b83612714565b6120a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209c90614d78565b60405180910390fd5b6120b184848484612b32565b50505050565b60606120c2826125e7565b612101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f890614cf8565b60405180910390fd5b6000600d805461211090615137565b80601f016020809104026020016040519081016040528092919081815260200182805461213c90615137565b80156121895780601f1061215e57610100808354040283529160200191612189565b820191906000526020600020905b81548152906001019060200180831161216c57829003601f168201915b505050505090506000815114156121d3576040518060400160405280600781526020017f697066733a2f2f0000000000000000000000000000000000000000000000000081525090505b80601160008581526020019081526020016000206001016040516020016121fb92919061488b565b604051602081830303815290604052915050919050565b61221a612653565b73ffffffffffffffffffffffffffffffffffffffff16612238611cd0565b73ffffffffffffffffffffffffffffffffffffffff161461228e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228590614c98565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600f80549050905090565b6060600e80546122ee90615137565b80601f016020809104026020016040519081016040528092919081815260200182805461231a90615137565b80156123675780601f1061233c57610100808354040283529160200191612367565b820191906000526020600020905b81548152906001019060200180831161234a57829003601f168201915b5050505050905090565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b7f00000000000000000000000000000000000000000000000000000000000005dc81565b61271081565b612437612653565b73ffffffffffffffffffffffffffffffffffffffff16612455611cd0565b73ffffffffffffffffffffffffffffffffffffffff16146124ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a290614c98565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561251b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161251290614a98565b60405180910390fd5b61252481612a4e565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060126000838152602001908152602001600020805490509050919050565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806125e057506125df82612b8e565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166126ce8361160b565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061271f826125e7565b61275e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161275590614b78565b60405180910390fd5b60006127698361160b565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806127d857508373ffffffffffffffffffffffffffffffffffffffff166127c08461088c565b73ffffffffffffffffffffffffffffffffffffffff16145b806127e957506127e88185612371565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166128128261160b565b73ffffffffffffffffffffffffffffffffffffffff1614612868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161285f90614cb8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156128d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128cf90614b18565b60405180910390fd5b6128e3838383612c70565b6128ee60008261265b565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461293e919061504d565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546129959190614f6c565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612b2e828260405180602001604052806000815250612d84565b5050565b612b3d8484846127f2565b612b4984848484612ddf565b612b88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7f90614a38565b60405180910390fd5b50505050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612c5957507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612c695750612c6882612f76565b5b9050919050565b612c7b838383612fe0565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612cbe57612cb981612fe5565b612cfd565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612cfc57612cfb838261302e565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612d4057612d3b8161319b565b612d7f565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612d7e57612d7d82826132de565b5b5b505050565b612d8e838361335d565b612d9b6000848484612ddf565b612dda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dd190614a38565b60405180910390fd5b505050565b6000612e008473ffffffffffffffffffffffffffffffffffffffff1661352b565b15612f69578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612e29612653565b8786866040518563ffffffff1660e01b8152600401612e4b94939291906148ec565b602060405180830381600087803b158015612e6557600080fd5b505af1925050508015612e9657506040513d601f19601f82011682018060405250810190612e9391906138ea565b60015b612f19573d8060008114612ec6576040519150601f19603f3d011682016040523d82523d6000602084013e612ecb565b606091505b50600081511415612f11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f0890614a38565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612f6e565b600190505b949350505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b6000600161303b84611731565b613045919061504d565b905060006007600084815260200190815260200160002054905081811461312a576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b600060016008805490506131af919061504d565b9050600060096000848152602001908152602001600020549050600060088381548110613205577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050806008838154811061324d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200181905550816009600083815260200190815260200160002081905550600960008581526020019081526020016000206000905560088054806132c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006132e983611731565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156133cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133c490614c58565b60405180910390fd5b6133d6816125e7565b15613416576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161340d90614ab8565b60405180910390fd5b61342260008383612c70565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546134729190614f6c565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080823b905060008111915050919050565b82805461354a90615137565b90600052602060002090601f01602090048101928261356c57600085556135b3565b82601f1061358557805160ff19168380011785556135b3565b828001600101855582156135b3579182015b828111156135b2578251825591602001919060010190613597565b5b5090506135c091906135c4565b5090565b5b808211156135dd5760008160009055506001016135c5565b5090565b60006135f46135ef84614eb4565b614e83565b90508281526020810184848401111561360c57600080fd5b6136178482856150f5565b509392505050565b600061363261362d84614ee4565b614e83565b90508281526020810184848401111561364a57600080fd5b6136558482856150f5565b509392505050565b60008135905061366c81615236565b92915050565b6000813590506136818161524d565b92915050565b60008135905061369681615264565b92915050565b6000815190506136ab81615264565b92915050565b600082601f8301126136c257600080fd5b81356136d28482602086016135e1565b91505092915050565b600082601f8301126136ec57600080fd5b81356136fc84826020860161361f565b91505092915050565b6000813590506137148161527b565b92915050565b60006020828403121561372c57600080fd5b600061373a8482850161365d565b91505092915050565b6000806040838503121561375657600080fd5b60006137648582860161365d565b92505060206137758582860161365d565b9150509250929050565b60008060006060848603121561379457600080fd5b60006137a28682870161365d565b93505060206137b38682870161365d565b92505060406137c486828701613705565b9150509250925092565b600080600080608085870312156137e457600080fd5b60006137f28782880161365d565b94505060206138038782880161365d565b935050604061381487828801613705565b925050606085013567ffffffffffffffff81111561383157600080fd5b61383d878288016136b1565b91505092959194509250565b6000806040838503121561385c57600080fd5b600061386a8582860161365d565b925050602061387b85828601613672565b9150509250929050565b6000806040838503121561389857600080fd5b60006138a68582860161365d565b92505060206138b785828601613705565b9150509250929050565b6000602082840312156138d357600080fd5b60006138e184828501613687565b91505092915050565b6000602082840312156138fc57600080fd5b600061390a8482850161369c565b91505092915050565b60006020828403121561392557600080fd5b600082013567ffffffffffffffff81111561393f57600080fd5b61394b848285016136db565b91505092915050565b6000806000806080858703121561396a57600080fd5b600085013567ffffffffffffffff81111561398457600080fd5b613990878288016136db565b945050602085013567ffffffffffffffff8111156139ad57600080fd5b6139b9878288016136db565b935050604085013567ffffffffffffffff8111156139d657600080fd5b6139e2878288016136db565b92505060606139f387828801613705565b91505092959194509250565b600060208284031215613a1157600080fd5b6000613a1f84828501613705565b91505092915050565b60008060408385031215613a3b57600080fd5b6000613a4985828601613705565b925050602083013567ffffffffffffffff811115613a6657600080fd5b613a72858286016136db565b9150509250929050565b60008060408385031215613a8f57600080fd5b6000613a9d85828601613705565b9250506020613aae85828601613705565b9150509250929050565b600080600080600060a08688031215613ad057600080fd5b6000613ade88828901613705565b9550506020613aef88828901613705565b9450506040613b0088828901613705565b9350506060613b118882890161365d565b925050608086013567ffffffffffffffff811115613b2e57600080fd5b613b3a888289016136db565b9150509295509295909350565b613b5081615081565b82525050565b613b5f81615093565b82525050565b6000613b7082614f29565b613b7a8185614f3f565b9350613b8a818560208601615104565b613b9381615225565b840191505092915050565b6000613ba982614f34565b613bb38185614f50565b9350613bc3818560208601615104565b613bcc81615225565b840191505092915050565b6000613be282614f34565b613bec8185614f61565b9350613bfc818560208601615104565b80840191505092915050565b60008154613c1581615137565b613c1f8186614f61565b94506001821660008114613c3a5760018114613c4b57613c7e565b60ff19831686528186019350613c7e565b613c5485614f14565b60005b83811015613c7657815481890152600182019150602081019050613c57565b838801955050505b50505092915050565b6000613c94601583614f50565b91507f696e76616c6964206f776e6572206164647265737300000000000000000000006000830152602082019050919050565b6000613cd4602b83614f50565b91507f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008301527f74206f6620626f756e64730000000000000000000000000000000000000000006020830152604082019050919050565b6000613d3a603283614f50565b91507f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008301527f63656976657220696d706c656d656e74657200000000000000000000000000006020830152604082019050919050565b6000613da0603183614f50565b91507f455243323938313a20717565727920726f79616c747920696e666f20666f722060008301527f6e6f6e6578697374656e7420746f6b656e0000000000000000000000000000006020830152604082019050919050565b6000613e06604783614f50565b91507f617274776f726b2065646974696f6e2073697a6520657863656564732074686560008301527f206d6178696d756d2065646974696f6e2073697a65206f66207468652065786860208301527f69626974696f6e000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613e92602683614f50565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613ef8601c83614f50565b91507f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006000830152602082019050919050565b6000613f38600e83614f61565b91507f2f6d657461646174612e6a736f6e0000000000000000000000000000000000006000830152600e82019050919050565b6000613f78601e83614f50565b91507f696e76616c696420726f79616c7479207061796f7574206164647265737300006000830152602082019050919050565b6000613fb8601483614f50565b91507f617274776f726b206973206e6f7420666f756e640000000000000000000000006000830152602082019050919050565b6000613ff8602483614f50565b91507f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061405e601983614f50565b91507f4552433732313a20617070726f766520746f2063616c6c6572000000000000006000830152602082019050919050565b600061409e601783614f50565b91507f6172746973742063616e206e6f7420626520656d7074790000000000000000006000830152602082019050919050565b60006140de602c83614f50565b91507f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b6000614144601683614f50565b91507f7469746c652063616e206e6f7420626520656d707479000000000000000000006000830152602082019050919050565b6000614184601c83614f50565b91507f617274776f726b2065646974696f6e206973206e6f7420666f756e64000000006000830152602082019050919050565b60006141c4603883614f50565b91507f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008301527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006020830152604082019050919050565b600061422a602a83614f50565b91507f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008301527f726f2061646472657373000000000000000000000000000000000000000000006020830152604082019050919050565b6000614290602983614f50565b91507f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008301527f656e7420746f6b656e00000000000000000000000000000000000000000000006020830152604082019050919050565b60006142f6601783614f50565b91507f7468652065646974696f6e206973206578697374656e740000000000000000006000830152602082019050919050565b6000614336602083614f50565b91507f4552433732313a206d696e7420746f20746865207a65726f20616464726573736000830152602082019050919050565b6000614376602c83614f50565b91507f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b60006143dc602083614f50565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b600061441c602983614f50565b91507f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008301527f73206e6f74206f776e00000000000000000000000000000000000000000000006020830152604082019050919050565b6000614482603b83614f50565b91507f616e20617274776f726b2077697468207468652073616d652066696e6765727060008301527f72696e742068617320616c7265616479207265676973746572656400000000006020830152604082019050919050565b60006144e8602f83614f50565b91507f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008301527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006020830152604082019050919050565b600061454e603583614f50565b91507f65646974696f6e206e756d62657220657863656564207468652065646974696f60008301527f6e2073697a65206f662074686520617274776f726b00000000000000000000006020830152604082019050919050565b60006145b4601983614f50565b91507f6269746d61726b206964206861732072656769737465726564000000000000006000830152602082019050919050565b60006145f4602183614f50565b91507f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008301527f72000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061465a603183614f50565b91507f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008301527f776e6572206e6f7220617070726f7665640000000000000000000000000000006020830152604082019050919050565b60006146c0602c83614f50565b91507f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008301527f7574206f6620626f756e647300000000000000000000000000000000000000006020830152604082019050919050565b6000614726602483614f50565b91507f617274776f726b733a20676c6f62616c20696e646578206f7574206f6620626f60008301527f756e6473000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061478c601c83614f50565b91507f66696e6765727072696e742063616e206e6f7420626520656d707479000000006000830152602082019050919050565b60006147cc601683614f50565b91507f69706673206964206861732072656769737465726564000000000000000000006000830152602082019050919050565b600061480c602383614f50565b91507f65646974696f6e2073697a65206e6565647320746f206265206174206c65617360008301527f74203100000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b61486e816150eb565b82525050565b60006148808284613bd7565b915081905092915050565b60006148978285613bd7565b91506148a38284613c08565b91506148ae82613f2b565b91508190509392505050565b60006148c68284613c08565b915081905092915050565b60006020820190506148e66000830184613b47565b92915050565b60006080820190506149016000830187613b47565b61490e6020830186613b47565b61491b6040830185614865565b818103606083015261492d8184613b65565b905095945050505050565b600060408201905061494d6000830185613b47565b61495a6020830184614865565b9392505050565b60006020820190506149766000830184613b56565b92915050565b600060208201905081810360008301526149968184613b9e565b905092915050565b600060808201905081810360008301526149b88187613b9e565b905081810360208301526149cc8186613b9e565b905081810360408301526149e08185613b9e565b90506149ef6060830184614865565b95945050505050565b60006020820190508181036000830152614a1181613c87565b9050919050565b60006020820190508181036000830152614a3181613cc7565b9050919050565b60006020820190508181036000830152614a5181613d2d565b9050919050565b60006020820190508181036000830152614a7181613d93565b9050919050565b60006020820190508181036000830152614a9181613df9565b9050919050565b60006020820190508181036000830152614ab181613e85565b9050919050565b60006020820190508181036000830152614ad181613eeb565b9050919050565b60006020820190508181036000830152614af181613f6b565b9050919050565b60006020820190508181036000830152614b1181613fab565b9050919050565b60006020820190508181036000830152614b3181613feb565b9050919050565b60006020820190508181036000830152614b5181614051565b9050919050565b60006020820190508181036000830152614b7181614091565b9050919050565b60006020820190508181036000830152614b91816140d1565b9050919050565b60006020820190508181036000830152614bb181614137565b9050919050565b60006020820190508181036000830152614bd181614177565b9050919050565b60006020820190508181036000830152614bf1816141b7565b9050919050565b60006020820190508181036000830152614c118161421d565b9050919050565b60006020820190508181036000830152614c3181614283565b9050919050565b60006020820190508181036000830152614c51816142e9565b9050919050565b60006020820190508181036000830152614c7181614329565b9050919050565b60006020820190508181036000830152614c9181614369565b9050919050565b60006020820190508181036000830152614cb1816143cf565b9050919050565b60006020820190508181036000830152614cd18161440f565b9050919050565b60006020820190508181036000830152614cf181614475565b9050919050565b60006020820190508181036000830152614d11816144db565b9050919050565b60006020820190508181036000830152614d3181614541565b9050919050565b60006020820190508181036000830152614d51816145a7565b9050919050565b60006020820190508181036000830152614d71816145e7565b9050919050565b60006020820190508181036000830152614d918161464d565b9050919050565b60006020820190508181036000830152614db1816146b3565b9050919050565b60006020820190508181036000830152614dd181614719565b9050919050565b60006020820190508181036000830152614df18161477f565b9050919050565b60006020820190508181036000830152614e11816147bf565b9050919050565b60006020820190508181036000830152614e31816147ff565b9050919050565b6000602082019050614e4d6000830184614865565b92915050565b6000604082019050614e686000830185614865565b8181036020830152614e7a8184613b9e565b90509392505050565b6000604051905081810181811067ffffffffffffffff82111715614eaa57614ea96151f6565b5b8060405250919050565b600067ffffffffffffffff821115614ecf57614ece6151f6565b5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115614eff57614efe6151f6565b5b601f19601f8301169050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000614f77826150eb565b9150614f82836150eb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614fb757614fb6615169565b5b828201905092915050565b6000614fcd826150eb565b9150614fd8836150eb565b925082614fe857614fe7615198565b5b828204905092915050565b6000614ffe826150eb565b9150615009836150eb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561504257615041615169565b5b828202905092915050565b6000615058826150eb565b9150615063836150eb565b92508282101561507657615075615169565b5b828203905092915050565b600061508c826150cb565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015615122578082015181840152602081019050615107565b83811115615131576000848401525b50505050565b6000600282049050600182168061514f57607f821691505b60208210811415615163576151626151c7565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b61523f81615081565b811461524a57600080fd5b50565b61525681615093565b811461526157600080fd5b50565b61526d8161509f565b811461527857600080fd5b50565b615284816150eb565b811461528f57600080fd5b5056fea26469706673582212201777040940f2ca923b2e178d0dae1411a802480a62ad5a4b19bf602f7a605ee064736f6c63430008000033
Verified Source Code Partial Match
Compiler: v0.8.0+commit.c7dfd78e
EVM: istanbul
Optimization: No
FeralfileExhibitionV2.sol 1754 lines
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
pragma solidity ^0.8.0;
/**
* @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`, 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 Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId)
external
view
returns (address operator);
/**
* @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 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);
/**
* @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;
}
// File: @openzeppelin/contracts/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 `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
pragma solidity ^0.8.0;
/**
* @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);
}
// File: @openzeppelin/contracts/utils/Address.sol
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(
address(this).balance >= amount,
"Address: insufficient balance"
);
(bool success, ) = recipient.call{value: amount}("");
require(
success,
"Address: unable to send value, recipient may have reverted"
);
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data)
internal
returns (bytes memory)
{
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return
functionCallWithValue(
target,
data,
value,
"Address: low-level call with value failed"
);
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(
address(this).balance >= value,
"Address: insufficient balance for call"
);
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(
data
);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data)
internal
view
returns (bytes memory)
{
return
functionStaticCall(
target,
data,
"Address: low-level static call failed"
);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data)
internal
returns (bytes memory)
{
return
functionDelegateCall(
target,
data,
"Address: low-level delegate call failed"
);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/utils/Context.sol
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length)
internal
pure
returns (string memory)
{
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
pragma solidity ^0.8.0;
/**
* @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: balance query for the zero address"
);
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: owner query for nonexistent token"
);
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)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
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 overriden 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 owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
require(
_exists(tokenId),
"ERC721: approved query for nonexistent token"
);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_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: transfer caller is not 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: transfer caller is not 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)
{
require(
_exists(tokenId),
"ERC721: operator query for nonexistent token"
);
address owner = ERC721.ownerOf(tokenId);
return (spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, 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);
}
/**
* @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);
}
/**
* @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 of token that is not own"
);
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);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @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 {
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 {}
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index)
external
view
returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
pragma solidity ^0.8.0;
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, ERC721)
returns (bool)
{
return
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
virtual
override
returns (uint256)
{
require(
index < ERC721.balanceOf(owner),
"ERC721Enumerable: owner index out of bounds"
);
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index)
public
view
virtual
override
returns (uint256)
{
require(
index < ERC721Enumerable.totalSupply(),
"ERC721Enumerable: global index out of bounds"
);
return _allTokens[index];
}
/**
* @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` cannot be the zero address.
* - `to` cannot be the zero address.
*
* 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 override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId)
private
{
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
// File: @openzeppelin/contracts/interfaces/IERC165.sol
pragma solidity ^0.8.0;
// File: @openzeppelin/contracts/interfaces/IERC2981.sol
pragma solidity ^0.8.0;
/**
* @dev Interface for the NFT Royalty Standard
*/
interface IERC2981 is IERC165 {
/**
* @dev Called with the sale price to determine how much royalty is owed and to whom.
* @param tokenId - the NFT asset queried for royalty information
* @param salePrice - the sale price of the NFT asset specified by `tokenId`
* @return receiver - address of who should be sent the royalty payment
* @return royaltyAmount - the royalty payment amount for `salePrice`
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_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 {
_setOwner(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"
);
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: contracts/Authorizable.sol
pragma solidity >=0.4.22 <0.9.0;
contract Authorizable is Ownable {
address public trustee;
constructor() {
trustee = address(0x0);
}
modifier onlyAuthorized() {
require(msg.sender == trustee || msg.sender == owner());
_;
}
function setTrustee(address _newTrustee) public onlyOwner {
trustee = _newTrustee;
}
}
// File: contracts/FeralfileArtworkV2.sol
pragma solidity ^0.8.0;
contract FeralfileExhibitionV2 is ERC721Enumerable, Authorizable, IERC2981 {
using Strings for uint256;
// royalty payout address
address public royaltyPayoutAddress;
// The maximum limit of edition size for each exhibitions
uint256 public immutable maxEditionPerArtwork;
// the basis points of royalty payments for each secondary sales
uint256 public immutable secondarySaleRoyaltyBPS;
// the maximum basis points of royalty payments
uint256 public constant MAX_ROYALITY_BPS = 100_00;
// token base URI
string private _tokenBaseURI;
// contract URI
string private _contractURI;
/// @notice A structure for Feral File artwork
struct Artwork {
string title;
string artistName;
string fingerprint;
uint256 editionSize;
}
struct ArtworkEdition {
uint256 editionID;
string ipfsCID;
}
uint256[] private _allArtworks;
mapping(uint256 => Artwork) public artworks; // artworkID => Artwork
mapping(uint256 => ArtworkEdition) public artworkEditions; // artworkEditionID => ArtworkEdition
mapping(uint256 => uint256[]) internal allArtworkEditions; // artworkID => []ArtworkEditionID
mapping(uint256 => bool) internal registeredBitmarks; // bitmarkID => bool
mapping(string => bool) internal registeredIPFSCIDs; // ipfsCID => bool
constructor(
string memory name_,
string memory symbol_,
uint256 maxEditionPerArtwork_,
uint256 secondarySaleRoyaltyBPS_,
address royaltyPayoutAddress_,
string memory contractURI_,
string memory tokenBaseURI_
) ERC721(name_, symbol_) {
require(
maxEditionPerArtwork_ > 0,
"maxEdition of each artwork in an exhibition needs to be greater than zero"
);
require(
secondarySaleRoyaltyBPS_ <= MAX_ROYALITY_BPS,
"royalty BPS for secondary sales can not be greater than the maximum royalty BPS"
);
require(
royaltyPayoutAddress_ != address(0),
"invalid royalty payout address"
);
maxEditionPerArtwork = maxEditionPerArtwork_;
secondarySaleRoyaltyBPS = secondarySaleRoyaltyBPS_;
royaltyPayoutAddress = royaltyPayoutAddress_;
_contractURI = contractURI_;
_tokenBaseURI = tokenBaseURI_;
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721Enumerable, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/// @notice Call to create an artwork in the exhibition
/// @param fingerprint - the fingerprint of an artwork
/// @param title - the title of an artwork
/// @param artistName - the artist of an artwork
/// @param editionSize - the maximum edition size of an artwork
function createArtwork(
string memory fingerprint,
string memory title,
string memory artistName,
uint256 editionSize
) external onlyAuthorized {
require(bytes(title).length != 0, "title can not be empty");
require(bytes(artistName).length != 0, "artist can not be empty");
require(bytes(fingerprint).length != 0, "fingerprint can not be empty");
require(editionSize > 0, "edition size needs to be at least 1");
r...
// [truncated — 56917 bytes total]
Read Contract
MAX_ROYALITY_BPS 0xec9cbb44 → uint256
artworkEditions 0x62fe2131 → uint256, string
artworks 0x4b602673 → string, string, string, uint256
balanceOf 0x70a08231 → uint256
contractURI 0xe8a3d485 → string
getApproved 0x081812fc → address
getArtworkByIndex 0xb4883703 → uint256
getArtworkEditionByIndex 0x641b18e9 → uint256
isApprovedForAll 0xe985e9c5 → bool
maxEditionPerArtwork 0x84ad61af → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
royaltyInfo 0x2a55205a → address, uint256
royaltyPayoutAddress 0x3f6805ba → address
secondarySaleRoyaltyBPS 0xea211d7c → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalArtworks 0xe4a233e1 → uint256
totalEditionOfArtwork 0xfe2a3bf3 → uint256
totalSupply 0x18160ddd → uint256
trustee 0xfdf97cb2 → address
Write Contract 13 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
createArtwork 0x3afb021a
string fingerprint
string title
string artistName
uint256 editionSize
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
setRoyaltyPayoutAddress 0x45aeefde
address royaltyPayoutAddress_
setTokenBaseURI 0x8ef79e91
string baseURI_
setTrustee 0xd0d1ea70
address _newTrustee
swapArtworkFromBitmark 0x7f34c0dd
uint256 artworkID
uint256 bitmarkID
uint256 editionNumber
address owner
string ipfsCID
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
updateArtworkEditionIPFSCid 0x0cfcb5f1
uint256 tokenId
string ipfsCID
Recent Transactions
No transactions found for this address