Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xb828184F3fcdf20da3812eFf491610b55cDcB3E2
Balance 0.003000 ETH
Nonce 1
Code Size 11202 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

11202 bytes
0x6080604052600436106102345760003560e01c80636c0360eb1161012e578063b88d4fde116100ab578063dc33e6811161006f578063dc33e681146106a0578063e985e9c5146106c0578063ec6d078914610709578063f16f0d7314610729578063f2fde38b1461074957600080fd5b8063b88d4fde14610613578063c87b56dd14610633578063d334c54f14610653578063d5abeb0114610668578063d7224ba01461068a57600080fd5b80639231ab2a116100f25780639231ab2a14610553578063954d90d0146105a957806395d89b41146105c9578063a22cb465146105de578063a2309ff8146105fe57600080fd5b80636c0360eb146104c957806370a08231146104de578063715018a6146104fe5780638da5cb5b146105135780639028241b1461053157600080fd5b80632d20fb60116101bc5780634f558e79116101805780634f558e791461042757806355f804b31461044757806359008f311461046757806362d5d3f0146104875780636352211e146104a957600080fd5b80632d20fb601461039f5780632d4d8765146103bf5780633ccfd60b146103df57806342842e0e146103f45780634b11faaf1461041457600080fd5b80630829ea90116102035780630829ea9014610304578063095ea7b31461032657806318160ddd1461034657806323b872dd146103695780632c4e9fc61461038957600080fd5b806301ffc9a7146102405780630397cfb51461027557806306fdde03146102aa578063081812fc146102cc57600080fd5b3661023b57005b600080fd5b34801561024c57600080fd5b5061026061025b366004612826565b610769565b60405190151581526020015b60405180910390f35b34801561028157600080fd5b5060095461029790600160f01b900461ffff1681565b60405161ffff909116815260200161026c565b3480156102b657600080fd5b506102bf6107bb565b60405161026c91906129c9565b3480156102d857600080fd5b506102ec6102e736600461280e565b61084d565b6040516001600160a01b03909116815260200161026c565b34801561031057600080fd5b5061032461031f366004612783565b610891565b005b34801561033257600080fd5b506103246103413660046126c4565b610a3d565b34801561035257600080fd5b50600154600054035b60405190815260200161026c565b34801561037557600080fd5b5061032461038436600461257f565b610acb565b34801561039557600080fd5b5061035b600b5481565b3480156103ab57600080fd5b506103246103ba36600461280e565b610c40565b3480156103cb57600080fd5b506103246103da36600461280e565b610c76565b3480156103eb57600080fd5b50610324610ca5565b34801561040057600080fd5b5061032461040f36600461257f565b610d5a565b6103246104223660046126ed565b610eea565b34801561043357600080fd5b5061026061044236600461280e565b6110d1565b34801561045357600080fd5b5061032461046236600461285e565b6110dc565b34801561047357600080fd5b506103246104823660046128d2565b611112565b34801561049357600080fd5b5060095461029790600160b01b900461ffff1681565b3480156104b557600080fd5b506102ec6104c436600461280e565b61125b565b3480156104d557600080fd5b506102bf61126d565b3480156104ea57600080fd5b5061035b6104f9366004612533565b61127c565b34801561050a57600080fd5b506103246112ca565b34801561051f57600080fd5b506009546001600160a01b03166102ec565b34801561053d57600080fd5b5060095461029790600160a01b900461ffff1681565b34801561055f57600080fd5b5061057361056e36600461280e565b611300565b6040805182516001600160a01b031681526020808401516001600160401b0316908201529181015115159082015260600161026c565b3480156105b557600080fd5b506102606105c4366004612744565b611326565b3480156105d557600080fd5b506102bf6113ea565b3480156105ea57600080fd5b506103246105f936600461268e565b6113f9565b34801561060a57600080fd5b5060005461035b565b34801561061f57600080fd5b5061032461062e3660046125ba565b61148f565b34801561063f57600080fd5b506102bf61064e36600461280e565b611684565b34801561065f57600080fd5b50610260611709565b34801561067457600080fd5b5060095461029790600160e01b900461ffff1681565b34801561069657600080fd5b5061035b60085481565b3480156106ac57600080fd5b5061035b6106bb366004612533565b611731565b3480156106cc57600080fd5b506102606106db36600461254d565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b34801561071557600080fd5b506103246107243660046128b8565b61175f565b34801561073557600080fd5b5061032461074436600461290d565b6117fd565b34801561075557600080fd5b50610324610764366004612533565b611897565b60006001600160e01b031982166380ac58cd60e01b148061079a57506001600160e01b03198216635b5e139f60e01b145b806107b557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600280546107ca90612abc565b80601f01602080910402602001604051908101604052809291908181526020018280546107f690612abc565b80156108435780601f1061081857610100808354040283529160200191610843565b820191906000526020600020905b81548152906001019060200180831161082657829003601f168201915b5050505050905090565b60006108588261192f565b610875576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6009546001600160a01b031633146108c45760405162461bcd60e51b81526004016108bb906129dc565b60405180910390fd5b6000805b82811015610919578383828181106108f057634e487b7160e01b600052603260045260246000fd5b90506040020160200135826109059190612a2e565b91508061091181612af7565b9150506108c8565b5060095461ffff600160b01b820481169161093d91600160a01b9091041683612a2e565b11156109795760405162461bcd60e51b815260206004820152600b60248201526a18d85b9b9bdd081b5a5b9d60aa1b60448201526064016108bb565b80600960148282829054906101000a900461ffff166109989190612a11565b92506101000a81548161ffff021916908361ffff16021790555060005b82811015610a3757610a258484838181106109e057634e487b7160e01b600052603260045260246000fd5b6109f69260206040909202019081019150612533565b858584818110610a1657634e487b7160e01b600052603260045260246000fd5b9050604002016020013561195a565b80610a2f81612af7565b9150506109b5565b50505050565b6000610a488261125b565b9050806001600160a01b0316836001600160a01b03161415610a7d5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610a9d5750610a9b81336106db565b155b15610abb576040516367d9dca160e11b815260040160405180910390fd5b610ac6838383611978565b505050565b826daaeb6d7670e522a718067333cd4e3b15610c35576001600160a01b038116331415610b0257610afd8484846119d4565b610a37565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c61711349060440160206040518083038186803b158015610b4c57600080fd5b505afa158015610b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8491906127f2565b8015610c165750604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c61711349060440160206040518083038186803b158015610bde57600080fd5b505afa158015610bf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1691906127f2565b610c3557604051633b79c77360e21b81523360048201526024016108bb565b610a378484846119d4565b6009546001600160a01b03163314610c6a5760405162461bcd60e51b81526004016108bb906129dc565b610c7381611bbf565b50565b6009546001600160a01b03163314610ca05760405162461bcd60e51b81526004016108bb906129dc565b600a55565b6009546001600160a01b03163314610ccf5760405162461bcd60e51b81526004016108bb906129dc565b604051600090339047908381818185875af1925050503d8060008114610d11576040519150601f19603f3d011682016040523d82523d6000602084013e610d16565b606091505b5050905080610c735760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064016108bb565b826daaeb6d7670e522a718067333cd4e3b15610ecf576001600160a01b038116331415610d9c57610afd8484846040518060200160405280600081525061148f565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c61711349060440160206040518083038186803b158015610de657600080fd5b505afa158015610dfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1e91906127f2565b8015610eb05750604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c61711349060440160206040518083038186803b158015610e7857600080fd5b505afa158015610e8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb091906127f2565b610ecf57604051633b79c77360e21b81523360048201526024016108bb565b610a378484846040518060200160405280600081525061148f565b610ef2611709565b610f495760405162461bcd60e51b815260206004820152602260248201527f77686974656c6973742073616c6520686173206e6f7420737461727465642079604482015261195d60f21b60648201526084016108bb565b600954600160f01b900461ffff1683610f6186611731565b610f6b9190612a2e565b1115610fb25760405162461bcd60e51b815260206004820152601660248201527563616e206e6f74206d696e742074686973206d616e7960501b60448201526064016108bb565b6040516bffffffffffffffffffffffff19606086901b16602082015260009060340160405160208183030381529060405280519060200120905061102d83838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600a549150849050611cf6565b61106b5760405162461bcd60e51b815260206004820152600f60248201526e24b731b7b93932b1ba10383937b7b360891b60448201526064016108bb565b83600b546110799190612a5a565b3410156110c05760405162461bcd60e51b81526020600482015260156024820152740dccacac840e8de40e6cadcc840dadee4ca408aa89605b1b60448201526064016108bb565b6110ca8585611d0c565b5050505050565b60006107b58261192f565b6009546001600160a01b031633146111065760405162461bcd60e51b81526004016108bb906129dc565b610ac6600c8383612423565b6009546001600160a01b0316331461113c5760405162461bcd60e51b81526004016108bb906129dc565b60095461ffff600160a01b90910481169083161180156111655750600154600054038161ffff16115b6111d75760405162461bcd60e51b815260206004820152603d60248201527f4d657461706c61636573536d616c6c4f6666696365733a3a696e69746961746560448201527f4d696e743a2077726f6e6720737570706c6965732070726f766964656400000060648201526084016108bb565b600b8390556009805467ffff00000000ffff60b01b1916600160b01b61ffff85811691820261ffff60e01b191692909217600160e01b928516928302179092556040805186815260208101939093528201527f8f4d37f8f08798216e70532783d8b9d7cf88da95ba574ead04f15856046387459060600160405180910390a1505050565b600061126682611e05565b5192915050565b6060611277611f1f565b905090565b60006001600160a01b0382166112a5576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6009546001600160a01b031633146112f45760405162461bcd60e51b81526004016108bb906129dc565b6112fe6000611f2e565b565b60408051606081018252600080825260208201819052918101919091526107b582611e05565b6040516bffffffffffffffffffffffff193360601b16602082015260009081906034016040516020818303038152906040528051906020012090506113a284848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600a549150849050611cf6565b6113e05760405162461bcd60e51b815260206004820152600f60248201526e24b731b7b93932b1ba10383937b7b360891b60448201526064016108bb565b5060019392505050565b6060600380546107ca90612abc565b6001600160a01b0382163314156114235760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b836daaeb6d7670e522a718067333cd4e3b15611639576001600160a01b038116331415611506576114c18585856119d4565b6001600160a01b0384163b151580156114e357506114e185858585611f80565b155b15611501576040516368d2bf6b60e11b815260040160405180910390fd5b6110ca565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c61711349060440160206040518083038186803b15801561155057600080fd5b505afa158015611564573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158891906127f2565b801561161a5750604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c61711349060440160206040518083038186803b1580156115e257600080fd5b505afa1580156115f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161a91906127f2565b61163957604051633b79c77360e21b81523360048201526024016108bb565b6116448585856119d4565b6001600160a01b0384163b15158015611666575061166485858585611f80565b155b156110ca576040516368d2bf6b60e11b815260040160405180910390fd5b606061168f8261192f565b6116ac57604051630a14c4b560e41b815260040160405180910390fd5b60006116b6611f1f565b90508051600014156116d75760405180602001604052806000815250611702565b806116e184612078565b6040516020016116f292919061295d565b6040516020818303038152906040525b9392505050565b600954600090600160c01b900463ffffffff16801580159061172b5750804210155b91505090565b6001600160a01b038116600090815260056020526040812054600160401b90046001600160401b03166107b5565b6009546001600160a01b031633146117895760405162461bcd60e51b81526004016108bb906129dc565b61ffff81166117da5760405162461bcd60e51b815260206004820152601e60248201527f6d6178576c4d696e744e756d6265722063616e6e6f74206265207a65726f000060448201526064016108bb565b6009805461ffff909216600160f01b026001600160f01b03909216919091179055565b6009546001600160a01b031633146118275760405162461bcd60e51b81526004016108bb906129dc565b63ffffffff81166118715760405162461bcd60e51b815260206004820152601460248201527319185d19481b5d5cdd081899481919599a5b995960621b60448201526064016108bb565b6009805463ffffffff909216600160c01b0263ffffffff60c01b19909216919091179055565b6009546001600160a01b031633146118c15760405162461bcd60e51b81526004016108bb906129dc565b6001600160a01b0381166119265760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108bb565b610c7381611f2e565b60008054821080156107b5575050600090815260046020526040902054600160e01b900460ff161590565b611974828260405180602001604052806000815250612191565b5050565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006119df82611e05565b9050836001600160a01b031681600001516001600160a01b031614611a165760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611a345750611a3485336106db565b80611a4f575033611a448461084d565b6001600160a01b0316145b905080611a6f57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038416611a9657604051633a954ecd60e21b815260040160405180910390fd5b611aa260008487611978565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116611b76576000548214611b7657805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46110ca565b80611bdd576040516356be441560e01b815260040160405180910390fd5b600054611bfd5760405163c0367cab60e01b815260040160405180910390fd5b60085480611c09575060005b6000548110611c2b576040516370e89b1b60e01b815260040160405180910390fd5b6000548282016000198101911015611c465750600054600019015b815b818111611ceb576000818152600460205260409020546001600160a01b0316158015611c8a5750600081815260046020526040902054600160e01b900460ff16155b15611ce3576000611c9a82611e05565b80516000848152600460209081526040909120805491909301516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b0390921691909117179055505b600101611c48565b506001016008555050565b600082611d03858461219e565b14949350505050565b600954600160e01b900461ffff1681611d286001546000540390565b611d329190612a2e565b1115611d9e5760405162461bcd60e51b815260206004820152603560248201527f696e73756666696369656e742072656d61696e696e6720737570706c7920666f6044820152741c8819195cda5c9959081b5a5b9d08185b5bdd5b9d605a1b60648201526084016108bb565b600081118015611daf575060148111155b611dfb5760405162461bcd60e51b815260206004820152601760248201527f696e636f7272656374206d696e74207175616e7469747900000000000000000060448201526064016108bb565b611974828261195a565b604080516060810182526000808252602082018190529181019190915281600054811015611f0657600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290611f045780516001600160a01b031615611e9b579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215611eff579392505050565b611e9b565b505b604051636f96cda160e11b815260040160405180910390fd5b6060600c80546107ca90612abc565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611fb590339089908890889060040161298c565b602060405180830381600087803b158015611fcf57600080fd5b505af1925050508015611fff575060408051601f3d908101601f19168201909252611ffc91810190612842565b60015b61205a573d80801561202d576040519150601f19603f3d011682016040523d82523d6000602084013e612032565b606091505b508051612052576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60608161209c5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156120c657806120b081612af7565b91506120bf9050600a83612a46565b91506120a0565b6000816001600160401b038111156120ee57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612118576020820181803683370190505b5090505b84156120705761212d600183612a79565b915061213a600a86612b12565b612145906030612a2e565b60f81b81838151811061216857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535061218a600a86612a46565b945061211c565b610ac68383836001612258565b600081815b84518110156122505760008582815181106121ce57634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161221057604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061223d565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061224881612af7565b9150506121a3565b509392505050565b6000546001600160a01b03851661228157604051622e076360e81b815260040160405180910390fd5b8361229f5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168c018116918217600160401b67ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801561234b57506001600160a01b0387163b15155b156123d4575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461239c6000888480600101955088611f80565b6123b9576040516368d2bf6b60e11b815260040160405180910390fd5b808214156123515782600054146123cf57600080fd5b61241a565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808214156123d5575b506000556110ca565b82805461242f90612abc565b90600052602060002090601f0160209004810192826124515760008555612497565b82601f1061246a5782800160ff19823516178555612497565b82800160010185558215612497579182015b8281111561249757823582559160200191906001019061247c565b506124a39291506124a7565b5090565b5b808211156124a357600081556001016124a8565b80356001600160a01b03811681146124d357600080fd5b919050565b60008083601f8401126124e9578081fd5b5081356001600160401b038111156124ff578182fd5b6020830191508360208260051b850101111561251a57600080fd5b9250929050565b803561ffff811681146124d357600080fd5b600060208284031215612544578081fd5b611702826124bc565b6000806040838503121561255f578081fd5b612568836124bc565b9150612576602084016124bc565b90509250929050565b600080600060608486031215612593578081fd5b61259c846124bc565b92506125aa602085016124bc565b9150604084013590509250925092565b600080600080608085870312156125cf578081fd5b6125d8856124bc565b93506125e6602086016124bc565b92506040850135915060608501356001600160401b0380821115612608578283fd5b818701915087601f83011261261b578283fd5b81358181111561262d5761262d612b52565b604051601f8201601f19908116603f0116810190838211818310171561265557612655612b52565b816040528281528a602084870101111561266d578586fd5b82602086016020830137918201602001949094529598949750929550505050565b600080604083850312156126a0578182fd5b6126a9836124bc565b915060208301356126b981612b68565b809150509250929050565b600080604083850312156126d6578182fd5b6126df836124bc565b946020939093013593505050565b60008060008060608587031215612702578384fd5b61270b856124bc565b93506020850135925060408501356001600160401b0381111561272c578283fd5b612738878288016124d8565b95989497509550505050565b60008060208385031215612756578182fd5b82356001600160401b0381111561276b578283fd5b612777858286016124d8565b90969095509350505050565b60008060208385031215612795578182fd5b82356001600160401b03808211156127ab578384fd5b818501915085601f8301126127be578384fd5b8135818111156127cc578485fd5b8660208260061b85010111156127e0578485fd5b60209290920196919550909350505050565b600060208284031215612803578081fd5b815161170281612b68565b60006020828403121561281f578081fd5b5035919050565b600060208284031215612837578081fd5b813561170281612b76565b600060208284031215612853578081fd5b815161170281612b76565b60008060208385031215612870578182fd5b82356001600160401b0380821115612886578384fd5b818501915085601f830112612899578384fd5b8135818111156128a7578485fd5b8660208285010111156127e0578485fd5b6000602082840312156128c9578081fd5b61170282612521565b6000806000606084860312156128e6578081fd5b833592506128f660208501612521565b915061290460408501612521565b90509250925092565b60006020828403121561291e578081fd5b813563ffffffff81168114611702578182fd5b60008151808452612949816020860160208601612a90565b601f01601f19169290920160200192915050565b6000835161296f818460208801612a90565b835190830190612983818360208801612a90565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906129bf90830184612931565b9695505050505050565b6020815260006117026020830184612931565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600061ffff80831681851680830382111561298357612983612b26565b60008219821115612a4157612a41612b26565b500190565b600082612a5557612a55612b3c565b500490565b6000816000190483118215151615612a7457612a74612b26565b500290565b600082821015612a8b57612a8b612b26565b500390565b60005b83811015612aab578181015183820152602001612a93565b83811115610a375750506000910152565b600181811c90821680612ad057607f821691505b60208210811415612af157634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612b0b57612b0b612b26565b5060010190565b600082612b2157612b21612b3c565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610c7357600080fd5b6001600160e01b031981168114610c7357600080fdfea2646970667358221220f0056a76703308db79898de5b7a383e208bb7f2ef9619225c8154dcc5e530c9464736f6c63430008040033

Verified Source Code Partial Match

Compiler: v0.8.4+commit.c7e474f2 EVM: istanbul Optimization: Yes (200 runs)
MetaplacesSmallOffices.sol 1640 lines
/**
 *Submitted for verification at Etherscan.io on 2022-04-17
*/

// File lib/utils/introspection/IERC165.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.8.4;
/**
 * @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 lib/token/ERC721/IERC721.sol


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

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

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

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

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

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

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

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

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

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

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

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


// File lib/token/ERC721/IERC721Receiver.sol


/**
 * @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 lib/token/ERC721/extensions/IERC721Metadata.sol

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

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

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


// File lib/utils/Address.sol


/**
 * @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 lib/utils/Context.sol


/**
 * @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 lib/utils/Strings.sol


/**
 * @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 lib/utils/introspection/ERC165.sol


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


// File lib/token/ERC721A.sol









error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function updateOperator(address registrant, address operator, bool filtered) external;
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
    function subscribe(address registrant, address registrantToSubscribe) external;
    function unsubscribe(address registrant, bool copyExistingEntries) external;
    function subscriptionOf(address addr) external returns (address registrant);
    function subscribers(address registrant) external returns (address[] memory);
    function subscriberAt(address registrant, uint256 index) external returns (address);
    function copyEntriesOf(address registrant, address registrantToCopy) external;
    function isOperatorFiltered(address registrant, address operator) external returns (bool);
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
    function filteredOperators(address addr) external returns (address[] memory);
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
    function isRegistered(address addr) external returns (bool);
    function codeHashOf(address addr) external returns (bytes32);
}

abstract contract OperatorFilterer {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry constant operatorFilterRegistry =
    IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(operatorFilterRegistry).code.length > 0) {
            if (subscribe) {
                operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    operatorFilterRegistry.register(address(this));
                }
            }
        }
    }

    modifier onlyAllowedOperator(address from) virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(operatorFilterRegistry).code.length > 0) {
            // Allow spending tokens from addresses with balance
            // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
            // from an EOA.
            if (from == msg.sender) {
                _;
                return;
            }
            if (
                !(
            operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)
            && operatorFilterRegistry.isOperatorAllowed(address(this), from)
            )
            ) {
                revert OperatorNotAllowed(msg.sender);
            }
        }
        _;
    }
}

abstract contract DefaultOperatorFilterer is OperatorFilterer {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, DefaultOperatorFilterer {
    using Address for address;
    using Strings for uint256;

    // Compiler will pack this into a single 256bit word.
    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
    }

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
        // For miscellaneous variable(s) pertaining to the address
        // (e.g. number of whitelist mint slots used).
        // If there are multiple variables, please pack them into a uint64.
        uint64 aux;
    }

    // The tokenId of the next token to be minted.
    uint256 internal _currentIndex;

    // The number of tokens burned.
    uint256 internal _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

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

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * To change the starting tokenId, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
     */
    function totalSupply() public view returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than _currentIndex - _startTokenId() times
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view returns (uint256) {
        // Counter underflow is impossible as _currentIndex does not decrement,
        // and it is initialized to _startTokenId()
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @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 override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return uint256(_addressData[owner].balance);
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberMinted);
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberBurned);
    }

    /**
     * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return _addressData[owner].aux;
    }

    /**
     * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal {
        _addressData[owner].aux = aux;
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr && curr < _currentIndex) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (!ownership.burned) {
                    if (ownership.addr != address(0)) {
                        return ownership;
                    }
                    // Invariant:
                    // There will always be an ownership that has an address and is not burned
                    // before an ownership that does not have an address and is not burned.
                    // Hence, curr will not underflow.
                    while (true) {
                        curr--;
                        ownership = _ownerships[curr];
                        if (ownership.addr != address(0)) {
                            return ownership;
                        }
                    }
                }
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return _ownershipOf(tokenId).addr;
    }

    /**
     * @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) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        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 override {
        address owner = ERC721A.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        if (operator == _msgSender()) revert ApproveToCaller();

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public onlyAllowedOperator(from) virtual override {
        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public onlyAllowedOperator(from) virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public onlyAllowedOperator(from) virtual override {
        _transfer(from, to, tokenId);
        if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

    /**
     * @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`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned;
    }

    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, '');
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        _mint(to, quantity, _data, true);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(
        address to,
        uint256 quantity,
        bytes memory _data,
        bool safe
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            if (safe && to.isContract()) {
                do {
                    emit Transfer(address(0), to, updatedIndex);
                    if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (updatedIndex != end);
                // Reentrancy protection
                if (_currentIndex != startTokenId) revert();
            } else {
                do {
                    emit Transfer(address(0), to, updatedIndex++);
                } while (updatedIndex != end);
            }
            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) private {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();

        bool isApprovedOrOwner = (_msgSender() == from ||
            isApprovedForAll(from, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            TokenOwnership storage currSlot = _ownerships[tokenId];
            currSlot.addr = to;
            currSlot.startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            TokenOwnership storage nextSlot = _ownerships[nextTokenId];
            if (nextSlot.addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId != _currentIndex) {
                    nextSlot.addr = from;
                    nextSlot.startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev This is equivalent to _burn(tokenId, false)
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        address from = prevOwnership.addr;

        if (approvalCheck) {
            bool isApprovedOrOwner = (_msgSender() == from ||
                isApprovedForAll(from, _msgSender()) ||
                getApproved(tokenId) == _msgSender());

            if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            AddressData storage addressData = _addressData[from];
            addressData.balance -= 1;
            addressData.numberBurned += 1;

            // Keep track of who burned the token, and the timestamp of burning.
            TokenOwnership storage currSlot = _ownerships[tokenId];
            currSlot.addr = from;
            currSlot.startTimestamp = uint64(block.timestamp);
            currSlot.burned = true;

            // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            TokenOwnership storage nextSlot = _ownerships[nextTokenId];
            if (nextSlot.addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId != _currentIndex) {
                    nextSlot.addr = from;
                    nextSlot.startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

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

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try IERC721Receiver(to).onERC721Received(_msgSender(), 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))
                }
            }
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * 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, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     * And also called after one token has been burned.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}


// File lib/token/ERC721AOwnersExplicit.sol


error AllOwnershipsHaveBeenSet();
error QuantityMustBeNonZero();
error NoTokensMintedYet();

abstract contract ERC721AOwnersExplicit is ERC721A {
    uint256 public nextOwnerToExplicitlySet;

    /**
     * @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
     */
    function _setOwnersExplicit(uint256 quantity) internal {
        if (quantity == 0) revert QuantityMustBeNonZero();
        if (_currentIndex == _startTokenId()) revert NoTokensMintedYet();
        uint256 _nextOwnerToExplicitlySet = nextOwnerToExplicitlySet;
        if (_nextOwnerToExplicitlySet == 0) {
            _nextOwnerToExplicitlySet = _startTokenId();
        }
        if (_nextOwnerToExplicitlySet >= _currentIndex) revert AllOwnershipsHaveBeenSet();

        // Index underflow is impossible.
        // Counter or index overflow is incredibly unrealistic.
        unchecked {
            uint256 endIndex = _nextOwnerToExplicitlySet + quantity - 1;

            // Set the end index to be the last token index
            if (endIndex + 1 > _currentIndex) {
                endIndex = _currentIndex - 1;
            }

            for (uint256 i = _nextOwnerToExplicitlySet; i <= endIndex; i++) {
                if (_ownerships[i].addr == address(0) && !_ownerships[i].burned) {
                    TokenOwnership memory ownership = _ownershipOf(i);
                    _ownerships[i].addr = ownership.addr;
                    _ownerships[i].startTimestamp = ownership.startTimestamp;
                }
            }

            nextOwnerToExplicitlySet = endIndex + 1;
        }
    }
}


// File lib/token/ERC721/extensions/ERC721Ownable.sol


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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File lib/utils/cryptography/MerkleProof.sol


/**
 * @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.
 */
l...

// [truncated — 57507 bytes total]

Read Contract

airdropsClaimed 0x9028241b → uint16
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
checkValidity 0x954d90d0 → bool
exists 0x4f558e79 → bool
getApproved 0x081812fc → address
getOwnershipData 0x9231ab2a → tuple
isApprovedForAll 0xe985e9c5 → bool
isWlSaleOn 0xd334c54f → bool
maxAirdropClaims 0x62d5d3f0 → uint16
maxSupply 0xd5abeb01 → uint16
maxWlMintNumber 0x0397cfb5 → uint16
name 0x06fdde03 → string
nextOwnerToExplicitlySet 0xd7224ba0 → uint256
numberMinted 0xdc33e681 → uint256
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalMinted 0xa2309ff8 → uint256
totalSupply 0x18160ddd → uint256
wlMintPrice 0x2c4e9fc6 → uint256

Write Contract 16 functions

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

airdropClaims 0x9e39847a
tuple[] airdropClaimList
approve 0x095ea7b3
address to
uint256 tokenId
initiateMint 0x59008f31
uint256 _wlMintPrice
uint16 _maxAirdropClaims
uint16 _maxSupply
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string baseURIValue
setMaxWlMintNumber 0xec6d0789
uint16 _maxWlMintNumber
setMintDates 0xf16f0d73
uint32 wlDate
setOwnersExplicit 0x2d20fb60
uint256 quantity
setRootMerkleHash 0x2d4d8765
bytes32 _rootmt
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
whitelistMint 0x4b11faaf
address to
uint256 quantity
bytes32[] _merkleProof
withdraw 0x3ccfd60b
No parameters

Recent Transactions

No transactions found for this address