Address Contract Partially Verified
Address
0x5759110402AA65241FD03435646aFD01a91Ab948
Balance
0 ETH
Nonce
1
Code Size
20079 bytes
Creator
0xE3cc5b6D...c509 at tx 0xd6d741a6...e11e84
Indexed Transactions
0
Contract Bytecode
20079 bytes
0x60806040526004361061025b5760003560e01c806370a0823111610144578063b61c5e69116100b6578063e65efccc1161007a578063e65efccc14610894578063e985e9c5146108d1578063ed9ec8881461090e578063f2fde38b1461094b578063f5aa406d14610974578063ffe630b51461099d5761025b565b8063b61c5e69146107be578063b88d4fde146107da578063c002d23d14610803578063c03afb591461082e578063c87b56dd146108575761025b565b806395d89b411161010857806395d89b41146106be5780639eb6ab62146106e95780639f3d1a2a14610714578063a22cb4651461073f578063a8d0a9b514610768578063b1c9fe6e146107935761025b565b806370a08231146105ff578063715018a61461063c5780637b99fab5146106535780638456cb591461067c5780638da5cb5b146106935761025b565b80633a367a67116101dd57806355f804b3116101a157806355f804b3146104ed5780635c975abb146105165780636352211e146105415780636373a6b11461057e57806365f13097146105a95780636ac437b0146105d45761025b565b80633a367a671461042e5780633f4ba83a1461045957806342842e0e1461047057806351cff8d914610499578063524513d6146104c25761025b565b8063095ea7b311610224578063095ea7b31461035b57806318160ddd1461038457806323b872dd146103af57806332cb6b0c146103d8578063386bfc98146104035761025b565b8062f86884146102605780630109c52e1461028b57806301ffc9a7146102b657806306fdde03146102f3578063081812fc1461031e575b600080fd5b34801561026c57600080fd5b506102756109c6565b6040516102829190613e2b565b60405180910390f35b34801561029757600080fd5b506102a06109e3565b6040516102ad919061421e565b60405180910390f35b3480156102c257600080fd5b506102dd60048036038101906102d891906136fb565b6109e8565b6040516102ea9190613e2b565b60405180910390f35b3480156102ff57600080fd5b50610308610aca565b6040516103159190613e61565b60405180910390f35b34801561032a57600080fd5b506103456004803603810190610340919061378e565b610b5c565b6040516103529190613dc4565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d9190613696565b610be1565b005b34801561039057600080fd5b50610399610cf9565b6040516103a69190614203565b60405180910390f35b3480156103bb57600080fd5b506103d660048036038101906103d19190613538565b610d0a565b005b3480156103e457600080fd5b506103ed610d6a565b6040516103fa9190614203565b60405180910390f35b34801561040f57600080fd5b50610418610d70565b6040516104259190613e46565b60405180910390f35b34801561043a57600080fd5b50610443610d76565b6040516104509190613e61565b60405180910390f35b34801561046557600080fd5b5061046e610e04565b005b34801561047c57600080fd5b5061049760048036038101906104929190613538565b610e8a565b005b3480156104a557600080fd5b506104c060048036038101906104bb91906134d3565b610eaa565b005b3480156104ce57600080fd5b506104d7610fd6565b6040516104e49190613e2b565b60405180910390f35b3480156104f957600080fd5b50610514600480360381019061050f919061374d565b611010565b005b34801561052257600080fd5b5061052b6110a6565b6040516105389190613e2b565b60405180910390f35b34801561054d57600080fd5b506105686004803603810190610563919061378e565b6110bd565b6040516105759190613dc4565b60405180910390f35b34801561058a57600080fd5b5061059361116f565b6040516105a09190613e61565b60405180910390f35b3480156105b557600080fd5b506105be6111fd565b6040516105cb919061421e565b60405180910390f35b3480156105e057600080fd5b506105e9611202565b6040516105f69190613e2b565b60405180910390f35b34801561060b57600080fd5b50610626600480360381019061062191906134aa565b61123c565b6040516106339190614203565b60405180910390f35b34801561064857600080fd5b506106516112f4565b005b34801561065f57600080fd5b5061067a600480360381019061067591906137e0565b61137c565b005b34801561068857600080fd5b506106916115ca565b005b34801561069f57600080fd5b506106a8611650565b6040516106b59190613dc4565b60405180910390f35b3480156106ca57600080fd5b506106d361167a565b6040516106e09190613e61565b60405180910390f35b3480156106f557600080fd5b506106fe61170c565b60405161070b919061421e565b60405180910390f35b34801561072057600080fd5b50610729611711565b6040516107369190613e61565b60405180910390f35b34801561074b57600080fd5b506107666004803603810190610761919061365a565b61179f565b005b34801561077457600080fd5b5061077d6117b5565b60405161078a919061421e565b60405180910390f35b34801561079f57600080fd5b506107a86117c8565b6040516107b5919061421e565b60405180910390f35b6107d860048036038101906107d3919061381c565b6117db565b005b3480156107e657600080fd5b5061080160048036038101906107fc9190613587565b611bb5565b005b34801561080f57600080fd5b50610818611c17565b6040516108259190614203565b60405180910390f35b34801561083a57600080fd5b50610855600480360381019061085091906137b7565b611c1d565b005b34801561086357600080fd5b5061087e6004803603810190610879919061378e565b611d0e565b60405161088b9190613e61565b60405180910390f35b3480156108a057600080fd5b506108bb60048036038101906108b69190613602565b611dc4565b6040516108c89190613e2b565b60405180910390f35b3480156108dd57600080fd5b506108f860048036038101906108f391906134fc565b611e8b565b6040516109059190613e2b565b60405180910390f35b34801561091a57600080fd5b50610935600480360381019061093091906134aa565b611f1f565b604051610942919061421e565b60405180910390f35b34801561095757600080fd5b50610972600480360381019061096d91906134aa565b611f3f565b005b34801561098057600080fd5b5061099b600480360381019061099691906136d2565b612037565b005b3480156109a957600080fd5b506109c460048036038101906109bf919061374d565b6120bd565b005b60006001600660159054906101000a900460ff1660ff1614905090565b600481565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610ab357507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610ac35750610ac282612153565b5b9050919050565b606060008054610ad990614549565b80601f0160208091040260200160405190810160405280929190818152602001828054610b0590614549565b8015610b525780601f10610b2757610100808354040283529160200191610b52565b820191906000526020600020905b815481529060010190602001808311610b3557829003601f168201915b5050505050905090565b6000610b67826121bd565b610ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9d90614123565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610bec826110bd565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c54906141a3565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610c7c612229565b73ffffffffffffffffffffffffffffffffffffffff161480610cab5750610caa81610ca5612229565b611e8b565b5b610cea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce190614043565b60405180910390fd5b610cf48383612231565b505050565b6000610d05600b6122ea565b905090565b610d1b610d15612229565b826122f8565b610d5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d51906141c3565b60405180910390fd5b610d658383836123d6565b505050565b60085481565b60075481565b600d8054610d8390614549565b80601f0160208091040260200160405190810160405280929190818152602001828054610daf90614549565b8015610dfc5780601f10610dd157610100808354040283529160200191610dfc565b820191906000526020600020905b815481529060010190602001808311610ddf57829003601f168201915b505050505081565b610e0c612229565b73ffffffffffffffffffffffffffffffffffffffff16610e2a611650565b73ffffffffffffffffffffffffffffffffffffffff1614610e80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7790614143565b60405180910390fd5b610e8861263d565b565b610ea583838360405180602001604052806000815250611bb5565b505050565b610eb2612229565b73ffffffffffffffffffffffffffffffffffffffff16610ed0611650565b73ffffffffffffffffffffffffffffffffffffffff1614610f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1d90614143565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff1647604051610f4c90613daf565b60006040518083038185875af1925050503d8060008114610f89576040519150601f19603f3d011682016040523d82523d6000602084013e610f8e565b606091505b5050905080610fd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc9906141e3565b60405180910390fd5b5050565b600080600660159054906101000a900460ff1660ff1611801561100b57506003600660159054906101000a900460ff1660ff16105b905090565b611018612229565b73ffffffffffffffffffffffffffffffffffffffff16611036611650565b73ffffffffffffffffffffffffffffffffffffffff161461108c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108390614143565b60405180910390fd5b80600e90805190602001906110a2929190613245565b5050565b6000600660149054906101000a900460ff16905090565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90614083565b60405180910390fd5b80915050919050565b600c805461117c90614549565b80601f01602080910402602001604051908101604052809291908181526020018280546111a890614549565b80156111f55780601f106111ca576101008083540402835291602001916111f5565b820191906000526020600020905b8154815290600101906020018083116111d857829003601f168201915b505050505081565b600281565b600080600660159054906101000a900460ff1660ff1611801561123757506004600660159054906101000a900460ff1660ff16105b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a490614063565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112fc612229565b73ffffffffffffffffffffffffffffffffffffffff1661131a611650565b73ffffffffffffffffffffffffffffffffffffffff1614611370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136790614143565b60405180910390fd5b61137a60006126df565b565b611384612229565b73ffffffffffffffffffffffffffffffffffffffff166113a2611650565b73ffffffffffffffffffffffffffffffffffffffff16146113f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ef90614143565b60405180910390fd5b6114006110a6565b15611440576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143790614003565b60405180910390fd5b611448611202565b611487576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147e90614023565b60405180910390fd5b603260ff1682600660169054906101000a900460ff166114a79190614364565b60ff1611156114eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e290613fa3565b60405180910390fd5b6008548260ff166114fa610cf9565b611504919061430e565b1115611545576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153c906140c3565b60405180910390fd5b60005b8260ff168163ffffffff16101561158f57611563600b6127a5565b600061156f600b6122ea565b905061157b83826127bb565b508080611587906145f5565b915050611548565b5081600660168282829054906101000a900460ff166115ae9190614364565b92506101000a81548160ff021916908360ff1602179055505050565b6115d2612229565b73ffffffffffffffffffffffffffffffffffffffff166115f0611650565b73ffffffffffffffffffffffffffffffffffffffff1614611646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163d90614143565b60405180910390fd5b61164e6127d9565b565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606001805461168990614549565b80601f01602080910402602001604051908101604052809291908181526020018280546116b590614549565b80156117025780601f106116d757610100808354040283529160200191611702565b820191906000526020600020905b8154815290600101906020018083116116e557829003601f168201915b5050505050905090565b603281565b600e805461171e90614549565b80601f016020809104026020016040519081016040528092919081815260200182805461174a90614549565b80156117975780601f1061176c57610100808354040283529160200191611797565b820191906000526020600020905b81548152906001019060200180831161177a57829003601f168201915b505050505081565b6117b16117aa612229565b838361287c565b5050565b600660169054906101000a900460ff1681565b600660159054906101000a900460ff1681565b6117e36110a6565b15611823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181a90614003565b60405180910390fd5b61182b611202565b61186a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186190614023565b60405180910390fd5b611872610fd6565b1561198f57611889611882612229565b8383611dc4565b6118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613ea3565b60405180910390fd5b60006118d26109c6565b6118dd5760046118e0565b60015b60ff1690508084600a60006118f3612229565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166119459190614364565b60ff161115611989576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198090613ec3565b60405180910390fd5b50611a38565b600260ff1683600a60006119a1612229565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166119f39190614364565b60ff161115611a37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2e90613fe3565b60405180910390fd5b5b8260ff16600954611a4991906143cc565b3414611a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8190614163565b60405180910390fd5b6008548360ff16611a99610cf9565b611aa3919061430e565b1115611ae4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611adb906140c3565b60405180910390fd5b60005b8360ff168163ffffffff161015611b3557611b02600b6127a5565b6000611b0e600b6122ea565b9050611b21611b1b612229565b826127bb565b508080611b2d906145f5565b915050611ae7565b5082600a6000611b43612229565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282829054906101000a900460ff16611b989190614364565b92506101000a81548160ff021916908360ff160217905550505050565b611bc6611bc0612229565b836122f8565b611c05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfc906141c3565b60405180910390fd5b611c11848484846129e9565b50505050565b60095481565b611c25612229565b73ffffffffffffffffffffffffffffffffffffffff16611c43611650565b73ffffffffffffffffffffffffffffffffffffffff1614611c99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9090614143565b60405180910390fd5b60008160ff1610158015611cb1575060048160ff1611155b611cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce7906140e3565b60405180910390fd5b80600660156101000a81548160ff021916908360ff16021790555050565b60606000611d1b83612a45565b9050600081511415611dba57600d8054611d3490614549565b80601f0160208091040260200160405190810160405280929190818152602001828054611d6090614549565b8015611dad5780601f10611d8257610100808354040283529160200191611dad565b820191906000526020600020905b815481529060010190602001808311611d9057829003601f168201915b5050505050915050611dbf565b809150505b919050565b60008060001b6007541415611e0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e05906140a3565b60405180910390fd5b611e82838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505060075486604051602001611e679190613d70565b60405160208183030381529060405280519060200120612aec565b90509392505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611f47612229565b73ffffffffffffffffffffffffffffffffffffffff16611f65611650565b73ffffffffffffffffffffffffffffffffffffffff1614611fbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb290614143565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561202b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202290613f03565b60405180910390fd5b612034816126df565b50565b61203f612229565b73ffffffffffffffffffffffffffffffffffffffff1661205d611650565b73ffffffffffffffffffffffffffffffffffffffff16146120b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120aa90614143565b60405180910390fd5b8060078190555050565b6120c5612229565b73ffffffffffffffffffffffffffffffffffffffff166120e3611650565b73ffffffffffffffffffffffffffffffffffffffff1614612139576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213090614143565b60405180910390fd5b80600c908051906020019061214f929190613245565b5050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166122a4836110bd565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081600001549050919050565b6000612303826121bd565b612342576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161233990613fc3565b60405180910390fd5b600061234d836110bd565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806123bc57508373ffffffffffffffffffffffffffffffffffffffff166123a484610b5c565b73ffffffffffffffffffffffffffffffffffffffff16145b806123cd57506123cc8185611e8b565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166123f6826110bd565b73ffffffffffffffffffffffffffffffffffffffff161461244c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244390613f23565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156124bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124b390613f63565b60405180910390fd5b6124c7838383612b03565b6124d2600082612231565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546125229190614426565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612579919061430e565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612638838383612b5b565b505050565b6126456110a6565b612684576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267b90613e83565b60405180910390fd5b6000600660146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6126c8612229565b6040516126d59190613dc4565b60405180910390a1565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001816000016000828254019250508190555050565b6127d5828260405180602001604052806000815250612b60565b5050565b6127e16110a6565b15612821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161281890614003565b60405180910390fd5b6001600660146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612865612229565b6040516128729190613dc4565b60405180910390a1565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156128eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e290613f83565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516129dc9190613e2b565b60405180910390a3505050565b6129f48484846123d6565b612a0084848484612bbb565b612a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3690613ee3565b60405180910390fd5b50505050565b6060612a50826121bd565b612a8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8690614183565b60405180910390fd5b6000612a99612d52565b90506000815111612ab95760405180602001604052806000815250612ae4565b80612ac384612de4565b604051602001612ad4929190613d8b565b6040516020818303038152906040525b915050919050565b600082612af98584612f91565b1490509392505050565b612b0b6110a6565b15612b4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b4290614003565b60405180910390fd5b612b5683838361302c565b505050565b505050565b612b6a8383613031565b612b776000848484612bbb565b612bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bad90613ee3565b60405180910390fd5b505050565b6000612bdc8473ffffffffffffffffffffffffffffffffffffffff1661320b565b15612d45578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612c05612229565b8786866040518563ffffffff1660e01b8152600401612c279493929190613ddf565b602060405180830381600087803b158015612c4157600080fd5b505af1925050508015612c7257506040513d601f19601f82011682018060405250810190612c6f9190613724565b60015b612cf5573d8060008114612ca2576040519150601f19603f3d011682016040523d82523d6000602084013e612ca7565b606091505b50600081511415612ced576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ce490613ee3565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612d4a565b600190505b949350505050565b6060600e8054612d6190614549565b80601f0160208091040260200160405190810160405280929190818152602001828054612d8d90614549565b8015612dda5780601f10612daf57610100808354040283529160200191612dda565b820191906000526020600020905b815481529060010190602001808311612dbd57829003601f168201915b5050505050905090565b60606000821415612e2c576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612f8c565b600082905060005b60008214612e5e578080612e47906145ac565b915050600a82612e57919061439b565b9150612e34565b60008167ffffffffffffffff811115612ea0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612ed25781602001600182028036833780820191505090505b5090505b60008514612f8557600182612eeb9190614426565b9150600a85612efa9190614646565b6030612f06919061430e565b60f81b818381518110612f42577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612f7e919061439b565b9450612ed6565b8093505050505b919050565b60008082905060005b8451811015613021576000858281518110612fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905080831161300057612ff9838261322e565b925061300d565b61300a818461322e565b92505b508080613019906145ac565b915050612f9a565b508091505092915050565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156130a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161309890614103565b60405180910390fd5b6130aa816121bd565b156130ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130e190613f43565b60405180910390fd5b6130f660008383612b03565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613146919061430e565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461320760008383612b5b565b5050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082600052816020526040600020905092915050565b82805461325190614549565b90600052602060002090601f01602090048101928261327357600085556132ba565b82601f1061328c57805160ff19168380011785556132ba565b828001600101855582156132ba579182015b828111156132b957825182559160200191906001019061329e565b5b5090506132c791906132cb565b5090565b5b808211156132e45760008160009055506001016132cc565b5090565b60006132fb6132f68461425e565b614239565b90508281526020810184848401111561331357600080fd5b61331e848285614507565b509392505050565b60006133396133348461428f565b614239565b90508281526020810184848401111561335157600080fd5b61335c848285614507565b509392505050565b60008135905061337381614d98565b92915050565b60008135905061338881614daf565b92915050565b60008083601f8401126133a057600080fd5b8235905067ffffffffffffffff8111156133b957600080fd5b6020830191508360208202830111156133d157600080fd5b9250929050565b6000813590506133e781614dc6565b92915050565b6000813590506133fc81614ddd565b92915050565b60008135905061341181614df4565b92915050565b60008151905061342681614df4565b92915050565b600082601f83011261343d57600080fd5b813561344d8482602086016132e8565b91505092915050565b600082601f83011261346757600080fd5b8135613477848260208601613326565b91505092915050565b60008135905061348f81614e0b565b92915050565b6000813590506134a481614e22565b92915050565b6000602082840312156134bc57600080fd5b60006134ca84828501613364565b91505092915050565b6000602082840312156134e557600080fd5b60006134f384828501613379565b91505092915050565b6000806040838503121561350f57600080fd5b600061351d85828601613364565b925050602061352e85828601613364565b9150509250929050565b60008060006060848603121561354d57600080fd5b600061355b86828701613364565b935050602061356c86828701613364565b925050604061357d86828701613480565b9150509250925092565b6000806000806080858703121561359d57600080fd5b60006135ab87828801613364565b94505060206135bc87828801613364565b93505060406135cd87828801613480565b925050606085013567ffffffffffffffff8111156135ea57600080fd5b6135f68782880161342c565b91505092959194509250565b60008060006040848603121561361757600080fd5b600061362586828701613364565b935050602084013567ffffffffffffffff81111561364257600080fd5b61364e8682870161338e565b92509250509250925092565b6000806040838503121561366d57600080fd5b600061367b85828601613364565b925050602061368c858286016133d8565b9150509250929050565b600080604083850312156136a957600080fd5b60006136b785828601613364565b92505060206136c885828601613480565b9150509250929050565b6000602082840312156136e457600080fd5b60006136f2848285016133ed565b91505092915050565b60006020828403121561370d57600080fd5b600061371b84828501613402565b91505092915050565b60006020828403121561373657600080fd5b600061374484828501613417565b91505092915050565b60006020828403121561375f57600080fd5b600082013567ffffffffffffffff81111561377957600080fd5b61378584828501613456565b91505092915050565b6000602082840312156137a057600080fd5b60006137ae84828501613480565b91505092915050565b6000602082840312156137c957600080fd5b60006137d784828501613495565b91505092915050565b600080604083850312156137f357600080fd5b600061380185828601613495565b925050602061381285828601613364565b9150509250929050565b60008060006040848603121561383157600080fd5b600061383f86828701613495565b935050602084013567ffffffffffffffff81111561385c57600080fd5b6138688682870161338e565b92509250509250925092565b61387d8161445a565b82525050565b61389461388f8261445a565b614622565b82525050565b6138a38161447e565b82525050565b6138b28161448a565b82525050565b60006138c3826142c0565b6138cd81856142d6565b93506138dd818560208601614516565b6138e681614733565b840191505092915050565b60006138fc826142cb565b61390681856142f2565b9350613916818560208601614516565b61391f81614733565b840191505092915050565b6000613935826142cb565b61393f8185614303565b935061394f818560208601614516565b80840191505092915050565b60006139686014836142f2565b915061397382614751565b602082019050919050565b600061398b6010836142f2565b91506139968261477a565b602082019050919050565b60006139ae6012836142f2565b91506139b9826147a3565b602082019050919050565b60006139d16032836142f2565b91506139dc826147cc565b604082019050919050565b60006139f46026836142f2565b91506139ff8261481b565b604082019050919050565b6000613a176025836142f2565b9150613a228261486a565b604082019050919050565b6000613a3a601c836142f2565b9150613a45826148b9565b602082019050919050565b6000613a5d6024836142f2565b9150613a68826148e2565b604082019050919050565b6000613a806019836142f2565b9150613a8b82614931565b602082019050919050565b6000613aa36015836142f2565b9150613aae8261495a565b602082019050919050565b6000613ac6602c836142f2565b9150613ad182614983565b604082019050919050565b6000613ae96016836142f2565b9150613af4826149d2565b602082019050919050565b6000613b0c6010836142f2565b9150613b17826149fb565b602082019050919050565b6000613b2f6012836142f2565b9150613b3a82614a24565b602082019050919050565b6000613b526038836142f2565b9150613b5d82614a4d565b604082019050919050565b6000613b75602a836142f2565b9150613b8082614a9c565b604082019050919050565b6000613b986029836142f2565b9150613ba382614aeb565b604082019050919050565b6000613bbb6016836142f2565b9150613bc682614b3a565b602082019050919050565b6000613bde6012836142f2565b9150613be982614b63565b602082019050919050565b6000613c01600d836142f2565b9150613c0c82614b8c565b602082019050919050565b6000613c246020836142f2565b9150613c2f82614bb5565b602082019050919050565b6000613c47602c836142f2565b9150613c5282614bde565b604082019050919050565b6000613c6a6020836142f2565b9150613c7582614c2d565b602082019050919050565b6000613c8d6010836142f2565b9150613c9882614c56565b602082019050919050565b6000613cb0602f836142f2565b9150613cbb82614c7f565b604082019050919050565b6000613cd36021836142f2565b9150613cde82614cce565b604082019050919050565b6000613cf66000836142e7565b9150613d0182614d1d565b600082019050919050565b6000613d196031836142f2565b9150613d2482614d20565b604082019050919050565b6000613d3c600e836142f2565b9150613d4782614d6f565b602082019050919050565b613d5b816144e0565b82525050565b613d6a816144fa565b82525050565b6000613d7c8284613883565b60148201915081905092915050565b6000613d97828561392a565b9150613da3828461392a565b91508190509392505050565b6000613dba82613ce9565b9150819050919050565b6000602082019050613dd96000830184613874565b92915050565b6000608082019050613df46000830187613874565b613e016020830186613874565b613e0e6040830185613d52565b8181036060830152613e2081846138b8565b905095945050505050565b6000602082019050613e40600083018461389a565b92915050565b6000602082019050613e5b60008301846138a9565b92915050565b60006020820190508181036000830152613e7b81846138f1565b905092915050565b60006020820190508181036000830152613e9c8161395b565b9050919050565b60006020820190508181036000830152613ebc8161397e565b9050919050565b60006020820190508181036000830152613edc816139a1565b9050919050565b60006020820190508181036000830152613efc816139c4565b9050919050565b60006020820190508181036000830152613f1c816139e7565b9050919050565b60006020820190508181036000830152613f3c81613a0a565b9050919050565b60006020820190508181036000830152613f5c81613a2d565b9050919050565b60006020820190508181036000830152613f7c81613a50565b9050919050565b60006020820190508181036000830152613f9c81613a73565b9050919050565b60006020820190508181036000830152613fbc81613a96565b9050919050565b60006020820190508181036000830152613fdc81613ab9565b9050919050565b60006020820190508181036000830152613ffc81613adc565b9050919050565b6000602082019050818103600083015261401c81613aff565b9050919050565b6000602082019050818103600083015261403c81613b22565b9050919050565b6000602082019050818103600083015261405c81613b45565b9050919050565b6000602082019050818103600083015261407c81613b68565b9050919050565b6000602082019050818103600083015261409c81613b8b565b9050919050565b600060208201905081810360008301526140bc81613bae565b9050919050565b600060208201905081810360008301526140dc81613bd1565b9050919050565b600060208201905081810360008301526140fc81613bf4565b9050919050565b6000602082019050818103600083015261411c81613c17565b9050919050565b6000602082019050818103600083015261413c81613c3a565b9050919050565b6000602082019050818103600083015261415c81613c5d565b9050919050565b6000602082019050818103600083015261417c81613c80565b9050919050565b6000602082019050818103600083015261419c81613ca3565b9050919050565b600060208201905081810360008301526141bc81613cc6565b9050919050565b600060208201905081810360008301526141dc81613d0c565b9050919050565b600060208201905081810360008301526141fc81613d2f565b9050919050565b60006020820190506142186000830184613d52565b92915050565b60006020820190506142336000830184613d61565b92915050565b6000614243614254565b905061424f828261457b565b919050565b6000604051905090565b600067ffffffffffffffff82111561427957614278614704565b5b61428282614733565b9050602081019050919050565b600067ffffffffffffffff8211156142aa576142a9614704565b5b6142b382614733565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000614319826144e0565b9150614324836144e0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561435957614358614677565b5b828201905092915050565b600061436f826144fa565b915061437a836144fa565b92508260ff038211156143905761438f614677565b5b828201905092915050565b60006143a6826144e0565b91506143b1836144e0565b9250826143c1576143c06146a6565b5b828204905092915050565b60006143d7826144e0565b91506143e2836144e0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561441b5761441a614677565b5b828202905092915050565b6000614431826144e0565b915061443c836144e0565b92508282101561444f5761444e614677565b5b828203905092915050565b6000614465826144c0565b9050919050565b6000614477826144c0565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015614534578082015181840152602081019050614519565b83811115614543576000848401525b50505050565b6000600282049050600182168061456157607f821691505b60208210811415614575576145746146d5565b5b50919050565b61458482614733565b810181811067ffffffffffffffff821117156145a3576145a2614704565b5b80604052505050565b60006145b7826144e0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156145ea576145e9614677565b5b600182019050919050565b6000614600826144ea565b915063ffffffff82141561461757614616614677565b5b600182019050919050565b600061462d82614634565b9050919050565b600061463f82614744565b9050919050565b6000614651826144e0565b915061465c836144e0565b92508261466c5761466b6146a6565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b7f494e56414c49445f574c5f50524f4f4600000000000000000000000000000000600082015250565b7f455843454544535f574c5f414c4c4f5745440000000000000000000000000000600082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f455843454544535f4f574e45525f414c4c4f5745440000000000000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f455843454544535f5055424c49435f414c4c4f57454400000000000000000000600082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f4d494e54494e475f4e4f545f4143544956450000000000000000000000000000600082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f57484954454c4953545f524f4f545f4e4f545f53455400000000000000000000600082015250565b7f455843454544535f4d41585f535550504c590000000000000000000000000000600082015250565b7f494e56414c49445f504841534500000000000000000000000000000000000000600082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f57524f4e475f4554485f414d4f554e5400000000000000000000000000000000600082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b50565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f57495448445241575f4552524f52000000000000000000000000000000000000600082015250565b614da18161445a565b8114614dac57600080fd5b50565b614db88161446c565b8114614dc357600080fd5b50565b614dcf8161447e565b8114614dda57600080fd5b50565b614de68161448a565b8114614df157600080fd5b50565b614dfd81614494565b8114614e0857600080fd5b50565b614e14816144e0565b8114614e1f57600080fd5b50565b614e2b816144fa565b8114614e3657600080fd5b5056fea264697066735822122010ff2ac82a2df81b314982d641ebf412f70778d0fb6a8abc7079179f62ad43ad64736f6c63430008040033
Verified Source Code Partial Match
Compiler: v0.8.4+commit.c7e474f2
EVM: istanbul
Optimization: No
FuzzyFelonsCollection.sol 421 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*^!!7?JJ7
FUZZY .:^^~~^~!!: .7J5GGBBBGPY7~:
FELONS ~~ ~7??YPGGP5YJJ????J5###BBBBBGGGY7~
...::. 7B######BGPP555P5YB##BBBBBBBBG5?:
:!7?Y55GBBGPPG#######BGGPP55Y5GGGGGBBBBBBG5?:
!GBBBB#B###&##BB#BBBGGGGGGGGGGGGGPPPPPGPJ!:
~GBBB#BB####BBBBBBBBGBGGGGGGGGGGGGGGPP5J^
.!PB#######BBBBBBBBBBGPPGGGPGGGGGGGGGP55J7.
.~7Y5PBBBBBBBBBBBBBGGBBBGGGGGGGGGGBG55Y?!
7PGBBBBBBBBBBBBBBBBBGGGGGBGGG55G5J!!:
7PBBBBBBGGGBGBGBGBBBGGGGGBGGPPPPJ7~!^
.?PBBB##BBBBBGGBGGBGGGGGGGP55555Y7!77
.JPB###BB##BBBBBGGBBGGGG55P5555J?!~.
:7PB###BB#####BBGGGP55JYYYYJJ!~.
.^7YPGBBGBGGGGPPGPPP55Y??7^
.!Y555YYYYY555YYJ?77~. ..
.~7J5PPP555555YYYJ?!^^:.:. .:.
.~7?JYYYPPPP55555555YJ777!~^^^:::^^:..
.~!??7777??Y55555555555YJ7777~^^^::^:^~: ..*/
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
/**
* @title The ERC721 contract for the Fuzzy Felons collection.
*
* This collection will allow up to MAX_SUPPLY tokens to be minted.
*
* The mint price per token is MINT_PRICE.
*
* During its lifetime this contract will go through several phases:
* - Phase 0 - Minting is still not active.
* - Phase 1 - Whitelisted addresses can mint 1 token each.
* - Phase 2 - Whitelisted addresses can mint up to MAX_WL_MINT tokens each,
* including any single token minted in Phase 1.
* - Phase 3 - Public minting, any address (even if not on whitelist) can mint
* up to MAX_PUBLIC_MINT tokens each, including any tokens minted
* in Phases 1 and 2.
* - Phase 4 - Minting is over. This will monstly happen after MAX_SUPPLY
* tokens have been minted or the deadline for Phase 3 is over.
*
* Each of these phases will have a deadline, after which the owner of this
* contract will use setPhase() to move on to the next one. See the FAQ at
* the website for more info on these phases and deadlines:
* https://fuzzyfelons.com/#faq
*
* For sake of transparencey, as an assurance that the content of the
* animations/images will not be tampered unnoticeably by the team, a
* PROVENANCE hash is published here. This contains the SHA256 hash of all
* SHA256 hashes of the animation files put together in order of tokenId.
* Anyone can download all these files, run a SHA256 hash on each one of them,
* concatenate all the bytes of these hashes and calculate its SHA256 hash to
* verify that they have the expected content. Thus, the content of these images
* will forever be recorded and verifiable in the blockchain.
*
* The owners of this contract reserve themselves the ability to mint up to
* MAX_OWNER_MINT tokens for free (except gas). These tokens will be mintable
* only when the wider public can also mint (Phase 1 to Phase 3). For the sake
* of transparency and openness this reduces the hipothetical scenario in which
* the team cherry-picks specific tokens. These tokens are meant to be handed
* out back to the community and people who supported the team as gifts,
* raffles, prizes, rewards, etc. The owner specifies which account will
* receive the newly minted tokens.
*
* The owner account is able to withdraw the eth funds from minting in this
* smart contract into a specified account.
*
* The whitelisting process uses a merkle tree and merkle proofs in order
* to reduce the gas needs for checking if an address is in the whitelist.
*
* The contract can be paused at any moment by the team if need be. This will
* pause the minting and token transfers.
*
*/
contract FuzzyFelonsCollection is ERC721, Ownable, Pausable {
// Maximum allowed tokens to be minted per whitelisted address during
// phase 2.
uint8 public constant MAX_WL_MINT = 4;
// Maximum allowed tokens to be held by the minting account during the
// public minting phase 3.
uint8 public constant MAX_PUBLIC_MINT = 2;
// Maximum number of tokens to be minted by the owner.
uint8 public constant MAX_OWNER_MINT = 50;
// The current minting Phase.
uint8 public phase;
// Keeps track of the number of tokens already minted by the owner.
uint8 public ownerMintedCount;
// Merkle Tree root for the Whitelist.
bytes32 public whitelistRoot;
// Maximum number of tokens that this collection will have.
uint256 public MAX_SUPPLY;
// The price per minted token.
uint256 public MINT_PRICE = 0.1 ether;
// Keeps track of how many tokens minted by each address.
mapping (address => uint8) public mintCount;
// Keeps track of the number of tokens minted so far.
using Counters for Counters.Counter;
Counters.Counter private _idCounter;
// Provenance - an hex hash produced by hashing all the image files of all
// tokens. Can be used as a proof that the images are the original ones.
string public PROVENANCE;
// The URI of the default token JSON, to be returned by tokenURI(id) before
// reveal.
string public defaultURI;
// The base URI of the revealed token metadata.
string public metadataBaseURI;
/**
* @param maxSupply - the maximum number of tokens allowed to be minted.
* @param provenance - the initial value of PROVENANCE.
* @param _defaultURI - the initial URI for every token.
*/
constructor(
uint256 maxSupply,
string memory provenance,
string memory _defaultURI,
address _owner
)
ERC721("Fuzzy Felons", "FELON")
{
// Initialize a few values during deploy.
MAX_SUPPLY = maxSupply;
PROVENANCE = provenance;
defaultURI = _defaultURI;
// Start with minting deactivated.
setPhase(0);
// Set the owner
transferOwnership(_owner);
}
//*** Minting ***//
/**
* @notice Mints tokens. The sender address will receive these tokens. The
* correct amount of eth has to be sent with the transaction that calls
* this. This eth amount should be = MINT_PRICE * mintNum.
*
* @dev This function validates if the sender address meets the conditions
* imposed by the current minting phase and fail if it doesn't.
*
* @param mintNum - the number of tokens to be minted.
*
* @param merkleProof - to be used to check if the sender address is in the
* whitelist. This is ignored during public minting (phase 3).
*/
function mint(uint8 mintNum, bytes32[] calldata merkleProof)
public payable whenNotPaused
{
// Check if minting is active.
require (isMintingActive(), "MINTING_NOT_ACTIVE");
if (isWhitelistActive()) {
// Check if the sender address is in the whitelist.
require(isInWhitelist(_msgSender(), merkleProof),
"INVALID_WL_PROOF");
// If we are in the single mint whitelist phase (1), then allow one
// token to be minted per whitelisted address, otherwise only allow
// up to MAX_WL_MINT (phase 2);
uint256 maxAllowed = isWhitelistSingle()? 1 : MAX_WL_MINT;
// Check if this address hasn't minted all the tokens it is allowed
// to in this phase.
require(mintCount[_msgSender()] + mintNum <= maxAllowed,
"EXCEEDS_WL_ALLOWED");
} else {
// Public Phase
// Make sure that the sender will not mint more tokens than the ones
// allowed during the public minting phase.
// NOTE: This will not stop an individual from minting more tokens
// with other addresses.
require(mintCount[_msgSender()] + mintNum <= MAX_PUBLIC_MINT,
"EXCEEDS_PUBLIC_ALLOWED");
}
// Make sure that the correct ammount of eth is being paid.
require(msg.value == MINT_PRICE * mintNum, "WRONG_ETH_AMOUNT");
// Don't allow the maximum supply to be exceeded.
require(totalSupply() + mintNum <= MAX_SUPPLY, "EXCEEDS_MAX_SUPPLY");
// All the conditions are verified at this point, good to go!
for (uint32 i = 0; i < mintNum; i++) {
// Increment the counter and get the id. First id is 1.
_idCounter.increment();
uint256 newTokenId = _idCounter.current();
// Mint the token.
_safeMint(_msgSender(), newTokenId);
}
// Update the counter of minted tokens by this address.
mintCount[_msgSender()] += mintNum;
}
/**
* @notice Allows the owner to mint up to MAX_OWNER_MINT tokens. The
* resulting tokens will be held by the 'to' account. This should
* fail during phases 0 and 4, when minting is deactivated for
* everyone.
*
* @param mintNum - the number of tokens to be minted.
* @param to - the address of the account that will receive the newly minted
* tokens.
*/
function ownerMint(uint8 mintNum, address to)
public onlyOwner whenNotPaused
{
// The owner can only mint when others can also mint - it's only fair...
require (isMintingActive(), "MINTING_NOT_ACTIVE");
// Make sure the owner doesn't mint more than it is allowed to.
require(ownerMintedCount + mintNum <= MAX_OWNER_MINT,
"EXCEEDS_OWNER_ALLOWED");
// Don't allow the maximum supply to be exceeded.
require(totalSupply() + mintNum <= MAX_SUPPLY, "EXCEEDS_MAX_SUPPLY");
// Mint the tokens.
for (uint32 i = 0; i < mintNum; i++) {
// Increment the counters and get the id. First id is 1.
_idCounter.increment();
uint256 newTokenId = _idCounter.current();
// Mint the token into the 'to' account.
_safeMint(to, newTokenId);
}
// Update the number of tokens minted by the owner.
ownerMintedCount += mintNum;
}
/**
* @dev Overrides ERC721.tokenURI().
*
* @notice Makes sure no transfers happen when paused.
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
)
internal override whenNotPaused
{
super._beforeTokenTransfer(from, to, tokenId);
}
/**
* @notice Returns the number of tokens minted so far.
*/
function totalSupply() public view returns (uint256) {
return _idCounter.current();
}
//*** Whitelist ***//
/**
* @notice Sets root of the Merkle Tree with the white list entries.
*
* @param root - the Merkle Tree root.
*/
function setWhitelistRoot(bytes32 root) external onlyOwner {
whitelistRoot = root;
}
/**
* @notice Verifies if an address is in the Whitelist.
*
* @param addr - the address being tested against the whitelist.
*
* @param merkleProof - the Merkle proof for addr in the tree.
*/
function isInWhitelist(address addr, bytes32[] calldata merkleProof)
public view returns (bool)
{
require( whitelistRoot != 0, "WHITELIST_ROOT_NOT_SET" );
return MerkleProof.verify(
merkleProof,
whitelistRoot,
keccak256(abi.encodePacked(addr))
);
}
//*** Metadata URI ***//
/**
* @notice Reveals the token images and traits by setting the base URI for
* all the token metadata JSONS. The full URI will be this base followed by
* the token id number.
*
* @param baseURI - the base URI for the token metadata JSONS.
*/
function setBaseURI(string memory baseURI) public onlyOwner {
metadataBaseURI = baseURI;
}
/**
* @dev Overrides ERC721._baseURI().
*/
function _baseURI() internal view override returns (string memory) {
return metadataBaseURI;
}
/**
* @dev Overrides ERC721.tokenURI().
*
* @return uri - the default uri until reveal and final one after that.
*/
function tokenURI(uint256 tokenId)
public view override returns (string memory)
{
string memory uri = super.tokenURI(tokenId);
if (bytes(uri).length == 0) {
// The reveal hasn't happend yet - return default URI.
return defaultURI;
} else {
return uri;
}
}
//*** Minting Phases ***//
/**
* @notice Sets the current minting phase. For more info:
* https://fuzzyfelons.com/#faq
*/
function setPhase(uint8 _phase) public onlyOwner {
require(_phase >= 0 && _phase <= 4, "INVALID_PHASE");
phase = _phase;
}
/**
* @return true if minting is active in this phase.
*/
function isMintingActive() public view returns (bool) {
// True for phases 1, 2 and 3.
return phase > 0 && phase < 4;
}
/**
* @return true if only whitelisted addresses can mint in this phase.
*/
function isWhitelistActive() public view returns (bool) {
// True for phases 1 and 2.
return phase > 0 && phase < 3;
}
/**
* @return true if whitelisted addresses can mint only 1 token in this
* phase.
*/
function isWhitelistSingle() public view returns (bool) {
// True for phase 1.
return phase == 1;
}
//*** Funds ***//
/**
* @notice Transfers all the minting funds to the 'to' account.
*
* @param to - the address of the account that will receive the funds.
*/
function withdraw(address payable to) public onlyOwner {
(bool success, ) = to.call{value: address(this).balance}("");
require(success, "WITHDRAW_ERROR");
}
//*** Provenance ***//
/**
* @notice Sets provenance hash.
*
* @dev This should match the SHA256 hash of all the SHA256 hashes of the
* token image files put together in order.
*/
function setProvenance(string memory provenance) public onlyOwner {
PROVENANCE = provenance;
}
//*** Pause ***//
/**
* @notice Pauses the minting.
*/
function pause() public onlyOwner {
_pause();
}
/**
* @notice Unpauses the minting.
*/
function unpause() public onlyOwner {
_unpause();
}
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
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;
}
}
Pausable.sol 91 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
ERC721.sol 447 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_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: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_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 a {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 a {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 Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
MerkleProof.sol 60 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = _efficientHash(computedHash, proofElement);
} else {
// Hash(current element of the proof + current computed hash)
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
Read Contract
MAX_OWNER_MINT 0x9eb6ab62 → uint8
MAX_PUBLIC_MINT 0x65f13097 → uint8
MAX_SUPPLY 0x32cb6b0c → uint256
MAX_WL_MINT 0x0109c52e → uint8
MINT_PRICE 0xc002d23d → uint256
PROVENANCE 0x6373a6b1 → string
balanceOf 0x70a08231 → uint256
defaultURI 0x3a367a67 → string
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
isInWhitelist 0xe65efccc → bool
isMintingActive 0x6ac437b0 → bool
isWhitelistActive 0x524513d6 → bool
isWhitelistSingle 0x00f86884 → bool
metadataBaseURI 0x9f3d1a2a → string
mintCount 0xed9ec888 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerMintedCount 0xa8d0a9b5 → uint8
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
phase 0xb1c9fe6e → uint8
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
whitelistRoot 0x386bfc98 → bytes32
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xb61c5e69
uint8 mintNum
bytes32[] merkleProof
ownerMint 0x7b99fab5
uint8 mintNum
address to
pause 0x8456cb59
No parameters
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
setBaseURI 0x55f804b3
string baseURI
setPhase 0xc03afb59
uint8 _phase
setProvenance 0xffe630b5
string provenance
setWhitelistRoot 0xf5aa406d
bytes32 root
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
withdraw 0x51cff8d9
address to
Recent Transactions
No transactions found for this address