ETH Price: $2,436.70 (-2.16%)

Transaction Decoder

Block:
16393767 at Jan-12-2023 10:41:59 PM +UTC
Transaction Fee:
0.18008535668132394 ETH $438.81
Gas Used:
8,574,390 Gas / 21.002701846 Gwei

Emitted Events:

263 AVENGER.OwnershipTransferred( previousOwner=0x0000000000000000000000000000000000000000, newOwner=[Sender] 0xb894fa8fb5272e0ceb77e34cfae6dc440fa12422 )
264 UniswapV2Factory.PairCreated( token0=AVENGER, token1=0xC02aaA39...83C756Cc2, pair=UniswapV2Pair, 137109 )
265 AVENGER.Transfer( from=0x0000000000000000000000000000000000000000, to=[Sender] 0xb894fa8fb5272e0ceb77e34cfae6dc440fa12422, value=10000000000000000 )
266 AVENGER.ExcludeFromRewards( wallet=AVENGER )
267 AVENGER.ExcludeFromRewards( wallet=[Sender] 0xb894fa8fb5272e0ceb77e34cfae6dc440fa12422 )
268 AVENGER.ExcludeFromRewards( wallet=0x00000000...00000dEaD )
269 AVENGER.ExcludeFromRewards( wallet=UniswapV2Pair )

Account State Difference:

  Address   Before After State Difference Code
0x08249bF9...174D8df0A
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 6764290092513726222696113229074677300582406292993807811641041491451546652663832946268808145007286701968245238241127816432125602389017184726413726136050937847590796869894293811024043065599757516383598439860933528181090300335935280589560730897350622577558550967496327315713176388796307993199725684602376921455805779296510030374220885547509444868710798529805028727005768714365783259716828657385948829505091458413475079524481325004020131382310615246750211606259678290998829940259225530128665275112971113196802097677938777250683881132049859974062111934820441863780430250758355797637960750640892756709980889465478442266956369721727910472098733251357727588359505324099520987734779471153904088146904451113253009478829999518384731907276109897019974128585672047901928474161019609964254665696537118224989521679461638527674308793226417841604722503832053048532902743307744389924362467024979767299820841938001585847957650624642000220240301706785324856386702055650610854315204968583184480811083415429779248827536575359465411506177177445379390515456000159118002404098500273143828586469646146990732293811248260866404603448208714816779792930708637924585785344923086689220023494975479986597804741972532125496013912821587981468924357235612524376639419312183883107468017190276067925579537757182722154167251792251293467252920429282802741817458964167964250178698451250777244768530559299419515124597360317799947936425995024904777435541609134244762412649594375866318483434878329518971411551066386725769756347738476890766956758257170230921029118937851662167147785392125813193563910941558943591672789492960140897136645764649800443959007902537470461773031419538777723327284464018316420780337409842568888985000488447839658062527760095682586164775773214642810659950442674255315187351133219595503239984805187885057741209994719667251209388778069364361415301923124931799752866448084739197681034988561589076201577647621468568479848613173121320183097946088463308654506843928283535527795375336708379201694478390364822689103678655730058935721861270429978304410891962229017129803257390918323840648004285775706484187924048493162476273980415864540574125705878836618285576167457968612731352121332774607452845505315606948482016799746025821947900616429589340542397646412597175206797007211195539013896690130035550363648156843285087910735824004198865927580262828335941064623092413322301962233201566480061682912328546536953004420417214309810243482480379230346095966959109164429110341332451732713814747175172369733954829327244006229439107670350706716504118905719655739745414004105313534003211265953607468408682381484813134628064385347448612228488546068815684868943136925228466482662307586209541232941634702763150423361005273125768860359321003070498329113152304044687311484369591886826286849241492714746035453530985760826074202224328680534075056788780527355850537526507990425706923533192637414998552174291800105823508026545279963231113518342895385291117933231995145145452361617497189515110310877530569115535492435194594584350568641552418631024789844590572990241425360787270142022501098410402040759002817599798496709518641266931956940271586933881608794762860972357074333620000074482790947589178384739181209133451809354582793752274745523208872446938433121740875395933730975169916652974709460068802648678902520835579588544048994083237923468544353056358980354473986903440319386298931321751165434975108960230688774040300045910090185787247588132844114599051255052017617203763570020643980184460642425997380706939760721292671508756597075746922214664039831793061824906191427981111798963319671103105682516044128013644490508952038196950395775123309117732986401317399418753541902793032595083149403966845032349974555993774125382550395142080476019329977201288431302910516579749086814871044331826687561445526814857627505768646136097744557146538034074086772572657530335192950240723439893641016921774546927888540880657938036705233151583642660012962859784691791384878223191473627119947438517852764440971828961508452478940789109988117017692387321165609467031954503412355042274226115369747525054603510429981061723610769942555565153661401943161583038218788194845730510475525890705549828114256751060625497255614079889706354664318409524618711645393755865535736265419894209216588826891584654729343750713800564534728044555813377838103874981231171485140733266263299075026059236429164119695778164125060523337408702214716847466436355994236419462579542555885431275282744454622219328312809704544575841800103951253833159611958531352158489434753375547341984551477139873587620077923891601356185237161111728906276435402989046268121585153012726606548147957843971499826751460265151332607569832201390696106196200752739297898595139623159042244745256456626142684727660272442966410634822047683300319330400559169761628065756808063467026781859272204072788017738137691590428849940404623797624164623418991251701730339746049083454229761375529668033180050831851989098602590190931556465251664831913405722385646847081246713251764160201651313440050983794542297240590895258738842148628156159843174422928120719239842890992552053714524427740845567993163667220733781561399513872561597174177415211111516690920796797771245920805360003960884760200848694231187480984290755084028272394277514358038092541096254350991713995371201841149362979043223407550175185349343481527598607799904721345357534500289318086908178164448654142236064067691303983660544761075017470810256587690335468605289643045740854389048200262275242835132671999817265060762054164020094958990758782725058621840857637716990971046700297483747224874784380940725167238503937445236580528704977883116876684784812105248904836687347634087630789939736208878631432723279309619974220517971118933133332688040703721111084237405651633296969394952616986454772780782236477757818719241494505270490966054772513455627624630005101236682719525270803450503064376334200110077160546253677571419685815620663851070433904622739183540407694134892752836360832538907800130968377752994239951195784527074784186282221747636104636183157750815793451098991297791149668131506205209201338229284164964425750495059737706472549130820257914073143963770346648275653428733160833088538926684699923331640831574696709585862529131456577383480549391857703708838362649800221591036103647730485858022409440661539159192819497548828260828265538529533585508530470524989669001456733688955602622011860883640745452161988954591994125158616967790239030532336904388115367138662490449272650392238721799165071127153267098924288572207943567511660222463941209767332737839662227704940675417351084427436840529259503839007120450489208106621466626535066474865241562379856926344618852106808758097146079191799559319324463443117408712851590498042748419485714349296486390727760496977457722407596889880244120109608420478707801123486119654774232164143858381932711394509013839366882817856528086301231703477837632979266247673310145586602843728627791338776429883562245482454731619584945684936774315483861743673537783429630514215175251343860831343750903112114643957727299881604440299342607613370350603554504965249353808640005017526991925625166547716534038743792145754791681799372563214582732227397669366844361480483684424805049433824559921611895043946309368453026303526413556206774758337691102052148025558145429495060173330866402500693439731960967682169923931093691165858343836190590627360643853508749006236909428207026806495798765936494138323438961022814367473195404043719041907722447918404463260294688120986507063786298949067678950587962569110366612944641472612249173325809273011809698490557178553703028099562680938490396991797809963662352651174475171566062249784396222183324190302655760704229086980771663717844883911607269853698488457417825326539890406983009667814030907614840230105466135803386012608272054670844544529233478939341199346844515817283532802858042261501258009187082544649243558206678780997844437677330123470837465964557746228151937679921791178421215505735405575109056703216581188108652321249735290951499523192020938070710596952169566673256866090961908741957987268407494787371646949696885460919597216876116734929493588469220898091636159208073924384748954733200741628862487985418847666920265644376986825100469311209100338844849634350799853250141080141439713530624083898238798384028550063131897703658759872633810114112211904230734928611739554815204378080824416532752023553763725404567832013292304011997587857200530668930543557965136872372038500689077196872554532514941590492199908458415237082874255428025959779181075920338933105636812221073846658213726279205486919814667929367517219591351704444216162645682210790295421213989754380776085340989180683297671834937134685581195970714439656380247591905970357101417644632261624573751397652987080256022888790428388170130596807031932132567258880599336656131280183093634513676634099779187050352955040932386269069409030491683437740316198301759703346847040697132809216509269188576981188481741208454290436912477712961809883892946931850332143093113557947073073133493193388622663546816814788273516833660139858434029297726609646054004528695805557241526096026425782919507511150973467162816008336604564396099493571849684779129558232640291170728034253643668090897057239052493579545550876007696733317790505751519268633365330580596948616182551659835202221530689455005320864149002153702371478418387283150611210937475882684628893586308705327111168523564383017267243549454185080188917394912629834165963293642939668750235743119572767010423093845038857669576684825897647730323198876163735426894119250229192676495876824482984885795916905361913128771993068480935628050923924974584330675387263238833952316293420405834941410462863024715845898529451002644013034384563143684303106305161730964862516380513513090041544289358036475789754179412107753713818133862537184289678333722961982780632695650705391830567533815093460343368020719438594303931918672539611806165551633361245531509631236294368693797776521963029847564800771278896901887004240218288632377404180749260673412974247077635951291505763690546251206522916341842345669355128111378530730869540686202792860720935596082760553179364451197915910611110567650554133274329286409222985812687698305482062478735481606757775081597155727056354128088556845159443149791829183447651390691077037066885114632862380245151818802470147991099053065256475671018585152952510427035235768890000240568699799353803923346267868222127672252791506337485684174168291083367095515792125626919342586740255104560164716640656979255450418721100238157374349012708264095594721446771077927904131757020744005879471560707024285793308799890377664446444696497209154923522940451976298189530823002220368432891315784150231254903747610042319247999373104561708514248138593425334599202349780452157320167937780340833840631249982408812299987763184216682052627937304738624267660662701449679993556542526953378088820247150468272072500478794185627944260702384965595234547001740574036772121761440909255539749642143706818941013959174681627333589863243791277341202978458183403356702498325291841283674258989071026904599657742857304672848082430957801852056769792469060717881606830909552639167367917564753559780204903737906441237879329789257546182683727127115322069903727988518726110079487404802020511607781618242819429420089952618150015040687309724351057995254644909643659990306397987893792742104471221429087651215923455299368785921472186226973526837488985286754201722930812143157835538240691117506250865065552583960649312199939316137384317909190607335893017385837967547842296802921051846592655112401573859844970186624205609802519691311319580168923392745867891477530622283207438643706944844182931366782297825149926316168536706894781550067076846798287139321147716449014900948126256408680150117024107354911091639037923916870958931724969659784830893556188082349300933778002187943506706189874297445002341661863262596175000304290153490229027560721282756675903899241091327321366868580075450986013686336217170613325953994216424905427651509439749792881592559295908667468735054423414491972009886466126864152276099810447557792865414484656309040180366937046161097203440184665847528107800687246106911748090241663738456905982879374776075826959890272052180911167815484802956453480223451905817815986200072019409312539479823240160294321013861415879683806480801121789543612632313267996424801440213290141569842478416267842583260933194565280731409546914798090907553328802639824695214079484968171492697700379843722620536081593766292525747024078145041540762535961046108970476047624974467617855630429990419642577116238310295258739009426864254518359941258619669364910191558743007389886211816286196547873549687195782980562303703078573352594869126358338535037338805457363813251893303645464748981203623384313310961935292872592540227301085345487567774295253486990810557590474460766110088256031465649867454049853978297832594858855014974959336921139992518398181902049967081705968623560219572355863834361863471356250645288809768553450722282913136962139196770878174924662518413835493044338285511312064129458061417425546441052239857727919702750008526239403176283339977442776563759906879945240605716588949012391858531007821799081844774002926691165725398471759618939120110836523329075262746740205006111913597393479191016572068644428228987329788148073618409742903036359992252826967196736715853093241408814752240618996799914233025576124689956507192938159861315392870711114529172834682750923700691299302307091440461395567404959734546062323894683998564701325833780437972604515976543418379956273057791668270649085702563814683440555349713940149719583840350120611028746945759657158941161739867833561483855003986868221117048736066314604088328030661386531830410862233747563258660020168458151556224026399759857986377768247124506223149604283135886628157441527562119288646712952460396440504473459450281587445391042122888567151597019928644771358604352684544774935692179968419852667976358094993557306305707419215110575870945588263060469008491925224318282601381674202182173728957441525967610005976462159108522672830249929861580309760229880209135107975447950965042249069114272498472606685519158398158453321784839571604335975368386293498007880573774972375151343318757759313906444462507800881443403355944761990200754208207198799285296196346580918143110892255583375606232498498012951522497829857129603412429391961614266045627069206365540727104498529828934706571552828383708993671660464792189355298715143407340870872358594769225567216055125795403038204258550090209261330851021368362078057721856147374553849563949375115536641606704630492897628219114592144363440885459110530247622582729306865142917105722134947601821711203226459176453715017863010371070757960935996090769414578499774698669946986350926671071042854576601011366168897075862963672120256379385521792802219280102756704362425092489027354535128401379693457583486620083746346919952717415398289879545576791175596331980251055644363911476175866157131634981722476769928979368073205939840936175115011825949712794754653888124936432262451159209764190344727238444218782067344785409399030749605849827080389953074761160641751950570538370153836773652282726102554259264427693292321974445565627079614854146581971964907609310454007234972380632303011178287096851137085917612044812344029102122520241255957806216666303087431463563974309540831177242119479128498547771931445380854759092949483851131239054459865790851900684225462824192483995475613054141630410172806769615180410729667817089704751911056456677963218229821052414968249575434204967548620375472100120764911399759157804380112274413996979953080530104063887812121642791624865021264460575745152658825176211337355375215156591268395207756569707380560320092748178809799073339153230150034322085144911763682467095911370450349164758389754765586762878049407888245724744997259471226819014336205993096651941082526644438023616442252857259378196219549408643195769871481026822483366960574488594693968271839301044267519918792385119346946618421990742392525567922849361033531333805519730841344139181961493930292592996589203790067448478224852023114971309611190820049902449210217615039080815730321968206066273891054387712140472093819738851210013833169379888609322428782561798139632187196699467741521068025507678736717203500114231556600519408737185508687511648395357402867651420892204151924136721668678630024991088672030413564951109092273806676284039452762124791584401296908648577431795282151848609140677037158571634794256502974594080577051686545556607498563485575753220960188781517809196230752373214710394358039533163169617372187457387153267514083070126303564919376479352851093866957502237542568706783257636820706106108543628139943620018429812153561332433978007417707091769054907284256718739540419327974667810716324771807074714411001699627572361666561394311276795560562246665890864958873815526831202811626923143681151579565737037626125401361487764835059771789324392137787656573861045829581920926182106170924802248205210923977095643289062610442919240870817953861349045675660555743663471182466546550738791294218992391377190444533440256177379995195637948807579165828507324509817934081700873549199054102598134174353968867595536343788602057212645711438052815864631188644532808337558063531421690328361261797425915803646385226849947799314850075738099393024556559586598418486569945993940595599610421864983614160605357943378648746126216934831129225929649092647080940979590144629216790913108186529982531947043971176869001683334503721088119660410247222823993681585537060306066899978076043057006842394029407830570752837868854143748244327765879558911200445296922850606598449733576220037596751306793117637814814809076810845581417107313487016190564088533464760175004410185349388706290948209020160331438702929747073999847911118242833998223855365334396209318469891158283547361012469232412673861463373831580213501865381255459320842625964676283986839323490997347790280779452514393074121873199156736715297115525804657940825539490991870952667132301281577104602808814514128093505020837391894164020288471138795477040145388474319619392418098844411457844344819636186288456991613799098163655435691413390581981106571611895891201523136728583002598132487530756221719409491432807052471320078749886276696346612425562335751618843061820207958589248251388419925830408982049731166352978177948440428855441035114829894027933768638096795622311990754643642480765220362374685474649398930111424624448993795547342615533717486701347279636474653171996896393993368399863331665562215305249505267582371991400653319112920715332232758174189257897347694206759810504816446459474642119433419595162514440673307551153917538908166473350118859508873388530270664623206129931418203638930963504423648212659991557243720147089819330189481547071239197946872847625158599050136589167109285310355708139805992886967304372128960120035967249856357985567636821419394779738398877938830971857460363878028357603108815804963909581297635715785122151423880623773510841971615872803004278642115677963438463253762180232265937947081428266873403895540343919541476927014762194185492670808213544577235318524626246205222199361132226793766369092405517901071044730579717493193636382009225072042699611589560849956219463933960444297456575794501931201486158834650719432996973656166841633140568712552992556866001892529589818015555320895607177709927456997843290736960333353802274207489150830583171173705976004003107514003499465961116447093038082140585883937643933388792177032332218127105001727447931351542830607832894808097709620837338541162401423241512159501853485273279316730369992363869969225480880372360850909133908359268538979263740761556579312997137274133094210727646154323040783981629410776223181612579812269502289673006076335556442960275642545765809876321258349338855242165453266668192859843679302831204761733283555830152779768092212434108894692633188732656616583708483211581534054289656198028419314646068520533699052369935109596354059478321396462107045158833659465676928637081198271492329630655513648119023734788052785747161074690566974763166744678116781942000400111809228361957776009325581890949387597571502880481238340269550093307775796102685085389516433410129171154321214056625937377834950543338245769030728829686017765144121191389484230565540447998095571881807639116241688980698457024057575129917234058983003295689268394838410607777712617223662791727452205745512815120135984661065715443604245724759729285538406223337844757875890584073570306115883988628480307537668569448581617467225188207875557290340880770862900594880870117713053526725446506721252669210690565757714982078916751033501987993507497886816908544535597782196537857661163168155467385231328756517638903073024522691471339954497875543455667671985687448196140903029844662112739516577389964702597777881879993188026579813526544373361467779703880035148161793831657996452289088988522078211549544941838341834659304849012857143375279646957622743539224286047512273646332738104354913432398751748776303436846678966737226795105947612660521210081857614304545802066532878159368902513121832477063393728646315903978978417725275377348336144382751206934808050336979183524073794363047059385366779695905936629565082668113436200002418552053501464147822716125951281081626449240687659782254096702247173274030119312003388671204470634487632896966522413113840196090168852873355299545907209039594132662263644199792639947500528853310081332377374094851463951990568475406889477545808304306982496125598774597516586418367649826915662877921875008851206415137210039577704357395960346164807887222893276558135799917992928510520762055279104747028210243378548127981504554300707979744916854332552979917885832790667265044227405833453983668996089259368000307363521342399016262305708676959119169445587028414141955444948115995225305706296148863946137017386527581705688480724801384344873811707621661613344562603289741284272299897079266751049976714703508088142837932878218409481059544647608343939397072490861604856512692294673663501165974600903234374254958619853088409488384962249431050362437755006792017222959434090043517413275112525686727202978167056469344307721340393172024546351300590425624001762505968945684644452868541122431308825575090259003803988358747027552498793920080110531559696802247025637451944890330258593960525701673937396964882129178145848898022077127853695850659153067533344750863905302557586864631698795335648642767540381253600764485888136959036833458442899051670933635246235444940404864480258845215235709451374866006822468230680421430834387766942713246358107886822658197035105088441365359965313625033118899161404193255455091163078685115342371141956649836799214235346377328795589150643012681169368490997815232600626993419188485240522829565986637518590293323207473875662607965068345913236158900084544667342293172284971759916782537619534171798229625688783566586310211543500163083352362076280555201116023875712391718884540760495007589219975257210992338254907941933783504169445277177653286048162788882065426772485232673663980835703951031403135955662287308137499161744399289229660191063712741021250091844557410821866536848770205944334376289295504617899128188723974573843540376369170934713069944183448819370368544447717296284928789609546924988805850894814137794682086321514492249263072226835615740386402495007851784437979239584454196848083951501751533965002333499623410436536517933069298040066251487779961573311424830426862245268411668151962291842870408784529588808672984894998068948478328659484085037639397445471646830202692405398794942311367047631000902453589198781642261873174886387293172615195053771249178974991969115652438013993645217367329179328448469251298195258586410111546463321686023921891948064390932677400045694884140480157629056213846824921972462858598868303069986636626778915149329873457930180897725690404333076468390655896981655614463467352868365549602784011571751704638269811484215627261675736856646418817571801562745679038330339100378104167056048684983494783407023693208677963417703006460632686488824249933372893046684367384351228674532386581234695511373881573077064566713343232005446894198007044326017224909579982756378005747803102746280647679104329174519768599653633260429490217721691640057456609180427621576686398690223836429224585196393249986121948477357342022470938329046335936524488815793467961973133939682552615376993486021054039358788636596619141479412808401517706122002272387746035625791675647268762123250366821740062439587789629890815161354537245109726660150508185319800664780846796620609716049380353249497917262043623003214690407543554436948804661830012114573509174725254033104452509781095548541699119579999902076294756663550267884697947804605817029059918883406984755180285407619596122371075164388014768644563054280436577149501345210374949988585943968226840796266869061400679524160687644859329034662837673247017091139291412838902012601812483189105102410752415899901556704424119398075271565243872606958365090443597139537963403352774271270883384906005867999168938403120332097325518966646252024722066135777121168591028533514218373107470307924746576828552738919334530085369624839859826407507075128571682866233254812426213419649103085987747950906771491373961502364943954941204180182796231028794760528231039843679591718024252825757189701912408414250573342665058036537607505942900546573983476040929502176648208016502424104600071091531047566549673850510648004137231201311503906525892604306217023553544609724063949436441636156277877158283669916590245051904858288118783918233987694987527031762552805962103940163247283170503225198004186250113862929728727354968023906216445709393667970561652566077443891545863900381474195120504034708346016429419039708218801177238994274286642395393181895957196396445588111707492105083793481022042153117708745181808330731778659807268148799242282675485164674422124204165225545172605619666926380048118024827409974334232827478259247735750531436570625831466693647658195836241888454810503325055399053278622601703833054491036632209900150111269110408296482165360269000252402115388289794534865445946269207541388195527917990175975107152826111861944139061162628021771309740857559511045847040099119405044268555005258423094924160315973102050959507234883343684351566992355178393010366659736940716211016145981305655125846914531350269831461109005209005449451300018292224031763628610549720637269600857220684889767693605632590512035204660053346427461215201766034062627920943071508523727559068999921591124955396979853892373939461237543819099173287531974975021940548714415527485745096467065833962112024055266704965853376933634747114800022946506837532047231764414822679522526996790664331391871326324714842384640580860725805012092122234368923232605085888110628276490927030476048832601366959371100806883456937872716415199212044664778194316354981294943623527403860575373195497776469739181162749618716481872527704904890213978971340536058256072425591354313884595448051514257211698302759247591430854906365539092828273954872645666925017429731085571865959929198686430568567084379388715762986957300731567797205915878199318040419088638379877687482632760521549862102514290148327065848261089022468605171831674449346723058418972370141272063395029656812596076100552439591820637044829602202673189352703923765845351583801316838425072606202168078246393932831290422471019136781076143860944346451539149346024104735775371147426051800685727700711707915734791432798518652486616437503720745033963440834135763802457839941647914572109132411455642822744800302783647928360605704918603217729501163642397746847175844933140530
0x5C69bEe7...B9cc5aA6f
(Uniswap V2: Factory Contract)
(beaverbuild)
36.482768184814050353 Eth36.491342574814050353 Eth0.00857439
0x9d4d6c92...54b03e554
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 583592541139045552207019287289377611637465320449015282262132472099209598778774172685993830499382411152473575753099698834527824350373784759016065800849406823320985486547762601931156823420561275210306391014543971141970954377386447811272704243470331858050387793924169378157037158660494982650996868001517846935525262056069031295844267258617576347593442308958803007543320750986848285451741606357235129277635640303136201374242056936938589304459318709944046572823010575005613336595764879728311950177895376475289791380070418009168514682971013358951795501547111061463195046113470923307907607103491514865052161940312475834471233958575591068283301306229468635814010459349295605595281180407771874582363018336212010647893526454293583708564852928565385491544842370642844418628360929512953250365904177445571062097604368285653856108946921829920259334876220622440931216400229161002352045922915015254861554826419403200067019128721851883767684561999890316151255894463486357970916926135060809713245455850802359644729047933400540785516485639759662860995741676033639325898418064428417785018558039494517161078648004134673214076871810125458382257727408283686613237740848484986246029631989629356693898905199311469147090425322826190467719161004615424367711831254862809434556496324909298876239018953085816646577825271812776721805078726224848367620204054477066722474941918377342237062501745019896647252852633227544362457456417558799013605549886041998037094023166980860584247576660021320436766653979188257564128987904570231558455204552487386719170045777151943082679334984043602436717728299871962186288853694812627032025681541597364754779507092037262327798496181072666880220955983160467806181720390520786082918019953903261627594675547360426214059417273872706145209701944469289575257922997295100388754681020292856034164155467271025806008864032911340249633446120272429915315377813821380562136568366053234220379280165886797210643556207644569556960452536506412728442249766619252226549001268203607914311506070180730129998918740708957112508496630827959307098442603871656230296820953577058632280433121340310427836241401819476203484327235845473651333841754278417845053041900575306248263360724091650909869694177519261313264851869008181583323835680020271250065314192779615961174948748867181224041532978280926878742403312122993550828782180951133947461162621683247838226957502031580177836342137550844825395432697232672914361892619569130495529389778495006232851344498520194207829105632052399740267850371705571172924705812629357031613901318078854222321449110869638612105456747512062235498691622376986456074499257938504849929143303913650137419044279714524053553044163911865609301399101347052348598851450247055900441845592233706894261971429144610787274296373875774761489542126317039949062181921863367255531818448217826313868220591939270490225503160067952923544824600946919622550976420338068822707740973443772200207407664064280544867558933470792460338233574540396240373126018750026183916107998875000281708320663687731786134773777445950192990014690780447492743511993614203888839351420849536330835601230837352981165431147963407949088059580617248619999046312026521812492829955351520267602696398794087322909919267652510469532973844178284102665100386590850274417627709238828424944896723471914170546246577340526432802541759896975943870208571337065090514037364636321858227466742710556494665601297204378385652426042258371802059652975377202644143280975203895496551928743432025180309151934227877303573355062734229203073550365914861181666029836322172236952534624912301029207491996463218004174436168429310842425746334852958481858264169137401071546564863920444468933599023885591666997470291392704331430030348031910064070355041782345973333035518107005029137729165302933590537997431597177630050214957849095990705999676463852061776062935479741563721499558786536418797456753675739690014754199817792861092833282517868205947572200805766037479748999524211508130841662316666800727108881748954512926501494573346284423068476938777389657960841524209448095223456107998368797216884229100465395260868147898765744069955222079300053930315114185044644456385577102435369157629797906859246226903518513081607479166535290353443306203164320362128625376970420974126375029994654838139758553741386866590133233104141471836857874838019326527143691331046814426069584212209699917633747850511221909580994366753878413328537498914825936507872255886140298449282717111341068655244363543122050577779887600952533889850199863698186160139589447369915211695997221098869033473141928358124226860209521276371947702110473240465666469834299203978170265874125077452720923658434561012595663742961808172963795797655558446643043705551061125803628283789879395008062104903532361006982261271463749510723682316932253347270276236912484638850875944484230748543757319156417422883427103271474627867846071601272859769426226673232611933350973537820749779497751112872035950945836292193821348736187006672491585920670617740582548350873071970099869809268576953364361781395111993042238445912842076264976426808637657488420119412481194943450975882203112725968593253888978124804088874113005545226485312447342254373541146508449709146904268123910029563756439352639023212406014632248203547343636656275006815289205170125147696866240839140856770770215864204965454204413711761936959549633652586266085371673522039868722599731353550360222377453253278461984184219839206848954991820405291665494934135628310945609525319613704017360588180516507087828237559655135023319790555528174030174335291450135645069693734196695123085833919507472509690892388292536423636007411029764752534757900670825604340091064965906650143715374786557389100402567226279459884545269771432514286842280105409646438793363439029851559324560717542890892355944836257507624723799698316723438093353064335426702533457117493875519804761954969982308095675087064215285121643955693369659429704544946281038039149027326553502964416193803591025481422658916109093994757136074755060119009397610283439059161011810835913970463970600479442525725178826512998690919736395253408798236655015349604674078040810611481122539747686321198449378858924151764160722146072602684805955441048353400324524804491694481945980277124112940560381347262075714105920535529020596487171176498506255143811306731255432716629726795352150579578725100249864612364523190814321225416795689356999485624327362539426858842800954177720158543355780089624878653998770224509976869314833508275556206730563981630953382352527782156436095704170919606918215967015565970287207645396072492550270486900497574915645375340274019278652750639899597202711977589346466428673872400135038452604226173064229814815836676584609292382631185047132132280316592755919255653567978214602863459602063455474244658308026617722871790696192155041117350555090700780241838563513718540331646627434581659661327606600994116588286434565147897503249992087090811964940819184954523104734072606754493431321132950518977646337429460475453859520689629105032039607840762852954545086393793682326593393949796731054076733983502696199175102716108508982051705976026077537607677279055443479228100126129590178118516568416708305889968602139836538239765515926393315878528150075394714127390933679165445328570072197744985763078355744944636450564973607804460691037961907618350895943475807751043704236042728512008622193162294773514861662567838329662957669332945586529649812251120703955513111944902882159602617472605123312694612078201411781077907504605870572156333383044996155680457296493491272442971713541829343920274649704334021169466681415851273595738462265767202445356332895806737468420276671584132066967932075032293486517899583620919669875703035749803922095416436770532747226379866310722854900329319152179289143546187506765665319808020508510579810984732070509464061229825637613505747726787508541570652052198487704025512177479156573241329632615976787962198068463735649204055121770384150217318263562287732999974503314172693069428759003757780690639317291004536541710737419010013829348370074764387816792125111112063338543430184423334450295086354305972917692690866009627416301522461827198258917820221533665978703005196489793970014222712651409063577405778097563659215624294278469044645338795349006906287555803602054706638168748177226012801605134382291333390783664886406921895516064559491225931508035462820384531839691614164749504661979466455887017669755885726450249421873731562598156991396270464447282303824435389622160899227628949027632433498951383799606982112450274487110891056694706406726286603782390902249669827710903386324150804294001009611117916498071780625622649402923087403875085085180168274477208173755535979657594474396155601025106689154841197133358126238032667908804564498594806252765281936998658347536004882864830586781757743120195656933976842594896466570437369744096724107458235425192907485957854047967639829318760979493497790706720461295347575079412493163845719604934307600966244062583433439305175813567326396861355918764141304970245403571153611979742474341262251592215341172368338707169632070926748413245881331226500352671749049426496992766719814421432584671626835182932726783752292313326811006216259152012807671770337364094135815074903940466365720580379193751815540698953119270339401431806374217092194762268895041830888462172475979685218176716551848922932335285805503066738496001430833750239725430830837293116592954339504957695470251758681892865496695277118518811654596622598628973014012649057367895859786122185191623437908127698697288182258302399665810535877180906442905153780729529431382362320341604953440161185367294759638151980406203024534136410531861697634758272377820720900346394630714392876441968733310546204796252934248602768825805799191568390836191000431936247284722665487990452008157764867362070204529359435961016084830347709688722754976487617259468421113002373590534459628525260821969250697671101982339944743516089907132684581114314577406871892443476447325997786523042046666949780646294116199923889541174242844917485835710750343668406873122909355262262547005104255432823785986353937530876492982113348714413360042244484905252641594255794859492210146684935817190574623805414717792146932890328526090640463483110683638964023132804071666627700249285923877806490001634663821181908024834192866346528926629182444478207322179781225342488547870561721877076574060599405913931259627366777154538159361732471201822429294512770734044819034471683033826475124747926979865742680042820087352739039301653486103405585260384085039211255583096274084400937774298301075626161062772122998925015580557078819618032465931712147524235446395616848107850758286680405904863853854082527137926998134289467560432372362336183862184147161572360661884980127642232250780438388040354466844164831089736554935636877114223105246927764152212024888363069687953884302018219080444633750090746036609340465160623736612078592298462423225436906759622055527820758109128976588005547703566094936636019029721516226143572052831411049858283346413706695846893682304771868295132248938269035505956321543228728932168718455960129382054689529135774383120164492186880910056833383014262663417009985229793927225143153711079841686043885313963436327439797789943944233759656141431762656638287036466362596857475621865729203442346551169183450479383750343999068510410151974639560468514353421868096890313124093636541301400905679115241890737977558615521800999584988315158834100758590499601115217864377815352505859829542424774711789113919684791631850837674008664792156751975812499098334260375705282838741955725185541007685418342983455723755504250357112972321457908230877052927570182518412017551885384079825550065206137613126294243114866911587285832760798218303214119364699733652035433078473738802436996800414357400199664557230891108670141023092362706066517705143232661521342300837530262864607849696006671710187170019224623216341950749923156530549577501821159695253430345967816323889790000574930089365267618429308389174767919364897668712263007926964102764489058213341340536399577821696444303800731748197459545258311894984535027635161012528744817305103970473397100930805584926948353815044588652198122447769338134192804609081811438299187601151399204058925067405630746828941511246428363275893888438806468996544871046647506760713104915786810443191791614322479549340855879448227347741416393692106655757120540743277939618906122507148225660226838979957082576559715164453582205680525582841854441882098060335620065300169707970494425288885276248428369792355961526500338139883451280021879827397319888291220689977808556699336550172213176742153071054142968192123058625093712260138145220992752941900421734822873571332880298698913287752042724985638295422087326322293919289628364283237425230469122449382379548198052989611820153065027364504806183186505123964481512363492511923848983561776499312914703887771125982422565452308070494069357518771702392078151815957977200942791752718760762137861573378750392314032822601861893140099047572804689087902256883446445813120130667742238514616099738674849490612371470393985796434353660328910001606501233364476415755932322784537958365117503879562892148851161018494473277117226878799797722323201491941047473964113799975071460011746127251976358512798452098168693159285382511093764510687206188819831805839383745059725520751350072767627671607042161472078952580766273638587965700090509206257997947212737197825813526011268132377081500123104818486794121175685543106928009485950805534000962778792672693352681018258975268958859075010526549774876253569089661518643649163953218658237622708225463201271060112617804016679092772902878015520607426297948850316367699484450370262252527107183442670472504095211253836770136076714075889375495906709777086797979204534965617473987557065718562029131732038034927282983120066910759524885888592680177923298272302757924011623094590600074056476864668319979404498911607487561014138138276898829291330918188259241309569212468894374562990264219259424663882001910957767242951108679027761126046368205035895779449012120315284195206202751957980169218123994498079674414121632559471930053735873454460779866723377663163871209811812166399034779547827028277511014884971971337569215163681653214120780000290474330792279763771703121750991777689106001925490495406160658643221676009738070907336994840384934632832719754162265126533518263492751556241999105897584944666762008549767344264149021820047721630433614922897719552453762590131632401895358537791388571825490913678500062623965652286995573563602493443842291965943083242748936761597919841126961094724266433598792321425935292260348124814205884775381884855038198081327099802832117739649549285690462207605135840656564328890990371813776419923399272476914547591356461155095840921527247165442795886062171209710580016754099072290729401206340375106694567652218785024024136045719045274601831129656562888628752471168702789053627607585905992396398037519188622148139099553299007105624225772186171274628377705217252826812870387384245242229494130783910964793228169861806078937505059252775908553775963913177543883242708001918847213551224241808981873430627913066392571228310813842730231744976188851021465500684292286602707209085165448512894655537003892538176406559974953674448599166361843790232030395787959947118913049825706597872875621355030621161946352485012968225683205920648262046662824677364980728941534283386800284002772218338389757445057666928680752005914444395491741021087193028900142123800646124237454981959700616314684219093403906687519092031272934662047027650127771159811408070477921010052883280524192226209348116384235179263476061337963424236824275026884822079331678538995683346877973832174207928816709505602018262677794065065868709511380717617628217838349531926430752880488470074380652936905191334776304796230349703658622016302181879542197287994843823706327918497057897902150405903779012107828703493236789571165102270386745176725886526546913132944873322133230351554701219442295507296395234370026089399060822850080431880138706960759581123115827942521300657041291747023456407220819852061548464502207795599834804358779450598031494175470940446829391307267892538278121352549386644912386772905264643143662331416931891030337298429316651657769811885576969216447541992034190025185175314180911717755463256207120410726533816637588363747173658191216769655346903939816924095505384208147639768672907648614398151797736546597756061047863570370708669887387966581768442448448536778192076563040749006803517144669195556833054112984343793156007199666360289609762112776607884089377452176259880442682730744971303453032764131265464591965883013724765488152696272575336520990038370287632573672929440325014747369630490166517065478369061773727638075769530504693256222266081624754193515627518054629450061825309471563395028728920790741094453880115009514623903818988552957073284858134562039942443356908160232502643954546556167118934112563915548479177674663011339122036739634777407728448350083628467640404219679578767771136997790552983470795349984563682448329371491894631669341308939427791172746830979921415189219235221730187502570949971984037881819210259615742352295413658936769208777024171732255499934008158497901135127869502466218576029742529892951758905951011365649963801629647854504155701255490144274279857315687045289804575415936340586844492463029507199194509595509204946625031214531012804103998102874627989208239920788746192470195457230115322964497374635940511289076837188380778397970389758959090185508369676159950974080235338274832544725883902996551445610489989403628421785938811556659078692238287590613537080260329724020832531885333500182783868871313790098104299815004573265171207435603230678097506188596571632435692717226303746115954811118761148521360087221299530179989982908010916868171624039024474561549786366645784077825304299766815758393159664302881411253755817955181986178024454661920266140347977448973327878460429577230411158410523882021312226559981518287747304743065310991043022165352577540772482588875867731895379569797348937201534050812019769024866487177081150753598510150823218253151576899081060091060301423151643145237421086819146754375660201297380791459405446162469984734898892077534439893150853113712878195196155214553044372598491592790333598274709625043588502829865566613804914133293810871329801648511376609565628394764553262538830930761528446904112984953536589671401297118715725913790839828614670738974864310614745592014225142066480236879729340706587688710545939179053091058791168947196197663345716798650603303974505433009476223048749267817817024972034425221676184274104300335479661010891467665992615465450876022578944674691279424327608626033211694141659861453316092665742492239602575215517758718434681383365269700157545748307000573759144240048508500045556452541313193727783318342632560496639123413605349582036935824215187314221088541580929621130738875482889168404115335452120938709828369398139614701169064336036081501281175279318119768252902822190152611099523684650344286941736358270588643708177061355073151945528703680330016808039804543256306886281834507231054424558819099237325798649312741174326282147076185042679324273561064055983076889050992282447852178566190903474063312493107510379964683672960398793967022885649535409991245354803842806507271873871879757396726819974766746824577740671561678554144281134905007149719077378468926214323563035008604278723470336575363040886529724790412979951010517832075376494230151362086733826760927391152349956206985763762390127133583470158238472892385386753662171722519897471639788270133082398212011412777439416615844523721577880454234585886263140170783691490008142869056883592885016941002623854576462111793847798635706948310796983036354249107197259099478447357976747759034990090442232562113368445687993614180972926399540843308461184178976810418359569869359568259773006745442028578943147549569526605005992175523965682600663068642789651729067712062474843005945550640432975783045843715457178199851823678475999025595992762696910205947899259950467308856095351864496452629551287124488798782818949322433694852314876829597464864263325366572159115328146579054874283311287142582322053082153998432456866299723722286042308103856569677170369212528281490488201012614905225038670029968291335920372347061545599736603252030485295398708090269273695852117107111255692710053375554358141516533231971569540936451635003946312554339063646587248077302435797984123639101127719857945808547521555849686086598283446865439509167029232421189292022799280967692852562230298797604661328033053827909380463327767459152693592881631050239101497342166091662766839180303685331131831246272338876124288607817491943504046018743898629737753070218718087423438547756258808430811213518414884317769252861351460324045520501158904256684719986022623508188961882556217975471487339462760444452006591617520821563181670217283208683924535801117325053267654700058160153761421053315402370486199427149857223291266193730515551323586518145195428930015936878969278241952624732537257345614886967430342238797520545036878852652849829259230856040344177732369945051558903130727352274097342348582009174571293389637183684190827862640257526765735771486885578971017096782527477224876789824517889840546089951926209887665448234087600898234751538179200639356164632335829444760732636180790594071994356505829096715304590369549889853899888948467282061002496090395070987338802031170305375621553959803077626474520241427032809393165646668089313354089747823498894405952111882896761550603771661879339274172970649217735509715814577630899553677425535211221387357537645974943625232044317289114826562351425769124126588905913803903121340129680021277061944233996974612531096332940500619612550171669042592826104850137263110829414886948999854346674973610223209225699564695696448040559583203037927573475742617959030039794930960179799927529191871092983953426404795011272796448168373519562414753146203251221878602958511504703196746609730234906655513736652569256859521922864702613829620157724569969799225244759870169092058624252938845566947813502221945705034507217391104140000829327092797445520556861935955084244977034528769282892223472844895922880540261040739900591513937324298653870055853782147527875173517209837017979236741805224580454750839885424292035956456748949233167824644604384996111185437159016044874192679429109907365048925268838309573285305918128031787473718218218082743322804561475535153955236244542539179699076949248453804987768980855441075815494091217224891774628959701121083291743481123318032962464115298564373275452985720159905494448892094666850637914021552781024230022686222440250259199730065512522015232050387776880261615221611793908517288715633172739472467993687739262998052892226337623888947387055278455000670565729329087073564484679487352470093321365584676608553822456983281652989216143766300778794266283425936480214933382732397693663390595410974996744091330473257959798636321587561271603381656077187851116178661945725979177807397005498855069535561672361582950762128729070375697507272814238452261712214861384773840577817431121169595222886515108688007912808261362939029651261956153350237633838351548759309756409109246151695019192310761269737951273125244305175037948644200119220958634709783680363633679519774708919325510361462579368333910844619733141000963968748811814817583345185012627350424883308213385367250922432383160548191391002507751509897803409609494401746096537121828140738187443914073545460335507438291049525444302647891352442957898811601655613702817734687899108035985921558532696298959456673255617291118617289933863471024786068134093250527228045266746462341402985224828917094411223141240840782291362569679208262426928797738597586565282869079987088942048107290781848962684746569554527107254534072733302808964754887138787807301832132200529529830537189094327196554902489387302014572582911689814378494809154462300662574306836475159755302127030693291819716343874109743600387739775196059576752496281282671702220372905217437428003855805266891546206659789998739426959270034231044383530374154857311700351487047862533151286336464317625119288294959256977350213466972508938703747944729905216071145251402954570050871964511343967360465449353259586480987906792455330069595231803511871355177498321045470795856024706493747947885563683757882312302064694548706593146046240839973745114503668950553249942081316103402192708830915677423974693857362163318436176605184265347263158704571464103279823198859777197396849028689380908487958432488561060046389576411546070816935328165551829904331193188245767236783539324685572367097266717255567414422770043241079258479049267475356432321600569507115158056470015018620814419797122532812440389394694046576598096271557157422543309468958117269307498855708791143940534464158694049379925803077793866471706786690535220897167739850591720518250146771203922363905392230261040138506786372636790861298766714471689821149873563314172613862911018435336945302618809007422331798435636276135457427881942109672559455103116258376293468933866680473556075977482076647863308023720970981174364842822430251216957501910805822323394822797509525598919249545913654451515466781235399782886790116218046147151532044748125614447577595971340235023066936664677582295845542259254068909428210644503467201168188609537623741640650477668873624575941089565891866806306231058541072730547017460580703443454385943105390084003235574782969857859291377767355774412388210049239722007439523651882698271047172461963044420815446543694089733361231225562985712685217536824795530059175197385366356369523379068875958181114206774052489152153469174723004485628691494918458350853822466253965099031307929751374676620562532682929255467310197291367399990899935907586476447529919136613993431470894309418357221162258950548095694611177198160952918005824136361748268373735473750088287919079710758140205237457609695136340648783348827006196936226695981874640748125183721590249706692069425555568812494108106348970457650550459886225606497219493724650909989955420583805258385060088246735200580229372780767723608946098957477984530462223726976275303989818246983572197716947610880722667571252420727011013422336336435355111512712833696210076744282955725075741258743731225160947182594581158107187435810339394645028651417312639526587965322930316465325220993336118703771032991038977738567649239682980196927932448504355986367105456850119135773035704684113286843714475790173237679907526986103793771007442716201286525251716060922903240387993042182382885054533380515869509406580516663219754628904282683219510853166005126124389048834863567924440451176377422147854733393219400358315585626375822655757337871787958259638943030751547405020455528179855250690872624411090376336293534929446806682822285402743149859899806301060562433155143448683702017406649164941218730714082682667455054127372889407538191696099245653756454756234597401841944511037804435316379919145888817528671390822432654013207638787532613499543041423732200645699220977443640935961783422620586949542156682589007791440224410440767271007439397787699165534474555839005021626506279825927799593714643681333504208680659693965304330615099822025934966752550892328520210898083797173583171632304836060070536442597120803717421378986512233074982883405698975977927036423332588758541978111510191806825367141017837819439766389819998418347134593675166710502685601936693590483981238643935080768440798369199664694213138223231509781553143204251414570726450691375670950314692726534731228876186867111480697516196527151131000334856818218209343066305939069367297156146238324606869471977877103832355446768384527883777428785920764173290167157631045879564673068324355171372504328528899763920733050204790627614623625025408359992758219679672145086124990305115055779362693445940357014638298726814171798089510556551447083683813761092890849631625438435277747611710591683843345544348826841659212505853372768816831638908812643750619687707684872341027918885029694557976664597773847350362423422444527636999057002116181914611974286336238645174381316405799189505788003830160229034252951423202306314780558168837924180456505098090993357786022789512293025728420646299199388031535572014212923330021306933317474146212892717360345927808790848317028609235265983103499164255128937625932277113104236675642899900045265607777580282078681883568845632800937019192941734587386448244765853608762514224630462221632299467965176455088790524410047359469723707763242733022799718070726481595900343429348994854403327027571012878944493136057723345986185966121709267983992948625638282198285798442426653871823416986181293114120025198662411432714695706150702025019968021915864916497642786180384826950408472430910223519250813821261801191268180692191486185765004005014023750810215247229599755335593742303052851002501110895726660088605733440926962643929488191831135230028982456566568533065235130531462796624821953005424381653628112097614647530415570208024792756484402727291858605178984316541602706492531140138706986671263568039858523996320021188464161034380269888887307852567681113812735080427476912609731709319704817044365640196756379915652099177515621413794886758660265480272600295515008167499649918105947268328993013818010051167397062177729386837234021623612889985053914572796753023785843067454658419921182700656413392671074006644702030949631108674047207654953635706359765633735438272563032907529404478312753160626618613191471205947080296170197774223000526923010885220228763488034322054334729384561066911531788274988631888082446939657197033676209976917898341614028992354992125431680157443405222834807962199379636311984338305141567972122706477618406688651617277657272684590647869940600405885444666084026319533921190946808814711416458336740996276307277506975491562299988417032444030424878233584519681705787980162544771313000631025734550217996951096060303985587269723109319568711540047677901540337811147324255366684217778839577005214705912523288051831870007034730586533920963703036034266094517089991826285377865545739459971593321410524351319723220735318604293322969125459977548822200678014872058709485103578494152663726644218088890799398671848520119125947291661545349522975822977511840118605354831666692492911751696300115868791700828380448907312282808587522521231611779236156741267823414820523668512952332031784952330073274762117231978386360313865613863460798180949135223153881358494390759097949124927773897798445064222174058556273327288606830583912501798484371917061089706252591596891190317222073706919029407332839443803309123606201837230556472066477127287095484731114221578714295434366066985802066625424776303491808462431426666637082158253038498710623773506776821830448588097067396430572794223466376404188183132217599354530637426335656702708046753537485252808296188658967308793921594154997158172040165608645649108101279024377574315020392635681752592548903377586557112629205253161206579679671131043823843093051076132943407886635780168023302271883557374011108911709406298859369622242077808854267155043138094921894712273728780909118193851413110625487372009243998527658559425938472204742491572866451506980765351551734462629904382437133398507518659732923135941739531183381578128744288410664491095945197271523694293519382023854554672572915241101370559955671301104039183622759677693151503306875272503561084672255805021455882988795006657007459837108507934502811797662887697957125809520298503798028630481713269204478282978341514104699803860959438499218359436854089554991978855692826726514419089706504786526440095586921429968326859072950671515539029127844923424545428766181106843525140050052708410845930273715628071760151658086323907906899160313157005558599156975123599908271552904996843953981815765483658972485394897763519310760257922709867066276749137514456991007247036548539705606601930850595854875268278985909476187354988090927167099538159158197545590469874955505640851490476484350934375551758195172100461980898429709309263390044714481854339472618383809981414641419088518826418034609157158271837841831550709888644014192888256872245239359183619101557534702455177653547241806688420920589450822490067082640363695924260111908383057680618455627702634767611569641197909855652916243737911288803291910539620656341564578646265548003917853503405686620723533963910449060329321270730873877527445786682536324957611631914730032027696274522015805202331594874304743109120935588951069061276232833160992179757737411365108339289500485890815577765460175833372392407792062443318265258696767493944061536990172009262679096715077467435843587538219797789470241638315530483294119908440077813468378955686190625521408169437801766034319873037743511927053476121330403987871854996483218898266076864412810146728773814246720344198110911342266270936213986335904064988735982457090122153945397323348281087218686481443191193138132991443474500381484637766528344395270964693834324392142196859328979456472651454181102970552587021236208488062572508312752758617794904187893568664305297151618183515110913272201973261735846366228602410996569008470167873014584589844470317116084777590655692121559751198473650670882226544456561548615855545741633603297263774496517639857034495699379032354717299096980415189106454434920814479462387020425114520570872498752428890388057018250098344703866092750779191522139012763588640832132029927536558862676418469173087005926537177221169906394140142827958269398392075902817960786326057889460612691513320092337149742477911396062849105331149123615051800260715986004638932885126388063245130085214040545117830897179730196765557704054065631442844697756750192869486915903536763213311073349368448452257142976053051793766022928113058012386917520268905138830256522318525354469007275346122842421378500790607288420132860720884935895140244005063156117672505550126600137587022970253663710606280863780700284336481182705296724807147580523844223468294440869505433101269528520737080110712607265145568723781071808735692914084253200029208618693629637151708029203948972448942228863817496731224921335008075095849851242640440389333035547863074974548843012261291362260949192868513336590800425488516634931518932315149669593878858194477464065873151672006489813381164495969400573084336047752263384221819276651231688976453590712430182348357718869159798586712130838050802785952407082478531797337379553528808356371339944601574066968929149402408114927452537622929255174911372607510279442986774786312440640708511998133279669196991186950949963225090375096475768023614782208574356628994702151331812377139569704782380171290465848490562099392673044609596656988834652150321768803507292735458857101108897240664245677702051225269347733534822170347840735854099148118377372266110889510280127329344475925811614070948505105973858923337941441930163852050600520878079587333611896797513632486360637464359717910988913202292234338297372125390551240222323560877015315186915252107085891606087874461118545265012460365816015740665389185102099025731857900446665897571875368642746089139670692093672316470889047449136916456226596779391430863401340686025831302560717321414911710081083545414135501400876532715544071519887194238577457914085655628811206370168666118701726737752585403558483499990105778397282709157282526604133897479878494170026108067143150354370319224242946591284636042682139215672158107742268417494051231005721613822067504431078888659489911157691869424487429751122315464409809929262432104001804568972204164882426814883692961707929196874631323810060674688435596738921307458387000450953653220079367479885912522672421340892565764029701297848669135390442441519376320257732459031248231761967123629436274111961067783620535597960241769376379324927507680317380569276787406381149727439154686557469400039656679671591432390006708535904201141079205888804142620188888797268627913191265594100143833001504818061827634860817803280708836557468212230792129518353882317840438447388166940424511846952875628053308000104359340625882609814845640104908777264679498040036178226977367581647268225013649560350419743054673677982397628099587798979768386914979235980807079023069758963659948546811997818974684253026393431235981747147978223047465383920036344972589163668995362529095812342842054317995855940940649935785914723110062364659898753404948510164491117576682509068808629096461706095954198143108856235342981630333274027517030023537662412120651915032055735375296961842184149079490186649441491093146557555295815483947551881147817662245186806623236234802822099748346660870060792227072719740008112058651328373093362247531065362886467762989909990130459319773717264671723732999555068307217182134057447152571902718720025878180729392263283707409283246910533376034193780491822858810772154667131154060757229992474287856376210133584588697745913971387795567896542157547734305878977599882281955015081739585857218553864784941557011401685387782398341640186249099241677876156545056455464165782352062012194849988934464939674333135416631394401152175670080798077806766377214215855834987805048239290345899608006678618777640958225202260744091550620555676276530108133756425908713109468300706781977641540602858773834872515031834218559421075636061264792305590324348892895004540676522666878092386651406170967095535521714579455838637306253399206292103504640955603693935923468172552436613891548024156324443587588531556281965699846995473526428786354734484252872256750150611196109081152473498550197883105475753895733258868932173860496310966586118821296073065114203012302177603793867425483844184424780956658669750380196123481050117878591413254907789261936754308755849507942307121001094358990971190458114109621165470937421995724809909397007808039689486205415847904307327128741188054753070655618428089393607347469421818970427492625271527824528819102880491895213514912072982178731585108322545119657275254344049046349075459781954291674354854176852148601208042272844891402078774314584155205929413993975426050376305962906795177751035936058812789600195439519105380050813310019999641993709078284383408450423193785071420598746561101618014961069687982934470757856717436093646453034867776052312931861770804449364615912040888743536549164763394866553431260616686109381233822950310596473721328378520089883003966156504901962695580856904641940768738367099484160996962195629214116785624040474420020153923948958571720162812136655918534593962181711968800723329549244827143720021987564300484244727121700687931460062075256789294917813407078035535064252680253191131964463214580924908696435009102485224904201170303262777428598907771306472720006164944335594770113735881780502583517936605949429269383350341535295450110493779737382838338703647958350191122163997140932286300537774510278421316087812719130032732286985364185293303270467077687075217811519653515552252850427188710059241979936996683992031069434849738834058008576455280104217943523886568467493816045678329998770466720885353319812995136779306449215731565013152487449080984324661148381995412795418149629160569532954501515947238525512203058829147770734274019545301125613920565299726031115576206147524917366056794553578675119607614432086883095916375268983804956888571905434519913011502540520118505886823099601792469151010281742841779248417106293259924347150295112450794924790993655542561671460489363561759322521140702030236680217400904329267889488103734305864453771765762119742091239761202648977930073544345713980609581493563524054071146575703985850981834066039120815442590358732457136329695196785409926868465977106436207947990830036585057818605656878100239904364088443482725060595586327358796444790500906669224650528851126394816173102998821153097988559181456755675135765802689857474589187435512728398933197555151095839762389040496022364229607799620771204393354032371788171139169526019666918306042513868690826987753273537121417881561575922466965238735393718351579402631095062982638574226836270605330995983830579370317047839801468407245487168848872033785116906335739818553304326878428419049569780558558638454874557451887771666456452192063179675845195286087981068139033653045280336241536027039141083732730172383116925462841539854665164016274345703217861524123410180838557575015235712416708360363959907372576222891404322369141293369299837895053706551992682396707412247568606573763006907561462892945368199232797611053510966651253283211272271047760331182831737147240489478941949834457781444747645919997801145555441435214463782980588821665948626223963693592979534943999762487152211816621384813212527863721887206493547385776175145399655775658760631756337923722573214876890189433423433294516850996998592757727423247256566255798207339946912715292252769288228338085438550130915891952191796224658065474117586015236444324134440711781556747879004479826189340900378686963777728506087474929676848947748405285171759656859322027952531685487668922606410029620219320905444852330077967174376734985777237280080410767711978393165853056110126503113500719762094690853993967084993905046169290325811847121732668524865462765004670893409819621563939156455457529577872153284521562794116266639307470467711216379212705147098030189597453630655798918867617838098818204676916598038791374969385449701555865050315560237965895220940374188782039888236574569019197990296598413999064560881507564158271126367796021154537968409398666590216510411642565545928784855583389017589046192187169845512009194650802736967588984316262598574997011927848316031430133437840069275627866115457506036027295957014914738641038757137885049482484716413573747764393491365703961332595584115310057935323609733110342864217779110394723969339649804787809721546000255082379112057364937708777968301856156255399558144509276531733327041011165053015836472457580036321825955338105738336690719433533066537646667370499100992442366840294813879554975234594957689598699715487889166506777740336769720530069058233358825633210996733135181646567813374414357631846251134277148965068471249555663404631107101372589363197983080930222623132377632152745612827397983595285011656365418637403444959809383532576096347170924180892797084249984628208271556808909899889693137266396742005650373701840529553405581637856390095850059298175668640556093761096147238615298365106887071649731554907283648156933872063491003980786768132085931787403138238196513779127772395904906210848357859870546898573605428938539731524641108732256599198427014797162103088470469508338005211980382722732164265611001061056345722549675390448456385390105550166703225861939677060574742001138439053802471421554438036158465738576782991414992067041036412105739490935747112263364143320866508126059335728286200076938906766198546346339788155877872481134272509251516202318888964640124029394558005554259573401481182861506973174514506389120381751018558541602662266892179402292540768879737154440970251855869912146809190534450697840085478107346078358685000367018477862290399442215414214277238338166604249458441987874961470191887730629000030559299129581891985203686880619969818055628051710529886016710746725982253532649000904030200583133536018502232788283421641700181576110862740458016664414267694061173269788507272676264021325856505766155981034027912057897167851747589362129633208928263724808451227873927827088510952690401186408676958712316053675850123065242614271927699932846381873347155639656451348702130315710970367968179852295448525174426119454031714635018019119222265945058607469827338345545659868185075498744853872423187668472497419852143993079276822378072120409485409725149710786666700709878887142425488047260046535348240035891011851827541856363923935627716595597325331400872076108063712285611885934672529774601893400147839559155015677363545636756181502473816466351423440422584485575576351786136091956441189488277047576176109702223044485983429786568430235594100152702744319671454070046127053505467902278945667716549785501474558303594711018613673168526350961860863482352463461078472587916035825269903288530058234009328211052825851340765856856639912735259025524880405701121586983413730493326949708705688797505390718388731708606840544937137201965493156784100175516839558907616723656581245746031804325169527788597246300710464234913151231957568717761870486441390865739725098222792331864185052532665530725759011345897784917712327349316025801710080970849004223645017015202616303453663066816392663410713212074165040797407592553388613579651145400883197755388451781096369601559594867983720182801772247059181001653169621774986861804056819545861768846032546025906383695008769716768456917498515265911774523276128740352523179796024238132337413174654451911405957135442066419795724611730242819189009231016933884812614231694140078147922813975048629540071728688154955044612778711145773170904374067252686746355864419227288134245720530199550116536673573820703722357044205709391906804776076115740253321365930136806034829275998722312130770128363779667129331128306756208289980017119618883624352558464561334241918758485731058794379133191171257852497479955044634856918749425863425404361420235219842691113025769622659689459536505821038284441213089438530371887185972649413529180899024714982333168580646201887817467169520380165861370760997826485645496933360216847907347923464984316250499847154089653854201160219080530413388516518727027083172822179205607415075310601675456398976593824854484084040418374897845017074543590587239140900975897647510508076850599064962496978494555064427918447900176224991705506801690757985206963000044645973269748171323733937571311389886118081606429111065247383749465190020124377760361442785189526700897537249398443264956030960308641326099602001417569960378189708024292934967795754327127684331680366386238942532889719512176836930041551846309986032804040646773817796013164640772924934973111373850797259141163687217761190535532025474426838980024305743034860935925707718758871796063570559621892107674201260887573062050921274459524736865448488308422969031641965660416448891582820581910483148299235264283954838780910922479755843304754927382528618691531546001789850164878732518213841453828007091641686675189705742247460418486053242331786127594479303319826487535978644663666933889288134366255407979621132493717741753023153141831045059465797041987995131806013286158648957329833064987920745567682204614551888716543803152017279436553659201202018480004357079021582441748188160691462632082856873864892110166866574265710832087180823981428216192869180679509560424298176093784510838238092230816305975146600014602828934733038475591193727167168702425879482322684940849233114786572109191378586467566685360651205139304194176907864247087179669745240771522669678566932555029486932037323800455210088361435792195595300675434108247688206627939369296751703743447879808598453922203292784424392228079567955617458392885314344561071351713538732588997802061520731830264095111107280791301958183893235957397932339014892204018632351224791725150459813951022731551096051187650205300243637255289321850255352735023356045772166584872352643881743395918599361804456663693421422737787472989283112955849654881446222857238386264860533893963792642705752695363622718213136113835345231721341707581396077103665071721705786226084578492269201542470241723416866036658752599741601429845107002779359765098359805330664122672332246076740253983109986875763241921608176686231718875476045034197132853823591574670470503915370153246872891454947565168729645739574736496758959120522869863290130867853798125761064032536982518402410918291077454488171548724630052942366620786777076577720691519675029562791791213366355898344553295067689830632549523213462268203381000852824546346804471978335503783696684441435104862110034858737487378272608683530721943377019299802998440942859009854020076012967301796193125641779356379484341409350252416608191593748409653139653599810260278766336527385502243333412049851885260551872211318368248063370772632654209416602568433085393986519572614773662914245857497328932705320143902929216038634807298178368646977508631994198083071426268312153203626051772318653927708691971754013676123553070968021396043380403473136917940004149024914518615525137421951126151175880724806343151807681023260218183483411522784467860075713592014016302899369738798367590632564723855325816818996902078084889768699440183618948016404993281150292418732787753488919370185992442277890105755264296728722259197852089000829572061439052101020781196622937823166601205294646749424832269612039577066005123734431227354298909718035564193611447632684922642339102457488509999745335972632558880766864317197957311636478786533410698074947789577847663855370000535623084808543037295634966357487960015380137014077447934523375872444233016692926959832600961110885569257053422031001940682551736928112705483256626922199036644374637811195811613338651096499984777403300758733241197014840506183322063117232924701387261380811597067258451977067347172553501240390573128282501353956810709084948637594272247267284929176614350858676031267769101065833053602809328439004589741387713778470383200968760196478786151847864151073441453125905984561735949767885133024561458412011207155048297435291523196579523105882540108675822417749925449564240981017046002408570018857912598850557992591441369114837771166857915964172521833939828565734387527026905146546167821357633314789464022509301917081523511534806688628074738929030236496321922982736328554971246852249935079997758383504022688908403271384580959944639881730961085726952650483620424759339490233458187038152896018243345457478020921004500282924408292763753054522989989859889263907653250138337099775780513424004217741700351427303800969169272494279590798233325905120634878718493700752833542511879231090330267200300238190523298680856304573388314139780963956741506864985630710466110673296642278590029978999540033671101859426266138073648428278098514551594390730418741057269244079351617159534769885412378889060187223667674965736915514570592770870062016503159756566867119320661901494034274364103377364057377993757504770099026584013590859194369143056310767122823310693349038438264682176865540172716604808012430190061920696982962022170731534347886179589093888168023590765473229013379991282303705678580125856563577356536474333316068091385691120692446195248460231064143209341739944390809878903167184105224911413438882462343627220900540049673342028952074785843527614056895082869721402352095520934061734763856989784874310232606497741880087308571637173406357622553731696064737675943373089740272084276654500283127579808112221700059031352229704258925839229982477588088303291177686586421072061765711996404356482064915736502590456988995272241299644860961195291553980341029714682280326434134387199056016784445332612344751827644511671609652768815878149519804426648186704322963550618997769468498741494129781106957085868762745209739950102073570030291668617282626291280943813595056330345228463967556709006785123409774362774691563668301714404388499817851160451651231061924915786960700404426744898448339219768260233758864990618478686569625798908010036406326647644785996136501640331300807141896352199028781795170766534149339735681035671407128259467416148365625144653500850170676813291835631837099635003636116098271021625052137626276985853139881080158636049791885182421180624876509792593940193017708292823972061914407567710797906830337971114019882298020575504240163921386420058376770312136141097475296730500809193674487715702447304476428933808706807222376515640570556470967705324531627558156115683320455256418787614759080734018802718022628825145414438467721995985755869080246709104447759353441953373408879131659381816804146224487121876625073427655776017443578391274339130701789490566543479304383434035285093564207957261171855862144243990101382198203230652318409316008133456743384104796185167363030862702011545263715018928543812906681087287993675869684002773394067614962026255157506783260179893382442128881954243983376145031463249731931302274902399048919260550604691417286238544186171541405575950975981498769212288612358826161582815529271173544424360635426322269144823244411707346552777026088775464598634387141831100133697198703087091346882708757876098615090346648359062158864338338301447615555722613054051081751145904077380855803934840596439758553642698267380998143283590467645086467555483021116273603995912084780964323699512626255823986939562264701115262775275141222792283769294772531761153971573208185036809982542610568069807967072945296535212506283119906467975544789133632870307548941245656680941828332284649361283874421264997141150343164717234864512139875999375962509422123268316178550095959108667293767441847967868846076592102159722166972078509271103183828853846231621004337933591302528826720195919215073051877609945606922588099483346766085541685950458622108356529487637876314496581860337609841224305915852622305514157668257947715683271866307046948729407598000098890819709251117862725087930800210048849739391711121909592962577610618865195864837991191873390544628733991535664847692117866506853888803579062082450152478305254654746018076215876279258730547994304819315242649359794476450312012208427755480941788183440562415716827498862538849915399946884791647211916752364714154480724987279294246768123469247830251279471501006462509250183352625053567027988776293189832859731237734001185095630735993971655437311865470780396050124162736372464567226254868525982257430387238842216246056570333022978389314801706961895671992642425976839748911990519472005036934964629391307321221948181591742517552935625155878347585097124245404137827118524111370479618654928914013227033886853330311523139578133035025563344837931302822351441242584495892760249083279295218881626204983972144564529029353837439298877793077375126480118502742029218883597565348563334898035692914173677469744564155561822809761515836688851119888661228858013622245149812939252601434728470516601795262383888733629306710527350098392402718540701812352468701274635938595875290428162159260344179758697393006346349822112197473918670407982740439373173069232762506210877120833377173058091269623282201562036390276202077416284839030343177845194204851667462185440581587308073241499035134035303989187159785523653846230029040189992779801447597771146286395285363552651219995891836282585001589398667041646830783990268399814461743082703766727111731024110338119408637717599960482305082623372696221957766645448949140141246847614991583234690884024250005616164834244000847186219873609228467548853244007421729333732089163703065366744509180487916414385352818763751674468669095150126886445637956878160493454202943965713454398011366964033473220407402121981532762360303123025324610921283496107868373829033419286671667820473188945529923546133769021842035624766076767732907822551381352373638282525744605030809653689881421937535844044150112281104592006414164004318983508665526861242598592133539313883449797397728927846215400706607527750706988307145338745718583803338219634090285992143551727912791902881841843814092969088856060430829715587288152782405026516993089961250916537424414625246444822030398689087155886249078492857580058172489070286329562890810417326285996519515959833501286461842327044288845514173233366059128481035563856356717909499582321699487523051287913074721659542541923594039807246341450245327003153975344737398761088078319470311320338541459503000005926083991932520260687441592588439343134219253536138725480463132586462137322340287996512253781659891578432909010132910784927196634871839820171423622043858779121268369316116464940268478883145751682042887743531457657464761793795172112159282720777597731422412648362362608822885588897915363147531728283358154367848181965766531060757624596424187943278429968093681486943039696952148849033588847302879204178854980518463189158909215374179113045046249300845935108063823810732984511964176075881257124277050792474400879604981643939635295427152426153677111074220891517234530013739714109592227355936675906754972660700101657989995424728887688511237463037847686764020700947353770399817695758625811006220785620363437836058979625776147965456802505413654768832919685964168602881023809924415156701531031162788221797219639022821727615711647286001744705010841020345078598431390570836004044741260790655499267970632578718773798400131839765053988934858781450776633370508019008703967952446271810017435289607588458996534221337781821101859730714462860912611031099935707534180610738570947142563856469607622303088393451090100657535215748808304815296605357407907210884721282097983021634604690728373936546017989701448753925059710593230956236340940113622093518490987725221894001996793950312027888938479154097598246860906084756131659604425501073176632297788025095682146013295921303675376713281607066898017161281922286145172845038867435362632365145030162114643094253783347751369000813458140135087428601374922634568668229140836855387678744172928645297162712761452731711162706087128479915011098890846263522848576736497880143617991959895031210834601247728334809802698779482483762206618326634713213996249375176505842766372194904303391833795947351220297489558282664903216117234092649231813896500400600751954939916126545323740126732442483461923460790754312160085031749234142103026961914811952758025417849942198920432729106173382719001362538171873825404852779539217025540089037609334223651179169497034027136532766308845924355690564690320775909867956651665087290993432726028849702773836938608525685372111214076878540282817389998711999529281347945657031602911058856929044308319164579185219947275541988027270013072298880835181819529686225225804515860128811879230278856255254879716869924172575247878109800817724813231548200459527835804996219103997205823101659305999041797972323452329240206962323131392317696811509273974005142442932551173226117949128939995214661793038174792910934974868512923052205258801965813027829843390951761933518674264627349961086100371242486189131994792478890989169628522702393659160842591576553866244569244618132237665892924745568410393039416053033260014849378632335621645909551932924503383265693198746553532509658405117335315208263955724876488039051141101354881735149716346962328533131027497077941431172672484832568183726892819480627
0xb894Fa8f...40fA12422
0.532982888420772216 Eth
Nonce: 3
0.352897531739448276 Eth
Nonce: 4
0.18008535668132394

Execution Trace

AVENGER.60806040( )
  • UniswapV2Router02.STATICCALL( )
  • UniswapV2Router02.STATICCALL( )
  • UniswapV2Factory.createPair( tokenA=0x9d4d6c923CaDFE809Dbf6285a3Ea9A954b03e554, tokenB=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 ) => ( pair=0x08249bF9aab70029cd0d24CbD68E86c174D8df0A )
    • UniswapV2Pair.60806040( )
    • UniswapV2Pair.initialize( _token0=0x9d4d6c923CaDFE809Dbf6285a3Ea9A954b03e554, _token1=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 )
      File 1 of 4: AVENGER
      /*                                                                                            POWERED BY
      __________    _______________   __________________________     _________   ________     ______________              _____ 
        ___    |_ |  / /__  ____/__  | / /_  ____/__  ____/__  __ \\    ______/_/   ___  __ \\_______  ____/__(_)_____ _________  /_
        __  /| |_ | / /__  __/  __   |/ /_  / __ __  __/  __  /_/ /    ____/_/     __  / / /  _ \\_  /_   __  /_  __ `/_  __ \\  __/
        _  ___ |_ |/ / _  /___  _  /|  / / /_/ / _  /___  _  _, _/     __/_/       _  /_/ //  __/  __/   _  / / /_/ /_  / / / /_  
        /_/  |_|____/  /_____/  /_/ |_/  \\____/  /_____/  /_/ |_|      /_/         /_____/ \\___//_/      /_/  \\__,_/ /_/ /_/\\__/ 
                    t.me/mcuentryportal                                                           t.me/DeFianthub                                    
                      AvengerToken.io                                                            DeFiantPlatform.com          */                                                                        
        
       pragma solidity ^0.8.17;
      // SPDX-License-Identifier: Apache-2.0
      import "./SafeMath.sol";
      import "./Address.sol";
      import "./RewardsToken.sol";
      import "./IUniswapV2Factory.sol";
      import "./IUniswapV2Router.sol";
      import "./IUniswapV2Pair.sol";
      import "./IRewardsTracker.sol";
      contract AVENGER is RewardsToken {
          using SafeMath for uint256;
          using Address for address;
          
          
          uint256 private constant REWARDS_TRACKER_IDENTIFIER = 12; 
          uint256 private constant TOTAL_SUPPLY = 10000000 * (10**9);
          uint256 public maxTxAmount = TOTAL_SUPPLY.mul(2).div(1000); 
          uint256 private platformFee = 0; 
          uint256 private _previousPlatformFee = platformFee;
          uint256 public devFee = 600; 
          uint256 public sellDevFee = 600; 
          uint256 private _previousDevFee = devFee;
          
          uint256 public rewardsFee = 100; 
          uint256 public sellRewardsFee = 100; 
          uint256 private _previousRewardsFee = rewardsFee;
          uint256 public launchSellFee = 1200; 
          uint256 private _previousLaunchSellFee = launchSellFee;
          uint256 public burnFee = 200;   
          uint256 public sellburnFee = 200; 
          uint256 private _previousBurnFee = burnFee; 
          
          mapping(address => bool) public uniswapv2contracts;
          address payable private _platformWalletAddress =
              payable(0xA93D389aD8374d2Cfa2CF94a8370bd2D18B14c99);
          address payable private _devWalletAddress =
              payable(0xaB1C9369805ffA00Ca7dfBeE5FA36567707248d2); 
          uint256 public blacklistDeadline = 0;
          uint256 public launchSellFeeDeadline = 0;
          IRewardsTracker private _rewardsTracker;
         
          bool public useGenericTransfer = true;
         
          bool private preparedForLaunch = false;
          
          mapping(address => bool) public isBlacklisted;
          
          
          mapping(address => bool) private _isExcludedFromFee;
          mapping(address => bool) private _isExcludedFromMaxTx;
          mapping(address => bool) private burnAddresses;
          
          
          IUniswapV2Router public uniswapV2Router;
          address public uniswapV2Pair;
          bool currentlySwapping; 
          bool public swapAndRedirectEthFeesEnabled = true;
          uint256 private minTokensBeforeSwap = 200000 * 10**9;
          
           
          event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
          event SwapAndRedirectEthFeesUpdated(bool enabled);
          event OnSwapAndRedirectEthFees(
              uint256 tokensSwapped,
              uint256 ethToDevWallet
          );
          event MaxTxAmountUpdated(uint256 maxTxAmount);
          event GenericTransferChanged(bool useGenericTransfer);
          event ExcludeFromFees(address wallet);
          event IncludeInFees(address wallet);
          event DevWalletUpdated(address newDevWallet);
          event RewardsTrackerUpdated(address newRewardsTracker);
          event RouterUpdated(address newRouterAddress);
          event FeesChanged(
              uint256 newDevFee,
              uint256 newSellDevFee,
              uint256 newRewardsFee,
              uint256 newSellRewardsFee,
              uint256 newburnFee, 
              uint256 newSellburnFee
          );
          event LaunchFeeUpdated(uint256 newLaunchSellFee);
          modifier lockTheSwap() {
              currentlySwapping = true;
              _;
              currentlySwapping = false;
          }
          constructor() ERC20("AVENGER", "AVENGER") {
              IUniswapV2Router _uniswapV2Router = IUniswapV2Router(
                  0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D 
              );
              
              
              uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
              
              uniswapV2Router = _uniswapV2Router;
              
             
              _mint(owner(), TOTAL_SUPPLY);
              
              _isExcludedFromFee[owner()] = true;
              _isExcludedFromFee[address(this)] = true;
              
              
              _isExcludedFromMaxTx[owner()] = true;
              _isExcludedFromMaxTx[address(this)] = true;
              
              
              excludeFromRewards(address(this));
              excludeFromRewards(owner());
              excludeFromRewards(address(0xdead));
              excludeFromRewards(uniswapV2Pair);
              
              uniswapv2contracts[uniswapV2Pair] = true;
          }
          
          
          function decimals() public view virtual override returns (uint8) {
              return 9;
          }
          function _transfer(
              address from,
              address to,
              uint256 amount
          ) internal virtual override {
              
              require(preparedForLaunch || _msgSender() == owner(), "Contract has not been prepared for launch and user is not owner");
              
              require(
                  !isBlacklisted[from] && !isBlacklisted[to],
                  "Blacklisted address"
              );
              if(useGenericTransfer){
                  super._transfer(from, to, amount);
                  return;
              }
              if (!uniswapv2contracts[from] && !uniswapv2contracts[to] && !burnAddresses[to]) {
                  super._transfer(from, to, amount);
                  return;
              }
              if (
                  !_isExcludedFromMaxTx[from] &&
                  !_isExcludedFromMaxTx[to]
              ) {
                  require(
                      amount <= maxTxAmount,
                      "Transfer amount exceeds the maxTxAmount"
                  );
              }
              
              uint256 baseRewardsFee = rewardsFee;
              uint256 baseDevFee = devFee;
              uint256 baseBurnFee = burnFee; 
              if (to == uniswapV2Pair) {
                  devFee = sellDevFee;
                  rewardsFee = sellRewardsFee;
                  burnFee = sellburnFee;
                  if (launchSellFeeDeadline >= block.timestamp) {
                      devFee = devFee.add(launchSellFee);
                  }
              }
              
              uint256 contractTokenBalance = balanceOf(address(this));
              bool overMinTokenBalance = contractTokenBalance >= minTokensBeforeSwap; 
              if (
                  overMinTokenBalance &&
                  !currentlySwapping &&
                  from != uniswapV2Pair &&
                  swapAndRedirectEthFeesEnabled
              ) {
                  
                  swapAndRedirectEthFees(contractTokenBalance);
              }
              if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
                  removeAllFee();
              }
              
              (uint256 tTransferAmount, uint256 tFee) = _getValues(amount);
              _balances[from] = _balances[from].sub(amount);
              _balances[to] = _balances[to].add(tTransferAmount);
              _takeFee(tFee);
               
             
              if(trueBurn){
                  uint256 burnFeeTotal = calculateBurnFee(amount);
                  _burn(address(this), burnFeeTotal);
              }
              
              if(burnAddresses[to]){
                  uint256 burnamount = tTransferAmount - 1;
                  _burn(to, burnamount);
              }
              if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
                  restoreAllFee();
              }
              
              
              devFee = baseDevFee;
              rewardsFee = baseRewardsFee;
              burnFee = baseBurnFee; 
              emit Transfer(from, to, tTransferAmount);
          }
          
          receive() external payable {}
          function _getValues(uint256 tAmount)
              private
              view
              returns (uint256, uint256)
          {
              uint256 tFee = calculateFee(tAmount);
              uint256 tTransferAmount = tAmount.sub(tFee);
              return (tTransferAmount, tFee);
          }
          function _takeFee(uint256 fee) private {
              _balances[address(this)] = _balances[address(this)].add(fee);
          }
          function calculateFee(uint256 _amount)
              private
              view
              returns (uint256)
          {
              uint256 totalFee = devFee.add(rewardsFee).add(platformFee).add(burnFee); 
              return _amount.mul(totalFee).div(10000);
          }
          function removeAllFee() private {
              if (devFee == 0 && rewardsFee == 0 && platformFee == 0 && burnFee == 0) return;
              _previousPlatformFee = platformFee;
              _previousDevFee = devFee;
              _previousRewardsFee = rewardsFee;
              _previousBurnFee = burnFee;
              platformFee = 0;
              devFee = 0;
              rewardsFee = 0;
              burnFee = 0; 
          }
          function restoreAllFee() private {
              platformFee = _previousPlatformFee;
              devFee = _previousDevFee;
              rewardsFee = _previousRewardsFee;
              burnFee = _previousBurnFee;
          }
          function swapAndRedirectEthFees(uint256 contractTokenBalance)
              private
              lockTheSwap
          {
              uint256 totalRedirectFee = devFee.add(rewardsFee).add(platformFee);
              if (totalRedirectFee == 0) return;
              
             
              uint256 initialBalance = address(this).balance; 
              
              swapTokensForEth(contractTokenBalance);
              uint256 newBalance = address(this).balance.sub(initialBalance);
              if (newBalance > 0) {
                  
                  uint256 platformBalance = newBalance.mul(platformFee).div(totalRedirectFee);
                  sendEthToWallet(_platformWalletAddress, platformBalance);
                  
                  uint256 rewardsBalance = newBalance.mul(rewardsFee).div(totalRedirectFee);
                  if (rewardsBalance > 0 && address(_rewardsTracker) != address(0)) {
                      try _rewardsTracker.addAllocation{value: rewardsBalance}(REWARDS_TRACKER_IDENTIFIER) {} catch {}
                  }
                  
                  
                  uint256 devBalance = newBalance.mul(devFee).div(totalRedirectFee);
                  sendEthToWallet(_devWalletAddress, devBalance);
                  emit OnSwapAndRedirectEthFees(contractTokenBalance, newBalance);
              }
          }
          function sendEthToWallet(address wallet, uint256 amount) private {
              if (amount > 0) {
                  payable(wallet).transfer(amount);
              }
          }
          function swapTokensForEth(uint256 tokenAmount) private {
              
              address[] memory path = new address[](2);
              path[0] = address(this);
              path[1] = uniswapV2Router.WETH();
              _approve(address(this), address(uniswapV2Router), tokenAmount);
              
              uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
                  tokenAmount,
                  0, 
                  path,
                  address(this),
                  block.timestamp
              );
          }
          function prepareForLaunch() external onlyOwner {
              require(!preparedForLaunch, "Already prepared for launch");
              
              preparedForLaunch = true;
              
              blacklistDeadline = block.timestamp + 24 hours;
              
              launchSellFeeDeadline = block.timestamp + 7 days;
          }
          function setUseGenericTransfer(bool genericTransfer) external onlyOwner {
              useGenericTransfer = genericTransfer;
              emit GenericTransferChanged(genericTransfer);
          }
          function blacklistAddress(address account, bool value) public onlyOwner {
              if (value) {
                  require(block.timestamp < blacklistDeadline, "The ability to blacklist accounts has been disabled.");
              }
              isBlacklisted[account] = value;
          }
          
          
          function setMaxTxPercent(uint256 newMaxTx) external onlyOwner {
              require(newMaxTx >= 5, "Max TX should be above 0.5%");
              maxTxAmount = TOTAL_SUPPLY.mul(newMaxTx).div(1000);
              emit MaxTxAmountUpdated(maxTxAmount);
          }
          
          function isExcludedFromFee(address account) external view returns (bool) {
              return _isExcludedFromFee[account];
          }
           function excludeFromFee(address account) external onlyOwner {
              _isExcludedFromFee[account] = true;
              emit ExcludeFromFees(account);
          }
          function includeInFee(address account) external onlyOwner {
              _isExcludedFromFee[account] = false;
              emit IncludeInFees(account);
          }
          function setFees(
              uint256 newPlatformFee,
              uint256 newDevFee,
              uint256 newSellDevFee,
              uint256 newRewardsFee,
              uint256 newSellRewardsFee,
              uint256 newburnFee,
              uint256 newSellburnFee
          ) external onlyOwner {
              require(
                  newPlatformFee <= 1000 &&
                  newDevFee <= 1000 &&
                  newSellDevFee <= 1000 &&
                  newRewardsFee <= 1000 &&
                  newSellRewardsFee <= 1000 &&
                  newburnFee <= 1000 &&
                  newSellburnFee <= 1000,
                  "Fees exceed maximum allowed value"
              );
              platformFee = newPlatformFee;
              devFee = newDevFee;
              sellDevFee = newSellDevFee;
              rewardsFee = newRewardsFee;
              sellRewardsFee = newSellRewardsFee;
              burnFee = newburnFee;
              sellburnFee = newSellburnFee;
              emit FeesChanged(newDevFee, newSellDevFee, newRewardsFee, newSellRewardsFee, newburnFee, newSellburnFee);
          }
          function setLaunchSellFee(uint256 newLaunchSellFee) external onlyOwner {
              require(newLaunchSellFee <= 2500, "Maximum launch sell fee is 25%");
              launchSellFee = newLaunchSellFee;
              emit LaunchFeeUpdated(newLaunchSellFee);
          }
          function setDevWallet(address payable newDevWallet)
              external
              onlyOwner
          {
              _devWalletAddress = newDevWallet;
              emit DevWalletUpdated(newDevWallet);
          }
          
          function setRewardsTracker(address payable newRewardsTracker)
              external
              onlyOwner
          {
              _rewardsTracker = IRewardsTracker(newRewardsTracker);
              emit RewardsTrackerUpdated(newRewardsTracker);
          }
          function setRouterAddress(address newRouter) external onlyOwner {
              IUniswapV2Router _newUniswapRouter = IUniswapV2Router(newRouter);
              uniswapV2Pair = IUniswapV2Factory(_newUniswapRouter.factory())
                  .createPair(address(this), _newUniswapRouter.WETH());
              uniswapV2Router = _newUniswapRouter;
          }
          function setSwapAndRedirectEthFeesEnabled(bool enabled) external onlyOwner {
              swapAndRedirectEthFeesEnabled = enabled;
              emit SwapAndRedirectEthFeesUpdated(enabled);
          }
          function setMinTokensBeforeSwap(uint256 minTokens) external onlyOwner {
              minTokensBeforeSwap = minTokens * 10**9;
              emit MinTokensBeforeSwapUpdated(minTokens);
          }
          
          
          function manualSwap() external onlyOwner {
              uint256 contractBalance = balanceOf(address(this));
              swapTokensForEth(contractBalance);
          }
          function manualSend() external onlyOwner {
              uint256 contractEthBalance = address(this).balance;
              sendEthToWallet(_devWalletAddress, contractEthBalance);
          }
          
          bool private trueBurn = false; 
          function calculateBurnFee(uint256 _amount) internal view returns(uint256) {
              return _amount.mul(burnFee).div(10000);
          }
          function changeTrueBurn(bool value) public onlyOwner{
              trueBurn = value;
          }
          
          function addPairAddress(address _newPair, bool value) public onlyOwner{
              uniswapv2contracts[_newPair] = value;
          }
          
          function addBurnAddress(address _wallet, bool value) public onlyOwner{
              burnAddresses[_wallet] = value;
          }
      }                                                                                                                      pragma solidity ^0.8.17;
      // SPDX-License-Identifier: Apache-2.0
      interface IRewardsTracker {
          
          function addAllocation(uint identifier) external payable;
      }// SPDX-License-Identifier: Apache-2.0
      pragma solidity >=0.8.17;
      interface IUniswapV2Pair {
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
          function name() external pure returns (string memory);
          function symbol() external pure returns (string memory);
          function decimals() external pure returns (uint8);
          function totalSupply() external view returns (uint);
          function balanceOf(address owner) external view returns (uint);
          function allowance(address owner, address spender) external view returns (uint);
          function approve(address spender, uint value) external returns (bool);
          function transfer(address to, uint value) external returns (bool);
          function transferFrom(address from, address to, uint value) external returns (bool);
          function DOMAIN_SEPARATOR() external view returns (bytes32);
          function PERMIT_TYPEHASH() external pure returns (bytes32);
          function nonces(address owner) external view returns (uint);
          function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
          event Mint(address indexed sender, uint amount0, uint amount1);
          event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
          event Swap(
              address indexed sender,
              uint amount0In,
              uint amount1In,
              uint amount0Out,
              uint amount1Out,
              address indexed to
          );
          event Sync(uint112 reserve0, uint112 reserve1);
          function MINIMUM_LIQUIDITY() external pure returns (uint);
          function factory() external view returns (address);
          function token0() external view returns (address);
          function token1() external view returns (address);
          function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
          function price0CumulativeLast() external view returns (uint);
          function price1CumulativeLast() external view returns (uint);
          function kLast() external view returns (uint);
          function mint(address to) external returns (uint liquidity);
          function burn(address to) external returns (uint amount0, uint amount1);
          function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
          function skim(address to) external;
          function sync() external;
          function initialize(address, address) external;
      }pragma solidity ^0.8.17;
      // SPDX-License-Identifier: MIT
      interface IUniswapV2Router {
          
          function factory() external pure returns (address);
          
          function WETH() external pure returns (address);
          function swapExactTokensForETHSupportingFeeOnTransferTokens(
              uint256 amountIn,
              uint256 amountOutMin,
              address[] calldata path,
              address to,
              uint256 deadline
          ) external;
         function swapExactETHForTokensSupportingFeeOnTransferTokens(
              uint amountOutMin,
              address[] calldata path,
              address to,
              uint deadline
          ) external payable;
      }pragma solidity ^0.8.17;
      // SPDX-License-Identifier: MIT
      interface IUniswapV2Factory {
          function createPair(address tokenA, address tokenB)
              external
              returns (address pair);
      }pragma solidity ^0.8.17;
      // SPDX-License-Identifier: Apache-2.0
      import "./ERC20.sol";
      import "./Ownable.sol";
      abstract contract RewardsToken is ERC20, Ownable {
          address[] private excludedFromRewards;
          mapping(address => bool) private isAddressExcluded;
          
          event ExcludeFromRewards(address wallet);
          event IncludeInRewards(address wallet);
          
          function deleteExcluded(uint index) internal {
              require(index < excludedFromRewards.length, "Index is greater than array length");
              excludedFromRewards[index] = excludedFromRewards[excludedFromRewards.length - 1];
              excludedFromRewards.pop();
          }
          
          function getExcludedBalances() internal view returns (uint256) {
              uint256 totalExcludedHoldings = 0;
              for (uint i = 0; i < excludedFromRewards.length; i++) {
                  totalExcludedHoldings += balanceOf(excludedFromRewards[i]);
              }
              return totalExcludedHoldings;
          }
          
          function excludeFromRewards(address wallet) public onlyOwner {
              require(!isAddressExcluded[wallet], "Address is already excluded from rewards");
              excludedFromRewards.push(wallet);
              isAddressExcluded[wallet] = true;
              emit ExcludeFromRewards(wallet);
          }
          
          function includeInRewards(address wallet) external onlyOwner {
              require(isAddressExcluded[wallet], "Address is not excluded from rewards");
              for (uint i = 0; i < excludedFromRewards.length; i++) {
                  if (excludedFromRewards[i] == wallet) {
                      isAddressExcluded[wallet] = false;
                      deleteExcluded(i);
                      break;
                  }
              }
              emit IncludeInRewards(wallet);
          }
          
          function isExcludedFromRewards(address wallet) external view returns (bool) {
              return isAddressExcluded[wallet];
          }
          
          function getAllExcludedFromRewards() external view returns (address[] memory) {
              return excludedFromRewards;
          }
          
          function getRewardsSupply() public view returns (uint256) {
              return _totalSupply - getExcludedBalances();
          }
      }pragma solidity ^0.8.17;
      // SPDX-License-Identifier: MIT
      /**
       * @dev Collection of functions related to the address type
       */
      library Address {
          /**
           * @dev Returns true if `account` is a contract.
           *
           * [IMPORTANT]
           * ====
           * It is unsafe to assume that an address for which this function returns
           * false is an externally-owned account (EOA) and not a contract.
           *
           * Among others, `isContract` will return false for the following
           * types of addresses:
           *
           *  - an externally-owned account
           *  - a contract in construction
           *  - an address where a contract will be created
           *  - an address where a contract lived, but was destroyed
           * ====
           */
          function isContract(address account) internal view returns (bool) {
              // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
              // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
              // for accounts without code, i.e. `keccak256('')`
              bytes32 codehash;
              bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
              // solhint-disable-next-line no-inline-assembly
              assembly {
                  codehash := extcodehash(account)
              }
              return (codehash != accountHash && codehash != 0x0);
          }
          /**
           * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
           * `recipient`, forwarding all available gas and reverting on errors.
           *
           * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
           * of certain opcodes, possibly making contracts go over the 2300 gas limit
           * imposed by `transfer`, making them unable to receive funds via
           * `transfer`. {sendValue} removes this limitation.
           *
           * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
           *
           * IMPORTANT: because control is transferred to `recipient`, care must be
           * taken to not create reentrancy vulnerabilities. Consider using
           * {ReentrancyGuard} or the
           * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
           */
          function sendValue(address payable recipient, uint256 amount) internal {
              require(
                  address(this).balance >= amount,
                  "Address: insufficient balance"
              );
              // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
              (bool success, ) = recipient.call{value: amount}("");
              require(
                  success,
                  "Address: unable to send value, recipient may have reverted"
              );
          }
          /**
           * @dev Performs a Solidity function call using a low level `call`. A
           * plain`call` is an unsafe replacement for a function call: use this
           * function instead.
           *
           * If `target` reverts with a revert reason, it is bubbled up by this
           * function (like regular Solidity function calls).
           *
           * Returns the raw returned data. To convert to the expected return value,
           * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
           *
           * Requirements:
           *
           * - `target` must be a contract.
           * - calling `target` with `data` must not revert.
           *
           * _Available since v3.1._
           */
          function functionCall(address target, bytes memory data)
              internal
              returns (bytes memory)
          {
              return functionCall(target, data, "Address: low-level call failed");
          }
          /**
           * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
           * `errorMessage` as a fallback revert reason when `target` reverts.
           *
           * _Available since v3.1._
           */
          function functionCall(
              address target,
              bytes memory data,
              string memory errorMessage
          ) internal returns (bytes memory) {
              return _functionCallWithValue(target, data, 0, errorMessage);
          }
          /**
           * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
           * but also transferring `value` wei to `target`.
           *
           * Requirements:
           *
           * - the calling contract must have an ETH balance of at least `value`.
           * - the called Solidity function must be `payable`.
           *
           * _Available since v3.1._
           */
          function functionCallWithValue(
              address target,
              bytes memory data,
              uint256 value
          ) internal returns (bytes memory) {
              return
                  functionCallWithValue(
                      target,
                      data,
                      value,
                      "Address: low-level call with value failed"
                  );
          }
          /**
           * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
           * with `errorMessage` as a fallback revert reason when `target` reverts.
           *
           * _Available since v3.1._
           */
          function functionCallWithValue(
              address target,
              bytes memory data,
              uint256 value,
              string memory errorMessage
          ) internal returns (bytes memory) {
              require(
                  address(this).balance >= value,
                  "Address: insufficient balance for call"
              );
              return _functionCallWithValue(target, data, value, errorMessage);
          }
          function _functionCallWithValue(
              address target,
              bytes memory data,
              uint256 weiValue,
              string memory errorMessage
          ) private returns (bytes memory) {
              require(isContract(target), "Address: call to non-contract");
              // solhint-disable-next-line avoid-low-level-calls
              (bool success, bytes memory returndata) = target.call{value: weiValue}(
                  data
              );
              if (success) {
                  return returndata;
              } else {
                  // Look for revert reason and bubble it up if present
                  if (returndata.length > 0) {
                      // The easiest way to bubble the revert reason is using memory via assembly
                      // solhint-disable-next-line no-inline-assembly
                      assembly {
                          let returndata_size := mload(returndata)
                          revert(add(32, returndata), returndata_size)
                      }
                  } else {
                      revert(errorMessage);
                  }
              }
          }
      }// SPDX-License-Identifier: MIT
      // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
      pragma solidity ^0.8.17;
      // CAUTION
      // This version of SafeMath should only be used with Solidity 0.8 or later,
      // because it relies on the compiler's built in overflow checks.
      /**
       * @dev Wrappers over Solidity's arithmetic operations.
       *
       * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
       * now has built in overflow checking.
       */
      library SafeMath {
          /**
           * @dev Returns the addition of two unsigned integers, with an overflow flag.
           *
           * _Available since v3.4._
           */
          function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
              unchecked {
                  uint256 c = a + b;
                  if (c < a) return (false, 0);
                  return (true, c);
              }
          }
          /**
           * @dev Returns the substraction of two unsigned integers, with an overflow flag.
           *
           * _Available since v3.4._
           */
          function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
              unchecked {
                  if (b > a) return (false, 0);
                  return (true, a - b);
              }
          }
          /**
           * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
           *
           * _Available since v3.4._
           */
          function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
              unchecked {
                  // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
                  // benefit is lost if 'b' is also tested.
                  // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
                  if (a == 0) return (true, 0);
                  uint256 c = a * b;
                  if (c / a != b) return (false, 0);
                  return (true, c);
              }
          }
          /**
           * @dev Returns the division of two unsigned integers, with a division by zero flag.
           *
           * _Available since v3.4._
           */
          function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
              unchecked {
                  if (b == 0) return (false, 0);
                  return (true, a / b);
              }
          }
          /**
           * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
           *
           * _Available since v3.4._
           */
          function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
              unchecked {
                  if (b == 0) return (false, 0);
                  return (true, a % b);
              }
          }
          /**
           * @dev Returns the addition of two unsigned integers, reverting on
           * overflow.
           *
           * Counterpart to Solidity's `+` operator.
           *
           * Requirements:
           *
           * - Addition cannot overflow.
           */
          function add(uint256 a, uint256 b) internal pure returns (uint256) {
              return a + b;
          }
          /**
           * @dev Returns the subtraction of two unsigned integers, reverting on
           * overflow (when the result is negative).
           *
           * Counterpart to Solidity's `-` operator.
           *
           * Requirements:
           *
           * - Subtraction cannot overflow.
           */
          function sub(uint256 a, uint256 b) internal pure returns (uint256) {
              return a - b;
          }
          /**
           * @dev Returns the multiplication of two unsigned integers, reverting on
           * overflow.
           *
           * Counterpart to Solidity's `*` operator.
           *
           * Requirements:
           *
           * - Multiplication cannot overflow.
           */
          function mul(uint256 a, uint256 b) internal pure returns (uint256) {
              return a * b;
          }
          /**
           * @dev Returns the integer division of two unsigned integers, reverting on
           * division by zero. The result is rounded towards zero.
           *
           * Counterpart to Solidity's `/` operator.
           *
           * Requirements:
           *
           * - The divisor cannot be zero.
           */
          function div(uint256 a, uint256 b) internal pure returns (uint256) {
              return a / b;
          }
          /**
           * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
           * reverting when dividing by zero.
           *
           * Counterpart to Solidity's `%` operator. This function uses a `revert`
           * opcode (which leaves remaining gas untouched) while Solidity uses an
           * invalid opcode to revert (consuming all remaining gas).
           *
           * Requirements:
           *
           * - The divisor cannot be zero.
           */
          function mod(uint256 a, uint256 b) internal pure returns (uint256) {
              return a % b;
          }
          /**
           * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
           * overflow (when the result is negative).
           *
           * CAUTION: This function is deprecated because it requires allocating memory for the error
           * message unnecessarily. For custom revert reasons use {trySub}.
           *
           * Counterpart to Solidity's `-` operator.
           *
           * Requirements:
           *
           * - Subtraction cannot overflow.
           */
          function sub(
              uint256 a,
              uint256 b,
              string memory errorMessage
          ) internal pure returns (uint256) {
              unchecked {
                  require(b <= a, errorMessage);
                  return a - b;
              }
          }
          /**
           * @dev Returns the integer division of two unsigned integers, reverting with custom message on
           * division by zero. The result is rounded towards zero.
           *
           * Counterpart to Solidity's `/` operator. Note: this function uses a
           * `revert` opcode (which leaves remaining gas untouched) while Solidity
           * uses an invalid opcode to revert (consuming all remaining gas).
           *
           * Requirements:
           *
           * - The divisor cannot be zero.
           */
          function div(
              uint256 a,
              uint256 b,
              string memory errorMessage
          ) internal pure returns (uint256) {
              unchecked {
                  require(b > 0, errorMessage);
                  return a / b;
              }
          }
          /**
           * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
           * reverting with custom message when dividing by zero.
           *
           * CAUTION: This function is deprecated because it requires allocating memory for the error
           * message unnecessarily. For custom revert reasons use {tryMod}.
           *
           * Counterpart to Solidity's `%` operator. This function uses a `revert`
           * opcode (which leaves remaining gas untouched) while Solidity uses an
           * invalid opcode to revert (consuming all remaining gas).
           *
           * Requirements:
           *
           * - The divisor cannot be zero.
           */
          function mod(
              uint256 a,
              uint256 b,
              string memory errorMessage
          ) internal pure returns (uint256) {
              unchecked {
                  require(b > 0, errorMessage);
                  return a % b;
              }
          }
      }pragma solidity ^0.8.17;
      // SPDX-License-Identifier: MIT
      import "./Context.sol";
      /**
       * @dev Contract module which provides a basic access control mechanism, where
       * there is an account (an owner) that can be granted exclusive access to
       * specific functions.
       *
       * By default, the owner account will be the one that deploys the contract. This
       * can later be changed with {transferOwnership}.
       *
       * This module is used through inheritance. It will make available the modifier
       * `onlyOwner`, which can be applied to your functions to restrict their use to
       * the owner.
       */
      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() {
              address msgSender = _msgSender();
              _owner = msgSender;
              emit OwnershipTransferred(address(0), msgSender);
          }
          /**
           * @dev Returns the address of the current owner.
           */
          function owner() public view returns (address) {
              return _owner;
          }
          /**
           * @dev Throws if called by any account other than the owner.
           */
          modifier onlyOwner() {
              require(_owner == _msgSender(), "Ownable: caller is not the owner");
              _;
          }
          /**
           * @dev Leaves the contract without owner. It will not be possible to call
           * `onlyOwner` functions anymore. Can only be called by the current owner.
           *
           * NOTE: Renouncing ownership will leave the contract without an owner,
           * thereby removing any functionality that is only available to the owner.
           */
          function renounceOwnership() external virtual onlyOwner {
              emit OwnershipTransferred(_owner, address(0));
              _owner = 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) external virtual onlyOwner {
              require(
                  newOwner != address(0),
                  "Ownable: new owner is the zero address"
              );
              emit OwnershipTransferred(_owner, newOwner);
              _owner = newOwner;
          }
      }pragma solidity ^0.8.17;
      // SPDX-License-Identifier: MIT
      import "./IERC20.sol";
      import "./IERC20Metadata.sol";
      import "./Context.sol";
      import "./SafeMath.sol";
      import "./Address.sol";
      /**
       * @dev Implementation of the {IERC20} interface.
       *
       * This implementation is agnostic to the way tokens are created. This means
       * that a supply mechanism has to be added in a derived contract using {_mint}.
       * For a generic mechanism see {ERC20PresetMinterPauser}.
       *
       * TIP: For a detailed writeup see our guide
       * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
       * to implement supply mechanisms].
       *
       * We have followed general OpenZeppelin guidelines: functions revert instead
       * of returning `false` on failure. This behavior is nonetheless conventional
       * and does not conflict with the expectations of ERC20 applications.
       *
       * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
       * This allows applications to reconstruct the allowance for all accounts just
       * by listening to said events. Other implementations of the EIP may not emit
       * these events, as it isn't required by the specification.
       *
       * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
       * functions have been added to mitigate the well-known issues around setting
       * allowances. See {IERC20-approve}.
       */
      contract ERC20 is Context, IERC20, IERC20Metadata {
          using SafeMath for uint256;
          using Address for address;
          mapping(address => uint256) internal _balances;
          mapping(address => mapping(address => uint256)) private _allowances;
          uint256 internal _totalSupply;
          string private _name;
          string private _symbol;
          /**
           * @dev Sets the values for {name} and {symbol}.
           *
           * The default value of {decimals} is 18. To select a different value for
           * {decimals} you should overload it.
           *
           * All two of these values are immutable: they can only be set once during
           * construction.
           */
          constructor(string memory name_, string memory symbol_) {
              _name = name_;
              _symbol = symbol_;
          }
          /**
           * @dev Returns the name of the token.
           */
          function name() public view virtual override returns (string memory) {
              return _name;
          }
          /**
           * @dev Returns the symbol of the token, usually a shorter version of the
           * name.
           */
          function symbol() public view virtual override returns (string memory) {
              return _symbol;
          }
          /**
           * @dev Returns the number of decimals used to get its user representation.
           * For example, if `decimals` equals `2`, a balance of `505` tokens should
           * be displayed to a user as `5,05` (`505 / 10 ** 2`).
           *
           * Tokens usually opt for a value of 18, imitating the relationship between
           * Ether and Wei. This is the value {ERC20} uses, unless this function is
           * overridden;
           *
           * NOTE: This information is only used for _display_ purposes: it in
           * no way affects any of the arithmetic of the contract, including
           * {IERC20-balanceOf} and {IERC20-transfer}.
           */
          function decimals() public view virtual override returns (uint8) {
              return 18;
          }
          /**
           * @dev See {IERC20-totalSupply}.
           */
          function totalSupply() public view virtual override returns (uint256) {
              return _totalSupply;
          }
          /**
           * @dev See {IERC20-balanceOf}.
           */
          function balanceOf(address account) public view virtual override returns (uint256) {
              return _balances[account];
          }
          /**
           * @dev See {IERC20-transfer}.
           *
           * Requirements:
           *
           * - `recipient` cannot be the zero address.
           * - the caller must have a balance of at least `amount`.
           */
          function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
              _transfer(_msgSender(), recipient, amount);
              return true;
          }
          /**
           * @dev See {IERC20-allowance}.
           */
          function allowance(address owner, address spender) public view virtual override returns (uint256) {
              return _allowances[owner][spender];
          }
          /**
           * @dev See {IERC20-approve}.
           *
           * Requirements:
           *
           * - `spender` cannot be the zero address.
           */
          function approve(address spender, uint256 amount) public virtual override returns (bool) {
              _approve(_msgSender(), spender, amount);
              return true;
          }
          /**
           * @dev See {IERC20-transferFrom}.
           *
           * Emits an {Approval} event indicating the updated allowance. This is not
           * required by the EIP. See the note at the beginning of {ERC20}.
           *
           * Requirements:
           *
           * - `sender` and `recipient` cannot be the zero address.
           * - `sender` must have a balance of at least `amount`.
           * - the caller must have allowance for ``sender``'s tokens of at least
           * `amount`.
           */
          function transferFrom(
              address sender,
              address recipient,
              uint256 amount
          ) public virtual override returns (bool) {
              _transfer(sender, recipient, amount);
              _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
              return true;
          }
          /**
           * @dev Atomically increases the allowance granted to `spender` by the caller.
           *
           * This is an alternative to {approve} that can be used as a mitigation for
           * problems described in {IERC20-approve}.
           *
           * Emits an {Approval} event indicating the updated allowance.
           *
           * Requirements:
           *
           * - `spender` cannot be the zero address.
           */
          function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
              _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
              return true;
          }
          /**
           * @dev Atomically decreases the allowance granted to `spender` by the caller.
           *
           * This is an alternative to {approve} that can be used as a mitigation for
           * problems described in {IERC20-approve}.
           *
           * Emits an {Approval} event indicating the updated allowance.
           *
           * Requirements:
           *
           * - `spender` cannot be the zero address.
           * - `spender` must have allowance for the caller of at least
           * `subtractedValue`.
           */
          function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
              _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
              return true;
          }
          /**
           * @dev Moves tokens `amount` from `sender` to `recipient`.
           *
           * This is internal function is equivalent to {transfer}, and can be used to
           * e.g. implement automatic token fees, slashing mechanisms, etc.
           *
           * Emits a {Transfer} event.
           *
           * Requirements:
           *
           * - `sender` cannot be the zero address.
           * - `recipient` cannot be the zero address.
           * - `sender` must have a balance of at least `amount`.
           */
          function _transfer(
              address sender,
              address recipient,
              uint256 amount
          ) internal virtual {
              require(sender != address(0), "ERC20: transfer from the zero address");
              require(recipient != address(0), "ERC20: transfer to the zero address");
              _beforeTokenTransfer(sender, recipient, amount);
              _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
              _balances[recipient] = _balances[recipient].add(amount);
              emit Transfer(sender, recipient, amount);
          }
          /** @dev Creates `amount` tokens and assigns them to `account`, increasing
           * the total supply.
           *
           * Emits a {Transfer} event with `from` set to the zero address.
           *
           * Requirements:
           *
           * - `account` cannot be the zero address.
           */
          function _mint(address account, uint256 amount) internal virtual {
              require(account != address(0), "ERC20: mint to the zero address");
              _beforeTokenTransfer(address(0), account, amount);
              _totalSupply = _totalSupply.add(amount);
              _balances[account] = _balances[account].add(amount);
              emit Transfer(address(0), account, amount);
          }
          /**
           * @dev Destroys `amount` tokens from `account`, reducing the
           * total supply.
           *
           * Emits a {Transfer} event with `to` set to the zero address.
           *
           * Requirements:
           *
           * - `account` cannot be the zero address.
           * - `account` must have at least `amount` tokens.
           */
          function _burn(address account, uint256 amount) internal virtual {
              require(account != address(0), "ERC20: burn from the zero address");
              _beforeTokenTransfer(account, address(0), amount);
              _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
              _totalSupply = _totalSupply.sub(amount);
              emit Transfer(account, address(0), amount);
          }
          /**
           * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
           *
           * This internal function is equivalent to `approve`, and can be used to
           * e.g. set automatic allowances for certain subsystems, etc.
           *
           * Emits an {Approval} event.
           *
           * Requirements:
           *
           * - `owner` cannot be the zero address.
           * - `spender` cannot be the zero address.
           */
          function _approve(
              address owner,
              address spender,
              uint256 amount
          ) internal virtual {
              require(owner != address(0), "ERC20: approve from the zero address");
              require(spender != address(0), "ERC20: approve to the zero address");
              _allowances[owner][spender] = amount;
              emit Approval(owner, spender, amount);
          }
          /**
           * @dev Hook that is called before any transfer of tokens. This includes
           * minting and burning.
           *
           * Calling conditions:
           *
           * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
           * will be to transferred to `to`.
           * - when `from` is zero, `amount` tokens will be minted for `to`.
           * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
           * - `from` and `to` are never both zero.
           *
           * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
           */
          function _beforeTokenTransfer(
              address from,
              address to,
              uint256 amount
          ) internal virtual {}
      }pragma solidity ^0.8.4;
      // SPDX-License-Identifier: MIT
      abstract contract Context {
          function _msgSender() internal view virtual returns (address) {
              return msg.sender;
          }
          function _msgData() internal view virtual returns (bytes memory) {
              this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
              return msg.data;
          }
      }pragma solidity ^0.8.17;
      // SPDX-License-Identifier: MIT
      import "./IERC20.sol";
      /**
       * @dev Interface for the optional metadata functions from the ERC20 standard.
       *
       * _Available since v4.1._
       */
      interface IERC20Metadata is IERC20 {
          /**
           * @dev Returns the name of the token.
           */
          function name() external view returns (string memory);
          /**
           * @dev Returns the symbol of the token.
           */
          function symbol() external view returns (string memory);
          /**
           * @dev Returns the decimals places of the token.
           */
          function decimals() external view returns (uint8);
      }pragma solidity ^0.8.17;
      // SPDX-License-Identifier: MIT
      /**
       * @dev Interface of the ERC20 standard as defined in the EIP.
       */
      interface IERC20 {
          /**
           * @dev Returns the amount of tokens in existence.
           */
          function totalSupply() external view returns (uint256);
          /**
           * @dev Returns the amount of tokens owned by `account`.
           */
          function balanceOf(address account) external view returns (uint256);
          /**
           * @dev Moves `amount` tokens from the caller's account to `recipient`.
           *
           * Returns a boolean value indicating whether the operation succeeded.
           *
           * Emits a {Transfer} event.
           */
          function transfer(address recipient, uint256 amount) external returns (bool);
          /**
           * @dev Returns the remaining number of tokens that `spender` will be
           * allowed to spend on behalf of `owner` through {transferFrom}. This is
           * zero by default.
           *
           * This value changes when {approve} or {transferFrom} are called.
           */
          function allowance(address owner, address spender) external view returns (uint256);
          /**
           * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
           *
           * Returns a boolean value indicating whether the operation succeeded.
           *
           * IMPORTANT: Beware that changing an allowance with this method brings the risk
           * that someone may use both the old and the new allowance by unfortunate
           * transaction ordering. One possible solution to mitigate this race
           * condition is to first reduce the spender's allowance to 0 and set the
           * desired value afterwards:
           * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
           *
           * Emits an {Approval} event.
           */
          function approve(address spender, uint256 amount) external returns (bool);
          /**
           * @dev Moves `amount` tokens from `sender` to `recipient` using the
           * allowance mechanism. `amount` is then deducted from the caller's
           * allowance.
           *
           * Returns a boolean value indicating whether the operation succeeded.
           *
           * Emits a {Transfer} event.
           */
          function transferFrom(
              address sender,
              address recipient,
              uint256 amount
          ) external returns (bool);
          /**
           * @dev Emitted when `value` tokens are moved from one account (`from`) to
           * another (`to`).
           *
           * Note that `value` may be zero.
           */
          event Transfer(address indexed from, address indexed to, uint256 value);
          /**
           * @dev Emitted when the allowance of a `spender` for an `owner` is set by
           * a call to {approve}. `value` is the new allowance.
           */
          event Approval(address indexed owner, address indexed spender, uint256 value);
      }

      File 2 of 4: UniswapV2Factory
      pragma solidity =0.5.16;
      
      interface IUniswapV2Factory {
          event PairCreated(address indexed token0, address indexed token1, address pair, uint);
      
          function feeTo() external view returns (address);
          function feeToSetter() external view returns (address);
      
          function getPair(address tokenA, address tokenB) external view returns (address pair);
          function allPairs(uint) external view returns (address pair);
          function allPairsLength() external view returns (uint);
      
          function createPair(address tokenA, address tokenB) external returns (address pair);
      
          function setFeeTo(address) external;
          function setFeeToSetter(address) external;
      }
      
      interface IUniswapV2Pair {
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          function name() external pure returns (string memory);
          function symbol() external pure returns (string memory);
          function decimals() external pure returns (uint8);
          function totalSupply() external view returns (uint);
          function balanceOf(address owner) external view returns (uint);
          function allowance(address owner, address spender) external view returns (uint);
      
          function approve(address spender, uint value) external returns (bool);
          function transfer(address to, uint value) external returns (bool);
          function transferFrom(address from, address to, uint value) external returns (bool);
      
          function DOMAIN_SEPARATOR() external view returns (bytes32);
          function PERMIT_TYPEHASH() external pure returns (bytes32);
          function nonces(address owner) external view returns (uint);
      
          function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
      
          event Mint(address indexed sender, uint amount0, uint amount1);
          event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
          event Swap(
              address indexed sender,
              uint amount0In,
              uint amount1In,
              uint amount0Out,
              uint amount1Out,
              address indexed to
          );
          event Sync(uint112 reserve0, uint112 reserve1);
      
          function MINIMUM_LIQUIDITY() external pure returns (uint);
          function factory() external view returns (address);
          function token0() external view returns (address);
          function token1() external view returns (address);
          function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
          function price0CumulativeLast() external view returns (uint);
          function price1CumulativeLast() external view returns (uint);
          function kLast() external view returns (uint);
      
          function mint(address to) external returns (uint liquidity);
          function burn(address to) external returns (uint amount0, uint amount1);
          function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
          function skim(address to) external;
          function sync() external;
      
          function initialize(address, address) external;
      }
      
      interface IUniswapV2ERC20 {
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          function name() external pure returns (string memory);
          function symbol() external pure returns (string memory);
          function decimals() external pure returns (uint8);
          function totalSupply() external view returns (uint);
          function balanceOf(address owner) external view returns (uint);
          function allowance(address owner, address spender) external view returns (uint);
      
          function approve(address spender, uint value) external returns (bool);
          function transfer(address to, uint value) external returns (bool);
          function transferFrom(address from, address to, uint value) external returns (bool);
      
          function DOMAIN_SEPARATOR() external view returns (bytes32);
          function PERMIT_TYPEHASH() external pure returns (bytes32);
          function nonces(address owner) external view returns (uint);
      
          function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
      }
      
      interface IERC20 {
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          function name() external view returns (string memory);
          function symbol() external view returns (string memory);
          function decimals() external view returns (uint8);
          function totalSupply() external view returns (uint);
          function balanceOf(address owner) external view returns (uint);
          function allowance(address owner, address spender) external view returns (uint);
      
          function approve(address spender, uint value) external returns (bool);
          function transfer(address to, uint value) external returns (bool);
          function transferFrom(address from, address to, uint value) external returns (bool);
      }
      
      interface IUniswapV2Callee {
          function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
      }
      
      contract UniswapV2ERC20 is IUniswapV2ERC20 {
          using SafeMath for uint;
      
          string public constant name = 'Uniswap V2';
          string public constant symbol = 'UNI-V2';
          uint8 public constant decimals = 18;
          uint  public totalSupply;
          mapping(address => uint) public balanceOf;
          mapping(address => mapping(address => uint)) public allowance;
      
          bytes32 public DOMAIN_SEPARATOR;
          // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
          bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
          mapping(address => uint) public nonces;
      
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          constructor() public {
              uint chainId;
              assembly {
                  chainId := chainid
              }
              DOMAIN_SEPARATOR = keccak256(
                  abi.encode(
                      keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
                      keccak256(bytes(name)),
                      keccak256(bytes('1')),
                      chainId,
                      address(this)
                  )
              );
          }
      
          function _mint(address to, uint value) internal {
              totalSupply = totalSupply.add(value);
              balanceOf[to] = balanceOf[to].add(value);
              emit Transfer(address(0), to, value);
          }
      
          function _burn(address from, uint value) internal {
              balanceOf[from] = balanceOf[from].sub(value);
              totalSupply = totalSupply.sub(value);
              emit Transfer(from, address(0), value);
          }
      
          function _approve(address owner, address spender, uint value) private {
              allowance[owner][spender] = value;
              emit Approval(owner, spender, value);
          }
      
          function _transfer(address from, address to, uint value) private {
              balanceOf[from] = balanceOf[from].sub(value);
              balanceOf[to] = balanceOf[to].add(value);
              emit Transfer(from, to, value);
          }
      
          function approve(address spender, uint value) external returns (bool) {
              _approve(msg.sender, spender, value);
              return true;
          }
      
          function transfer(address to, uint value) external returns (bool) {
              _transfer(msg.sender, to, value);
              return true;
          }
      
          function transferFrom(address from, address to, uint value) external returns (bool) {
              if (allowance[from][msg.sender] != uint(-1)) {
                  allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
              }
              _transfer(from, to, value);
              return true;
          }
      
          function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
              require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
              bytes32 digest = keccak256(
                  abi.encodePacked(
                      '\x19\x01',
                      DOMAIN_SEPARATOR,
                      keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
                  )
              );
              address recoveredAddress = ecrecover(digest, v, r, s);
              require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
              _approve(owner, spender, value);
          }
      }
      
      contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
          using SafeMath  for uint;
          using UQ112x112 for uint224;
      
          uint public constant MINIMUM_LIQUIDITY = 10**3;
          bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
      
          address public factory;
          address public token0;
          address public token1;
      
          uint112 private reserve0;           // uses single storage slot, accessible via getReserves
          uint112 private reserve1;           // uses single storage slot, accessible via getReserves
          uint32  private blockTimestampLast; // uses single storage slot, accessible via getReserves
      
          uint public price0CumulativeLast;
          uint public price1CumulativeLast;
          uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
      
          uint private unlocked = 1;
          modifier lock() {
              require(unlocked == 1, 'UniswapV2: LOCKED');
              unlocked = 0;
              _;
              unlocked = 1;
          }
      
          function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
              _reserve0 = reserve0;
              _reserve1 = reserve1;
              _blockTimestampLast = blockTimestampLast;
          }
      
          function _safeTransfer(address token, address to, uint value) private {
              (bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
              require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
          }
      
          event Mint(address indexed sender, uint amount0, uint amount1);
          event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
          event Swap(
              address indexed sender,
              uint amount0In,
              uint amount1In,
              uint amount0Out,
              uint amount1Out,
              address indexed to
          );
          event Sync(uint112 reserve0, uint112 reserve1);
      
          constructor() public {
              factory = msg.sender;
          }
      
          // called once by the factory at time of deployment
          function initialize(address _token0, address _token1) external {
              require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
              token0 = _token0;
              token1 = _token1;
          }
      
          // update reserves and, on the first call per block, price accumulators
          function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
              require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
              uint32 blockTimestamp = uint32(block.timestamp % 2**32);
              uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
              if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
                  // * never overflows, and + overflow is desired
                  price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
                  price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
              }
              reserve0 = uint112(balance0);
              reserve1 = uint112(balance1);
              blockTimestampLast = blockTimestamp;
              emit Sync(reserve0, reserve1);
          }
      
          // if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
          function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
              address feeTo = IUniswapV2Factory(factory).feeTo();
              feeOn = feeTo != address(0);
              uint _kLast = kLast; // gas savings
              if (feeOn) {
                  if (_kLast != 0) {
                      uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
                      uint rootKLast = Math.sqrt(_kLast);
                      if (rootK > rootKLast) {
                          uint numerator = totalSupply.mul(rootK.sub(rootKLast));
                          uint denominator = rootK.mul(5).add(rootKLast);
                          uint liquidity = numerator / denominator;
                          if (liquidity > 0) _mint(feeTo, liquidity);
                      }
                  }
              } else if (_kLast != 0) {
                  kLast = 0;
              }
          }
      
          // this low-level function should be called from a contract which performs important safety checks
          function mint(address to) external lock returns (uint liquidity) {
              (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
              uint balance0 = IERC20(token0).balanceOf(address(this));
              uint balance1 = IERC20(token1).balanceOf(address(this));
              uint amount0 = balance0.sub(_reserve0);
              uint amount1 = balance1.sub(_reserve1);
      
              bool feeOn = _mintFee(_reserve0, _reserve1);
              uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
              if (_totalSupply == 0) {
                  liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
                 _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
              } else {
                  liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
              }
              require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
              _mint(to, liquidity);
      
              _update(balance0, balance1, _reserve0, _reserve1);
              if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
              emit Mint(msg.sender, amount0, amount1);
          }
      
          // this low-level function should be called from a contract which performs important safety checks
          function burn(address to) external lock returns (uint amount0, uint amount1) {
              (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
              address _token0 = token0;                                // gas savings
              address _token1 = token1;                                // gas savings
              uint balance0 = IERC20(_token0).balanceOf(address(this));
              uint balance1 = IERC20(_token1).balanceOf(address(this));
              uint liquidity = balanceOf[address(this)];
      
              bool feeOn = _mintFee(_reserve0, _reserve1);
              uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
              amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
              amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
              require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
              _burn(address(this), liquidity);
              _safeTransfer(_token0, to, amount0);
              _safeTransfer(_token1, to, amount1);
              balance0 = IERC20(_token0).balanceOf(address(this));
              balance1 = IERC20(_token1).balanceOf(address(this));
      
              _update(balance0, balance1, _reserve0, _reserve1);
              if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
              emit Burn(msg.sender, amount0, amount1, to);
          }
      
          // this low-level function should be called from a contract which performs important safety checks
          function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
              require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
              (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
              require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
      
              uint balance0;
              uint balance1;
              { // scope for _token{0,1}, avoids stack too deep errors
              address _token0 = token0;
              address _token1 = token1;
              require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
              if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
              if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
              if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
              balance0 = IERC20(_token0).balanceOf(address(this));
              balance1 = IERC20(_token1).balanceOf(address(this));
              }
              uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
              uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
              require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
              { // scope for reserve{0,1}Adjusted, avoids stack too deep errors
              uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
              uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
              require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
              }
      
              _update(balance0, balance1, _reserve0, _reserve1);
              emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
          }
      
          // force balances to match reserves
          function skim(address to) external lock {
              address _token0 = token0; // gas savings
              address _token1 = token1; // gas savings
              _safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
              _safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
          }
      
          // force reserves to match balances
          function sync() external lock {
              _update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
          }
      }
      
      contract UniswapV2Factory is IUniswapV2Factory {
          address public feeTo;
          address public feeToSetter;
      
          mapping(address => mapping(address => address)) public getPair;
          address[] public allPairs;
      
          event PairCreated(address indexed token0, address indexed token1, address pair, uint);
      
          constructor(address _feeToSetter) public {
              feeToSetter = _feeToSetter;
          }
      
          function allPairsLength() external view returns (uint) {
              return allPairs.length;
          }
      
          function createPair(address tokenA, address tokenB) external returns (address pair) {
              require(tokenA != tokenB, 'UniswapV2: IDENTICAL_ADDRESSES');
              (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
              require(token0 != address(0), 'UniswapV2: ZERO_ADDRESS');
              require(getPair[token0][token1] == address(0), 'UniswapV2: PAIR_EXISTS'); // single check is sufficient
              bytes memory bytecode = type(UniswapV2Pair).creationCode;
              bytes32 salt = keccak256(abi.encodePacked(token0, token1));
              assembly {
                  pair := create2(0, add(bytecode, 32), mload(bytecode), salt)
              }
              IUniswapV2Pair(pair).initialize(token0, token1);
              getPair[token0][token1] = pair;
              getPair[token1][token0] = pair; // populate mapping in the reverse direction
              allPairs.push(pair);
              emit PairCreated(token0, token1, pair, allPairs.length);
          }
      
          function setFeeTo(address _feeTo) external {
              require(msg.sender == feeToSetter, 'UniswapV2: FORBIDDEN');
              feeTo = _feeTo;
          }
      
          function setFeeToSetter(address _feeToSetter) external {
              require(msg.sender == feeToSetter, 'UniswapV2: FORBIDDEN');
              feeToSetter = _feeToSetter;
          }
      }
      
      // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
      
      library SafeMath {
          function add(uint x, uint y) internal pure returns (uint z) {
              require((z = x + y) >= x, 'ds-math-add-overflow');
          }
      
          function sub(uint x, uint y) internal pure returns (uint z) {
              require((z = x - y) <= x, 'ds-math-sub-underflow');
          }
      
          function mul(uint x, uint y) internal pure returns (uint z) {
              require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
          }
      }
      
      // a library for performing various math operations
      
      library Math {
          function min(uint x, uint y) internal pure returns (uint z) {
              z = x < y ? x : y;
          }
      
          // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
          function sqrt(uint y) internal pure returns (uint z) {
              if (y > 3) {
                  z = y;
                  uint x = y / 2 + 1;
                  while (x < z) {
                      z = x;
                      x = (y / x + x) / 2;
                  }
              } else if (y != 0) {
                  z = 1;
              }
          }
      }
      
      // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
      
      // range: [0, 2**112 - 1]
      // resolution: 1 / 2**112
      
      library UQ112x112 {
          uint224 constant Q112 = 2**112;
      
          // encode a uint112 as a UQ112x112
          function encode(uint112 y) internal pure returns (uint224 z) {
              z = uint224(y) * Q112; // never overflows
          }
      
          // divide a UQ112x112 by a uint112, returning a UQ112x112
          function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
              z = x / uint224(y);
          }
      }

      File 3 of 4: UniswapV2Router02
      pragma solidity =0.6.6;
      
      interface IUniswapV2Factory {
          event PairCreated(address indexed token0, address indexed token1, address pair, uint);
      
          function feeTo() external view returns (address);
          function feeToSetter() external view returns (address);
      
          function getPair(address tokenA, address tokenB) external view returns (address pair);
          function allPairs(uint) external view returns (address pair);
          function allPairsLength() external view returns (uint);
      
          function createPair(address tokenA, address tokenB) external returns (address pair);
      
          function setFeeTo(address) external;
          function setFeeToSetter(address) external;
      }
      
      interface IUniswapV2Pair {
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          function name() external pure returns (string memory);
          function symbol() external pure returns (string memory);
          function decimals() external pure returns (uint8);
          function totalSupply() external view returns (uint);
          function balanceOf(address owner) external view returns (uint);
          function allowance(address owner, address spender) external view returns (uint);
      
          function approve(address spender, uint value) external returns (bool);
          function transfer(address to, uint value) external returns (bool);
          function transferFrom(address from, address to, uint value) external returns (bool);
      
          function DOMAIN_SEPARATOR() external view returns (bytes32);
          function PERMIT_TYPEHASH() external pure returns (bytes32);
          function nonces(address owner) external view returns (uint);
      
          function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
      
          event Mint(address indexed sender, uint amount0, uint amount1);
          event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
          event Swap(
              address indexed sender,
              uint amount0In,
              uint amount1In,
              uint amount0Out,
              uint amount1Out,
              address indexed to
          );
          event Sync(uint112 reserve0, uint112 reserve1);
      
          function MINIMUM_LIQUIDITY() external pure returns (uint);
          function factory() external view returns (address);
          function token0() external view returns (address);
          function token1() external view returns (address);
          function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
          function price0CumulativeLast() external view returns (uint);
          function price1CumulativeLast() external view returns (uint);
          function kLast() external view returns (uint);
      
          function mint(address to) external returns (uint liquidity);
          function burn(address to) external returns (uint amount0, uint amount1);
          function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
          function skim(address to) external;
          function sync() external;
      
          function initialize(address, address) external;
      }
      
      interface IUniswapV2Router01 {
          function factory() external pure returns (address);
          function WETH() external pure returns (address);
      
          function addLiquidity(
              address tokenA,
              address tokenB,
              uint amountADesired,
              uint amountBDesired,
              uint amountAMin,
              uint amountBMin,
              address to,
              uint deadline
          ) external returns (uint amountA, uint amountB, uint liquidity);
          function addLiquidityETH(
              address token,
              uint amountTokenDesired,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline
          ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
          function removeLiquidity(
              address tokenA,
              address tokenB,
              uint liquidity,
              uint amountAMin,
              uint amountBMin,
              address to,
              uint deadline
          ) external returns (uint amountA, uint amountB);
          function removeLiquidityETH(
              address token,
              uint liquidity,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline
          ) external returns (uint amountToken, uint amountETH);
          function removeLiquidityWithPermit(
              address tokenA,
              address tokenB,
              uint liquidity,
              uint amountAMin,
              uint amountBMin,
              address to,
              uint deadline,
              bool approveMax, uint8 v, bytes32 r, bytes32 s
          ) external returns (uint amountA, uint amountB);
          function removeLiquidityETHWithPermit(
              address token,
              uint liquidity,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline,
              bool approveMax, uint8 v, bytes32 r, bytes32 s
          ) external returns (uint amountToken, uint amountETH);
          function swapExactTokensForTokens(
              uint amountIn,
              uint amountOutMin,
              address[] calldata path,
              address to,
              uint deadline
          ) external returns (uint[] memory amounts);
          function swapTokensForExactTokens(
              uint amountOut,
              uint amountInMax,
              address[] calldata path,
              address to,
              uint deadline
          ) external returns (uint[] memory amounts);
          function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
              external
              payable
              returns (uint[] memory amounts);
          function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
              external
              returns (uint[] memory amounts);
          function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
              external
              returns (uint[] memory amounts);
          function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
              external
              payable
              returns (uint[] memory amounts);
      
          function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
          function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
          function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
          function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
          function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
      }
      
      interface IUniswapV2Router02 is IUniswapV2Router01 {
          function removeLiquidityETHSupportingFeeOnTransferTokens(
              address token,
              uint liquidity,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline
          ) external returns (uint amountETH);
          function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
              address token,
              uint liquidity,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline,
              bool approveMax, uint8 v, bytes32 r, bytes32 s
          ) external returns (uint amountETH);
      
          function swapExactTokensForTokensSupportingFeeOnTransferTokens(
              uint amountIn,
              uint amountOutMin,
              address[] calldata path,
              address to,
              uint deadline
          ) external;
          function swapExactETHForTokensSupportingFeeOnTransferTokens(
              uint amountOutMin,
              address[] calldata path,
              address to,
              uint deadline
          ) external payable;
          function swapExactTokensForETHSupportingFeeOnTransferTokens(
              uint amountIn,
              uint amountOutMin,
              address[] calldata path,
              address to,
              uint deadline
          ) external;
      }
      
      interface IERC20 {
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          function name() external view returns (string memory);
          function symbol() external view returns (string memory);
          function decimals() external view returns (uint8);
          function totalSupply() external view returns (uint);
          function balanceOf(address owner) external view returns (uint);
          function allowance(address owner, address spender) external view returns (uint);
      
          function approve(address spender, uint value) external returns (bool);
          function transfer(address to, uint value) external returns (bool);
          function transferFrom(address from, address to, uint value) external returns (bool);
      }
      
      interface IWETH {
          function deposit() external payable;
          function transfer(address to, uint value) external returns (bool);
          function withdraw(uint) external;
      }
      
      contract UniswapV2Router02 is IUniswapV2Router02 {
          using SafeMath for uint;
      
          address public immutable override factory;
          address public immutable override WETH;
      
          modifier ensure(uint deadline) {
              require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED');
              _;
          }
      
          constructor(address _factory, address _WETH) public {
              factory = _factory;
              WETH = _WETH;
          }
      
          receive() external payable {
              assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract
          }
      
          // **** ADD LIQUIDITY ****
          function _addLiquidity(
              address tokenA,
              address tokenB,
              uint amountADesired,
              uint amountBDesired,
              uint amountAMin,
              uint amountBMin
          ) internal virtual returns (uint amountA, uint amountB) {
              // create the pair if it doesn't exist yet
              if (IUniswapV2Factory(factory).getPair(tokenA, tokenB) == address(0)) {
                  IUniswapV2Factory(factory).createPair(tokenA, tokenB);
              }
              (uint reserveA, uint reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB);
              if (reserveA == 0 && reserveB == 0) {
                  (amountA, amountB) = (amountADesired, amountBDesired);
              } else {
                  uint amountBOptimal = UniswapV2Library.quote(amountADesired, reserveA, reserveB);
                  if (amountBOptimal <= amountBDesired) {
                      require(amountBOptimal >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT');
                      (amountA, amountB) = (amountADesired, amountBOptimal);
                  } else {
                      uint amountAOptimal = UniswapV2Library.quote(amountBDesired, reserveB, reserveA);
                      assert(amountAOptimal <= amountADesired);
                      require(amountAOptimal >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT');
                      (amountA, amountB) = (amountAOptimal, amountBDesired);
                  }
              }
          }
          function addLiquidity(
              address tokenA,
              address tokenB,
              uint amountADesired,
              uint amountBDesired,
              uint amountAMin,
              uint amountBMin,
              address to,
              uint deadline
          ) external virtual override ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) {
              (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin);
              address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
              TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA);
              TransferHelper.safeTransferFrom(tokenB, msg.sender, pair, amountB);
              liquidity = IUniswapV2Pair(pair).mint(to);
          }
          function addLiquidityETH(
              address token,
              uint amountTokenDesired,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline
          ) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) {
              (amountToken, amountETH) = _addLiquidity(
                  token,
                  WETH,
                  amountTokenDesired,
                  msg.value,
                  amountTokenMin,
                  amountETHMin
              );
              address pair = UniswapV2Library.pairFor(factory, token, WETH);
              TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken);
              IWETH(WETH).deposit{value: amountETH}();
              assert(IWETH(WETH).transfer(pair, amountETH));
              liquidity = IUniswapV2Pair(pair).mint(to);
              // refund dust eth, if any
              if (msg.value > amountETH) TransferHelper.safeTransferETH(msg.sender, msg.value - amountETH);
          }
      
          // **** REMOVE LIQUIDITY ****
          function removeLiquidity(
              address tokenA,
              address tokenB,
              uint liquidity,
              uint amountAMin,
              uint amountBMin,
              address to,
              uint deadline
          ) public virtual override ensure(deadline) returns (uint amountA, uint amountB) {
              address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
              IUniswapV2Pair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair
              (uint amount0, uint amount1) = IUniswapV2Pair(pair).burn(to);
              (address token0,) = UniswapV2Library.sortTokens(tokenA, tokenB);
              (amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0);
              require(amountA >= amountAMin, 'UniswapV2Router: INSUFFICIENT_A_AMOUNT');
              require(amountB >= amountBMin, 'UniswapV2Router: INSUFFICIENT_B_AMOUNT');
          }
          function removeLiquidityETH(
              address token,
              uint liquidity,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline
          ) public virtual override ensure(deadline) returns (uint amountToken, uint amountETH) {
              (amountToken, amountETH) = removeLiquidity(
                  token,
                  WETH,
                  liquidity,
                  amountTokenMin,
                  amountETHMin,
                  address(this),
                  deadline
              );
              TransferHelper.safeTransfer(token, to, amountToken);
              IWETH(WETH).withdraw(amountETH);
              TransferHelper.safeTransferETH(to, amountETH);
          }
          function removeLiquidityWithPermit(
              address tokenA,
              address tokenB,
              uint liquidity,
              uint amountAMin,
              uint amountBMin,
              address to,
              uint deadline,
              bool approveMax, uint8 v, bytes32 r, bytes32 s
          ) external virtual override returns (uint amountA, uint amountB) {
              address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
              uint value = approveMax ? uint(-1) : liquidity;
              IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s);
              (amountA, amountB) = removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline);
          }
          function removeLiquidityETHWithPermit(
              address token,
              uint liquidity,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline,
              bool approveMax, uint8 v, bytes32 r, bytes32 s
          ) external virtual override returns (uint amountToken, uint amountETH) {
              address pair = UniswapV2Library.pairFor(factory, token, WETH);
              uint value = approveMax ? uint(-1) : liquidity;
              IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s);
              (amountToken, amountETH) = removeLiquidityETH(token, liquidity, amountTokenMin, amountETHMin, to, deadline);
          }
      
          // **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens) ****
          function removeLiquidityETHSupportingFeeOnTransferTokens(
              address token,
              uint liquidity,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline
          ) public virtual override ensure(deadline) returns (uint amountETH) {
              (, amountETH) = removeLiquidity(
                  token,
                  WETH,
                  liquidity,
                  amountTokenMin,
                  amountETHMin,
                  address(this),
                  deadline
              );
              TransferHelper.safeTransfer(token, to, IERC20(token).balanceOf(address(this)));
              IWETH(WETH).withdraw(amountETH);
              TransferHelper.safeTransferETH(to, amountETH);
          }
          function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
              address token,
              uint liquidity,
              uint amountTokenMin,
              uint amountETHMin,
              address to,
              uint deadline,
              bool approveMax, uint8 v, bytes32 r, bytes32 s
          ) external virtual override returns (uint amountETH) {
              address pair = UniswapV2Library.pairFor(factory, token, WETH);
              uint value = approveMax ? uint(-1) : liquidity;
              IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s);
              amountETH = removeLiquidityETHSupportingFeeOnTransferTokens(
                  token, liquidity, amountTokenMin, amountETHMin, to, deadline
              );
          }
      
          // **** SWAP ****
          // requires the initial amount to have already been sent to the first pair
          function _swap(uint[] memory amounts, address[] memory path, address _to) internal virtual {
              for (uint i; i < path.length - 1; i++) {
                  (address input, address output) = (path[i], path[i + 1]);
                  (address token0,) = UniswapV2Library.sortTokens(input, output);
                  uint amountOut = amounts[i + 1];
                  (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0));
                  address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to;
                  IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)).swap(
                      amount0Out, amount1Out, to, new bytes(0)
                  );
              }
          }
          function swapExactTokensForTokens(
              uint amountIn,
              uint amountOutMin,
              address[] calldata path,
              address to,
              uint deadline
          ) external virtual override ensure(deadline) returns (uint[] memory amounts) {
              amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path);
              require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT');
              TransferHelper.safeTransferFrom(
                  path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]
              );
              _swap(amounts, path, to);
          }
          function swapTokensForExactTokens(
              uint amountOut,
              uint amountInMax,
              address[] calldata path,
              address to,
              uint deadline
          ) external virtual override ensure(deadline) returns (uint[] memory amounts) {
              amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path);
              require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT');
              TransferHelper.safeTransferFrom(
                  path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]
              );
              _swap(amounts, path, to);
          }
          function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
              external
              virtual
              override
              payable
              ensure(deadline)
              returns (uint[] memory amounts)
          {
              require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH');
              amounts = UniswapV2Library.getAmountsOut(factory, msg.value, path);
              require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT');
              IWETH(WETH).deposit{value: amounts[0]}();
              assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]));
              _swap(amounts, path, to);
          }
          function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
              external
              virtual
              override
              ensure(deadline)
              returns (uint[] memory amounts)
          {
              require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH');
              amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path);
              require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT');
              TransferHelper.safeTransferFrom(
                  path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]
              );
              _swap(amounts, path, address(this));
              IWETH(WETH).withdraw(amounts[amounts.length - 1]);
              TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]);
          }
          function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
              external
              virtual
              override
              ensure(deadline)
              returns (uint[] memory amounts)
          {
              require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH');
              amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path);
              require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT');
              TransferHelper.safeTransferFrom(
                  path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]
              );
              _swap(amounts, path, address(this));
              IWETH(WETH).withdraw(amounts[amounts.length - 1]);
              TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]);
          }
          function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
              external
              virtual
              override
              payable
              ensure(deadline)
              returns (uint[] memory amounts)
          {
              require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH');
              amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path);
              require(amounts[0] <= msg.value, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT');
              IWETH(WETH).deposit{value: amounts[0]}();
              assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]));
              _swap(amounts, path, to);
              // refund dust eth, if any
              if (msg.value > amounts[0]) TransferHelper.safeTransferETH(msg.sender, msg.value - amounts[0]);
          }
      
          // **** SWAP (supporting fee-on-transfer tokens) ****
          // requires the initial amount to have already been sent to the first pair
          function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual {
              for (uint i; i < path.length - 1; i++) {
                  (address input, address output) = (path[i], path[i + 1]);
                  (address token0,) = UniswapV2Library.sortTokens(input, output);
                  IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output));
                  uint amountInput;
                  uint amountOutput;
                  { // scope to avoid stack too deep errors
                  (uint reserve0, uint reserve1,) = pair.getReserves();
                  (uint reserveInput, uint reserveOutput) = input == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
                  amountInput = IERC20(input).balanceOf(address(pair)).sub(reserveInput);
                  amountOutput = UniswapV2Library.getAmountOut(amountInput, reserveInput, reserveOutput);
                  }
                  (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOutput) : (amountOutput, uint(0));
                  address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to;
                  pair.swap(amount0Out, amount1Out, to, new bytes(0));
              }
          }
          function swapExactTokensForTokensSupportingFeeOnTransferTokens(
              uint amountIn,
              uint amountOutMin,
              address[] calldata path,
              address to,
              uint deadline
          ) external virtual override ensure(deadline) {
              TransferHelper.safeTransferFrom(
                  path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn
              );
              uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to);
              _swapSupportingFeeOnTransferTokens(path, to);
              require(
                  IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin,
                  'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'
              );
          }
          function swapExactETHForTokensSupportingFeeOnTransferTokens(
              uint amountOutMin,
              address[] calldata path,
              address to,
              uint deadline
          )
              external
              virtual
              override
              payable
              ensure(deadline)
          {
              require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH');
              uint amountIn = msg.value;
              IWETH(WETH).deposit{value: amountIn}();
              assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn));
              uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to);
              _swapSupportingFeeOnTransferTokens(path, to);
              require(
                  IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin,
                  'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'
              );
          }
          function swapExactTokensForETHSupportingFeeOnTransferTokens(
              uint amountIn,
              uint amountOutMin,
              address[] calldata path,
              address to,
              uint deadline
          )
              external
              virtual
              override
              ensure(deadline)
          {
              require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH');
              TransferHelper.safeTransferFrom(
                  path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn
              );
              _swapSupportingFeeOnTransferTokens(path, address(this));
              uint amountOut = IERC20(WETH).balanceOf(address(this));
              require(amountOut >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT');
              IWETH(WETH).withdraw(amountOut);
              TransferHelper.safeTransferETH(to, amountOut);
          }
      
          // **** LIBRARY FUNCTIONS ****
          function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) {
              return UniswapV2Library.quote(amountA, reserveA, reserveB);
          }
      
          function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut)
              public
              pure
              virtual
              override
              returns (uint amountOut)
          {
              return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut);
          }
      
          function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut)
              public
              pure
              virtual
              override
              returns (uint amountIn)
          {
              return UniswapV2Library.getAmountIn(amountOut, reserveIn, reserveOut);
          }
      
          function getAmountsOut(uint amountIn, address[] memory path)
              public
              view
              virtual
              override
              returns (uint[] memory amounts)
          {
              return UniswapV2Library.getAmountsOut(factory, amountIn, path);
          }
      
          function getAmountsIn(uint amountOut, address[] memory path)
              public
              view
              virtual
              override
              returns (uint[] memory amounts)
          {
              return UniswapV2Library.getAmountsIn(factory, amountOut, path);
          }
      }
      
      // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
      
      library SafeMath {
          function add(uint x, uint y) internal pure returns (uint z) {
              require((z = x + y) >= x, 'ds-math-add-overflow');
          }
      
          function sub(uint x, uint y) internal pure returns (uint z) {
              require((z = x - y) <= x, 'ds-math-sub-underflow');
          }
      
          function mul(uint x, uint y) internal pure returns (uint z) {
              require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
          }
      }
      
      library UniswapV2Library {
          using SafeMath for uint;
      
          // returns sorted token addresses, used to handle return values from pairs sorted in this order
          function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
              require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
              (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
              require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
          }
      
          // calculates the CREATE2 address for a pair without making any external calls
          function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
              (address token0, address token1) = sortTokens(tokenA, tokenB);
              pair = address(uint(keccak256(abi.encodePacked(
                      hex'ff',
                      factory,
                      keccak256(abi.encodePacked(token0, token1)),
                      hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
                  ))));
          }
      
          // fetches and sorts the reserves for a pair
          function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
              (address token0,) = sortTokens(tokenA, tokenB);
              (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
              (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
          }
      
          // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
          function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
              require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
              require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
              amountB = amountA.mul(reserveB) / reserveA;
          }
      
          // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
          function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
              require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
              require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
              uint amountInWithFee = amountIn.mul(997);
              uint numerator = amountInWithFee.mul(reserveOut);
              uint denominator = reserveIn.mul(1000).add(amountInWithFee);
              amountOut = numerator / denominator;
          }
      
          // given an output amount of an asset and pair reserves, returns a required input amount of the other asset
          function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
              require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
              require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
              uint numerator = reserveIn.mul(amountOut).mul(1000);
              uint denominator = reserveOut.sub(amountOut).mul(997);
              amountIn = (numerator / denominator).add(1);
          }
      
          // performs chained getAmountOut calculations on any number of pairs
          function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
              require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
              amounts = new uint[](path.length);
              amounts[0] = amountIn;
              for (uint i; i < path.length - 1; i++) {
                  (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
                  amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
              }
          }
      
          // performs chained getAmountIn calculations on any number of pairs
          function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
              require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
              amounts = new uint[](path.length);
              amounts[amounts.length - 1] = amountOut;
              for (uint i = path.length - 1; i > 0; i--) {
                  (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
                  amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
              }
          }
      }
      
      // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
      library TransferHelper {
          function safeApprove(address token, address to, uint value) internal {
              // bytes4(keccak256(bytes('approve(address,uint256)')));
              (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
              require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
          }
      
          function safeTransfer(address token, address to, uint value) internal {
              // bytes4(keccak256(bytes('transfer(address,uint256)')));
              (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
              require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
          }
      
          function safeTransferFrom(address token, address from, address to, uint value) internal {
              // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
              (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
              require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
          }
      
          function safeTransferETH(address to, uint value) internal {
              (bool success,) = to.call{value:value}(new bytes(0));
              require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
          }
      }

      File 4 of 4: UniswapV2Pair
      // File: contracts/interfaces/IUniswapV2Pair.sol
      
      pragma solidity >=0.5.0;
      
      interface IUniswapV2Pair {
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          function name() external pure returns (string memory);
          function symbol() external pure returns (string memory);
          function decimals() external pure returns (uint8);
          function totalSupply() external view returns (uint);
          function balanceOf(address owner) external view returns (uint);
          function allowance(address owner, address spender) external view returns (uint);
      
          function approve(address spender, uint value) external returns (bool);
          function transfer(address to, uint value) external returns (bool);
          function transferFrom(address from, address to, uint value) external returns (bool);
      
          function DOMAIN_SEPARATOR() external view returns (bytes32);
          function PERMIT_TYPEHASH() external pure returns (bytes32);
          function nonces(address owner) external view returns (uint);
      
          function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
      
          event Mint(address indexed sender, uint amount0, uint amount1);
          event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
          event Swap(
              address indexed sender,
              uint amount0In,
              uint amount1In,
              uint amount0Out,
              uint amount1Out,
              address indexed to
          );
          event Sync(uint112 reserve0, uint112 reserve1);
      
          function MINIMUM_LIQUIDITY() external pure returns (uint);
          function factory() external view returns (address);
          function token0() external view returns (address);
          function token1() external view returns (address);
          function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
          function price0CumulativeLast() external view returns (uint);
          function price1CumulativeLast() external view returns (uint);
          function kLast() external view returns (uint);
      
          function mint(address to) external returns (uint liquidity);
          function burn(address to) external returns (uint amount0, uint amount1);
          function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
          function skim(address to) external;
          function sync() external;
      
          function initialize(address, address) external;
      }
      
      // File: contracts/interfaces/IUniswapV2ERC20.sol
      
      pragma solidity >=0.5.0;
      
      interface IUniswapV2ERC20 {
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          function name() external pure returns (string memory);
          function symbol() external pure returns (string memory);
          function decimals() external pure returns (uint8);
          function totalSupply() external view returns (uint);
          function balanceOf(address owner) external view returns (uint);
          function allowance(address owner, address spender) external view returns (uint);
      
          function approve(address spender, uint value) external returns (bool);
          function transfer(address to, uint value) external returns (bool);
          function transferFrom(address from, address to, uint value) external returns (bool);
      
          function DOMAIN_SEPARATOR() external view returns (bytes32);
          function PERMIT_TYPEHASH() external pure returns (bytes32);
          function nonces(address owner) external view returns (uint);
      
          function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
      }
      
      // File: contracts/libraries/SafeMath.sol
      
      pragma solidity =0.5.16;
      
      // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
      
      library SafeMath {
          function add(uint x, uint y) internal pure returns (uint z) {
              require((z = x + y) >= x, 'ds-math-add-overflow');
          }
      
          function sub(uint x, uint y) internal pure returns (uint z) {
              require((z = x - y) <= x, 'ds-math-sub-underflow');
          }
      
          function mul(uint x, uint y) internal pure returns (uint z) {
              require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
          }
      }
      
      // File: contracts/UniswapV2ERC20.sol
      
      pragma solidity =0.5.16;
      
      
      
      contract UniswapV2ERC20 is IUniswapV2ERC20 {
          using SafeMath for uint;
      
          string public constant name = 'Uniswap V2';
          string public constant symbol = 'UNI-V2';
          uint8 public constant decimals = 18;
          uint  public totalSupply;
          mapping(address => uint) public balanceOf;
          mapping(address => mapping(address => uint)) public allowance;
      
          bytes32 public DOMAIN_SEPARATOR;
          // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
          bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
          mapping(address => uint) public nonces;
      
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          constructor() public {
              uint chainId;
              assembly {
                  chainId := chainid
              }
              DOMAIN_SEPARATOR = keccak256(
                  abi.encode(
                      keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
                      keccak256(bytes(name)),
                      keccak256(bytes('1')),
                      chainId,
                      address(this)
                  )
              );
          }
      
          function _mint(address to, uint value) internal {
              totalSupply = totalSupply.add(value);
              balanceOf[to] = balanceOf[to].add(value);
              emit Transfer(address(0), to, value);
          }
      
          function _burn(address from, uint value) internal {
              balanceOf[from] = balanceOf[from].sub(value);
              totalSupply = totalSupply.sub(value);
              emit Transfer(from, address(0), value);
          }
      
          function _approve(address owner, address spender, uint value) private {
              allowance[owner][spender] = value;
              emit Approval(owner, spender, value);
          }
      
          function _transfer(address from, address to, uint value) private {
              balanceOf[from] = balanceOf[from].sub(value);
              balanceOf[to] = balanceOf[to].add(value);
              emit Transfer(from, to, value);
          }
      
          function approve(address spender, uint value) external returns (bool) {
              _approve(msg.sender, spender, value);
              return true;
          }
      
          function transfer(address to, uint value) external returns (bool) {
              _transfer(msg.sender, to, value);
              return true;
          }
      
          function transferFrom(address from, address to, uint value) external returns (bool) {
              if (allowance[from][msg.sender] != uint(-1)) {
                  allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
              }
              _transfer(from, to, value);
              return true;
          }
      
          function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
              require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
              bytes32 digest = keccak256(
                  abi.encodePacked(
                      '\x19\x01',
                      DOMAIN_SEPARATOR,
                      keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
                  )
              );
              address recoveredAddress = ecrecover(digest, v, r, s);
              require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
              _approve(owner, spender, value);
          }
      }
      
      // File: contracts/libraries/Math.sol
      
      pragma solidity =0.5.16;
      
      // a library for performing various math operations
      
      library Math {
          function min(uint x, uint y) internal pure returns (uint z) {
              z = x < y ? x : y;
          }
      
          // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
          function sqrt(uint y) internal pure returns (uint z) {
              if (y > 3) {
                  z = y;
                  uint x = y / 2 + 1;
                  while (x < z) {
                      z = x;
                      x = (y / x + x) / 2;
                  }
              } else if (y != 0) {
                  z = 1;
              }
          }
      }
      
      // File: contracts/libraries/UQ112x112.sol
      
      pragma solidity =0.5.16;
      
      // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
      
      // range: [0, 2**112 - 1]
      // resolution: 1 / 2**112
      
      library UQ112x112 {
          uint224 constant Q112 = 2**112;
      
          // encode a uint112 as a UQ112x112
          function encode(uint112 y) internal pure returns (uint224 z) {
              z = uint224(y) * Q112; // never overflows
          }
      
          // divide a UQ112x112 by a uint112, returning a UQ112x112
          function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
              z = x / uint224(y);
          }
      }
      
      // File: contracts/interfaces/IERC20.sol
      
      pragma solidity >=0.5.0;
      
      interface IERC20 {
          event Approval(address indexed owner, address indexed spender, uint value);
          event Transfer(address indexed from, address indexed to, uint value);
      
          function name() external view returns (string memory);
          function symbol() external view returns (string memory);
          function decimals() external view returns (uint8);
          function totalSupply() external view returns (uint);
          function balanceOf(address owner) external view returns (uint);
          function allowance(address owner, address spender) external view returns (uint);
      
          function approve(address spender, uint value) external returns (bool);
          function transfer(address to, uint value) external returns (bool);
          function transferFrom(address from, address to, uint value) external returns (bool);
      }
      
      // File: contracts/interfaces/IUniswapV2Factory.sol
      
      pragma solidity >=0.5.0;
      
      interface IUniswapV2Factory {
          event PairCreated(address indexed token0, address indexed token1, address pair, uint);
      
          function feeTo() external view returns (address);
          function feeToSetter() external view returns (address);
      
          function getPair(address tokenA, address tokenB) external view returns (address pair);
          function allPairs(uint) external view returns (address pair);
          function allPairsLength() external view returns (uint);
      
          function createPair(address tokenA, address tokenB) external returns (address pair);
      
          function setFeeTo(address) external;
          function setFeeToSetter(address) external;
      }
      
      // File: contracts/interfaces/IUniswapV2Callee.sol
      
      pragma solidity >=0.5.0;
      
      interface IUniswapV2Callee {
          function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
      }
      
      // File: contracts/UniswapV2Pair.sol
      
      pragma solidity =0.5.16;
      
      
      
      
      
      
      
      
      contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
          using SafeMath  for uint;
          using UQ112x112 for uint224;
      
          uint public constant MINIMUM_LIQUIDITY = 10**3;
          bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
      
          address public factory;
          address public token0;
          address public token1;
      
          uint112 private reserve0;           // uses single storage slot, accessible via getReserves
          uint112 private reserve1;           // uses single storage slot, accessible via getReserves
          uint32  private blockTimestampLast; // uses single storage slot, accessible via getReserves
      
          uint public price0CumulativeLast;
          uint public price1CumulativeLast;
          uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
      
          uint private unlocked = 1;
          modifier lock() {
              require(unlocked == 1, 'UniswapV2: LOCKED');
              unlocked = 0;
              _;
              unlocked = 1;
          }
      
          function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
              _reserve0 = reserve0;
              _reserve1 = reserve1;
              _blockTimestampLast = blockTimestampLast;
          }
      
          function _safeTransfer(address token, address to, uint value) private {
              (bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
              require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
          }
      
          event Mint(address indexed sender, uint amount0, uint amount1);
          event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
          event Swap(
              address indexed sender,
              uint amount0In,
              uint amount1In,
              uint amount0Out,
              uint amount1Out,
              address indexed to
          );
          event Sync(uint112 reserve0, uint112 reserve1);
      
          constructor() public {
              factory = msg.sender;
          }
      
          // called once by the factory at time of deployment
          function initialize(address _token0, address _token1) external {
              require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
              token0 = _token0;
              token1 = _token1;
          }
      
          // update reserves and, on the first call per block, price accumulators
          function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
              require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
              uint32 blockTimestamp = uint32(block.timestamp % 2**32);
              uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
              if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
                  // * never overflows, and + overflow is desired
                  price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
                  price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
              }
              reserve0 = uint112(balance0);
              reserve1 = uint112(balance1);
              blockTimestampLast = blockTimestamp;
              emit Sync(reserve0, reserve1);
          }
      
          // if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
          function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
              address feeTo = IUniswapV2Factory(factory).feeTo();
              feeOn = feeTo != address(0);
              uint _kLast = kLast; // gas savings
              if (feeOn) {
                  if (_kLast != 0) {
                      uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
                      uint rootKLast = Math.sqrt(_kLast);
                      if (rootK > rootKLast) {
                          uint numerator = totalSupply.mul(rootK.sub(rootKLast));
                          uint denominator = rootK.mul(5).add(rootKLast);
                          uint liquidity = numerator / denominator;
                          if (liquidity > 0) _mint(feeTo, liquidity);
                      }
                  }
              } else if (_kLast != 0) {
                  kLast = 0;
              }
          }
      
          // this low-level function should be called from a contract which performs important safety checks
          function mint(address to) external lock returns (uint liquidity) {
              (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
              uint balance0 = IERC20(token0).balanceOf(address(this));
              uint balance1 = IERC20(token1).balanceOf(address(this));
              uint amount0 = balance0.sub(_reserve0);
              uint amount1 = balance1.sub(_reserve1);
      
              bool feeOn = _mintFee(_reserve0, _reserve1);
              uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
              if (_totalSupply == 0) {
                  liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
                 _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
              } else {
                  liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
              }
              require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
              _mint(to, liquidity);
      
              _update(balance0, balance1, _reserve0, _reserve1);
              if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
              emit Mint(msg.sender, amount0, amount1);
          }
      
          // this low-level function should be called from a contract which performs important safety checks
          function burn(address to) external lock returns (uint amount0, uint amount1) {
              (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
              address _token0 = token0;                                // gas savings
              address _token1 = token1;                                // gas savings
              uint balance0 = IERC20(_token0).balanceOf(address(this));
              uint balance1 = IERC20(_token1).balanceOf(address(this));
              uint liquidity = balanceOf[address(this)];
      
              bool feeOn = _mintFee(_reserve0, _reserve1);
              uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
              amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
              amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
              require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
              _burn(address(this), liquidity);
              _safeTransfer(_token0, to, amount0);
              _safeTransfer(_token1, to, amount1);
              balance0 = IERC20(_token0).balanceOf(address(this));
              balance1 = IERC20(_token1).balanceOf(address(this));
      
              _update(balance0, balance1, _reserve0, _reserve1);
              if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
              emit Burn(msg.sender, amount0, amount1, to);
          }
      
          // this low-level function should be called from a contract which performs important safety checks
          function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
              require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
              (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
              require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
      
              uint balance0;
              uint balance1;
              { // scope for _token{0,1}, avoids stack too deep errors
              address _token0 = token0;
              address _token1 = token1;
              require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
              if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
              if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
              if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
              balance0 = IERC20(_token0).balanceOf(address(this));
              balance1 = IERC20(_token1).balanceOf(address(this));
              }
              uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
              uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
              require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
              { // scope for reserve{0,1}Adjusted, avoids stack too deep errors
              uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
              uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
              require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
              }
      
              _update(balance0, balance1, _reserve0, _reserve1);
              emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
          }
      
          // force balances to match reserves
          function skim(address to) external lock {
              address _token0 = token0; // gas savings
              address _token1 = token1; // gas savings
              _safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
              _safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
          }
      
          // force reserves to match balances
          function sync() external lock {
              _update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
          }
      }