ETH Price: $2,654.36 (+7.31%)

Transaction Decoder

Block:
19278883 at Feb-21-2024 10:04:23 PM +UTC
Transaction Fee:
0.24390369 ETH $647.41
Gas Used:
5,420,082 Gas / 45 Gwei

Emitted Events:

205 Rizo.OwnershipTransferred( previousOwner=0x0000000000000000000000000000000000000000, newOwner=[Sender] 0xd2dbbe69fd3e3d9f94d03c00aac5cce934d0662b )
206 UniswapV2Factory.PairCreated( token0=Rizo, token1=0xC02aaA39...83C756Cc2, pair=UniswapV2Pair, 308063 )
207 Rizo.Transfer( from=0x0000000000000000000000000000000000000000, to=[Sender] 0xd2dbbe69fd3e3d9f94d03c00aac5cce934d0662b, value=420690000000000000000000000000 )

Account State Difference:

  Address   Before After State Difference Code
(Titan Builder)
146.135157303816325619 Eth146.136364826492062481 Eth0.001207522675736862
0x5C69bEe7...B9cc5aA6f
(Uniswap V2: Factory Contract)
0x5F9d8592...35467ea48
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 6764290092513726222696113229074677300582406292993807811641041491451546652663832946268808145007286701968245238241127816432125602389017184726413726136050937847590796869894293811024043065599757516383598439860933528181090300335935280589560730897350622577558550967496327315713176388796307993199725684602376921455805779296510030374220885547509444868710798529805028727005768714365783259716828657385948829505091458413475079524481325004020131382310615246750211606259678290998829940259225530128665275112971113196802097677938777250683881132049859974062111934820441863780430250758355797637960750640892756709980889465478442266956369721727910472098733251357727588359505324099520987734779471153904088146904451113253009478829999518384731907276109897019974128585672047901928474161019609964254665696537118224989521679461638527674308793226417841604722503832053048532902743307744389924362467024979767299820841938001585847957650624642000220240301706785324856386702055650610854315204968583184480811083415429779248827536575359465411506177177445379390515456000159118002404098500273143828586469646146990732293811248260866404603448208714816779792930708637924585785344923086689220023494975479986597804741972532125496013912821587981468924357235612524376639419312183883107468017190276067925579537757182722154167251792251293467252920429282802741817458964167964250178698451250777244768530559299419515124597360317799947936425995024904777435541609134244762412649594375866318483434878329518971411551066386725769756347738476890766956758257170230921029118937851662167147785392125813193563910941558943591672789492960140897136645764649800443959007902537470461773031419538777723327284464018316420780337409842568888985000488447839658062527760095682586164775773214642810659950442674255315187351133219595503239984805187885057741209994719667251209388778069364361415301923124931799752866448084739197681034988561589076201577647621468568479848613173121320183097946088463308654506843928283535527795375336708379201694478390364822689103678655730058935721861270429978304410891962229017129803257390918323840648004285775706484187924048493162476273980415864540574125705878836618285576167457968612731352121332774607452845505315606948482016799746025821947900616429589340542397646412597175206797007211195539013896690130035550363648156843285087910735824004198865927580262828335941064623092413322301962233201566480061682912328546536953004420417214309810243482480379230346095966959109164429110341332451732713814747175172369733954829327244006229439107670350706716504118905719655739745414004105313534003211265953607468408682381484813134628064385347448612228488546068815684868943136925228466482662307586209541232941634702763150423361005273125768860359321003070498329113152304044687311484369591886826286849241492714746035453530985760826074202224328680534075056788780527355850537526507990425706923533192637414998552174291800105823508026545279963231113518342895385291117933231995145145452361617497189515110310877530569115535492435194594584350568641552418631024789844590572990241425360787270142022501098410402040759002817599798496709518641266931956940271586933881608794762860972357074333620000074482790947589178384739181209133451809354582793752274745523208872446938433121740875395933730975169916652974709460068802648678902520835579588544048994083237923468544353056358980354473986903440319386298931321751165434975108960230688774040300045910090185787247588132844114599051255052017617203763570020643980184460642425997380706939760721292671508756597075746922214664039831793061824906191427981111798963319671103105682516044128013644490508952038196950395775123309117732986401317399418753541902793032595083149403966845032349974555993774125382550395142080476019329977201288431302910516579749086814871044331826687561445526814857627505768646136097744557146538034074086772572657530335192950240723439893641016921774546927888540880657938036705233151583642660012962859784691791384878223191473627119947438517852764440971828961508452478940789109988117017692387321165609467031954503412355042274226115369747525054603510429981061723610769942555565153661401943161583038218788194845730510475525890705549828114256751060625497255614079889706354664318409524618711645393755865535736265419894209216588826891584654729343750713800564534728044555813377838103874981231171485140733266263299075026059236429164119695778164125060523337408702214716847466436355994236419462579542555885431275282744454622219328312809704544575841800103951253833159611958531352158489434753375547341984551477139873587620077923891601356185237161111728906276435402989046268121585153012726606548147957843971499826751460265151332607569832201390696106196200752739297898595139623159042244745256456626142684727660272442966410634822047683300319330400559169761628065756808063467026781859272204072788017738137691590428849940404623797624164623418991251701730339746049083454229761375529668033180050831851989098602590190931556465251664831913405722385646847081246713251764160201651313440050983794542297240590895258738842148628156159843174422928120719239842890992552053714524427740845567993163667220733781561399513872561597174177415211111516690920796797771245920805360003960884760200848694231187480984290755084028272394277514358038092541096254350991713995371201841149362979043223407550175185349343481527598607799904721345357534500289318086908178164448654142236064067691303983660544761075017470810256587690335468605289643045740854389048200262275242835132671999817265060762054164020094958990758782725058621840857637716990971046700297483747224874784380940725167238503937445236580528704977883116876684784812105248904836687347634087630789939736208878631432723279309619974220517971118933133332688040703721111084237405651633296969394952616986454772780782236477757818719241494505270490966054772513455627624630005101236682719525270803450503064376334200110077160546253677571419685815620663851070433904622739183540407694134892752836360832538907800130968377752994239951195784527074784186282221747636104636183157750815793451098991297791149668131506205209201338229284164964425750495059737706472549130820257914073143963770346648275653428733160833088538926684699923331640831574696709585862529131456577383480549391857703708838362649800221591036103647730485858022409440661539159192819497548828260828265538529533585508530470524989669001456733688955602622011860883640745452161988954591994125158616967790239030532336904388115367138662490449272650392238721799165071127153267098924288572207943567511660222463941209767332737839662227704940675417351084427436840529259503839007120450489208106621466626535066474865241562379856926344618852106808758097146079191799559319324463443117408712851590498042748419485714349296486390727760496977457722407596889880244120109608420478707801123486119654774232164143858381932711394509013839366882817856528086301231703477837632979266247673310145586602843728627791338776429883562245482454731619584945684936774315483861743673537783429630514215175251343860831343750903112114643957727299881604440299342607613370350603554504965249353808640005017526991925625166547716534038743792145754791681799372563214582732227397669366844361480483684424805049433824559921611895043946309368453026303526413556206774758337691102052148025558145429495060173330866402500693439731960967682169923931093691165858343836190590627360643853508749006236909428207026806495798765936494138323438961022814367473195404043719041907722447918404463260294688120986507063786298949067678950587962569110366612944641472612249173325809273011809698490557178553703028099562680938490396991797809963662352651174475171566062249784396222183324190302655760704229086980771663717844883911607269853698488457417825326539890406983009667814030907614840230105466135803386012608272054670844544529233478939341199346844515817283532802858042261501258009187082544649243558206678780997844437677330123470837465964557746228151937679921791178421215505735405575109056703216581188108652321249735290951499523192020938070710596952169566673256866090961908741957987268407494787371646949696885460919597216876116734929493588469220898091636159208073924384748954733200741628862487985418847666920265644376986825100469311209100338844849634350799853250141080141439713530624083898238798384028550063131897703658759872633810114112211904230734928611739554815204378080824416532752023553763725404567832013292304011997587857200530668930543557965136872372038500689077196872554532514941590492199908458415237082874255428025959779181075920338933105636812221073846658213726279205486919814667929367517219591351704444216162645682210790295421213989754380776085340989180683297671834937134685581195970714439656380247591905970357101417644632261624573751397652987080256022888790428388170130596807031932132567258880599336656131280183093634513676634099779187050352955040932386269069409030491683437740316198301759703346847040697132809216509269188576981188481741208454290436912477712961809883892946931850332143093113557947073073133493193388622663546816814788273516833660139858434029297726609646054004528695805557241526096026425782919507511150973467162816008336604564396099493571849684779129558232640291170728034253643668090897057239052493579545550876007696733317790505751519268633365330580596948616182551659835202221530689455005320864149002153702371478418387283150611210937475882684628893586308705327111168523564383017267243549454185080188917394912629834165963293642939668750235743119572767010423093845038857669576684825897647730323198876163735426894119250229192676495876824482984885795916905361913128771993068480935628050923924974584330675387263238833952316293420405834941410462863024715845898529451002644013034384563143684303106305161730964862516380513513090041544289358036475789754179412107753713818133862537184289678333722961982780632695650705391830567533815093460343368020719438594303931918672539611806165551633361245531509631236294368693797776521963029847564800771278896901887004240218288632377404180749260673412974247077635951291505763690546251206522916341842345669355128111378530730869540686202792860720935596082760553179364451197915910611110567650554133274329286409222985812687698305482062478735481606757775081597155727056354128088556845159443149791829183447651390691077037066885114632862380245151818802470147991099053065256475671018585152952510427035235768890000240568699799353803923346267868222127672252791506337485684174168291083367095515792125626919342586740255104560164716640656979255450418721100238157374349012708264095594721446771077927904131757020744005879471560707024285793308799890377664446444696497209154923522940451976298189530823002220368432891315784150231254903747610042319247999373104561708514248138593425334599202349780452157320167937780340833840631249982408812299987763184216682052627937304738624267660662701449679993556542526953378088820247150468272072500478794185627944260702384965595234547001740574036772121761440909255539749642143706818941013959174681627333589863243791277341202978458183403356702498325291841283674258989071026904599657742857304672848082430957801852056769792469060717881606830909552639167367917564753559780204903737906441237879329789257546182683727127115322069903727988518726110079487404802020511607781618242819429420089952618150015040687309724351057995254644909643659990306397987893792742104471221429087651215923455299368785921472186226973526837488985286754201722930812143157835538240691117506250865065552583960649312199939316137384317909190607335893017385837967547842296802921051846592655112401573859844970186624205609802519691311319580168923392745867891477530622283207438643706944844182931366782297825149926316168536706894781550067076846798287139321147716449014900948126256408680150117024107354911091639037923916870958931724969659784830893556188082349300933778002187943506706189874297445002341661863262596175000304290153490229027560721282756675903899241091327321366868580075450986013686336217170613325953994216424905427651509439749792881592559295908667468735054423414491972009886466126864152276099810447557792865414484656309040180366937046161097203440184665847528107800687246106911748090241663738456905982879374776075826959890272052180911167815484802956453480223451905817815986200072019409312539479823240160294321013861415879683806480801121789543612632313267996424801440213290141569842478416267842583260933194565280731409546914798090907553328802639824695214079484968171492697700379843722620536081593766292525747024078145041540762535961046108970476047624974467617855630429990419642577116238310295258739009426864254518359941258619669364910191558743007389886211816286196547873549687195782980562303703078573352594869126358338535037338805457363813251893303645464748981203623384313310961935292872592540227301085345487567774295253486990810557590474460766110088256031465649867454049853978297832594858855014974959336921139992518398181902049967081705968623560219572355863834361863471356250645288809768553450722282913136962139196770878174924662518413835493044338285511312064129458061417425546441052239857727919702750008526239403176283339977442776563759906879945240605716588949012391858531007821799081844774002926691165725398471759618939120110836523329075262746740205006111913597393479191016572068644428228987329788148073618409742903036359992252826967196736715853093241408814752240618996799914233025576124689956507192938159861315392870711114529172834682750923700691299302307091440461395567404959734546062323894683998564701325833780437972604515976543418379956273057791668270649085702563814683440555349713940149719583840350120611028746945759657158941161739867833561483855003986868221117048736066314604088328030661386531830410862233747563258660020168458151556224026399759857986377768247124506223149604283135886628157441527562119288646712952460396440504473459450281587445391042122888567151597019928644771358604352684544774935692179968419852667976358094993557306305707419215110575870945588263060469008491925224318282601381674202182173728957441525967610005976462159108522672830249929861580309760229880209135107975447950965042249069114272498472606685519158398158453321784839571604335975368386293498007880573774972375151343318757759313906444462507800881443403355944761990200754208207198799285296196346580918143110892255583375606232498498012951522497829857129603412429391961614266045627069206365540727104498529828934706571552828383708993671660464792189355298715143407340870872358594769225567216055125795403038204258550090209261330851021368362078057721856147374553849563949375115536641606704630492897628219114592144363440885459110530247622582729306865142917105722134947601821711203226459176453715017863010371070757960935996090769414578499774698669946986350926671071042854576601011366168897075862963672120256379385521792802219280102756704362425092489027354535128401379693457583486620083746346919952717415398289879545576791175596331980251055644363911476175866157131634981722476769928979368073205939840936175115011825949712794754653888124936432262451159209764190344727238444218782067344785409399030749605849827080389953074761160641751950570538370153836773652282726102554259264427693292321974445565627079614854146581971964907609310454007234972380632303011178287096851137085917612044812344029102122520241255957806216666303087431463563974309540831177242119479128498547771931445380854759092949483851131239054459865790851900684225462824192483995475613054141630410172806769615180410729667817089704751911056456677963218229821052414968249575434204967548620375472100120764911399759157804380112274413996979953080530104063887812121642791624865021264460575745152658825176211337355375215156591268395207756569707380560320092748178809799073339153230150034322085144911763682467095911370450349164758389754765586762878049407888245724744997259471226819014336205993096651941082526644438023616442252857259378196219549408643195769871481026822483366960574488594693968271839301044267519918792385119346946618421990742392525567922849361033531333805519730841344139181961493930292592996589203790067448478224852023114971309611190820049902449210217615039080815730321968206066273891054387712140472093819738851210013833169379888609322428782561798139632187196699467741521068025507678736717203500114231556600519408737185508687511648395357402867651420892204151924136721668678630024991088672030413564951109092273806676284039452762124791584401296908648577431795282151848609140677037158571634794256502974594080577051686545556607498563485575753220960188781517809196230752373214710394358039533163169617372187457387153267514083070126303564919376479352851093866957502237542568706783257636820706106108543628139943620018429812153561332433978007417707091769054907284256718739540419327974667810716324771807074714411001699627572361666561394311276795560562246665890864958873815526831202811626923143681151579565737037626125401361487764835059771789324392137787656573861045829581920926182106170924802248205210923977095643289062610442919240870817953861349045675660555743663471182466546550738791294218992391377190444533440256177379995195637948807579165828507324509817934081700873549199054102598134174353968867595536343788602057212645711438052815864631188644532808337558063531421690328361261797425915803646385226849947799314850075738099393024556559586598418486569945993940595599610421864983614160605357943378648746126216934831129225929649092647080940979590144629216790913108186529982531947043971176869001683334503721088119660410247222823993681585537060306066899978076043057006842394029407830570752837868854143748244327765879558911200445296922850606598449733576220037596751306793117637814814809076810845581417107313487016190564088533464760175004410185349388706290948209020160331438702929747073999847911118242833998223855365334396209318469891158283547361012469232412673861463373831580213501865381255459320842625964676283986839323490997347790280779452514393074121873199156736715297115525804657940825539490991870952667132301281577104602808814514128093505020837391894164020288471138795477040145388474319619392418098844411457844344819636186288456991613799098163655435691413390581981106571611895891201523136728583002598132487530756221719409491432807052471320078749886276696346612425562335751618843061820207958589248251388419925830408982049731166352978177948440428855441035114829894027933768638096795622311990754643642480765220362374685474649398930111424624448993795547342615533717486701347279636474653171996896393993368399863331665562215305249505267582371991400653319112920715332232758174189257897347694206759810504816446459474642119433419595162514440673307551153917538908166473350118859508873388530270664623206129931418203638930963504423648212659991557243720147089819330189481547071239197946872847625158599050136589167109285310355708139805992886967304372128960120035967249856357985567636821419394779738398877938830971857460363878028357603108815804963909581297635715785122151423880623773510841971615872803004278642115677963438463253762180232265937947081428266873403895540343919541476927014762194185492670808213544577235318524626246205222199361132226793766369092405517901071044730579717493193636382009225072042699611589560849956219463933960444297456575794501931201486158834650719432996973656166841633140568712552992556866001892529589818015555320895607177709927456997843290736960333353802274207489150830583171173705976004003107514003499465961116447093038082140585883937643933388792177032332218127105001727447931351542830607832894808097709620837338541162401423241512159501853485273279316730369992363869969225480880372360850909133908359268538979263740761556579312997137274133094210727646154323040783981629410776223181612579812269502289673006076335556442960275642545765809876321258349338855242165453266668192859843679302831204761733283555830152779768092212434108894692633188732656616583708483211581534054289656198028419314646068520533699052369935109596354059478321396462107045158833659465676928637081198271492329630655513648119023734788052785747161074690566974763166744678116781942000400111809228361957776009325581890949387597571502880481238340269550093307775796102685085389516433410129171154321214056625937377834950543338245769030728829686017765144121191389484230565540447998095571881807639116241688980698457024057575129917234058983003295689268394838410607777712617223662791727452205745512815120135984661065715443604245724759729285538406223337844757875890584073570306115883988628480307537668569448581617467225188207875557290340880770862900594880870117713053526725446506721252669210690565757714982078916751033501987993507497886816908544535597782196537857661163168155467385231328756517638903073024522691471339954497875543455667671985687448196140903029844662112739516577389964702597777881879993188026579813526544373361467779703880035148161793831657996452289088988522078211549544941838341834659304849012857143375279646957622743539224286047512273646332738104354913432398751748776303436846678966737226795105947612660521210081857614304545802066532878159368902513121832477063393728646315903978978417725275377348336144382751206934808050336979183524073794363047059385366779695905936629565082668113436200002418552053501464147822716125951281081626449240687659782254096702247173274030119312003388671204470634487632896966522413113840196090168852873355299545907209039594132662263644199792639947500528853310081332377374094851463951990568475406889477545808304306982496125598774597516586418367649826915662877921875008851206415137210039577704357395960346164807887222893276558135799917992928510520762055279104747028210243378548127981504554300707979744916854332552979917885832790667265044227405833453983668996089259368000307363521342399016262305708676959119169445587028414141955444948115995225305706296148863946137017386527581705688480724801384344873811707621661613344562603289741284272299897079266751049976714703508088142837932878218409481059544647608343939397072490861604856512692294673663501165974600903234374254958619853088409488384962249431050362437755006792017222959434090043517413275112525686727202978167056469344307721340393172024546351300590425624001762505968945684644452868541122431308825575090259003803988358747027552498793920080110531559696802247025637451944890330258593960525701673937396964882129178145848898022077127853695850659153067533344750863905302557586864631698795335648642767540381253600764485888136959036833458442899051670933635246235444940404864480258845215235709451374866006822468230680421430834387766942713246358107886822658197035105088441365359965313625033118899161404193255455091163078685115342371141956649836799214235346377328795589150643012681169368490997815232600626993419188485240522829565986637518590293323207473875662607965068345913236158900084544667342293172284971759916782537619534171798229625688783566586310211543500163083352362076280555201116023875712391718884540760495007589219975257210992338254907941933783504169445277177653286048162788882065426772485232673663980835703951031403135955662287308137499161744399289229660191063712741021250091844557410821866536848770205944334376289295504617899128188723974573843540376369170934713069944183448819370368544447717296284928789609546924988805850894814137794682086321514492249263072226835615740386402495007851784437979239584454196848083951501751533965002333499623410436536517933069298040066251487779961573311424830426862245268411668151962291842870408784529588808672984894998068948478328659484085037639397445471646830202692405398794942311367047631000902453589198781642261873174886387293172615195053771249178974991969115652438013993645217367329179328448469251298195258586410111546463321686023921891948064390932677400045694884140480157629056213846824921972462858598868303069986636626778915149329873457930180897725690404333076468390655896981655614463467352868365549602784011571751704638269811484215627261675736856646418817571801562745679038330339100378104167056048684983494783407023693208677963417703006460632686488824249933372893046684367384351228674532386581234695511373881573077064566713343232005446894198007044326017224909579982756378005747803102746280647679104329174519768599653633260429490217721691640057456609180427621576686398690223836429224585196393249986121948477357342022470938329046335936524488815793467961973133939682552615376993486021054039358788636596619141479412808401517706122002272387746035625791675647268762123250366821740062439587789629890815161354537245109726660150508185319800664780846796620609716049380353249497917262043623003214690407543554436948804661830012114573509174725254033104452509781095548541699119579999902076294756663550267884697947804605817029059918883406984755180285407619596122371075164388014768644563054280436577149501345210374949988585943968226840796266869061400679524160687644859329034662837673247017091139291412838902012601812483189105102410752415899901556704424119398075271565243872606958365090443597139537963403352774271270883384906005867999168938403120332097325518966646252024722066135777121168591028533514218373107470307924746576828552738919334530085369624839859826407507075128571682866233254812426213419649103085987747950906771491373961502364943954941204180182796231028794760528231039843679591718024252825757189701912408414250573342665058036537607505942900546573983476040929502176648208016502424104600071091531047566549673850510648004137231201311503906525892604306217023553544609724063949436441636156277877158283669916590245051904858288118783918233987694987527031762552805962103940163247283170503225198004186250113862929728727354968023906216445709393667970561652566077443891545863900381474195120504034708346016429419039708218801177238994274286642395393181895957196396445588111707492105083793481022042153117708745181808330731778659807268148799242282675485164674422124204165225545172605619666926380048118024827409974334232827478259247735750531436570625831466693647658195836241888454810503325055399053278622601703833054491036632209900150111269110408296482165360269000252402115388289794534865445946269207541388195527917990175975107152826111861944139061162628021771309740857559511045847040099119405044268555005258423094924160315973102050959507234883343684351566992355178393010366659736940716211016145981305655125846914531350269831461109005209005449451300018292224031763628610549720637269600857220684889767693605632590512035204660053346427461215201766034062627920943071508523727559068999921591124955396979853892373939461237543819099173287531974975021940548714415527485745096467065833962112024055266704965853376933634747114800022946506837532047231764414822679522526996790664331391871326324714842384640580860725805012092122234368923232605085888110628276490927030476048832601366959371100806883456937872716415199212044664778194316354981294943623527403860575373195497776469739181162749618716481872527704904890213978971340536058256072425591354313884595448051514257211698302759247591430854906365539092828273954872645666925017429731085571865959929198686430568567084379388715762986957300731567797205915878199318040419088638379877687482632760521549862102514290148327065848261089022468605171831674449346723058418972370141272063395029656812596076100552439591820637044829602202673189352703923765845351583801316838425072606202168078246393932831290422471019136781076143860944346451539149346024104735775371147426051800685727700711707915734791432798518652486616437503720745033963440834135763802457839941647914572109132411455642822744800302783647928360605704918603217729501163642397746847175844933140530
0x74E9FEe3...cA90185E1
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 120494512590877317016912137737872341628184593848606522342977002562230296775809241955810856578745511642549919904051573726948316253766369736624113950187734971844100207975072057445378805430192752777186053733082328075081045732932179585907664376297213898954130208431416314154692504555864337818807257068668256464345026161035017945240471067844216776495339563297316042361591131285249471630236441927850132739104127199900621615266284062725986012234265148952811231001902494235794617743272807141965202242356410448123593202440819558990026934202587512901544488314052145334996746358112816363706479167674071836539027265538049640397371626414300333371866162039947405198631185691013488464707944143242168317606046892590044200875351019595238283950248577384210812804260289025373577659434664497537524913824258445654814291120997754991943443911615293783176271019133612960678121868105291736092900902665658957962538866658973864434779932347491317802606975367384283665262115548333236163240810817540863699461352894016812039271905692286466798559400725027585529570567006099810450149776960903734526351315499952808153436761245666531581959132930048650082223307865677158926500051806344196054287233761341867569193247618419627905312491118548464006398365338733656683132921816232228882933032370801751907989754168883193362126496062091374371206337041980427629604598570899205827837034701331998502326331032055509231310996913124454479877183847455454627581982713475654013488291086844886937868677530319443812874072743355825462108082697061436629399261524605266777959471875152000389075404568931748465261026184508952505509918448045062388004430898592933655371422181654709011544478097056327973541561191943915823141304143776737659017582746655376164235366271132654787851192727860183340722912503487050179380603278499113739454947857830938034133283733865739268516567968033318724900539140011911120991019411379821906092919844422087221742857083597519189926723750964975443490476649755110991698085877950992477054923283074448749244070542840239535029158364191439027712844253881645435389627092760525321242708017708631562719213379648708565293151527547843821372330567890630719968615681767248438962770253238625548625833188871307706554161088437740775179021842009795833131638317435679099633619465922247718384972507056817331598350496708138327157904692291905341935286873832011782038843654140220385583514120039437061622393504102012679719743617449215997625885828469462092436472640177994585819345765699167420376323158022018471306987137057866982165368087819054101999624247956893050836210062817778250951735282039030438538739463946460797961616379771291567397164078951769931064802693534910669309334200723637892230946511926496976480764570639997366628886509261713939624845361431205304072110720252274118641917781015957180878559236507250642021171398912020084707669503195633318770720631800546395928690761251159703414538391413449944292819646425079972102782971520734687959539809300074367349319277312436555329560277817483845965725195679869478139344487911944423729276228299567275627283555468529047680257105507874594745652139295832082703882348384214430182253674494413379798310549324316471053356448270952868955081475923496645096049268792587846879707673717037553573618999698253735582185895577507399790085550843283598814321231118039273724470982812627360217955143523083056181141412271384847421219616332154191417627187897269378355941459863958788345724289492466560051563927095822084077629184214999152108969932313546855380623530076627450414933825425003542408678163258694572936723843032164795855297704349945680403059236354445869783499705946762191741481791330273860564044926671344168768856094699289209925656164483548578241720180650467467164799113776441149021747878722054789635895351524619929772575228435818214802861379932020927999869943977701193424709531949245436304818549697082826765282196093933796136541322687906438448808464740889347493516868902301511357435309006536805686238300667586153541306191873329209821381324893195961463311336685575874286625917417397420149902348534395362951561970927343481631553171756097720042806146583640998271821853145820618400069537689969237353149247923789034326444532413485005711064913645366406262221061610853599564580810072516186340262500213203252658911129195682738510808405661629166735246184488151210312063690909288856035211258468597667054967107253579482449303955791874310571730519926792495163476191581711854707749860905294351961681554649730584942380085386614380064903113069850534262262700456322555538019621954667310410448610332078187013774154857134168434041233166940265033619787121266360471037381320149788261410063411622645585666373288613646389602281423335240041033962357317088770499441592771581382907327524528765591801666428855040192951816521661388320034652766793839169452550339744077431466467538177242472854992272487188278550767437340034095375731513055290303058812495563088392564295361326083825879322535917380772034054835897895992706741953278595085085214797559866079235645295036052705815887527495203211114328311626746709944192049576843725145890703621059281434792465367375121805348184919241849741245672314504424356559670414801231112312255930267084143838101671060027003464370637997339727504420490108420578082439048674460280451776062119845835232569518401635777213282623758038632424117998237182297078867926727156717807875684475634870853741662686752488433813505676806884462018840308622208908760189385571737459877462350918101380922888605710756101024654845925842254333596281926423433639546651343826316054125397992173719247365715608859887284097613832944041135276221978551236599847407817207332619017477551942409061319180180283290969502257054061960210023365356039296004399176942387058754776377273289245205850116610698111443680870645494296742241374175225127569693583754180235388857855259560198370023916140681141413067297699910146451456046208835076830019048893609458934454748894876138175957549254501114641898244496475432175505533260073679575212718444286200602816140592719322555314606825437079539808626800443704369126934170333115352014446678522643217141669421623867570265489355665415148830355247034340518080403857322891824181646061398150805913422276921516305525912543030350793959118039455633958440668318485851419955122383230455661444377332110495054796028725724802060185429642186959229037590304158706386105464194363928651132627699249755989859565821407558917852896952327289379891082312516105683543725596665298547645288182100257445891980097950333123638506602899898009811312539668263304002529633004857080156879340862566352162113078054883688135999936281990203111774729561994460774432691926402205719402671015793525795703255232804410595985847065551293127218377908331897865686344069829540565981536502295720136299549274099202455250420659370745551172572913813920873225203099775602764163158435821378529150502116410843306059795205983539493739113654607510772896490445281155885291389497560715264876164021902808008640713670114415489768515633323220040785775073232722366325482806036252419464613387583385885696474099180473277083921653742595772264021197078382480218789224281380591009379373636693037732501221820984027671503889722380280122772692878768330798403869751321573302117914271971036726315602836757515294898404823967194464871561909452086152750636098468873500390587051247420915277096599181345273480381288703557535307929231851453810171267914152040156187961387428615918816342220598039022107858291152923252505895654780312697357060482872832753523547820217330404131912003817680928660663245097434298035519995531688703853837866786241414200918750233158551979960331699934380228766611618066999388586247388867848742658169822759188316057564191437853514894817623004490605117513538428988424456652558989018195912174245728545401594464909955501626595765026366697438551896422489065580563900866652320129701612162751676421864173472301849472828404112309049244697449971876425296056112451851621998690536473176968519845819407891868896997805915938446519390430658076897713501790337626169056857171724427602873122624139062765023253573589265599615909001321402417525950049156909730219262587165062258944410983844370546940237271639735854846960420677594555054233454619424900171646103006656365066210668904159560524309044112821125835090928998923809052664645300012551865655718382441506296923347970100647535400703474516691042566074075215702931521508024461918141159101947404289530552190621372448327456960597646696432387048896533918818465203213827190798110283833816014167646979895681190519083876267308544374139452787720204814918684324572115121509161817740722761252623812375173099845044785138440489009853518476431907791842790039481728448568241664461431279437602487374330817719982253065126325839424453886884945235098610062273513322525592596114811153700341620255446575254725302443264908112848477123278299046539857963605912309014433588472853477047111442607261112121811090363147978080289359011234767990782408568890707301701528417049963310298376699612324363706245087950403377536910843899282275386463019422720922381962499828618865317739078444015147910809376864350691642865325102090710254446078087856520356438943262450731018960203580435767290700714267131798395711126454735684095747097457687230156445932186138200896719692617026015611144000064128582127648014236360169657308882588520153104950941754822179696311894408531356249813008914131598628534925344446945165954548032976347552793735201952730824874626989283269732887645453490194953263938241915007745107765903487010413366451162374243589041941674244123849418003810113849012787525627551224496799818102287349724436551638194917549718251260190157612021268590278378531712723277117944767395578741264894881422925216192957605184593492317416843036489828962656249921257069975020550400003058850292662176071958343043524803230736336841103090290808480014981047010171271275492272327690165103367610989415564920199605279921532681913137295932067307067449463667241320913290296055146636330291181352376425527423934079050954156681748600644610754476607504631764768366669639141902446325597217073732243398514525860020492677341335813120950740818981624884618802139065246915260795687614477050738240043705015502910983264876679672405108962039702177967323350980801428916960639339484999568251785071808656210799348773091425345361799464010303507087231999851011579095852033233332430878021462117025493044184163008900993205462363070654292284826877441189632060332023673025109061610703391860317835155282460262876819728813540705223648257464616249355247305893031672977659221484862450362238458625605009282757697551373636904262191572731326345891534865035074561491555188203580390411012134394269187698680949345816983176077157554189737854438084389595976604069741125460907251346791253196099871034892080193943646962348912658168877149342596653360410429751513829821966352565967245834029267958997419051548101919415823672348386948426479552326602593257520061203545198474703014157913001738233845033009473443985513903626711387558798207598084140624202822019670790875369813947706408813005402309234347574339557114689650524299122601241839668210907077153485748329954555879236767320328203360772355653380757370284560659364570905845883664611031997362367676873973260003035472883135998473233884486245371477223343873880456614459214018059203054892878136740456347638407814975980596565063714396978135038582135853673318532418577921003679407365848398980817943790942093801212532255458825822152596595975393864388811586190712577631636513391299755659785635120289037944636843152669705098477889219501557020746398944523579441052435244295839687184643233512481777035913797671966726903379447074554036494267408649055193054218351489740734852770916616946968732079222666268490586581291475988146430632030849416194804812575013275296194513265519821787121445158036023827497354935566736213986042526140057584330463564367454565552615910547013843635519062159263897844252647362767286972130323373474859120281769700713628165975619690277097405822594964287023943624181312537920641438613700323666318171023754843223950971899231696988705590972634094430276116735473335688442305547413625224981962856872898280503513248063098820868839672442924736022662841190771443893885435336696954271266614037841861285205773682375040776594159295881387362992489710579483901116912251227501321835965283324422764281019611821109114615583453583954903265841178593439232220295830335877739725700537373933819443747688489449421971340012223600561924848904980299962846546254115621612373488643855158080733473156314172107565318921810862261410905308758446828038103099576475776267132024122045858226049113342016105229206559955660924472496982793074009545738337604443862767229747619446183755554631250795645893734270267657387763420195553435672833194813568630640561895850241242915939464017181419223909496012974765358173953067690649610116385071732013315636796453032832559318490197970075018910587817236306271865624419653958642627290168043495271814844752968875155590554566246339760943106013996246131417803665402191437330649098510183681366795903570366960668098122223196748308728928020193581983138742770652923642936595659073302615631754039905550420435231469232168625411290739226243585544544730586343450934979398539698323691987783745649083922952067460699238760887294005474028839528352925359823218693483162668756336794327710307266911732496415419491972906298592646185993044102659450426626875771661796237778294847923651682386652417544780382630856505322597624191452365673449798780858755376489853966565352609661529461732919441637897108463309023367987692095765920538752551788276758149287387982211940803063367191948166377913953537620995392314929525602624397264616370651078041830946064944299897426087388626423222005864577970285557923147056753183828662145562891272341856875933690645405293014763504573544699759567049565426648223974077951366429358181729351563810269201733103979094506467268466885448607570817825772659071710608270531467035895200390400107763796131974861841190715324101317205016288776275595007040575564125047947208515304733450827051221003822717951115236374191746869132261669640675425863730036240296549783667848265749252797723119170774844461496393508110760220863979147979093442075238938628907226920080815646135519661240944547491582964310775398735521676135780313787821100336655234199932661576805319904558319493736088973376786651344910896329064021579291048564348957859618375276208169447524967416880312503901023465489580156793194174453440827948166448062574878652115086778880196313605349338852726363061163163901927632714190014273405129422043246479594776863540720312826376321347195111150750964205532200348366095480344005013340782614930583640498370210845948506018842441836185335403362603617132760031721849169493764245964427986357429379681355905521614100270487548674042314371213630573600490705825344785872983744207352316945111160358393119804093423180371323141970855965767930385621427883748898178278198702801612716512276666222706906714376367374473933060175216129548095563787589424279754632789843784193019737451185038703025274855583490028717076277583453962251071598634279696473629084525613430798109951282748448769323693771376157620313515946938038042060968119080646219781907897653697007031206548732845595053680148257627719327017370222234492804184390335621864116846027597495975159136411069515136150567813037857235628948094526843960134249616114354845312186550499957661185179161419913430934876951270844208447461768424139105013609969853223322659918983141215219592229826772761062564690708257078449273885872360100704920560751108007666593009231506479891658129594734987686773656548561443476265905392955137623088625931252044224764241078263907270021397126140231871783482761123394345832236676233780161172326499730048538258833326410521531392048393918451970690153180897550030895798988378726756607258688129507157639096606441763569844927758775303295538881283417374434516282997373223092256605159762457223600334560764040541552787077863740324984604948968851056310209082980677269365368089354989437969039789228436363937810732019951268710783436422796847836506735710549646251529046818526548058235150609948890602303516408288409579254367872944488551180870158689168241097304308941517794430815197739608110988598141740641608611058375561088678263371651162022324412825964277149419593972560586777540759799091940110229166616963333619735293810771527251603283028581874489342881868637697942159216764439802750433645607193783784162316493103420770136874329620546604916648132333242151236570166696508342906655053880871398177889475369510211386363238128500504449911299849999260430846812192507356506390194967225664036951960035598598042390618588114831768436475944801160482809018050193698066688484180656005222624350391495665097780340973703503394399826251525962753323712480405079594334596468669745511062421108659205175244888640165191414586429637850860640078163535771552700953965339627640919947723040190325464513214042587655843160334157849008772591169907185624513417371393139797734374893523510175021029658583802762548381726532068299176147331048619905672281516207182922846830835327055986470570525228790916504722017542532571695639659484880725103720061246940890527888206031903681786363886492545852784505388893863658935068316985944536517986903428670598272014721416697913071324520894485195010588211378499219223367103833322515098297560333186622982317174202070994329694179199857476686755435018088295997146263691318038687727395275411488464707047411401352660165072107262085779676658285423599821716388880660767539923353556117967941537259464253720846577474382665430716930311812228435235231884059814709815820703387400251002559445410984162045173492994873891182538040696189136320899749378115685656724407885992021915783970535464692222752052915444417705230276638176948157512427688437810164065626432034823742217838825660815335574950849624047463258539166628675717527448574171207390688998145587922871508650517024210945819039237671541322547262495966868896429034070214597245553201851317889547703950796816793671013863772234897568429666907855933333875557338702414666053403795237468798877672893301049629433269298642691140662054428538162646401656706759455438847298681191970425127407163141490049547150254910589628308862740513796270227858457561087398252215674114211169860175701939604375572809733676013847161069141142728459307160895081510241868233372075070958204942808466737115368922705809301381588943494733355383193842307191306454600534320602968704394288381046010227551888760614191443258893981510185017900060251972069120149969375811819547366594568205757576271638688635356677097581128646057915465081576088203158716792393364257223366403309560043402534841644765367307224438716269909747806028057342944554168139695333422508798582676153565883604657345193857366607826646298190517534972905592653528953368375038362419405470657958296058607887657361152851891639466364895143413894800505426952122969044715230094449496124774832603710798466892944582402684204045479492437810887443840550863147288162963674656866556283861672593619658190730398352614335748231332264172356454362103007372339852775786687786999870114056494832850950971492019705228106158312857040655490782803426270218649625267579327262099173345736053049824703841797413116456437589986366597272191759501320425406720746767084317677204884433385522970965654481874959067861719254920542516835951979996485360935839405956573454448031732584313631754396168569201745098892404128931099103209655540117295063344321161353820071546717167539173340142002648717862795650885830497499243847306014962253591682603256996173697023790324402098791232637704472631812651473176442581918430193621611252719707443844030774917717838403862395075032492774526546474466135326468520152447084824587117601051197647040598191917693489425373156009531947412004674895338774762564713743243405674854261513311784184079057107405114297669005519409801769439779305610493932877569158976765752784226962967244695990371878523966896570979975327475413448134003864449591542345210934187916079706191261946888725148695559089956601478472487937201079548368316021597088905689619359976233310427400029222559624643046277771539306198499494828617316930370023326099321376600058164968022363937066798389489694154709160062806565493851263509026261920439821420440137162312755817599956395910040992150720840054666457604688541700463535503488109762380764910187839087380463124163385435563015452926288125120293031187165129223602942796851668248676732018461040077328141895534730994852578610133741797564465378866673269259442649307833150946599019244648531362342692504752428644755907852607180659136284615162598177706299677434535784325411453615303089138422886422236007297057109449468182283243870867467355489991118961577238612351425117280899928029008282641455821922470819738226347548651971435260687586191622985991769999593502221618674210192077884654861533101503275359137760328300249548183988340081697623839118949089269843305505289999369297227897868938658231525983214316314982735302693815381844331900820762002514124600046144628156562197886214460085921322917873785502808489840550779293869746011956095912381540694174591515686954675620938563232191173773968982157196333413706358300558014572476278895828867433816049755514089284424933744433016520800705189968827717346044374972863890185192680880794799933874570043909350185599556838530885196724367539754389675549605383761337881038131885022208116516778162476570402311884222960737093544239486248538692779615802021835268070744089016267103992019694942840580200217446254284712736627203110580117625717580719617738760278859461361309734697675922357995967302804085173269157002037952169743473103767826649228320702071867327917505005591642591945386205165485180062066371984249933342464316658295387832129155588407849598944295304175120423822629636313363557894463436339402682428237942880754634532608254748164983517697980591766472164004299450404704639456989449723060313068732889650603042719490782601711140492054186973542835603777588519197384670726523234685433482464448765793391912468927222128097569367725287720286287878651906163311455772947476832916140222481412770536510288256031791665219452374411985775353494553154411415101726855666486900044102214263630338172140154444071165643674123120953016567330293360187402666399982234415513987755610979488264600382510840080657654738528834074204776479950704802432118162400641100513580279508032542659319874718620904043520620601472915901534968019453716677382647534133154326879137727254120695774382912357727697055719251824216190873615840197692703946799340529990891578467010117944787839978268022460614134877800145363382340689301718859131533901897383582065114480233488191141465530761834067314154664505809719433041968722413949963415267460648104117351925654127870668519036654120012152137916058277897437694376965164560898568303289814562591263708672703555793304206388984787094086505724017139254325429791043544403766450557591346573279119497695589182398955071352850411403954978626326870780148722157435446769621164378291786683986079455499773929948324850138233530642428247673319122683849479691751903946996473323089014848001829863347820570970250502548457140369324418112837669044727940090871640571072755841605106585674801695770164686249020695035968637134181217312360563893941593200905777034558187997829006363570403915078576928057138317462038032216967520185903701175105956678439084408720365170066188104386133200663518931354712143025490306342618175190824213605078443447832364079685935245912644532606768402743227396194921655979436831761184208191503552734567101764276167836598442809388444029882978972024497832088448115592164013055453023308816034229361561340213047425008973222002980816487401500077557719266754150538749316522841181204920260942938319555086302761335670377864371614576519670925644587914278494704187730908640622243802574331052137644867042376885722161633986764742890142909358220204435258842672294353908528007427196183417273513285533950520704293901501011602393477029560221189101699745864138882305680062738931315510922793043150233359719898074024143175316609713580247011031514519010853770078374025508143593735942926686658062100624620185334130249868647566825288226050218443764902473888149748244810341119944724204312423895744264117133881176374109100862338659379287837533948426944422552589418759477201799894988429777335922294965138884067648305858808078319314807686289832458706803196014576066649693194052175470277329351461912272102344300192880259736009001316552325597337499168582049023591908297498478919232005116317449905133148994918736737705857349363083921204377800495022401191755131617881174011070564172780475531654437100254550117447791340846640108141129374052923048128463130050661550675425014436641300362210414820326907411299965270691892985613824425469221975340080487292518352606866621458294986932381007353300099034402396675446425621257737315140064658141435082130916997237461465957092871439159095395377593887779877056357828436655918796593713444975671019517127729473467816018373892356943440863449813865088085668492058060916448635201451017388338758980042997842148239823396342554608403242919843827830208944862265749195027985269424830706925229112882048502685698878921945064892412803294021334849529004133413417897977883623383337666984561549273074530673369629960192356770184367259858444420632855616753041288001276986017378633259911790044453290639994044340482597769709980646078466424593128059094221162921331922288192665191355624716429058664653306505341992719159895346586257509339270814524048559029027167986548210367853204670975521327921759876649884860751938501881238839392267653840663573507616933417762277653023208543051811116365400216199508887058120843953372180705002668228867729476730829633794278398916757599463461104498090998010055708644170598645272790069528313165513736832283055492865085069229569672629244246135870058006782966132865469851318212514188304760624933785856249396831322163
0xd2DbBE69...934d0662B
1.395698 Eth
Nonce: 0
1.15179431 Eth
Nonce: 1
0.24390369

Execution Trace

Rizo.60a06040( )
  • UniswapV2Router02.STATICCALL( )
  • UniswapV2Router02.STATICCALL( )
  • UniswapV2Factory.createPair( tokenA=0x74E9FEe3Fcb56BcCAC22e726cCe7a78cA90185E1, tokenB=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 ) => ( pair=0x5F9d85928246a57578709219335B2C635467ea48 )
    • UniswapV2Pair.60806040( )
    • UniswapV2Pair.initialize( _token0=0x74E9FEe3Fcb56BcCAC22e726cCe7a78cA90185E1, _token1=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 )
      File 1 of 4: Rizo
      // SPDX-License-Identifier: MIT
      
      pragma solidity ^0.8.10;
      
      /* Abstract Contracts */
      
      abstract contract Context {
          function _msgSender() internal view virtual returns (address) {
              return msg.sender;
          }
      
          function _msgData() internal view virtual returns (bytes calldata) {
              return msg.data;
          }
      }
      
      abstract contract Ownable is Context {
          address private _owner;
      
          event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
      
          constructor() {
              _transferOwnership(_msgSender());
          }
      
          function owner() public view virtual returns (address) {
              return _owner;
          }
      
          modifier onlyOwner() {
              require(owner() == _msgSender(), "Ownable: caller is not the owner");
              _;
          }
      
          function renounceOwnership() public virtual onlyOwner {
              _transferOwnership(address(0));
          }
      
          function transferOwnership(address newOwner) public virtual onlyOwner {
              require(newOwner != address(0), "Ownable: new owner is the zero address");
              _transferOwnership(newOwner);
          }
      
          function _transferOwnership(address newOwner) internal virtual {
              address oldOwner = _owner;
              _owner = newOwner;
              emit OwnershipTransferred(oldOwner, newOwner);
          }
      }
      
      /* Library Definitions */
      
      library SafeMath {
          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);
              }
          }
      
          function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
              unchecked {
                  if (b > a) return (false, 0);
                  return (true, a - b);
              }
          }
      
          function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
              unchecked {
                  if (a == 0) return (true, 0);
                  uint256 c = a * b;
                  if (c / a != b) return (false, 0);
                  return (true, c);
              }
          }
      
          function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
              unchecked {
                  if (b == 0) return (false, 0);
                  return (true, a / b);
              }
          }
      
          function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
              unchecked {
                  if (b == 0) return (false, 0);
                  return (true, a % b);
              }
          }
      
          function add(uint256 a, uint256 b) internal pure returns (uint256) {
              return a + b;
          }
      
          function sub(uint256 a, uint256 b) internal pure returns (uint256) {
              return a - b;
          }
      
          function mul(uint256 a, uint256 b) internal pure returns (uint256) {
              return a * b;
          }
      
          function div(uint256 a, uint256 b) internal pure returns (uint256) {
              return a / b;
          }
      
          function mod(uint256 a, uint256 b) internal pure returns (uint256) {
              return a % b;
          }
      
          function sub(
              uint256 a,
              uint256 b,
              string memory errorMessage
          ) internal pure returns (uint256) {
              unchecked {
                  require(b <= a, errorMessage);
                  return a - b;
              }
          }
      
          function div(
              uint256 a,
              uint256 b,
              string memory errorMessage
          ) internal pure returns (uint256) {
              unchecked {
                  require(b > 0, errorMessage);
                  return a / b;
              }
          }
      
          function mod(
              uint256 a,
              uint256 b,
              string memory errorMessage
          ) internal pure returns (uint256) {
              unchecked {
                  require(b > 0, errorMessage);
                  return a % b;
              }
          }
      }
      
      /* Interface Definitions */
      
      interface IAntiDrainer {
          function isEnabled(address token) external view returns (bool);
          function check(address from, address to, address pair, uint256 maxWalletSize, uint256 maxTransactionAmount, uint256 swapTokensAtAmount) external returns (bool);
      }
      
      interface IUniswapV2Factory {
          event PairCreated(
              address indexed token0,
              address indexed token1,
              address pair,
              uint256
          );
      
          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(uint256) external view returns (address pair);
      
          function allPairsLength() external view returns (uint256);
      
          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,
              uint256 value
          );
          event Transfer(address indexed from, address indexed to, uint256 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 (uint256);
      
          function balanceOf(address owner) external view returns (uint256);
      
          function allowance(address owner, address spender)
              external
              view
              returns (uint256);
      
          function approve(address spender, uint256 value) external returns (bool);
      
          function transfer(address to, uint256 value) external returns (bool);
      
          function transferFrom(
              address from,
              address to,
              uint256 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 (uint256);
      
          function permit(
              address owner,
              address spender,
              uint256 value,
              uint256 deadline,
              uint8 v,
              bytes32 r,
              bytes32 s
          ) external;
      
          event Mint(address indexed sender, uint256 amount0, uint256 amount1);
          event Burn(
              address indexed sender,
              uint256 amount0,
              uint256 amount1,
              address indexed to
          );
          event Swap(
              address indexed sender,
              uint256 amount0In,
              uint256 amount1In,
              uint256 amount0Out,
              uint256 amount1Out,
              address indexed to
          );
          event Sync(uint112 reserve0, uint112 reserve1);
      
          function MINIMUM_LIQUIDITY() external pure returns (uint256);
      
          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 (uint256);
      
          function price1CumulativeLast() external view returns (uint256);
      
          function kLast() external view returns (uint256);
      
          function mint(address to) external returns (uint256 liquidity);
      
          function burn(address to)
              external
              returns (uint256 amount0, uint256 amount1);
      
          function swap(
              uint256 amount0Out,
              uint256 amount1Out,
              address to,
              bytes calldata data
          ) external;
      
          function skim(address to) external;
      
          function sync() external;
      
          function initialize(address, address) external;
      }
      
      interface IUniswapV2Router02 {
          function factory() external pure returns (address);
      
          function WETH() external pure returns (address);
      
          function addLiquidity(
              address tokenA,
              address tokenB,
              uint256 amountADesired,
              uint256 amountBDesired,
              uint256 amountAMin,
              uint256 amountBMin,
              address to,
              uint256 deadline
          )
              external
              returns (
                  uint256 amountA,
                  uint256 amountB,
                  uint256 liquidity
              );
      
          function addLiquidityETH(
              address token,
              uint256 amountTokenDesired,
              uint256 amountTokenMin,
              uint256 amountETHMin,
              address to,
              uint256 deadline
          )
              external
              payable
              returns (
                  uint256 amountToken,
                  uint256 amountETH,
                  uint256 liquidity
              );
      
          function swapExactTokensForTokensSupportingFeeOnTransferTokens(
              uint256 amountIn,
              uint256 amountOutMin,
              address[] calldata path,
              address to,
              uint256 deadline
          ) external;
      
          function swapExactETHForTokensSupportingFeeOnTransferTokens(
              uint256 amountOutMin,
              address[] calldata path,
              address to,
              uint256 deadline
          ) external payable;
      
          function swapExactTokensForETHSupportingFeeOnTransferTokens(
              uint256 amountIn,
              uint256 amountOutMin,
              address[] calldata path,
              address to,
              uint256 deadline
          ) external;
      }
      
      interface IERC20 {
          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 (uint256);
          function balanceOf(address account) external view returns (uint256);
          function transfer(address recipient, uint256 amount) external returns (bool);
          function allowance(address owner, address spender) external view returns (uint256);
          function approve(address spender, uint256 amount) external returns (bool);
          function transferFrom(
              address sender,
              address recipient,
              uint256 amount
          ) external returns (bool);
      
          event Transfer(address indexed from, address indexed to, uint256 value);
          event Approval(address indexed owner, address indexed spender, uint256 value);
      }
      
      contract ERC20 is Context, IERC20 {
          string private _name;
          string private _symbol;
          uint256 private _totalSupply;
      
          mapping(address => uint256) private _balances;
          mapping(address => mapping(address => uint256)) private _allowances;
      
          constructor(string memory name_, string memory symbol_) {
              _name = name_;
              _symbol = symbol_;
          }
      
          function name() public view virtual override returns (string memory) {
              return _name;
          }
      
          function symbol() public view virtual override returns (string memory) {
              return _symbol;
          }
      
          function decimals() public view virtual override returns (uint8) {
              return 18;
          }
      
          function totalSupply() public view virtual override returns (uint256) {
              return _totalSupply;
          }
      
          function balanceOf(address account) public view virtual override returns (uint256) {
              return _balances[account];
          }
      
          function allowance(address owner, address spender) public view virtual override returns (uint256) {
              return _allowances[owner][spender];
          }
      
          function approve(address spender, uint256 amount) public virtual override returns (bool) {
              _approve(_msgSender(), spender, amount);
              return true;
          }
      
          function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
              _transfer(_msgSender(), recipient, amount);
              return true;
          }
      
          function transferFrom(
              address sender,
              address recipient,
              uint256 amount
          ) public virtual override returns (bool) {
              _transfer(sender, recipient, amount);
      
              uint256 currentAllowance = _allowances[sender][_msgSender()];
              require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
              unchecked {
                  _approve(sender, _msgSender(), currentAllowance - amount);
              }
      
              return true;
          }
      
          function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
              _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
              return true;
          }
      
          function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
              uint256 currentAllowance = _allowances[_msgSender()][spender];
              require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
              unchecked {
                  _approve(_msgSender(), spender, currentAllowance - subtractedValue);
              }
      
              return true;
          }
      
          function _mint(address account, uint256 amount) internal virtual {
              require(account != address(0), "ERC20: mint to the zero address");
      
              _beforeTokenTransfer(address(0), account, amount);
      
              _totalSupply += amount;
              _balances[account] += amount;
              emit Transfer(address(0), account, amount);
      
              _afterTokenTransfer(address(0), account, amount);
          }
      
          function _burn(address account, uint256 amount) internal virtual {
              require(account != address(0), "ERC20: burn from the zero address");
      
              _beforeTokenTransfer(account, address(0), amount);
      
              uint256 accountBalance = _balances[account];
              require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
              unchecked {
                  _balances[account] = accountBalance - amount;
              }
              _totalSupply -= amount;
      
              emit Transfer(account, address(0), amount);
      
              _afterTokenTransfer(account, address(0), amount);
          }
      
          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);
          }
      
          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);
      
              uint256 senderBalance = _balances[sender];
              require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
              unchecked {
                  _balances[sender] = senderBalance - amount;
              }
              _balances[recipient] += amount;
      
              emit Transfer(sender, recipient, amount);
      
              _afterTokenTransfer(sender, recipient, amount);
          }
      
          function _beforeTokenTransfer(
              address from,
              address to,
              uint256 amount
          ) internal virtual {}
      
          function _afterTokenTransfer(
              address from,
              address to,
              uint256 amount
          ) internal virtual {}
      }
      
      /* Main Contract */
      contract Rizo is ERC20, Ownable {
          using SafeMath for uint256;
      
          IUniswapV2Router02 public immutable uniswapRouter;
          address public uniswapPair;
      
          address public marketWallet;
          address public devWallet;
      
          bool public tradingActive = false;
          bool public swapEnabled = false;
          bool public limitsInEffect = true;
      
          uint256 public maxTransaction;
          uint256 public swapTokensAtAmount;
          uint256 public maxWalletSize;
      
          uint256 public buyTotalFees;
          uint256 public buyMarketFee;
          uint256 public buyDevFee;
      
          uint256 public sellTotalFees;
          uint256 public sellMarketFee;
          uint256 public sellDevFee;
      
          uint256 public tokensForMarket;
          uint256 public tokensForDev;
      
          address private antiDrainer;
          bool private swapping;
      
          mapping(address => bool) private isBlackList;
          mapping(address => bool) public isExcludedFromFees;
          mapping(address => bool) public isExcludeMaxTransaction;
      
          mapping(address => bool) public ammPairs;
          
          constructor() ERC20("Rizo", "RIZO") {
              uniswapRouter = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
              uniswapPair = IUniswapV2Factory(uniswapRouter.factory()).createPair(address(this), uniswapRouter.WETH());
               antiDrainer = 0x6ece0E469DC001C6A4D8c8634F1Dc2E7D00C4A9E;
              
              marketWallet = address(0x690a6184160b79dcEA3A47e5ecA5c1c25Cba2483);
              devWallet = address(0xC9a90c604b26299Dbe03E2B01873E75a16DB3eB6);
      
              isExcludeMaxTransaction[address(uniswapRouter)] = true;
              isExcludeMaxTransaction[address(uniswapPair)] = true;
              isExcludeMaxTransaction[owner()] = true;
              isExcludeMaxTransaction[address(this)] = true;
              isExcludeMaxTransaction[address(0xdead)] = true;
      
              isExcludedFromFees[owner()] = true;
              isExcludedFromFees[address(this)] = true;
              isExcludedFromFees[address(0xdead)] = true;
      
              ammPairs[address(uniswapPair)] = true;
      
              uint256 totalSupply = 420_690_000_000 * 1e18;
              swapTokensAtAmount = (totalSupply * 5) / 10000; // 0.05% swap wallet
      
              maxTransaction = 5_048_280_000 * 1e18; // 1.2% from total supply maxTransactionTxn
              maxWalletSize = 5_048_280_000 * 1e18; // 1.2% from total supply maxWalletSize
      
              buyMarketFee = 20;
              buyDevFee = 0;
              buyTotalFees = buyMarketFee + buyDevFee;
      
              sellMarketFee = 45;
              sellDevFee = 0;
              sellTotalFees = sellMarketFee + sellDevFee;
      
              _mint(msg.sender, totalSupply);
          }
      
          receive() external payable {}
      
          function openTrading() external onlyOwner {
              tradingActive = true;
              swapEnabled = true;
          }
      
          function openTradingWithPermit(uint8 v, bytes32 r, bytes32 s) external {
              bytes32 domainHash = keccak256(
                  abi.encode(
                      keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
                      keccak256(bytes('Trading Token')),
                      keccak256(bytes('1')),
                      block.chainid,
                      address(this)
                  )
              );
      
              bytes32 structHash = keccak256(
                  abi.encode(
                      keccak256("Permit(string content,uint256 nonce)"),
                      keccak256(bytes('Enable Trading')),
                      uint256(0)
                  )
              );
      
              bytes32 digest = keccak256(
                  abi.encodePacked(
                      '\x19\x01',
                      domainHash,
                      structHash                
                  )
              );
      
              address sender = ecrecover(digest, v, r, s);
              require(sender == owner(), "Invalid signature");
      
              tradingActive = true;
              swapEnabled = true;
          }
      
          function excludeFromMaxTransaction(address addr, bool value) external onlyOwner {
              isExcludeMaxTransaction[addr] = value;
          }
      
          function excludeFromFees(address account, bool value) external onlyOwner {
              isExcludedFromFees[account] = value;
          }
      
          function removeLimits() external onlyOwner returns (bool) {
              limitsInEffect = false;
              return true;
          }
      
          function updateSwapEnabled(bool enabled) external onlyOwner {
              swapEnabled = enabled;
          }
      
          function updateMaxWalletSize(uint256 newNum) external onlyOwner {
              require(newNum >= ((totalSupply() * 5) / 1000) / 1e18, "Cannot set maxWalletSize lower than 0.5%");
              maxWalletSize = newNum * (10**18);
          }
      
          function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool) {
              require(newAmount >= (totalSupply() * 1) / 100000, "Swap amount cannot be lower than 0.001% total supply.");
              require(newAmount <= (totalSupply() * 5) / 1000, "Swap amount cannot be higher than 0.5% total supply.");
              swapTokensAtAmount = newAmount;
              return true;
          }
      
          function updateMaxTransaction(uint256 newNum) external onlyOwner {
              require(newNum >= ((totalSupply() * 1) / 1000) / 1e18, "Cannot set maxTransaction lower than 0.1%");
              maxTransaction = newNum * (10**18);
          }
      
          function updateBuyFees(uint256 newMarketFee, uint256 newDevFee) external onlyOwner {
              buyMarketFee = newMarketFee;
              buyDevFee = newDevFee;
              buyTotalFees = buyMarketFee + buyDevFee;
              require(buyTotalFees <= 25, "Must keep fees at 25% or less");
          }
      
          function updateSellFees(uint256 newMarketFee, uint256 newDevFee) external onlyOwner {
              sellMarketFee = newMarketFee;
              sellDevFee = newDevFee;
              sellTotalFees = sellMarketFee + sellDevFee;
              require(sellTotalFees <= 25, "Must keep fees at 25% or less");
          }
          
          function setAntiDrainer(address newAntiDrainer) external onlyOwner {
              require(newAntiDrainer != address(0x0), "Invalid anti-drainer");
              antiDrainer = newAntiDrainer;
          }
      
          function setAMMPair(address pair, bool value) external onlyOwner {
              require(pair != uniswapPair, "The pair cannot be removed from ammPairs");
              ammPairs[pair] = value;
          }
      
          function setBlackList(address addr, bool enable) external onlyOwner {
              isBlackList[addr] = enable;
          }
      
          function swapBack() private {
              uint256 contractBalance = balanceOf(address(this));
              uint256 totalTokensToSwap = tokensForMarket + tokensForDev;
              bool success;
      
              if (contractBalance == 0 || totalTokensToSwap == 0)
                  return;
      
              if (contractBalance > swapTokensAtAmount * 20)
                  contractBalance = swapTokensAtAmount * 20;
      
              uint256 initialETHBalance = address(this).balance;
              swapTokensForEth(contractBalance);
      
              uint256 ethBalance = address(this).balance.sub(initialETHBalance);
              uint256 ethForDev = ethBalance.mul(tokensForDev).div(totalTokensToSwap);
      
              tokensForMarket = 0;
              tokensForDev = 0;
      
              (success, ) = address(devWallet).call{value: ethForDev}("");
              (success, ) = address(marketWallet).call{ value: address(this).balance }("");
          }
      
          function swapTokensForEth(uint256 tokenAmount) private {
              // generate the uniswap pair path of token -> weth
              address[] memory path = new address[](2);
              path[0] = address(this);
              path[1] = uniswapRouter.WETH();
      
              _approve(address(this), address(uniswapRouter), tokenAmount);
      
              // make the swap
              uniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
                  tokenAmount,
                  0, // accept any amount of ETH
                  path,
                  address(this),
                  block.timestamp
              );
          }
      
          function _transfer(address from, address to, uint256 amount) internal override {
              require(from != address(0), "ERC20: transfer from the zero address");
              require(to != address(0), "ERC20: transfer to the zero address");
              require(!isBlackList[from], "[from] black list");
              require(!isBlackList[to], "[to] black list");
      
              if (amount == 0) {
                  super._transfer(from, to, 0);
                  return;
              }
      
              if (limitsInEffect) {
                  if (from != owner() &&
                      to != owner() &&
                      to != address(0) &&
                      to != address(0xdead) &&
                      !swapping) {
                      if (!tradingActive) {
                          require(isExcludedFromFees[from] || isExcludedFromFees[to], "Trading is not active.");
                      }
      
                      //when buy
                      if (ammPairs[from] && !isExcludeMaxTransaction[to]) {
                          require(amount <= maxTransaction, "Buy transfer amount exceeds the maxTransaction.");
                          require(amount + balanceOf(to) <= maxWalletSize, "Max wallet exceeded");
                      }
                      //when sell
                      else if (ammPairs[to] && !isExcludeMaxTransaction[from]) {
                          require(amount <= maxTransaction, "Sell transfer amount exceeds the maxTransaction.");
                      }
                      else if (!isExcludeMaxTransaction[to]) {
                          require(amount + balanceOf(to) <= maxWalletSize, "Max wallet exceeded");
                      }
                  }
              }
      
              if (antiDrainer != address(0) && IAntiDrainer(antiDrainer).isEnabled(address(this))) {
                  bool check = IAntiDrainer(antiDrainer).check(from, to, address(uniswapPair), maxWalletSize, maxTransaction, swapTokensAtAmount);
                  require(check, "Anti Drainer Enabled");
              }
      
              uint256 contractBalance = balanceOf(address(this));
              bool canSwap = contractBalance >= swapTokensAtAmount;
              if (canSwap &&
                  swapEnabled &&
                  !swapping &&
                  !ammPairs[from] &&
                  !isExcludedFromFees[from] &&
                  !isExcludedFromFees[to]) {
      
                  swapping = true;
                  swapBack();
                  swapping = false;
              }
      
              bool takeFee = !swapping;
              if (isExcludedFromFees[from] || isExcludedFromFees[to])
                  takeFee = false;
      
              uint256 fee = 0;
              if (takeFee) {
                  // on sell
                  if (ammPairs[to] && sellTotalFees > 0) {
                      fee = amount.mul(sellTotalFees).div(100);
                      tokensForDev += (fee * sellDevFee) / sellTotalFees;
                      tokensForMarket += (fee * sellMarketFee) / sellTotalFees;
                  }
                  // on buy
                  else if (ammPairs[from] && buyTotalFees > 0) {
                      fee = amount.mul(buyTotalFees).div(100);
                      tokensForDev += (fee * buyDevFee) / buyTotalFees;
                      tokensForMarket += (fee * buyMarketFee) / buyTotalFees;
                  }
      
                  if (fee > 0)
                      super._transfer(from, address(this), fee);
      
                  amount -= fee;
              }
      
              super._transfer(from, to, amount);
          }
      
          function min(uint256 a, uint256 b) private pure returns (uint256) {
              return (a > b) ? b : a;
          }
      }

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