Address Contract Verified
Address
0x07Ce82f414A42D9A73B0bD9EC23c249d446A0109
Balance
0 ETH
Nonce
1
Code Size
22839 bytes
Creator
0x93E4d56B...463e at tx 0xc1330cfa...6d6ca7
Indexed Transactions
0
Contract Bytecode
22839 bytes
0x608060405234801561001057600080fd5b506004361061028a5760003560e01c806370a082311161015c578063c87b56dd116100ce578063e58306f911610087578063e58306f91461077a578063e985e9c514610796578063ec52634b146107c6578063f2fde38b146107e4578063f4a0a52814610800578063fca76c261461081c5761028a565b8063c87b56dd146106a8578063c884ef83146106d8578063cac9266914610708578063d5abeb0114610724578063e1c4c02914610742578063e268e4d31461075e5761028a565b806395d89b411161012057806395d89b41146105fa578063a22cb46514610618578063abcbf52c14610634578063ae05c6f114610652578063b88d4fde14610670578063ba41b0c61461068c5761028a565b806370a0823114610568578063715018a6146105985780637c382d0b146105a25780638da5cb5b146105be578063943eb504146105dc5761028a565b8063368b7b161161020057806355a40dab116101b957806355a40dab146104a45780635c975abb146104c25780636352211e146104e05780636817c76c146105105780636c0360eb1461052e5780636f8b44b01461054c5761028a565b8063368b7b16146104085780633ccfd60b1461042657806342842e0e1461043057806342966c681461044c578063453c23101461046857806345766929146104865761028a565b806314d350431161025257806314d350431461034557806316c38b3c1461036357806318160ddd1461037f5780631ce97fd11461039d57806323b872dd146103bb5780632a55205a146103d75761028a565b806301ffc9a71461028f57806302fe5305146102bf57806306fdde03146102db578063081812fc146102f9578063095ea7b314610329575b600080fd5b6102a960048036038101906102a49190613706565b610826565b6040516102b6919061374e565b60405180910390f35b6102d960048036038101906102d491906138af565b6108a0565b005b6102e36108f5565b6040516102f09190613977565b60405180910390f35b610313600480360381019061030e91906139cf565b610987565b6040516103209190613a3d565b60405180910390f35b610343600480360381019061033e9190613a84565b6109cd565b005b61034d610ae4565b60405161035a9190613add565b60405180910390f35b61037d60048036038101906103789190613b24565b610b35565b005b610387610b5c565b6040516103949190613b60565b60405180910390f35b6103a5610b62565b6040516103b29190613b60565b60405180910390f35b6103d560048036038101906103d09190613b7b565b610ca2565b005b6103f160048036038101906103ec9190613bce565b610d02565b6040516103ff929190613c0e565b60405180910390f35b610410610eec565b60405161041d9190613add565b60405180910390f35b61042e610ef2565b005b61044a60048036038101906104459190613b7b565b611024565b005b610466600480360381019061046191906139cf565b611044565b005b6104706110a0565b60405161047d9190613b60565b60405180910390f35b61048e6110a6565b60405161049b9190613add565b60405180910390f35b6104ac6110ac565b6040516104b99190613add565b60405180910390f35b6104ca6110b2565b6040516104d7919061374e565b60405180910390f35b6104fa60048036038101906104f591906139cf565b6110c9565b6040516105079190613a3d565b60405180910390f35b61051861117a565b6040516105259190613b60565b60405180910390f35b610536611180565b6040516105439190613977565b60405180910390f35b610566600480360381019061056191906139cf565b61120e565b005b610582600480360381019061057d9190613c37565b611303565b60405161058f9190613b60565b60405180910390f35b6105a06113ba565b005b6105bc60048036038101906105b79190613c90565b6113ce565b005b6105c661151b565b6040516105d39190613a3d565b60405180910390f35b6105e4611545565b6040516105f1919061374e565b60405180910390f35b610602611558565b60405161060f9190613977565b60405180910390f35b610632600480360381019061062d9190613cd0565b6115ea565b005b61063c611600565b6040516106499190613d3b565b60405180910390f35b61065a611620565b6040516106679190613d3b565b60405180910390f35b61068a60048036038101906106859190613df7565b611642565b005b6106a660048036038101906106a19190613eda565b6116a4565b005b6106c260048036038101906106bd91906139cf565b6119e2565b6040516106cf9190613977565b60405180910390f35b6106f260048036038101906106ed9190613c37565b611a4b565b6040516106ff9190613b60565b60405180910390f35b610722600480360381019061071d9190613f7e565b611a63565b005b61072c611b09565b6040516107399190613b60565b60405180910390f35b61075c60048036038101906107579190613fd7565b611b0f565b005b610778600480360381019061077391906139cf565b611cb6565b005b610794600480360381019061078f9190613a84565b611d03565b005b6107b060048036038101906107ab919061402a565b611df8565b6040516107bd919061374e565b60405180910390f35b6107ce611e8c565b6040516107db9190613d3b565b60405180910390f35b6107fe60048036038101906107f99190613c37565b611eae565b005b61081a600480360381019061081591906139cf565b611f31565b005b610824611f7e565b005b60007f2baae9fd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610899575061089882611ff2565b5b9050919050565b6108a861206c565b7feb0ff494c0855e7c27233e02cb7987f997be6005d24b09af504d00f2e349c8916009826040516108da929190614163565b60405180910390a180600990816108f19190614331565b5050565b60606000805461090490614099565b80601f016020809104026020016040519081016040528092919081815260200182805461093090614099565b801561097d5780601f106109525761010080835404028352916020019161097d565b820191906000526020600020905b81548152906001019060200180831161096057829003601f168201915b5050505050905090565b6000610992826120ea565b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006109d8826110c9565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3f90614475565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610a67612135565b73ffffffffffffffffffffffffffffffffffffffff161480610a965750610a9581610a90612135565b611df8565b5b610ad5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acc90614507565b60405180910390fd5b610adf838361213d565b505050565b600080610aef610b62565b905060018103610b0457601154915050610b32565b60028103610b1757601254915050610b32565b60038103610b2a57601354915050610b32565b6000801b9150505b90565b610b3d61206c565b8015610b5057610b4b6121f6565b610b59565b610b58612259565b5b50565b60145481565b6000600f60019054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff164210158015610bd35750601060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1642105b15610be15760019050610c9f565b601060009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff164210158015610c4e575060108054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1642105b15610c5c5760029050610c9f565b60108054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff164210610c9a5760039050610c9f565b600090505b90565b610cb3610cad612135565b826122bc565b610cf2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce990614599565b60405180910390fd5b610cfd838383612351565b505050565b6000806000600760008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1603610e975760066040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b6000610ea16125b7565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff1686610ecd91906145e8565b610ed79190614659565b90508160000151819350935050509250929050565b60115481565b610efa61206c565b60007f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610f559190613a3d565b602060405180830381865afa158015610f72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f96919061469f565b9050610fea610fa361151b565b827f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166125c19092919063ffffffff16565b7f4e70a604b23a8edee2b1d0a656e9b9c00b73ad8bb1afc2c59381ee9f69197de7816040516110199190613b60565b60405180910390a150565b61103f83838360405180602001604052806000815250611642565b505050565b61105561104f612135565b826122bc565b611094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108b9061473e565b60405180910390fd5b61109d81612647565b50565b600d5481565b60135481565b60125481565b6000600860149054906101000a900460ff16905090565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611171576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611168906147aa565b60405180910390fd5b80915050919050565b600c5481565b6009805461118d90614099565b80601f01602080910402602001604051908101604052809291908181526020018280546111b990614099565b80156112065780601f106111db57610100808354040283529160200191611206565b820191906000526020600020905b8154815290600101906020018083116111e957829003601f168201915b505050505081565b61121661206c565b600f60009054906101000a900460ff1615611266576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125d90614816565b60405180910390fd5b6001611272600b612664565b61127c9190614836565b8110156112be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b5906148b6565b60405180910390fd5b7f904452cc27e87db7e7bf1a4675be33b6106fcd0a3fb8068baac864c2b38ac4a4600e54826040516112f19291906148d6565b60405180910390a180600e8190555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136a90614971565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6113c261206c565b6113cc6000612672565b565b6113d661206c565b6000811180156113e7575060038111155b611426576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141d906149dd565b60405180910390fd5b600181036114775760017fe37a76f4fa1f705d7df386b4190189a01cbf8b19a9946049aeda120b1ea909a9601154846040516114639291906149fd565b60405180910390a281601181905550611517565b600281036114c85760027fe37a76f4fa1f705d7df386b4190189a01cbf8b19a9946049aeda120b1ea909a9601254846040516114b49291906149fd565b60405180910390a281601281905550611516565b600381036115155760037fe37a76f4fa1f705d7df386b4190189a01cbf8b19a9946049aeda120b1ea909a9601354846040516115059291906149fd565b60405180910390a2816013819055505b5b5b5050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600f60009054906101000a900460ff1681565b60606001805461156790614099565b80601f016020809104026020016040519081016040528092919081815260200182805461159390614099565b80156115e05780601f106115b5576101008083540402835291602001916115e0565b820191906000526020600020905b8154815290600101906020018083116115c357829003601f168201915b5050505050905090565b6115fc6115f5612135565b8383612738565b5050565b60108054906101000a90046fffffffffffffffffffffffffffffffff1681565b601060009054906101000a90046fffffffffffffffffffffffffffffffff1681565b61165361164d612135565b836122bc565b611692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168990614599565b60405180910390fd5b61169e848484846128a4565b50505050565b6116ac612900565b600083116116ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e690614a72565b60405180910390fd5b600d5483600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173d9190614a92565b111561177e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177590614b12565b60405180910390fd5b6001600e5461178d9190614a92565b83611798600b612664565b6117a29190614a92565b11156117e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117da90614b7e565b60405180910390fd5b61183d333085600c546117f691906145e8565b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1661294a909392919063ffffffff16565b6000336040516020016118509190614be6565b6040516020818303038152906040528051906020012090506000611872610ae4565b90506000801b81036118b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b090614c4d565b60405180910390fd5b611905848480806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505082846129d3565b611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90614cb9565b60405180910390fd5b84600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546119939190614a92565b925050819055506000805b868110156119d9576119b0600b612664565b91506119bc600b611fdc565b6119c633836129ea565b80806119d190614cd9565b91505061199e565b50505050505050565b60606119ed826120ea565b6000600980546119fc90614099565b905011611a185760405180602001604052806000815250611a44565b6009611a2383612a08565b604051602001611a34929190614e2c565b6040516020818303038152906040525b9050919050565b600a6020528060005260406000206000915090505481565b611a6b61206c565b6103e8816bffffffffffffffffffffffff161115611abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab590614ea7565b60405180910390fd5b611acf611ac961151b565b82612b68565b7f3cf4fec9aae458c3a169ef0c25423c15fbfc6175238fa756786f345d9d9fdbc981604051611afe9190614ed6565b60405180910390a150565b600e5481565b611b1761206c565b816fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610158015611b6f5750826fffffffffffffffffffffffffffffffff16826fffffffffffffffffffffffffffffffff1610155b8015611b8d575042836fffffffffffffffffffffffffffffffff1610155b611bcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc390614f3d565b60405180910390fd5b82600f60016101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555081601060006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550806010806101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055507f256137935a6b27b03df14d87db512ea66776f482bc9dbe9e996e318f66095f5e838383604051611ca993929190614f5d565b60405180910390a1505050565b611cbe61206c565b7f91d83d678e463f3bd36117413cec5e4cd93c2b7688234e854c4b662fb7fc493b600d5482604051611cf19291906148d6565b60405180910390a180600d8190555050565b611d0b61206c565b60008111611d4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4590614a72565b60405180910390fd5b6001600e54611d5d9190614a92565b81611d68600b612664565b611d729190614a92565b1115611db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611daa90614b7e565b60405180910390fd5b6000805b82811015611df257611dc9600b612664565b9150611dd5600b611fdc565b611ddf84836129ea565b8080611dea90614cd9565b915050611db7565b50505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600f60019054906101000a90046fffffffffffffffffffffffffffffffff1681565b611eb661206c565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611f25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1c90615006565b60405180910390fd5b611f2e81612672565b50565b611f3961206c565b7f28b518248e075f614060b16a7568fe9b127ed22af6667aafeeb74c74fda7ac75600c5482604051611f6c9291906148d6565b60405180910390a180600c8190555050565b611f8661206c565b6001600f60006101000a81548160ff0219169083151502179055507fdaa3683bdce5fe06df7271dd5b157d795bd8d9cb1198428dd9c11e243114a5c8600e54604051611fd29190613b60565b60405180910390a1565b6001816000016000828254019250508190555050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612065575061206482612cfd565b5b9050919050565b612074612135565b73ffffffffffffffffffffffffffffffffffffffff1661209261151b565b73ffffffffffffffffffffffffffffffffffffffff16146120e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120df90615072565b60405180910390fd5b565b6120f381612ddf565b612132576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612129906147aa565b60405180910390fd5b50565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166121b0836110c9565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6121fe612900565b6001600860146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612242612135565b60405161224f9190613a3d565b60405180910390a1565b612261612e4b565b6000600860146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6122a5612135565b6040516122b29190613a3d565b60405180910390a1565b6000806122c8836110c9565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061230a57506123098185611df8565b5b8061234857508373ffffffffffffffffffffffffffffffffffffffff1661233084610987565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612371826110c9565b73ffffffffffffffffffffffffffffffffffffffff16146123c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123be90615104565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612436576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242d90615196565b60405180910390fd5b612441838383612e94565b61244c60008261213d565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461249c9190614836565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546124f39190614a92565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46125b2838383612e99565b505050565b6000612710905090565b6126428363a9059cbb60e01b84846040516024016125e0929190613c0e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e9e565b505050565b61265081612f65565b601460008154600190039190508190555050565b600081600001549050919050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036127a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279d90615202565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612897919061374e565b60405180910390a3505050565b6128af848484612351565b6128bb84848484613082565b6128fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128f190615294565b60405180910390fd5b50505050565b6129086110b2565b15612948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161293f90615300565b60405180910390fd5b565b6129cd846323b872dd60e01b85858560405160240161296b93929190615320565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e9e565b50505050565b6000826129e08584613209565b1490509392505050565b6129f4828261325f565b601460008154600101919050819055505050565b606060008203612a4f576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612b63565b600082905060005b60008214612a81578080612a6a90614cd9565b915050600a82612a7a9190614659565b9150612a57565b60008167ffffffffffffffff811115612a9d57612a9c613784565b5b6040519080825280601f01601f191660200182016040528015612acf5781602001600182028036833780820191505090505b5090505b60008514612b5c57600182612ae89190614836565b9150600a85612af79190615357565b6030612b039190614a92565b60f81b818381518110612b1957612b18615388565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612b559190614659565b9450612ad3565b8093505050505b919050565b612b706125b7565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff161115612bce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bc590615429565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612c3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c3490615495565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff16815250600660008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055509050505050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612dc857507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612dd85750612dd782613438565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b612e536110b2565b612e92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e8990615501565b60405180910390fd5b565b505050565b505050565b6000612f00826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166134a29092919063ffffffff16565b9050600081511115612f605780806020019051810190612f209190615536565b612f5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f56906155d5565b60405180910390fd5b5b505050565b6000612f70826110c9565b9050612f7e81600084612e94565b612f8960008361213d565b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612fd99190614836565b925050819055506002600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461307e81600084612e99565b5050565b60006130a38473ffffffffffffffffffffffffffffffffffffffff166134ba565b156131fc578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026130cc612135565b8786866040518563ffffffff1660e01b81526004016130ee949392919061564a565b6020604051808303816000875af192505050801561312a57506040513d601f19601f8201168201806040525081019061312791906156ab565b60015b6131ac573d806000811461315a576040519150601f19603f3d011682016040523d82523d6000602084013e61315f565b606091505b5060008151036131a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161319b90615294565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613201565b600190505b949350505050565b60008082905060005b84518110156132545761323f8286838151811061323257613231615388565b5b60200260200101516134dd565b9150808061324c90614cd9565b915050613212565b508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036132ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132c590615724565b60405180910390fd5b6132d781612ddf565b15613317576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161330e90615790565b60405180910390fd5b61332360008383612e94565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546133739190614a92565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461343460008383612e99565b5050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60606134b18484600085613508565b90509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008183106134f5576134f0828461361c565b613500565b6134ff838361361c565b5b905092915050565b60608247101561354d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161354490615822565b60405180910390fd5b613556856134ba565b613595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161358c9061588e565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516135be91906158ea565b60006040518083038185875af1925050503d80600081146135fb576040519150601f19603f3d011682016040523d82523d6000602084013e613600565b606091505b5091509150613610828286613633565b92505050949350505050565b600082600052816020526040600020905092915050565b6060831561364357829050613693565b6000835111156136565782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161368a9190613977565b60405180910390fd5b9392505050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6136e3816136ae565b81146136ee57600080fd5b50565b600081359050613700816136da565b92915050565b60006020828403121561371c5761371b6136a4565b5b600061372a848285016136f1565b91505092915050565b60008115159050919050565b61374881613733565b82525050565b6000602082019050613763600083018461373f565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6137bc82613773565b810181811067ffffffffffffffff821117156137db576137da613784565b5b80604052505050565b60006137ee61369a565b90506137fa82826137b3565b919050565b600067ffffffffffffffff82111561381a57613819613784565b5b61382382613773565b9050602081019050919050565b82818337600083830152505050565b600061385261384d846137ff565b6137e4565b90508281526020810184848401111561386e5761386d61376e565b5b613879848285613830565b509392505050565b600082601f83011261389657613895613769565b5b81356138a684826020860161383f565b91505092915050565b6000602082840312156138c5576138c46136a4565b5b600082013567ffffffffffffffff8111156138e3576138e26136a9565b5b6138ef84828501613881565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613932578082015181840152602081019050613917565b60008484015250505050565b6000613949826138f8565b6139538185613903565b9350613963818560208601613914565b61396c81613773565b840191505092915050565b60006020820190508181036000830152613991818461393e565b905092915050565b6000819050919050565b6139ac81613999565b81146139b757600080fd5b50565b6000813590506139c9816139a3565b92915050565b6000602082840312156139e5576139e46136a4565b5b60006139f3848285016139ba565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613a27826139fc565b9050919050565b613a3781613a1c565b82525050565b6000602082019050613a526000830184613a2e565b92915050565b613a6181613a1c565b8114613a6c57600080fd5b50565b600081359050613a7e81613a58565b92915050565b60008060408385031215613a9b57613a9a6136a4565b5b6000613aa985828601613a6f565b9250506020613aba858286016139ba565b9150509250929050565b6000819050919050565b613ad781613ac4565b82525050565b6000602082019050613af26000830184613ace565b92915050565b613b0181613733565b8114613b0c57600080fd5b50565b600081359050613b1e81613af8565b92915050565b600060208284031215613b3a57613b396136a4565b5b6000613b4884828501613b0f565b91505092915050565b613b5a81613999565b82525050565b6000602082019050613b756000830184613b51565b92915050565b600080600060608486031215613b9457613b936136a4565b5b6000613ba286828701613a6f565b9350506020613bb386828701613a6f565b9250506040613bc4868287016139ba565b9150509250925092565b60008060408385031215613be557613be46136a4565b5b6000613bf3858286016139ba565b9250506020613c04858286016139ba565b9150509250929050565b6000604082019050613c236000830185613a2e565b613c306020830184613b51565b9392505050565b600060208284031215613c4d57613c4c6136a4565b5b6000613c5b84828501613a6f565b91505092915050565b613c6d81613ac4565b8114613c7857600080fd5b50565b600081359050613c8a81613c64565b92915050565b60008060408385031215613ca757613ca66136a4565b5b6000613cb585828601613c7b565b9250506020613cc6858286016139ba565b9150509250929050565b60008060408385031215613ce757613ce66136a4565b5b6000613cf585828601613a6f565b9250506020613d0685828601613b0f565b9150509250929050565b60006fffffffffffffffffffffffffffffffff82169050919050565b613d3581613d10565b82525050565b6000602082019050613d506000830184613d2c565b92915050565b600067ffffffffffffffff821115613d7157613d70613784565b5b613d7a82613773565b9050602081019050919050565b6000613d9a613d9584613d56565b6137e4565b905082815260208101848484011115613db657613db561376e565b5b613dc1848285613830565b509392505050565b600082601f830112613dde57613ddd613769565b5b8135613dee848260208601613d87565b91505092915050565b60008060008060808587031215613e1157613e106136a4565b5b6000613e1f87828801613a6f565b9450506020613e3087828801613a6f565b9350506040613e41878288016139ba565b925050606085013567ffffffffffffffff811115613e6257613e616136a9565b5b613e6e87828801613dc9565b91505092959194509250565b600080fd5b600080fd5b60008083601f840112613e9a57613e99613769565b5b8235905067ffffffffffffffff811115613eb757613eb6613e7a565b5b602083019150836020820283011115613ed357613ed2613e7f565b5b9250929050565b600080600060408486031215613ef357613ef26136a4565b5b6000613f01868287016139ba565b935050602084013567ffffffffffffffff811115613f2257613f216136a9565b5b613f2e86828701613e84565b92509250509250925092565b60006bffffffffffffffffffffffff82169050919050565b613f5b81613f3a565b8114613f6657600080fd5b50565b600081359050613f7881613f52565b92915050565b600060208284031215613f9457613f936136a4565b5b6000613fa284828501613f69565b91505092915050565b613fb481613d10565b8114613fbf57600080fd5b50565b600081359050613fd181613fab565b92915050565b600080600060608486031215613ff057613fef6136a4565b5b6000613ffe86828701613fc2565b935050602061400f86828701613fc2565b925050604061402086828701613fc2565b9150509250925092565b60008060408385031215614041576140406136a4565b5b600061404f85828601613a6f565b925050602061406085828601613a6f565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806140b157607f821691505b6020821081036140c4576140c361406a565b5b50919050565b60008190508160005260206000209050919050565b600081546140ec81614099565b6140f68186613903565b9450600182166000811461411157600181146141275761415a565b60ff19831686528115156020028601935061415a565b614130856140ca565b60005b8381101561415257815481890152600182019150602081019050614133565b808801955050505b50505092915050565b6000604082019050818103600083015261417d81856140df565b90508181036020830152614191818461393e565b90509392505050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026141e77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826141aa565b6141f186836141aa565b95508019841693508086168417925050509392505050565b6000819050919050565b600061422e61422961422484613999565b614209565b613999565b9050919050565b6000819050919050565b61424883614213565b61425c61425482614235565b8484546141b7565b825550505050565b600090565b614271614264565b61427c81848461423f565b505050565b5b818110156142a057614295600082614269565b600181019050614282565b5050565b601f8211156142e5576142b6816140ca565b6142bf8461419a565b810160208510156142ce578190505b6142e26142da8561419a565b830182614281565b50505b505050565b600082821c905092915050565b6000614308600019846008026142ea565b1980831691505092915050565b600061432183836142f7565b9150826002028217905092915050565b61433a826138f8565b67ffffffffffffffff81111561435357614352613784565b5b61435d8254614099565b6143688282856142a4565b600060209050601f83116001811461439b5760008415614389578287015190505b6143938582614315565b8655506143fb565b601f1984166143a9866140ca565b60005b828110156143d1578489015182556001820191506020850194506020810190506143ac565b868310156143ee57848901516143ea601f8916826142f7565b8355505b6001600288020188555050505b505050505050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061445f602183613903565b915061446a82614403565b604082019050919050565b6000602082019050818103600083015261448e81614452565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000602082015250565b60006144f1603e83613903565b91506144fc82614495565b604082019050919050565b60006020820190508181036000830152614520816144e4565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206e6f7220617070726f766564000000000000000000000000000000000000602082015250565b6000614583602e83613903565b915061458e82614527565b604082019050919050565b600060208201905081810360008301526145b281614576565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006145f382613999565b91506145fe83613999565b925082820261460c81613999565b91508282048414831517614623576146226145b9565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061466482613999565b915061466f83613999565b92508261467f5761467e61462a565b5b828204905092915050565b600081519050614699816139a3565b92915050565b6000602082840312156146b5576146b46136a4565b5b60006146c38482850161468a565b91505092915050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b6000614728602d83613903565b9150614733826146cc565b604082019050919050565b600060208201905081810360008301526147578161471b565b9050919050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b6000614794601883613903565b915061479f8261475e565b602082019050919050565b600060208201905081810360008301526147c381614787565b9050919050565b7f4c6f636b65640000000000000000000000000000000000000000000000000000600082015250565b6000614800600683613903565b915061480b826147ca565b602082019050919050565b6000602082019050818103600083015261482f816147f3565b9050919050565b600061484182613999565b915061484c83613999565b9250828203905081811115614864576148636145b9565b5b92915050565b7f21737570706c7900000000000000000000000000000000000000000000000000600082015250565b60006148a0600783613903565b91506148ab8261486a565b602082019050919050565b600060208201905081810360008301526148cf81614893565b9050919050565b60006040820190506148eb6000830185613b51565b6148f86020830184613b51565b9392505050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b600061495b602983613903565b9150614966826148ff565b604082019050919050565b6000602082019050818103600083015261498a8161494e565b9050919050565b7f21706172616d0000000000000000000000000000000000000000000000000000600082015250565b60006149c7600683613903565b91506149d282614991565b602082019050919050565b600060208201905081810360008301526149f6816149ba565b9050919050565b6000604082019050614a126000830185613ace565b614a1f6020830184613ace565b9392505050565b7f217a65726f000000000000000000000000000000000000000000000000000000600082015250565b6000614a5c600583613903565b9150614a6782614a26565b602082019050919050565b60006020820190508181036000830152614a8b81614a4f565b9050919050565b6000614a9d82613999565b9150614aa883613999565b9250828201905080821115614ac057614abf6145b9565b5b92915050565b7f2171747900000000000000000000000000000000000000000000000000000000600082015250565b6000614afc600483613903565b9150614b0782614ac6565b602082019050919050565b60006020820190508181036000830152614b2b81614aef565b9050919050565b7f4d617820737570706c7900000000000000000000000000000000000000000000600082015250565b6000614b68600a83613903565b9150614b7382614b32565b602082019050919050565b60006020820190508181036000830152614b9781614b5b565b9050919050565b60008160601b9050919050565b6000614bb682614b9e565b9050919050565b6000614bc882614bab565b9050919050565b614be0614bdb82613a1c565b614bbd565b82525050565b6000614bf28284614bcf565b60148201915081905092915050565b7f2170686173650000000000000000000000000000000000000000000000000000600082015250565b6000614c37600683613903565b9150614c4282614c01565b602082019050919050565b60006020820190508181036000830152614c6681614c2a565b9050919050565b7f2170726f6f660000000000000000000000000000000000000000000000000000600082015250565b6000614ca3600683613903565b9150614cae82614c6d565b602082019050919050565b60006020820190508181036000830152614cd281614c96565b9050919050565b6000614ce482613999565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614d1657614d156145b9565b5b600182019050919050565b600081905092915050565b60008154614d3981614099565b614d438186614d21565b94506001821660008114614d5e5760018114614d7357614da6565b60ff1983168652811515820286019350614da6565b614d7c856140ca565b60005b83811015614d9e57815481890152600182019150602081019050614d7f565b838801955050505b50505092915050565b6000614dba826138f8565b614dc48185614d21565b9350614dd4818560208601613914565b80840191505092915050565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000600082015250565b6000614e16600583614d21565b9150614e2182614de0565b600582019050919050565b6000614e388285614d2c565b9150614e448284614daf565b9150614e4f82614e09565b91508190509392505050565b7f2162707300000000000000000000000000000000000000000000000000000000600082015250565b6000614e91600483613903565b9150614e9c82614e5b565b602082019050919050565b60006020820190508181036000830152614ec081614e84565b9050919050565b614ed081613f3a565b82525050565b6000602082019050614eeb6000830184614ec7565b92915050565b7f2174696d696e6700000000000000000000000000000000000000000000000000600082015250565b6000614f27600783613903565b9150614f3282614ef1565b602082019050919050565b60006020820190508181036000830152614f5681614f1a565b9050919050565b6000606082019050614f726000830186613d2c565b614f7f6020830185613d2c565b614f8c6040830184613d2c565b949350505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614ff0602683613903565b9150614ffb82614f94565b604082019050919050565b6000602082019050818103600083015261501f81614fe3565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061505c602083613903565b915061506782615026565b602082019050919050565b6000602082019050818103600083015261508b8161504f565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b60006150ee602583613903565b91506150f982615092565b604082019050919050565b6000602082019050818103600083015261511d816150e1565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615180602483613903565b915061518b82615124565b604082019050919050565b600060208201905081810360008301526151af81615173565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b60006151ec601983613903565b91506151f7826151b6565b602082019050919050565b6000602082019050818103600083015261521b816151df565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b600061527e603283613903565b915061528982615222565b604082019050919050565b600060208201905081810360008301526152ad81615271565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b60006152ea601083613903565b91506152f5826152b4565b602082019050919050565b60006020820190508181036000830152615319816152dd565b9050919050565b60006060820190506153356000830186613a2e565b6153426020830185613a2e565b61534f6040830184613b51565b949350505050565b600061536282613999565b915061536d83613999565b92508261537d5761537c61462a565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201527f2073616c65507269636500000000000000000000000000000000000000000000602082015250565b6000615413602a83613903565b915061541e826153b7565b604082019050919050565b6000602082019050818103600083015261544281615406565b9050919050565b7f455243323938313a20696e76616c696420726563656976657200000000000000600082015250565b600061547f601983613903565b915061548a82615449565b602082019050919050565b600060208201905081810360008301526154ae81615472565b9050919050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b60006154eb601483613903565b91506154f6826154b5565b602082019050919050565b6000602082019050818103600083015261551a816154de565b9050919050565b60008151905061553081613af8565b92915050565b60006020828403121561554c5761554b6136a4565b5b600061555a84828501615521565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b60006155bf602a83613903565b91506155ca82615563565b604082019050919050565b600060208201905081810360008301526155ee816155b2565b9050919050565b600081519050919050565b600082825260208201905092915050565b600061561c826155f5565b6156268185615600565b9350615636818560208601613914565b61563f81613773565b840191505092915050565b600060808201905061565f6000830187613a2e565b61566c6020830186613a2e565b6156796040830185613b51565b818103606083015261568b8184615611565b905095945050505050565b6000815190506156a5816136da565b92915050565b6000602082840312156156c1576156c06136a4565b5b60006156cf84828501615696565b91505092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b600061570e602083613903565b9150615719826156d8565b602082019050919050565b6000602082019050818103600083015261573d81615701565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b600061577a601c83613903565b915061578582615744565b602082019050919050565b600060208201905081810360008301526157a98161576d565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061580c602683613903565b9150615817826157b0565b604082019050919050565b6000602082019050818103600083015261583b816157ff565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000615878601d83613903565b915061588382615842565b602082019050919050565b600060208201905081810360008301526158a78161586b565b9050919050565b600081905092915050565b60006158c4826155f5565b6158ce81856158ae565b93506158de818560208601613914565b80840191505092915050565b60006158f682846158b9565b91508190509291505056fea2646970667358221220c3c4b4cb9e8067d3bea16d69f913bee3c2597593c91ecb7c04cba25f37dda34264736f6c63430008110033
Verified Source Code Full Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: No
IERC2981.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
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);
}
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);
}
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;
}
}
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);
}
}
}
}
ERC721Burnable.sol 26 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol)
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "../../../utils/Context.sol";
/**
* @title ERC721 Burnable Token
* @dev ERC721 Token that can be burned (destroyed).
*/
abstract contract ERC721Burnable is Context, ERC721 {
/**
* @dev Burns `tokenId`. See {ERC721-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_burn(tokenId);
}
}
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 {}
}
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;
}
}
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);
}
draft-IERC20Permit.sol 60 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
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);
}
}
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);
}
SafeERC20.sol 116 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
ArcadePass.sol 348 lines
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
/**
* >>> Join the Resistance <<<
* >>> https://nfa.gg/ <<<
* @title NonFungibleArcade Arcade Pass
* @author BowTiedPickle
*/
contract ArcadePass is ERC721, ERC721Burnable, ERC2981, Ownable, Pausable {
using Counters for Counters.Counter;
using SafeERC20 for IERC20;
using Strings for uint256;
string public baseURI;
mapping(address => uint256) public claimed;
Counters.Counter internal nextId;
uint256 public mintPrice = 250e6;
uint256 public maxPerWallet = 1;
uint256 public maxSupply = 1000;
bool public supplyLocked;
uint128 public startTime_heroes;
uint128 public startTime_arcade;
uint128 public startTime_rebels;
bytes32 public merkleRoot_heroes;
bytes32 public merkleRoot_arcade;
bytes32 public merkleRoot_rebels;
IERC20 internal immutable USDC;
/// @notice Total number of tokens in existence
uint256 public totalSupply;
/**
* @param _owner Owner address
* @param _royaltyBPS Royalty in basis points, max is 10% (1000 BPS)
* @param _merkleRoot_heroes Merkle root for Heroes phase
* @param _merkleRoot_arcade Merkle root for Arcade phase
* @param _merkleRoot_rebels Merkle root for Rebels phase
* @param _USDC Address of the USDC token proxy
* @param _startTime_heroes Start time for Heroes phase
* @param _startTime_arcade Start time for Arcade phase
* @param _startTime_rebels Start time for Rebels phase
*/
constructor(
address _owner,
uint96 _royaltyBPS,
bytes32 _merkleRoot_heroes,
bytes32 _merkleRoot_arcade,
bytes32 _merkleRoot_rebels,
address _USDC,
uint128 _startTime_heroes,
uint128 _startTime_arcade,
uint128 _startTime_rebels
) ERC721("NonFungibleArcade Arcade Pass", "NFA-PASS") {
require(_owner != address(0), "!addr");
require(_royaltyBPS <= 1000, "!bps");
_transferOwnership(_owner);
_setDefaultRoyalty(owner(), _royaltyBPS);
// Start at 1, not at 0
nextId.increment();
// Set the merkle roots
merkleRoot_heroes = _merkleRoot_heroes;
merkleRoot_arcade = _merkleRoot_arcade;
merkleRoot_rebels = _merkleRoot_rebels;
// Set timestamps
startTime_heroes = _startTime_heroes;
startTime_arcade = _startTime_arcade;
startTime_rebels = _startTime_rebels;
// Set the USDC deployment
USDC = IERC20(_USDC);
// Deploy in paused state
_pause();
}
/**
* @notice Mint an arcade pass
* @dev User must have approved this contract for the required value already
* @param _qty Quantity to mint
* @param _proof Merkle whitelist proof
*/
function mint(uint256 _qty, bytes32[] calldata _proof) external whenNotPaused {
require(_qty > 0, "!zero");
require(claimed[msg.sender] + _qty <= maxPerWallet, "!qty");
require(nextId.current() + _qty <= maxSupply + 1, "Max supply");
USDC.safeTransferFrom(msg.sender, address(this), mintPrice * _qty);
// Verify
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
bytes32 root = getActiveRoot();
require(root != 0, "!phase");
require(MerkleProof.verify(_proof, root, leaf), "!proof");
claimed[msg.sender] += _qty;
// Mint
uint256 tokenId;
for (uint256 i; i < _qty; i++) {
tokenId = nextId.current();
nextId.increment();
_mint(msg.sender, tokenId);
}
}
// ----- Admin Functions -----
/**
* @notice Permissioned mint function
* @dev Respects max supply
* @param _to Recipient address
* @param _qty Quantity to mint
*/
function adminMint(address _to, uint256 _qty) external onlyOwner {
require(_qty > 0, "!zero");
require(nextId.current() + _qty <= maxSupply + 1, "Max supply");
uint256 tokenId;
for (uint256 i; i < _qty; i++) {
tokenId = nextId.current();
nextId.increment();
_mint(_to, tokenId);
}
}
/**
* @notice Withdraw profits from the contract
*/
function withdraw() external onlyOwner {
uint256 balance = USDC.balanceOf(address(this));
USDC.safeTransfer(owner(), balance);
emit Withdrawal(balance);
}
/**
* @notice Sets a new royalty numerator
* @dev Cannot exceed 10%
* @param _royaltyBPS New royalty, denominated in BPS (10000 = 100%)
*/
function setRoyalty(uint96 _royaltyBPS) external onlyOwner {
require(_royaltyBPS <= 1000, "!bps");
_setDefaultRoyalty(owner(), _royaltyBPS);
emit NewRoyalty(_royaltyBPS);
}
/**
* @notice Set a new base URI
* @param _newURI New URI string
*/
function setURI(string memory _newURI) external onlyOwner {
emit NewURI(baseURI, _newURI);
baseURI = _newURI;
}
/**
* @notice Set a new merkle root
* @param _newRoot New whitelist merkle root
*/
function setMerkleRoot(bytes32 _newRoot, uint256 _phase) external onlyOwner {
require(_phase > 0 && _phase <= 3, "!param");
if (_phase == 1) {
emit NewRoot(1, merkleRoot_heroes, _newRoot);
merkleRoot_heroes = _newRoot;
} else if (_phase == 2) {
emit NewRoot(2, merkleRoot_arcade, _newRoot);
merkleRoot_arcade = _newRoot;
} else if (_phase == 3) {
emit NewRoot(3, merkleRoot_rebels, _newRoot);
merkleRoot_rebels = _newRoot;
}
}
/**
* @notice Set a new maximum supply
* @dev Cannot be set once supply is locked.
* @dev Cannot be set below existing total token supply.
* @param _newMax New max supply
*/
function setMaxSupply(uint256 _newMax) external onlyOwner {
require(!supplyLocked, "Locked");
require(_newMax >= nextId.current() - 1, "!supply");
emit NewMaxSupply(maxSupply, _newMax);
maxSupply = _newMax;
}
/**
* @notice Lock the maximum supply, preventing any further changes
*/
function lockMaxSupply() external onlyOwner {
supplyLocked = true;
emit SupplyLocked(maxSupply);
}
/**
* @notice Set a new maximum per wallet
* @param _newMax New max per wallet
*/
function setMaxPerWallet(uint256 _newMax) external onlyOwner {
emit NewMaxPerWallet(maxPerWallet, _newMax);
maxPerWallet = _newMax;
}
/**
* @notice Set a new mint price
* @param _newPrice New mint price in units of USDC
*/
function setMintPrice(uint256 _newPrice) external onlyOwner {
emit NewMintPrice(mintPrice, _newPrice);
mintPrice = _newPrice;
}
/**
* @notice Set the minting pause status
* @param _status True to pause, false to unpause
*/
function setPaused(bool _status) external onlyOwner {
if (_status) {
_pause();
} else {
_unpause();
}
}
/**
* @notice Set start time of each phase
* @dev Each phase start must be >= previous phase, all must be >= block.timestamp
* @param _startTime_heroes Start time of Heroes phase in Unix epoch seconds
* @param _startTime_arcade Start time of Arcadelist phase in Unix epoch seconds
* @param _startTime_rebels Start time of Rebels phase in Unix epoch seconds
*/
function setStartTimes(
uint128 _startTime_heroes,
uint128 _startTime_arcade,
uint128 _startTime_rebels
) external onlyOwner {
require(
_startTime_rebels >= _startTime_arcade && _startTime_arcade >= _startTime_heroes && _startTime_heroes >= block.timestamp,
"!timing"
);
// Set timestamps
startTime_heroes = _startTime_heroes;
startTime_arcade = _startTime_arcade;
startTime_rebels = _startTime_rebels;
emit NewStartTimes(_startTime_heroes, _startTime_arcade, _startTime_rebels);
}
// ----- View Functions -----
/**
* @notice Get the Merkle root of the active phase
* @return Merkle root of the active phase, 0 if none active
*/
function getActiveRoot() public view returns (bytes32) {
uint256 phase = getActivePhase();
if (phase == 1) {
return merkleRoot_heroes;
} else if (phase == 2) {
return merkleRoot_arcade;
} else if (phase == 3) {
return merkleRoot_rebels;
} else {
return 0;
}
}
/**
* @notice Get the ID the active phase
* @return 1 for Heroes, 2 for Arcade, 3 for Rebels, 0 for no active phase
*/
function getActivePhase() public view returns (uint256) {
if (block.timestamp >= startTime_heroes && block.timestamp < startTime_arcade) {
return 1;
} else if (block.timestamp >= startTime_arcade && block.timestamp < startTime_rebels) {
return 2;
} else if (block.timestamp >= startTime_rebels) {
return 3;
} else {
return 0;
}
}
// ----- Overrides -----
function _burn(uint256 tokenId) internal virtual override {
super._burn(tokenId);
unchecked {
--totalSupply;
}
}
function _mint(address to, uint256 tokenId) internal virtual override {
super._mint(to, tokenId);
unchecked {
++totalSupply;
}
}
/// @inheritdoc ERC721
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
/// @inheritdoc ERC721
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(), ".json")) : "";
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) {
return interfaceId == type(ERC2981).interfaceId || super.supportsInterface(interfaceId);
}
// ----- Events -----
event Withdrawal(uint256 balance);
event SupplyLocked(uint256 finalMaxSupply);
event NewRoyalty(uint96 newRoyalty);
event NewURI(string oldURI, string newURI);
event NewRoot(uint256 indexed phase, bytes32 oldRoot, bytes32 newRoot);
event NewMaxSupply(uint256 oldMax, uint256 newMax);
event NewMaxPerWallet(uint256 oldMax, uint256 newMax);
event NewMintPrice(uint256 oldPrice, uint256 newPrice);
event NewStartTimes(uint128 startTime_heroes, uint128 startTime_arcade, uint128 startTime_rebels);
}
MerkleProof.sol 212 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Calldata version of {verify}
*
* _Available since v4.7._
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Calldata version of {processProof}
*
* _Available since v4.7._
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* _Available since v4.7._
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Calldata version of {multiProofVerify}
*
* _Available since v4.7._
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
* consuming from one or the other at each step according to the instructions given by
* `proofFlags`.
*
* _Available since v4.7._
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Calldata version of {processMultiProof}
*
* _Available since v4.7._
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
ERC2981.sol 111 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*
* _Available since v4.5._
*/
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}
Counters.sol 43 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
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);
}
}
Pausable.sol 105 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
Read Contract
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
claimed 0xc884ef83 → uint256
getActivePhase 0x1ce97fd1 → uint256
getActiveRoot 0x14d35043 → bytes32
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxPerWallet 0x453c2310 → uint256
maxSupply 0xd5abeb01 → uint256
merkleRoot_arcade 0x55a40dab → bytes32
merkleRoot_heroes 0x368b7b16 → bytes32
merkleRoot_rebels 0x45766929 → bytes32
mintPrice 0x6817c76c → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
royaltyInfo 0x2a55205a → address, uint256
startTime_arcade 0xae05c6f1 → uint128
startTime_heroes 0xec52634b → uint128
startTime_rebels 0xabcbf52c → uint128
supplyLocked 0x943eb504 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 20 functions
These functions modify contract state and require a wallet transaction to execute.
adminMint 0xe58306f9
address _to
uint256 _qty
approve 0x095ea7b3
address to
uint256 tokenId
burn 0x42966c68
uint256 tokenId
lockMaxSupply 0xfca76c26
No parameters
mint 0xba41b0c6
uint256 _qty
bytes32[] _proof
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
setMaxPerWallet 0xe268e4d3
uint256 _newMax
setMaxSupply 0x6f8b44b0
uint256 _newMax
setMerkleRoot 0x7c382d0b
bytes32 _newRoot
uint256 _phase
setMintPrice 0xf4a0a528
uint256 _newPrice
setPaused 0x16c38b3c
bool _status
setRoyalty 0xcac92669
uint96 _royaltyBPS
setStartTimes 0xe1c4c029
uint128 _startTime_heroes
uint128 _startTime_arcade
uint128 _startTime_rebels
setURI 0x02fe5305
string _newURI
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address