ETH Price: $2,539.32 (-4.42%)

Transaction Decoder

Block:
17369732 at May-30-2023 05:40:11 AM +UTC
Transaction Fee:
0.17218504373684412 ETH $437.23
Gas Used:
3,387,435 Gas / 50.830508552 Gwei

Emitted Events:

Account State Difference:

  Address   Before After State Difference Code
0x25f23845...DF5398A4d
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 4926167118646549737255503273995202747795415335899589167238003298267241808511671826537381468704696845390351386535644105337239527409657902307752459461944777426130130275791878978782590069360106297750725288419914858048755670323460463487866233680434994432550138584663060708828440435037107956083533824087472041829476849255619208494449652471414209490726463651137781429056341888845768683812605571415342412823242730056137758687115822842855125123712149975655388419394351482317823888547650720854777587726079351227373465832903101247821785434428141181820484753991986785495625112826038332210310830989480438164972766990964359454926194089597455992181266298783360195295387028219090049255476062592573936396843644894035293691747975806014862163207959392470540255377309311448424981890531013669546004110575973696185021398092238691692900155997684391561721794364709600546401154322863375675645919201281759321728727015997417604107365727134679434703754548327496724699096838586265385752904824634041751033700608995966946714247094774397806720933783356461909188155883518885761274917294584387744311036409296136814920983122467102198295127504990971028249258302197165220536973470679852322373842206055951388420053229606236478874148498256418227475200723299322556525758610695470203612849450384422275760095787321890956018028486974791617293911183462731833899157795064240843428373135037262464882394911884756532501390671392309638571811207987989173477397059229860298285141343330923227780202838295036806487292886634415181770082310656598358484157497914278455981963622301324435134386127205161084063346817513483230877686378870503209226624340639581665123233002248770338315620006545881930911060942732984393375466733136851990627115656257190927320836862212641994485323339335342774336863664561583158275362922663246306175089911298591199141702878762708956411849023129355937130417235387921029338993110677654228186607804306447869016179284616707250306506208365506627949473862070642242864583038588850039995543025924565818534053644989814040765437646098466819841749539503010308816471200834605988762200069002198908105342068569135557248399985273382698199866462567746922228243941696083424044633734778752478729037626672765868393287411325727041136341073029957581604799026145552742976969157982443717695861048566296192414764321270320656268092886095938855777111149394615444523892434385009522444298570915804544177369951539223055900355772993391416134484996425300289809719071160884368142056758800490078707414452811860608691006012499394952731058806857408933687512086174658771644465703510198857168130809106931856650540773872132602159101503568380723483087459015403527935577173546683084660907468150613223039382593019816161551321918458490280275913636725697517405499821673097942919069584200110643670087196344765934628390467278713249119478164865332785304641312326388756605888218717893770292296277239406122669009180846061308684123464391033881538690359516641600491336250809498181488277990060771466452775887649021160528743383576682178544113721997469688081436919264128503254443476424729622484078806886699968319697244327632209379040435854064612570602156521846570507088383863653005460912924704330291692614131527249627659431906784990651588119849685311327171248645662613954819821781244674055759576492573192223409621371616988141939967556911838697945993072068151806729667239844184331740590438540108757114583341503981675910362812041351866565021982144471225231006674414049973804231988485866767586427032661803736654508279390874197445755594430306500795303499862332164778515445347382068611242582170679776088987590419622263296385619121881174810634973264269017778388725691461525728566082540105451767556789771433573126185333966347015897599321640824995398103839453138715929932694522332458794622656236323793312959315574063020306160990184164519341255256408335248972568316347325424814266289686279263731781134483997275148708028923273067766221840504828114161729317496927267695604624267201385917533034605223859648679394795279966069258772513606050924445964636922586937819199404781876613975178831480438384076412071434254469688513844104414127596291206044407150475739647379949990997461076663514180257165503820520068495008786056726682878547398075025138049306398098076764978173941294737532939432679627530348680136456842039583447263668561476933342188239347077501194522967310536829265691266861032304801744240402705288287455368730938553131384347175452809375204346299028249366981805479975119845725574704858498296493670575573579849322055671957010456040767065512958673613012605159158507326299518316189681467832979358219045840438425166803700416355176490258291476228316108879309708833761794851762229404512055731139412141737307284828907277245471229036285742798562942434191781308973899349145585897179610198132385212640178845033132023162282995453087316307135688544642751325379830434904731823168209121029589864580485099834584043835013619161246870649677845205535995992395771965561869310501189468687428470735169595899740196024257173620851936760147771485607409363906117525194356444313835954568637440365073038680562299556803696241045809607166980395682121547219099120827011040715685867026761899483820620018116686623030446649715477915673092735293536647793177848007975839107086271869627380238865085308150871942247406687953824411803942050437444610515381105069590717439914734562229208643471767304724359177022730318499087516191531906026015885738700319581932080506927131901861444337668761979845048673264462805304450661775223907159650167825300538315347993514682312172241255329711368021943604531282897086560874859430668445891646830530351834846504567087952397676758480862490683908867911151154106617174831952379034766649797866137790853624904828583809056859945949337274991056920914149877512101688490012588393683409975881510257997468522063558639446481976119196639157926360176060675734015823674843293429629229841993529284112153844243662758103555476884281045236369326725086489226386693552383322070650949913958673667216459246814152943917822804198972587685603251443343448981752746314121548287165795361887572941090808886529140106704376675677644779705099565394756842375103578660988781966710272150974203153794016997470314817121322112375805473174886246073124031807961231169340299238071353991418185279203673326362492578675481556983659047534939105934369180132229681321825450002686666366665797300351837925445026250973774413264728573993525113172831895503984293039708536236323114829705729631250405794224488746906842766768510420470041510269680553016535026175090277238044850922819590433881597015659153270394298132853177693516817201524720575114008739021182266075324278156283744853084751543611345127137966380454676698420024976808734633909398935604534051081795570641945058060059132122067024769029284840712043341202146528058008771635310208127241815576092954571410829249465603352978246236179520991078125282915256493567639490573344249510047531276347143424774603378593310894032554772653826509284343450581762992499311987197220482299929321210707265380601008024790521816119791705842161206484113094130723166824914024140028986414181240647242159734766092573003270918901214713731161008160148420690776677589560802405463621248382436738261297725616226196300700083756761968868737102597216386212315970708895555502574494736429810322017423466839186196836136199776866721923705348668269867083599748103321178115916181792181629093179795647919589029355125655988625216790606133544688359480079185608194182313286411531816096693760295860401700686899945404973418133479183935007402382908589798948795784882245860744269201553713428517044645913769680874099101233367347266890268418450697020522900689696881443126908486388967925132022597183177077048466058402616565417237490681555073511846563119630163283871325819447920016762304750953830728085449233951698888354294225714401227504707855846582406422989382471905351332977102833262991282030407204747654234359893197513388039144096700630387877066456404728127872528360941389070125001169489046183200699572082685545648608030663349556118261324255187617795201425190508434308872004612034171590648465631232706632445018740991367111102423095436224050248419441353883653218573470489064517034896239570633026356025486146181544966104943031011123306530915382551457947115459930033352603880077269460121213111914462055781799375917205395769081491852406837709893361602121051372717419009821200936485143100120104814388223229509295886140418519880153391153630261889897927767499382559250840555539195649652025854861709933931685869329301752067057889536011981897270265693181417530318620517221540570027945517872938143565135242502090888279072504003059477222981955329889500063847133612590635295619484214289524456417445160371907341983320031287965177007112050643641377564866756768358833906858608579395357094738449074091426732398821262208673999157189651044185400457807869088963967106605399037430833216161004743913396336892732169198930155563643271120927968528993057440592124051722032911316241616684836181124575099706780573808284970072347012241761121068227059607729271263515707128995389000465173451588781754155583277963559328796482073763495850287391567469254787667709402161063726217105414772137312078772777196653349260298765809328178333277414352741379169026460109475836403550591820814055760051393134348480284560053266588373093233767838292976824597347171486840915240991463432049736603591228344107517959383877642798279953744861079359184046097233491168850869830796397979569297435014007110246262037416665317637249812668978599436528502345585424887918698475889473303588025950263687643320148897008071945142426223806745067517426397570744057746716425666574009640462197678997844243244993331762722676685966545690758934542625656969662982644009873794340036898544925121917305896879165442078949460557546300588010954239702789561027463594306791199371788361294169710665555416784325003768838986894800835014996943707227432160286896307177616397802768188225017488407665896610388966953131947113749936925457768023937908812602605172222983215103748383074952625214148170895107011165420799230113817130110099817270086269670026418258832100748779696075984760110792773589705172496539143412399040074294605482356750678463047024034514782053702228023305924660150144751497980096418057948634618230509594715874796286210991720443901004726743098398425791421413528422455277093476170082474592326534374086223081720028559054823041312151458557532349821721065198961348852883642499309554278320716537623529173189439467697997198719583540738156069900340471665947863766150161189063279947414051360715656899789466588393664661222664911700445076384869750211779919786000075814910179595292971569905615742545261203880650384461268181703677057988981236129652150994115678587204731092737646309153625054136306689266876879795091065105873304016483829991913601160313523368527339554757310714242265734286412456122601105542841114564919326285395508951412036142647887694215486086097597417680559103918536777066041986561401854725137325815175146230534626054564191712639504917971283094702038009943708407473061013329438149423901969501265621925468356234578628976506957866874441553003052167117104910907393331252170691495980873792647797813052739958893761677976216256098613073632845943400687957840143532722195460691645307050651482801450634742674779663026843789806148170437938455101901748720927485260842300932977093691188916746521234487831380896661682328633044958262084140902555340009678556428549173051653203773286384177486479310638361317779945868511621591462610975780880201281319816465456254933687632830732640556321780296329352387650216763424317044657929238690712204468846561273199157068705447049926895938250454869360963971807676145950257932376145107909906994489535508492874315550557348473155522294426895194213632876425356903802602260218299681123970023149484919137995896025694047630616842975248855465752563276302783878067089833983502249014985691039599726893295749900235131471707008215056027451078308004081935416507565504762321435842885497519412996342226598912627781335164410078217462731383786198497978674438307931624515637444844785202686138267663590168569250268665652283055910318680252906541461527681793658492233060951413772410239134101684276651145658359189680620102526509545075088033937332994925314668713965102623361628312839691518837205180909934010255532620609205319012813529949877458028986607058309132621102629211056140938280500212189153560249066615942163245528186446048870258143454292282949032042900787346969735711901444953904889420104103009825946126168651946206417298582164188202483512076639318161819361959157754699264540071667974805494942734495485706208668994864278216532864575072331541753095118639595590856599882311956413304415465620688012159778142640948671482383479267119926287350993165357933077929240228867835238070284163681632214655856709960120750569850374279629696228263290806735425698438951951933758293689226631749078902156845222554160862691456567143721323655691298255092826354021525745342415574153957337532861657980651801975191198144830693264825839385147624655037316688371507895678926490159028845237846810247377232606540266257104730399949788201360310005860060834241998974710939898808401913595871443608240207499709871670246484042143232777136418084775127851053482111975843854447651620877071317499128724155389429303033140871371190181914060700868432809559414200676941670302686398486650490600132479637557189438617086088261637532682381647440327406336290020857892431889048136237275650733657394967615081541962976892661942453918356273723602753855836065587945893710545378789050830894819943157634982212798032510248265440218976265304190433280917327086226409313333554608139239253260494117299418043348616571367848261440580973799593127150521710968083335216728964912401146127633376738838312836359748976231394569057668614872636682180672429372301991434742684043002203347754178633006749727226928135366555718273281563587131081867672768201782413412651036643532979907942160516246995216257871771198550478917440807562949419268898412371054975332625512622890744984199864506980153847166439702738900848790985839936752885024956990620618493478789451098866296935135043021795029422369985320870398153367701659490719964200790752007298590375045213513418466988040644920320412598882830913719310342775879079181016710302580041180046936712941155447773940622249011964142952439518608307113723995256372616573357574385064278304865037612109612097788249202777005432181271135803974862993512655891049119425085804923033072205374935000397776212504919341495620930866290125160964900121012076633497939559755701330240618503588816799739710028733916874684217837396872388071744417032748758841892418621168650540009528664683907796751681810894071980031600134242765540101388923778438196643268315749238351348417309099672890222874138248305328419232716895833712792186764310304503884413829900037852532093279003239276663753814171039846609999872288241824314877037435402562721713376336368196979207032962946218285340952213201197565711563085646590521543331035151188181831067001066444232266702669930252670066996843436570968713550979910043420472125149104053887254497520729845421183890054931265540609499256359246439854828737205741853709939215745478698275967808950952821526997289299613633410930552474525861659626385191286819396547064100771257698512986047131196657261390098649403502923626023742542242733626530987527981982410482738498804520879746420075910183107486747696746874662338305140344691272089702018225294386726700229315097887365787703976999438369461500929726440400836115370475523496743257464761829105564714649464811111385808646410421341305190798525853226796955726978596399125403044768970870625628256787142467900382870182391466526624050208215736127108486353577526685205423091439073032382910009009632124288244603284576879419456762102815584164645887532182463102992840342113968021281985725500345791912695393618945565021017226975826407251923866726901828646484692433731456251786259443188144033414880860217684122971601149309395709608732270010129662972272475745250233454993555061908214201084588399995469640428182547817665811961689229244014020523371899253262876576089743920408483707389716913879521656445816809391914902155014012481516906064463126359798419526930147196819052739662887489675560697383759148253062367265644373677683092444153920292400009327923911475815565774728142724603265332770831429922666153044188251317112883654541776748941107006261243842640243231074447652032200558588924571576340150977845633533350924082487415799971378847328344268844873305801131992405462071676370215310269584518525073496917711994839249665902055250953546130391160711275450620484252855318791950118652155888901191188380161530372090821551251672574501056228712451581682478256668304691145603878618443093454182709011753833917833465798719295442458768150516148767478922964195269441339610776363814258413792159255441944891126098146145485025243030171206765516945663065649908600379295214170983619930185774742811418019446389192301831253354109965205902478961298096408524672442157740041043971933318517722477708448260974022018268632147076157414208195258534303926924536642480499926458283784088349731093186928342348397035831349459034906659266477339695250185712398378141579892305480894310186933019178462293170619185710169594030593546445265679971306524179528963986823510013570185894191071502921903410906018654978760607891823430922048275551481774739924805077628006674416340937010406776832809772930804466402994328290798874647182330490448677706253167340927382491175992381542010379242454231537822994928708263182959536583805031566658873323020709511758791103544035564960384938001430610790697954027665299312871788987008106672947930285856093433975955141283693807012938942241430202201030616541366205817059507767110823427625309212503737301945238220942540577826346422856278586861571107222973481289647751462605002494911770521012720205129017583714851902369797533585557214915875658426290748799707991905707117534377543477361967882097536969193763795779453380786992084169498245470808596755296635493960702224863612677614867273980169431377695748895475944231149968102461164717483868167976638824321234612652064887805333437172292686212465849606325972589248221802317437077292292896497172466165467561985791328007767472509492777236651250200159955169762741081809227490720819153270284601080350106603896554755408694531745372032013547977461418190601243563338830647206888153996322995381904083428595560947697512878201022021872580989651358966404596101699955998320981893593635589471582859177223881064038111139925343924990893806298495917903982543072646171720303376237031867125773290634377265892539096716725320619811750800679157171221030258674217967910484661262208884963539101935495708714171583998570421848488621049065104124803151166875993330257384890622147574681789741697543566564769424070020997279195133820917180457646106729060673615118599058210639736477820304252812093366742169546330644147656297074385896800013247202758749368424894125793863496754720867706099829217558628355527138492581796482128625181348038940958222612705522958077719405415851249139868410128341580926034838961344861425279300482345081093597547555493443193727862732096409362563555445041846662202808512540438186216325464172530102794009484263911003482712728287961422771776410176362422387409509803754579965539811667465361161566387836899168081361149033004208665813927336692246128822642689491724914169728009880384434268786444399583826877720744559511370592360673959628766460223948802769959273667368415938168071291356866168456294101171999614288695662421905334156387506912086970611345785825533304545699073144447859371099619625561010422762377033016913246225686047353988682937717477274148389789850466226021227837740916640298037400924145975189444761817610405408889835512067126484609990030043625185074638658103219451288521482612191597789240858927130094296801314973729067942664342839853837360161916566320334832775036809799904379756545570415557830865180633324115109469783148869592919712116516797580086567357803688342851940346866523256200861485521097622091650756503195782130260935656401662380265234812373022964000284275319485466740701007222132466953796134226925874824505407534009345322219262777376566643973815336328899828282531099836663222571279924217395893707796644276859097661108554308131762266939482256522032512519621820427643486225458917427820513912800605339811563937135923062803738366061077402952149525447240388792909393761486734203006905915496527690119289683266166107468573782325500060091559898482020046282107056127257882303497617691062467349332735549622945164607436414273155889974558209026404919017354747452022701171821098027685965677912845314173359485502179797027488250554690053288983732943387034752701396360507811542554228280752664279877925943082227245697948131730181629680301909665817764927034471749418054370188216110777752284460170760889894804437056394342105712706799516765343254557934267979079903755143146158142285607699426168896425125927412259710788309153305538173628557551622490458743679817922303715733491138211176521686160563676581310338309000318920848837542422657120185068571069412749584466876950032460235219061525857211357843517857855238180587023236972969505771347602413062665565807539490572715129104739604479790703309119611013730455313140310257676329765727242961689439389963665838193251496409211161169795719617256280772313340211172181191989283259550913205448660800068698336036348538087118705827410815991875703663358931487606016901135902745384383005035718742784454679854993275005097088714226362314066793607662225403705537051034722751835539001899813550354275377749255056947630018321627092955241234791002401595125692687886021207927467702472045020945371601096794816891922672088383881186481030012126049126862769706480628866178815329024870161968228379257770189833873570094792020266851798438590098165918173452639620274030917738963227601320176345548869032524409524343755675738950303652803394652276176216914523262796223161275752623581526611379146266244863564835370063431630644471158379396333809993633383753905123694813517256392024728765181854124525258613968958650145342351534299742471853425968948912646899382153431202290278959366354312797792003844896801114821180094298189115545942903939064527141096816677017530128086666368975533741141260622384106044554526744361853795465078013657757659050972808637163820432200839526929855125667587901800271628712141941259375238667839531900039416491017036914087641339899660332930027432146517781711178192195413622298758498485908139269945047530785448318352393832033811009508311757984932286785443157020213413002952150306211200496440786741665029596215937912066465434667259848366466864685324177050381260337776890852610928306281835486093776487630643409807536030844433413591055473566897547030886503800605595590575924457855779126269444274655429652269405010435970192795382675413020421085761749576370351818286990258098073741017456604711084891440160397265283899727423695035749287465634327406307996291071048361364256400349518934361114670648843060628350446055826745553436255947327679235670145336767862471856200885738132754045167100312970055148676907335748301099151758447298647833500094869782678165463670315863678147460578574164176754617801299590547813530226855606719412811170206587373274948584662147381139545595395325588941571780536138656742036163920700068213700131404096657478927958219890232478147770926500420156806468166493443291208126870568359526393063813803084894314199739050087356587435306211058694699720497884057283943808020159111539073792495724111752031746629290709709947907336007333542271307794793253288110528174897384712976985336503873488540552852220631148577103688446761488789883258403964725511309078840943996880661022404411850978724858116097103726117751113812573395323071787361486971326588540869361886700172387870370495029846771185740344705772128025627465816710957572301044655411095819072238848340770077928825715699001487585914932651779267787716384283959701638537124671780044010818363512540828872107417973019043160841594666068745795922283911700469576702442499148305034479127834607343850471490849386614770423474493336063542287854630908391331802296500993152410615830494887170129728969315667374199229967335149446073046905862988123803351017719144094644585068954950819545333329814572602679212882878045094579777631783208343682519456289336876137446888923600475739078165454574567865168815658323198237690473694536021315723244552034633423776070977990083461482386314279922990033668407618269204516071789805873481887960678256997875226256315700372874839298672037381065415613417820964074478897535580815726596766518438778041551914549445057031356074496306371797972797470618239524240689180019515713725533060107280276621010778147925750709461226467014824029341748631444056717216074902729360001874951560764557559537985090827504033684869035105073416938670684210802093466328571481405520246740511069891441318756912292096071896171349259290123003174880622933389130940037039659841470287170501395868777742781092652859021905587247436599951350529184445136926534863642398949554945285943395652187473428085023907560041441230169764182813591961773173977382477221565358775181651603272213829794861043418399639445362958083095920794930646354931545085715996569769280795271343262631494519996792926523794246836636644910483685399691456278009684557386915755638764881278311552039529887541158102496749545264289077425507758112750443761076655644068074855618144103429753012847820275798496722091195819068261561044853066334077225672968384985444765410879648816844977161249410331656592457932783608420604198489017318908709270718477589643859116811336307645839817297934309597490640851937707965010382141875988348921298961936611879239561841807883399819011353482864193524136447743220913135198759639316785196533529499899349273011840247958682463640003128875235294528893051696035380457341061851314097409202821150472574070185598890419410381293107560950085464505951826835443096298332143100423442578757894460515122767888247199106235990615814872067142019731969293683107395113158075418177010187639182947548608560191163778058027169857814176893748259306273681841777470628275118455565074970995349957582648223506135460984876833887508840026307397436176611152700875010141160824249330963839446707953858283522484791655334084680794145908765794480452515824120061629537192672600408264955383780808119334164211717530637204985061195379962122988037993744897190013774248219812849582177873764379537574245241424522412961293216673484829983256227223482115405076448064621680651165239601896379382504794283499999183253255453528830916992735071607102510861583142443805891751305521425836713830885622002908222553411475379720395664289572869578676935693195320290587930205890937422930949665304206513100555210378272031072651518548368783377852340309116477935491199572607018388798908848213915785496561533534672441827040257879881922653539313873303623943187218899905023012777731225655845117603077992125888826187415433603872365060567884201331257073763430588286394136618707774556808368687694188379606163008627413353841431007866812368390789581997149072357028586168280424118351986669239816194573291530603637600613907679876224967320309941727787405620262489055733064466068397981072970892697957058954020941957659542033303511479022652945283729769010025810080965230565336782037033055039476618551639741132905945312514244689181906744997291156220855002547612074925648483908187322285372189472058863790450866689845882829503790617974388066376786981214022400813309616388872702465665386911210947004051525422642841694125205312657084419280320824692733692325554274650434843184941398143874929160050323202997548022334837155095304959670167950823059264122873169236922045585190241129303196109547547871979092620209752537183474660141411914005585665790976499568181898915993830298744520986005956755226319948082066609782314600817180458737029191186672306096790992764390394539854104247439959423140922596500573023142818702915777241320084291141238035350267329154469584313500864589440429430168151713109660730953170782694573113862448075220479157745278393365531997773811124871370744619451017988058493595239639925119744320339001242198476643330548301322606809374169442854948901755244710344657394288818674865391704466278490814503475289855917673771590442857222977953148269233170847793489989386317190508178971214767582084234406540557905251488800247327719025456736463298318807034325751947401662621461083372958499478570428035227582663351046042633394386770573297199090633463728312340711177096337113116500648914811638178197837321756309379422537422227299041149094636608537572121859507491231889528328268446532583717473678431845097735574375589602733913683197485069514766310827031094233904185257157383637375062826011944104833881765519462732401859829564450009840910801711441659534824857578759479774227753957680582653583774266397358521972016963445398708597022360974965561093928160104998734810245298308340918981560666090352683832585717451512605759623127834306376218161052781264224521697829540326397335217259215698741648835615732432998220398322348046646835028703357256800397298429098610494996858372463153802333677921369839157185449345806341071955658489025550780526344431638962623787764759396059110378296008058310182108280610059608965939724107383670850852420051282397292379579994367839563665339269895264217221274303349027874077540649619288600944820380429716105308450380073936192000439124982925149680091323881385818838061203323585066784947527631153279668521066208497562100237234415459431928552631809470525753759302015003813660972286924143780694938741293438189594006018624063298078939673996117195831852025999391739689083379824873949458794202890698823170088254939693344698659321365478316575093130367631586708841527819908737292558437198831453496846190810042437202857672697204432105823444104462737969136979439238872646313454740965701468029222116557826645822072010577788973762541946522614621842961854473611668876053981585285436749762226097518876980411372894456706559734798595404169681282979688713678416588132457653146481205999711219054654610831788033541015176936151395287190919527625425348357994434461051529388892182795257604815083682878882429369223908736438773196694538651819571690126495236909878116406968618965792880871296172757781607279088968879339993903797928987411835286102205309137674033764630317184626344604255245345383927295591567776348515195635803836667265991911916327126786109815542447165530643920066357498488083126881832036366331910581026166558974014728770969500810874620012678074377457237210974622531790428706044170952864511782882966412291220571267531281607477863029760181591179405395562021555857408274925179116112627909969049472094786629893060309657128202855975459806193780153917957239383995348003183297098303007610199814626290145154063271901532310242980473041403842765949569133364650935094484377079657570335521584506436219029130607488283206273780199960105643123642107136128534761205053310294972988217490012810468608807659117971312293660728139691832608001607648669835233686677433778402985333389504419238954348522918227686902603603427323242154264929162813380312031882628663012332039968093681700781198011468544219519638983020858556965127305628979271460488892792995901436554151357075698256873684617822907536467453932423926219961571304655658126405947124058141157256645524167022600675320705057409862269838979798231961103513978173370871881219130195409577758317561369307286399330322170901822148847602980868787772504231488283568851199172355741678958198872011271145325377409466012198204909221726887397749581193093071827538486868369917232328488239257055194869966500168193562163153770037424963693476191559894638636447381295186881721456742065187220640747847747349581137612947670362466022718604685881375288826600434938705824533413413380283192683238400572772339240643993555177433373129215218596901115008152777394490353811246820134201724813341207608315282216214463681287200569970934987700543372672422266933369958970923120695583322958453611667142107301776259501906432674488188766931741443315560648052059576424687237269578956287201764951861131076354238670129771209749968783417723654421241540609008311231882147749138987842760520304310132278108187022428660631487308296641813259711018470871586335439858942045047542809954557829804024629112734984523536284505557169450994798406932356876552959338327968846840172024295399349379471559618610071489828290484706304629859610782553013829954136455943407153943578996947624254625508130632172820195556153679180899782908825661522741735811592174414008115816162177364572500820657120603219556390413505821600688932082252400600204547204795259048415150644578058134753362369287914847939390981704661279202604619610258944583183692286844817815721983085029948656339325822799888967663388545717950928091448027242917683571187713335730883323265380930268577009981972068805383379744249246867136192563058043920659336441436284440465484910899255922551054365144625163186673543203011943568160036086593471438076873529091437693529712891648630283364558794086768223644722950071259008670239614660486455049255305449820275741445287797219676661015709227627336757344405042438529062015046499042689728608485473480410504390548703367162868042087807652225000519396119123252123410439497088935908137502742014004006029783335659164193465335995015231828976460957421396670427727107429987884004689583943556611741756085707784998847531171488489044121526594099734480033515370615372414607326515606056907212366836096464448823240421878936198186700169048999871508471476276174162240341179401553477118275683579874012959018395647796701222585002812706267326353692423569809708572374943595314630616496947869567969062144549319541785715591674770501840542338439957992688278366785330142993168114130240842166588734322224884869618589782889301699331502188261634707824947319593694871365977262613644350485521660506687193852003428544621706904251468832796483152862405622818840605640957124076605480787209647360048545486919718862948355247874396276971479784342732215716329660224402159671967506951342342621600862926354039200707500448734799067527510462506032256268918494073857663801922463683414935971517108337451701801042522097636567120124839168909612978646823076367927209579122205769002982458627726102610267979715377347416955143832726003981131249502726455364384134592439877711168198528731217312987395470626888100690200783442674279944828444713525199188605706851917807254837553176519555371620156317331296343086985777288448231327843862837834707295893177593895675900314381290359969399355615291460518947912096464852535057034355958948875794039444883985038050038390489309269169732190943941929083801824905915521571609730436703829142874223048734164173210168125581079365557129283210215148623302591178834663362633965466549081378663989329628671172900728977550554268105859511221805131280839527738071736279679009984118117727986809946249455588521218431966611658142166287608243451926460704896644968467618145449453559111532257728682862296900221548294909710179292251288456233941962740917939484180396738488312093548995028510860971547034262947230465356881767301557820924516338827052955260327419793344687056674264154911204259386309556384074965034049577730433772889436934511422120758187662395996688016231114811961352929485956504530736821396687557134136281567790821399108252099657139575371381407928134733357274108067883997357337348492656435788243396334102116142375235067985175457258081076825185335750031655248644406042296947194759121404577566266943879194166662203374340361404172592038282457572496553356508597451161486921157190473872514881110591638909180495071015032314021030232432713990195
0x4dDAc376...f6CAe1D92
(Unchained Milady: Deployer)
0.41217844210991347 Eth
Nonce: 1180
0.23999339837306935 Eth
Nonce: 1181
0.17218504373684412
(MEV Builder: 0xb4c...792)
0.057176484310681609 Eth0.060563919310681609 Eth0.003387435

Execution Trace

UnchainedMilady.60806040( )
// Sources flattened with hardhat v2.12.6 https://hardhat.org

// File @openzeppelin/contracts/utils/[email protected]
// SPDX-License-Identifier: MIT


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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


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


// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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/introspection/[email protected]


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

pragma solidity ^0.8.0;

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


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


// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * 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 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * 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);
}


// File erc721a/contracts/[email protected]


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

pragma solidity ^0.8.4;

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

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

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

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @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() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 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`,
     * 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,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` 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 payable;

    /**
     * @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 payable;

    /**
     * @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);

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}


// File erc721a/contracts/[email protected]


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

pragma solidity ^0.8.4;

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

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // 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 bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID 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`
    // - [232..255] `extraData`
    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 => TokenApprovalRef) private _tokenApprovals;

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

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

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

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

    /**
     * @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 virtual 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 virtual 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 virtual 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 virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual 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 auxiliary 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 auxiliary 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 virtual {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    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: [ERC165](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.
    }

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

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    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, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

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

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

    /**
     * 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 initialized ownership slot
                        // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                        // before an unintialized ownership slot
                        // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                        // Hence, `curr` will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed will be zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev 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;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @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) public payable virtual override {
        address owner = ownerOf(tokenId);

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

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

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @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) public virtual override {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

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

    /**
     * @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. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

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

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // 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] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // 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 `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @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 memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

    /**
     * @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 Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns 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))
                }
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @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 for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (quantity == 0) revert MintZeroQuantity();

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

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _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] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

            _currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

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

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _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] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, 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.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @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));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

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

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // 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] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

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

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * 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 _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @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 virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

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

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

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


// File contracts/UnchainedMilady.sol



pragma solidity ^0.8.17;



contract UnchainedMilady is ERC721A, Ownable {
    uint256 public mintPrice = 0.044 ether;

    bool public saleIsActive = false;

    uint256 public maxPerAddressDuringMint = 100;
    string private _baseTokenURI;
    uint256 public maxSupply = 8888;

    mapping(address => bool) public mintedFree;

    address mezzanotteWallet = 0x4dDAc376f28BE60e1F7642A4D302C6Cf6CAe1D92;
    address devWallet = 0x67c724f54EEeaF679a62149AbeA6f067187731cd;

    modifier onlyDev() {
        require(msg.sender == devWallet, "Caller is not the dev");
        _;
    }

    constructor() ERC721A("Unchained Milady", "UNMIL") {}

    function mintReserveTokens(uint256 numberOfTokens) public onlyDev {
        _safeMint(msg.sender, numberOfTokens);
        require(totalSupply() <= maxSupply, "Limit reached");
    }

    function flipSaleState() public onlyDev {
        saleIsActive = !saleIsActive;
    }

    function setMintPrice(uint256 newPrice) public onlyDev {
        mintPrice = newPrice;
    }

    function setMaxSupply(uint256 newAmount) public onlyDev {
        maxSupply = newAmount;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return _baseTokenURI;
    }

    function setBaseURI(string calldata baseURI) external onlyDev {
        _baseTokenURI = baseURI;
    }

    function mint(uint256 quantity) external payable {
        require(saleIsActive, "Sale must be active to mint");
        require(
            quantity <= maxPerAddressDuringMint,
            "You can't mint that many at once"
        );

        require(
            mintPrice * quantity <= msg.value,
            "Ether value sent is not correct"
        );

        _mint(msg.sender, quantity);
        require(totalSupply() <= maxSupply, "Limit reached");
    }

    function freeMint() external payable {
        require(saleIsActive, "Sale must be active to mint");

        require(
            isAFriend(msg.sender),
            "This wallet doesn't hold any friend NFTs"
        );
        require(
            mintedFree[msg.sender] == false,
            "You can only mint 1 for free"
        );

        mintedFree[msg.sender] = true;
        _mint(msg.sender, 1);

        require(totalSupply() <= maxSupply, "Limit reached");
    }

    function isAFriend(address addr) public view returns (bool) {
        address milady = 0x5Af0D9827E0c53E4799BB226655A1de152A425a5;
        address ssrwives = 0x64256b6409150e8B2B25A456A17DCf171209542a;
        address angelbanners = 0xB1224F5E241424458E87c14652CFe59662BF3A9A;
        address aura = 0x2fC722C1c77170A61F17962CC4D039692f033b43;

        // Mezzanotte projects:
        address whitehearts = 0x4577fcfB0642afD21b5f2502753ED6D497B830E9;
        address simPackTwo = 0x243d558472eF7030aFe3675Bb0a6f9Fb7cE39E13;
        address simPackOne = 0x8b6DCfB251bef4953cF3f3A8C66Af870e6b7466e;
        address dropicall = 0x8b82D758a95c84Bc5476244f91e9AC6478d2a8B0;

        return
            IERC721(milady).balanceOf(addr) > 0 ||
            IERC721(ssrwives).balanceOf(addr) > 0 ||
            IERC721(angelbanners).balanceOf(addr) > 0 ||
            IERC721(aura).balanceOf(addr) > 0 ||
            IERC721(whitehearts).balanceOf(addr) > 0 ||
            IERC721(simPackTwo).balanceOf(addr) > 0 ||
            IERC721(simPackOne).balanceOf(addr) > 0 ||
            IERC721(dropicall).balanceOf(addr) > 0;
    }

    function withdrawMoney() external onlyDev {
        (bool success, ) = devWallet.call{value: address(this).balance}("");
        require(success, "Transfer failed.");
    }

    function withdrawSplit() public payable onlyOwner {
        uint256 tenth = address(this).balance / 10;

        require(payable(devWallet).send(tenth));
        require(payable(mezzanotteWallet).send(9 * tenth));
    }
}