Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0xefB4F583B2b6F0E8C658Dd7675E356D8a30Ac7FF
Balance 0.000000000 ETH
Nonce 1
Code Size 9903 bytes
Indexed Transactions 0 (1 on-chain, 1.2% indexed)
External Etherscan · Sourcify

Contract Bytecode

9903 bytes
0x6080604052600436106102155760003560e01c806370a0823111610119578063a0712d68116100a6578063a0712d68146105f2578063a22cb46514610612578063b88d4fde14610632578063c87b56dd14610652578063d9cd245314610672578063e086e5ec14610692578063e979806a146106a7578063e985e9c5146106c7578063eb9047bb14610710578063f2fde38b14610723578063f4f3b2001461074357600080fd5b806370a08231146104cb578063715018a6146104eb578063743262961461050057806377201fe4146105205780637cc4207a1461054057806380f28af3146105625780638a27034f146105825780638d36ba28146105b25780638da5cb5b146105c857806395d89b41146105dd57600080fd5b80632094e84d116101a25780632094e84d1461036e5780632344be0a1461038e57806323b872dd146103a45780632a55205a146103c457806332cb6b0c146103f257806335d532c91461040857806342842e0e1461043557806342966c68146104555780634e5d29031461047557806355f804b31461048b5780636352211e146104ab57600080fd5b806301ffc9a71461022157806306fdde0314610256578063081812fc14610278578063095ea7b3146102a55780630f2cdd6c146102c75780630f7309e8146102ea57806310969523146102ff57806311b7e5e71461031f578063170c9c5f1461033f57806318160ddd1461035557600080fd5b3661021c57005b600080fd5b34801561022d57600080fd5b5061024161023c36600461207b565b610763565b60405190151581526020015b60405180910390f35b34801561026257600080fd5b5061026b61078e565b60405161024d91906120f0565b34801561028457600080fd5b50610298610293366004612103565b610820565b60405161024d919061211c565b3480156102b157600080fd5b506102c56102c0366004612145565b610864565b005b3480156102d357600080fd5b506102dc600a81565b60405190815260200161024d565b3480156102f657600080fd5b5061026b610936565b34801561030b57600080fd5b506102c561031a3660046121fc565b6109c4565b34801561032b57600080fd5b506102c561033a366004612103565b610a22565b34801561034b57600080fd5b506102dc60145481565b34801561036157600080fd5b50600154600054036102dc565b34801561037a57600080fd5b506102dc610389366004612145565b610a65565b34801561039a57600080fd5b506102dc60095481565b3480156103b057600080fd5b506102c56103bf366004612244565b610a96565b3480156103d057600080fd5b506103e46103df366004612285565b610aa6565b60405161024d9291906122a7565b3480156103fe57600080fd5b506102dc61138881565b34801561041457600080fd5b506104286104233660046122c0565b610aca565b60405161024d91906122dd565b34801561044157600080fd5b506102c5610450366004612244565b610b36565b34801561046157600080fd5b506102c5610470366004612103565b610b51565b34801561048157600080fd5b506102dc60125481565b34801561049757600080fd5b506102c56104a63660046121fc565b610bcc565b3480156104b757600080fd5b506102986104c6366004612103565b610c1d565b3480156104d757600080fd5b506102dc6104e63660046122c0565b610c28565b3480156104f757600080fd5b506102c5610c76565b34801561050c57600080fd5b506102c561051b366004612103565b610cb1565b34801561052c57600080fd5b506102c561053b366004612103565b610cf4565b34801561054c57600080fd5b5061029860008051602061265a83398151915281565b34801561056e57600080fd5b506102c561057d366004612103565b610d37565b34801561058e57600080fd5b5061024161059d366004612103565b60156020526000908152604090205460ff1681565b3480156105be57600080fd5b506102dc60135481565b3480156105d457600080fd5b50610298610d7a565b3480156105e957600080fd5b5061026b610d89565b3480156105fe57600080fd5b506102c561060d366004612103565b610d98565b34801561061e57600080fd5b506102c561062d36600461232f565b610e5e565b34801561063e57600080fd5b506102c561064d366004612368565b610ef3565b34801561065e57600080fd5b5061026b61066d366004612103565b610f3d565b34801561067e57600080fd5b506102c561068d3660046121fc565b611065565b34801561069e57600080fd5b506102c56110b6565b3480156106b357600080fd5b506102c56106c23660046123e7565b6111c9565b3480156106d357600080fd5b506102416106e236600461240c565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6102c561071e366004612103565b611351565b34801561072f57600080fd5b506102c561073e3660046122c0565b6114a0565b34801561074f57600080fd5b506102c561075e3660046122c0565b61153d565b60006001600160e01b0319821663152a902d60e11b148061078857506107888261172d565b92915050565b60606002805461079d9061243a565b80601f01602080910402602001604051908101604052809291908181526020018280546107c99061243a565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b5050505050905090565b600061082b8261177b565b610848576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600061086f826117a2565b9050806001600160a01b0316836001600160a01b0316036108a35760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216146108da576108bd81336106e2565b6108da576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600b80546109439061243a565b80601f016020809104026020016040519081016040528092919081815260200182805461096f9061243a565b80156109bc5780601f10610991576101008083540402835291602001916109bc565b820191906000526020600020905b81548152906001019060200180831161099f57829003601f168201915b505050505081565b3360008051602061265a83398151915214610a0b5760008051602061265a833981519152604051631022f85d60e11b8152600401610a02919061211c565b60405180910390fd5b8051610a1e90600b906020840190611fcc565b5050565b3360008051602061265a83398151915214610a605760008051602061265a833981519152604051631022f85d60e11b8152600401610a02919061211c565b600955565b60116020528160005260406000208181548110610a8157600080fd5b90600052602060002001600091509150505481565b610aa1838383611809565b505050565b3060006103e8610ab760458561248a565b610ac191906124bf565b90509250929050565b6001600160a01b038116600090815260116020908152604091829020805483518184028101840190945280845260609392830182828015610b2a57602002820191906000526020600020905b815481526020019060010190808311610b16575b50505050509050919050565b610aa183838360405180602001604052806000815250610ef3565b33610b5b82610c1d565b6001600160a01b031614610b9e5780610b7382610c1d565b6040516326a5d68f60e11b815260048101929092526001600160a01b03166024820152604401610a02565b33600090815260116020908152604082208054600181018255908352912001819055610bc98161199e565b50565b3360008051602061265a83398151915214610c0a5760008051602061265a833981519152604051631022f85d60e11b8152600401610a02919061211c565b8051610a1e90600c906020840190611fcc565b6000610788826117a2565b60006001600160a01b038216610c51576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b33610c7f610d7a565b6001600160a01b031614610ca55760405162461bcd60e51b8152600401610a02906124d3565b610caf60006119a9565b565b3360008051602061265a83398151915214610cef5760008051602061265a833981519152604051631022f85d60e11b8152600401610a02919061211c565b601655565b3360008051602061265a83398151915214610d325760008051602061265a833981519152604051631022f85d60e11b8152600401610a02919061211c565b601255565b3360008051602061265a83398151915214610d755760008051602061265a833981519152604051631022f85d60e11b8152600401610a02919061211c565b601355565b6008546001600160a01b031690565b60606003805461079d9061243a565b600954421015610dbb5760405163589ed34b60e01b815260040160405180910390fd5b61138881610dc860005490565b610dd29190612508565b1115610e085780610de260005490565b610dec9190612508565b604051630c540f2160e01b8152600401610a0291815260200190565b600a81610e14336119fb565b610e1e9190612508565b1115610e5457610e2d336119fb565b610e3890600a612520565b6040516302c0c8bd60e11b8152600401610a0291815260200190565b610bc93382611a23565b336001600160a01b03831603610e875760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610efe848484611809565b6001600160a01b0383163b15610f3757610f1a84848484611a3d565b610f37576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6060610f4860005490565b8210610f6a57604051631e39122160e11b815260048101839052602401610a02565b60008281526015602052604081205460ff16610f8757600c610f8a565b600d5b8054610f959061243a565b80601f0160208091040260200160405190810160405280929190818152602001828054610fc19061243a565b801561100e5780601f10610fe35761010080835404028352916020019161100e565b820191906000526020600020905b815481529060010190602001808311610ff157829003601f168201915b505050505090506000815111611033576040518060200160405280600081525061105e565b8061103d84611b29565b60405160200161104e929190612537565b6040516020818303038152906040525b9392505050565b3360008051602061265a833981519152146110a35760008051602061265a833981519152604051631022f85d60e11b8152600401610a02919061211c565b8051610a1e90600d906020840190611fcc565b336000908152600e602052604090205460ff166110e657604051634f88b4f560e11b815260040160405180910390fd5b476000819003611109576040516308ae8bb160e41b815260040160405180910390fd5b600f5460005b81811015611191576000600f828154811061112c5761112c612566565b6000918252602082200154601080546001600160a01b0390921693506064918590811061115b5761115b612566565b906000526020600020015486611171919061248a565b61117b91906124bf565b90506111878282611c29565b505060010161110f565b506040518281527f043f607a14d3b4f0a11a0b2e192bbfcd894298ba5abf22553be6081406db28aa9060200160405180910390a15050565b3360008051602061265a833981519152146112075760008051602061265a833981519152604051631022f85d60e11b8152600401610a02919061211c565b6001600160a01b03811661125b5760405162461bcd60e51b815260206004820152601b60248201527a043616e6e6f7420736574207465616d206d656d62657220746f203602c1b6044820152606401610a02565b600f5482106112a85760405162461bcd60e51b8152602060048201526019602482015278092dcecc2d8d2c840e8cac2da40dacadac4cae440d2dcc8caf603b1b6044820152606401610a02565b6000600e6000600f85815481106112c1576112c1612566565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff1916911515919091179055600f80548291908490811061130c5761130c612566565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600e90915260409020805460ff1916600117905550565b601354341461138057601354604051637998543b60e01b81523460048201526024810191909152604401610a02565b3361138a82610c1d565b6001600160a01b0316146113a25780610b7382610c1d565b60008181526015602052604090205460ff16156113d55760405163d39ab56360e01b815260048101829052602401610a02565b601254601454106113f9576040516332d2dafb60e11b815260040160405180910390fd5b601654156114325761143260008051602061265a833981519152606460165434611423919061248a565b61142d91906124bf565b611c29565b6001601460008282546114459190612508565b909155505060008181526015602052604090819020805460ff19166001179055517f51dba42a71b99e344e4141f74c8d409d50613b760cbe5360262c20260c39b428906114959083815260200190565b60405180910390a150565b336114a9610d7a565b6001600160a01b0316146114cf5760405162461bcd60e51b8152600401610a02906124d3565b6001600160a01b0381166115345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a02565b610bc9816119a9565b336000908152600e602052604090205460ff1661156d57604051634f88b4f560e11b815260040160405180910390fd5b6040516370a0823160e01b81526000906001600160a01b038316906370a082319061159c90309060040161211c565b602060405180830381865afa1580156115b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115dd919061257c565b905080600003611600576040516308ae8bb160e41b815260040160405180910390fd5b600f5460005b818110156116ee57600060646010838154811061162557611625612566565b90600052602060002001548561163b919061248a565b61164591906124bf565b9050846001600160a01b031663a9059cbb600f848154811061166957611669612566565b6000918252602090912001546040516001600160e01b031960e084901b1681526116a1916001600160a01b03169085906004016122a7565b6020604051808303816000875af11580156116c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e49190612595565b5050600101611606565b507f7e2c99819371db0a6fc6f4269fe872496e44f502df19ba3eae594b7a1598746083836040516117209291906122a7565b60405180910390a1505050565b60006301ffc9a760e01b6001600160e01b03198316148061175e57506380ac58cd60e01b6001600160e01b03198316145b806107885750506001600160e01b031916635b5e139f60e01b1490565b6000805482108015610788575050600090815260046020526040902054600160e01b161590565b6000816000548110156117f05760008181526004602052604081205490600160e01b821690036117ee575b8060000361105e5750600019016000818152600460205260409020546117cd565b505b604051636f96cda160e11b815260040160405180910390fd5b6000611814826117a2565b9050836001600160a01b0316816001600160a01b0316146118475760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611865575061186585336106e2565b8061188057503361187584610820565b6001600160a01b0316145b9050806118a057604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166118c757604051633a954ecd60e21b815260040160405180910390fd5b600083815260066020908152604080832080546001600160a01b03191690556001600160a01b038881168452600583528184208054600019019055871683528083208054600101905585835260049091528120600160e11b4260a01b8717811790915583169003611968576001830160008181526004602052604081205490036119665760005481146119665760008181526004602052604090208390555b505b82846001600160a01b0316866001600160a01b031660008051602061263a83398151915260405160405180910390a45050505050565b610bc9816000611d3f565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03166000908152600560205260409081902054901c6001600160401b031690565b610a1e828260405180602001604052806000815250611e7c565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611a729033908990889088906004016125b2565b6020604051808303816000875af1925050508015611aad575060408051601f3d908101601f19168201909252611aaa918101906125ef565b60015b611b0b573d808015611adb576040519150601f19603f3d011682016040523d82523d6000602084013e611ae0565b606091505b508051600003611b03576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606081600003611b505750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611b7a5780611b648161260c565b9150611b739050600a836124bf565b9150611b54565b6000816001600160401b03811115611b9457611b94612171565b6040519080825280601f01601f191660200182016040528015611bbe576020820181803683370190505b5090505b8415611b2157611bd3600183612520565b9150611be0600a86612625565b611beb906030612508565b60f81b818381518110611c0057611c00612566565b60200101906001600160f81b031916908160001a905350611c22600a866124bf565b9450611bc2565b80471015611c795760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a02565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611cc6576040519150601f19603f3d011682016040523d82523d6000602084013e611ccb565b606091505b5050905080610aa15760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610a02565b6000611d4a836117a2565b9050808215611dae576000336001600160a01b0383161480611d715750611d7182336106e2565b80611d8c575033611d8186610820565b6001600160a01b0316145b905080611dac57604051632ce44b5f60e11b815260040160405180910390fd5b505b600084815260066020908152604080832080546001600160a01b03191690556001600160a01b03841683526005825280832080546001600160801b0301905586835260049091528120600360e01b4260a01b8417179055600160e11b83169003611e4857600184016000818152600460205260408120549003611e46576000548114611e465760008181526004602052604090208390555b505b60405184906000906001600160a01b0384169060008051602061263a833981519152908390a4505060018054810190555050565b6000546001600160a01b038416611ea557604051622e076360e81b815260040160405180910390fd5b82600003611ec65760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03841660008181526005602090815260408083208054680100000000000000018902019055848352600490915290204260a01b86176001861460e11b1790558190818501903b15611f89575b60405182906001600160a01b0388169060009060008051602061263a833981519152908290a4611f526000878480600101955087611a3d565b611f6f576040516368d2bf6b60e11b815260040160405180910390fd5b808210611f19578260005414611f8457600080fd5b611fbc565b5b6040516001830192906001600160a01b0388169060009060008051602061263a833981519152908290a4808210611f8a575b506000908155610f379085838684565b828054611fd89061243a565b90600052602060002090601f016020900481019282611ffa5760008555612040565b82601f1061201357805160ff1916838001178555612040565b82800160010185558215612040579182015b82811115612040578251825591602001919060010190612025565b5061204c929150612050565b5090565b5b8082111561204c5760008155600101612051565b6001600160e01b031981168114610bc957600080fd5b60006020828403121561208d57600080fd5b813561105e81612065565b60005b838110156120b357818101518382015260200161209b565b83811115610f375750506000910152565b600081518084526120dc816020860160208601612098565b601f01601f19169290920160200192915050565b60208152600061105e60208301846120c4565b60006020828403121561211557600080fd5b5035919050565b6001600160a01b0391909116815260200190565b6001600160a01b0381168114610bc957600080fd5b6000806040838503121561215857600080fd5b823561216381612130565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b03808411156121a1576121a1612171565b604051601f8501601f19908116603f011681019082821181831017156121c9576121c9612171565b816040528093508581528686860111156121e257600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561220e57600080fd5b81356001600160401b0381111561222457600080fd5b8201601f8101841361223557600080fd5b611b2184823560208401612187565b60008060006060848603121561225957600080fd5b833561226481612130565b9250602084013561227481612130565b929592945050506040919091013590565b6000806040838503121561229857600080fd5b50508035926020909101359150565b6001600160a01b03929092168252602082015260400190565b6000602082840312156122d257600080fd5b813561105e81612130565b6020808252825182820181905260009190848201906040850190845b81811015612315578351835292840192918401916001016122f9565b50909695505050505050565b8015158114610bc957600080fd5b6000806040838503121561234257600080fd5b823561234d81612130565b9150602083013561235d81612321565b809150509250929050565b6000806000806080858703121561237e57600080fd5b843561238981612130565b9350602085013561239981612130565b92506040850135915060608501356001600160401b038111156123bb57600080fd5b8501601f810187136123cc57600080fd5b6123db87823560208401612187565b91505092959194509250565b600080604083850312156123fa57600080fd5b82359150602083013561235d81612130565b6000806040838503121561241f57600080fd5b823561242a81612130565b9150602083013561235d81612130565b600181811c9082168061244e57607f821691505b60208210810361246e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156124a4576124a4612474565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826124ce576124ce6124a9565b500490565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561251b5761251b612474565b500190565b60008282101561253257612532612474565b500390565b60008351612549818460208801612098565b83519083019061255d818360208801612098565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561258e57600080fd5b5051919050565b6000602082840312156125a757600080fd5b815161105e81612321565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906125e5908301846120c4565b9695505050505050565b60006020828403121561260157600080fd5b815161105e81612065565b60006001820161261e5761261e612474565b5060010190565b600082612634576126346124a9565b50069056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef00000000000000000000000046e50dc219ba5a26890dc99cde4f4ac2a48011e9a26469706673582212203acefceca66f34233f08e061eb9c879f0fd31d8cdfb388b98696d6088755e48b64736f6c634300080e0033

Verified Source Code Partial Match

Compiler: v0.8.14+commit.80d49f37 EVM: london Optimization: Yes (40 runs)
Happies.sol 1981 lines
/*
  __    __                            __
 |  \  |  \                          |  \
 | ▓▓  | ▓▓ ______   ______   ______  \▓▓ ______   _______
 | ▓▓__| ▓▓|      \ /      \ /      \|  \/      \ /       \
 | ▓▓    ▓▓ \▓▓▓▓▓▓\  ▓▓▓▓▓▓\  ▓▓▓▓▓▓\ ▓▓  ▓▓▓▓▓▓\  ▓▓▓▓▓▓▓
 | ▓▓▓▓▓▓▓▓/      ▓▓ ▓▓  | ▓▓ ▓▓  | ▓▓ ▓▓ ▓▓    ▓▓\▓▓    \
 | ▓▓  | ▓▓  ▓▓▓▓▓▓▓ ▓▓__/ ▓▓ ▓▓__/ ▓▓ ▓▓ ▓▓▓▓▓▓▓▓_\▓▓▓▓▓▓\
 | ▓▓  | ▓▓\▓▓    ▓▓ ▓▓    ▓▓ ▓▓    ▓▓ ▓▓\▓▓     \       ▓▓
  \▓▓   \▓▓ \▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓| ▓▓▓▓▓▓▓ \▓▓ \▓▓▓▓▓▓▓\▓▓▓▓▓▓▓
                   | ▓▓     | ▓▓
                   | ▓▓     | ▓▓
                    \▓▓      \▓▓
by
 ╔╗  ╔╗         ╔╗  ╔╗    ╔═══╗ ╔╗       ╔╗              ╔════╗╔═╗╔═╗
 ║╚╗╔╝║         ║║  ║║    ║╔═╗║╔╝╚╗      ║║              ║╔╗╔╗║║║╚╝║║
 ╚╗╚╝╔╝╔══╗╔══╗ ║╚═╗║║    ║╚══╗╚╗╔╝╔╗╔╗╔═╝║╔╗╔══╗╔══╗    ╚╝║║╚╝║╔╗╔╗║
  ╚╗╔╝ ║╔╗║╚ ╗║ ║╔╗║╚╝    ╚══╗║ ║║ ║║║║║╔╗║╠╣║╔╗║║══╣      ║║  ║║║║║║
   ║║  ║║═╣║╚╝╚╗║║║║╔╗    ║╚═╝║ ║╚╗║╚╝║║╚╝║║║║╚╝║╠══║     ╔╝╚╗ ║║║║║║
   ╚╝  ╚══╝╚═══╝╚╝╚╝╚╝    ╚═══╝ ╚═╝╚══╝╚══╝╚╝╚══╝╚══╝     ╚══╝ ╚╝╚╝╚╝
contract by
 ██╗      █████╗ ██████╗ ██╗  ██╗██╗███╗   ██╗
 ██║     ██╔══██╗██╔══██╗██║ ██╔╝██║████╗  ██║
 ██║     ███████║██████╔╝█████╔╝ ██║██╔██╗ ██║
 ██║     ██╔══██║██╔══██╗██╔═██╗ ██║██║╚██╗██║
 ███████╗██║  ██║██║  ██║██║  ██╗██║██║ ╚████║
 ╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

// Sources flattened with hardhat v2.9.6 https://hardhat.org

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


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



/**
 * @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/interfaces/[email protected]


// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)



/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}


// File erc721a/contracts/[email protected]


// ERC721A Contracts v4.0.0
// Creator: Chiru Labs



/**
 * @dev Interface of an ERC721A compliant contract.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * The caller cannot approve to their own address.
     */
    error ApproveToCaller();

    /**
     * The caller cannot approve to the current owner.
     */
    error ApprovalToCurrentOwner();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

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

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     *
     * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.
     */
    function totalSupply() external view returns (uint256);

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

    // ==============================
    //            IERC721
    // ==============================

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must 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 Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

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

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

    // ==============================
    //        IERC721Metadata
    // ==============================

    /**
     * @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 erc721a/contracts/[email protected]


// ERC721A Contracts v4.0.0
// Creator: Chiru Labs



/**
 * @dev ERC721 token receiver interface.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @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 IERC721A {
    // Mask of an entry in packed address data.
    uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant BITMASK_NEXT_INITIALIZED = 1 << 225;

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

    // The number of tokens burned.
    uint256 private _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 `_packedOwnershipOf` implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

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

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

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see `_totalMinted`.
     */
    function totalSupply() public view override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * @dev 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 Returns the total number of tokens burned.
     */
    function _totalBurned() internal view returns (uint256) {
        return _burnCounter;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes of the XOR of
        // all function selectors in the interface. See: https://eips.ethereum.org/EIPS/eip-165
        // e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> BITPOS_NUMBER_MINTED) & BITMASK_ADDRESS_DATA_ENTRY;
    }

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

    /**
     * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return uint64(_packedAddressData[owner] >> BITPOS_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 {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        assembly { // Cast aux without masking.
            auxCasted := aux
        }
        packed = (packed & BITMASK_AUX_COMPLEMENT) | (auxCasted << BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & BITMASK_BURNED == 0) {
                        // 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.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed is zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);
        ownership.burned = packed & BITMASK_BURNED != 0;
    }

    /**
     * Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * 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) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

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

    /**
     * @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, _toString(tokenId))) : '';
    }

    /**
     * @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 Casts the address to uint256 without masking.
     */
    function _addressToUint256(address value) private pure returns (uint256 result) {
        assembly {
            result := value
        }
    }

    /**
     * @dev Casts the boolean to uint256 without branching.
     */
    function _boolToUint256(bool value) private pure returns (uint256 result) {
        assembly {
            result := value
        }
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = address(uint160(_packedOwnershipOf(tokenId)));
        if (to == owner) revert ApprovalToCurrentOwner();

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

        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @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 == _msgSenderERC721A()) revert ApproveToCaller();

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

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

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

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        _transfer(from, to, tokenId);
        if (to.code.length != 0)
            if (!_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 && // If within bounds,
            _packedOwnerships[tokenId] & BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    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 {
        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 {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the balance and number minted.
            _packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] =
                _addressToUint256(to) |
                (block.timestamp << BITPOS_START_TIMESTAMP) |
                (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);

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

            if (to.code.length != 0) {
                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 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) 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 {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the balance and number minted.
            _packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] =
                _addressToUint256(to) |
                (block.timestamp << BITPOS_START_TIMESTAMP) |
                (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);

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

            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 {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

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

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

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        delete _tokenApprovals[tokenId];

        // 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 {
            // We can directly increment and decrement the balances.
            --_packedAddressData[from]; // Updates: `balance -= 1`.
            ++_packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] =
                _addressToUint256(to) |
                (block.timestamp << BITPOS_START_TIMESTAMP) |
                BITMASK_NEXT_INITIALIZED;

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

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

    /**
     * @dev 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 {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        address from = address(uint160(prevOwnershipPacked));

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

            if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        }

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

        // Clear approvals from the previous owner.
        delete _tokenApprovals[tokenId];

        // 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 {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] =
                _addressToUint256(from) |
                (block.timestamp << BITPOS_START_TIMESTAMP) |
                BITMASK_BURNED |
                BITMASK_NEXT_INITIALIZED;

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        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 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 ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
            bytes4 retval
        ) {
            return retval == ERC721A__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 {}

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function _toString(uint256 value) internal pure returns (string memory ptr) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit),
            // but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged.
            // We will need 1 32-byte word to store the length,
            // and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128.
            ptr := add(mload(0x40), 128)
            // Update the free memory pointer to allocate.
            mstore(0x40, ptr)

            // Cache the end of the memory to calculate the length later.
            let end := ptr

            // We write the string from the rightmost digit to the leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // Costs a bit more than early returning for the zero case,
            // but cheaper in terms of deployment and overall runtime costs.
            for {
                // Initialize and perform the first pass without check.
                let temp := value
                // Move the pointer 1 byte leftwards to point to an empty character slot.
                ptr := sub(ptr, 1)
                // Write the character to the pointer. 48 is the ASCII index of '0'.
                mstore8(ptr, add(48, mod(temp, 10)))
                temp := div(temp, 10)
            } temp {
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
            } { // Body of the for loop.
                ptr := sub(ptr, 1)
                mstore8(ptr, add(48, mod(temp, 10)))
            }

            let length := sub(end, ptr)
            // Move the pointer 32 bytes leftwards to make room for the length.
            ptr := sub(ptr, 32)
            // Store the length.
            mstore(ptr, length)
        }
    }
}


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


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)



/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}


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


// OpenZeppelin Contracts v4.4.1 (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 @openzeppelin/contracts/access/[email protected]


// OpenZeppelin Contracts v4.4.1 (access/Ownable.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 @openzeppelin/contracts/utils/[email protected]


// OpenZeppelin Contracts (last updated v4.5.0) (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
     * ====
     *
     * [IMPORTANT]...

// [truncated — 74969 bytes total]

Read Contract

LARKIN 0x7cc4207a → address
MAX_PER_WALLET 0x0f2cdd6c → uint256
MAX_SUPPLY 0x32cb6b0c → uint256
balanceOf 0x70a08231 → uint256
burnedBy 0x2094e84d → uint256
getApproved 0x081812fc → address
getBurnedBy 0x35d532c9 → uint256[]
isApprovedForAll 0xe985e9c5 → bool
maxTransforms 0x4e5d2903 → uint256
name 0x06fdde03 → string
numTransformed 0x170c9c5f → uint256
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
provenance 0x0f7309e8 → string
publicSaleTime 0x2344be0a → uint256
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
transformPrice 0x8d36ba28 → uint256
transformed 0x8a27034f → bool

Write Contract 20 functions

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

approve 0x095ea7b3
address to
uint256 tokenId
burn 0x42966c68
uint256 _tokenId
mint 0xa0712d68
uint256 _amount
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 _uri
setDevTransformBoost 0x74326296
uint256 _boostPercent
setMaxTransforms 0x77201fe4
uint256 _max
setProvenanceHash 0x10969523
string _provenanceHash
setPublicSaleTime 0x11b7e5e7
uint256 _newTime
setTeamMember 0xe979806a
uint256 index
address member
setTransformPrice 0x80f28af3
uint256 _price
setTransformedBaseURI 0xd9cd2453
string _uri
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
transform 0xeb9047bb
uint256 _tokenId
withdrawERC20 0xf4f3b200
address _token
withdrawETH 0xe086e5ec
No parameters

Token Balances (1) $68.83

View Transfers →
TokenBalancePriceValue
WETH 0.0348 $1977.95 $68.83

Recent Transactions

This address has 1 on-chain transactions, but only 1.2% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →