Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x0769C2D2eCc4882FbC76061951d638F8887d729F
Balance 0 ETH
Nonce 1
Code Size 10328 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

10328 bytes
0x60806040526004361061021a5760003560e01c80636fdca5e011610123578063a71bbebe116100ab578063f2fde38b1161006f578063f2fde38b14610642578063f5b9662114610662578063f8048d8f14610682578063fcfff16f146106a2578063fe2c7fee146106c357600080fd5b8063a71bbebe1461058c578063b88d4fde1461059f578063bee6348a146105bf578063c87b56dd146105d9578063e985e9c5146105f957600080fd5b80638da5cb5b116100f25780638da5cb5b1461050457806395d89b41146105225780639e5666cd14610537578063a22cb46514610557578063a475b5dd1461057757600080fd5b80636fdca5e01461048f57806370a08231146104af578063715018a6146104cf578063729ad39e146104e457600080fd5b806323b872dd116101a657806344a0d68a1161017557806344a0d68a146103ec578063453c23101461040c578063507e094f14610431578063518302271461044e5780636352211e1461046f57600080fd5b806323b872dd146103845780633006b543146103a45780633ccfd60b146103c457806342842e0e146103cc57600080fd5b8063081812fc116101ed578063081812fc146102c4578063092501a0146102fc578063095ea7b31461031c57806313faede61461033c57806318160ddd1461036057600080fd5b806301ffc9a71461021f5780630364d22a14610254578063047fc9aa1461026957806306fdde03146102a2575b600080fd5b34801561022b57600080fd5b5061023f61023a366004612373565b6106e3565b60405190151581526020015b60405180910390f35b61026761026236600461240b565b610735565b005b34801561027557600080fd5b5060095461028d90600160401b900463ffffffff1681565b60405163ffffffff909116815260200161024b565b3480156102ae57600080fd5b506102b7610a83565b60405161024b919061259b565b3480156102d057600080fd5b506102e46102df36600461235b565b610b15565b6040516001600160a01b03909116815260200161024b565b34801561030857600080fd5b506102676103173660046123f1565b610baa565b34801561032857600080fd5b506102676103373660046122d8565b610c1c565b34801561034857600080fd5b5061035260085481565b60405190815260200161024b565b34801561036c57600080fd5b5060095461028d90600160601b900463ffffffff1681565b34801561039057600080fd5b5061026761039f3660046121fb565b610d32565b3480156103b057600080fd5b506102676103bf3660046123f1565b610d63565b610267610db5565b3480156103d857600080fd5b506102676103e73660046121fb565b610e37565b3480156103f857600080fd5b5061026761040736600461235b565b610e52565b34801561041857600080fd5b5060095461028d90640100000000900463ffffffff1681565b34801561043d57600080fd5b5060095461028d9063ffffffff1681565b34801561045a57600080fd5b50600b5461023f90600160c01b900460ff1681565b34801561047b57600080fd5b506102e461048a36600461235b565b610e81565b34801561049b57600080fd5b506102676104aa366004612341565b610ef8565b3480156104bb57600080fd5b506103526104ca3660046121a8565b610f40565b3480156104db57600080fd5b50610267610fc7565b3480156104f057600080fd5b506102676104ff366004612301565b610ffd565b34801561051057600080fd5b506006546001600160a01b03166102e4565b34801561052e57600080fd5b506102b7611147565b34801561054357600080fd5b5061026761055236600461235b565b611156565b34801561056357600080fd5b506102676105723660046122af565b611185565b34801561058357600080fd5b50610267611194565b61026761059a3660046123f1565b6111d3565b3480156105ab57600080fd5b506102676105ba366004612236565b611424565b3480156105cb57600080fd5b50600d5461023f9060ff1681565b3480156105e557600080fd5b506102b76105f436600461235b565b611456565b34801561060557600080fd5b5061023f6106143660046121c9565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561064e57600080fd5b5061026761065d3660046121a8565b6114f7565b34801561066e57600080fd5b5061026761067d366004612341565b61158f565b34801561068e57600080fd5b5061026761069d3660046123f1565b6115cc565b3480156106ae57600080fd5b5060095461023f90600160801b900460ff1681565b3480156106cf57600080fd5b506102676106de3660046123ab565b611612565b60006001600160e01b031982166380ac58cd60e01b148061071457506001600160e01b03198216635b5e139f60e01b145b8061072f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b8260008163ffffffff16116107865760405162461bcd60e51b815260206004820152601260248201527126b4b73a1030ba103632b0b9ba1037b7329760711b60448201526064015b60405180910390fd5b60095461079a9063ffffffff16600161269e565b63ffffffff168163ffffffff16106107e85760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161077d565b8063ffffffff166008546107fc91906126da565b34101561083e5760405162461bcd60e51b815260206004820152601060248201526f2737ba1032b737bab3b410333ab7321760811b604482015260640161077d565b60095461085990600160601b900463ffffffff16600161269e565b60095463ffffffff91821691610879918491600160401b9091041661269e565b63ffffffff16106108bc5760405162461bcd60e51b815260206004820152600d60248201526c135a5b9d081cdbdb19081bdd5d609a1b604482015260640161077d565b600954336000908152600a602052604090205463ffffffff6401000000009092048216916108ed9190841690612686565b11156109345760405162461bcd60e51b815260206004820152601660248201527513585e081d1bdd185b081b5a5b9d081c995858da195960521b604482015260640161077d565b600d5460ff166109795760405162461bcd60e51b815260206004820152601060248201526f283932b9b0b632903737ba1037b832b760811b604482015260640161077d565b600e546109bc5760405162461bcd60e51b815260206004820152601160248201527050726573616c65206e6f7420726561647960781b604482015260640161077d565b610a3183838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600e546040516bffffffffffffffffffffffff193360601b16602082015290925060340190506040516020818303038152906040528051906020012061164f565b610a745760405162461bcd60e51b81526020600482015260146024820152732737ba103090383932b9b0b6329036b2b6b132b960611b604482015260640161077d565b610a7d84611665565b50505050565b606060008054610a929061273c565b80601f0160208091040260200160405190810160405280929190818152602001828054610abe9061273c565b8015610b0b5780601f10610ae057610100808354040283529160200191610b0b565b820191906000526020600020905b815481529060010190602001808311610aee57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610b8e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161077d565b506000908152600460205260409020546001600160a01b031690565b600b5464010000000090046001600160a01b03163314610c005760405162461bcd60e51b8152602060048201526011602482015270496e636f7272656374204164647265737360781b604482015260640161077d565b600b805463ffffffff191663ffffffff92909216919091179055565b6000610c2782610e81565b9050806001600160a01b0316836001600160a01b03161415610c955760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161077d565b336001600160a01b0382161480610cb15750610cb18133610614565b610d235760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161077d565b610d2d8383611760565b505050565b610d3c33826117ce565b610d585760405162461bcd60e51b815260040161077d90612635565b610d2d8383836118c5565b6006546001600160a01b03163314610d8d5760405162461bcd60e51b815260040161077d90612600565b6009805463ffffffff9092166401000000000267ffffffff0000000019909216919091179055565b6006546001600160a01b03163314610ddf5760405162461bcd60e51b815260040161077d90612600565b604051600090339047908381818185875af1925050503d8060008114610e21576040519150601f19603f3d011682016040523d82523d6000602084013e610e26565b606091505b5050905080610e3457600080fd5b50565b610d2d83838360405180602001604052806000815250611424565b6006546001600160a01b03163314610e7c5760405162461bcd60e51b815260040161077d90612600565b600855565b6000818152600260205260408120546001600160a01b03168061072f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161077d565b6006546001600160a01b03163314610f225760405162461bcd60e51b815260040161077d90612600565b60098054911515600160801b0260ff60801b19909216919091179055565b60006001600160a01b038216610fab5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161077d565b506001600160a01b031660009081526003602052604090205490565b6006546001600160a01b03163314610ff15760405162461bcd60e51b815260040161077d90612600565b610ffb6000611a65565b565b6006546001600160a01b031633146110275760405162461bcd60e51b815260040161077d90612600565b60005b63ffffffff8116821115610d2d5760095463ffffffff600160601b820481169161105e91600160401b90910416600161269e565b63ffffffff1611156110a25760405162461bcd60e51b815260206004820152600d60248201526c131a5b5a5d081c995858da1959609a1b604482015260640161077d565b61113583838363ffffffff168181106110cb57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906110e091906121a8565b600980546008906110fd90600160401b900463ffffffff16612792565b91906101000a81548163ffffffff021916908363ffffffff160217905563ffffffff1660405180602001604052806000815250611ab7565b8061113f81612792565b91505061102a565b606060018054610a929061273c565b6006546001600160a01b031633146111805760405162461bcd60e51b815260040161077d90612600565b600e55565b611190338383611aea565b5050565b6006546001600160a01b031633146111be5760405162461bcd60e51b815260040161077d90612600565b600b805460ff60c01b1916600160c01b179055565b8060008163ffffffff161161121f5760405162461bcd60e51b815260206004820152601260248201527126b4b73a1030ba103632b0b9ba1037b7329760711b604482015260640161077d565b6009546112339063ffffffff16600161269e565b63ffffffff168163ffffffff16106112815760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161077d565b8063ffffffff1660085461129591906126da565b3410156112d75760405162461bcd60e51b815260206004820152601060248201526f2737ba1032b737bab3b410333ab7321760811b604482015260640161077d565b6009546112f290600160601b900463ffffffff16600161269e565b60095463ffffffff91821691611312918491600160401b9091041661269e565b63ffffffff16106113555760405162461bcd60e51b815260206004820152600d60248201526c135a5b9d081cdbdb19081bdd5d609a1b604482015260640161077d565b600954336000908152600a602052604090205463ffffffff6401000000009092048216916113869190841690612686565b11156113cd5760405162461bcd60e51b815260206004820152601660248201527513585e081d1bdd185b081b5a5b9d081c995858da195960521b604482015260640161077d565b600954600160801b900460ff16151560011461141b5760405162461bcd60e51b815260206004820152600d60248201526c26b4b73a103737ba1037b832b760991b604482015260640161077d565b61119082611665565b61142e33836117ce565b61144a5760405162461bcd60e51b815260040161077d90612635565b610a7d84848484611bb9565b600954606090600160401b900463ffffffff168211156114a95760405162461bcd60e51b815260206004820152600e60248201526d139bdd081b5a5b9d1959081e595d60921b604482015260640161077d565b600b54600160c01b900460ff166114ec57600c6114c583611bec565b6040516020016114d69291906124a4565b6040516020818303038152906040529050919050565b60076114c583611bec565b6006546001600160a01b031633146115215760405162461bcd60e51b815260040161077d90612600565b6001600160a01b0381166115865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161077d565b610e3481611a65565b6006546001600160a01b031633146115b95760405162461bcd60e51b815260040161077d90612600565b600d805460ff1916911515919091179055565b6006546001600160a01b031633146115f65760405162461bcd60e51b815260040161077d90612600565b6009805463ffffffff191663ffffffff92909216919091179055565b6006546001600160a01b0316331461163c5760405162461bcd60e51b815260040161077d90612600565b805161119090600c90602084019061200f565b60008261165c8584611d06565b14949350505050565b60005b8163ffffffff168163ffffffff1610156116b05761169e336009600881819054906101000a900463ffffffff166110fd90612792565b806116a881612792565b915050611668565b50336000908152600a60205260408120805463ffffffff841692906116d6908490612686565b9091555050600b546000906001600160a01b03640100000000820416906103e8906117079063ffffffff16346126da565b61171191906126c6565b604051600081818185875af1925050503d806000811461174d576040519150601f19603f3d011682016040523d82523d6000602084013e611752565b606091505b505090508061119057600080fd5b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061179582610e81565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166118475760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161077d565b600061185283610e81565b9050806001600160a01b0316846001600160a01b0316148061188d5750836001600160a01b031661188284610b15565b6001600160a01b0316145b806118bd57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166118d882610e81565b6001600160a01b0316146119405760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161077d565b6001600160a01b0382166119a25760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161077d565b6119ad600082611760565b6001600160a01b03831660009081526003602052604081208054600192906119d69084906126f9565b90915550506001600160a01b0382166000908152600360205260408120805460019290611a04908490612686565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611ac18383611dc0565b611ace6000848484611f02565b610d2d5760405162461bcd60e51b815260040161077d906125ae565b816001600160a01b0316836001600160a01b03161415611b4c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161077d565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611bc48484846118c5565b611bd084848484611f02565b610a7d5760405162461bcd60e51b815260040161077d906125ae565b606081611c105750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611c3a5780611c2481612777565b9150611c339050600a836126c6565b9150611c14565b60008167ffffffffffffffff811115611c6357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611c8d576020820181803683370190505b5090505b84156118bd57611ca26001836126f9565b9150611caf600a866127b6565b611cba906030612686565b60f81b818381518110611cdd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611cff600a866126c6565b9450611c91565b600081815b8451811015611db8576000858281518110611d3657634e487b7160e01b600052603260045260246000fd5b60200260200101519050808311611d78576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250611da5565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080611db081612777565b915050611d0b565b509392505050565b6001600160a01b038216611e165760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161077d565b6000818152600260205260409020546001600160a01b031615611e7b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161077d565b6001600160a01b0382166000908152600360205260408120805460019290611ea4908490612686565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561200457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611f4690339089908890889060040161255e565b602060405180830381600087803b158015611f6057600080fd5b505af1925050508015611f90575060408051601f3d908101601f19168201909252611f8d9181019061238f565b60015b611fea573d808015611fbe576040519150601f19603f3d011682016040523d82523d6000602084013e611fc3565b606091505b508051611fe25760405162461bcd60e51b815260040161077d906125ae565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506118bd565b506001949350505050565b82805461201b9061273c565b90600052602060002090601f01602090048101928261203d5760008555612083565b82601f1061205657805160ff1916838001178555612083565b82800160010185558215612083579182015b82811115612083578251825591602001919060010190612068565b5061208f929150612093565b5090565b5b8082111561208f5760008155600101612094565b600067ffffffffffffffff808411156120c3576120c36127f6565b604051601f8501601f19908116603f011681019082821181831017156120eb576120eb6127f6565b8160405280935085815286868601111561210457600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461213557600080fd5b919050565b60008083601f84011261214b578081fd5b50813567ffffffffffffffff811115612162578182fd5b6020830191508360208260051b850101111561217d57600080fd5b9250929050565b8035801515811461213557600080fd5b803563ffffffff8116811461213557600080fd5b6000602082840312156121b9578081fd5b6121c28261211e565b9392505050565b600080604083850312156121db578081fd5b6121e48361211e565b91506121f26020840161211e565b90509250929050565b60008060006060848603121561220f578081fd5b6122188461211e565b92506122266020850161211e565b9150604084013590509250925092565b6000806000806080858703121561224b578081fd5b6122548561211e565b93506122626020860161211e565b925060408501359150606085013567ffffffffffffffff811115612284578182fd5b8501601f81018713612294578182fd5b6122a3878235602084016120a8565b91505092959194509250565b600080604083850312156122c1578182fd5b6122ca8361211e565b91506121f260208401612184565b600080604083850312156122ea578182fd5b6122f38361211e565b946020939093013593505050565b60008060208385031215612313578182fd5b823567ffffffffffffffff811115612329578283fd5b6123358582860161213a565b90969095509350505050565b600060208284031215612352578081fd5b6121c282612184565b60006020828403121561236c578081fd5b5035919050565b600060208284031215612384578081fd5b81356121c28161280c565b6000602082840312156123a0578081fd5b81516121c28161280c565b6000602082840312156123bc578081fd5b813567ffffffffffffffff8111156123d2578182fd5b8201601f810184136123e2578182fd5b6118bd848235602084016120a8565b600060208284031215612402578081fd5b6121c282612194565b60008060006040848603121561241f578081fd5b61242884612194565b9250602084013567ffffffffffffffff811115612443578182fd5b61244f8682870161213a565b9497909650939450505050565b60008151808452612474816020860160208601612710565b601f01601f19169290920160200192915050565b6000815161249a818560208601612710565b9290920192915050565b600080845482600182811c9150808316806124c057607f831692505b60208084108214156124e057634e487b7160e01b87526022600452602487fd5b8180156124f4576001811461250557612531565b60ff19861689528489019650612531565b60008b815260209020885b868110156125295781548b820152908501908301612510565b505084890196505b5050505050506125556125448286612488565b64173539b7b760d91b815260050190565b95945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906125919083018461245c565b9695505050505050565b6020815260006121c2602083018461245c565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60008219821115612699576126996127ca565b500190565b600063ffffffff8083168185168083038211156126bd576126bd6127ca565b01949350505050565b6000826126d5576126d56127e0565b500490565b60008160001904831182151516156126f4576126f46127ca565b500290565b60008282101561270b5761270b6127ca565b500390565b60005b8381101561272b578181015183820152602001612713565b83811115610a7d5750506000910152565b600181811c9082168061275057607f821691505b6020821081141561277157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561278b5761278b6127ca565b5060010190565b600063ffffffff808316818114156127ac576127ac6127ca565b6001019392505050565b6000826127c5576127c56127e0565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610e3457600080fdfea2646970667358221220150350ae84a226bd35e1918cbf5b5b2961a568d265627b53eac5603b968d0dac64736f6c63430008040033

Verified Source Code Partial Match

Compiler: v0.8.4+commit.c7e474f2 EVM: istanbul Optimization: Yes (200 runs)
NFTArtGenPresaleReveal.sol 1348 lines
// Sources flattened with hardhat v2.8.0 https://hardhat.org

// File @openzeppelin/contracts/utils/introspection/[email protected]

// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

// "SPDX-License-Identifier: UNLICENSED"


pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}


// File @openzeppelin/contracts/token/ERC721/[email protected]

// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}


// File @openzeppelin/contracts/token/ERC721/[email protected]

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


// File @openzeppelin/contracts/token/ERC721/extensions/[email protected]

// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}


// File @openzeppelin/contracts/utils/[email protected]

// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}


// File @openzeppelin/contracts/utils/[email protected]

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


// File @openzeppelin/contracts/utils/[email protected]

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


// File @openzeppelin/contracts/utils/introspection/[email protected]

// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}


// File @openzeppelin/contracts/token/ERC721/[email protected]

// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;







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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

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

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

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

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

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

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

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

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

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _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);
    }

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

    /**
     * @dev 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 {}
}


// File @openzeppelin/contracts/access/[email protected]

// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _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);
    }
}


// File contracts/NFTArtGen.sol


pragma solidity ^0.8.4;



// 
// Built by https://nft-generator.art
// 
contract NFTArtGen is ERC721, Ownable {
    string internal baseUri;

    uint256 public cost = 0.05 ether;
    uint32 public maxPerMint = 5;
    uint32 public maxPerWallet = 20;
    uint32 public supply = 0;
    uint32 public totalSupply = 0;
    bool public open = false;
    mapping(address => uint256) internal addressMintedMap;

    uint32 private commission = 49; // 4.9%
    address private author = 0x460Fd5059E7301680fA53E63bbBF7272E643e89C;

    constructor(
        string memory _uri,
        string memory _name,
        string memory _symbol,
        uint32 _totalSupply,
        uint256 _cost,
        bool _open
    ) ERC721(_name, _symbol) {
        baseUri = _uri;
        totalSupply = _totalSupply;
        cost = _cost;
        open = _open;
    }

    // ------ Author Only ------

    function setCommission(uint32 _commision) public {
        require(msg.sender == author, "Incorrect Address");
        commission = _commision;
    }

    // ------ Owner Only ------

    function setCost(uint256 _cost) public onlyOwner {
        cost = _cost;
    }

    function setOpen(bool _open) public onlyOwner {
        open = _open;
    }

    function setMaxPerWallet(uint32 _max) public onlyOwner {
        maxPerWallet = _max;
    }

    function setMaxPerMint(uint32 _max) public onlyOwner {
        maxPerMint = _max;
    }

    function airdrop(address[] calldata to) public onlyOwner {
        for (uint32 i = 0; i < to.length; i++) {
            require(1 + supply <= totalSupply, "Limit reached");
            _safeMint(to[i], ++supply, "");
        }
    }

    function withdraw() public payable onlyOwner {
        (bool success, ) = payable(msg.sender).call{
            value: address(this).balance
        }("");
        require(success);
    }

    // ------ Mint! ------

    function mint(uint32 count) external payable preMintChecks(count) {
        require(open == true, "Mint not open");
        performMint(count);
    }

    function performMint(uint32 count) internal {
        for (uint32 i = 0; i < count; i++) {
            _safeMint(msg.sender, ++supply, "");
        }
        
        addressMintedMap[msg.sender] += count;

        (bool success, ) = payable(author).call{
            value: (msg.value * commission) / 1000
        }("");
        require(success);
    }

    // ------ Read ------

    // ------ Modifiers ------

    modifier preMintChecks(uint32 count) {
        require(count > 0, "Mint at least one.");
        require(count < maxPerMint + 1, "Max mint reached.");
        require(msg.value >= cost * count, "Not enough fund.");
        require(supply + count < totalSupply + 1, "Mint sold out");
        require(
            addressMintedMap[msg.sender] + count <= maxPerWallet,
            "Max total mint reached"
        );
        _;
    }
}


// File contracts/utils/Revealable.sol


pragma solidity ^0.8.4;

abstract contract Revealable is NFTArtGen {
    bool public revealed = false;
    string internal uriNotRevealed;

    function setUnrevealedURI(string memory _uri) public onlyOwner {
        uriNotRevealed = _uri;
    }

    function reveal() public onlyOwner {
        revealed = true;
    }
}


// File @openzeppelin/contracts/utils/cryptography/[email protected]

// OpenZeppelin Contracts v4.4.1 (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 = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }
        return computedHash;
    }
}


// File contracts/utils/Presaleable.sol


pragma solidity ^0.8.4;


abstract contract Presaleable is NFTArtGen {
    bool public presaleOpen = false;
    bytes32 private merkleRoot;

    function setPresaleOpen(bool _open) public onlyOwner {
        presaleOpen = _open;
    }

    function setPreSaleAddresses(bytes32 root) public onlyOwner {
        merkleRoot = root;
    }

    function presaleMint(uint32 count, bytes32[] calldata proof)
        external
        payable
        preMintChecks(count)
    {
        require(presaleOpen, "Presale not open");
        require(merkleRoot != "", "Presale not ready");
        require(
            MerkleProof.verify(
                proof,
                merkleRoot,
                keccak256(abi.encodePacked(msg.sender))
            ),
            "Not a presale member"
        );

        performMint(count);
    }
}


// File contracts/extensions/PresaleReveal.sol


pragma solidity ^0.8.4;



contract NFTArtGenPresaleReveal is NFTArtGen, Revealable, Presaleable {
    constructor(
        string memory _uri,
        string memory _name,
        string memory _symbol,
        uint32 _totalSupply,
        uint256 _cost,
        bool _open
    ) NFTArtGen(_uri, _name, _symbol, _totalSupply, _cost, _open) {}

    function tokenURI(uint256 _tokenId)
        public
        view
        override
        returns (string memory)
    {
        require(_tokenId <= supply, "Not minted yet");
        if (revealed == false) {
            return string(
                abi.encodePacked(uriNotRevealed, Strings.toString(_tokenId), ".json")
            );
        }

        return
            string(
                abi.encodePacked(baseUri, Strings.toString(_tokenId), ".json")
            );
    }
}

Read Contract

balanceOf 0x70a08231 → uint256
cost 0x13faede6 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxPerMint 0x507e094f → uint32
maxPerWallet 0x453c2310 → uint32
name 0x06fdde03 → string
open 0xfcfff16f → bool
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
presaleOpen 0xbee6348a → bool
revealed 0x51830227 → bool
supply 0x047fc9aa → uint32
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint32

Write Contract 20 functions

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

airdrop 0x729ad39e
address[] to
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa71bbebe
uint32 count
presaleMint 0x0364d22a
uint32 count
bytes32[] proof
renounceOwnership 0x715018a6
No parameters
reveal 0xa475b5dd
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
setCommission 0x092501a0
uint32 _commision
setCost 0x44a0d68a
uint256 _cost
setMaxPerMint 0xf8048d8f
uint32 _max
setMaxPerWallet 0x3006b543
uint32 _max
setOpen 0x6fdca5e0
bool _open
setPreSaleAddresses 0x9e5666cd
bytes32 root
setPresaleOpen 0xf5b96621
bool _open
setUnrevealedURI 0xfe2c7fee
string _uri
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters

Recent Transactions

No transactions found for this address