Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xB5893a75b74F9cACCd3c23b4A974DB5F53B4E9D2
Balance 0 ETH
Nonce 1
Code Size 9336 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

9336 bytes
0x6080604052600436106102675760003560e01c80638611244c11610144578063b584b78d116100b6578063cfbe73551161007a578063cfbe73551461072c578063da3ef23f1461074c578063e985e9c51461076c578063f2fde38b1461078c578063fe2c7fee146107ac578063feaea586146107cc57600080fd5b8063b584b78d146106a1578063b88d4fde146106b6578063bee6348a146106d6578063c6682862146106f7578063c87b56dd1461070c57600080fd5b8063a0712d6811610108578063a0712d68146105ed578063a0f45b6914610600578063a205ea4214610636578063a22cb46514610657578063a43be57b14610677578063a475b5dd1461068c57600080fd5b80638611244c146105555780638da5cb5b1461056a57806395d89b411461058a578063964c33b51461059f5780639c3e73c3146105cc57600080fd5b806342842e0e116101dd57806355f804b3116101a157806355f804b3146104955780636352211e146104b55780636833a228146104d55780636c0360eb146104f557806370a082311461050a578063715018a61461054057600080fd5b806342842e0e146103f957806342ca1d091461041957806344a0d68a14610434578063518302271461045457806351cff8d91461047557600080fd5b8063095ea7b31161022f578063095ea7b31461032757806313faede61461034757806318160ddd1461036b57806323b872dd146103a15780632a23d07d146103c15780632a484ad4146103d757600080fd5b806301ffc9a71461026c57806303a17969146102a157806304c98b2b146102b857806306fdde03146102cd578063081812fc146102ef575b600080fd5b34801561027857600080fd5b5061028c610287366004612039565b6107ec565b60405190151581526020015b60405180910390f35b3480156102ad57600080fd5b506102b661083e565b005b3480156102c457600080fd5b506102b6610880565b3480156102d957600080fd5b506102e26108c0565b6040516102989190612268565b3480156102fb57600080fd5b5061030f61030a3660046120d9565b610952565b6040516001600160a01b039091168152602001610298565b34801561033357600080fd5b506102b6610342366004611ff2565b6109e4565b34801561035357600080fd5b5061035d60055481565b604051908152602001610298565b34801561037757600080fd5b5060035461038e90640100000000900461ffff1681565b60405161ffff9091168152602001610298565b3480156103ad57600080fd5b506102b66103bc366004611f08565b610afa565b3480156103cd57600080fd5b5061035d60045481565b3480156103e357600080fd5b5060035461038e90600160301b900461ffff1681565b34801561040557600080fd5b506102b6610414366004611f08565b610b05565b34801561042557600080fd5b5060035461038e9061ffff1681565b34801561044057600080fd5b506102b661044f3660046120d9565b610b20565b34801561046057600080fd5b5060035461028c90600160401b900460ff1681565b34801561048157600080fd5b506102b6610490366004611ead565b610b4f565b3480156104a157600080fd5b506102b66104b0366004612071565b610b86565b3480156104c157600080fd5b5061030f6104d03660046120d9565b610bc7565b3480156104e157600080fd5b506102b66104f0366004612109565b610c36565b34801561050157600080fd5b506102e2610c83565b34801561051657600080fd5b5061035d610525366004611ead565b6001600160a01b031660009081526007602052604090205490565b34801561054c57600080fd5b506102b6610d11565b34801561056157600080fd5b506102b6610d4d565b34801561057657600080fd5b5060005461030f906001600160a01b031681565b34801561059657600080fd5b506102e2610d8d565b3480156105ab57600080fd5b5061035d6105ba366004611ead565b60096020526000908152604090205481565b3480156105d857600080fd5b5060035461028c90600160501b900460ff1681565b6102b66105fb3660046120d9565b610d9c565b34801561060c57600080fd5b5061030f61061b3660046120d9565b6008602052600090815260409020546001600160a01b031681565b34801561064257600080fd5b5060035461038e9062010000900461ffff1681565b34801561066357600080fd5b506102b6610672366004611fc5565b611078565b34801561068357600080fd5b506102b6611083565b34801561069857600080fd5b506102b66110c2565b3480156106ad57600080fd5b506102e2611106565b3480156106c257600080fd5b506102b66106d1366004611f48565b611113565b3480156106e257600080fd5b5060035461028c90600160481b900460ff1681565b34801561070357600080fd5b506102e261114d565b34801561071857600080fd5b506102e26107273660046120d9565b61115a565b34801561073857600080fd5b506102b66107473660046120b7565b6113df565b34801561075857600080fd5b506102b6610767366004612071565b611421565b34801561077857600080fd5b5061028c610787366004611ed0565b61145e565b34801561079857600080fd5b506102b66107a7366004611ead565b61148c565b3480156107b857600080fd5b506102b66107c7366004612071565b6114d8565b3480156107d857600080fd5b506102b66107e7366004611ed0565b611515565b60006001600160e01b031982166380ac58cd60e01b148061081d57506001600160e01b03198216635b5e139f60e01b145b8061083857506001600160e01b031982166301ffc9a760e01b145b92915050565b6000546001600160a01b031633146108715760405162461bcd60e51b81526004016108689061227b565b60405180910390fd5b6003805460ff60501b19169055565b6000546001600160a01b031633146108aa5760405162461bcd60e51b81526004016108689061227b565b6003805461ffff60481b1916600160481b179055565b6060600180546108cf9061235d565b80601f01602080910402602001604051908101604052809291908181526020018280546108fb9061235d565b80156109485780601f1061091d57610100808354040283529160200191610948565b820191906000526020600020905b81548152906001019060200180831161092b57829003601f168201915b5050505050905090565b600354600090640100000000900461ffff168211156109c85760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610868565b506000908152600d60205260409020546001600160a01b031690565b60006109ef82610bc7565b9050806001600160a01b0316836001600160a01b03161415610a5d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610868565b336001600160a01b0382161480610a795750610a79813361145e565b610aeb5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610868565b610af5838361163e565b505050565b610af58383836116ac565b610af583838360405180602001604052806000815250611113565b6000546001600160a01b03163314610b4a5760405162461bcd60e51b81526004016108689061227b565b600555565b6000546001600160a01b03163314610b795760405162461bcd60e51b81526004016108689061227b565b610b838147611917565b50565b6000546001600160a01b03163314610bb05760405162461bcd60e51b81526004016108689061227b565b8051610bc390600a906020840190611d9e565b5050565b60006006548210610bda57506000919050565b815b600181118015610c0157506000818152600860205260409020546001600160a01b0316155b15610c1857610c1160018261231a565b9050610bdc565b6000908152600860205260409020546001600160a01b031692915050565b6000546001600160a01b03163314610c605760405162461bcd60e51b81526004016108689061227b565b6003805467ffff000000000000191660ff92909216600160301b02919091179055565b600a8054610c909061235d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbc9061235d565b8015610d095780601f10610cde57610100808354040283529160200191610d09565b820191906000526020600020905b815481529060010190602001808311610cec57829003601f168201915b505050505081565b6000546001600160a01b03163314610d3b5760405162461bcd60e51b81526004016108689061227b565b600080546001600160a01b0319169055565b6000546001600160a01b03163314610d775760405162461bcd60e51b81526004016108689061227b565b6003805461ffff60481b1916600160501b179055565b6060600280546108cf9061235d565b60035433600090815260096020526040902054600160301b90910461ffff1690610dc79083906122cf565b1115610e085760405162461bcd60e51b815260206004820152601060248201526f11549493d48e88139195081b1a5b5a5d60821b6044820152606401610868565b60035461ffff80821691610e24918491620100009004166122cf565b1115610e635760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b6044820152606401610868565b600354600160501b900460ff1680610e845750600354600160481b900460ff165b610ec35760405162461bcd60e51b815260206004820152601060248201526f29b0b6329034b9903737ba1037b832b760811b6044820152606401610868565b600354600090600160481b900460ff16610edf57600554610ee3565b6004545b90506000610ef183836122fb565b905080341015610f3a5760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152606401610868565b80341115610f7a57336108fc610f50833461231a565b6040518115909202916000818181858888f19350505050158015610f78573d6000803e3d6000fd5b505b60005b83811015610fd25780600654610f9391906122cf565b60405133906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610fcb6001826122cf565b9050610f7d565b50600654600090815260086020526040902080546001600160a01b031916339081179091556110019084611a30565b82600360028282829054906101000a900461ffff1661102091906122a9565b92506101000a81548161ffff021916908361ffff16021790555082600360048282829054906101000a900461ffff1661105991906122a9565b92506101000a81548161ffff021916908361ffff160217905550505050565b610bc3338383611aa7565b6000546001600160a01b031633146110ad5760405162461bcd60e51b81526004016108689061227b565b6003805469ff00000000000000000019169055565b6000546001600160a01b031633146110ec5760405162461bcd60e51b81526004016108689061227b565b6003805468ff00000000000000001916600160401b179055565b600b8054610c909061235d565b61111e8484846116ac565b61112a84848484611b76565b611147576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b600c8054610c909061235d565b600354606090640100000000900461ffff168211156111d35760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610868565b600354600160401b900460ff1661127657600b80546111f19061235d565b80601f016020809104026020016040519081016040528092919081815260200182805461121d9061235d565b801561126a5780601f1061123f5761010080835404028352916020019161126a565b820191906000526020600020905b81548152906001019060200180831161124d57829003601f168201915b50505050509050919050565b604080516020810190915260008152600a8310156112ae575060408051808201909152600381526203030360ec1b60208201526112fa565b60648310156112d65750604080518082019091526002815261030360f41b60208201526112fa565b6103e88310156112fa57506040805180820190915260018152600360fc1b60208201525b6000600a80546113099061235d565b80601f01602080910402602001604051908101604052809291908181526020018280546113359061235d565b80156113825780601f1061135757610100808354040283529160200191611382565b820191906000526020600020905b81548152906001019060200180831161136557829003601f168201915b5050505050905060008151116113a757604051806020016040528060008152506113d7565b80826113b286611c84565b600c6040516020016113c79493929190612156565b6040516020818303038152906040525b949350505050565b6000546001600160a01b031633146114095760405162461bcd60e51b81526004016108689061227b565b6003805461ffff191661ffff92909216919091179055565b6000546001600160a01b0316331461144b5760405162461bcd60e51b81526004016108689061227b565b8051610bc390600c906020840190611d9e565b6001600160a01b039182166000908152600e6020908152604080832093909416825291909152205460ff1690565b6000546001600160a01b031633146114b65760405162461bcd60e51b81526004016108689061227b565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146115025760405162461bcd60e51b81526004016108689061227b565b8051610bc390600b906020840190611d9e565b6000546001600160a01b0316331461153f5760405162461bcd60e51b81526004016108689061227b565b6040516370a0823160e01b81523060048201526001600160a01b0383169063a9059cbb90839083906370a082319060240160206040518083038186803b15801561158857600080fd5b505afa15801561159c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c091906120f1565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561160657600080fd5b505af115801561161a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af5919061201d565b6000818152600d6020526040902080546001600160a01b0319166001600160a01b038416908117909155819061167382610bc7565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006116b782610bc7565b9050826001600160a01b0316846001600160a01b0316141561171b5760405162461bcd60e51b815260206004820152601f60248201527f596f752063616e6e6f74207472616e7366657220746f20796f757273656c66006044820152606401610868565b806001600160a01b0316846001600160a01b0316146117735760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642066726f6d206164647265737360601b6044820152606401610868565b336001600160a01b038216148061178f575061178f813361145e565b806117aa57503361179f83610952565b6001600160a01b0316145b6117e65760405162461bcd60e51b815260206004820152600d60248201526c1058d8d95cdcc819195b9a5959609a1b6044820152606401610868565b6117f160008361163e565b600082815260086020526040812080546001600160a01b0319166001600160a01b0386161790556118238360016122cf565b6000818152600860205260409020549091506001600160a01b031615801561184c575060065481105b1561187957600081815260086020526040902080546001600160a01b0319166001600160a01b0384161790555b6001600160a01b03821660009081526007602052604081208054600192906118a290849061231a565b90915550506001600160a01b03841660009081526007602052604081208054600192906118d09084906122cf565b909155505060405183906001600160a01b0380871691908816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a45050505050565b804710156119675760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610868565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119b4576040519150601f19603f3d011682016040523d82523d6000602084013e6119b9565b606091505b5050905080610af55760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610868565b6001600160a01b03821660009081526007602052604081208054839290611a589084906122cf565b90915550506001600160a01b03821660009081526009602052604081208054839290611a859084906122cf565b925050819055508060066000828254611a9e91906122cf565b90915550505050565b816001600160a01b0316836001600160a01b03161415611b095760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610868565b6001600160a01b038381166000818152600e6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60006001600160a01b0384163b15611c7957604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611bba90339089908890889060040161222b565b602060405180830381600087803b158015611bd457600080fd5b505af1925050508015611c04575060408051601f3d908101601f19168201909252611c0191810190612055565b60015b611c5f573d808015611c32576040519150601f19603f3d011682016040523d82523d6000602084013e611c37565b606091505b508051611c57576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506113d7565b506001949350505050565b606081611ca85750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611cd25780611cbc81612398565b9150611ccb9050600a836122e7565b9150611cac565b60008167ffffffffffffffff811115611cfb57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611d25576020820181803683370190505b5090505b84156113d757611d3a60018361231a565b9150611d47600a866123b3565b611d529060306122cf565b60f81b818381518110611d7557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350611d97600a866122e7565b9450611d29565b828054611daa9061235d565b90600052602060002090601f016020900481019282611dcc5760008555611e12565b82601f10611de557805160ff1916838001178555611e12565b82800160010185558215611e12579182015b82811115611e12578251825591602001919060010190611df7565b50611e1e929150611e22565b5090565b5b80821115611e1e5760008155600101611e23565b600067ffffffffffffffff80841115611e5257611e526123f3565b604051601f8501601f19908116603f01168101908282118183101715611e7a57611e7a6123f3565b81604052809350858152868686011115611e9357600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215611ebe578081fd5b8135611ec981612409565b9392505050565b60008060408385031215611ee2578081fd5b8235611eed81612409565b91506020830135611efd81612409565b809150509250929050565b600080600060608486031215611f1c578081fd5b8335611f2781612409565b92506020840135611f3781612409565b929592945050506040919091013590565b60008060008060808587031215611f5d578081fd5b8435611f6881612409565b93506020850135611f7881612409565b925060408501359150606085013567ffffffffffffffff811115611f9a578182fd5b8501601f81018713611faa578182fd5b611fb987823560208401611e37565b91505092959194509250565b60008060408385031215611fd7578182fd5b8235611fe281612409565b91506020830135611efd8161241e565b60008060408385031215612004578182fd5b823561200f81612409565b946020939093013593505050565b60006020828403121561202e578081fd5b8151611ec98161241e565b60006020828403121561204a578081fd5b8135611ec98161242c565b600060208284031215612066578081fd5b8151611ec98161242c565b600060208284031215612082578081fd5b813567ffffffffffffffff811115612098578182fd5b8201601f810184136120a8578182fd5b6113d784823560208401611e37565b6000602082840312156120c8578081fd5b813561ffff81168114611ec9578182fd5b6000602082840312156120ea578081fd5b5035919050565b600060208284031215612102578081fd5b5051919050565b60006020828403121561211a578081fd5b813560ff81168114611ec9578182fd5b60008151808452612142816020860160208601612331565b601f01601f19169290920160200192915050565b6000855160206121698285838b01612331565b86519184019161217c8184848b01612331565b865192019161218e8184848a01612331565b85549201918390600181811c90808316806121aa57607f831692505b8583108114156121c857634e487b7160e01b88526022600452602488fd5b8080156121dc57600181146121ed57612219565b60ff19851688528388019550612219565b60008b815260209020895b858110156122115781548a8201529084019088016121f8565b505083880195505b50939c9b505050505050505050505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061225e9083018461212a565b9695505050505050565b602081526000611ec9602083018461212a565b60208082526014908201527311549493d488481058d8d95cdcc819195b9a595960621b604082015260600190565b600061ffff8083168185168083038211156122c6576122c66123c7565b01949350505050565b600082198211156122e2576122e26123c7565b500190565b6000826122f6576122f66123dd565b500490565b6000816000190483118215151615612315576123156123c7565b500290565b60008282101561232c5761232c6123c7565b500390565b60005b8381101561234c578181015183820152602001612334565b838111156111475750506000910152565b600181811c9082168061237157607f821691505b6020821081141561239257634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156123ac576123ac6123c7565b5060010190565b6000826123c2576123c26123dd565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b8357600080fd5b8015158114610b8357600080fd5b6001600160e01b031981168114610b8357600080fdfea26469706673582212205e4bf4e1c5bc3c37aee2d77e89e13ed8365549a1d7c702bd7b3aef82b5b8ada264736f6c63430008040033

Verified Source Code Full Match

Compiler: v0.8.4+commit.c7e474f2 EVM: istanbul Optimization: Yes (200 runs)
ClownzNFT.sol 963 lines
// SPDX-License-Identifier: GPL-3.0
// File: @openzeppelin/contracts/utils/Strings.sol


// 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/Address.sol


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

// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol


// 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/utils/introspection/IERC165.sol


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

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol


// 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/IERC721.sol


// 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/extensions/IERC721Metadata.sol


// 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: SMSC.sol



pragma solidity ^0.8.4;

interface IERC20 {
    function totalSupply() external view returns (uint256);

    function decimals() external view returns (uint8);

    function symbol() external view returns (string memory);

    function name() external view returns (string memory);

    function getOwner() external view returns (address);

    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount) external returns (bool);

    function allowance(address _owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(address indexed owner, address indexed spender, uint256 value);
}



error TransferToNonERC721ReceiverImplementer();

contract Ownable {
    address public owner;

    constructor() {
        owner = msg.sender;
    }

    // ownership
    modifier onlyOwner() {
        require(msg.sender == owner, "ERROR! Access denied");
        _;
    }

    function transferOwnership(address _newOwner) external onlyOwner {
        owner = _newOwner;
    }

    function renounceOwnership() external onlyOwner {
        owner = address(0);
    }
}

contract ClownzNFT is IERC721, Ownable {
    using Address for address;
    using Strings for uint256;

    string private _name = "House of Clownz";
    string private _symbol = "Clownz";

    uint16 public pubsaleSupply = 10000;
    uint16 public pubsaledAmount;
    uint16 public totalSupply;
    uint16 public limitPerAddress = 3;

    bool public revealed;

    bool public presaleOpen;
    bool public pubsaleOpen;

    uint public presaleCost = 0;
    uint256 public cost = 0.05 ether;
    uint256 internal _currentIndex = 1;

    mapping(address => uint256) private _balances;
    mapping(uint256 => address) public ownership;
    mapping(address => uint256) public addressMints;

    string public baseURI;
    string public norevealedURI;
    string public baseExtension;

    mapping(uint256 => address) private _tokenApprovals;
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    modifier onlyTokenOwner(uint256 tokenId) {
        require(
            ownerOf(tokenId) == msg.sender,
            "ERROR! You must be the token owner"
        );
        _;
    }

    function name() public view returns (string memory) {
        return _name;
    }

    function symbol() public view returns (string memory) {
        return _symbol;
    }

    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

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

        _approve(to, tokenId);
    }

    function getApproved(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        require(
            tokenId <= totalSupply,
            "ERC721: approved query for nonexistent token"
        );

        return _tokenApprovals[tokenId];
    }

    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        _setApprovalForAll(msg.sender, operator, approved);
    }

    function isApprovedForAll(address owner, address operator)
        public
        view
        virtual
        override
        returns (bool)
    {
        return _operatorApprovals[owner][operator];
    }

    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

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

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

    function setLimitPerAddress(uint8 _limit) external onlyOwner {
        limitPerAddress = _limit;
    }

    function startPresale() external onlyOwner {
        presaleOpen = true;
        pubsaleOpen = false;
    }

    function endPresale() external onlyOwner {
        presaleOpen = false;
    }

    function startPubsale() external onlyOwner {
        pubsaleOpen = true;
        presaleOpen = false;
    }

    function endPubsale() external onlyOwner {
        pubsaleOpen = false;
    }

    function balanceOf(address owner) public view override returns (uint256) {
        return _balances[owner];
    }

    function ownerOf(uint256 tokenId) public view override returns (address) {
        if (tokenId >= _currentIndex) {
            return address(0);
        }

        uint256 id = tokenId;
        while (id > 1 && ownership[id] == address(0)) {
            id -= 1;
        }
        return ownership[id];
    }

    function mint(uint256 amount) external payable {
        require(
            addressMints[msg.sender] + amount <= limitPerAddress,
            "ERROR: NFT limit"
        );
        require(pubsaledAmount + amount <= pubsaleSupply, "Invalid amount");
        require(pubsaleOpen || presaleOpen, "Sale is not open");

        uint _cost = presaleOpen? presaleCost : cost;

        uint256 totalCost = _cost * amount;
        require(msg.value >= totalCost, "Insufficient payment");

        if (msg.value > totalCost) {
            payable(msg.sender).transfer(msg.value - totalCost);
        }

        for (uint256 i = 0; i < amount; i += 1) {
            emit Transfer(address(0), msg.sender, _currentIndex + i);
        }

        ownership[_currentIndex] = msg.sender;
        _mint(msg.sender, amount);

        pubsaledAmount += uint16(amount);
        totalSupply += uint16(amount);
    }

    function _mint(address to, uint256 amount) internal {
        _balances[to] += amount;
        addressMints[to] += amount;
        _currentIndex += amount;
    }

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override {
        _transfer(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override {
        safeTransferFrom(from, to, tokenId, "");
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public override {
        _transfer(from, to, tokenId);

        if (!_checkOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal {
        address preOwner = ownerOf(tokenId);

        require(from != to, "You cannot transfer to yourself");
        require(from == preOwner, "Invalid from address");
        require(
            msg.sender == preOwner ||
                isApprovedForAll(preOwner, msg.sender) ||
                getApproved(tokenId) == msg.sender,
            "Access denied"
        );

        _approve(address(0), tokenId);

        ownership[tokenId] = to;

        uint256 nextId = tokenId + 1;

        if (ownership[nextId] == address(0) && nextId < _currentIndex) {
            ownership[nextId] = preOwner;
        }

        _balances[preOwner] -= 1;
        _balances[to] += 1;

        emit Transfer(from, to, tokenId);
    }

    function tokenURI(uint256 tokenId) public view returns (string memory) {
        require(
            tokenId <= totalSupply,
            "ERC721Metadata: URI query for nonexistent token"
        );

        if (revealed == false) {
            return norevealedURI;
        }

        string memory zeros = "";
        if (tokenId < 10) zeros = "000";
        else if (tokenId < 100) zeros = "00";
        else if (tokenId < 1000) zeros = "0";

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

    function setBaseURI(string memory _baseURI) external onlyOwner {
        baseURI = _baseURI;
    }

    function setUnrevealedURI(string memory _uri) external onlyOwner {
        norevealedURI = _uri;
    }

    function setBaseExtension(string memory _ext) external onlyOwner {
        baseExtension = _ext;
    }

    function setPubsaleSupply(uint16 _amount) external onlyOwner {
        pubsaleSupply = _amount;
    }

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

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(IERC165)
        returns (bool)
    {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            interfaceId == type(IERC165).interfaceId;
    }

    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try
                IERC721Receiver(to).onERC721Received(
                    msg.sender,
                    from,
                    tokenId,
                    _data
                )
            returns (bytes4 retval) {
                return retval == IERC721Receiver(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert TransferToNonERC721ReceiverImplementer();
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    function withdraw(address payable to) external onlyOwner {
        Address.sendValue(to, address(this).balance);
    }

    function recoverToken(address token, address to) external onlyOwner {
        IERC20(token).transfer(to, IERC20(token).balanceOf(address(this)));
    }
}

Read Contract

addressMints 0x964c33b5 → uint256
balanceOf 0x70a08231 → uint256
baseExtension 0xc6682862 → string
baseURI 0x6c0360eb → string
cost 0x13faede6 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
limitPerAddress 0x2a484ad4 → uint16
name 0x06fdde03 → string
norevealedURI 0xb584b78d → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
ownership 0xa0f45b69 → address
presaleCost 0x2a23d07d → uint256
presaleOpen 0xbee6348a → bool
pubsaleOpen 0x9c3e73c3 → bool
pubsaleSupply 0x42ca1d09 → uint16
pubsaledAmount 0xa205ea42 → uint16
revealed 0x51830227 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint16

Write Contract 21 functions

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

approve 0x095ea7b3
address to
uint256 tokenId
endPresale 0xa43be57b
No parameters
endPubsale 0x03a17969
No parameters
mint 0xa0712d68
uint256 amount
recoverToken 0xfeaea586
address token
address to
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
setBaseExtension 0xda3ef23f
string _ext
setBaseURI 0x55f804b3
string _baseURI
setCost 0x44a0d68a
uint256 _cost
setLimitPerAddress 0x6833a228
uint8 _limit
setPubsaleSupply 0xcfbe7355
uint16 _amount
setUnrevealedURI 0xfe2c7fee
string _uri
startPresale 0x04c98b2b
No parameters
startPubsale 0x8611244c
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address _newOwner
withdraw 0x51cff8d9
address to

Recent Transactions

No transactions found for this address