utils.adoc 216 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647
  1. :github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
  2. :Math: pass:normal[xref:utils.adoc#Math[`Math`]]
  3. :SignedMath: pass:normal[xref:utils.adoc#SignedMath[`SignedMath`]]
  4. :SafeCast: pass:normal[xref:utils.adoc#SafeCast[`SafeCast`]]
  5. :ECDSA: pass:normal[xref:utils.adoc#ECDSA[`ECDSA`]]
  6. :MessageHashUtils: pass:normal[xref:utils.adoc#MessageHashUtils[`MessageHashUtils`]]
  7. :SignatureChecker: pass:normal[xref:utils.adoc#SignatureChecker[`SignatureChecker`]]
  8. :MerkleProof: pass:normal[xref:utils.adoc#MerkleProof[`MerkleProof`]]
  9. :EIP712: pass:normal[xref:utils.adoc#EIP712[`EIP712`]]
  10. :ReentrancyGuard: pass:normal[xref:utils.adoc#ReentrancyGuard[`ReentrancyGuard`]]
  11. :Pausable: pass:normal[xref:utils.adoc#Pausable[`Pausable`]]
  12. :Nonces: pass:normal[xref:utils.adoc#Nonces[`Nonces`]]
  13. :BitMaps: pass:normal[xref:utils.adoc#BitMaps[`BitMaps`]]
  14. :EnumerableMap: pass:normal[xref:utils.adoc#EnumerableMap[`EnumerableMap`]]
  15. :EnumerableSet: pass:normal[xref:utils.adoc#EnumerableSet[`EnumerableSet`]]
  16. :EnumerableMap: pass:normal[xref:utils.adoc#EnumerableMap[`EnumerableMap`]]
  17. :DoubleEndedQueue: pass:normal[xref:utils.adoc#DoubleEndedQueue[`DoubleEndedQueue`]]
  18. :Checkpoints: pass:normal[xref:utils.adoc#Checkpoints[`Checkpoints`]]
  19. :Create2: pass:normal[xref:utils.adoc#Create2[`Create2`]]
  20. :Address: pass:normal[xref:utils.adoc#Address[`Address`]]
  21. :Arrays: pass:normal[xref:utils.adoc#Arrays[`Arrays`]]
  22. :Base64: pass:normal[xref:utils.adoc#Base64[`Base64`]]
  23. :Strings: pass:normal[xref:utils.adoc#Strings[`Strings`]]
  24. :ShortString: pass:normal[xref:utils.adoc#ShortString[`ShortString`]]
  25. :StorageSlot: pass:normal[xref:utils.adoc#StorageSlot[`StorageSlot`]]
  26. :Multicall: pass:normal[xref:utils.adoc#Multicall[`Multicall`]]
  27. :Context: pass:normal[xref:utils.adoc#Context[`Context`]]
  28. :EnumerableMap: pass:normal[xref:utils.adoc#EnumerableMap[`EnumerableMap`]]
  29. :EnumerableSet: pass:normal[xref:utils.adoc#EnumerableSet[`EnumerableSet`]]
  30. :xref-Math-tryAdd-uint256-uint256-: xref:utils.adoc#Math-tryAdd-uint256-uint256-
  31. :xref-Math-trySub-uint256-uint256-: xref:utils.adoc#Math-trySub-uint256-uint256-
  32. :xref-Math-tryMul-uint256-uint256-: xref:utils.adoc#Math-tryMul-uint256-uint256-
  33. :xref-Math-tryDiv-uint256-uint256-: xref:utils.adoc#Math-tryDiv-uint256-uint256-
  34. :xref-Math-tryMod-uint256-uint256-: xref:utils.adoc#Math-tryMod-uint256-uint256-
  35. :xref-Math-max-uint256-uint256-: xref:utils.adoc#Math-max-uint256-uint256-
  36. :xref-Math-min-uint256-uint256-: xref:utils.adoc#Math-min-uint256-uint256-
  37. :xref-Math-average-uint256-uint256-: xref:utils.adoc#Math-average-uint256-uint256-
  38. :xref-Math-ceilDiv-uint256-uint256-: xref:utils.adoc#Math-ceilDiv-uint256-uint256-
  39. :xref-Math-mulDiv-uint256-uint256-uint256-: xref:utils.adoc#Math-mulDiv-uint256-uint256-uint256-
  40. :xref-Math-mulDiv-uint256-uint256-uint256-enum-Math-Rounding-: xref:utils.adoc#Math-mulDiv-uint256-uint256-uint256-enum-Math-Rounding-
  41. :xref-Math-sqrt-uint256-: xref:utils.adoc#Math-sqrt-uint256-
  42. :xref-Math-sqrt-uint256-enum-Math-Rounding-: xref:utils.adoc#Math-sqrt-uint256-enum-Math-Rounding-
  43. :xref-Math-log2-uint256-: xref:utils.adoc#Math-log2-uint256-
  44. :xref-Math-log2-uint256-enum-Math-Rounding-: xref:utils.adoc#Math-log2-uint256-enum-Math-Rounding-
  45. :xref-Math-log10-uint256-: xref:utils.adoc#Math-log10-uint256-
  46. :xref-Math-log10-uint256-enum-Math-Rounding-: xref:utils.adoc#Math-log10-uint256-enum-Math-Rounding-
  47. :xref-Math-log256-uint256-: xref:utils.adoc#Math-log256-uint256-
  48. :xref-Math-log256-uint256-enum-Math-Rounding-: xref:utils.adoc#Math-log256-uint256-enum-Math-Rounding-
  49. :xref-Math-unsignedRoundsUp-enum-Math-Rounding-: xref:utils.adoc#Math-unsignedRoundsUp-enum-Math-Rounding-
  50. :xref-Math-MathOverflowedMulDiv--: xref:utils.adoc#Math-MathOverflowedMulDiv--
  51. :xref-SignedMath-max-int256-int256-: xref:utils.adoc#SignedMath-max-int256-int256-
  52. :xref-SignedMath-min-int256-int256-: xref:utils.adoc#SignedMath-min-int256-int256-
  53. :xref-SignedMath-average-int256-int256-: xref:utils.adoc#SignedMath-average-int256-int256-
  54. :xref-SignedMath-abs-int256-: xref:utils.adoc#SignedMath-abs-int256-
  55. :xref-SafeCast-toUint248-uint256-: xref:utils.adoc#SafeCast-toUint248-uint256-
  56. :xref-SafeCast-toUint240-uint256-: xref:utils.adoc#SafeCast-toUint240-uint256-
  57. :xref-SafeCast-toUint232-uint256-: xref:utils.adoc#SafeCast-toUint232-uint256-
  58. :xref-SafeCast-toUint224-uint256-: xref:utils.adoc#SafeCast-toUint224-uint256-
  59. :xref-SafeCast-toUint216-uint256-: xref:utils.adoc#SafeCast-toUint216-uint256-
  60. :xref-SafeCast-toUint208-uint256-: xref:utils.adoc#SafeCast-toUint208-uint256-
  61. :xref-SafeCast-toUint200-uint256-: xref:utils.adoc#SafeCast-toUint200-uint256-
  62. :xref-SafeCast-toUint192-uint256-: xref:utils.adoc#SafeCast-toUint192-uint256-
  63. :xref-SafeCast-toUint184-uint256-: xref:utils.adoc#SafeCast-toUint184-uint256-
  64. :xref-SafeCast-toUint176-uint256-: xref:utils.adoc#SafeCast-toUint176-uint256-
  65. :xref-SafeCast-toUint168-uint256-: xref:utils.adoc#SafeCast-toUint168-uint256-
  66. :xref-SafeCast-toUint160-uint256-: xref:utils.adoc#SafeCast-toUint160-uint256-
  67. :xref-SafeCast-toUint152-uint256-: xref:utils.adoc#SafeCast-toUint152-uint256-
  68. :xref-SafeCast-toUint144-uint256-: xref:utils.adoc#SafeCast-toUint144-uint256-
  69. :xref-SafeCast-toUint136-uint256-: xref:utils.adoc#SafeCast-toUint136-uint256-
  70. :xref-SafeCast-toUint128-uint256-: xref:utils.adoc#SafeCast-toUint128-uint256-
  71. :xref-SafeCast-toUint120-uint256-: xref:utils.adoc#SafeCast-toUint120-uint256-
  72. :xref-SafeCast-toUint112-uint256-: xref:utils.adoc#SafeCast-toUint112-uint256-
  73. :xref-SafeCast-toUint104-uint256-: xref:utils.adoc#SafeCast-toUint104-uint256-
  74. :xref-SafeCast-toUint96-uint256-: xref:utils.adoc#SafeCast-toUint96-uint256-
  75. :xref-SafeCast-toUint88-uint256-: xref:utils.adoc#SafeCast-toUint88-uint256-
  76. :xref-SafeCast-toUint80-uint256-: xref:utils.adoc#SafeCast-toUint80-uint256-
  77. :xref-SafeCast-toUint72-uint256-: xref:utils.adoc#SafeCast-toUint72-uint256-
  78. :xref-SafeCast-toUint64-uint256-: xref:utils.adoc#SafeCast-toUint64-uint256-
  79. :xref-SafeCast-toUint56-uint256-: xref:utils.adoc#SafeCast-toUint56-uint256-
  80. :xref-SafeCast-toUint48-uint256-: xref:utils.adoc#SafeCast-toUint48-uint256-
  81. :xref-SafeCast-toUint40-uint256-: xref:utils.adoc#SafeCast-toUint40-uint256-
  82. :xref-SafeCast-toUint32-uint256-: xref:utils.adoc#SafeCast-toUint32-uint256-
  83. :xref-SafeCast-toUint24-uint256-: xref:utils.adoc#SafeCast-toUint24-uint256-
  84. :xref-SafeCast-toUint16-uint256-: xref:utils.adoc#SafeCast-toUint16-uint256-
  85. :xref-SafeCast-toUint8-uint256-: xref:utils.adoc#SafeCast-toUint8-uint256-
  86. :xref-SafeCast-toUint256-int256-: xref:utils.adoc#SafeCast-toUint256-int256-
  87. :xref-SafeCast-toInt248-int256-: xref:utils.adoc#SafeCast-toInt248-int256-
  88. :xref-SafeCast-toInt240-int256-: xref:utils.adoc#SafeCast-toInt240-int256-
  89. :xref-SafeCast-toInt232-int256-: xref:utils.adoc#SafeCast-toInt232-int256-
  90. :xref-SafeCast-toInt224-int256-: xref:utils.adoc#SafeCast-toInt224-int256-
  91. :xref-SafeCast-toInt216-int256-: xref:utils.adoc#SafeCast-toInt216-int256-
  92. :xref-SafeCast-toInt208-int256-: xref:utils.adoc#SafeCast-toInt208-int256-
  93. :xref-SafeCast-toInt200-int256-: xref:utils.adoc#SafeCast-toInt200-int256-
  94. :xref-SafeCast-toInt192-int256-: xref:utils.adoc#SafeCast-toInt192-int256-
  95. :xref-SafeCast-toInt184-int256-: xref:utils.adoc#SafeCast-toInt184-int256-
  96. :xref-SafeCast-toInt176-int256-: xref:utils.adoc#SafeCast-toInt176-int256-
  97. :xref-SafeCast-toInt168-int256-: xref:utils.adoc#SafeCast-toInt168-int256-
  98. :xref-SafeCast-toInt160-int256-: xref:utils.adoc#SafeCast-toInt160-int256-
  99. :xref-SafeCast-toInt152-int256-: xref:utils.adoc#SafeCast-toInt152-int256-
  100. :xref-SafeCast-toInt144-int256-: xref:utils.adoc#SafeCast-toInt144-int256-
  101. :xref-SafeCast-toInt136-int256-: xref:utils.adoc#SafeCast-toInt136-int256-
  102. :xref-SafeCast-toInt128-int256-: xref:utils.adoc#SafeCast-toInt128-int256-
  103. :xref-SafeCast-toInt120-int256-: xref:utils.adoc#SafeCast-toInt120-int256-
  104. :xref-SafeCast-toInt112-int256-: xref:utils.adoc#SafeCast-toInt112-int256-
  105. :xref-SafeCast-toInt104-int256-: xref:utils.adoc#SafeCast-toInt104-int256-
  106. :xref-SafeCast-toInt96-int256-: xref:utils.adoc#SafeCast-toInt96-int256-
  107. :xref-SafeCast-toInt88-int256-: xref:utils.adoc#SafeCast-toInt88-int256-
  108. :xref-SafeCast-toInt80-int256-: xref:utils.adoc#SafeCast-toInt80-int256-
  109. :xref-SafeCast-toInt72-int256-: xref:utils.adoc#SafeCast-toInt72-int256-
  110. :xref-SafeCast-toInt64-int256-: xref:utils.adoc#SafeCast-toInt64-int256-
  111. :xref-SafeCast-toInt56-int256-: xref:utils.adoc#SafeCast-toInt56-int256-
  112. :xref-SafeCast-toInt48-int256-: xref:utils.adoc#SafeCast-toInt48-int256-
  113. :xref-SafeCast-toInt40-int256-: xref:utils.adoc#SafeCast-toInt40-int256-
  114. :xref-SafeCast-toInt32-int256-: xref:utils.adoc#SafeCast-toInt32-int256-
  115. :xref-SafeCast-toInt24-int256-: xref:utils.adoc#SafeCast-toInt24-int256-
  116. :xref-SafeCast-toInt16-int256-: xref:utils.adoc#SafeCast-toInt16-int256-
  117. :xref-SafeCast-toInt8-int256-: xref:utils.adoc#SafeCast-toInt8-int256-
  118. :xref-SafeCast-toInt256-uint256-: xref:utils.adoc#SafeCast-toInt256-uint256-
  119. :xref-SafeCast-SafeCastOverflowedUintDowncast-uint8-uint256-: xref:utils.adoc#SafeCast-SafeCastOverflowedUintDowncast-uint8-uint256-
  120. :xref-SafeCast-SafeCastOverflowedIntToUint-int256-: xref:utils.adoc#SafeCast-SafeCastOverflowedIntToUint-int256-
  121. :xref-SafeCast-SafeCastOverflowedIntDowncast-uint8-int256-: xref:utils.adoc#SafeCast-SafeCastOverflowedIntDowncast-uint8-int256-
  122. :xref-SafeCast-SafeCastOverflowedUintToInt-uint256-: xref:utils.adoc#SafeCast-SafeCastOverflowedUintToInt-uint256-
  123. :xref-ECDSA-tryRecover-bytes32-bytes-: xref:utils.adoc#ECDSA-tryRecover-bytes32-bytes-
  124. :xref-ECDSA-recover-bytes32-bytes-: xref:utils.adoc#ECDSA-recover-bytes32-bytes-
  125. :xref-ECDSA-tryRecover-bytes32-bytes32-bytes32-: xref:utils.adoc#ECDSA-tryRecover-bytes32-bytes32-bytes32-
  126. :xref-ECDSA-recover-bytes32-bytes32-bytes32-: xref:utils.adoc#ECDSA-recover-bytes32-bytes32-bytes32-
  127. :xref-ECDSA-tryRecover-bytes32-uint8-bytes32-bytes32-: xref:utils.adoc#ECDSA-tryRecover-bytes32-uint8-bytes32-bytes32-
  128. :xref-ECDSA-recover-bytes32-uint8-bytes32-bytes32-: xref:utils.adoc#ECDSA-recover-bytes32-uint8-bytes32-bytes32-
  129. :xref-ECDSA-ECDSAInvalidSignature--: xref:utils.adoc#ECDSA-ECDSAInvalidSignature--
  130. :xref-ECDSA-ECDSAInvalidSignatureLength-uint256-: xref:utils.adoc#ECDSA-ECDSAInvalidSignatureLength-uint256-
  131. :xref-ECDSA-ECDSAInvalidSignatureS-bytes32-: xref:utils.adoc#ECDSA-ECDSAInvalidSignatureS-bytes32-
  132. :MessageHashUtils-toEthSignedMessageHash: pass:normal[xref:utils.adoc#MessageHashUtils-toEthSignedMessageHash-bytes-[`MessageHashUtils.toEthSignedMessageHash`]]
  133. :MessageHashUtils-toEthSignedMessageHash: pass:normal[xref:utils.adoc#MessageHashUtils-toEthSignedMessageHash-bytes-[`MessageHashUtils.toEthSignedMessageHash`]]
  134. :ECDSA-tryRecover: pass:normal[xref:utils.adoc#ECDSA-tryRecover-bytes32-uint8-bytes32-bytes32-[`ECDSA.tryRecover`]]
  135. :ECDSA-recover: pass:normal[xref:utils.adoc#ECDSA-recover-bytes32-uint8-bytes32-bytes32-[`ECDSA.recover`]]
  136. :ECDSA-tryRecover: pass:normal[xref:utils.adoc#ECDSA-tryRecover-bytes32-uint8-bytes32-bytes32-[`ECDSA.tryRecover`]]
  137. :ECDSA-recover: pass:normal[xref:utils.adoc#ECDSA-recover-bytes32-uint8-bytes32-bytes32-[`ECDSA.recover`]]
  138. :ECDSA: pass:normal[xref:utils.adoc#ECDSA[`ECDSA`]]
  139. :xref-MessageHashUtils-toEthSignedMessageHash-bytes32-: xref:utils.adoc#MessageHashUtils-toEthSignedMessageHash-bytes32-
  140. :xref-MessageHashUtils-toEthSignedMessageHash-bytes-: xref:utils.adoc#MessageHashUtils-toEthSignedMessageHash-bytes-
  141. :xref-MessageHashUtils-toDataWithIntendedValidatorHash-address-bytes-: xref:utils.adoc#MessageHashUtils-toDataWithIntendedValidatorHash-address-bytes-
  142. :xref-MessageHashUtils-toTypedDataHash-bytes32-bytes32-: xref:utils.adoc#MessageHashUtils-toTypedDataHash-bytes32-bytes32-
  143. :ECDSA-recover: pass:normal[xref:utils.adoc#ECDSA-recover-bytes32-uint8-bytes32-bytes32-[`ECDSA.recover`]]
  144. :ECDSA-recover: pass:normal[xref:utils.adoc#ECDSA-recover-bytes32-uint8-bytes32-bytes32-[`ECDSA.recover`]]
  145. :ECDSA-recover: pass:normal[xref:utils.adoc#ECDSA-recover-bytes32-uint8-bytes32-bytes32-[`ECDSA.recover`]]
  146. :ECDSA-recover: pass:normal[xref:utils.adoc#ECDSA-recover-bytes32-uint8-bytes32-bytes32-[`ECDSA.recover`]]
  147. :xref-SignatureChecker-isValidSignatureNow-address-bytes32-bytes-: xref:utils.adoc#SignatureChecker-isValidSignatureNow-address-bytes32-bytes-
  148. :xref-SignatureChecker-isValidERC1271SignatureNow-address-bytes32-bytes-: xref:utils.adoc#SignatureChecker-isValidERC1271SignatureNow-address-bytes32-bytes-
  149. :xref-MerkleProof-verify-bytes32---bytes32-bytes32-: xref:utils.adoc#MerkleProof-verify-bytes32---bytes32-bytes32-
  150. :xref-MerkleProof-verifyCalldata-bytes32---bytes32-bytes32-: xref:utils.adoc#MerkleProof-verifyCalldata-bytes32---bytes32-bytes32-
  151. :xref-MerkleProof-processProof-bytes32---bytes32-: xref:utils.adoc#MerkleProof-processProof-bytes32---bytes32-
  152. :xref-MerkleProof-processProofCalldata-bytes32---bytes32-: xref:utils.adoc#MerkleProof-processProofCalldata-bytes32---bytes32-
  153. :xref-MerkleProof-multiProofVerify-bytes32---bool---bytes32-bytes32---: xref:utils.adoc#MerkleProof-multiProofVerify-bytes32---bool---bytes32-bytes32---
  154. :xref-MerkleProof-multiProofVerifyCalldata-bytes32---bool---bytes32-bytes32---: xref:utils.adoc#MerkleProof-multiProofVerifyCalldata-bytes32---bool---bytes32-bytes32---
  155. :xref-MerkleProof-processMultiProof-bytes32---bool---bytes32---: xref:utils.adoc#MerkleProof-processMultiProof-bytes32---bool---bytes32---
  156. :xref-MerkleProof-processMultiProofCalldata-bytes32---bool---bytes32---: xref:utils.adoc#MerkleProof-processMultiProofCalldata-bytes32---bool---bytes32---
  157. :xref-MerkleProof-MerkleProofInvalidMultiproof--: xref:utils.adoc#MerkleProof-MerkleProofInvalidMultiproof--
  158. :xref-EIP712-constructor-string-string-: xref:utils.adoc#EIP712-constructor-string-string-
  159. :xref-EIP712-_domainSeparatorV4--: xref:utils.adoc#EIP712-_domainSeparatorV4--
  160. :xref-EIP712-_hashTypedDataV4-bytes32-: xref:utils.adoc#EIP712-_hashTypedDataV4-bytes32-
  161. :xref-EIP712-eip712Domain--: xref:utils.adoc#EIP712-eip712Domain--
  162. :xref-EIP712-_EIP712Name--: xref:utils.adoc#EIP712-_EIP712Name--
  163. :xref-EIP712-_EIP712Version--: xref:utils.adoc#EIP712-_EIP712Version--
  164. :xref-IERC5267-EIP712DomainChanged--: xref:interfaces.adoc#IERC5267-EIP712DomainChanged--
  165. :ECDSA-recover: pass:normal[xref:utils.adoc#ECDSA-recover-bytes32-uint8-bytes32-bytes32-[`ECDSA.recover`]]
  166. :xref-ReentrancyGuard-nonReentrant--: xref:utils.adoc#ReentrancyGuard-nonReentrant--
  167. :xref-ReentrancyGuard-constructor--: xref:utils.adoc#ReentrancyGuard-constructor--
  168. :xref-ReentrancyGuard-_reentrancyGuardEntered--: xref:utils.adoc#ReentrancyGuard-_reentrancyGuardEntered--
  169. :xref-ReentrancyGuard-ReentrancyGuardReentrantCall--: xref:utils.adoc#ReentrancyGuard-ReentrancyGuardReentrantCall--
  170. :xref-Pausable-whenNotPaused--: xref:utils.adoc#Pausable-whenNotPaused--
  171. :xref-Pausable-whenPaused--: xref:utils.adoc#Pausable-whenPaused--
  172. :xref-Pausable-constructor--: xref:utils.adoc#Pausable-constructor--
  173. :xref-Pausable-paused--: xref:utils.adoc#Pausable-paused--
  174. :xref-Pausable-_requireNotPaused--: xref:utils.adoc#Pausable-_requireNotPaused--
  175. :xref-Pausable-_requirePaused--: xref:utils.adoc#Pausable-_requirePaused--
  176. :xref-Pausable-_pause--: xref:utils.adoc#Pausable-_pause--
  177. :xref-Pausable-_unpause--: xref:utils.adoc#Pausable-_unpause--
  178. :xref-Pausable-Paused-address-: xref:utils.adoc#Pausable-Paused-address-
  179. :xref-Pausable-Unpaused-address-: xref:utils.adoc#Pausable-Unpaused-address-
  180. :xref-Pausable-EnforcedPause--: xref:utils.adoc#Pausable-EnforcedPause--
  181. :xref-Pausable-ExpectedPause--: xref:utils.adoc#Pausable-ExpectedPause--
  182. :xref-Nonces-nonces-address-: xref:utils.adoc#Nonces-nonces-address-
  183. :xref-Nonces-_useNonce-address-: xref:utils.adoc#Nonces-_useNonce-address-
  184. :xref-Nonces-_useCheckedNonce-address-uint256-: xref:utils.adoc#Nonces-_useCheckedNonce-address-uint256-
  185. :xref-Nonces-InvalidAccountNonce-address-uint256-: xref:utils.adoc#Nonces-InvalidAccountNonce-address-uint256-
  186. :ERC165Checker: pass:normal[xref:utils.adoc#ERC165Checker[`ERC165Checker`]]
  187. :ERC165: pass:normal[xref:utils.adoc#ERC165[`ERC165`]]
  188. :xref-IERC165-supportsInterface-bytes4-: xref:utils.adoc#IERC165-supportsInterface-bytes4-
  189. :IERC165: pass:normal[xref:utils.adoc#IERC165[`IERC165`]]
  190. :xref-ERC165-supportsInterface-bytes4-: xref:utils.adoc#ERC165-supportsInterface-bytes4-
  191. :IERC165-supportsInterface: pass:normal[xref:utils.adoc#IERC165-supportsInterface-bytes4-[`IERC165.supportsInterface`]]
  192. :IERC165: pass:normal[xref:utils.adoc#IERC165[`IERC165`]]
  193. :xref-ERC165Checker-supportsERC165-address-: xref:utils.adoc#ERC165Checker-supportsERC165-address-
  194. :xref-ERC165Checker-supportsInterface-address-bytes4-: xref:utils.adoc#ERC165Checker-supportsInterface-address-bytes4-
  195. :xref-ERC165Checker-getSupportedInterfaces-address-bytes4---: xref:utils.adoc#ERC165Checker-getSupportedInterfaces-address-bytes4---
  196. :xref-ERC165Checker-supportsAllInterfaces-address-bytes4---: xref:utils.adoc#ERC165Checker-supportsAllInterfaces-address-bytes4---
  197. :xref-ERC165Checker-supportsERC165InterfaceUnchecked-address-bytes4-: xref:utils.adoc#ERC165Checker-supportsERC165InterfaceUnchecked-address-bytes4-
  198. :IERC165: pass:normal[xref:utils.adoc#IERC165[`IERC165`]]
  199. :IERC165: pass:normal[xref:utils.adoc#IERC165[`IERC165`]]
  200. :IERC165-supportsInterface: pass:normal[xref:utils.adoc#IERC165-supportsInterface-bytes4-[`IERC165.supportsInterface`]]
  201. :IERC165-supportsInterface: pass:normal[xref:utils.adoc#IERC165-supportsInterface-bytes4-[`IERC165.supportsInterface`]]
  202. :IERC165: pass:normal[xref:utils.adoc#IERC165[`IERC165`]]
  203. :IERC165: pass:normal[xref:utils.adoc#IERC165[`IERC165`]]
  204. :IERC165-supportsInterface: pass:normal[xref:utils.adoc#IERC165-supportsInterface-bytes4-[`IERC165.supportsInterface`]]
  205. :xref-BitMaps-get-struct-BitMaps-BitMap-uint256-: xref:utils.adoc#BitMaps-get-struct-BitMaps-BitMap-uint256-
  206. :xref-BitMaps-setTo-struct-BitMaps-BitMap-uint256-bool-: xref:utils.adoc#BitMaps-setTo-struct-BitMaps-BitMap-uint256-bool-
  207. :xref-BitMaps-set-struct-BitMaps-BitMap-uint256-: xref:utils.adoc#BitMaps-set-struct-BitMaps-BitMap-uint256-
  208. :xref-BitMaps-unset-struct-BitMaps-BitMap-uint256-: xref:utils.adoc#BitMaps-unset-struct-BitMaps-BitMap-uint256-
  209. :xref-EnumerableMap-set-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-bytes32-: xref:utils.adoc#EnumerableMap-set-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-bytes32-
  210. :xref-EnumerableMap-remove-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-: xref:utils.adoc#EnumerableMap-remove-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-
  211. :xref-EnumerableMap-contains-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-: xref:utils.adoc#EnumerableMap-contains-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-
  212. :xref-EnumerableMap-length-struct-EnumerableMap-Bytes32ToBytes32Map-: xref:utils.adoc#EnumerableMap-length-struct-EnumerableMap-Bytes32ToBytes32Map-
  213. :xref-EnumerableMap-at-struct-EnumerableMap-Bytes32ToBytes32Map-uint256-: xref:utils.adoc#EnumerableMap-at-struct-EnumerableMap-Bytes32ToBytes32Map-uint256-
  214. :xref-EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-: xref:utils.adoc#EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-
  215. :xref-EnumerableMap-get-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-: xref:utils.adoc#EnumerableMap-get-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-
  216. :xref-EnumerableMap-keys-struct-EnumerableMap-Bytes32ToBytes32Map-: xref:utils.adoc#EnumerableMap-keys-struct-EnumerableMap-Bytes32ToBytes32Map-
  217. :xref-EnumerableMap-set-struct-EnumerableMap-UintToUintMap-uint256-uint256-: xref:utils.adoc#EnumerableMap-set-struct-EnumerableMap-UintToUintMap-uint256-uint256-
  218. :xref-EnumerableMap-remove-struct-EnumerableMap-UintToUintMap-uint256-: xref:utils.adoc#EnumerableMap-remove-struct-EnumerableMap-UintToUintMap-uint256-
  219. :xref-EnumerableMap-contains-struct-EnumerableMap-UintToUintMap-uint256-: xref:utils.adoc#EnumerableMap-contains-struct-EnumerableMap-UintToUintMap-uint256-
  220. :xref-EnumerableMap-length-struct-EnumerableMap-UintToUintMap-: xref:utils.adoc#EnumerableMap-length-struct-EnumerableMap-UintToUintMap-
  221. :xref-EnumerableMap-at-struct-EnumerableMap-UintToUintMap-uint256-: xref:utils.adoc#EnumerableMap-at-struct-EnumerableMap-UintToUintMap-uint256-
  222. :xref-EnumerableMap-tryGet-struct-EnumerableMap-UintToUintMap-uint256-: xref:utils.adoc#EnumerableMap-tryGet-struct-EnumerableMap-UintToUintMap-uint256-
  223. :xref-EnumerableMap-get-struct-EnumerableMap-UintToUintMap-uint256-: xref:utils.adoc#EnumerableMap-get-struct-EnumerableMap-UintToUintMap-uint256-
  224. :xref-EnumerableMap-keys-struct-EnumerableMap-UintToUintMap-: xref:utils.adoc#EnumerableMap-keys-struct-EnumerableMap-UintToUintMap-
  225. :xref-EnumerableMap-set-struct-EnumerableMap-UintToAddressMap-uint256-address-: xref:utils.adoc#EnumerableMap-set-struct-EnumerableMap-UintToAddressMap-uint256-address-
  226. :xref-EnumerableMap-remove-struct-EnumerableMap-UintToAddressMap-uint256-: xref:utils.adoc#EnumerableMap-remove-struct-EnumerableMap-UintToAddressMap-uint256-
  227. :xref-EnumerableMap-contains-struct-EnumerableMap-UintToAddressMap-uint256-: xref:utils.adoc#EnumerableMap-contains-struct-EnumerableMap-UintToAddressMap-uint256-
  228. :xref-EnumerableMap-length-struct-EnumerableMap-UintToAddressMap-: xref:utils.adoc#EnumerableMap-length-struct-EnumerableMap-UintToAddressMap-
  229. :xref-EnumerableMap-at-struct-EnumerableMap-UintToAddressMap-uint256-: xref:utils.adoc#EnumerableMap-at-struct-EnumerableMap-UintToAddressMap-uint256-
  230. :xref-EnumerableMap-tryGet-struct-EnumerableMap-UintToAddressMap-uint256-: xref:utils.adoc#EnumerableMap-tryGet-struct-EnumerableMap-UintToAddressMap-uint256-
  231. :xref-EnumerableMap-get-struct-EnumerableMap-UintToAddressMap-uint256-: xref:utils.adoc#EnumerableMap-get-struct-EnumerableMap-UintToAddressMap-uint256-
  232. :xref-EnumerableMap-keys-struct-EnumerableMap-UintToAddressMap-: xref:utils.adoc#EnumerableMap-keys-struct-EnumerableMap-UintToAddressMap-
  233. :xref-EnumerableMap-set-struct-EnumerableMap-AddressToUintMap-address-uint256-: xref:utils.adoc#EnumerableMap-set-struct-EnumerableMap-AddressToUintMap-address-uint256-
  234. :xref-EnumerableMap-remove-struct-EnumerableMap-AddressToUintMap-address-: xref:utils.adoc#EnumerableMap-remove-struct-EnumerableMap-AddressToUintMap-address-
  235. :xref-EnumerableMap-contains-struct-EnumerableMap-AddressToUintMap-address-: xref:utils.adoc#EnumerableMap-contains-struct-EnumerableMap-AddressToUintMap-address-
  236. :xref-EnumerableMap-length-struct-EnumerableMap-AddressToUintMap-: xref:utils.adoc#EnumerableMap-length-struct-EnumerableMap-AddressToUintMap-
  237. :xref-EnumerableMap-at-struct-EnumerableMap-AddressToUintMap-uint256-: xref:utils.adoc#EnumerableMap-at-struct-EnumerableMap-AddressToUintMap-uint256-
  238. :xref-EnumerableMap-tryGet-struct-EnumerableMap-AddressToUintMap-address-: xref:utils.adoc#EnumerableMap-tryGet-struct-EnumerableMap-AddressToUintMap-address-
  239. :xref-EnumerableMap-get-struct-EnumerableMap-AddressToUintMap-address-: xref:utils.adoc#EnumerableMap-get-struct-EnumerableMap-AddressToUintMap-address-
  240. :xref-EnumerableMap-keys-struct-EnumerableMap-AddressToUintMap-: xref:utils.adoc#EnumerableMap-keys-struct-EnumerableMap-AddressToUintMap-
  241. :xref-EnumerableMap-set-struct-EnumerableMap-Bytes32ToUintMap-bytes32-uint256-: xref:utils.adoc#EnumerableMap-set-struct-EnumerableMap-Bytes32ToUintMap-bytes32-uint256-
  242. :xref-EnumerableMap-remove-struct-EnumerableMap-Bytes32ToUintMap-bytes32-: xref:utils.adoc#EnumerableMap-remove-struct-EnumerableMap-Bytes32ToUintMap-bytes32-
  243. :xref-EnumerableMap-contains-struct-EnumerableMap-Bytes32ToUintMap-bytes32-: xref:utils.adoc#EnumerableMap-contains-struct-EnumerableMap-Bytes32ToUintMap-bytes32-
  244. :xref-EnumerableMap-length-struct-EnumerableMap-Bytes32ToUintMap-: xref:utils.adoc#EnumerableMap-length-struct-EnumerableMap-Bytes32ToUintMap-
  245. :xref-EnumerableMap-at-struct-EnumerableMap-Bytes32ToUintMap-uint256-: xref:utils.adoc#EnumerableMap-at-struct-EnumerableMap-Bytes32ToUintMap-uint256-
  246. :xref-EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToUintMap-bytes32-: xref:utils.adoc#EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToUintMap-bytes32-
  247. :xref-EnumerableMap-get-struct-EnumerableMap-Bytes32ToUintMap-bytes32-: xref:utils.adoc#EnumerableMap-get-struct-EnumerableMap-Bytes32ToUintMap-bytes32-
  248. :xref-EnumerableMap-keys-struct-EnumerableMap-Bytes32ToUintMap-: xref:utils.adoc#EnumerableMap-keys-struct-EnumerableMap-Bytes32ToUintMap-
  249. :xref-EnumerableMap-EnumerableMapNonexistentKey-bytes32-: xref:utils.adoc#EnumerableMap-EnumerableMapNonexistentKey-bytes32-
  250. :xref-EnumerableSet-add-struct-EnumerableSet-Bytes32Set-bytes32-: xref:utils.adoc#EnumerableSet-add-struct-EnumerableSet-Bytes32Set-bytes32-
  251. :xref-EnumerableSet-remove-struct-EnumerableSet-Bytes32Set-bytes32-: xref:utils.adoc#EnumerableSet-remove-struct-EnumerableSet-Bytes32Set-bytes32-
  252. :xref-EnumerableSet-contains-struct-EnumerableSet-Bytes32Set-bytes32-: xref:utils.adoc#EnumerableSet-contains-struct-EnumerableSet-Bytes32Set-bytes32-
  253. :xref-EnumerableSet-length-struct-EnumerableSet-Bytes32Set-: xref:utils.adoc#EnumerableSet-length-struct-EnumerableSet-Bytes32Set-
  254. :xref-EnumerableSet-at-struct-EnumerableSet-Bytes32Set-uint256-: xref:utils.adoc#EnumerableSet-at-struct-EnumerableSet-Bytes32Set-uint256-
  255. :xref-EnumerableSet-values-struct-EnumerableSet-Bytes32Set-: xref:utils.adoc#EnumerableSet-values-struct-EnumerableSet-Bytes32Set-
  256. :xref-EnumerableSet-add-struct-EnumerableSet-AddressSet-address-: xref:utils.adoc#EnumerableSet-add-struct-EnumerableSet-AddressSet-address-
  257. :xref-EnumerableSet-remove-struct-EnumerableSet-AddressSet-address-: xref:utils.adoc#EnumerableSet-remove-struct-EnumerableSet-AddressSet-address-
  258. :xref-EnumerableSet-contains-struct-EnumerableSet-AddressSet-address-: xref:utils.adoc#EnumerableSet-contains-struct-EnumerableSet-AddressSet-address-
  259. :xref-EnumerableSet-length-struct-EnumerableSet-AddressSet-: xref:utils.adoc#EnumerableSet-length-struct-EnumerableSet-AddressSet-
  260. :xref-EnumerableSet-at-struct-EnumerableSet-AddressSet-uint256-: xref:utils.adoc#EnumerableSet-at-struct-EnumerableSet-AddressSet-uint256-
  261. :xref-EnumerableSet-values-struct-EnumerableSet-AddressSet-: xref:utils.adoc#EnumerableSet-values-struct-EnumerableSet-AddressSet-
  262. :xref-EnumerableSet-add-struct-EnumerableSet-UintSet-uint256-: xref:utils.adoc#EnumerableSet-add-struct-EnumerableSet-UintSet-uint256-
  263. :xref-EnumerableSet-remove-struct-EnumerableSet-UintSet-uint256-: xref:utils.adoc#EnumerableSet-remove-struct-EnumerableSet-UintSet-uint256-
  264. :xref-EnumerableSet-contains-struct-EnumerableSet-UintSet-uint256-: xref:utils.adoc#EnumerableSet-contains-struct-EnumerableSet-UintSet-uint256-
  265. :xref-EnumerableSet-length-struct-EnumerableSet-UintSet-: xref:utils.adoc#EnumerableSet-length-struct-EnumerableSet-UintSet-
  266. :xref-EnumerableSet-at-struct-EnumerableSet-UintSet-uint256-: xref:utils.adoc#EnumerableSet-at-struct-EnumerableSet-UintSet-uint256-
  267. :xref-EnumerableSet-values-struct-EnumerableSet-UintSet-: xref:utils.adoc#EnumerableSet-values-struct-EnumerableSet-UintSet-
  268. :xref-DoubleEndedQueue-pushBack-struct-DoubleEndedQueue-Bytes32Deque-bytes32-: xref:utils.adoc#DoubleEndedQueue-pushBack-struct-DoubleEndedQueue-Bytes32Deque-bytes32-
  269. :xref-DoubleEndedQueue-popBack-struct-DoubleEndedQueue-Bytes32Deque-: xref:utils.adoc#DoubleEndedQueue-popBack-struct-DoubleEndedQueue-Bytes32Deque-
  270. :xref-DoubleEndedQueue-pushFront-struct-DoubleEndedQueue-Bytes32Deque-bytes32-: xref:utils.adoc#DoubleEndedQueue-pushFront-struct-DoubleEndedQueue-Bytes32Deque-bytes32-
  271. :xref-DoubleEndedQueue-popFront-struct-DoubleEndedQueue-Bytes32Deque-: xref:utils.adoc#DoubleEndedQueue-popFront-struct-DoubleEndedQueue-Bytes32Deque-
  272. :xref-DoubleEndedQueue-front-struct-DoubleEndedQueue-Bytes32Deque-: xref:utils.adoc#DoubleEndedQueue-front-struct-DoubleEndedQueue-Bytes32Deque-
  273. :xref-DoubleEndedQueue-back-struct-DoubleEndedQueue-Bytes32Deque-: xref:utils.adoc#DoubleEndedQueue-back-struct-DoubleEndedQueue-Bytes32Deque-
  274. :xref-DoubleEndedQueue-at-struct-DoubleEndedQueue-Bytes32Deque-uint256-: xref:utils.adoc#DoubleEndedQueue-at-struct-DoubleEndedQueue-Bytes32Deque-uint256-
  275. :xref-DoubleEndedQueue-clear-struct-DoubleEndedQueue-Bytes32Deque-: xref:utils.adoc#DoubleEndedQueue-clear-struct-DoubleEndedQueue-Bytes32Deque-
  276. :xref-DoubleEndedQueue-length-struct-DoubleEndedQueue-Bytes32Deque-: xref:utils.adoc#DoubleEndedQueue-length-struct-DoubleEndedQueue-Bytes32Deque-
  277. :xref-DoubleEndedQueue-empty-struct-DoubleEndedQueue-Bytes32Deque-: xref:utils.adoc#DoubleEndedQueue-empty-struct-DoubleEndedQueue-Bytes32Deque-
  278. :xref-DoubleEndedQueue-QueueEmpty--: xref:utils.adoc#DoubleEndedQueue-QueueEmpty--
  279. :xref-DoubleEndedQueue-QueueFull--: xref:utils.adoc#DoubleEndedQueue-QueueFull--
  280. :xref-DoubleEndedQueue-QueueOutOfBounds--: xref:utils.adoc#DoubleEndedQueue-QueueOutOfBounds--
  281. :Votes: pass:normal[xref:governance.adoc#Votes[`Votes`]]
  282. :xref-Checkpoints-push-struct-Checkpoints-Trace224-uint32-uint224-: xref:utils.adoc#Checkpoints-push-struct-Checkpoints-Trace224-uint32-uint224-
  283. :xref-Checkpoints-lowerLookup-struct-Checkpoints-Trace224-uint32-: xref:utils.adoc#Checkpoints-lowerLookup-struct-Checkpoints-Trace224-uint32-
  284. :xref-Checkpoints-upperLookup-struct-Checkpoints-Trace224-uint32-: xref:utils.adoc#Checkpoints-upperLookup-struct-Checkpoints-Trace224-uint32-
  285. :xref-Checkpoints-upperLookupRecent-struct-Checkpoints-Trace224-uint32-: xref:utils.adoc#Checkpoints-upperLookupRecent-struct-Checkpoints-Trace224-uint32-
  286. :xref-Checkpoints-latest-struct-Checkpoints-Trace224-: xref:utils.adoc#Checkpoints-latest-struct-Checkpoints-Trace224-
  287. :xref-Checkpoints-latestCheckpoint-struct-Checkpoints-Trace224-: xref:utils.adoc#Checkpoints-latestCheckpoint-struct-Checkpoints-Trace224-
  288. :xref-Checkpoints-length-struct-Checkpoints-Trace224-: xref:utils.adoc#Checkpoints-length-struct-Checkpoints-Trace224-
  289. :xref-Checkpoints-at-struct-Checkpoints-Trace224-uint32-: xref:utils.adoc#Checkpoints-at-struct-Checkpoints-Trace224-uint32-
  290. :xref-Checkpoints-push-struct-Checkpoints-Trace208-uint48-uint208-: xref:utils.adoc#Checkpoints-push-struct-Checkpoints-Trace208-uint48-uint208-
  291. :xref-Checkpoints-lowerLookup-struct-Checkpoints-Trace208-uint48-: xref:utils.adoc#Checkpoints-lowerLookup-struct-Checkpoints-Trace208-uint48-
  292. :xref-Checkpoints-upperLookup-struct-Checkpoints-Trace208-uint48-: xref:utils.adoc#Checkpoints-upperLookup-struct-Checkpoints-Trace208-uint48-
  293. :xref-Checkpoints-upperLookupRecent-struct-Checkpoints-Trace208-uint48-: xref:utils.adoc#Checkpoints-upperLookupRecent-struct-Checkpoints-Trace208-uint48-
  294. :xref-Checkpoints-latest-struct-Checkpoints-Trace208-: xref:utils.adoc#Checkpoints-latest-struct-Checkpoints-Trace208-
  295. :xref-Checkpoints-latestCheckpoint-struct-Checkpoints-Trace208-: xref:utils.adoc#Checkpoints-latestCheckpoint-struct-Checkpoints-Trace208-
  296. :xref-Checkpoints-length-struct-Checkpoints-Trace208-: xref:utils.adoc#Checkpoints-length-struct-Checkpoints-Trace208-
  297. :xref-Checkpoints-at-struct-Checkpoints-Trace208-uint32-: xref:utils.adoc#Checkpoints-at-struct-Checkpoints-Trace208-uint32-
  298. :xref-Checkpoints-push-struct-Checkpoints-Trace160-uint96-uint160-: xref:utils.adoc#Checkpoints-push-struct-Checkpoints-Trace160-uint96-uint160-
  299. :xref-Checkpoints-lowerLookup-struct-Checkpoints-Trace160-uint96-: xref:utils.adoc#Checkpoints-lowerLookup-struct-Checkpoints-Trace160-uint96-
  300. :xref-Checkpoints-upperLookup-struct-Checkpoints-Trace160-uint96-: xref:utils.adoc#Checkpoints-upperLookup-struct-Checkpoints-Trace160-uint96-
  301. :xref-Checkpoints-upperLookupRecent-struct-Checkpoints-Trace160-uint96-: xref:utils.adoc#Checkpoints-upperLookupRecent-struct-Checkpoints-Trace160-uint96-
  302. :xref-Checkpoints-latest-struct-Checkpoints-Trace160-: xref:utils.adoc#Checkpoints-latest-struct-Checkpoints-Trace160-
  303. :xref-Checkpoints-latestCheckpoint-struct-Checkpoints-Trace160-: xref:utils.adoc#Checkpoints-latestCheckpoint-struct-Checkpoints-Trace160-
  304. :xref-Checkpoints-length-struct-Checkpoints-Trace160-: xref:utils.adoc#Checkpoints-length-struct-Checkpoints-Trace160-
  305. :xref-Checkpoints-at-struct-Checkpoints-Trace160-uint32-: xref:utils.adoc#Checkpoints-at-struct-Checkpoints-Trace160-uint32-
  306. :xref-Checkpoints-CheckpointUnorderedInsertion--: xref:utils.adoc#Checkpoints-CheckpointUnorderedInsertion--
  307. :xref-Create2-deploy-uint256-bytes32-bytes-: xref:utils.adoc#Create2-deploy-uint256-bytes32-bytes-
  308. :xref-Create2-computeAddress-bytes32-bytes32-: xref:utils.adoc#Create2-computeAddress-bytes32-bytes32-
  309. :xref-Create2-computeAddress-bytes32-bytes32-address-: xref:utils.adoc#Create2-computeAddress-bytes32-bytes32-address-
  310. :xref-Create2-Create2InsufficientBalance-uint256-uint256-: xref:utils.adoc#Create2-Create2InsufficientBalance-uint256-uint256-
  311. :xref-Create2-Create2EmptyBytecode--: xref:utils.adoc#Create2-Create2EmptyBytecode--
  312. :xref-Create2-Create2FailedDeployment--: xref:utils.adoc#Create2-Create2FailedDeployment--
  313. :xref-Address-sendValue-address-payable-uint256-: xref:utils.adoc#Address-sendValue-address-payable-uint256-
  314. :xref-Address-functionCall-address-bytes-: xref:utils.adoc#Address-functionCall-address-bytes-
  315. :xref-Address-functionCallWithValue-address-bytes-uint256-: xref:utils.adoc#Address-functionCallWithValue-address-bytes-uint256-
  316. :xref-Address-functionStaticCall-address-bytes-: xref:utils.adoc#Address-functionStaticCall-address-bytes-
  317. :xref-Address-functionDelegateCall-address-bytes-: xref:utils.adoc#Address-functionDelegateCall-address-bytes-
  318. :xref-Address-verifyCallResultFromTarget-address-bool-bytes-: xref:utils.adoc#Address-verifyCallResultFromTarget-address-bool-bytes-
  319. :xref-Address-verifyCallResult-bool-bytes-: xref:utils.adoc#Address-verifyCallResult-bool-bytes-
  320. :xref-Address-AddressInsufficientBalance-address-: xref:utils.adoc#Address-AddressInsufficientBalance-address-
  321. :xref-Address-AddressEmptyCode-address-: xref:utils.adoc#Address-AddressEmptyCode-address-
  322. :xref-Address-FailedInnerCall--: xref:utils.adoc#Address-FailedInnerCall--
  323. :ReentrancyGuard: pass:normal[xref:utils.adoc#ReentrancyGuard[`ReentrancyGuard`]]
  324. :xref-Address-functionCall-address-bytes-: xref:utils.adoc#Address-functionCall-address-bytes-
  325. :xref-Address-functionCall-address-bytes-: xref:utils.adoc#Address-functionCall-address-bytes-
  326. :xref-Address-functionCall-address-bytes-: xref:utils.adoc#Address-functionCall-address-bytes-
  327. :xref-Arrays-findUpperBound-uint256---uint256-: xref:utils.adoc#Arrays-findUpperBound-uint256---uint256-
  328. :xref-Arrays-unsafeAccess-address---uint256-: xref:utils.adoc#Arrays-unsafeAccess-address---uint256-
  329. :xref-Arrays-unsafeAccess-bytes32---uint256-: xref:utils.adoc#Arrays-unsafeAccess-bytes32---uint256-
  330. :xref-Arrays-unsafeAccess-uint256---uint256-: xref:utils.adoc#Arrays-unsafeAccess-uint256---uint256-
  331. :xref-Arrays-unsafeMemoryAccess-uint256---uint256-: xref:utils.adoc#Arrays-unsafeMemoryAccess-uint256---uint256-
  332. :xref-Arrays-unsafeMemoryAccess-address---uint256-: xref:utils.adoc#Arrays-unsafeMemoryAccess-address---uint256-
  333. :xref-Base64-encode-bytes-: xref:utils.adoc#Base64-encode-bytes-
  334. :xref-Strings-toString-uint256-: xref:utils.adoc#Strings-toString-uint256-
  335. :xref-Strings-toStringSigned-int256-: xref:utils.adoc#Strings-toStringSigned-int256-
  336. :xref-Strings-toHexString-uint256-: xref:utils.adoc#Strings-toHexString-uint256-
  337. :xref-Strings-toHexString-uint256-uint256-: xref:utils.adoc#Strings-toHexString-uint256-uint256-
  338. :xref-Strings-toHexString-address-: xref:utils.adoc#Strings-toHexString-address-
  339. :xref-Strings-equal-string-string-: xref:utils.adoc#Strings-equal-string-string-
  340. :xref-Strings-StringsInsufficientHexLength-uint256-uint256-: xref:utils.adoc#Strings-StringsInsufficientHexLength-uint256-uint256-
  341. :xref-ShortStrings-toShortString-string-: xref:utils.adoc#ShortStrings-toShortString-string-
  342. :xref-ShortStrings-toString-ShortString-: xref:utils.adoc#ShortStrings-toString-ShortString-
  343. :xref-ShortStrings-byteLength-ShortString-: xref:utils.adoc#ShortStrings-byteLength-ShortString-
  344. :xref-ShortStrings-toShortStringWithFallback-string-string-: xref:utils.adoc#ShortStrings-toShortStringWithFallback-string-string-
  345. :xref-ShortStrings-toStringWithFallback-ShortString-string-: xref:utils.adoc#ShortStrings-toStringWithFallback-ShortString-string-
  346. :xref-ShortStrings-byteLengthWithFallback-ShortString-string-: xref:utils.adoc#ShortStrings-byteLengthWithFallback-ShortString-string-
  347. :xref-ShortStrings-StringTooLong-string-: xref:utils.adoc#ShortStrings-StringTooLong-string-
  348. :xref-ShortStrings-InvalidShortString--: xref:utils.adoc#ShortStrings-InvalidShortString--
  349. :xref-StorageSlot-getAddressSlot-bytes32-: xref:utils.adoc#StorageSlot-getAddressSlot-bytes32-
  350. :xref-StorageSlot-getBooleanSlot-bytes32-: xref:utils.adoc#StorageSlot-getBooleanSlot-bytes32-
  351. :xref-StorageSlot-getBytes32Slot-bytes32-: xref:utils.adoc#StorageSlot-getBytes32Slot-bytes32-
  352. :xref-StorageSlot-getUint256Slot-bytes32-: xref:utils.adoc#StorageSlot-getUint256Slot-bytes32-
  353. :xref-StorageSlot-getStringSlot-bytes32-: xref:utils.adoc#StorageSlot-getStringSlot-bytes32-
  354. :xref-StorageSlot-getStringSlot-string-: xref:utils.adoc#StorageSlot-getStringSlot-string-
  355. :xref-StorageSlot-getBytesSlot-bytes32-: xref:utils.adoc#StorageSlot-getBytesSlot-bytes32-
  356. :xref-StorageSlot-getBytesSlot-bytes-: xref:utils.adoc#StorageSlot-getBytesSlot-bytes-
  357. :ERC2771Context: pass:normal[xref:metatx.adoc#ERC2771Context[`ERC2771Context`]]
  358. :xref-Multicall-multicall-bytes---: xref:utils.adoc#Multicall-multicall-bytes---
  359. :xref-Context-_msgSender--: xref:utils.adoc#Context-_msgSender--
  360. :xref-Context-_msgData--: xref:utils.adoc#Context-_msgData--
  361. :xref-Context-_contextSuffixLength--: xref:utils.adoc#Context-_contextSuffixLength--
  362. = Utilities
  363. [.readme-notice]
  364. NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/utils
  365. Miscellaneous contracts and libraries containing utility functions you can use to improve security, work with new data types, or safely use low-level primitives.
  366. * {Math}, {SignedMath}: Implementation of various arithmetic functions.
  367. * {SafeCast}: Checked downcasting functions to avoid silent truncation.
  368. * {ECDSA}, {MessageHashUtils}: Libraries for interacting with ECDSA signatures.
  369. * {SignatureChecker}: A library helper to support regular ECDSA from EOAs as well as ERC-1271 signatures for smart contracts.
  370. * {MerkleProof}: Functions for verifying https://en.wikipedia.org/wiki/Merkle_tree[Merkle Tree] proofs.
  371. * {EIP712}: Contract with functions to allow processing signed typed structure data according to https://eips.ethereum.org/EIPS/eip-712[EIP-712].
  372. * {ReentrancyGuard}: A modifier that can prevent reentrancy during certain functions.
  373. * {Pausable}: A common emergency response mechanism that can pause functionality while a remediation is pending.
  374. * {Nonces}: Utility for tracking and verifying address nonces that only increment.
  375. * {ERC165, ERC165Checker}: Utilities for inspecting interfaces supported by contracts.
  376. * {BitMaps}: A simple library to manage boolean value mapped to a numerical index in an efficient way.
  377. * {EnumerableMap}: A type like Solidity's https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`], but with key-value _enumeration_: this will let you know how many entries a mapping has, and iterate over them (which is not possible with `mapping`).
  378. * {EnumerableSet}: Like {EnumerableMap}, but for https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets]. Can be used to store privileged accounts, issued IDs, etc.
  379. * {DoubleEndedQueue}: An implementation of a https://en.wikipedia.org/wiki/Double-ended_queue[double ended queue] whose values can be removed added or remove from both sides. Useful for FIFO and LIFO structures.
  380. * {Checkpoints}: A data structure to store values mapped to an strictly increasing key. Can be used for storing and accessing values over time.
  381. * {Create2}: Wrapper around the https://blog.openzeppelin.com/getting-the-most-out-of-create2/[`CREATE2` EVM opcode] for safe use without having to deal with low-level assembly.
  382. * {Address}: Collection of functions for overloading Solidity's https://docs.soliditylang.org/en/latest/types.html#address[`address`] type.
  383. * {Arrays}: Collection of functions that operate on https://docs.soliditylang.org/en/latest/types.html#arrays[`arrays`].
  384. * {Base64}: On-chain base64 and base64URL encoding according to https://datatracker.ietf.org/doc/html/rfc4648[RFC-4648].
  385. * {Strings}: Common operations for strings formatting.
  386. * {ShortString}: Library to encode (and decode) short strings into (or from) a single bytes32 slot for optimizing costs. Short strings are limited to 31 characters.
  387. * {StorageSlot}: Methods for accessing specific storage slots formatted as common primitive types.
  388. * {Multicall}: Abstract contract with an utility to allow batching together multiple calls in a single transaction. Useful for allowing EOAs to perform multiple operations at once.
  389. * {Context}: An utility for abstracting the sender and calldata in the current execution context.
  390. [NOTE]
  391. ====
  392. Because Solidity does not support generic types, {EnumerableMap} and {EnumerableSet} are specialized to a limited number of key-value types.
  393. ====
  394. == Math
  395. :MathOverflowedMulDiv: pass:normal[xref:#Math-MathOverflowedMulDiv--[`++MathOverflowedMulDiv++`]]
  396. :Rounding: pass:normal[xref:#Math-Rounding[`++Rounding++`]]
  397. :tryAdd: pass:normal[xref:#Math-tryAdd-uint256-uint256-[`++tryAdd++`]]
  398. :trySub: pass:normal[xref:#Math-trySub-uint256-uint256-[`++trySub++`]]
  399. :tryMul: pass:normal[xref:#Math-tryMul-uint256-uint256-[`++tryMul++`]]
  400. :tryDiv: pass:normal[xref:#Math-tryDiv-uint256-uint256-[`++tryDiv++`]]
  401. :tryMod: pass:normal[xref:#Math-tryMod-uint256-uint256-[`++tryMod++`]]
  402. :max: pass:normal[xref:#Math-max-uint256-uint256-[`++max++`]]
  403. :min: pass:normal[xref:#Math-min-uint256-uint256-[`++min++`]]
  404. :average: pass:normal[xref:#Math-average-uint256-uint256-[`++average++`]]
  405. :ceilDiv: pass:normal[xref:#Math-ceilDiv-uint256-uint256-[`++ceilDiv++`]]
  406. :mulDiv: pass:normal[xref:#Math-mulDiv-uint256-uint256-uint256-[`++mulDiv++`]]
  407. :mulDiv: pass:normal[xref:#Math-mulDiv-uint256-uint256-uint256-enum-Math-Rounding-[`++mulDiv++`]]
  408. :sqrt: pass:normal[xref:#Math-sqrt-uint256-[`++sqrt++`]]
  409. :sqrt: pass:normal[xref:#Math-sqrt-uint256-enum-Math-Rounding-[`++sqrt++`]]
  410. :log2: pass:normal[xref:#Math-log2-uint256-[`++log2++`]]
  411. :log2: pass:normal[xref:#Math-log2-uint256-enum-Math-Rounding-[`++log2++`]]
  412. :log10: pass:normal[xref:#Math-log10-uint256-[`++log10++`]]
  413. :log10: pass:normal[xref:#Math-log10-uint256-enum-Math-Rounding-[`++log10++`]]
  414. :log256: pass:normal[xref:#Math-log256-uint256-[`++log256++`]]
  415. :log256: pass:normal[xref:#Math-log256-uint256-enum-Math-Rounding-[`++log256++`]]
  416. :unsignedRoundsUp: pass:normal[xref:#Math-unsignedRoundsUp-enum-Math-Rounding-[`++unsignedRoundsUp++`]]
  417. [.contract]
  418. [[Math]]
  419. === `++Math++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/math/Math.sol[{github-icon},role=heading-link]
  420. [.hljs-theme-light.nopadding]
  421. ```solidity
  422. import "@openzeppelin/contracts/utils/math/Math.sol";
  423. ```
  424. Standard math utilities missing in the Solidity language.
  425. [.contract-index]
  426. .Functions
  427. --
  428. * {xref-Math-tryAdd-uint256-uint256-}[`++tryAdd(a, b)++`]
  429. * {xref-Math-trySub-uint256-uint256-}[`++trySub(a, b)++`]
  430. * {xref-Math-tryMul-uint256-uint256-}[`++tryMul(a, b)++`]
  431. * {xref-Math-tryDiv-uint256-uint256-}[`++tryDiv(a, b)++`]
  432. * {xref-Math-tryMod-uint256-uint256-}[`++tryMod(a, b)++`]
  433. * {xref-Math-max-uint256-uint256-}[`++max(a, b)++`]
  434. * {xref-Math-min-uint256-uint256-}[`++min(a, b)++`]
  435. * {xref-Math-average-uint256-uint256-}[`++average(a, b)++`]
  436. * {xref-Math-ceilDiv-uint256-uint256-}[`++ceilDiv(a, b)++`]
  437. * {xref-Math-mulDiv-uint256-uint256-uint256-}[`++mulDiv(x, y, denominator)++`]
  438. * {xref-Math-mulDiv-uint256-uint256-uint256-enum-Math-Rounding-}[`++mulDiv(x, y, denominator, rounding)++`]
  439. * {xref-Math-sqrt-uint256-}[`++sqrt(a)++`]
  440. * {xref-Math-sqrt-uint256-enum-Math-Rounding-}[`++sqrt(a, rounding)++`]
  441. * {xref-Math-log2-uint256-}[`++log2(value)++`]
  442. * {xref-Math-log2-uint256-enum-Math-Rounding-}[`++log2(value, rounding)++`]
  443. * {xref-Math-log10-uint256-}[`++log10(value)++`]
  444. * {xref-Math-log10-uint256-enum-Math-Rounding-}[`++log10(value, rounding)++`]
  445. * {xref-Math-log256-uint256-}[`++log256(value)++`]
  446. * {xref-Math-log256-uint256-enum-Math-Rounding-}[`++log256(value, rounding)++`]
  447. * {xref-Math-unsignedRoundsUp-enum-Math-Rounding-}[`++unsignedRoundsUp(rounding)++`]
  448. --
  449. [.contract-index]
  450. .Errors
  451. --
  452. * {xref-Math-MathOverflowedMulDiv--}[`++MathOverflowedMulDiv()++`]
  453. --
  454. [.contract-item]
  455. [[Math-tryAdd-uint256-uint256-]]
  456. ==== `[.contract-item-name]#++tryAdd++#++(uint256 a, uint256 b) → bool, uint256++` [.item-kind]#internal#
  457. Returns the addition of two unsigned integers, with an overflow flag.
  458. [.contract-item]
  459. [[Math-trySub-uint256-uint256-]]
  460. ==== `[.contract-item-name]#++trySub++#++(uint256 a, uint256 b) → bool, uint256++` [.item-kind]#internal#
  461. Returns the subtraction of two unsigned integers, with an overflow flag.
  462. [.contract-item]
  463. [[Math-tryMul-uint256-uint256-]]
  464. ==== `[.contract-item-name]#++tryMul++#++(uint256 a, uint256 b) → bool, uint256++` [.item-kind]#internal#
  465. Returns the multiplication of two unsigned integers, with an overflow flag.
  466. [.contract-item]
  467. [[Math-tryDiv-uint256-uint256-]]
  468. ==== `[.contract-item-name]#++tryDiv++#++(uint256 a, uint256 b) → bool, uint256++` [.item-kind]#internal#
  469. Returns the division of two unsigned integers, with a division by zero flag.
  470. [.contract-item]
  471. [[Math-tryMod-uint256-uint256-]]
  472. ==== `[.contract-item-name]#++tryMod++#++(uint256 a, uint256 b) → bool, uint256++` [.item-kind]#internal#
  473. Returns the remainder of dividing two unsigned integers, with a division by zero flag.
  474. [.contract-item]
  475. [[Math-max-uint256-uint256-]]
  476. ==== `[.contract-item-name]#++max++#++(uint256 a, uint256 b) → uint256++` [.item-kind]#internal#
  477. Returns the largest of two numbers.
  478. [.contract-item]
  479. [[Math-min-uint256-uint256-]]
  480. ==== `[.contract-item-name]#++min++#++(uint256 a, uint256 b) → uint256++` [.item-kind]#internal#
  481. Returns the smallest of two numbers.
  482. [.contract-item]
  483. [[Math-average-uint256-uint256-]]
  484. ==== `[.contract-item-name]#++average++#++(uint256 a, uint256 b) → uint256++` [.item-kind]#internal#
  485. Returns the average of two numbers. The result is rounded towards
  486. zero.
  487. [.contract-item]
  488. [[Math-ceilDiv-uint256-uint256-]]
  489. ==== `[.contract-item-name]#++ceilDiv++#++(uint256 a, uint256 b) → uint256++` [.item-kind]#internal#
  490. Returns the ceiling of the division of two numbers.
  491. This differs from standard division with `/` in that it rounds towards infinity instead
  492. of rounding towards zero.
  493. [.contract-item]
  494. [[Math-mulDiv-uint256-uint256-uint256-]]
  495. ==== `[.contract-item-name]#++mulDiv++#++(uint256 x, uint256 y, uint256 denominator) → uint256 result++` [.item-kind]#internal#
  496. Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
  497. Uniswap Labs also under MIT license.
  498. [.contract-item]
  499. [[Math-mulDiv-uint256-uint256-uint256-enum-Math-Rounding-]]
  500. ==== `[.contract-item-name]#++mulDiv++#++(uint256 x, uint256 y, uint256 denominator, enum Math.Rounding rounding) → uint256++` [.item-kind]#internal#
  501. [.contract-item]
  502. [[Math-sqrt-uint256-]]
  503. ==== `[.contract-item-name]#++sqrt++#++(uint256 a) → uint256++` [.item-kind]#internal#
  504. Returns the square root of a number. If the number is not a perfect square, the value is rounded
  505. towards zero.
  506. Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
  507. [.contract-item]
  508. [[Math-sqrt-uint256-enum-Math-Rounding-]]
  509. ==== `[.contract-item-name]#++sqrt++#++(uint256 a, enum Math.Rounding rounding) → uint256++` [.item-kind]#internal#
  510. [.contract-item]
  511. [[Math-log2-uint256-]]
  512. ==== `[.contract-item-name]#++log2++#++(uint256 value) → uint256++` [.item-kind]#internal#
  513. Return the log in base 2 of a positive value rounded towards zero.
  514. Returns 0 if given 0.
  515. [.contract-item]
  516. [[Math-log2-uint256-enum-Math-Rounding-]]
  517. ==== `[.contract-item-name]#++log2++#++(uint256 value, enum Math.Rounding rounding) → uint256++` [.item-kind]#internal#
  518. Return the log in base 2, following the selected rounding direction, of a positive value.
  519. Returns 0 if given 0.
  520. [.contract-item]
  521. [[Math-log10-uint256-]]
  522. ==== `[.contract-item-name]#++log10++#++(uint256 value) → uint256++` [.item-kind]#internal#
  523. Return the log in base 10 of a positive value rounded towards zero.
  524. Returns 0 if given 0.
  525. [.contract-item]
  526. [[Math-log10-uint256-enum-Math-Rounding-]]
  527. ==== `[.contract-item-name]#++log10++#++(uint256 value, enum Math.Rounding rounding) → uint256++` [.item-kind]#internal#
  528. Return the log in base 10, following the selected rounding direction, of a positive value.
  529. Returns 0 if given 0.
  530. [.contract-item]
  531. [[Math-log256-uint256-]]
  532. ==== `[.contract-item-name]#++log256++#++(uint256 value) → uint256++` [.item-kind]#internal#
  533. Return the log in base 256 of a positive value rounded towards zero.
  534. Returns 0 if given 0.
  535. Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
  536. [.contract-item]
  537. [[Math-log256-uint256-enum-Math-Rounding-]]
  538. ==== `[.contract-item-name]#++log256++#++(uint256 value, enum Math.Rounding rounding) → uint256++` [.item-kind]#internal#
  539. Return the log in base 256, following the selected rounding direction, of a positive value.
  540. Returns 0 if given 0.
  541. [.contract-item]
  542. [[Math-unsignedRoundsUp-enum-Math-Rounding-]]
  543. ==== `[.contract-item-name]#++unsignedRoundsUp++#++(enum Math.Rounding rounding) → bool++` [.item-kind]#internal#
  544. Returns whether a provided rounding mode is considered rounding up for unsigned integers.
  545. [.contract-item]
  546. [[Math-MathOverflowedMulDiv--]]
  547. ==== `[.contract-item-name]#++MathOverflowedMulDiv++#++()++` [.item-kind]#error#
  548. Muldiv operation overflow.
  549. :max: pass:normal[xref:#SignedMath-max-int256-int256-[`++max++`]]
  550. :min: pass:normal[xref:#SignedMath-min-int256-int256-[`++min++`]]
  551. :average: pass:normal[xref:#SignedMath-average-int256-int256-[`++average++`]]
  552. :abs: pass:normal[xref:#SignedMath-abs-int256-[`++abs++`]]
  553. [.contract]
  554. [[SignedMath]]
  555. === `++SignedMath++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/math/SignedMath.sol[{github-icon},role=heading-link]
  556. [.hljs-theme-light.nopadding]
  557. ```solidity
  558. import "@openzeppelin/contracts/utils/math/SignedMath.sol";
  559. ```
  560. Standard signed math utilities missing in the Solidity language.
  561. [.contract-index]
  562. .Functions
  563. --
  564. * {xref-SignedMath-max-int256-int256-}[`++max(a, b)++`]
  565. * {xref-SignedMath-min-int256-int256-}[`++min(a, b)++`]
  566. * {xref-SignedMath-average-int256-int256-}[`++average(a, b)++`]
  567. * {xref-SignedMath-abs-int256-}[`++abs(n)++`]
  568. --
  569. [.contract-item]
  570. [[SignedMath-max-int256-int256-]]
  571. ==== `[.contract-item-name]#++max++#++(int256 a, int256 b) → int256++` [.item-kind]#internal#
  572. Returns the largest of two signed numbers.
  573. [.contract-item]
  574. [[SignedMath-min-int256-int256-]]
  575. ==== `[.contract-item-name]#++min++#++(int256 a, int256 b) → int256++` [.item-kind]#internal#
  576. Returns the smallest of two signed numbers.
  577. [.contract-item]
  578. [[SignedMath-average-int256-int256-]]
  579. ==== `[.contract-item-name]#++average++#++(int256 a, int256 b) → int256++` [.item-kind]#internal#
  580. Returns the average of two signed numbers without overflow.
  581. The result is rounded towards zero.
  582. [.contract-item]
  583. [[SignedMath-abs-int256-]]
  584. ==== `[.contract-item-name]#++abs++#++(int256 n) → uint256++` [.item-kind]#internal#
  585. Returns the absolute unsigned value of a signed value.
  586. :SafeCastOverflowedUintDowncast: pass:normal[xref:#SafeCast-SafeCastOverflowedUintDowncast-uint8-uint256-[`++SafeCastOverflowedUintDowncast++`]]
  587. :SafeCastOverflowedIntToUint: pass:normal[xref:#SafeCast-SafeCastOverflowedIntToUint-int256-[`++SafeCastOverflowedIntToUint++`]]
  588. :SafeCastOverflowedIntDowncast: pass:normal[xref:#SafeCast-SafeCastOverflowedIntDowncast-uint8-int256-[`++SafeCastOverflowedIntDowncast++`]]
  589. :SafeCastOverflowedUintToInt: pass:normal[xref:#SafeCast-SafeCastOverflowedUintToInt-uint256-[`++SafeCastOverflowedUintToInt++`]]
  590. :toUint248: pass:normal[xref:#SafeCast-toUint248-uint256-[`++toUint248++`]]
  591. :toUint240: pass:normal[xref:#SafeCast-toUint240-uint256-[`++toUint240++`]]
  592. :toUint232: pass:normal[xref:#SafeCast-toUint232-uint256-[`++toUint232++`]]
  593. :toUint224: pass:normal[xref:#SafeCast-toUint224-uint256-[`++toUint224++`]]
  594. :toUint216: pass:normal[xref:#SafeCast-toUint216-uint256-[`++toUint216++`]]
  595. :toUint208: pass:normal[xref:#SafeCast-toUint208-uint256-[`++toUint208++`]]
  596. :toUint200: pass:normal[xref:#SafeCast-toUint200-uint256-[`++toUint200++`]]
  597. :toUint192: pass:normal[xref:#SafeCast-toUint192-uint256-[`++toUint192++`]]
  598. :toUint184: pass:normal[xref:#SafeCast-toUint184-uint256-[`++toUint184++`]]
  599. :toUint176: pass:normal[xref:#SafeCast-toUint176-uint256-[`++toUint176++`]]
  600. :toUint168: pass:normal[xref:#SafeCast-toUint168-uint256-[`++toUint168++`]]
  601. :toUint160: pass:normal[xref:#SafeCast-toUint160-uint256-[`++toUint160++`]]
  602. :toUint152: pass:normal[xref:#SafeCast-toUint152-uint256-[`++toUint152++`]]
  603. :toUint144: pass:normal[xref:#SafeCast-toUint144-uint256-[`++toUint144++`]]
  604. :toUint136: pass:normal[xref:#SafeCast-toUint136-uint256-[`++toUint136++`]]
  605. :toUint128: pass:normal[xref:#SafeCast-toUint128-uint256-[`++toUint128++`]]
  606. :toUint120: pass:normal[xref:#SafeCast-toUint120-uint256-[`++toUint120++`]]
  607. :toUint112: pass:normal[xref:#SafeCast-toUint112-uint256-[`++toUint112++`]]
  608. :toUint104: pass:normal[xref:#SafeCast-toUint104-uint256-[`++toUint104++`]]
  609. :toUint96: pass:normal[xref:#SafeCast-toUint96-uint256-[`++toUint96++`]]
  610. :toUint88: pass:normal[xref:#SafeCast-toUint88-uint256-[`++toUint88++`]]
  611. :toUint80: pass:normal[xref:#SafeCast-toUint80-uint256-[`++toUint80++`]]
  612. :toUint72: pass:normal[xref:#SafeCast-toUint72-uint256-[`++toUint72++`]]
  613. :toUint64: pass:normal[xref:#SafeCast-toUint64-uint256-[`++toUint64++`]]
  614. :toUint56: pass:normal[xref:#SafeCast-toUint56-uint256-[`++toUint56++`]]
  615. :toUint48: pass:normal[xref:#SafeCast-toUint48-uint256-[`++toUint48++`]]
  616. :toUint40: pass:normal[xref:#SafeCast-toUint40-uint256-[`++toUint40++`]]
  617. :toUint32: pass:normal[xref:#SafeCast-toUint32-uint256-[`++toUint32++`]]
  618. :toUint24: pass:normal[xref:#SafeCast-toUint24-uint256-[`++toUint24++`]]
  619. :toUint16: pass:normal[xref:#SafeCast-toUint16-uint256-[`++toUint16++`]]
  620. :toUint8: pass:normal[xref:#SafeCast-toUint8-uint256-[`++toUint8++`]]
  621. :toUint256: pass:normal[xref:#SafeCast-toUint256-int256-[`++toUint256++`]]
  622. :toInt248: pass:normal[xref:#SafeCast-toInt248-int256-[`++toInt248++`]]
  623. :toInt240: pass:normal[xref:#SafeCast-toInt240-int256-[`++toInt240++`]]
  624. :toInt232: pass:normal[xref:#SafeCast-toInt232-int256-[`++toInt232++`]]
  625. :toInt224: pass:normal[xref:#SafeCast-toInt224-int256-[`++toInt224++`]]
  626. :toInt216: pass:normal[xref:#SafeCast-toInt216-int256-[`++toInt216++`]]
  627. :toInt208: pass:normal[xref:#SafeCast-toInt208-int256-[`++toInt208++`]]
  628. :toInt200: pass:normal[xref:#SafeCast-toInt200-int256-[`++toInt200++`]]
  629. :toInt192: pass:normal[xref:#SafeCast-toInt192-int256-[`++toInt192++`]]
  630. :toInt184: pass:normal[xref:#SafeCast-toInt184-int256-[`++toInt184++`]]
  631. :toInt176: pass:normal[xref:#SafeCast-toInt176-int256-[`++toInt176++`]]
  632. :toInt168: pass:normal[xref:#SafeCast-toInt168-int256-[`++toInt168++`]]
  633. :toInt160: pass:normal[xref:#SafeCast-toInt160-int256-[`++toInt160++`]]
  634. :toInt152: pass:normal[xref:#SafeCast-toInt152-int256-[`++toInt152++`]]
  635. :toInt144: pass:normal[xref:#SafeCast-toInt144-int256-[`++toInt144++`]]
  636. :toInt136: pass:normal[xref:#SafeCast-toInt136-int256-[`++toInt136++`]]
  637. :toInt128: pass:normal[xref:#SafeCast-toInt128-int256-[`++toInt128++`]]
  638. :toInt120: pass:normal[xref:#SafeCast-toInt120-int256-[`++toInt120++`]]
  639. :toInt112: pass:normal[xref:#SafeCast-toInt112-int256-[`++toInt112++`]]
  640. :toInt104: pass:normal[xref:#SafeCast-toInt104-int256-[`++toInt104++`]]
  641. :toInt96: pass:normal[xref:#SafeCast-toInt96-int256-[`++toInt96++`]]
  642. :toInt88: pass:normal[xref:#SafeCast-toInt88-int256-[`++toInt88++`]]
  643. :toInt80: pass:normal[xref:#SafeCast-toInt80-int256-[`++toInt80++`]]
  644. :toInt72: pass:normal[xref:#SafeCast-toInt72-int256-[`++toInt72++`]]
  645. :toInt64: pass:normal[xref:#SafeCast-toInt64-int256-[`++toInt64++`]]
  646. :toInt56: pass:normal[xref:#SafeCast-toInt56-int256-[`++toInt56++`]]
  647. :toInt48: pass:normal[xref:#SafeCast-toInt48-int256-[`++toInt48++`]]
  648. :toInt40: pass:normal[xref:#SafeCast-toInt40-int256-[`++toInt40++`]]
  649. :toInt32: pass:normal[xref:#SafeCast-toInt32-int256-[`++toInt32++`]]
  650. :toInt24: pass:normal[xref:#SafeCast-toInt24-int256-[`++toInt24++`]]
  651. :toInt16: pass:normal[xref:#SafeCast-toInt16-int256-[`++toInt16++`]]
  652. :toInt8: pass:normal[xref:#SafeCast-toInt8-int256-[`++toInt8++`]]
  653. :toInt256: pass:normal[xref:#SafeCast-toInt256-uint256-[`++toInt256++`]]
  654. [.contract]
  655. [[SafeCast]]
  656. === `++SafeCast++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/math/SafeCast.sol[{github-icon},role=heading-link]
  657. [.hljs-theme-light.nopadding]
  658. ```solidity
  659. import "@openzeppelin/contracts/utils/math/SafeCast.sol";
  660. ```
  661. Wrappers over Solidity's uintXX/intXX casting operators with added overflow
  662. checks.
  663. Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
  664. easily result in undesired exploitation or bugs, since developers usually
  665. assume that overflows raise errors. `SafeCast` restores this intuition by
  666. reverting the transaction when such an operation overflows.
  667. Using this library instead of the unchecked operations eliminates an entire
  668. class of bugs, so it's recommended to use it always.
  669. [.contract-index]
  670. .Functions
  671. --
  672. * {xref-SafeCast-toUint248-uint256-}[`++toUint248(value)++`]
  673. * {xref-SafeCast-toUint240-uint256-}[`++toUint240(value)++`]
  674. * {xref-SafeCast-toUint232-uint256-}[`++toUint232(value)++`]
  675. * {xref-SafeCast-toUint224-uint256-}[`++toUint224(value)++`]
  676. * {xref-SafeCast-toUint216-uint256-}[`++toUint216(value)++`]
  677. * {xref-SafeCast-toUint208-uint256-}[`++toUint208(value)++`]
  678. * {xref-SafeCast-toUint200-uint256-}[`++toUint200(value)++`]
  679. * {xref-SafeCast-toUint192-uint256-}[`++toUint192(value)++`]
  680. * {xref-SafeCast-toUint184-uint256-}[`++toUint184(value)++`]
  681. * {xref-SafeCast-toUint176-uint256-}[`++toUint176(value)++`]
  682. * {xref-SafeCast-toUint168-uint256-}[`++toUint168(value)++`]
  683. * {xref-SafeCast-toUint160-uint256-}[`++toUint160(value)++`]
  684. * {xref-SafeCast-toUint152-uint256-}[`++toUint152(value)++`]
  685. * {xref-SafeCast-toUint144-uint256-}[`++toUint144(value)++`]
  686. * {xref-SafeCast-toUint136-uint256-}[`++toUint136(value)++`]
  687. * {xref-SafeCast-toUint128-uint256-}[`++toUint128(value)++`]
  688. * {xref-SafeCast-toUint120-uint256-}[`++toUint120(value)++`]
  689. * {xref-SafeCast-toUint112-uint256-}[`++toUint112(value)++`]
  690. * {xref-SafeCast-toUint104-uint256-}[`++toUint104(value)++`]
  691. * {xref-SafeCast-toUint96-uint256-}[`++toUint96(value)++`]
  692. * {xref-SafeCast-toUint88-uint256-}[`++toUint88(value)++`]
  693. * {xref-SafeCast-toUint80-uint256-}[`++toUint80(value)++`]
  694. * {xref-SafeCast-toUint72-uint256-}[`++toUint72(value)++`]
  695. * {xref-SafeCast-toUint64-uint256-}[`++toUint64(value)++`]
  696. * {xref-SafeCast-toUint56-uint256-}[`++toUint56(value)++`]
  697. * {xref-SafeCast-toUint48-uint256-}[`++toUint48(value)++`]
  698. * {xref-SafeCast-toUint40-uint256-}[`++toUint40(value)++`]
  699. * {xref-SafeCast-toUint32-uint256-}[`++toUint32(value)++`]
  700. * {xref-SafeCast-toUint24-uint256-}[`++toUint24(value)++`]
  701. * {xref-SafeCast-toUint16-uint256-}[`++toUint16(value)++`]
  702. * {xref-SafeCast-toUint8-uint256-}[`++toUint8(value)++`]
  703. * {xref-SafeCast-toUint256-int256-}[`++toUint256(value)++`]
  704. * {xref-SafeCast-toInt248-int256-}[`++toInt248(value)++`]
  705. * {xref-SafeCast-toInt240-int256-}[`++toInt240(value)++`]
  706. * {xref-SafeCast-toInt232-int256-}[`++toInt232(value)++`]
  707. * {xref-SafeCast-toInt224-int256-}[`++toInt224(value)++`]
  708. * {xref-SafeCast-toInt216-int256-}[`++toInt216(value)++`]
  709. * {xref-SafeCast-toInt208-int256-}[`++toInt208(value)++`]
  710. * {xref-SafeCast-toInt200-int256-}[`++toInt200(value)++`]
  711. * {xref-SafeCast-toInt192-int256-}[`++toInt192(value)++`]
  712. * {xref-SafeCast-toInt184-int256-}[`++toInt184(value)++`]
  713. * {xref-SafeCast-toInt176-int256-}[`++toInt176(value)++`]
  714. * {xref-SafeCast-toInt168-int256-}[`++toInt168(value)++`]
  715. * {xref-SafeCast-toInt160-int256-}[`++toInt160(value)++`]
  716. * {xref-SafeCast-toInt152-int256-}[`++toInt152(value)++`]
  717. * {xref-SafeCast-toInt144-int256-}[`++toInt144(value)++`]
  718. * {xref-SafeCast-toInt136-int256-}[`++toInt136(value)++`]
  719. * {xref-SafeCast-toInt128-int256-}[`++toInt128(value)++`]
  720. * {xref-SafeCast-toInt120-int256-}[`++toInt120(value)++`]
  721. * {xref-SafeCast-toInt112-int256-}[`++toInt112(value)++`]
  722. * {xref-SafeCast-toInt104-int256-}[`++toInt104(value)++`]
  723. * {xref-SafeCast-toInt96-int256-}[`++toInt96(value)++`]
  724. * {xref-SafeCast-toInt88-int256-}[`++toInt88(value)++`]
  725. * {xref-SafeCast-toInt80-int256-}[`++toInt80(value)++`]
  726. * {xref-SafeCast-toInt72-int256-}[`++toInt72(value)++`]
  727. * {xref-SafeCast-toInt64-int256-}[`++toInt64(value)++`]
  728. * {xref-SafeCast-toInt56-int256-}[`++toInt56(value)++`]
  729. * {xref-SafeCast-toInt48-int256-}[`++toInt48(value)++`]
  730. * {xref-SafeCast-toInt40-int256-}[`++toInt40(value)++`]
  731. * {xref-SafeCast-toInt32-int256-}[`++toInt32(value)++`]
  732. * {xref-SafeCast-toInt24-int256-}[`++toInt24(value)++`]
  733. * {xref-SafeCast-toInt16-int256-}[`++toInt16(value)++`]
  734. * {xref-SafeCast-toInt8-int256-}[`++toInt8(value)++`]
  735. * {xref-SafeCast-toInt256-uint256-}[`++toInt256(value)++`]
  736. --
  737. [.contract-index]
  738. .Errors
  739. --
  740. * {xref-SafeCast-SafeCastOverflowedUintDowncast-uint8-uint256-}[`++SafeCastOverflowedUintDowncast(bits, value)++`]
  741. * {xref-SafeCast-SafeCastOverflowedIntToUint-int256-}[`++SafeCastOverflowedIntToUint(value)++`]
  742. * {xref-SafeCast-SafeCastOverflowedIntDowncast-uint8-int256-}[`++SafeCastOverflowedIntDowncast(bits, value)++`]
  743. * {xref-SafeCast-SafeCastOverflowedUintToInt-uint256-}[`++SafeCastOverflowedUintToInt(value)++`]
  744. --
  745. [.contract-item]
  746. [[SafeCast-toUint248-uint256-]]
  747. ==== `[.contract-item-name]#++toUint248++#++(uint256 value) → uint248++` [.item-kind]#internal#
  748. Returns the downcasted uint248 from uint256, reverting on
  749. overflow (when the input is greater than largest uint248).
  750. Counterpart to Solidity's `uint248` operator.
  751. Requirements:
  752. - input must fit into 248 bits
  753. [.contract-item]
  754. [[SafeCast-toUint240-uint256-]]
  755. ==== `[.contract-item-name]#++toUint240++#++(uint256 value) → uint240++` [.item-kind]#internal#
  756. Returns the downcasted uint240 from uint256, reverting on
  757. overflow (when the input is greater than largest uint240).
  758. Counterpart to Solidity's `uint240` operator.
  759. Requirements:
  760. - input must fit into 240 bits
  761. [.contract-item]
  762. [[SafeCast-toUint232-uint256-]]
  763. ==== `[.contract-item-name]#++toUint232++#++(uint256 value) → uint232++` [.item-kind]#internal#
  764. Returns the downcasted uint232 from uint256, reverting on
  765. overflow (when the input is greater than largest uint232).
  766. Counterpart to Solidity's `uint232` operator.
  767. Requirements:
  768. - input must fit into 232 bits
  769. [.contract-item]
  770. [[SafeCast-toUint224-uint256-]]
  771. ==== `[.contract-item-name]#++toUint224++#++(uint256 value) → uint224++` [.item-kind]#internal#
  772. Returns the downcasted uint224 from uint256, reverting on
  773. overflow (when the input is greater than largest uint224).
  774. Counterpart to Solidity's `uint224` operator.
  775. Requirements:
  776. - input must fit into 224 bits
  777. [.contract-item]
  778. [[SafeCast-toUint216-uint256-]]
  779. ==== `[.contract-item-name]#++toUint216++#++(uint256 value) → uint216++` [.item-kind]#internal#
  780. Returns the downcasted uint216 from uint256, reverting on
  781. overflow (when the input is greater than largest uint216).
  782. Counterpart to Solidity's `uint216` operator.
  783. Requirements:
  784. - input must fit into 216 bits
  785. [.contract-item]
  786. [[SafeCast-toUint208-uint256-]]
  787. ==== `[.contract-item-name]#++toUint208++#++(uint256 value) → uint208++` [.item-kind]#internal#
  788. Returns the downcasted uint208 from uint256, reverting on
  789. overflow (when the input is greater than largest uint208).
  790. Counterpart to Solidity's `uint208` operator.
  791. Requirements:
  792. - input must fit into 208 bits
  793. [.contract-item]
  794. [[SafeCast-toUint200-uint256-]]
  795. ==== `[.contract-item-name]#++toUint200++#++(uint256 value) → uint200++` [.item-kind]#internal#
  796. Returns the downcasted uint200 from uint256, reverting on
  797. overflow (when the input is greater than largest uint200).
  798. Counterpart to Solidity's `uint200` operator.
  799. Requirements:
  800. - input must fit into 200 bits
  801. [.contract-item]
  802. [[SafeCast-toUint192-uint256-]]
  803. ==== `[.contract-item-name]#++toUint192++#++(uint256 value) → uint192++` [.item-kind]#internal#
  804. Returns the downcasted uint192 from uint256, reverting on
  805. overflow (when the input is greater than largest uint192).
  806. Counterpart to Solidity's `uint192` operator.
  807. Requirements:
  808. - input must fit into 192 bits
  809. [.contract-item]
  810. [[SafeCast-toUint184-uint256-]]
  811. ==== `[.contract-item-name]#++toUint184++#++(uint256 value) → uint184++` [.item-kind]#internal#
  812. Returns the downcasted uint184 from uint256, reverting on
  813. overflow (when the input is greater than largest uint184).
  814. Counterpart to Solidity's `uint184` operator.
  815. Requirements:
  816. - input must fit into 184 bits
  817. [.contract-item]
  818. [[SafeCast-toUint176-uint256-]]
  819. ==== `[.contract-item-name]#++toUint176++#++(uint256 value) → uint176++` [.item-kind]#internal#
  820. Returns the downcasted uint176 from uint256, reverting on
  821. overflow (when the input is greater than largest uint176).
  822. Counterpart to Solidity's `uint176` operator.
  823. Requirements:
  824. - input must fit into 176 bits
  825. [.contract-item]
  826. [[SafeCast-toUint168-uint256-]]
  827. ==== `[.contract-item-name]#++toUint168++#++(uint256 value) → uint168++` [.item-kind]#internal#
  828. Returns the downcasted uint168 from uint256, reverting on
  829. overflow (when the input is greater than largest uint168).
  830. Counterpart to Solidity's `uint168` operator.
  831. Requirements:
  832. - input must fit into 168 bits
  833. [.contract-item]
  834. [[SafeCast-toUint160-uint256-]]
  835. ==== `[.contract-item-name]#++toUint160++#++(uint256 value) → uint160++` [.item-kind]#internal#
  836. Returns the downcasted uint160 from uint256, reverting on
  837. overflow (when the input is greater than largest uint160).
  838. Counterpart to Solidity's `uint160` operator.
  839. Requirements:
  840. - input must fit into 160 bits
  841. [.contract-item]
  842. [[SafeCast-toUint152-uint256-]]
  843. ==== `[.contract-item-name]#++toUint152++#++(uint256 value) → uint152++` [.item-kind]#internal#
  844. Returns the downcasted uint152 from uint256, reverting on
  845. overflow (when the input is greater than largest uint152).
  846. Counterpart to Solidity's `uint152` operator.
  847. Requirements:
  848. - input must fit into 152 bits
  849. [.contract-item]
  850. [[SafeCast-toUint144-uint256-]]
  851. ==== `[.contract-item-name]#++toUint144++#++(uint256 value) → uint144++` [.item-kind]#internal#
  852. Returns the downcasted uint144 from uint256, reverting on
  853. overflow (when the input is greater than largest uint144).
  854. Counterpart to Solidity's `uint144` operator.
  855. Requirements:
  856. - input must fit into 144 bits
  857. [.contract-item]
  858. [[SafeCast-toUint136-uint256-]]
  859. ==== `[.contract-item-name]#++toUint136++#++(uint256 value) → uint136++` [.item-kind]#internal#
  860. Returns the downcasted uint136 from uint256, reverting on
  861. overflow (when the input is greater than largest uint136).
  862. Counterpart to Solidity's `uint136` operator.
  863. Requirements:
  864. - input must fit into 136 bits
  865. [.contract-item]
  866. [[SafeCast-toUint128-uint256-]]
  867. ==== `[.contract-item-name]#++toUint128++#++(uint256 value) → uint128++` [.item-kind]#internal#
  868. Returns the downcasted uint128 from uint256, reverting on
  869. overflow (when the input is greater than largest uint128).
  870. Counterpart to Solidity's `uint128` operator.
  871. Requirements:
  872. - input must fit into 128 bits
  873. [.contract-item]
  874. [[SafeCast-toUint120-uint256-]]
  875. ==== `[.contract-item-name]#++toUint120++#++(uint256 value) → uint120++` [.item-kind]#internal#
  876. Returns the downcasted uint120 from uint256, reverting on
  877. overflow (when the input is greater than largest uint120).
  878. Counterpart to Solidity's `uint120` operator.
  879. Requirements:
  880. - input must fit into 120 bits
  881. [.contract-item]
  882. [[SafeCast-toUint112-uint256-]]
  883. ==== `[.contract-item-name]#++toUint112++#++(uint256 value) → uint112++` [.item-kind]#internal#
  884. Returns the downcasted uint112 from uint256, reverting on
  885. overflow (when the input is greater than largest uint112).
  886. Counterpart to Solidity's `uint112` operator.
  887. Requirements:
  888. - input must fit into 112 bits
  889. [.contract-item]
  890. [[SafeCast-toUint104-uint256-]]
  891. ==== `[.contract-item-name]#++toUint104++#++(uint256 value) → uint104++` [.item-kind]#internal#
  892. Returns the downcasted uint104 from uint256, reverting on
  893. overflow (when the input is greater than largest uint104).
  894. Counterpart to Solidity's `uint104` operator.
  895. Requirements:
  896. - input must fit into 104 bits
  897. [.contract-item]
  898. [[SafeCast-toUint96-uint256-]]
  899. ==== `[.contract-item-name]#++toUint96++#++(uint256 value) → uint96++` [.item-kind]#internal#
  900. Returns the downcasted uint96 from uint256, reverting on
  901. overflow (when the input is greater than largest uint96).
  902. Counterpart to Solidity's `uint96` operator.
  903. Requirements:
  904. - input must fit into 96 bits
  905. [.contract-item]
  906. [[SafeCast-toUint88-uint256-]]
  907. ==== `[.contract-item-name]#++toUint88++#++(uint256 value) → uint88++` [.item-kind]#internal#
  908. Returns the downcasted uint88 from uint256, reverting on
  909. overflow (when the input is greater than largest uint88).
  910. Counterpart to Solidity's `uint88` operator.
  911. Requirements:
  912. - input must fit into 88 bits
  913. [.contract-item]
  914. [[SafeCast-toUint80-uint256-]]
  915. ==== `[.contract-item-name]#++toUint80++#++(uint256 value) → uint80++` [.item-kind]#internal#
  916. Returns the downcasted uint80 from uint256, reverting on
  917. overflow (when the input is greater than largest uint80).
  918. Counterpart to Solidity's `uint80` operator.
  919. Requirements:
  920. - input must fit into 80 bits
  921. [.contract-item]
  922. [[SafeCast-toUint72-uint256-]]
  923. ==== `[.contract-item-name]#++toUint72++#++(uint256 value) → uint72++` [.item-kind]#internal#
  924. Returns the downcasted uint72 from uint256, reverting on
  925. overflow (when the input is greater than largest uint72).
  926. Counterpart to Solidity's `uint72` operator.
  927. Requirements:
  928. - input must fit into 72 bits
  929. [.contract-item]
  930. [[SafeCast-toUint64-uint256-]]
  931. ==== `[.contract-item-name]#++toUint64++#++(uint256 value) → uint64++` [.item-kind]#internal#
  932. Returns the downcasted uint64 from uint256, reverting on
  933. overflow (when the input is greater than largest uint64).
  934. Counterpart to Solidity's `uint64` operator.
  935. Requirements:
  936. - input must fit into 64 bits
  937. [.contract-item]
  938. [[SafeCast-toUint56-uint256-]]
  939. ==== `[.contract-item-name]#++toUint56++#++(uint256 value) → uint56++` [.item-kind]#internal#
  940. Returns the downcasted uint56 from uint256, reverting on
  941. overflow (when the input is greater than largest uint56).
  942. Counterpart to Solidity's `uint56` operator.
  943. Requirements:
  944. - input must fit into 56 bits
  945. [.contract-item]
  946. [[SafeCast-toUint48-uint256-]]
  947. ==== `[.contract-item-name]#++toUint48++#++(uint256 value) → uint48++` [.item-kind]#internal#
  948. Returns the downcasted uint48 from uint256, reverting on
  949. overflow (when the input is greater than largest uint48).
  950. Counterpart to Solidity's `uint48` operator.
  951. Requirements:
  952. - input must fit into 48 bits
  953. [.contract-item]
  954. [[SafeCast-toUint40-uint256-]]
  955. ==== `[.contract-item-name]#++toUint40++#++(uint256 value) → uint40++` [.item-kind]#internal#
  956. Returns the downcasted uint40 from uint256, reverting on
  957. overflow (when the input is greater than largest uint40).
  958. Counterpart to Solidity's `uint40` operator.
  959. Requirements:
  960. - input must fit into 40 bits
  961. [.contract-item]
  962. [[SafeCast-toUint32-uint256-]]
  963. ==== `[.contract-item-name]#++toUint32++#++(uint256 value) → uint32++` [.item-kind]#internal#
  964. Returns the downcasted uint32 from uint256, reverting on
  965. overflow (when the input is greater than largest uint32).
  966. Counterpart to Solidity's `uint32` operator.
  967. Requirements:
  968. - input must fit into 32 bits
  969. [.contract-item]
  970. [[SafeCast-toUint24-uint256-]]
  971. ==== `[.contract-item-name]#++toUint24++#++(uint256 value) → uint24++` [.item-kind]#internal#
  972. Returns the downcasted uint24 from uint256, reverting on
  973. overflow (when the input is greater than largest uint24).
  974. Counterpart to Solidity's `uint24` operator.
  975. Requirements:
  976. - input must fit into 24 bits
  977. [.contract-item]
  978. [[SafeCast-toUint16-uint256-]]
  979. ==== `[.contract-item-name]#++toUint16++#++(uint256 value) → uint16++` [.item-kind]#internal#
  980. Returns the downcasted uint16 from uint256, reverting on
  981. overflow (when the input is greater than largest uint16).
  982. Counterpart to Solidity's `uint16` operator.
  983. Requirements:
  984. - input must fit into 16 bits
  985. [.contract-item]
  986. [[SafeCast-toUint8-uint256-]]
  987. ==== `[.contract-item-name]#++toUint8++#++(uint256 value) → uint8++` [.item-kind]#internal#
  988. Returns the downcasted uint8 from uint256, reverting on
  989. overflow (when the input is greater than largest uint8).
  990. Counterpart to Solidity's `uint8` operator.
  991. Requirements:
  992. - input must fit into 8 bits
  993. [.contract-item]
  994. [[SafeCast-toUint256-int256-]]
  995. ==== `[.contract-item-name]#++toUint256++#++(int256 value) → uint256++` [.item-kind]#internal#
  996. Converts a signed int256 into an unsigned uint256.
  997. Requirements:
  998. - input must be greater than or equal to 0.
  999. [.contract-item]
  1000. [[SafeCast-toInt248-int256-]]
  1001. ==== `[.contract-item-name]#++toInt248++#++(int256 value) → int248 downcasted++` [.item-kind]#internal#
  1002. Returns the downcasted int248 from int256, reverting on
  1003. overflow (when the input is less than smallest int248 or
  1004. greater than largest int248).
  1005. Counterpart to Solidity's `int248` operator.
  1006. Requirements:
  1007. - input must fit into 248 bits
  1008. [.contract-item]
  1009. [[SafeCast-toInt240-int256-]]
  1010. ==== `[.contract-item-name]#++toInt240++#++(int256 value) → int240 downcasted++` [.item-kind]#internal#
  1011. Returns the downcasted int240 from int256, reverting on
  1012. overflow (when the input is less than smallest int240 or
  1013. greater than largest int240).
  1014. Counterpart to Solidity's `int240` operator.
  1015. Requirements:
  1016. - input must fit into 240 bits
  1017. [.contract-item]
  1018. [[SafeCast-toInt232-int256-]]
  1019. ==== `[.contract-item-name]#++toInt232++#++(int256 value) → int232 downcasted++` [.item-kind]#internal#
  1020. Returns the downcasted int232 from int256, reverting on
  1021. overflow (when the input is less than smallest int232 or
  1022. greater than largest int232).
  1023. Counterpart to Solidity's `int232` operator.
  1024. Requirements:
  1025. - input must fit into 232 bits
  1026. [.contract-item]
  1027. [[SafeCast-toInt224-int256-]]
  1028. ==== `[.contract-item-name]#++toInt224++#++(int256 value) → int224 downcasted++` [.item-kind]#internal#
  1029. Returns the downcasted int224 from int256, reverting on
  1030. overflow (when the input is less than smallest int224 or
  1031. greater than largest int224).
  1032. Counterpart to Solidity's `int224` operator.
  1033. Requirements:
  1034. - input must fit into 224 bits
  1035. [.contract-item]
  1036. [[SafeCast-toInt216-int256-]]
  1037. ==== `[.contract-item-name]#++toInt216++#++(int256 value) → int216 downcasted++` [.item-kind]#internal#
  1038. Returns the downcasted int216 from int256, reverting on
  1039. overflow (when the input is less than smallest int216 or
  1040. greater than largest int216).
  1041. Counterpart to Solidity's `int216` operator.
  1042. Requirements:
  1043. - input must fit into 216 bits
  1044. [.contract-item]
  1045. [[SafeCast-toInt208-int256-]]
  1046. ==== `[.contract-item-name]#++toInt208++#++(int256 value) → int208 downcasted++` [.item-kind]#internal#
  1047. Returns the downcasted int208 from int256, reverting on
  1048. overflow (when the input is less than smallest int208 or
  1049. greater than largest int208).
  1050. Counterpart to Solidity's `int208` operator.
  1051. Requirements:
  1052. - input must fit into 208 bits
  1053. [.contract-item]
  1054. [[SafeCast-toInt200-int256-]]
  1055. ==== `[.contract-item-name]#++toInt200++#++(int256 value) → int200 downcasted++` [.item-kind]#internal#
  1056. Returns the downcasted int200 from int256, reverting on
  1057. overflow (when the input is less than smallest int200 or
  1058. greater than largest int200).
  1059. Counterpart to Solidity's `int200` operator.
  1060. Requirements:
  1061. - input must fit into 200 bits
  1062. [.contract-item]
  1063. [[SafeCast-toInt192-int256-]]
  1064. ==== `[.contract-item-name]#++toInt192++#++(int256 value) → int192 downcasted++` [.item-kind]#internal#
  1065. Returns the downcasted int192 from int256, reverting on
  1066. overflow (when the input is less than smallest int192 or
  1067. greater than largest int192).
  1068. Counterpart to Solidity's `int192` operator.
  1069. Requirements:
  1070. - input must fit into 192 bits
  1071. [.contract-item]
  1072. [[SafeCast-toInt184-int256-]]
  1073. ==== `[.contract-item-name]#++toInt184++#++(int256 value) → int184 downcasted++` [.item-kind]#internal#
  1074. Returns the downcasted int184 from int256, reverting on
  1075. overflow (when the input is less than smallest int184 or
  1076. greater than largest int184).
  1077. Counterpart to Solidity's `int184` operator.
  1078. Requirements:
  1079. - input must fit into 184 bits
  1080. [.contract-item]
  1081. [[SafeCast-toInt176-int256-]]
  1082. ==== `[.contract-item-name]#++toInt176++#++(int256 value) → int176 downcasted++` [.item-kind]#internal#
  1083. Returns the downcasted int176 from int256, reverting on
  1084. overflow (when the input is less than smallest int176 or
  1085. greater than largest int176).
  1086. Counterpart to Solidity's `int176` operator.
  1087. Requirements:
  1088. - input must fit into 176 bits
  1089. [.contract-item]
  1090. [[SafeCast-toInt168-int256-]]
  1091. ==== `[.contract-item-name]#++toInt168++#++(int256 value) → int168 downcasted++` [.item-kind]#internal#
  1092. Returns the downcasted int168 from int256, reverting on
  1093. overflow (when the input is less than smallest int168 or
  1094. greater than largest int168).
  1095. Counterpart to Solidity's `int168` operator.
  1096. Requirements:
  1097. - input must fit into 168 bits
  1098. [.contract-item]
  1099. [[SafeCast-toInt160-int256-]]
  1100. ==== `[.contract-item-name]#++toInt160++#++(int256 value) → int160 downcasted++` [.item-kind]#internal#
  1101. Returns the downcasted int160 from int256, reverting on
  1102. overflow (when the input is less than smallest int160 or
  1103. greater than largest int160).
  1104. Counterpart to Solidity's `int160` operator.
  1105. Requirements:
  1106. - input must fit into 160 bits
  1107. [.contract-item]
  1108. [[SafeCast-toInt152-int256-]]
  1109. ==== `[.contract-item-name]#++toInt152++#++(int256 value) → int152 downcasted++` [.item-kind]#internal#
  1110. Returns the downcasted int152 from int256, reverting on
  1111. overflow (when the input is less than smallest int152 or
  1112. greater than largest int152).
  1113. Counterpart to Solidity's `int152` operator.
  1114. Requirements:
  1115. - input must fit into 152 bits
  1116. [.contract-item]
  1117. [[SafeCast-toInt144-int256-]]
  1118. ==== `[.contract-item-name]#++toInt144++#++(int256 value) → int144 downcasted++` [.item-kind]#internal#
  1119. Returns the downcasted int144 from int256, reverting on
  1120. overflow (when the input is less than smallest int144 or
  1121. greater than largest int144).
  1122. Counterpart to Solidity's `int144` operator.
  1123. Requirements:
  1124. - input must fit into 144 bits
  1125. [.contract-item]
  1126. [[SafeCast-toInt136-int256-]]
  1127. ==== `[.contract-item-name]#++toInt136++#++(int256 value) → int136 downcasted++` [.item-kind]#internal#
  1128. Returns the downcasted int136 from int256, reverting on
  1129. overflow (when the input is less than smallest int136 or
  1130. greater than largest int136).
  1131. Counterpart to Solidity's `int136` operator.
  1132. Requirements:
  1133. - input must fit into 136 bits
  1134. [.contract-item]
  1135. [[SafeCast-toInt128-int256-]]
  1136. ==== `[.contract-item-name]#++toInt128++#++(int256 value) → int128 downcasted++` [.item-kind]#internal#
  1137. Returns the downcasted int128 from int256, reverting on
  1138. overflow (when the input is less than smallest int128 or
  1139. greater than largest int128).
  1140. Counterpart to Solidity's `int128` operator.
  1141. Requirements:
  1142. - input must fit into 128 bits
  1143. [.contract-item]
  1144. [[SafeCast-toInt120-int256-]]
  1145. ==== `[.contract-item-name]#++toInt120++#++(int256 value) → int120 downcasted++` [.item-kind]#internal#
  1146. Returns the downcasted int120 from int256, reverting on
  1147. overflow (when the input is less than smallest int120 or
  1148. greater than largest int120).
  1149. Counterpart to Solidity's `int120` operator.
  1150. Requirements:
  1151. - input must fit into 120 bits
  1152. [.contract-item]
  1153. [[SafeCast-toInt112-int256-]]
  1154. ==== `[.contract-item-name]#++toInt112++#++(int256 value) → int112 downcasted++` [.item-kind]#internal#
  1155. Returns the downcasted int112 from int256, reverting on
  1156. overflow (when the input is less than smallest int112 or
  1157. greater than largest int112).
  1158. Counterpart to Solidity's `int112` operator.
  1159. Requirements:
  1160. - input must fit into 112 bits
  1161. [.contract-item]
  1162. [[SafeCast-toInt104-int256-]]
  1163. ==== `[.contract-item-name]#++toInt104++#++(int256 value) → int104 downcasted++` [.item-kind]#internal#
  1164. Returns the downcasted int104 from int256, reverting on
  1165. overflow (when the input is less than smallest int104 or
  1166. greater than largest int104).
  1167. Counterpart to Solidity's `int104` operator.
  1168. Requirements:
  1169. - input must fit into 104 bits
  1170. [.contract-item]
  1171. [[SafeCast-toInt96-int256-]]
  1172. ==== `[.contract-item-name]#++toInt96++#++(int256 value) → int96 downcasted++` [.item-kind]#internal#
  1173. Returns the downcasted int96 from int256, reverting on
  1174. overflow (when the input is less than smallest int96 or
  1175. greater than largest int96).
  1176. Counterpart to Solidity's `int96` operator.
  1177. Requirements:
  1178. - input must fit into 96 bits
  1179. [.contract-item]
  1180. [[SafeCast-toInt88-int256-]]
  1181. ==== `[.contract-item-name]#++toInt88++#++(int256 value) → int88 downcasted++` [.item-kind]#internal#
  1182. Returns the downcasted int88 from int256, reverting on
  1183. overflow (when the input is less than smallest int88 or
  1184. greater than largest int88).
  1185. Counterpart to Solidity's `int88` operator.
  1186. Requirements:
  1187. - input must fit into 88 bits
  1188. [.contract-item]
  1189. [[SafeCast-toInt80-int256-]]
  1190. ==== `[.contract-item-name]#++toInt80++#++(int256 value) → int80 downcasted++` [.item-kind]#internal#
  1191. Returns the downcasted int80 from int256, reverting on
  1192. overflow (when the input is less than smallest int80 or
  1193. greater than largest int80).
  1194. Counterpart to Solidity's `int80` operator.
  1195. Requirements:
  1196. - input must fit into 80 bits
  1197. [.contract-item]
  1198. [[SafeCast-toInt72-int256-]]
  1199. ==== `[.contract-item-name]#++toInt72++#++(int256 value) → int72 downcasted++` [.item-kind]#internal#
  1200. Returns the downcasted int72 from int256, reverting on
  1201. overflow (when the input is less than smallest int72 or
  1202. greater than largest int72).
  1203. Counterpart to Solidity's `int72` operator.
  1204. Requirements:
  1205. - input must fit into 72 bits
  1206. [.contract-item]
  1207. [[SafeCast-toInt64-int256-]]
  1208. ==== `[.contract-item-name]#++toInt64++#++(int256 value) → int64 downcasted++` [.item-kind]#internal#
  1209. Returns the downcasted int64 from int256, reverting on
  1210. overflow (when the input is less than smallest int64 or
  1211. greater than largest int64).
  1212. Counterpart to Solidity's `int64` operator.
  1213. Requirements:
  1214. - input must fit into 64 bits
  1215. [.contract-item]
  1216. [[SafeCast-toInt56-int256-]]
  1217. ==== `[.contract-item-name]#++toInt56++#++(int256 value) → int56 downcasted++` [.item-kind]#internal#
  1218. Returns the downcasted int56 from int256, reverting on
  1219. overflow (when the input is less than smallest int56 or
  1220. greater than largest int56).
  1221. Counterpart to Solidity's `int56` operator.
  1222. Requirements:
  1223. - input must fit into 56 bits
  1224. [.contract-item]
  1225. [[SafeCast-toInt48-int256-]]
  1226. ==== `[.contract-item-name]#++toInt48++#++(int256 value) → int48 downcasted++` [.item-kind]#internal#
  1227. Returns the downcasted int48 from int256, reverting on
  1228. overflow (when the input is less than smallest int48 or
  1229. greater than largest int48).
  1230. Counterpart to Solidity's `int48` operator.
  1231. Requirements:
  1232. - input must fit into 48 bits
  1233. [.contract-item]
  1234. [[SafeCast-toInt40-int256-]]
  1235. ==== `[.contract-item-name]#++toInt40++#++(int256 value) → int40 downcasted++` [.item-kind]#internal#
  1236. Returns the downcasted int40 from int256, reverting on
  1237. overflow (when the input is less than smallest int40 or
  1238. greater than largest int40).
  1239. Counterpart to Solidity's `int40` operator.
  1240. Requirements:
  1241. - input must fit into 40 bits
  1242. [.contract-item]
  1243. [[SafeCast-toInt32-int256-]]
  1244. ==== `[.contract-item-name]#++toInt32++#++(int256 value) → int32 downcasted++` [.item-kind]#internal#
  1245. Returns the downcasted int32 from int256, reverting on
  1246. overflow (when the input is less than smallest int32 or
  1247. greater than largest int32).
  1248. Counterpart to Solidity's `int32` operator.
  1249. Requirements:
  1250. - input must fit into 32 bits
  1251. [.contract-item]
  1252. [[SafeCast-toInt24-int256-]]
  1253. ==== `[.contract-item-name]#++toInt24++#++(int256 value) → int24 downcasted++` [.item-kind]#internal#
  1254. Returns the downcasted int24 from int256, reverting on
  1255. overflow (when the input is less than smallest int24 or
  1256. greater than largest int24).
  1257. Counterpart to Solidity's `int24` operator.
  1258. Requirements:
  1259. - input must fit into 24 bits
  1260. [.contract-item]
  1261. [[SafeCast-toInt16-int256-]]
  1262. ==== `[.contract-item-name]#++toInt16++#++(int256 value) → int16 downcasted++` [.item-kind]#internal#
  1263. Returns the downcasted int16 from int256, reverting on
  1264. overflow (when the input is less than smallest int16 or
  1265. greater than largest int16).
  1266. Counterpart to Solidity's `int16` operator.
  1267. Requirements:
  1268. - input must fit into 16 bits
  1269. [.contract-item]
  1270. [[SafeCast-toInt8-int256-]]
  1271. ==== `[.contract-item-name]#++toInt8++#++(int256 value) → int8 downcasted++` [.item-kind]#internal#
  1272. Returns the downcasted int8 from int256, reverting on
  1273. overflow (when the input is less than smallest int8 or
  1274. greater than largest int8).
  1275. Counterpart to Solidity's `int8` operator.
  1276. Requirements:
  1277. - input must fit into 8 bits
  1278. [.contract-item]
  1279. [[SafeCast-toInt256-uint256-]]
  1280. ==== `[.contract-item-name]#++toInt256++#++(uint256 value) → int256++` [.item-kind]#internal#
  1281. Converts an unsigned uint256 into a signed int256.
  1282. Requirements:
  1283. - input must be less than or equal to maxInt256.
  1284. [.contract-item]
  1285. [[SafeCast-SafeCastOverflowedUintDowncast-uint8-uint256-]]
  1286. ==== `[.contract-item-name]#++SafeCastOverflowedUintDowncast++#++(uint8 bits, uint256 value)++` [.item-kind]#error#
  1287. Value doesn't fit in an uint of `bits` size.
  1288. [.contract-item]
  1289. [[SafeCast-SafeCastOverflowedIntToUint-int256-]]
  1290. ==== `[.contract-item-name]#++SafeCastOverflowedIntToUint++#++(int256 value)++` [.item-kind]#error#
  1291. An int value doesn't fit in an uint of `bits` size.
  1292. [.contract-item]
  1293. [[SafeCast-SafeCastOverflowedIntDowncast-uint8-int256-]]
  1294. ==== `[.contract-item-name]#++SafeCastOverflowedIntDowncast++#++(uint8 bits, int256 value)++` [.item-kind]#error#
  1295. Value doesn't fit in an int of `bits` size.
  1296. [.contract-item]
  1297. [[SafeCast-SafeCastOverflowedUintToInt-uint256-]]
  1298. ==== `[.contract-item-name]#++SafeCastOverflowedUintToInt++#++(uint256 value)++` [.item-kind]#error#
  1299. An uint value doesn't fit in an int of `bits` size.
  1300. == Cryptography
  1301. :RecoverError: pass:normal[xref:#ECDSA-RecoverError[`++RecoverError++`]]
  1302. :ECDSAInvalidSignature: pass:normal[xref:#ECDSA-ECDSAInvalidSignature--[`++ECDSAInvalidSignature++`]]
  1303. :ECDSAInvalidSignatureLength: pass:normal[xref:#ECDSA-ECDSAInvalidSignatureLength-uint256-[`++ECDSAInvalidSignatureLength++`]]
  1304. :ECDSAInvalidSignatureS: pass:normal[xref:#ECDSA-ECDSAInvalidSignatureS-bytes32-[`++ECDSAInvalidSignatureS++`]]
  1305. :tryRecover: pass:normal[xref:#ECDSA-tryRecover-bytes32-bytes-[`++tryRecover++`]]
  1306. :recover: pass:normal[xref:#ECDSA-recover-bytes32-bytes-[`++recover++`]]
  1307. :tryRecover: pass:normal[xref:#ECDSA-tryRecover-bytes32-bytes32-bytes32-[`++tryRecover++`]]
  1308. :recover: pass:normal[xref:#ECDSA-recover-bytes32-bytes32-bytes32-[`++recover++`]]
  1309. :tryRecover: pass:normal[xref:#ECDSA-tryRecover-bytes32-uint8-bytes32-bytes32-[`++tryRecover++`]]
  1310. :recover: pass:normal[xref:#ECDSA-recover-bytes32-uint8-bytes32-bytes32-[`++recover++`]]
  1311. [.contract]
  1312. [[ECDSA]]
  1313. === `++ECDSA++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/cryptography/ECDSA.sol[{github-icon},role=heading-link]
  1314. [.hljs-theme-light.nopadding]
  1315. ```solidity
  1316. import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
  1317. ```
  1318. Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
  1319. These functions can be used to verify that a message was signed by the holder
  1320. of the private keys of a given address.
  1321. [.contract-index]
  1322. .Functions
  1323. --
  1324. * {xref-ECDSA-tryRecover-bytes32-bytes-}[`++tryRecover(hash, signature)++`]
  1325. * {xref-ECDSA-recover-bytes32-bytes-}[`++recover(hash, signature)++`]
  1326. * {xref-ECDSA-tryRecover-bytes32-bytes32-bytes32-}[`++tryRecover(hash, r, vs)++`]
  1327. * {xref-ECDSA-recover-bytes32-bytes32-bytes32-}[`++recover(hash, r, vs)++`]
  1328. * {xref-ECDSA-tryRecover-bytes32-uint8-bytes32-bytes32-}[`++tryRecover(hash, v, r, s)++`]
  1329. * {xref-ECDSA-recover-bytes32-uint8-bytes32-bytes32-}[`++recover(hash, v, r, s)++`]
  1330. --
  1331. [.contract-index]
  1332. .Errors
  1333. --
  1334. * {xref-ECDSA-ECDSAInvalidSignature--}[`++ECDSAInvalidSignature()++`]
  1335. * {xref-ECDSA-ECDSAInvalidSignatureLength-uint256-}[`++ECDSAInvalidSignatureLength(length)++`]
  1336. * {xref-ECDSA-ECDSAInvalidSignatureS-bytes32-}[`++ECDSAInvalidSignatureS(s)++`]
  1337. --
  1338. [.contract-item]
  1339. [[ECDSA-tryRecover-bytes32-bytes-]]
  1340. ==== `[.contract-item-name]#++tryRecover++#++(bytes32 hash, bytes signature) → address, enum ECDSA.RecoverError, bytes32++` [.item-kind]#internal#
  1341. Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
  1342. return address(0) without also returning an error description. Errors are documented using an enum (error type)
  1343. and a bytes32 providing additional information about the error.
  1344. If no error is returned, then the address can be used for verification purposes.
  1345. The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
  1346. this function rejects them by requiring the `s` value to be in the lower
  1347. half order, and the `v` value to be either 27 or 28.
  1348. IMPORTANT: `hash` _must_ be the result of a hash operation for the
  1349. verification to be secure: it is possible to craft signatures that
  1350. recover to arbitrary addresses for non-hashed data. A safe way to ensure
  1351. this is by receiving a hash of the original message (which may otherwise
  1352. be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
  1353. Documentation for signature generation:
  1354. - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
  1355. - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
  1356. [.contract-item]
  1357. [[ECDSA-recover-bytes32-bytes-]]
  1358. ==== `[.contract-item-name]#++recover++#++(bytes32 hash, bytes signature) → address++` [.item-kind]#internal#
  1359. Returns the address that signed a hashed message (`hash`) with
  1360. `signature`. This address can then be used for verification purposes.
  1361. The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
  1362. this function rejects them by requiring the `s` value to be in the lower
  1363. half order, and the `v` value to be either 27 or 28.
  1364. IMPORTANT: `hash` _must_ be the result of a hash operation for the
  1365. verification to be secure: it is possible to craft signatures that
  1366. recover to arbitrary addresses for non-hashed data. A safe way to ensure
  1367. this is by receiving a hash of the original message (which may otherwise
  1368. be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
  1369. [.contract-item]
  1370. [[ECDSA-tryRecover-bytes32-bytes32-bytes32-]]
  1371. ==== `[.contract-item-name]#++tryRecover++#++(bytes32 hash, bytes32 r, bytes32 vs) → address, enum ECDSA.RecoverError, bytes32++` [.item-kind]#internal#
  1372. Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
  1373. See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
  1374. [.contract-item]
  1375. [[ECDSA-recover-bytes32-bytes32-bytes32-]]
  1376. ==== `[.contract-item-name]#++recover++#++(bytes32 hash, bytes32 r, bytes32 vs) → address++` [.item-kind]#internal#
  1377. Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
  1378. [.contract-item]
  1379. [[ECDSA-tryRecover-bytes32-uint8-bytes32-bytes32-]]
  1380. ==== `[.contract-item-name]#++tryRecover++#++(bytes32 hash, uint8 v, bytes32 r, bytes32 s) → address, enum ECDSA.RecoverError, bytes32++` [.item-kind]#internal#
  1381. Overload of {ECDSA-tryRecover} that receives the `v`,
  1382. `r` and `s` signature fields separately.
  1383. [.contract-item]
  1384. [[ECDSA-recover-bytes32-uint8-bytes32-bytes32-]]
  1385. ==== `[.contract-item-name]#++recover++#++(bytes32 hash, uint8 v, bytes32 r, bytes32 s) → address++` [.item-kind]#internal#
  1386. Overload of {ECDSA-recover} that receives the `v`,
  1387. `r` and `s` signature fields separately.
  1388. [.contract-item]
  1389. [[ECDSA-ECDSAInvalidSignature--]]
  1390. ==== `[.contract-item-name]#++ECDSAInvalidSignature++#++()++` [.item-kind]#error#
  1391. The signature derives the `address(0)`.
  1392. [.contract-item]
  1393. [[ECDSA-ECDSAInvalidSignatureLength-uint256-]]
  1394. ==== `[.contract-item-name]#++ECDSAInvalidSignatureLength++#++(uint256 length)++` [.item-kind]#error#
  1395. The signature has an invalid length.
  1396. [.contract-item]
  1397. [[ECDSA-ECDSAInvalidSignatureS-bytes32-]]
  1398. ==== `[.contract-item-name]#++ECDSAInvalidSignatureS++#++(bytes32 s)++` [.item-kind]#error#
  1399. The signature has an S value that is in the upper half order.
  1400. :toEthSignedMessageHash: pass:normal[xref:#MessageHashUtils-toEthSignedMessageHash-bytes32-[`++toEthSignedMessageHash++`]]
  1401. :toEthSignedMessageHash: pass:normal[xref:#MessageHashUtils-toEthSignedMessageHash-bytes-[`++toEthSignedMessageHash++`]]
  1402. :toDataWithIntendedValidatorHash: pass:normal[xref:#MessageHashUtils-toDataWithIntendedValidatorHash-address-bytes-[`++toDataWithIntendedValidatorHash++`]]
  1403. :toTypedDataHash: pass:normal[xref:#MessageHashUtils-toTypedDataHash-bytes32-bytes32-[`++toTypedDataHash++`]]
  1404. [.contract]
  1405. [[MessageHashUtils]]
  1406. === `++MessageHashUtils++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/cryptography/MessageHashUtils.sol[{github-icon},role=heading-link]
  1407. [.hljs-theme-light.nopadding]
  1408. ```solidity
  1409. import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
  1410. ```
  1411. Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
  1412. The library provides methods for generating a hash of a message that conforms to the
  1413. https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
  1414. specifications.
  1415. [.contract-index]
  1416. .Functions
  1417. --
  1418. * {xref-MessageHashUtils-toEthSignedMessageHash-bytes32-}[`++toEthSignedMessageHash(messageHash)++`]
  1419. * {xref-MessageHashUtils-toEthSignedMessageHash-bytes-}[`++toEthSignedMessageHash(message)++`]
  1420. * {xref-MessageHashUtils-toDataWithIntendedValidatorHash-address-bytes-}[`++toDataWithIntendedValidatorHash(validator, data)++`]
  1421. * {xref-MessageHashUtils-toTypedDataHash-bytes32-bytes32-}[`++toTypedDataHash(domainSeparator, structHash)++`]
  1422. --
  1423. [.contract-item]
  1424. [[MessageHashUtils-toEthSignedMessageHash-bytes32-]]
  1425. ==== `[.contract-item-name]#++toEthSignedMessageHash++#++(bytes32 messageHash) → bytes32 digest++` [.item-kind]#internal#
  1426. Returns the keccak256 digest of an EIP-191 signed data with version
  1427. `0x45` (`personal_sign` messages).
  1428. The digest is calculated by prefixing a bytes32 `messageHash` with
  1429. `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
  1430. hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
  1431. NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
  1432. keccak256, although any bytes32 value can be safely used because the final digest will
  1433. be re-hashed.
  1434. See {ECDSA-recover}.
  1435. [.contract-item]
  1436. [[MessageHashUtils-toEthSignedMessageHash-bytes-]]
  1437. ==== `[.contract-item-name]#++toEthSignedMessageHash++#++(bytes message) → bytes32++` [.item-kind]#internal#
  1438. Returns the keccak256 digest of an EIP-191 signed data with version
  1439. `0x45` (`personal_sign` messages).
  1440. The digest is calculated by prefixing an arbitrary `message` with
  1441. `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
  1442. hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
  1443. See {ECDSA-recover}.
  1444. [.contract-item]
  1445. [[MessageHashUtils-toDataWithIntendedValidatorHash-address-bytes-]]
  1446. ==== `[.contract-item-name]#++toDataWithIntendedValidatorHash++#++(address validator, bytes data) → bytes32++` [.item-kind]#internal#
  1447. Returns the keccak256 digest of an EIP-191 signed data with version
  1448. `0x00` (data with intended validator).
  1449. The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
  1450. `validator` address. Then hashing the result.
  1451. See {ECDSA-recover}.
  1452. [.contract-item]
  1453. [[MessageHashUtils-toTypedDataHash-bytes32-bytes32-]]
  1454. ==== `[.contract-item-name]#++toTypedDataHash++#++(bytes32 domainSeparator, bytes32 structHash) → bytes32 digest++` [.item-kind]#internal#
  1455. Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
  1456. The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
  1457. `\x19\x01` and hashing the result. It corresponds to the hash signed by the
  1458. https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
  1459. See {ECDSA-recover}.
  1460. :isValidSignatureNow: pass:normal[xref:#SignatureChecker-isValidSignatureNow-address-bytes32-bytes-[`++isValidSignatureNow++`]]
  1461. :isValidERC1271SignatureNow: pass:normal[xref:#SignatureChecker-isValidERC1271SignatureNow-address-bytes32-bytes-[`++isValidERC1271SignatureNow++`]]
  1462. [.contract]
  1463. [[SignatureChecker]]
  1464. === `++SignatureChecker++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/cryptography/SignatureChecker.sol[{github-icon},role=heading-link]
  1465. [.hljs-theme-light.nopadding]
  1466. ```solidity
  1467. import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
  1468. ```
  1469. Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
  1470. signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
  1471. Argent and Safe Wallet (previously Gnosis Safe).
  1472. [.contract-index]
  1473. .Functions
  1474. --
  1475. * {xref-SignatureChecker-isValidSignatureNow-address-bytes32-bytes-}[`++isValidSignatureNow(signer, hash, signature)++`]
  1476. * {xref-SignatureChecker-isValidERC1271SignatureNow-address-bytes32-bytes-}[`++isValidERC1271SignatureNow(signer, hash, signature)++`]
  1477. --
  1478. [.contract-item]
  1479. [[SignatureChecker-isValidSignatureNow-address-bytes32-bytes-]]
  1480. ==== `[.contract-item-name]#++isValidSignatureNow++#++(address signer, bytes32 hash, bytes signature) → bool++` [.item-kind]#internal#
  1481. Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
  1482. signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
  1483. NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
  1484. change through time. It could return true at block N and false at block N+1 (or the opposite).
  1485. [.contract-item]
  1486. [[SignatureChecker-isValidERC1271SignatureNow-address-bytes32-bytes-]]
  1487. ==== `[.contract-item-name]#++isValidERC1271SignatureNow++#++(address signer, bytes32 hash, bytes signature) → bool++` [.item-kind]#internal#
  1488. Checks if a signature is valid for a given signer and data hash. The signature is validated
  1489. against the signer smart contract using ERC1271.
  1490. NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
  1491. change through time. It could return true at block N and false at block N+1 (or the opposite).
  1492. :MerkleProofInvalidMultiproof: pass:normal[xref:#MerkleProof-MerkleProofInvalidMultiproof--[`++MerkleProofInvalidMultiproof++`]]
  1493. :verify: pass:normal[xref:#MerkleProof-verify-bytes32---bytes32-bytes32-[`++verify++`]]
  1494. :verifyCalldata: pass:normal[xref:#MerkleProof-verifyCalldata-bytes32---bytes32-bytes32-[`++verifyCalldata++`]]
  1495. :processProof: pass:normal[xref:#MerkleProof-processProof-bytes32---bytes32-[`++processProof++`]]
  1496. :processProofCalldata: pass:normal[xref:#MerkleProof-processProofCalldata-bytes32---bytes32-[`++processProofCalldata++`]]
  1497. :multiProofVerify: pass:normal[xref:#MerkleProof-multiProofVerify-bytes32---bool---bytes32-bytes32---[`++multiProofVerify++`]]
  1498. :multiProofVerifyCalldata: pass:normal[xref:#MerkleProof-multiProofVerifyCalldata-bytes32---bool---bytes32-bytes32---[`++multiProofVerifyCalldata++`]]
  1499. :processMultiProof: pass:normal[xref:#MerkleProof-processMultiProof-bytes32---bool---bytes32---[`++processMultiProof++`]]
  1500. :processMultiProofCalldata: pass:normal[xref:#MerkleProof-processMultiProofCalldata-bytes32---bool---bytes32---[`++processMultiProofCalldata++`]]
  1501. [.contract]
  1502. [[MerkleProof]]
  1503. === `++MerkleProof++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/cryptography/MerkleProof.sol[{github-icon},role=heading-link]
  1504. [.hljs-theme-light.nopadding]
  1505. ```solidity
  1506. import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
  1507. ```
  1508. These functions deal with verification of Merkle Tree proofs.
  1509. The tree and the proofs can be generated using our
  1510. https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
  1511. You will find a quickstart guide in the readme.
  1512. WARNING: You should avoid using leaf values that are 64 bytes long prior to
  1513. hashing, or use a hash function other than keccak256 for hashing leaves.
  1514. This is because the concatenation of a sorted pair of internal nodes in
  1515. the Merkle tree could be reinterpreted as a leaf value.
  1516. OpenZeppelin's JavaScript library generates Merkle trees that are safe
  1517. against this attack out of the box.
  1518. [.contract-index]
  1519. .Functions
  1520. --
  1521. * {xref-MerkleProof-verify-bytes32---bytes32-bytes32-}[`++verify(proof, root, leaf)++`]
  1522. * {xref-MerkleProof-verifyCalldata-bytes32---bytes32-bytes32-}[`++verifyCalldata(proof, root, leaf)++`]
  1523. * {xref-MerkleProof-processProof-bytes32---bytes32-}[`++processProof(proof, leaf)++`]
  1524. * {xref-MerkleProof-processProofCalldata-bytes32---bytes32-}[`++processProofCalldata(proof, leaf)++`]
  1525. * {xref-MerkleProof-multiProofVerify-bytes32---bool---bytes32-bytes32---}[`++multiProofVerify(proof, proofFlags, root, leaves)++`]
  1526. * {xref-MerkleProof-multiProofVerifyCalldata-bytes32---bool---bytes32-bytes32---}[`++multiProofVerifyCalldata(proof, proofFlags, root, leaves)++`]
  1527. * {xref-MerkleProof-processMultiProof-bytes32---bool---bytes32---}[`++processMultiProof(proof, proofFlags, leaves)++`]
  1528. * {xref-MerkleProof-processMultiProofCalldata-bytes32---bool---bytes32---}[`++processMultiProofCalldata(proof, proofFlags, leaves)++`]
  1529. --
  1530. [.contract-index]
  1531. .Errors
  1532. --
  1533. * {xref-MerkleProof-MerkleProofInvalidMultiproof--}[`++MerkleProofInvalidMultiproof()++`]
  1534. --
  1535. [.contract-item]
  1536. [[MerkleProof-verify-bytes32---bytes32-bytes32-]]
  1537. ==== `[.contract-item-name]#++verify++#++(bytes32[] proof, bytes32 root, bytes32 leaf) → bool++` [.item-kind]#internal#
  1538. Returns true if a `leaf` can be proved to be a part of a Merkle tree
  1539. defined by `root`. For this, a `proof` must be provided, containing
  1540. sibling hashes on the branch from the leaf to the root of the tree. Each
  1541. pair of leaves and each pair of pre-images are assumed to be sorted.
  1542. [.contract-item]
  1543. [[MerkleProof-verifyCalldata-bytes32---bytes32-bytes32-]]
  1544. ==== `[.contract-item-name]#++verifyCalldata++#++(bytes32[] proof, bytes32 root, bytes32 leaf) → bool++` [.item-kind]#internal#
  1545. Calldata version of {verify}
  1546. [.contract-item]
  1547. [[MerkleProof-processProof-bytes32---bytes32-]]
  1548. ==== `[.contract-item-name]#++processProof++#++(bytes32[] proof, bytes32 leaf) → bytes32++` [.item-kind]#internal#
  1549. Returns the rebuilt hash obtained by traversing a Merkle tree up
  1550. from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
  1551. hash matches the root of the tree. When processing the proof, the pairs
  1552. of leafs & pre-images are assumed to be sorted.
  1553. [.contract-item]
  1554. [[MerkleProof-processProofCalldata-bytes32---bytes32-]]
  1555. ==== `[.contract-item-name]#++processProofCalldata++#++(bytes32[] proof, bytes32 leaf) → bytes32++` [.item-kind]#internal#
  1556. Calldata version of {processProof}
  1557. [.contract-item]
  1558. [[MerkleProof-multiProofVerify-bytes32---bool---bytes32-bytes32---]]
  1559. ==== `[.contract-item-name]#++multiProofVerify++#++(bytes32[] proof, bool[] proofFlags, bytes32 root, bytes32[] leaves) → bool++` [.item-kind]#internal#
  1560. Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
  1561. `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
  1562. CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
  1563. [.contract-item]
  1564. [[MerkleProof-multiProofVerifyCalldata-bytes32---bool---bytes32-bytes32---]]
  1565. ==== `[.contract-item-name]#++multiProofVerifyCalldata++#++(bytes32[] proof, bool[] proofFlags, bytes32 root, bytes32[] leaves) → bool++` [.item-kind]#internal#
  1566. Calldata version of {multiProofVerify}
  1567. CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
  1568. [.contract-item]
  1569. [[MerkleProof-processMultiProof-bytes32---bool---bytes32---]]
  1570. ==== `[.contract-item-name]#++processMultiProof++#++(bytes32[] proof, bool[] proofFlags, bytes32[] leaves) → bytes32 merkleRoot++` [.item-kind]#internal#
  1571. Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
  1572. proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
  1573. leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
  1574. respectively.
  1575. CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
  1576. is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
  1577. tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
  1578. [.contract-item]
  1579. [[MerkleProof-processMultiProofCalldata-bytes32---bool---bytes32---]]
  1580. ==== `[.contract-item-name]#++processMultiProofCalldata++#++(bytes32[] proof, bool[] proofFlags, bytes32[] leaves) → bytes32 merkleRoot++` [.item-kind]#internal#
  1581. Calldata version of {processMultiProof}.
  1582. CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
  1583. [.contract-item]
  1584. [[MerkleProof-MerkleProofInvalidMultiproof--]]
  1585. ==== `[.contract-item-name]#++MerkleProofInvalidMultiproof++#++()++` [.item-kind]#error#
  1586. The multiproof provided is not valid.
  1587. :constructor: pass:normal[xref:#EIP712-constructor-string-string-[`++constructor++`]]
  1588. :_domainSeparatorV4: pass:normal[xref:#EIP712-_domainSeparatorV4--[`++_domainSeparatorV4++`]]
  1589. :_hashTypedDataV4: pass:normal[xref:#EIP712-_hashTypedDataV4-bytes32-[`++_hashTypedDataV4++`]]
  1590. :eip712Domain: pass:normal[xref:#EIP712-eip712Domain--[`++eip712Domain++`]]
  1591. :_EIP712Name: pass:normal[xref:#EIP712-_EIP712Name--[`++_EIP712Name++`]]
  1592. :_EIP712Version: pass:normal[xref:#EIP712-_EIP712Version--[`++_EIP712Version++`]]
  1593. [.contract]
  1594. [[EIP712]]
  1595. === `++EIP712++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/cryptography/EIP712.sol[{github-icon},role=heading-link]
  1596. [.hljs-theme-light.nopadding]
  1597. ```solidity
  1598. import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
  1599. ```
  1600. https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
  1601. The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
  1602. encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract
  1603. does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to
  1604. produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.
  1605. This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
  1606. scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
  1607. ({_hashTypedDataV4}).
  1608. The implementation of the domain separator was designed to be as efficient as possible while still properly updating
  1609. the chain id to protect against replay attacks on an eventual fork of the chain.
  1610. NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
  1611. https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
  1612. NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
  1613. separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
  1614. separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
  1615. [.contract-index]
  1616. .Functions
  1617. --
  1618. * {xref-EIP712-constructor-string-string-}[`++constructor(name, version)++`]
  1619. * {xref-EIP712-_domainSeparatorV4--}[`++_domainSeparatorV4()++`]
  1620. * {xref-EIP712-_hashTypedDataV4-bytes32-}[`++_hashTypedDataV4(structHash)++`]
  1621. * {xref-EIP712-eip712Domain--}[`++eip712Domain()++`]
  1622. * {xref-EIP712-_EIP712Name--}[`++_EIP712Name()++`]
  1623. * {xref-EIP712-_EIP712Version--}[`++_EIP712Version()++`]
  1624. [.contract-subindex-inherited]
  1625. .IERC5267
  1626. --
  1627. [.contract-index]
  1628. .Events
  1629. --
  1630. [.contract-subindex-inherited]
  1631. .IERC5267
  1632. * {xref-IERC5267-EIP712DomainChanged--}[`++EIP712DomainChanged()++`]
  1633. --
  1634. [.contract-item]
  1635. [[EIP712-constructor-string-string-]]
  1636. ==== `[.contract-item-name]#++constructor++#++(string name, string version)++` [.item-kind]#internal#
  1637. Initializes the domain separator and parameter caches.
  1638. The meaning of `name` and `version` is specified in
  1639. https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
  1640. - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
  1641. - `version`: the current major version of the signing domain.
  1642. NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
  1643. contract upgrade].
  1644. [.contract-item]
  1645. [[EIP712-_domainSeparatorV4--]]
  1646. ==== `[.contract-item-name]#++_domainSeparatorV4++#++() → bytes32++` [.item-kind]#internal#
  1647. Returns the domain separator for the current chain.
  1648. [.contract-item]
  1649. [[EIP712-_hashTypedDataV4-bytes32-]]
  1650. ==== `[.contract-item-name]#++_hashTypedDataV4++#++(bytes32 structHash) → bytes32++` [.item-kind]#internal#
  1651. Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
  1652. function returns the hash of the fully encoded EIP712 message for this domain.
  1653. This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
  1654. ```solidity
  1655. bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
  1656. keccak256("Mail(address to,string contents)"),
  1657. mailTo,
  1658. keccak256(bytes(mailContents))
  1659. )));
  1660. address signer = ECDSA.recover(digest, signature);
  1661. ```
  1662. [.contract-item]
  1663. [[EIP712-eip712Domain--]]
  1664. ==== `[.contract-item-name]#++eip712Domain++#++() → bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions++` [.item-kind]#public#
  1665. See {IERC-5267}.
  1666. [.contract-item]
  1667. [[EIP712-_EIP712Name--]]
  1668. ==== `[.contract-item-name]#++_EIP712Name++#++() → string++` [.item-kind]#internal#
  1669. The name parameter for the EIP712 domain.
  1670. NOTE: By default this function reads _name which is an immutable value.
  1671. It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
  1672. [.contract-item]
  1673. [[EIP712-_EIP712Version--]]
  1674. ==== `[.contract-item-name]#++_EIP712Version++#++() → string++` [.item-kind]#internal#
  1675. The version parameter for the EIP712 domain.
  1676. NOTE: By default this function reads _version which is an immutable value.
  1677. It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
  1678. == Security
  1679. :ReentrancyGuardReentrantCall: pass:normal[xref:#ReentrancyGuard-ReentrancyGuardReentrantCall--[`++ReentrancyGuardReentrantCall++`]]
  1680. :constructor: pass:normal[xref:#ReentrancyGuard-constructor--[`++constructor++`]]
  1681. :nonReentrant: pass:normal[xref:#ReentrancyGuard-nonReentrant--[`++nonReentrant++`]]
  1682. :_reentrancyGuardEntered: pass:normal[xref:#ReentrancyGuard-_reentrancyGuardEntered--[`++_reentrancyGuardEntered++`]]
  1683. [.contract]
  1684. [[ReentrancyGuard]]
  1685. === `++ReentrancyGuard++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/ReentrancyGuard.sol[{github-icon},role=heading-link]
  1686. [.hljs-theme-light.nopadding]
  1687. ```solidity
  1688. import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
  1689. ```
  1690. Contract module that helps prevent reentrant calls to a function.
  1691. Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
  1692. available, which can be applied to functions to make sure there are no nested
  1693. (reentrant) calls to them.
  1694. Note that because there is a single `nonReentrant` guard, functions marked as
  1695. `nonReentrant` may not call one another. This can be worked around by making
  1696. those functions `private`, and then adding `external` `nonReentrant` entry
  1697. points to them.
  1698. TIP: If you would like to learn more about reentrancy and alternative ways
  1699. to protect against it, check out our blog post
  1700. https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
  1701. [.contract-index]
  1702. .Modifiers
  1703. --
  1704. * {xref-ReentrancyGuard-nonReentrant--}[`++nonReentrant()++`]
  1705. --
  1706. [.contract-index]
  1707. .Functions
  1708. --
  1709. * {xref-ReentrancyGuard-constructor--}[`++constructor()++`]
  1710. * {xref-ReentrancyGuard-_reentrancyGuardEntered--}[`++_reentrancyGuardEntered()++`]
  1711. --
  1712. [.contract-index]
  1713. .Errors
  1714. --
  1715. * {xref-ReentrancyGuard-ReentrancyGuardReentrantCall--}[`++ReentrancyGuardReentrantCall()++`]
  1716. --
  1717. [.contract-item]
  1718. [[ReentrancyGuard-nonReentrant--]]
  1719. ==== `[.contract-item-name]#++nonReentrant++#++()++` [.item-kind]#modifier#
  1720. Prevents a contract from calling itself, directly or indirectly.
  1721. Calling a `nonReentrant` function from another `nonReentrant`
  1722. function is not supported. It is possible to prevent this from happening
  1723. by making the `nonReentrant` function external, and making it call a
  1724. `private` function that does the actual work.
  1725. [.contract-item]
  1726. [[ReentrancyGuard-constructor--]]
  1727. ==== `[.contract-item-name]#++constructor++#++()++` [.item-kind]#internal#
  1728. [.contract-item]
  1729. [[ReentrancyGuard-_reentrancyGuardEntered--]]
  1730. ==== `[.contract-item-name]#++_reentrancyGuardEntered++#++() → bool++` [.item-kind]#internal#
  1731. Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
  1732. `nonReentrant` function in the call stack.
  1733. [.contract-item]
  1734. [[ReentrancyGuard-ReentrancyGuardReentrantCall--]]
  1735. ==== `[.contract-item-name]#++ReentrancyGuardReentrantCall++#++()++` [.item-kind]#error#
  1736. Unauthorized reentrant call.
  1737. :Paused: pass:normal[xref:#Pausable-Paused-address-[`++Paused++`]]
  1738. :Unpaused: pass:normal[xref:#Pausable-Unpaused-address-[`++Unpaused++`]]
  1739. :EnforcedPause: pass:normal[xref:#Pausable-EnforcedPause--[`++EnforcedPause++`]]
  1740. :ExpectedPause: pass:normal[xref:#Pausable-ExpectedPause--[`++ExpectedPause++`]]
  1741. :constructor: pass:normal[xref:#Pausable-constructor--[`++constructor++`]]
  1742. :whenNotPaused: pass:normal[xref:#Pausable-whenNotPaused--[`++whenNotPaused++`]]
  1743. :whenPaused: pass:normal[xref:#Pausable-whenPaused--[`++whenPaused++`]]
  1744. :paused: pass:normal[xref:#Pausable-paused--[`++paused++`]]
  1745. :_requireNotPaused: pass:normal[xref:#Pausable-_requireNotPaused--[`++_requireNotPaused++`]]
  1746. :_requirePaused: pass:normal[xref:#Pausable-_requirePaused--[`++_requirePaused++`]]
  1747. :_pause: pass:normal[xref:#Pausable-_pause--[`++_pause++`]]
  1748. :_unpause: pass:normal[xref:#Pausable-_unpause--[`++_unpause++`]]
  1749. [.contract]
  1750. [[Pausable]]
  1751. === `++Pausable++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Pausable.sol[{github-icon},role=heading-link]
  1752. [.hljs-theme-light.nopadding]
  1753. ```solidity
  1754. import "@openzeppelin/contracts/utils/Pausable.sol";
  1755. ```
  1756. Contract module which allows children to implement an emergency stop
  1757. mechanism that can be triggered by an authorized account.
  1758. This module is used through inheritance. It will make available the
  1759. modifiers `whenNotPaused` and `whenPaused`, which can be applied to
  1760. the functions of your contract. Note that they will not be pausable by
  1761. simply including this module, only once the modifiers are put in place.
  1762. [.contract-index]
  1763. .Modifiers
  1764. --
  1765. * {xref-Pausable-whenNotPaused--}[`++whenNotPaused()++`]
  1766. * {xref-Pausable-whenPaused--}[`++whenPaused()++`]
  1767. --
  1768. [.contract-index]
  1769. .Functions
  1770. --
  1771. * {xref-Pausable-constructor--}[`++constructor()++`]
  1772. * {xref-Pausable-paused--}[`++paused()++`]
  1773. * {xref-Pausable-_requireNotPaused--}[`++_requireNotPaused()++`]
  1774. * {xref-Pausable-_requirePaused--}[`++_requirePaused()++`]
  1775. * {xref-Pausable-_pause--}[`++_pause()++`]
  1776. * {xref-Pausable-_unpause--}[`++_unpause()++`]
  1777. --
  1778. [.contract-index]
  1779. .Events
  1780. --
  1781. * {xref-Pausable-Paused-address-}[`++Paused(account)++`]
  1782. * {xref-Pausable-Unpaused-address-}[`++Unpaused(account)++`]
  1783. --
  1784. [.contract-index]
  1785. .Errors
  1786. --
  1787. * {xref-Pausable-EnforcedPause--}[`++EnforcedPause()++`]
  1788. * {xref-Pausable-ExpectedPause--}[`++ExpectedPause()++`]
  1789. --
  1790. [.contract-item]
  1791. [[Pausable-whenNotPaused--]]
  1792. ==== `[.contract-item-name]#++whenNotPaused++#++()++` [.item-kind]#modifier#
  1793. Modifier to make a function callable only when the contract is not paused.
  1794. Requirements:
  1795. - The contract must not be paused.
  1796. [.contract-item]
  1797. [[Pausable-whenPaused--]]
  1798. ==== `[.contract-item-name]#++whenPaused++#++()++` [.item-kind]#modifier#
  1799. Modifier to make a function callable only when the contract is paused.
  1800. Requirements:
  1801. - The contract must be paused.
  1802. [.contract-item]
  1803. [[Pausable-constructor--]]
  1804. ==== `[.contract-item-name]#++constructor++#++()++` [.item-kind]#internal#
  1805. Initializes the contract in unpaused state.
  1806. [.contract-item]
  1807. [[Pausable-paused--]]
  1808. ==== `[.contract-item-name]#++paused++#++() → bool++` [.item-kind]#public#
  1809. Returns true if the contract is paused, and false otherwise.
  1810. [.contract-item]
  1811. [[Pausable-_requireNotPaused--]]
  1812. ==== `[.contract-item-name]#++_requireNotPaused++#++()++` [.item-kind]#internal#
  1813. Throws if the contract is paused.
  1814. [.contract-item]
  1815. [[Pausable-_requirePaused--]]
  1816. ==== `[.contract-item-name]#++_requirePaused++#++()++` [.item-kind]#internal#
  1817. Throws if the contract is not paused.
  1818. [.contract-item]
  1819. [[Pausable-_pause--]]
  1820. ==== `[.contract-item-name]#++_pause++#++()++` [.item-kind]#internal#
  1821. Triggers stopped state.
  1822. Requirements:
  1823. - The contract must not be paused.
  1824. [.contract-item]
  1825. [[Pausable-_unpause--]]
  1826. ==== `[.contract-item-name]#++_unpause++#++()++` [.item-kind]#internal#
  1827. Returns to normal state.
  1828. Requirements:
  1829. - The contract must be paused.
  1830. [.contract-item]
  1831. [[Pausable-Paused-address-]]
  1832. ==== `[.contract-item-name]#++Paused++#++(address account)++` [.item-kind]#event#
  1833. Emitted when the pause is triggered by `account`.
  1834. [.contract-item]
  1835. [[Pausable-Unpaused-address-]]
  1836. ==== `[.contract-item-name]#++Unpaused++#++(address account)++` [.item-kind]#event#
  1837. Emitted when the pause is lifted by `account`.
  1838. [.contract-item]
  1839. [[Pausable-EnforcedPause--]]
  1840. ==== `[.contract-item-name]#++EnforcedPause++#++()++` [.item-kind]#error#
  1841. The operation failed because the contract is paused.
  1842. [.contract-item]
  1843. [[Pausable-ExpectedPause--]]
  1844. ==== `[.contract-item-name]#++ExpectedPause++#++()++` [.item-kind]#error#
  1845. The operation failed because the contract is not paused.
  1846. :InvalidAccountNonce: pass:normal[xref:#Nonces-InvalidAccountNonce-address-uint256-[`++InvalidAccountNonce++`]]
  1847. :nonces: pass:normal[xref:#Nonces-nonces-address-[`++nonces++`]]
  1848. :_useNonce: pass:normal[xref:#Nonces-_useNonce-address-[`++_useNonce++`]]
  1849. :_useCheckedNonce: pass:normal[xref:#Nonces-_useCheckedNonce-address-uint256-[`++_useCheckedNonce++`]]
  1850. [.contract]
  1851. [[Nonces]]
  1852. === `++Nonces++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Nonces.sol[{github-icon},role=heading-link]
  1853. [.hljs-theme-light.nopadding]
  1854. ```solidity
  1855. import "@openzeppelin/contracts/utils/Nonces.sol";
  1856. ```
  1857. Provides tracking nonces for addresses. Nonces will only increment.
  1858. [.contract-index]
  1859. .Functions
  1860. --
  1861. * {xref-Nonces-nonces-address-}[`++nonces(owner)++`]
  1862. * {xref-Nonces-_useNonce-address-}[`++_useNonce(owner)++`]
  1863. * {xref-Nonces-_useCheckedNonce-address-uint256-}[`++_useCheckedNonce(owner, nonce)++`]
  1864. --
  1865. [.contract-index]
  1866. .Errors
  1867. --
  1868. * {xref-Nonces-InvalidAccountNonce-address-uint256-}[`++InvalidAccountNonce(account, currentNonce)++`]
  1869. --
  1870. [.contract-item]
  1871. [[Nonces-nonces-address-]]
  1872. ==== `[.contract-item-name]#++nonces++#++(address owner) → uint256++` [.item-kind]#public#
  1873. Returns the next unused nonce for an address.
  1874. [.contract-item]
  1875. [[Nonces-_useNonce-address-]]
  1876. ==== `[.contract-item-name]#++_useNonce++#++(address owner) → uint256++` [.item-kind]#internal#
  1877. Consumes a nonce.
  1878. Returns the current value and increments nonce.
  1879. [.contract-item]
  1880. [[Nonces-_useCheckedNonce-address-uint256-]]
  1881. ==== `[.contract-item-name]#++_useCheckedNonce++#++(address owner, uint256 nonce)++` [.item-kind]#internal#
  1882. Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.
  1883. [.contract-item]
  1884. [[Nonces-InvalidAccountNonce-address-uint256-]]
  1885. ==== `[.contract-item-name]#++InvalidAccountNonce++#++(address account, uint256 currentNonce)++` [.item-kind]#error#
  1886. The nonce used for an `account` is not the expected current nonce.
  1887. == Introspection
  1888. This set of interfaces and contracts deal with https://en.wikipedia.org/wiki/Type_introspection[type introspection] of contracts, that is, examining which functions can be called on them. This is usually referred to as a contract's _interface_.
  1889. Ethereum contracts have no native concept of an interface, so applications must usually simply trust they are not making an incorrect call. For trusted setups this is a non-issue, but often unknown and untrusted third-party addresses need to be interacted with. There may even not be any direct calls to them! (e.g. `ERC20` tokens may be sent to a contract that lacks a way to transfer them out of it, locking them forever). In these cases, a contract _declaring_ its interface can be very helpful in preventing errors.
  1890. :supportsInterface: pass:normal[xref:#IERC165-supportsInterface-bytes4-[`++supportsInterface++`]]
  1891. [.contract]
  1892. [[IERC165]]
  1893. === `++IERC165++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/introspection/IERC165.sol[{github-icon},role=heading-link]
  1894. [.hljs-theme-light.nopadding]
  1895. ```solidity
  1896. import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
  1897. ```
  1898. Interface of the ERC165 standard, as defined in the
  1899. https://eips.ethereum.org/EIPS/eip-165[EIP].
  1900. Implementers can declare support of contract interfaces, which can then be
  1901. queried by others ({ERC165Checker}).
  1902. For an implementation, see {ERC165}.
  1903. [.contract-index]
  1904. .Functions
  1905. --
  1906. * {xref-IERC165-supportsInterface-bytes4-}[`++supportsInterface(interfaceId)++`]
  1907. --
  1908. [.contract-item]
  1909. [[IERC165-supportsInterface-bytes4-]]
  1910. ==== `[.contract-item-name]#++supportsInterface++#++(bytes4 interfaceId) → bool++` [.item-kind]#external#
  1911. Returns true if this contract implements the interface defined by
  1912. `interfaceId`. See the corresponding
  1913. https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
  1914. to learn more about how these ids are created.
  1915. This function call must use less than 30 000 gas.
  1916. :supportsInterface: pass:normal[xref:#ERC165-supportsInterface-bytes4-[`++supportsInterface++`]]
  1917. [.contract]
  1918. [[ERC165]]
  1919. === `++ERC165++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/introspection/ERC165.sol[{github-icon},role=heading-link]
  1920. [.hljs-theme-light.nopadding]
  1921. ```solidity
  1922. import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
  1923. ```
  1924. Implementation of the {IERC165} interface.
  1925. Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
  1926. for the additional interface id that will be supported. For example:
  1927. ```solidity
  1928. function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
  1929. return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
  1930. }
  1931. ```
  1932. [.contract-index]
  1933. .Functions
  1934. --
  1935. * {xref-ERC165-supportsInterface-bytes4-}[`++supportsInterface(interfaceId)++`]
  1936. [.contract-subindex-inherited]
  1937. .IERC165
  1938. --
  1939. [.contract-item]
  1940. [[ERC165-supportsInterface-bytes4-]]
  1941. ==== `[.contract-item-name]#++supportsInterface++#++(bytes4 interfaceId) → bool++` [.item-kind]#public#
  1942. See {IERC165-supportsInterface}.
  1943. :supportsERC165: pass:normal[xref:#ERC165Checker-supportsERC165-address-[`++supportsERC165++`]]
  1944. :supportsInterface: pass:normal[xref:#ERC165Checker-supportsInterface-address-bytes4-[`++supportsInterface++`]]
  1945. :getSupportedInterfaces: pass:normal[xref:#ERC165Checker-getSupportedInterfaces-address-bytes4---[`++getSupportedInterfaces++`]]
  1946. :supportsAllInterfaces: pass:normal[xref:#ERC165Checker-supportsAllInterfaces-address-bytes4---[`++supportsAllInterfaces++`]]
  1947. :supportsERC165InterfaceUnchecked: pass:normal[xref:#ERC165Checker-supportsERC165InterfaceUnchecked-address-bytes4-[`++supportsERC165InterfaceUnchecked++`]]
  1948. [.contract]
  1949. [[ERC165Checker]]
  1950. === `++ERC165Checker++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/introspection/ERC165Checker.sol[{github-icon},role=heading-link]
  1951. [.hljs-theme-light.nopadding]
  1952. ```solidity
  1953. import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
  1954. ```
  1955. Library used to query support of an interface declared via {IERC165}.
  1956. Note that these functions return the actual result of the query: they do not
  1957. `revert` if an interface is not supported. It is up to the caller to decide
  1958. what to do in these cases.
  1959. [.contract-index]
  1960. .Functions
  1961. --
  1962. * {xref-ERC165Checker-supportsERC165-address-}[`++supportsERC165(account)++`]
  1963. * {xref-ERC165Checker-supportsInterface-address-bytes4-}[`++supportsInterface(account, interfaceId)++`]
  1964. * {xref-ERC165Checker-getSupportedInterfaces-address-bytes4---}[`++getSupportedInterfaces(account, interfaceIds)++`]
  1965. * {xref-ERC165Checker-supportsAllInterfaces-address-bytes4---}[`++supportsAllInterfaces(account, interfaceIds)++`]
  1966. * {xref-ERC165Checker-supportsERC165InterfaceUnchecked-address-bytes4-}[`++supportsERC165InterfaceUnchecked(account, interfaceId)++`]
  1967. --
  1968. [.contract-item]
  1969. [[ERC165Checker-supportsERC165-address-]]
  1970. ==== `[.contract-item-name]#++supportsERC165++#++(address account) → bool++` [.item-kind]#internal#
  1971. Returns true if `account` supports the {IERC165} interface.
  1972. [.contract-item]
  1973. [[ERC165Checker-supportsInterface-address-bytes4-]]
  1974. ==== `[.contract-item-name]#++supportsInterface++#++(address account, bytes4 interfaceId) → bool++` [.item-kind]#internal#
  1975. Returns true if `account` supports the interface defined by
  1976. `interfaceId`. Support for {IERC165} itself is queried automatically.
  1977. See {IERC165-supportsInterface}.
  1978. [.contract-item]
  1979. [[ERC165Checker-getSupportedInterfaces-address-bytes4---]]
  1980. ==== `[.contract-item-name]#++getSupportedInterfaces++#++(address account, bytes4[] interfaceIds) → bool[]++` [.item-kind]#internal#
  1981. Returns a boolean array where each value corresponds to the
  1982. interfaces passed in and whether they're supported or not. This allows
  1983. you to batch check interfaces for a contract where your expectation
  1984. is that some interfaces may not be supported.
  1985. See {IERC165-supportsInterface}.
  1986. [.contract-item]
  1987. [[ERC165Checker-supportsAllInterfaces-address-bytes4---]]
  1988. ==== `[.contract-item-name]#++supportsAllInterfaces++#++(address account, bytes4[] interfaceIds) → bool++` [.item-kind]#internal#
  1989. Returns true if `account` supports all the interfaces defined in
  1990. `interfaceIds`. Support for {IERC165} itself is queried automatically.
  1991. Batch-querying can lead to gas savings by skipping repeated checks for
  1992. {IERC165} support.
  1993. See {IERC165-supportsInterface}.
  1994. [.contract-item]
  1995. [[ERC165Checker-supportsERC165InterfaceUnchecked-address-bytes4-]]
  1996. ==== `[.contract-item-name]#++supportsERC165InterfaceUnchecked++#++(address account, bytes4 interfaceId) → bool++` [.item-kind]#internal#
  1997. Assumes that account contains a contract that supports ERC165, otherwise
  1998. the behavior of this method is undefined. This precondition can be checked
  1999. with {supportsERC165}.
  2000. Some precompiled contracts will falsely indicate support for a given interface, so caution
  2001. should be exercised when using this function.
  2002. Interface identification is specified in ERC-165.
  2003. == Data Structures
  2004. :BitMap: pass:normal[xref:#BitMaps-BitMap[`++BitMap++`]]
  2005. :get: pass:normal[xref:#BitMaps-get-struct-BitMaps-BitMap-uint256-[`++get++`]]
  2006. :setTo: pass:normal[xref:#BitMaps-setTo-struct-BitMaps-BitMap-uint256-bool-[`++setTo++`]]
  2007. :set: pass:normal[xref:#BitMaps-set-struct-BitMaps-BitMap-uint256-[`++set++`]]
  2008. :unset: pass:normal[xref:#BitMaps-unset-struct-BitMaps-BitMap-uint256-[`++unset++`]]
  2009. [.contract]
  2010. [[BitMaps]]
  2011. === `++BitMaps++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/structs/BitMaps.sol[{github-icon},role=heading-link]
  2012. [.hljs-theme-light.nopadding]
  2013. ```solidity
  2014. import "@openzeppelin/contracts/utils/structs/BitMaps.sol";
  2015. ```
  2016. Library for managing uint256 to bool mapping in a compact and efficient way, provided the keys are sequential.
  2017. Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
  2018. BitMaps pack 256 booleans across each bit of a single 256-bit slot of `uint256` type.
  2019. Hence booleans corresponding to 256 _sequential_ indices would only consume a single slot,
  2020. unlike the regular `bool` which would consume an entire slot for a single value.
  2021. This results in gas savings in two ways:
  2022. - Setting a zero value to non-zero only once every 256 times
  2023. - Accessing the same warm slot for every 256 _sequential_ indices
  2024. [.contract-index]
  2025. .Functions
  2026. --
  2027. * {xref-BitMaps-get-struct-BitMaps-BitMap-uint256-}[`++get(bitmap, index)++`]
  2028. * {xref-BitMaps-setTo-struct-BitMaps-BitMap-uint256-bool-}[`++setTo(bitmap, index, value)++`]
  2029. * {xref-BitMaps-set-struct-BitMaps-BitMap-uint256-}[`++set(bitmap, index)++`]
  2030. * {xref-BitMaps-unset-struct-BitMaps-BitMap-uint256-}[`++unset(bitmap, index)++`]
  2031. --
  2032. [.contract-item]
  2033. [[BitMaps-get-struct-BitMaps-BitMap-uint256-]]
  2034. ==== `[.contract-item-name]#++get++#++(struct BitMaps.BitMap bitmap, uint256 index) → bool++` [.item-kind]#internal#
  2035. Returns whether the bit at `index` is set.
  2036. [.contract-item]
  2037. [[BitMaps-setTo-struct-BitMaps-BitMap-uint256-bool-]]
  2038. ==== `[.contract-item-name]#++setTo++#++(struct BitMaps.BitMap bitmap, uint256 index, bool value)++` [.item-kind]#internal#
  2039. Sets the bit at `index` to the boolean `value`.
  2040. [.contract-item]
  2041. [[BitMaps-set-struct-BitMaps-BitMap-uint256-]]
  2042. ==== `[.contract-item-name]#++set++#++(struct BitMaps.BitMap bitmap, uint256 index)++` [.item-kind]#internal#
  2043. Sets the bit at `index`.
  2044. [.contract-item]
  2045. [[BitMaps-unset-struct-BitMaps-BitMap-uint256-]]
  2046. ==== `[.contract-item-name]#++unset++#++(struct BitMaps.BitMap bitmap, uint256 index)++` [.item-kind]#internal#
  2047. Unsets the bit at `index`.
  2048. :EnumerableMapNonexistentKey: pass:normal[xref:#EnumerableMap-EnumerableMapNonexistentKey-bytes32-[`++EnumerableMapNonexistentKey++`]]
  2049. :Bytes32ToBytes32Map: pass:normal[xref:#EnumerableMap-Bytes32ToBytes32Map[`++Bytes32ToBytes32Map++`]]
  2050. :set: pass:normal[xref:#EnumerableMap-set-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-bytes32-[`++set++`]]
  2051. :remove: pass:normal[xref:#EnumerableMap-remove-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-[`++remove++`]]
  2052. :contains: pass:normal[xref:#EnumerableMap-contains-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-[`++contains++`]]
  2053. :length: pass:normal[xref:#EnumerableMap-length-struct-EnumerableMap-Bytes32ToBytes32Map-[`++length++`]]
  2054. :at: pass:normal[xref:#EnumerableMap-at-struct-EnumerableMap-Bytes32ToBytes32Map-uint256-[`++at++`]]
  2055. :tryGet: pass:normal[xref:#EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-[`++tryGet++`]]
  2056. :get: pass:normal[xref:#EnumerableMap-get-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-[`++get++`]]
  2057. :keys: pass:normal[xref:#EnumerableMap-keys-struct-EnumerableMap-Bytes32ToBytes32Map-[`++keys++`]]
  2058. :UintToUintMap: pass:normal[xref:#EnumerableMap-UintToUintMap[`++UintToUintMap++`]]
  2059. :set: pass:normal[xref:#EnumerableMap-set-struct-EnumerableMap-UintToUintMap-uint256-uint256-[`++set++`]]
  2060. :remove: pass:normal[xref:#EnumerableMap-remove-struct-EnumerableMap-UintToUintMap-uint256-[`++remove++`]]
  2061. :contains: pass:normal[xref:#EnumerableMap-contains-struct-EnumerableMap-UintToUintMap-uint256-[`++contains++`]]
  2062. :length: pass:normal[xref:#EnumerableMap-length-struct-EnumerableMap-UintToUintMap-[`++length++`]]
  2063. :at: pass:normal[xref:#EnumerableMap-at-struct-EnumerableMap-UintToUintMap-uint256-[`++at++`]]
  2064. :tryGet: pass:normal[xref:#EnumerableMap-tryGet-struct-EnumerableMap-UintToUintMap-uint256-[`++tryGet++`]]
  2065. :get: pass:normal[xref:#EnumerableMap-get-struct-EnumerableMap-UintToUintMap-uint256-[`++get++`]]
  2066. :keys: pass:normal[xref:#EnumerableMap-keys-struct-EnumerableMap-UintToUintMap-[`++keys++`]]
  2067. :UintToAddressMap: pass:normal[xref:#EnumerableMap-UintToAddressMap[`++UintToAddressMap++`]]
  2068. :set: pass:normal[xref:#EnumerableMap-set-struct-EnumerableMap-UintToAddressMap-uint256-address-[`++set++`]]
  2069. :remove: pass:normal[xref:#EnumerableMap-remove-struct-EnumerableMap-UintToAddressMap-uint256-[`++remove++`]]
  2070. :contains: pass:normal[xref:#EnumerableMap-contains-struct-EnumerableMap-UintToAddressMap-uint256-[`++contains++`]]
  2071. :length: pass:normal[xref:#EnumerableMap-length-struct-EnumerableMap-UintToAddressMap-[`++length++`]]
  2072. :at: pass:normal[xref:#EnumerableMap-at-struct-EnumerableMap-UintToAddressMap-uint256-[`++at++`]]
  2073. :tryGet: pass:normal[xref:#EnumerableMap-tryGet-struct-EnumerableMap-UintToAddressMap-uint256-[`++tryGet++`]]
  2074. :get: pass:normal[xref:#EnumerableMap-get-struct-EnumerableMap-UintToAddressMap-uint256-[`++get++`]]
  2075. :keys: pass:normal[xref:#EnumerableMap-keys-struct-EnumerableMap-UintToAddressMap-[`++keys++`]]
  2076. :AddressToUintMap: pass:normal[xref:#EnumerableMap-AddressToUintMap[`++AddressToUintMap++`]]
  2077. :set: pass:normal[xref:#EnumerableMap-set-struct-EnumerableMap-AddressToUintMap-address-uint256-[`++set++`]]
  2078. :remove: pass:normal[xref:#EnumerableMap-remove-struct-EnumerableMap-AddressToUintMap-address-[`++remove++`]]
  2079. :contains: pass:normal[xref:#EnumerableMap-contains-struct-EnumerableMap-AddressToUintMap-address-[`++contains++`]]
  2080. :length: pass:normal[xref:#EnumerableMap-length-struct-EnumerableMap-AddressToUintMap-[`++length++`]]
  2081. :at: pass:normal[xref:#EnumerableMap-at-struct-EnumerableMap-AddressToUintMap-uint256-[`++at++`]]
  2082. :tryGet: pass:normal[xref:#EnumerableMap-tryGet-struct-EnumerableMap-AddressToUintMap-address-[`++tryGet++`]]
  2083. :get: pass:normal[xref:#EnumerableMap-get-struct-EnumerableMap-AddressToUintMap-address-[`++get++`]]
  2084. :keys: pass:normal[xref:#EnumerableMap-keys-struct-EnumerableMap-AddressToUintMap-[`++keys++`]]
  2085. :Bytes32ToUintMap: pass:normal[xref:#EnumerableMap-Bytes32ToUintMap[`++Bytes32ToUintMap++`]]
  2086. :set: pass:normal[xref:#EnumerableMap-set-struct-EnumerableMap-Bytes32ToUintMap-bytes32-uint256-[`++set++`]]
  2087. :remove: pass:normal[xref:#EnumerableMap-remove-struct-EnumerableMap-Bytes32ToUintMap-bytes32-[`++remove++`]]
  2088. :contains: pass:normal[xref:#EnumerableMap-contains-struct-EnumerableMap-Bytes32ToUintMap-bytes32-[`++contains++`]]
  2089. :length: pass:normal[xref:#EnumerableMap-length-struct-EnumerableMap-Bytes32ToUintMap-[`++length++`]]
  2090. :at: pass:normal[xref:#EnumerableMap-at-struct-EnumerableMap-Bytes32ToUintMap-uint256-[`++at++`]]
  2091. :tryGet: pass:normal[xref:#EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToUintMap-bytes32-[`++tryGet++`]]
  2092. :get: pass:normal[xref:#EnumerableMap-get-struct-EnumerableMap-Bytes32ToUintMap-bytes32-[`++get++`]]
  2093. :keys: pass:normal[xref:#EnumerableMap-keys-struct-EnumerableMap-Bytes32ToUintMap-[`++keys++`]]
  2094. [.contract]
  2095. [[EnumerableMap]]
  2096. === `++EnumerableMap++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/structs/EnumerableMap.sol[{github-icon},role=heading-link]
  2097. [.hljs-theme-light.nopadding]
  2098. ```solidity
  2099. import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
  2100. ```
  2101. Library for managing an enumerable variant of Solidity's
  2102. https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
  2103. type.
  2104. Maps have the following properties:
  2105. - Entries are added, removed, and checked for existence in constant time
  2106. (O(1)).
  2107. - Entries are enumerated in O(n). No guarantees are made on the ordering.
  2108. ```solidity
  2109. contract Example {
  2110. // Add the library methods
  2111. using EnumerableMap for EnumerableMap.UintToAddressMap;
  2112. // Declare a set state variable
  2113. EnumerableMap.UintToAddressMap private myMap;
  2114. }
  2115. ```
  2116. The following map types are supported:
  2117. - `uint256 -> address` (`UintToAddressMap`) since v3.0.0
  2118. - `address -> uint256` (`AddressToUintMap`) since v4.6.0
  2119. - `bytes32 -> bytes32` (`Bytes32ToBytes32Map`) since v4.6.0
  2120. - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0
  2121. - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0
  2122. [WARNING]
  2123. ====
  2124. Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
  2125. unusable.
  2126. See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
  2127. In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an
  2128. array of EnumerableMap.
  2129. ====
  2130. [.contract-index]
  2131. .Functions
  2132. --
  2133. * {xref-EnumerableMap-set-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-bytes32-}[`++set(map, key, value)++`]
  2134. * {xref-EnumerableMap-remove-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-}[`++remove(map, key)++`]
  2135. * {xref-EnumerableMap-contains-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-}[`++contains(map, key)++`]
  2136. * {xref-EnumerableMap-length-struct-EnumerableMap-Bytes32ToBytes32Map-}[`++length(map)++`]
  2137. * {xref-EnumerableMap-at-struct-EnumerableMap-Bytes32ToBytes32Map-uint256-}[`++at(map, index)++`]
  2138. * {xref-EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-}[`++tryGet(map, key)++`]
  2139. * {xref-EnumerableMap-get-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-}[`++get(map, key)++`]
  2140. * {xref-EnumerableMap-keys-struct-EnumerableMap-Bytes32ToBytes32Map-}[`++keys(map)++`]
  2141. * {xref-EnumerableMap-set-struct-EnumerableMap-UintToUintMap-uint256-uint256-}[`++set(map, key, value)++`]
  2142. * {xref-EnumerableMap-remove-struct-EnumerableMap-UintToUintMap-uint256-}[`++remove(map, key)++`]
  2143. * {xref-EnumerableMap-contains-struct-EnumerableMap-UintToUintMap-uint256-}[`++contains(map, key)++`]
  2144. * {xref-EnumerableMap-length-struct-EnumerableMap-UintToUintMap-}[`++length(map)++`]
  2145. * {xref-EnumerableMap-at-struct-EnumerableMap-UintToUintMap-uint256-}[`++at(map, index)++`]
  2146. * {xref-EnumerableMap-tryGet-struct-EnumerableMap-UintToUintMap-uint256-}[`++tryGet(map, key)++`]
  2147. * {xref-EnumerableMap-get-struct-EnumerableMap-UintToUintMap-uint256-}[`++get(map, key)++`]
  2148. * {xref-EnumerableMap-keys-struct-EnumerableMap-UintToUintMap-}[`++keys(map)++`]
  2149. * {xref-EnumerableMap-set-struct-EnumerableMap-UintToAddressMap-uint256-address-}[`++set(map, key, value)++`]
  2150. * {xref-EnumerableMap-remove-struct-EnumerableMap-UintToAddressMap-uint256-}[`++remove(map, key)++`]
  2151. * {xref-EnumerableMap-contains-struct-EnumerableMap-UintToAddressMap-uint256-}[`++contains(map, key)++`]
  2152. * {xref-EnumerableMap-length-struct-EnumerableMap-UintToAddressMap-}[`++length(map)++`]
  2153. * {xref-EnumerableMap-at-struct-EnumerableMap-UintToAddressMap-uint256-}[`++at(map, index)++`]
  2154. * {xref-EnumerableMap-tryGet-struct-EnumerableMap-UintToAddressMap-uint256-}[`++tryGet(map, key)++`]
  2155. * {xref-EnumerableMap-get-struct-EnumerableMap-UintToAddressMap-uint256-}[`++get(map, key)++`]
  2156. * {xref-EnumerableMap-keys-struct-EnumerableMap-UintToAddressMap-}[`++keys(map)++`]
  2157. * {xref-EnumerableMap-set-struct-EnumerableMap-AddressToUintMap-address-uint256-}[`++set(map, key, value)++`]
  2158. * {xref-EnumerableMap-remove-struct-EnumerableMap-AddressToUintMap-address-}[`++remove(map, key)++`]
  2159. * {xref-EnumerableMap-contains-struct-EnumerableMap-AddressToUintMap-address-}[`++contains(map, key)++`]
  2160. * {xref-EnumerableMap-length-struct-EnumerableMap-AddressToUintMap-}[`++length(map)++`]
  2161. * {xref-EnumerableMap-at-struct-EnumerableMap-AddressToUintMap-uint256-}[`++at(map, index)++`]
  2162. * {xref-EnumerableMap-tryGet-struct-EnumerableMap-AddressToUintMap-address-}[`++tryGet(map, key)++`]
  2163. * {xref-EnumerableMap-get-struct-EnumerableMap-AddressToUintMap-address-}[`++get(map, key)++`]
  2164. * {xref-EnumerableMap-keys-struct-EnumerableMap-AddressToUintMap-}[`++keys(map)++`]
  2165. * {xref-EnumerableMap-set-struct-EnumerableMap-Bytes32ToUintMap-bytes32-uint256-}[`++set(map, key, value)++`]
  2166. * {xref-EnumerableMap-remove-struct-EnumerableMap-Bytes32ToUintMap-bytes32-}[`++remove(map, key)++`]
  2167. * {xref-EnumerableMap-contains-struct-EnumerableMap-Bytes32ToUintMap-bytes32-}[`++contains(map, key)++`]
  2168. * {xref-EnumerableMap-length-struct-EnumerableMap-Bytes32ToUintMap-}[`++length(map)++`]
  2169. * {xref-EnumerableMap-at-struct-EnumerableMap-Bytes32ToUintMap-uint256-}[`++at(map, index)++`]
  2170. * {xref-EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToUintMap-bytes32-}[`++tryGet(map, key)++`]
  2171. * {xref-EnumerableMap-get-struct-EnumerableMap-Bytes32ToUintMap-bytes32-}[`++get(map, key)++`]
  2172. * {xref-EnumerableMap-keys-struct-EnumerableMap-Bytes32ToUintMap-}[`++keys(map)++`]
  2173. --
  2174. [.contract-index]
  2175. .Errors
  2176. --
  2177. * {xref-EnumerableMap-EnumerableMapNonexistentKey-bytes32-}[`++EnumerableMapNonexistentKey(key)++`]
  2178. --
  2179. [.contract-item]
  2180. [[EnumerableMap-set-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-bytes32-]]
  2181. ==== `[.contract-item-name]#++set++#++(struct EnumerableMap.Bytes32ToBytes32Map map, bytes32 key, bytes32 value) → bool++` [.item-kind]#internal#
  2182. Adds a key-value pair to a map, or updates the value for an existing
  2183. key. O(1).
  2184. Returns true if the key was added to the map, that is if it was not
  2185. already present.
  2186. [.contract-item]
  2187. [[EnumerableMap-remove-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-]]
  2188. ==== `[.contract-item-name]#++remove++#++(struct EnumerableMap.Bytes32ToBytes32Map map, bytes32 key) → bool++` [.item-kind]#internal#
  2189. Removes a key-value pair from a map. O(1).
  2190. Returns true if the key was removed from the map, that is if it was present.
  2191. [.contract-item]
  2192. [[EnumerableMap-contains-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-]]
  2193. ==== `[.contract-item-name]#++contains++#++(struct EnumerableMap.Bytes32ToBytes32Map map, bytes32 key) → bool++` [.item-kind]#internal#
  2194. Returns true if the key is in the map. O(1).
  2195. [.contract-item]
  2196. [[EnumerableMap-length-struct-EnumerableMap-Bytes32ToBytes32Map-]]
  2197. ==== `[.contract-item-name]#++length++#++(struct EnumerableMap.Bytes32ToBytes32Map map) → uint256++` [.item-kind]#internal#
  2198. Returns the number of key-value pairs in the map. O(1).
  2199. [.contract-item]
  2200. [[EnumerableMap-at-struct-EnumerableMap-Bytes32ToBytes32Map-uint256-]]
  2201. ==== `[.contract-item-name]#++at++#++(struct EnumerableMap.Bytes32ToBytes32Map map, uint256 index) → bytes32, bytes32++` [.item-kind]#internal#
  2202. Returns the key-value pair stored at position `index` in the map. O(1).
  2203. Note that there are no guarantees on the ordering of entries inside the
  2204. array, and it may change when more entries are added or removed.
  2205. Requirements:
  2206. - `index` must be strictly less than {length}.
  2207. [.contract-item]
  2208. [[EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-]]
  2209. ==== `[.contract-item-name]#++tryGet++#++(struct EnumerableMap.Bytes32ToBytes32Map map, bytes32 key) → bool, bytes32++` [.item-kind]#internal#
  2210. Tries to returns the value associated with `key`. O(1).
  2211. Does not revert if `key` is not in the map.
  2212. [.contract-item]
  2213. [[EnumerableMap-get-struct-EnumerableMap-Bytes32ToBytes32Map-bytes32-]]
  2214. ==== `[.contract-item-name]#++get++#++(struct EnumerableMap.Bytes32ToBytes32Map map, bytes32 key) → bytes32++` [.item-kind]#internal#
  2215. Returns the value associated with `key`. O(1).
  2216. Requirements:
  2217. - `key` must be in the map.
  2218. [.contract-item]
  2219. [[EnumerableMap-keys-struct-EnumerableMap-Bytes32ToBytes32Map-]]
  2220. ==== `[.contract-item-name]#++keys++#++(struct EnumerableMap.Bytes32ToBytes32Map map) → bytes32[]++` [.item-kind]#internal#
  2221. Return the an array containing all the keys
  2222. WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
  2223. to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
  2224. this function has an unbounded cost, and using it as part of a state-changing function may render the function
  2225. uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
  2226. [.contract-item]
  2227. [[EnumerableMap-set-struct-EnumerableMap-UintToUintMap-uint256-uint256-]]
  2228. ==== `[.contract-item-name]#++set++#++(struct EnumerableMap.UintToUintMap map, uint256 key, uint256 value) → bool++` [.item-kind]#internal#
  2229. Adds a key-value pair to a map, or updates the value for an existing
  2230. key. O(1).
  2231. Returns true if the key was added to the map, that is if it was not
  2232. already present.
  2233. [.contract-item]
  2234. [[EnumerableMap-remove-struct-EnumerableMap-UintToUintMap-uint256-]]
  2235. ==== `[.contract-item-name]#++remove++#++(struct EnumerableMap.UintToUintMap map, uint256 key) → bool++` [.item-kind]#internal#
  2236. Removes a value from a map. O(1).
  2237. Returns true if the key was removed from the map, that is if it was present.
  2238. [.contract-item]
  2239. [[EnumerableMap-contains-struct-EnumerableMap-UintToUintMap-uint256-]]
  2240. ==== `[.contract-item-name]#++contains++#++(struct EnumerableMap.UintToUintMap map, uint256 key) → bool++` [.item-kind]#internal#
  2241. Returns true if the key is in the map. O(1).
  2242. [.contract-item]
  2243. [[EnumerableMap-length-struct-EnumerableMap-UintToUintMap-]]
  2244. ==== `[.contract-item-name]#++length++#++(struct EnumerableMap.UintToUintMap map) → uint256++` [.item-kind]#internal#
  2245. Returns the number of elements in the map. O(1).
  2246. [.contract-item]
  2247. [[EnumerableMap-at-struct-EnumerableMap-UintToUintMap-uint256-]]
  2248. ==== `[.contract-item-name]#++at++#++(struct EnumerableMap.UintToUintMap map, uint256 index) → uint256, uint256++` [.item-kind]#internal#
  2249. Returns the element stored at position `index` in the map. O(1).
  2250. Note that there are no guarantees on the ordering of values inside the
  2251. array, and it may change when more values are added or removed.
  2252. Requirements:
  2253. - `index` must be strictly less than {length}.
  2254. [.contract-item]
  2255. [[EnumerableMap-tryGet-struct-EnumerableMap-UintToUintMap-uint256-]]
  2256. ==== `[.contract-item-name]#++tryGet++#++(struct EnumerableMap.UintToUintMap map, uint256 key) → bool, uint256++` [.item-kind]#internal#
  2257. Tries to returns the value associated with `key`. O(1).
  2258. Does not revert if `key` is not in the map.
  2259. [.contract-item]
  2260. [[EnumerableMap-get-struct-EnumerableMap-UintToUintMap-uint256-]]
  2261. ==== `[.contract-item-name]#++get++#++(struct EnumerableMap.UintToUintMap map, uint256 key) → uint256++` [.item-kind]#internal#
  2262. Returns the value associated with `key`. O(1).
  2263. Requirements:
  2264. - `key` must be in the map.
  2265. [.contract-item]
  2266. [[EnumerableMap-keys-struct-EnumerableMap-UintToUintMap-]]
  2267. ==== `[.contract-item-name]#++keys++#++(struct EnumerableMap.UintToUintMap map) → uint256[]++` [.item-kind]#internal#
  2268. Return the an array containing all the keys
  2269. WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
  2270. to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
  2271. this function has an unbounded cost, and using it as part of a state-changing function may render the function
  2272. uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
  2273. [.contract-item]
  2274. [[EnumerableMap-set-struct-EnumerableMap-UintToAddressMap-uint256-address-]]
  2275. ==== `[.contract-item-name]#++set++#++(struct EnumerableMap.UintToAddressMap map, uint256 key, address value) → bool++` [.item-kind]#internal#
  2276. Adds a key-value pair to a map, or updates the value for an existing
  2277. key. O(1).
  2278. Returns true if the key was added to the map, that is if it was not
  2279. already present.
  2280. [.contract-item]
  2281. [[EnumerableMap-remove-struct-EnumerableMap-UintToAddressMap-uint256-]]
  2282. ==== `[.contract-item-name]#++remove++#++(struct EnumerableMap.UintToAddressMap map, uint256 key) → bool++` [.item-kind]#internal#
  2283. Removes a value from a map. O(1).
  2284. Returns true if the key was removed from the map, that is if it was present.
  2285. [.contract-item]
  2286. [[EnumerableMap-contains-struct-EnumerableMap-UintToAddressMap-uint256-]]
  2287. ==== `[.contract-item-name]#++contains++#++(struct EnumerableMap.UintToAddressMap map, uint256 key) → bool++` [.item-kind]#internal#
  2288. Returns true if the key is in the map. O(1).
  2289. [.contract-item]
  2290. [[EnumerableMap-length-struct-EnumerableMap-UintToAddressMap-]]
  2291. ==== `[.contract-item-name]#++length++#++(struct EnumerableMap.UintToAddressMap map) → uint256++` [.item-kind]#internal#
  2292. Returns the number of elements in the map. O(1).
  2293. [.contract-item]
  2294. [[EnumerableMap-at-struct-EnumerableMap-UintToAddressMap-uint256-]]
  2295. ==== `[.contract-item-name]#++at++#++(struct EnumerableMap.UintToAddressMap map, uint256 index) → uint256, address++` [.item-kind]#internal#
  2296. Returns the element stored at position `index` in the map. O(1).
  2297. Note that there are no guarantees on the ordering of values inside the
  2298. array, and it may change when more values are added or removed.
  2299. Requirements:
  2300. - `index` must be strictly less than {length}.
  2301. [.contract-item]
  2302. [[EnumerableMap-tryGet-struct-EnumerableMap-UintToAddressMap-uint256-]]
  2303. ==== `[.contract-item-name]#++tryGet++#++(struct EnumerableMap.UintToAddressMap map, uint256 key) → bool, address++` [.item-kind]#internal#
  2304. Tries to returns the value associated with `key`. O(1).
  2305. Does not revert if `key` is not in the map.
  2306. [.contract-item]
  2307. [[EnumerableMap-get-struct-EnumerableMap-UintToAddressMap-uint256-]]
  2308. ==== `[.contract-item-name]#++get++#++(struct EnumerableMap.UintToAddressMap map, uint256 key) → address++` [.item-kind]#internal#
  2309. Returns the value associated with `key`. O(1).
  2310. Requirements:
  2311. - `key` must be in the map.
  2312. [.contract-item]
  2313. [[EnumerableMap-keys-struct-EnumerableMap-UintToAddressMap-]]
  2314. ==== `[.contract-item-name]#++keys++#++(struct EnumerableMap.UintToAddressMap map) → uint256[]++` [.item-kind]#internal#
  2315. Return the an array containing all the keys
  2316. WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
  2317. to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
  2318. this function has an unbounded cost, and using it as part of a state-changing function may render the function
  2319. uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
  2320. [.contract-item]
  2321. [[EnumerableMap-set-struct-EnumerableMap-AddressToUintMap-address-uint256-]]
  2322. ==== `[.contract-item-name]#++set++#++(struct EnumerableMap.AddressToUintMap map, address key, uint256 value) → bool++` [.item-kind]#internal#
  2323. Adds a key-value pair to a map, or updates the value for an existing
  2324. key. O(1).
  2325. Returns true if the key was added to the map, that is if it was not
  2326. already present.
  2327. [.contract-item]
  2328. [[EnumerableMap-remove-struct-EnumerableMap-AddressToUintMap-address-]]
  2329. ==== `[.contract-item-name]#++remove++#++(struct EnumerableMap.AddressToUintMap map, address key) → bool++` [.item-kind]#internal#
  2330. Removes a value from a map. O(1).
  2331. Returns true if the key was removed from the map, that is if it was present.
  2332. [.contract-item]
  2333. [[EnumerableMap-contains-struct-EnumerableMap-AddressToUintMap-address-]]
  2334. ==== `[.contract-item-name]#++contains++#++(struct EnumerableMap.AddressToUintMap map, address key) → bool++` [.item-kind]#internal#
  2335. Returns true if the key is in the map. O(1).
  2336. [.contract-item]
  2337. [[EnumerableMap-length-struct-EnumerableMap-AddressToUintMap-]]
  2338. ==== `[.contract-item-name]#++length++#++(struct EnumerableMap.AddressToUintMap map) → uint256++` [.item-kind]#internal#
  2339. Returns the number of elements in the map. O(1).
  2340. [.contract-item]
  2341. [[EnumerableMap-at-struct-EnumerableMap-AddressToUintMap-uint256-]]
  2342. ==== `[.contract-item-name]#++at++#++(struct EnumerableMap.AddressToUintMap map, uint256 index) → address, uint256++` [.item-kind]#internal#
  2343. Returns the element stored at position `index` in the map. O(1).
  2344. Note that there are no guarantees on the ordering of values inside the
  2345. array, and it may change when more values are added or removed.
  2346. Requirements:
  2347. - `index` must be strictly less than {length}.
  2348. [.contract-item]
  2349. [[EnumerableMap-tryGet-struct-EnumerableMap-AddressToUintMap-address-]]
  2350. ==== `[.contract-item-name]#++tryGet++#++(struct EnumerableMap.AddressToUintMap map, address key) → bool, uint256++` [.item-kind]#internal#
  2351. Tries to returns the value associated with `key`. O(1).
  2352. Does not revert if `key` is not in the map.
  2353. [.contract-item]
  2354. [[EnumerableMap-get-struct-EnumerableMap-AddressToUintMap-address-]]
  2355. ==== `[.contract-item-name]#++get++#++(struct EnumerableMap.AddressToUintMap map, address key) → uint256++` [.item-kind]#internal#
  2356. Returns the value associated with `key`. O(1).
  2357. Requirements:
  2358. - `key` must be in the map.
  2359. [.contract-item]
  2360. [[EnumerableMap-keys-struct-EnumerableMap-AddressToUintMap-]]
  2361. ==== `[.contract-item-name]#++keys++#++(struct EnumerableMap.AddressToUintMap map) → address[]++` [.item-kind]#internal#
  2362. Return the an array containing all the keys
  2363. WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
  2364. to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
  2365. this function has an unbounded cost, and using it as part of a state-changing function may render the function
  2366. uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
  2367. [.contract-item]
  2368. [[EnumerableMap-set-struct-EnumerableMap-Bytes32ToUintMap-bytes32-uint256-]]
  2369. ==== `[.contract-item-name]#++set++#++(struct EnumerableMap.Bytes32ToUintMap map, bytes32 key, uint256 value) → bool++` [.item-kind]#internal#
  2370. Adds a key-value pair to a map, or updates the value for an existing
  2371. key. O(1).
  2372. Returns true if the key was added to the map, that is if it was not
  2373. already present.
  2374. [.contract-item]
  2375. [[EnumerableMap-remove-struct-EnumerableMap-Bytes32ToUintMap-bytes32-]]
  2376. ==== `[.contract-item-name]#++remove++#++(struct EnumerableMap.Bytes32ToUintMap map, bytes32 key) → bool++` [.item-kind]#internal#
  2377. Removes a value from a map. O(1).
  2378. Returns true if the key was removed from the map, that is if it was present.
  2379. [.contract-item]
  2380. [[EnumerableMap-contains-struct-EnumerableMap-Bytes32ToUintMap-bytes32-]]
  2381. ==== `[.contract-item-name]#++contains++#++(struct EnumerableMap.Bytes32ToUintMap map, bytes32 key) → bool++` [.item-kind]#internal#
  2382. Returns true if the key is in the map. O(1).
  2383. [.contract-item]
  2384. [[EnumerableMap-length-struct-EnumerableMap-Bytes32ToUintMap-]]
  2385. ==== `[.contract-item-name]#++length++#++(struct EnumerableMap.Bytes32ToUintMap map) → uint256++` [.item-kind]#internal#
  2386. Returns the number of elements in the map. O(1).
  2387. [.contract-item]
  2388. [[EnumerableMap-at-struct-EnumerableMap-Bytes32ToUintMap-uint256-]]
  2389. ==== `[.contract-item-name]#++at++#++(struct EnumerableMap.Bytes32ToUintMap map, uint256 index) → bytes32, uint256++` [.item-kind]#internal#
  2390. Returns the element stored at position `index` in the map. O(1).
  2391. Note that there are no guarantees on the ordering of values inside the
  2392. array, and it may change when more values are added or removed.
  2393. Requirements:
  2394. - `index` must be strictly less than {length}.
  2395. [.contract-item]
  2396. [[EnumerableMap-tryGet-struct-EnumerableMap-Bytes32ToUintMap-bytes32-]]
  2397. ==== `[.contract-item-name]#++tryGet++#++(struct EnumerableMap.Bytes32ToUintMap map, bytes32 key) → bool, uint256++` [.item-kind]#internal#
  2398. Tries to returns the value associated with `key`. O(1).
  2399. Does not revert if `key` is not in the map.
  2400. [.contract-item]
  2401. [[EnumerableMap-get-struct-EnumerableMap-Bytes32ToUintMap-bytes32-]]
  2402. ==== `[.contract-item-name]#++get++#++(struct EnumerableMap.Bytes32ToUintMap map, bytes32 key) → uint256++` [.item-kind]#internal#
  2403. Returns the value associated with `key`. O(1).
  2404. Requirements:
  2405. - `key` must be in the map.
  2406. [.contract-item]
  2407. [[EnumerableMap-keys-struct-EnumerableMap-Bytes32ToUintMap-]]
  2408. ==== `[.contract-item-name]#++keys++#++(struct EnumerableMap.Bytes32ToUintMap map) → bytes32[]++` [.item-kind]#internal#
  2409. Return the an array containing all the keys
  2410. WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
  2411. to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
  2412. this function has an unbounded cost, and using it as part of a state-changing function may render the function
  2413. uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
  2414. [.contract-item]
  2415. [[EnumerableMap-EnumerableMapNonexistentKey-bytes32-]]
  2416. ==== `[.contract-item-name]#++EnumerableMapNonexistentKey++#++(bytes32 key)++` [.item-kind]#error#
  2417. Query for a nonexistent map key.
  2418. :Set: pass:normal[xref:#EnumerableSet-Set[`++Set++`]]
  2419. :Bytes32Set: pass:normal[xref:#EnumerableSet-Bytes32Set[`++Bytes32Set++`]]
  2420. :add: pass:normal[xref:#EnumerableSet-add-struct-EnumerableSet-Bytes32Set-bytes32-[`++add++`]]
  2421. :remove: pass:normal[xref:#EnumerableSet-remove-struct-EnumerableSet-Bytes32Set-bytes32-[`++remove++`]]
  2422. :contains: pass:normal[xref:#EnumerableSet-contains-struct-EnumerableSet-Bytes32Set-bytes32-[`++contains++`]]
  2423. :length: pass:normal[xref:#EnumerableSet-length-struct-EnumerableSet-Bytes32Set-[`++length++`]]
  2424. :at: pass:normal[xref:#EnumerableSet-at-struct-EnumerableSet-Bytes32Set-uint256-[`++at++`]]
  2425. :values: pass:normal[xref:#EnumerableSet-values-struct-EnumerableSet-Bytes32Set-[`++values++`]]
  2426. :AddressSet: pass:normal[xref:#EnumerableSet-AddressSet[`++AddressSet++`]]
  2427. :add: pass:normal[xref:#EnumerableSet-add-struct-EnumerableSet-AddressSet-address-[`++add++`]]
  2428. :remove: pass:normal[xref:#EnumerableSet-remove-struct-EnumerableSet-AddressSet-address-[`++remove++`]]
  2429. :contains: pass:normal[xref:#EnumerableSet-contains-struct-EnumerableSet-AddressSet-address-[`++contains++`]]
  2430. :length: pass:normal[xref:#EnumerableSet-length-struct-EnumerableSet-AddressSet-[`++length++`]]
  2431. :at: pass:normal[xref:#EnumerableSet-at-struct-EnumerableSet-AddressSet-uint256-[`++at++`]]
  2432. :values: pass:normal[xref:#EnumerableSet-values-struct-EnumerableSet-AddressSet-[`++values++`]]
  2433. :UintSet: pass:normal[xref:#EnumerableSet-UintSet[`++UintSet++`]]
  2434. :add: pass:normal[xref:#EnumerableSet-add-struct-EnumerableSet-UintSet-uint256-[`++add++`]]
  2435. :remove: pass:normal[xref:#EnumerableSet-remove-struct-EnumerableSet-UintSet-uint256-[`++remove++`]]
  2436. :contains: pass:normal[xref:#EnumerableSet-contains-struct-EnumerableSet-UintSet-uint256-[`++contains++`]]
  2437. :length: pass:normal[xref:#EnumerableSet-length-struct-EnumerableSet-UintSet-[`++length++`]]
  2438. :at: pass:normal[xref:#EnumerableSet-at-struct-EnumerableSet-UintSet-uint256-[`++at++`]]
  2439. :values: pass:normal[xref:#EnumerableSet-values-struct-EnumerableSet-UintSet-[`++values++`]]
  2440. [.contract]
  2441. [[EnumerableSet]]
  2442. === `++EnumerableSet++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/structs/EnumerableSet.sol[{github-icon},role=heading-link]
  2443. [.hljs-theme-light.nopadding]
  2444. ```solidity
  2445. import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
  2446. ```
  2447. Library for managing
  2448. https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
  2449. types.
  2450. Sets have the following properties:
  2451. - Elements are added, removed, and checked for existence in constant time
  2452. (O(1)).
  2453. - Elements are enumerated in O(n). No guarantees are made on the ordering.
  2454. ```solidity
  2455. contract Example {
  2456. // Add the library methods
  2457. using EnumerableSet for EnumerableSet.AddressSet;
  2458. // Declare a set state variable
  2459. EnumerableSet.AddressSet private mySet;
  2460. }
  2461. ```
  2462. As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
  2463. and `uint256` (`UintSet`) are supported.
  2464. [WARNING]
  2465. ====
  2466. Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
  2467. unusable.
  2468. See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
  2469. In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
  2470. array of EnumerableSet.
  2471. ====
  2472. [.contract-index]
  2473. .Functions
  2474. --
  2475. * {xref-EnumerableSet-add-struct-EnumerableSet-Bytes32Set-bytes32-}[`++add(set, value)++`]
  2476. * {xref-EnumerableSet-remove-struct-EnumerableSet-Bytes32Set-bytes32-}[`++remove(set, value)++`]
  2477. * {xref-EnumerableSet-contains-struct-EnumerableSet-Bytes32Set-bytes32-}[`++contains(set, value)++`]
  2478. * {xref-EnumerableSet-length-struct-EnumerableSet-Bytes32Set-}[`++length(set)++`]
  2479. * {xref-EnumerableSet-at-struct-EnumerableSet-Bytes32Set-uint256-}[`++at(set, index)++`]
  2480. * {xref-EnumerableSet-values-struct-EnumerableSet-Bytes32Set-}[`++values(set)++`]
  2481. * {xref-EnumerableSet-add-struct-EnumerableSet-AddressSet-address-}[`++add(set, value)++`]
  2482. * {xref-EnumerableSet-remove-struct-EnumerableSet-AddressSet-address-}[`++remove(set, value)++`]
  2483. * {xref-EnumerableSet-contains-struct-EnumerableSet-AddressSet-address-}[`++contains(set, value)++`]
  2484. * {xref-EnumerableSet-length-struct-EnumerableSet-AddressSet-}[`++length(set)++`]
  2485. * {xref-EnumerableSet-at-struct-EnumerableSet-AddressSet-uint256-}[`++at(set, index)++`]
  2486. * {xref-EnumerableSet-values-struct-EnumerableSet-AddressSet-}[`++values(set)++`]
  2487. * {xref-EnumerableSet-add-struct-EnumerableSet-UintSet-uint256-}[`++add(set, value)++`]
  2488. * {xref-EnumerableSet-remove-struct-EnumerableSet-UintSet-uint256-}[`++remove(set, value)++`]
  2489. * {xref-EnumerableSet-contains-struct-EnumerableSet-UintSet-uint256-}[`++contains(set, value)++`]
  2490. * {xref-EnumerableSet-length-struct-EnumerableSet-UintSet-}[`++length(set)++`]
  2491. * {xref-EnumerableSet-at-struct-EnumerableSet-UintSet-uint256-}[`++at(set, index)++`]
  2492. * {xref-EnumerableSet-values-struct-EnumerableSet-UintSet-}[`++values(set)++`]
  2493. --
  2494. [.contract-item]
  2495. [[EnumerableSet-add-struct-EnumerableSet-Bytes32Set-bytes32-]]
  2496. ==== `[.contract-item-name]#++add++#++(struct EnumerableSet.Bytes32Set set, bytes32 value) → bool++` [.item-kind]#internal#
  2497. Add a value to a set. O(1).
  2498. Returns true if the value was added to the set, that is if it was not
  2499. already present.
  2500. [.contract-item]
  2501. [[EnumerableSet-remove-struct-EnumerableSet-Bytes32Set-bytes32-]]
  2502. ==== `[.contract-item-name]#++remove++#++(struct EnumerableSet.Bytes32Set set, bytes32 value) → bool++` [.item-kind]#internal#
  2503. Removes a value from a set. O(1).
  2504. Returns true if the value was removed from the set, that is if it was
  2505. present.
  2506. [.contract-item]
  2507. [[EnumerableSet-contains-struct-EnumerableSet-Bytes32Set-bytes32-]]
  2508. ==== `[.contract-item-name]#++contains++#++(struct EnumerableSet.Bytes32Set set, bytes32 value) → bool++` [.item-kind]#internal#
  2509. Returns true if the value is in the set. O(1).
  2510. [.contract-item]
  2511. [[EnumerableSet-length-struct-EnumerableSet-Bytes32Set-]]
  2512. ==== `[.contract-item-name]#++length++#++(struct EnumerableSet.Bytes32Set set) → uint256++` [.item-kind]#internal#
  2513. Returns the number of values in the set. O(1).
  2514. [.contract-item]
  2515. [[EnumerableSet-at-struct-EnumerableSet-Bytes32Set-uint256-]]
  2516. ==== `[.contract-item-name]#++at++#++(struct EnumerableSet.Bytes32Set set, uint256 index) → bytes32++` [.item-kind]#internal#
  2517. Returns the value stored at position `index` in the set. O(1).
  2518. Note that there are no guarantees on the ordering of values inside the
  2519. array, and it may change when more values are added or removed.
  2520. Requirements:
  2521. - `index` must be strictly less than {length}.
  2522. [.contract-item]
  2523. [[EnumerableSet-values-struct-EnumerableSet-Bytes32Set-]]
  2524. ==== `[.contract-item-name]#++values++#++(struct EnumerableSet.Bytes32Set set) → bytes32[]++` [.item-kind]#internal#
  2525. Return the entire set in an array
  2526. WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
  2527. to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
  2528. this function has an unbounded cost, and using it as part of a state-changing function may render the function
  2529. uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
  2530. [.contract-item]
  2531. [[EnumerableSet-add-struct-EnumerableSet-AddressSet-address-]]
  2532. ==== `[.contract-item-name]#++add++#++(struct EnumerableSet.AddressSet set, address value) → bool++` [.item-kind]#internal#
  2533. Add a value to a set. O(1).
  2534. Returns true if the value was added to the set, that is if it was not
  2535. already present.
  2536. [.contract-item]
  2537. [[EnumerableSet-remove-struct-EnumerableSet-AddressSet-address-]]
  2538. ==== `[.contract-item-name]#++remove++#++(struct EnumerableSet.AddressSet set, address value) → bool++` [.item-kind]#internal#
  2539. Removes a value from a set. O(1).
  2540. Returns true if the value was removed from the set, that is if it was
  2541. present.
  2542. [.contract-item]
  2543. [[EnumerableSet-contains-struct-EnumerableSet-AddressSet-address-]]
  2544. ==== `[.contract-item-name]#++contains++#++(struct EnumerableSet.AddressSet set, address value) → bool++` [.item-kind]#internal#
  2545. Returns true if the value is in the set. O(1).
  2546. [.contract-item]
  2547. [[EnumerableSet-length-struct-EnumerableSet-AddressSet-]]
  2548. ==== `[.contract-item-name]#++length++#++(struct EnumerableSet.AddressSet set) → uint256++` [.item-kind]#internal#
  2549. Returns the number of values in the set. O(1).
  2550. [.contract-item]
  2551. [[EnumerableSet-at-struct-EnumerableSet-AddressSet-uint256-]]
  2552. ==== `[.contract-item-name]#++at++#++(struct EnumerableSet.AddressSet set, uint256 index) → address++` [.item-kind]#internal#
  2553. Returns the value stored at position `index` in the set. O(1).
  2554. Note that there are no guarantees on the ordering of values inside the
  2555. array, and it may change when more values are added or removed.
  2556. Requirements:
  2557. - `index` must be strictly less than {length}.
  2558. [.contract-item]
  2559. [[EnumerableSet-values-struct-EnumerableSet-AddressSet-]]
  2560. ==== `[.contract-item-name]#++values++#++(struct EnumerableSet.AddressSet set) → address[]++` [.item-kind]#internal#
  2561. Return the entire set in an array
  2562. WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
  2563. to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
  2564. this function has an unbounded cost, and using it as part of a state-changing function may render the function
  2565. uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
  2566. [.contract-item]
  2567. [[EnumerableSet-add-struct-EnumerableSet-UintSet-uint256-]]
  2568. ==== `[.contract-item-name]#++add++#++(struct EnumerableSet.UintSet set, uint256 value) → bool++` [.item-kind]#internal#
  2569. Add a value to a set. O(1).
  2570. Returns true if the value was added to the set, that is if it was not
  2571. already present.
  2572. [.contract-item]
  2573. [[EnumerableSet-remove-struct-EnumerableSet-UintSet-uint256-]]
  2574. ==== `[.contract-item-name]#++remove++#++(struct EnumerableSet.UintSet set, uint256 value) → bool++` [.item-kind]#internal#
  2575. Removes a value from a set. O(1).
  2576. Returns true if the value was removed from the set, that is if it was
  2577. present.
  2578. [.contract-item]
  2579. [[EnumerableSet-contains-struct-EnumerableSet-UintSet-uint256-]]
  2580. ==== `[.contract-item-name]#++contains++#++(struct EnumerableSet.UintSet set, uint256 value) → bool++` [.item-kind]#internal#
  2581. Returns true if the value is in the set. O(1).
  2582. [.contract-item]
  2583. [[EnumerableSet-length-struct-EnumerableSet-UintSet-]]
  2584. ==== `[.contract-item-name]#++length++#++(struct EnumerableSet.UintSet set) → uint256++` [.item-kind]#internal#
  2585. Returns the number of values in the set. O(1).
  2586. [.contract-item]
  2587. [[EnumerableSet-at-struct-EnumerableSet-UintSet-uint256-]]
  2588. ==== `[.contract-item-name]#++at++#++(struct EnumerableSet.UintSet set, uint256 index) → uint256++` [.item-kind]#internal#
  2589. Returns the value stored at position `index` in the set. O(1).
  2590. Note that there are no guarantees on the ordering of values inside the
  2591. array, and it may change when more values are added or removed.
  2592. Requirements:
  2593. - `index` must be strictly less than {length}.
  2594. [.contract-item]
  2595. [[EnumerableSet-values-struct-EnumerableSet-UintSet-]]
  2596. ==== `[.contract-item-name]#++values++#++(struct EnumerableSet.UintSet set) → uint256[]++` [.item-kind]#internal#
  2597. Return the entire set in an array
  2598. WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
  2599. to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
  2600. this function has an unbounded cost, and using it as part of a state-changing function may render the function
  2601. uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
  2602. :QueueEmpty: pass:normal[xref:#DoubleEndedQueue-QueueEmpty--[`++QueueEmpty++`]]
  2603. :QueueFull: pass:normal[xref:#DoubleEndedQueue-QueueFull--[`++QueueFull++`]]
  2604. :QueueOutOfBounds: pass:normal[xref:#DoubleEndedQueue-QueueOutOfBounds--[`++QueueOutOfBounds++`]]
  2605. :Bytes32Deque: pass:normal[xref:#DoubleEndedQueue-Bytes32Deque[`++Bytes32Deque++`]]
  2606. :pushBack: pass:normal[xref:#DoubleEndedQueue-pushBack-struct-DoubleEndedQueue-Bytes32Deque-bytes32-[`++pushBack++`]]
  2607. :popBack: pass:normal[xref:#DoubleEndedQueue-popBack-struct-DoubleEndedQueue-Bytes32Deque-[`++popBack++`]]
  2608. :pushFront: pass:normal[xref:#DoubleEndedQueue-pushFront-struct-DoubleEndedQueue-Bytes32Deque-bytes32-[`++pushFront++`]]
  2609. :popFront: pass:normal[xref:#DoubleEndedQueue-popFront-struct-DoubleEndedQueue-Bytes32Deque-[`++popFront++`]]
  2610. :front: pass:normal[xref:#DoubleEndedQueue-front-struct-DoubleEndedQueue-Bytes32Deque-[`++front++`]]
  2611. :back: pass:normal[xref:#DoubleEndedQueue-back-struct-DoubleEndedQueue-Bytes32Deque-[`++back++`]]
  2612. :at: pass:normal[xref:#DoubleEndedQueue-at-struct-DoubleEndedQueue-Bytes32Deque-uint256-[`++at++`]]
  2613. :clear: pass:normal[xref:#DoubleEndedQueue-clear-struct-DoubleEndedQueue-Bytes32Deque-[`++clear++`]]
  2614. :length: pass:normal[xref:#DoubleEndedQueue-length-struct-DoubleEndedQueue-Bytes32Deque-[`++length++`]]
  2615. :empty: pass:normal[xref:#DoubleEndedQueue-empty-struct-DoubleEndedQueue-Bytes32Deque-[`++empty++`]]
  2616. [.contract]
  2617. [[DoubleEndedQueue]]
  2618. === `++DoubleEndedQueue++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/structs/DoubleEndedQueue.sol[{github-icon},role=heading-link]
  2619. [.hljs-theme-light.nopadding]
  2620. ```solidity
  2621. import "@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol";
  2622. ```
  2623. A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of
  2624. the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and
  2625. FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that
  2626. the existing queue contents are left in storage.
  2627. The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be
  2628. used in storage, and not in memory.
  2629. ```solidity
  2630. DoubleEndedQueue.Bytes32Deque queue;
  2631. ```
  2632. [.contract-index]
  2633. .Functions
  2634. --
  2635. * {xref-DoubleEndedQueue-pushBack-struct-DoubleEndedQueue-Bytes32Deque-bytes32-}[`++pushBack(deque, value)++`]
  2636. * {xref-DoubleEndedQueue-popBack-struct-DoubleEndedQueue-Bytes32Deque-}[`++popBack(deque)++`]
  2637. * {xref-DoubleEndedQueue-pushFront-struct-DoubleEndedQueue-Bytes32Deque-bytes32-}[`++pushFront(deque, value)++`]
  2638. * {xref-DoubleEndedQueue-popFront-struct-DoubleEndedQueue-Bytes32Deque-}[`++popFront(deque)++`]
  2639. * {xref-DoubleEndedQueue-front-struct-DoubleEndedQueue-Bytes32Deque-}[`++front(deque)++`]
  2640. * {xref-DoubleEndedQueue-back-struct-DoubleEndedQueue-Bytes32Deque-}[`++back(deque)++`]
  2641. * {xref-DoubleEndedQueue-at-struct-DoubleEndedQueue-Bytes32Deque-uint256-}[`++at(deque, index)++`]
  2642. * {xref-DoubleEndedQueue-clear-struct-DoubleEndedQueue-Bytes32Deque-}[`++clear(deque)++`]
  2643. * {xref-DoubleEndedQueue-length-struct-DoubleEndedQueue-Bytes32Deque-}[`++length(deque)++`]
  2644. * {xref-DoubleEndedQueue-empty-struct-DoubleEndedQueue-Bytes32Deque-}[`++empty(deque)++`]
  2645. --
  2646. [.contract-index]
  2647. .Errors
  2648. --
  2649. * {xref-DoubleEndedQueue-QueueEmpty--}[`++QueueEmpty()++`]
  2650. * {xref-DoubleEndedQueue-QueueFull--}[`++QueueFull()++`]
  2651. * {xref-DoubleEndedQueue-QueueOutOfBounds--}[`++QueueOutOfBounds()++`]
  2652. --
  2653. [.contract-item]
  2654. [[DoubleEndedQueue-pushBack-struct-DoubleEndedQueue-Bytes32Deque-bytes32-]]
  2655. ==== `[.contract-item-name]#++pushBack++#++(struct DoubleEndedQueue.Bytes32Deque deque, bytes32 value)++` [.item-kind]#internal#
  2656. Inserts an item at the end of the queue.
  2657. Reverts with {QueueFull} if the queue is full.
  2658. [.contract-item]
  2659. [[DoubleEndedQueue-popBack-struct-DoubleEndedQueue-Bytes32Deque-]]
  2660. ==== `[.contract-item-name]#++popBack++#++(struct DoubleEndedQueue.Bytes32Deque deque) → bytes32 value++` [.item-kind]#internal#
  2661. Removes the item at the end of the queue and returns it.
  2662. Reverts with {QueueEmpty} if the queue is empty.
  2663. [.contract-item]
  2664. [[DoubleEndedQueue-pushFront-struct-DoubleEndedQueue-Bytes32Deque-bytes32-]]
  2665. ==== `[.contract-item-name]#++pushFront++#++(struct DoubleEndedQueue.Bytes32Deque deque, bytes32 value)++` [.item-kind]#internal#
  2666. Inserts an item at the beginning of the queue.
  2667. Reverts with {QueueFull} if the queue is full.
  2668. [.contract-item]
  2669. [[DoubleEndedQueue-popFront-struct-DoubleEndedQueue-Bytes32Deque-]]
  2670. ==== `[.contract-item-name]#++popFront++#++(struct DoubleEndedQueue.Bytes32Deque deque) → bytes32 value++` [.item-kind]#internal#
  2671. Removes the item at the beginning of the queue and returns it.
  2672. Reverts with `QueueEmpty` if the queue is empty.
  2673. [.contract-item]
  2674. [[DoubleEndedQueue-front-struct-DoubleEndedQueue-Bytes32Deque-]]
  2675. ==== `[.contract-item-name]#++front++#++(struct DoubleEndedQueue.Bytes32Deque deque) → bytes32 value++` [.item-kind]#internal#
  2676. Returns the item at the beginning of the queue.
  2677. Reverts with `QueueEmpty` if the queue is empty.
  2678. [.contract-item]
  2679. [[DoubleEndedQueue-back-struct-DoubleEndedQueue-Bytes32Deque-]]
  2680. ==== `[.contract-item-name]#++back++#++(struct DoubleEndedQueue.Bytes32Deque deque) → bytes32 value++` [.item-kind]#internal#
  2681. Returns the item at the end of the queue.
  2682. Reverts with `QueueEmpty` if the queue is empty.
  2683. [.contract-item]
  2684. [[DoubleEndedQueue-at-struct-DoubleEndedQueue-Bytes32Deque-uint256-]]
  2685. ==== `[.contract-item-name]#++at++#++(struct DoubleEndedQueue.Bytes32Deque deque, uint256 index) → bytes32 value++` [.item-kind]#internal#
  2686. Return the item at a position in the queue given by `index`, with the first item at 0 and last item at
  2687. `length(deque) - 1`.
  2688. Reverts with `QueueOutOfBounds` if the index is out of bounds.
  2689. [.contract-item]
  2690. [[DoubleEndedQueue-clear-struct-DoubleEndedQueue-Bytes32Deque-]]
  2691. ==== `[.contract-item-name]#++clear++#++(struct DoubleEndedQueue.Bytes32Deque deque)++` [.item-kind]#internal#
  2692. Resets the queue back to being empty.
  2693. NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses
  2694. out on potential gas refunds.
  2695. [.contract-item]
  2696. [[DoubleEndedQueue-length-struct-DoubleEndedQueue-Bytes32Deque-]]
  2697. ==== `[.contract-item-name]#++length++#++(struct DoubleEndedQueue.Bytes32Deque deque) → uint256++` [.item-kind]#internal#
  2698. Returns the number of items in the queue.
  2699. [.contract-item]
  2700. [[DoubleEndedQueue-empty-struct-DoubleEndedQueue-Bytes32Deque-]]
  2701. ==== `[.contract-item-name]#++empty++#++(struct DoubleEndedQueue.Bytes32Deque deque) → bool++` [.item-kind]#internal#
  2702. Returns true if the queue is empty.
  2703. [.contract-item]
  2704. [[DoubleEndedQueue-QueueEmpty--]]
  2705. ==== `[.contract-item-name]#++QueueEmpty++#++()++` [.item-kind]#error#
  2706. An operation (e.g. {front}) couldn't be completed due to the queue being empty.
  2707. [.contract-item]
  2708. [[DoubleEndedQueue-QueueFull--]]
  2709. ==== `[.contract-item-name]#++QueueFull++#++()++` [.item-kind]#error#
  2710. A push operation couldn't be completed due to the queue being full.
  2711. [.contract-item]
  2712. [[DoubleEndedQueue-QueueOutOfBounds--]]
  2713. ==== `[.contract-item-name]#++QueueOutOfBounds++#++()++` [.item-kind]#error#
  2714. An operation (e.g. {at}) couldn't be completed due to an index being out of bounds.
  2715. :CheckpointUnorderedInsertion: pass:normal[xref:#Checkpoints-CheckpointUnorderedInsertion--[`++CheckpointUnorderedInsertion++`]]
  2716. :Trace224: pass:normal[xref:#Checkpoints-Trace224[`++Trace224++`]]
  2717. :Checkpoint224: pass:normal[xref:#Checkpoints-Checkpoint224[`++Checkpoint224++`]]
  2718. :push: pass:normal[xref:#Checkpoints-push-struct-Checkpoints-Trace224-uint32-uint224-[`++push++`]]
  2719. :lowerLookup: pass:normal[xref:#Checkpoints-lowerLookup-struct-Checkpoints-Trace224-uint32-[`++lowerLookup++`]]
  2720. :upperLookup: pass:normal[xref:#Checkpoints-upperLookup-struct-Checkpoints-Trace224-uint32-[`++upperLookup++`]]
  2721. :upperLookupRecent: pass:normal[xref:#Checkpoints-upperLookupRecent-struct-Checkpoints-Trace224-uint32-[`++upperLookupRecent++`]]
  2722. :latest: pass:normal[xref:#Checkpoints-latest-struct-Checkpoints-Trace224-[`++latest++`]]
  2723. :latestCheckpoint: pass:normal[xref:#Checkpoints-latestCheckpoint-struct-Checkpoints-Trace224-[`++latestCheckpoint++`]]
  2724. :length: pass:normal[xref:#Checkpoints-length-struct-Checkpoints-Trace224-[`++length++`]]
  2725. :at: pass:normal[xref:#Checkpoints-at-struct-Checkpoints-Trace224-uint32-[`++at++`]]
  2726. :Trace208: pass:normal[xref:#Checkpoints-Trace208[`++Trace208++`]]
  2727. :Checkpoint208: pass:normal[xref:#Checkpoints-Checkpoint208[`++Checkpoint208++`]]
  2728. :push: pass:normal[xref:#Checkpoints-push-struct-Checkpoints-Trace208-uint48-uint208-[`++push++`]]
  2729. :lowerLookup: pass:normal[xref:#Checkpoints-lowerLookup-struct-Checkpoints-Trace208-uint48-[`++lowerLookup++`]]
  2730. :upperLookup: pass:normal[xref:#Checkpoints-upperLookup-struct-Checkpoints-Trace208-uint48-[`++upperLookup++`]]
  2731. :upperLookupRecent: pass:normal[xref:#Checkpoints-upperLookupRecent-struct-Checkpoints-Trace208-uint48-[`++upperLookupRecent++`]]
  2732. :latest: pass:normal[xref:#Checkpoints-latest-struct-Checkpoints-Trace208-[`++latest++`]]
  2733. :latestCheckpoint: pass:normal[xref:#Checkpoints-latestCheckpoint-struct-Checkpoints-Trace208-[`++latestCheckpoint++`]]
  2734. :length: pass:normal[xref:#Checkpoints-length-struct-Checkpoints-Trace208-[`++length++`]]
  2735. :at: pass:normal[xref:#Checkpoints-at-struct-Checkpoints-Trace208-uint32-[`++at++`]]
  2736. :Trace160: pass:normal[xref:#Checkpoints-Trace160[`++Trace160++`]]
  2737. :Checkpoint160: pass:normal[xref:#Checkpoints-Checkpoint160[`++Checkpoint160++`]]
  2738. :push: pass:normal[xref:#Checkpoints-push-struct-Checkpoints-Trace160-uint96-uint160-[`++push++`]]
  2739. :lowerLookup: pass:normal[xref:#Checkpoints-lowerLookup-struct-Checkpoints-Trace160-uint96-[`++lowerLookup++`]]
  2740. :upperLookup: pass:normal[xref:#Checkpoints-upperLookup-struct-Checkpoints-Trace160-uint96-[`++upperLookup++`]]
  2741. :upperLookupRecent: pass:normal[xref:#Checkpoints-upperLookupRecent-struct-Checkpoints-Trace160-uint96-[`++upperLookupRecent++`]]
  2742. :latest: pass:normal[xref:#Checkpoints-latest-struct-Checkpoints-Trace160-[`++latest++`]]
  2743. :latestCheckpoint: pass:normal[xref:#Checkpoints-latestCheckpoint-struct-Checkpoints-Trace160-[`++latestCheckpoint++`]]
  2744. :length: pass:normal[xref:#Checkpoints-length-struct-Checkpoints-Trace160-[`++length++`]]
  2745. :at: pass:normal[xref:#Checkpoints-at-struct-Checkpoints-Trace160-uint32-[`++at++`]]
  2746. [.contract]
  2747. [[Checkpoints]]
  2748. === `++Checkpoints++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/structs/Checkpoints.sol[{github-icon},role=heading-link]
  2749. [.hljs-theme-light.nopadding]
  2750. ```solidity
  2751. import "@openzeppelin/contracts/utils/structs/Checkpoints.sol";
  2752. ```
  2753. This library defines the `Trace*` struct, for checkpointing values as they change at different points in
  2754. time, and later looking up past values by block number. See {Votes} as an example.
  2755. To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new
  2756. checkpoint for the current transaction block using the {push} function.
  2757. [.contract-index]
  2758. .Functions
  2759. --
  2760. * {xref-Checkpoints-push-struct-Checkpoints-Trace224-uint32-uint224-}[`++push(self, key, value)++`]
  2761. * {xref-Checkpoints-lowerLookup-struct-Checkpoints-Trace224-uint32-}[`++lowerLookup(self, key)++`]
  2762. * {xref-Checkpoints-upperLookup-struct-Checkpoints-Trace224-uint32-}[`++upperLookup(self, key)++`]
  2763. * {xref-Checkpoints-upperLookupRecent-struct-Checkpoints-Trace224-uint32-}[`++upperLookupRecent(self, key)++`]
  2764. * {xref-Checkpoints-latest-struct-Checkpoints-Trace224-}[`++latest(self)++`]
  2765. * {xref-Checkpoints-latestCheckpoint-struct-Checkpoints-Trace224-}[`++latestCheckpoint(self)++`]
  2766. * {xref-Checkpoints-length-struct-Checkpoints-Trace224-}[`++length(self)++`]
  2767. * {xref-Checkpoints-at-struct-Checkpoints-Trace224-uint32-}[`++at(self, pos)++`]
  2768. * {xref-Checkpoints-push-struct-Checkpoints-Trace208-uint48-uint208-}[`++push(self, key, value)++`]
  2769. * {xref-Checkpoints-lowerLookup-struct-Checkpoints-Trace208-uint48-}[`++lowerLookup(self, key)++`]
  2770. * {xref-Checkpoints-upperLookup-struct-Checkpoints-Trace208-uint48-}[`++upperLookup(self, key)++`]
  2771. * {xref-Checkpoints-upperLookupRecent-struct-Checkpoints-Trace208-uint48-}[`++upperLookupRecent(self, key)++`]
  2772. * {xref-Checkpoints-latest-struct-Checkpoints-Trace208-}[`++latest(self)++`]
  2773. * {xref-Checkpoints-latestCheckpoint-struct-Checkpoints-Trace208-}[`++latestCheckpoint(self)++`]
  2774. * {xref-Checkpoints-length-struct-Checkpoints-Trace208-}[`++length(self)++`]
  2775. * {xref-Checkpoints-at-struct-Checkpoints-Trace208-uint32-}[`++at(self, pos)++`]
  2776. * {xref-Checkpoints-push-struct-Checkpoints-Trace160-uint96-uint160-}[`++push(self, key, value)++`]
  2777. * {xref-Checkpoints-lowerLookup-struct-Checkpoints-Trace160-uint96-}[`++lowerLookup(self, key)++`]
  2778. * {xref-Checkpoints-upperLookup-struct-Checkpoints-Trace160-uint96-}[`++upperLookup(self, key)++`]
  2779. * {xref-Checkpoints-upperLookupRecent-struct-Checkpoints-Trace160-uint96-}[`++upperLookupRecent(self, key)++`]
  2780. * {xref-Checkpoints-latest-struct-Checkpoints-Trace160-}[`++latest(self)++`]
  2781. * {xref-Checkpoints-latestCheckpoint-struct-Checkpoints-Trace160-}[`++latestCheckpoint(self)++`]
  2782. * {xref-Checkpoints-length-struct-Checkpoints-Trace160-}[`++length(self)++`]
  2783. * {xref-Checkpoints-at-struct-Checkpoints-Trace160-uint32-}[`++at(self, pos)++`]
  2784. --
  2785. [.contract-index]
  2786. .Errors
  2787. --
  2788. * {xref-Checkpoints-CheckpointUnorderedInsertion--}[`++CheckpointUnorderedInsertion()++`]
  2789. --
  2790. [.contract-item]
  2791. [[Checkpoints-push-struct-Checkpoints-Trace224-uint32-uint224-]]
  2792. ==== `[.contract-item-name]#++push++#++(struct Checkpoints.Trace224 self, uint32 key, uint224 value) → uint224, uint224++` [.item-kind]#internal#
  2793. Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.
  2794. Returns previous value and new value.
  2795. IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the
  2796. library.
  2797. [.contract-item]
  2798. [[Checkpoints-lowerLookup-struct-Checkpoints-Trace224-uint32-]]
  2799. ==== `[.contract-item-name]#++lowerLookup++#++(struct Checkpoints.Trace224 self, uint32 key) → uint224++` [.item-kind]#internal#
  2800. Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if
  2801. there is none.
  2802. [.contract-item]
  2803. [[Checkpoints-upperLookup-struct-Checkpoints-Trace224-uint32-]]
  2804. ==== `[.contract-item-name]#++upperLookup++#++(struct Checkpoints.Trace224 self, uint32 key) → uint224++` [.item-kind]#internal#
  2805. Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero
  2806. if there is none.
  2807. [.contract-item]
  2808. [[Checkpoints-upperLookupRecent-struct-Checkpoints-Trace224-uint32-]]
  2809. ==== `[.contract-item-name]#++upperLookupRecent++#++(struct Checkpoints.Trace224 self, uint32 key) → uint224++` [.item-kind]#internal#
  2810. Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero
  2811. if there is none.
  2812. NOTE: This is a variant of {upperLookup} that is optimised to find "recent" checkpoint (checkpoints with high
  2813. keys).
  2814. [.contract-item]
  2815. [[Checkpoints-latest-struct-Checkpoints-Trace224-]]
  2816. ==== `[.contract-item-name]#++latest++#++(struct Checkpoints.Trace224 self) → uint224++` [.item-kind]#internal#
  2817. Returns the value in the most recent checkpoint, or zero if there are no checkpoints.
  2818. [.contract-item]
  2819. [[Checkpoints-latestCheckpoint-struct-Checkpoints-Trace224-]]
  2820. ==== `[.contract-item-name]#++latestCheckpoint++#++(struct Checkpoints.Trace224 self) → bool exists, uint32 _key, uint224 _value++` [.item-kind]#internal#
  2821. Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value
  2822. in the most recent checkpoint.
  2823. [.contract-item]
  2824. [[Checkpoints-length-struct-Checkpoints-Trace224-]]
  2825. ==== `[.contract-item-name]#++length++#++(struct Checkpoints.Trace224 self) → uint256++` [.item-kind]#internal#
  2826. Returns the number of checkpoint.
  2827. [.contract-item]
  2828. [[Checkpoints-at-struct-Checkpoints-Trace224-uint32-]]
  2829. ==== `[.contract-item-name]#++at++#++(struct Checkpoints.Trace224 self, uint32 pos) → struct Checkpoints.Checkpoint224++` [.item-kind]#internal#
  2830. Returns checkpoint at given position.
  2831. [.contract-item]
  2832. [[Checkpoints-push-struct-Checkpoints-Trace208-uint48-uint208-]]
  2833. ==== `[.contract-item-name]#++push++#++(struct Checkpoints.Trace208 self, uint48 key, uint208 value) → uint208, uint208++` [.item-kind]#internal#
  2834. Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.
  2835. Returns previous value and new value.
  2836. IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the
  2837. library.
  2838. [.contract-item]
  2839. [[Checkpoints-lowerLookup-struct-Checkpoints-Trace208-uint48-]]
  2840. ==== `[.contract-item-name]#++lowerLookup++#++(struct Checkpoints.Trace208 self, uint48 key) → uint208++` [.item-kind]#internal#
  2841. Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if
  2842. there is none.
  2843. [.contract-item]
  2844. [[Checkpoints-upperLookup-struct-Checkpoints-Trace208-uint48-]]
  2845. ==== `[.contract-item-name]#++upperLookup++#++(struct Checkpoints.Trace208 self, uint48 key) → uint208++` [.item-kind]#internal#
  2846. Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero
  2847. if there is none.
  2848. [.contract-item]
  2849. [[Checkpoints-upperLookupRecent-struct-Checkpoints-Trace208-uint48-]]
  2850. ==== `[.contract-item-name]#++upperLookupRecent++#++(struct Checkpoints.Trace208 self, uint48 key) → uint208++` [.item-kind]#internal#
  2851. Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero
  2852. if there is none.
  2853. NOTE: This is a variant of {upperLookup} that is optimised to find "recent" checkpoint (checkpoints with high
  2854. keys).
  2855. [.contract-item]
  2856. [[Checkpoints-latest-struct-Checkpoints-Trace208-]]
  2857. ==== `[.contract-item-name]#++latest++#++(struct Checkpoints.Trace208 self) → uint208++` [.item-kind]#internal#
  2858. Returns the value in the most recent checkpoint, or zero if there are no checkpoints.
  2859. [.contract-item]
  2860. [[Checkpoints-latestCheckpoint-struct-Checkpoints-Trace208-]]
  2861. ==== `[.contract-item-name]#++latestCheckpoint++#++(struct Checkpoints.Trace208 self) → bool exists, uint48 _key, uint208 _value++` [.item-kind]#internal#
  2862. Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value
  2863. in the most recent checkpoint.
  2864. [.contract-item]
  2865. [[Checkpoints-length-struct-Checkpoints-Trace208-]]
  2866. ==== `[.contract-item-name]#++length++#++(struct Checkpoints.Trace208 self) → uint256++` [.item-kind]#internal#
  2867. Returns the number of checkpoint.
  2868. [.contract-item]
  2869. [[Checkpoints-at-struct-Checkpoints-Trace208-uint32-]]
  2870. ==== `[.contract-item-name]#++at++#++(struct Checkpoints.Trace208 self, uint32 pos) → struct Checkpoints.Checkpoint208++` [.item-kind]#internal#
  2871. Returns checkpoint at given position.
  2872. [.contract-item]
  2873. [[Checkpoints-push-struct-Checkpoints-Trace160-uint96-uint160-]]
  2874. ==== `[.contract-item-name]#++push++#++(struct Checkpoints.Trace160 self, uint96 key, uint160 value) → uint160, uint160++` [.item-kind]#internal#
  2875. Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.
  2876. Returns previous value and new value.
  2877. IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the
  2878. library.
  2879. [.contract-item]
  2880. [[Checkpoints-lowerLookup-struct-Checkpoints-Trace160-uint96-]]
  2881. ==== `[.contract-item-name]#++lowerLookup++#++(struct Checkpoints.Trace160 self, uint96 key) → uint160++` [.item-kind]#internal#
  2882. Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if
  2883. there is none.
  2884. [.contract-item]
  2885. [[Checkpoints-upperLookup-struct-Checkpoints-Trace160-uint96-]]
  2886. ==== `[.contract-item-name]#++upperLookup++#++(struct Checkpoints.Trace160 self, uint96 key) → uint160++` [.item-kind]#internal#
  2887. Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero
  2888. if there is none.
  2889. [.contract-item]
  2890. [[Checkpoints-upperLookupRecent-struct-Checkpoints-Trace160-uint96-]]
  2891. ==== `[.contract-item-name]#++upperLookupRecent++#++(struct Checkpoints.Trace160 self, uint96 key) → uint160++` [.item-kind]#internal#
  2892. Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero
  2893. if there is none.
  2894. NOTE: This is a variant of {upperLookup} that is optimised to find "recent" checkpoint (checkpoints with high
  2895. keys).
  2896. [.contract-item]
  2897. [[Checkpoints-latest-struct-Checkpoints-Trace160-]]
  2898. ==== `[.contract-item-name]#++latest++#++(struct Checkpoints.Trace160 self) → uint160++` [.item-kind]#internal#
  2899. Returns the value in the most recent checkpoint, or zero if there are no checkpoints.
  2900. [.contract-item]
  2901. [[Checkpoints-latestCheckpoint-struct-Checkpoints-Trace160-]]
  2902. ==== `[.contract-item-name]#++latestCheckpoint++#++(struct Checkpoints.Trace160 self) → bool exists, uint96 _key, uint160 _value++` [.item-kind]#internal#
  2903. Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value
  2904. in the most recent checkpoint.
  2905. [.contract-item]
  2906. [[Checkpoints-length-struct-Checkpoints-Trace160-]]
  2907. ==== `[.contract-item-name]#++length++#++(struct Checkpoints.Trace160 self) → uint256++` [.item-kind]#internal#
  2908. Returns the number of checkpoint.
  2909. [.contract-item]
  2910. [[Checkpoints-at-struct-Checkpoints-Trace160-uint32-]]
  2911. ==== `[.contract-item-name]#++at++#++(struct Checkpoints.Trace160 self, uint32 pos) → struct Checkpoints.Checkpoint160++` [.item-kind]#internal#
  2912. Returns checkpoint at given position.
  2913. [.contract-item]
  2914. [[Checkpoints-CheckpointUnorderedInsertion--]]
  2915. ==== `[.contract-item-name]#++CheckpointUnorderedInsertion++#++()++` [.item-kind]#error#
  2916. A value was attempted to be inserted on a past checkpoint.
  2917. == Libraries
  2918. :Create2InsufficientBalance: pass:normal[xref:#Create2-Create2InsufficientBalance-uint256-uint256-[`++Create2InsufficientBalance++`]]
  2919. :Create2EmptyBytecode: pass:normal[xref:#Create2-Create2EmptyBytecode--[`++Create2EmptyBytecode++`]]
  2920. :Create2FailedDeployment: pass:normal[xref:#Create2-Create2FailedDeployment--[`++Create2FailedDeployment++`]]
  2921. :deploy: pass:normal[xref:#Create2-deploy-uint256-bytes32-bytes-[`++deploy++`]]
  2922. :computeAddress: pass:normal[xref:#Create2-computeAddress-bytes32-bytes32-[`++computeAddress++`]]
  2923. :computeAddress: pass:normal[xref:#Create2-computeAddress-bytes32-bytes32-address-[`++computeAddress++`]]
  2924. [.contract]
  2925. [[Create2]]
  2926. === `++Create2++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Create2.sol[{github-icon},role=heading-link]
  2927. [.hljs-theme-light.nopadding]
  2928. ```solidity
  2929. import "@openzeppelin/contracts/utils/Create2.sol";
  2930. ```
  2931. Helper to make usage of the `CREATE2` EVM opcode easier and safer.
  2932. `CREATE2` can be used to compute in advance the address where a smart
  2933. contract will be deployed, which allows for interesting new mechanisms known
  2934. as 'counterfactual interactions'.
  2935. See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more
  2936. information.
  2937. [.contract-index]
  2938. .Functions
  2939. --
  2940. * {xref-Create2-deploy-uint256-bytes32-bytes-}[`++deploy(amount, salt, bytecode)++`]
  2941. * {xref-Create2-computeAddress-bytes32-bytes32-}[`++computeAddress(salt, bytecodeHash)++`]
  2942. * {xref-Create2-computeAddress-bytes32-bytes32-address-}[`++computeAddress(salt, bytecodeHash, deployer)++`]
  2943. --
  2944. [.contract-index]
  2945. .Errors
  2946. --
  2947. * {xref-Create2-Create2InsufficientBalance-uint256-uint256-}[`++Create2InsufficientBalance(balance, needed)++`]
  2948. * {xref-Create2-Create2EmptyBytecode--}[`++Create2EmptyBytecode()++`]
  2949. * {xref-Create2-Create2FailedDeployment--}[`++Create2FailedDeployment()++`]
  2950. --
  2951. [.contract-item]
  2952. [[Create2-deploy-uint256-bytes32-bytes-]]
  2953. ==== `[.contract-item-name]#++deploy++#++(uint256 amount, bytes32 salt, bytes bytecode) → address addr++` [.item-kind]#internal#
  2954. Deploys a contract using `CREATE2`. The address where the contract
  2955. will be deployed can be known in advance via {computeAddress}.
  2956. The bytecode for a contract can be obtained from Solidity with
  2957. `type(contractName).creationCode`.
  2958. Requirements:
  2959. - `bytecode` must not be empty.
  2960. - `salt` must have not been used for `bytecode` already.
  2961. - the factory must have a balance of at least `amount`.
  2962. - if `amount` is non-zero, `bytecode` must have a `payable` constructor.
  2963. [.contract-item]
  2964. [[Create2-computeAddress-bytes32-bytes32-]]
  2965. ==== `[.contract-item-name]#++computeAddress++#++(bytes32 salt, bytes32 bytecodeHash) → address++` [.item-kind]#internal#
  2966. Returns the address where a contract will be stored if deployed via {deploy}. Any change in the
  2967. `bytecodeHash` or `salt` will result in a new destination address.
  2968. [.contract-item]
  2969. [[Create2-computeAddress-bytes32-bytes32-address-]]
  2970. ==== `[.contract-item-name]#++computeAddress++#++(bytes32 salt, bytes32 bytecodeHash, address deployer) → address addr++` [.item-kind]#internal#
  2971. Returns the address where a contract will be stored if deployed via {deploy} from a contract located at
  2972. `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.
  2973. [.contract-item]
  2974. [[Create2-Create2InsufficientBalance-uint256-uint256-]]
  2975. ==== `[.contract-item-name]#++Create2InsufficientBalance++#++(uint256 balance, uint256 needed)++` [.item-kind]#error#
  2976. Not enough balance for performing a CREATE2 deploy.
  2977. [.contract-item]
  2978. [[Create2-Create2EmptyBytecode--]]
  2979. ==== `[.contract-item-name]#++Create2EmptyBytecode++#++()++` [.item-kind]#error#
  2980. There's no code to deploy.
  2981. [.contract-item]
  2982. [[Create2-Create2FailedDeployment--]]
  2983. ==== `[.contract-item-name]#++Create2FailedDeployment++#++()++` [.item-kind]#error#
  2984. The deployment failed.
  2985. :AddressInsufficientBalance: pass:normal[xref:#Address-AddressInsufficientBalance-address-[`++AddressInsufficientBalance++`]]
  2986. :AddressEmptyCode: pass:normal[xref:#Address-AddressEmptyCode-address-[`++AddressEmptyCode++`]]
  2987. :FailedInnerCall: pass:normal[xref:#Address-FailedInnerCall--[`++FailedInnerCall++`]]
  2988. :sendValue: pass:normal[xref:#Address-sendValue-address-payable-uint256-[`++sendValue++`]]
  2989. :functionCall: pass:normal[xref:#Address-functionCall-address-bytes-[`++functionCall++`]]
  2990. :functionCallWithValue: pass:normal[xref:#Address-functionCallWithValue-address-bytes-uint256-[`++functionCallWithValue++`]]
  2991. :functionStaticCall: pass:normal[xref:#Address-functionStaticCall-address-bytes-[`++functionStaticCall++`]]
  2992. :functionDelegateCall: pass:normal[xref:#Address-functionDelegateCall-address-bytes-[`++functionDelegateCall++`]]
  2993. :verifyCallResultFromTarget: pass:normal[xref:#Address-verifyCallResultFromTarget-address-bool-bytes-[`++verifyCallResultFromTarget++`]]
  2994. :verifyCallResult: pass:normal[xref:#Address-verifyCallResult-bool-bytes-[`++verifyCallResult++`]]
  2995. [.contract]
  2996. [[Address]]
  2997. === `++Address++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Address.sol[{github-icon},role=heading-link]
  2998. [.hljs-theme-light.nopadding]
  2999. ```solidity
  3000. import "@openzeppelin/contracts/utils/Address.sol";
  3001. ```
  3002. Collection of functions related to the address type
  3003. [.contract-index]
  3004. .Functions
  3005. --
  3006. * {xref-Address-sendValue-address-payable-uint256-}[`++sendValue(recipient, amount)++`]
  3007. * {xref-Address-functionCall-address-bytes-}[`++functionCall(target, data)++`]
  3008. * {xref-Address-functionCallWithValue-address-bytes-uint256-}[`++functionCallWithValue(target, data, value)++`]
  3009. * {xref-Address-functionStaticCall-address-bytes-}[`++functionStaticCall(target, data)++`]
  3010. * {xref-Address-functionDelegateCall-address-bytes-}[`++functionDelegateCall(target, data)++`]
  3011. * {xref-Address-verifyCallResultFromTarget-address-bool-bytes-}[`++verifyCallResultFromTarget(target, success, returndata)++`]
  3012. * {xref-Address-verifyCallResult-bool-bytes-}[`++verifyCallResult(success, returndata)++`]
  3013. --
  3014. [.contract-index]
  3015. .Errors
  3016. --
  3017. * {xref-Address-AddressInsufficientBalance-address-}[`++AddressInsufficientBalance(account)++`]
  3018. * {xref-Address-AddressEmptyCode-address-}[`++AddressEmptyCode(target)++`]
  3019. * {xref-Address-FailedInnerCall--}[`++FailedInnerCall()++`]
  3020. --
  3021. [.contract-item]
  3022. [[Address-sendValue-address-payable-uint256-]]
  3023. ==== `[.contract-item-name]#++sendValue++#++(address payable recipient, uint256 amount)++` [.item-kind]#internal#
  3024. Replacement for Solidity's `transfer`: sends `amount` wei to
  3025. `recipient`, forwarding all available gas and reverting on errors.
  3026. https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
  3027. of certain opcodes, possibly making contracts go over the 2300 gas limit
  3028. imposed by `transfer`, making them unable to receive funds via
  3029. `transfer`. {sendValue} removes this limitation.
  3030. https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
  3031. IMPORTANT: because control is transferred to `recipient`, care must be
  3032. taken to not create reentrancy vulnerabilities. Consider using
  3033. {ReentrancyGuard} or the
  3034. https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
  3035. [.contract-item]
  3036. [[Address-functionCall-address-bytes-]]
  3037. ==== `[.contract-item-name]#++functionCall++#++(address target, bytes data) → bytes++` [.item-kind]#internal#
  3038. Performs a Solidity function call using a low level `call`. A
  3039. plain `call` is an unsafe replacement for a function call: use this
  3040. function instead.
  3041. If `target` reverts with a revert reason or custom error, it is bubbled
  3042. up by this function (like regular Solidity function calls). However, if
  3043. the call reverted with no returned reason, this function reverts with a
  3044. {FailedInnerCall} error.
  3045. Returns the raw returned data. To convert to the expected return value,
  3046. use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
  3047. Requirements:
  3048. - `target` must be a contract.
  3049. - calling `target` with `data` must not revert.
  3050. [.contract-item]
  3051. [[Address-functionCallWithValue-address-bytes-uint256-]]
  3052. ==== `[.contract-item-name]#++functionCallWithValue++#++(address target, bytes data, uint256 value) → bytes++` [.item-kind]#internal#
  3053. Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
  3054. but also transferring `value` wei to `target`.
  3055. Requirements:
  3056. - the calling contract must have an ETH balance of at least `value`.
  3057. - the called Solidity function must be `payable`.
  3058. [.contract-item]
  3059. [[Address-functionStaticCall-address-bytes-]]
  3060. ==== `[.contract-item-name]#++functionStaticCall++#++(address target, bytes data) → bytes++` [.item-kind]#internal#
  3061. Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
  3062. but performing a static call.
  3063. [.contract-item]
  3064. [[Address-functionDelegateCall-address-bytes-]]
  3065. ==== `[.contract-item-name]#++functionDelegateCall++#++(address target, bytes data) → bytes++` [.item-kind]#internal#
  3066. Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
  3067. but performing a delegate call.
  3068. [.contract-item]
  3069. [[Address-verifyCallResultFromTarget-address-bool-bytes-]]
  3070. ==== `[.contract-item-name]#++verifyCallResultFromTarget++#++(address target, bool success, bytes returndata) → bytes++` [.item-kind]#internal#
  3071. Tool to verify that a low level call to smart-contract was successful, and reverts if the target
  3072. was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
  3073. unsuccessful call.
  3074. [.contract-item]
  3075. [[Address-verifyCallResult-bool-bytes-]]
  3076. ==== `[.contract-item-name]#++verifyCallResult++#++(bool success, bytes returndata) → bytes++` [.item-kind]#internal#
  3077. Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
  3078. revert reason or with a default {FailedInnerCall} error.
  3079. [.contract-item]
  3080. [[Address-AddressInsufficientBalance-address-]]
  3081. ==== `[.contract-item-name]#++AddressInsufficientBalance++#++(address account)++` [.item-kind]#error#
  3082. The ETH balance of the account is not enough to perform the operation.
  3083. [.contract-item]
  3084. [[Address-AddressEmptyCode-address-]]
  3085. ==== `[.contract-item-name]#++AddressEmptyCode++#++(address target)++` [.item-kind]#error#
  3086. There's no code at `target` (it is not a contract).
  3087. [.contract-item]
  3088. [[Address-FailedInnerCall--]]
  3089. ==== `[.contract-item-name]#++FailedInnerCall++#++()++` [.item-kind]#error#
  3090. A call to an address target failed. The target may have reverted.
  3091. :findUpperBound: pass:normal[xref:#Arrays-findUpperBound-uint256---uint256-[`++findUpperBound++`]]
  3092. :unsafeAccess: pass:normal[xref:#Arrays-unsafeAccess-address---uint256-[`++unsafeAccess++`]]
  3093. :unsafeAccess: pass:normal[xref:#Arrays-unsafeAccess-bytes32---uint256-[`++unsafeAccess++`]]
  3094. :unsafeAccess: pass:normal[xref:#Arrays-unsafeAccess-uint256---uint256-[`++unsafeAccess++`]]
  3095. :unsafeMemoryAccess: pass:normal[xref:#Arrays-unsafeMemoryAccess-uint256---uint256-[`++unsafeMemoryAccess++`]]
  3096. :unsafeMemoryAccess: pass:normal[xref:#Arrays-unsafeMemoryAccess-address---uint256-[`++unsafeMemoryAccess++`]]
  3097. [.contract]
  3098. [[Arrays]]
  3099. === `++Arrays++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Arrays.sol[{github-icon},role=heading-link]
  3100. [.hljs-theme-light.nopadding]
  3101. ```solidity
  3102. import "@openzeppelin/contracts/utils/Arrays.sol";
  3103. ```
  3104. Collection of functions related to array types.
  3105. [.contract-index]
  3106. .Functions
  3107. --
  3108. * {xref-Arrays-findUpperBound-uint256---uint256-}[`++findUpperBound(array, element)++`]
  3109. * {xref-Arrays-unsafeAccess-address---uint256-}[`++unsafeAccess(arr, pos)++`]
  3110. * {xref-Arrays-unsafeAccess-bytes32---uint256-}[`++unsafeAccess(arr, pos)++`]
  3111. * {xref-Arrays-unsafeAccess-uint256---uint256-}[`++unsafeAccess(arr, pos)++`]
  3112. * {xref-Arrays-unsafeMemoryAccess-uint256---uint256-}[`++unsafeMemoryAccess(arr, pos)++`]
  3113. * {xref-Arrays-unsafeMemoryAccess-address---uint256-}[`++unsafeMemoryAccess(arr, pos)++`]
  3114. --
  3115. [.contract-item]
  3116. [[Arrays-findUpperBound-uint256---uint256-]]
  3117. ==== `[.contract-item-name]#++findUpperBound++#++(uint256[] array, uint256 element) → uint256++` [.item-kind]#internal#
  3118. Searches a sorted `array` and returns the first index that contains
  3119. a value greater or equal to `element`. If no such index exists (i.e. all
  3120. values in the array are strictly less than `element`), the array length is
  3121. returned. Time complexity O(log n).
  3122. `array` is expected to be sorted in ascending order, and to contain no
  3123. repeated elements.
  3124. [.contract-item]
  3125. [[Arrays-unsafeAccess-address---uint256-]]
  3126. ==== `[.contract-item-name]#++unsafeAccess++#++(address[] arr, uint256 pos) → struct StorageSlot.AddressSlot++` [.item-kind]#internal#
  3127. Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
  3128. WARNING: Only use if you are certain `pos` is lower than the array length.
  3129. [.contract-item]
  3130. [[Arrays-unsafeAccess-bytes32---uint256-]]
  3131. ==== `[.contract-item-name]#++unsafeAccess++#++(bytes32[] arr, uint256 pos) → struct StorageSlot.Bytes32Slot++` [.item-kind]#internal#
  3132. Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
  3133. WARNING: Only use if you are certain `pos` is lower than the array length.
  3134. [.contract-item]
  3135. [[Arrays-unsafeAccess-uint256---uint256-]]
  3136. ==== `[.contract-item-name]#++unsafeAccess++#++(uint256[] arr, uint256 pos) → struct StorageSlot.Uint256Slot++` [.item-kind]#internal#
  3137. Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
  3138. WARNING: Only use if you are certain `pos` is lower than the array length.
  3139. [.contract-item]
  3140. [[Arrays-unsafeMemoryAccess-uint256---uint256-]]
  3141. ==== `[.contract-item-name]#++unsafeMemoryAccess++#++(uint256[] arr, uint256 pos) → uint256 res++` [.item-kind]#internal#
  3142. Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
  3143. WARNING: Only use if you are certain `pos` is lower than the array length.
  3144. [.contract-item]
  3145. [[Arrays-unsafeMemoryAccess-address---uint256-]]
  3146. ==== `[.contract-item-name]#++unsafeMemoryAccess++#++(address[] arr, uint256 pos) → address res++` [.item-kind]#internal#
  3147. Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
  3148. WARNING: Only use if you are certain `pos` is lower than the array length.
  3149. :_TABLE: pass:normal[xref:#Base64-_TABLE-string[`++_TABLE++`]]
  3150. :encode: pass:normal[xref:#Base64-encode-bytes-[`++encode++`]]
  3151. [.contract]
  3152. [[Base64]]
  3153. === `++Base64++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Base64.sol[{github-icon},role=heading-link]
  3154. [.hljs-theme-light.nopadding]
  3155. ```solidity
  3156. import "@openzeppelin/contracts/utils/Base64.sol";
  3157. ```
  3158. Provides a set of functions to operate with Base64 strings.
  3159. [.contract-index]
  3160. .Functions
  3161. --
  3162. * {xref-Base64-encode-bytes-}[`++encode(data)++`]
  3163. --
  3164. [.contract-item]
  3165. [[Base64-encode-bytes-]]
  3166. ==== `[.contract-item-name]#++encode++#++(bytes data) → string++` [.item-kind]#internal#
  3167. Converts a `bytes` to its Bytes64 `string` representation.
  3168. :StringsInsufficientHexLength: pass:normal[xref:#Strings-StringsInsufficientHexLength-uint256-uint256-[`++StringsInsufficientHexLength++`]]
  3169. :toString: pass:normal[xref:#Strings-toString-uint256-[`++toString++`]]
  3170. :toStringSigned: pass:normal[xref:#Strings-toStringSigned-int256-[`++toStringSigned++`]]
  3171. :toHexString: pass:normal[xref:#Strings-toHexString-uint256-[`++toHexString++`]]
  3172. :toHexString: pass:normal[xref:#Strings-toHexString-uint256-uint256-[`++toHexString++`]]
  3173. :toHexString: pass:normal[xref:#Strings-toHexString-address-[`++toHexString++`]]
  3174. :equal: pass:normal[xref:#Strings-equal-string-string-[`++equal++`]]
  3175. [.contract]
  3176. [[Strings]]
  3177. === `++Strings++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Strings.sol[{github-icon},role=heading-link]
  3178. [.hljs-theme-light.nopadding]
  3179. ```solidity
  3180. import "@openzeppelin/contracts/utils/Strings.sol";
  3181. ```
  3182. String operations.
  3183. [.contract-index]
  3184. .Functions
  3185. --
  3186. * {xref-Strings-toString-uint256-}[`++toString(value)++`]
  3187. * {xref-Strings-toStringSigned-int256-}[`++toStringSigned(value)++`]
  3188. * {xref-Strings-toHexString-uint256-}[`++toHexString(value)++`]
  3189. * {xref-Strings-toHexString-uint256-uint256-}[`++toHexString(value, length)++`]
  3190. * {xref-Strings-toHexString-address-}[`++toHexString(addr)++`]
  3191. * {xref-Strings-equal-string-string-}[`++equal(a, b)++`]
  3192. --
  3193. [.contract-index]
  3194. .Errors
  3195. --
  3196. * {xref-Strings-StringsInsufficientHexLength-uint256-uint256-}[`++StringsInsufficientHexLength(value, length)++`]
  3197. --
  3198. [.contract-item]
  3199. [[Strings-toString-uint256-]]
  3200. ==== `[.contract-item-name]#++toString++#++(uint256 value) → string++` [.item-kind]#internal#
  3201. Converts a `uint256` to its ASCII `string` decimal representation.
  3202. [.contract-item]
  3203. [[Strings-toStringSigned-int256-]]
  3204. ==== `[.contract-item-name]#++toStringSigned++#++(int256 value) → string++` [.item-kind]#internal#
  3205. Converts a `int256` to its ASCII `string` decimal representation.
  3206. [.contract-item]
  3207. [[Strings-toHexString-uint256-]]
  3208. ==== `[.contract-item-name]#++toHexString++#++(uint256 value) → string++` [.item-kind]#internal#
  3209. Converts a `uint256` to its ASCII `string` hexadecimal representation.
  3210. [.contract-item]
  3211. [[Strings-toHexString-uint256-uint256-]]
  3212. ==== `[.contract-item-name]#++toHexString++#++(uint256 value, uint256 length) → string++` [.item-kind]#internal#
  3213. Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
  3214. [.contract-item]
  3215. [[Strings-toHexString-address-]]
  3216. ==== `[.contract-item-name]#++toHexString++#++(address addr) → string++` [.item-kind]#internal#
  3217. Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
  3218. representation.
  3219. [.contract-item]
  3220. [[Strings-equal-string-string-]]
  3221. ==== `[.contract-item-name]#++equal++#++(string a, string b) → bool++` [.item-kind]#internal#
  3222. Returns true if the two strings are equal.
  3223. [.contract-item]
  3224. [[Strings-StringsInsufficientHexLength-uint256-uint256-]]
  3225. ==== `[.contract-item-name]#++StringsInsufficientHexLength++#++(uint256 value, uint256 length)++` [.item-kind]#error#
  3226. The `value` string doesn't fit in the specified `length`.
  3227. :StringTooLong: pass:normal[xref:#ShortStrings-StringTooLong-string-[`++StringTooLong++`]]
  3228. :InvalidShortString: pass:normal[xref:#ShortStrings-InvalidShortString--[`++InvalidShortString++`]]
  3229. :toShortString: pass:normal[xref:#ShortStrings-toShortString-string-[`++toShortString++`]]
  3230. :toString: pass:normal[xref:#ShortStrings-toString-ShortString-[`++toString++`]]
  3231. :byteLength: pass:normal[xref:#ShortStrings-byteLength-ShortString-[`++byteLength++`]]
  3232. :toShortStringWithFallback: pass:normal[xref:#ShortStrings-toShortStringWithFallback-string-string-[`++toShortStringWithFallback++`]]
  3233. :toStringWithFallback: pass:normal[xref:#ShortStrings-toStringWithFallback-ShortString-string-[`++toStringWithFallback++`]]
  3234. :byteLengthWithFallback: pass:normal[xref:#ShortStrings-byteLengthWithFallback-ShortString-string-[`++byteLengthWithFallback++`]]
  3235. [.contract]
  3236. [[ShortStrings]]
  3237. === `++ShortStrings++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/ShortStrings.sol[{github-icon},role=heading-link]
  3238. [.hljs-theme-light.nopadding]
  3239. ```solidity
  3240. import "@openzeppelin/contracts/utils/ShortStrings.sol";
  3241. ```
  3242. This library provides functions to convert short memory strings
  3243. into a `ShortString` type that can be used as an immutable variable.
  3244. Strings of arbitrary length can be optimized using this library if
  3245. they are short enough (up to 31 bytes) by packing them with their
  3246. length (1 byte) in a single EVM word (32 bytes). Additionally, a
  3247. fallback mechanism can be used for every other case.
  3248. Usage example:
  3249. ```solidity
  3250. contract Named {
  3251. using ShortStrings for *;
  3252. ShortString private immutable _name;
  3253. string private _nameFallback;
  3254. constructor(string memory contractName) {
  3255. _name = contractName.toShortStringWithFallback(_nameFallback);
  3256. }
  3257. function name() external view returns (string memory) {
  3258. return _name.toStringWithFallback(_nameFallback);
  3259. }
  3260. }
  3261. ```
  3262. [.contract-index]
  3263. .Functions
  3264. --
  3265. * {xref-ShortStrings-toShortString-string-}[`++toShortString(str)++`]
  3266. * {xref-ShortStrings-toString-ShortString-}[`++toString(sstr)++`]
  3267. * {xref-ShortStrings-byteLength-ShortString-}[`++byteLength(sstr)++`]
  3268. * {xref-ShortStrings-toShortStringWithFallback-string-string-}[`++toShortStringWithFallback(value, store)++`]
  3269. * {xref-ShortStrings-toStringWithFallback-ShortString-string-}[`++toStringWithFallback(value, store)++`]
  3270. * {xref-ShortStrings-byteLengthWithFallback-ShortString-string-}[`++byteLengthWithFallback(value, store)++`]
  3271. --
  3272. [.contract-index]
  3273. .Errors
  3274. --
  3275. * {xref-ShortStrings-StringTooLong-string-}[`++StringTooLong(str)++`]
  3276. * {xref-ShortStrings-InvalidShortString--}[`++InvalidShortString()++`]
  3277. --
  3278. [.contract-item]
  3279. [[ShortStrings-toShortString-string-]]
  3280. ==== `[.contract-item-name]#++toShortString++#++(string str) → ShortString++` [.item-kind]#internal#
  3281. Encode a string of at most 31 chars into a `ShortString`.
  3282. This will trigger a `StringTooLong` error is the input string is too long.
  3283. [.contract-item]
  3284. [[ShortStrings-toString-ShortString-]]
  3285. ==== `[.contract-item-name]#++toString++#++(ShortString sstr) → string++` [.item-kind]#internal#
  3286. Decode a `ShortString` back to a "normal" string.
  3287. [.contract-item]
  3288. [[ShortStrings-byteLength-ShortString-]]
  3289. ==== `[.contract-item-name]#++byteLength++#++(ShortString sstr) → uint256++` [.item-kind]#internal#
  3290. Return the length of a `ShortString`.
  3291. [.contract-item]
  3292. [[ShortStrings-toShortStringWithFallback-string-string-]]
  3293. ==== `[.contract-item-name]#++toShortStringWithFallback++#++(string value, string store) → ShortString++` [.item-kind]#internal#
  3294. Encode a string into a `ShortString`, or write it to storage if it is too long.
  3295. [.contract-item]
  3296. [[ShortStrings-toStringWithFallback-ShortString-string-]]
  3297. ==== `[.contract-item-name]#++toStringWithFallback++#++(ShortString value, string store) → string++` [.item-kind]#internal#
  3298. Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
  3299. [.contract-item]
  3300. [[ShortStrings-byteLengthWithFallback-ShortString-string-]]
  3301. ==== `[.contract-item-name]#++byteLengthWithFallback++#++(ShortString value, string store) → uint256++` [.item-kind]#internal#
  3302. Return the length of a string that was encoded to `ShortString` or written to storage using
  3303. {setWithFallback}.
  3304. WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
  3305. actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
  3306. [.contract-item]
  3307. [[ShortStrings-StringTooLong-string-]]
  3308. ==== `[.contract-item-name]#++StringTooLong++#++(string str)++` [.item-kind]#error#
  3309. [.contract-item]
  3310. [[ShortStrings-InvalidShortString--]]
  3311. ==== `[.contract-item-name]#++InvalidShortString++#++()++` [.item-kind]#error#
  3312. :AddressSlot: pass:normal[xref:#StorageSlot-AddressSlot[`++AddressSlot++`]]
  3313. :BooleanSlot: pass:normal[xref:#StorageSlot-BooleanSlot[`++BooleanSlot++`]]
  3314. :Bytes32Slot: pass:normal[xref:#StorageSlot-Bytes32Slot[`++Bytes32Slot++`]]
  3315. :Uint256Slot: pass:normal[xref:#StorageSlot-Uint256Slot[`++Uint256Slot++`]]
  3316. :StringSlot: pass:normal[xref:#StorageSlot-StringSlot[`++StringSlot++`]]
  3317. :BytesSlot: pass:normal[xref:#StorageSlot-BytesSlot[`++BytesSlot++`]]
  3318. :getAddressSlot: pass:normal[xref:#StorageSlot-getAddressSlot-bytes32-[`++getAddressSlot++`]]
  3319. :getBooleanSlot: pass:normal[xref:#StorageSlot-getBooleanSlot-bytes32-[`++getBooleanSlot++`]]
  3320. :getBytes32Slot: pass:normal[xref:#StorageSlot-getBytes32Slot-bytes32-[`++getBytes32Slot++`]]
  3321. :getUint256Slot: pass:normal[xref:#StorageSlot-getUint256Slot-bytes32-[`++getUint256Slot++`]]
  3322. :getStringSlot: pass:normal[xref:#StorageSlot-getStringSlot-bytes32-[`++getStringSlot++`]]
  3323. :getStringSlot: pass:normal[xref:#StorageSlot-getStringSlot-string-[`++getStringSlot++`]]
  3324. :getBytesSlot: pass:normal[xref:#StorageSlot-getBytesSlot-bytes32-[`++getBytesSlot++`]]
  3325. :getBytesSlot: pass:normal[xref:#StorageSlot-getBytesSlot-bytes-[`++getBytesSlot++`]]
  3326. [.contract]
  3327. [[StorageSlot]]
  3328. === `++StorageSlot++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/StorageSlot.sol[{github-icon},role=heading-link]
  3329. [.hljs-theme-light.nopadding]
  3330. ```solidity
  3331. import "@openzeppelin/contracts/utils/StorageSlot.sol";
  3332. ```
  3333. Library for reading and writing primitive types to specific storage slots.
  3334. Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
  3335. This library helps with reading and writing to such slots without the need for inline assembly.
  3336. The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
  3337. Example usage to set ERC1967 implementation slot:
  3338. ```solidity
  3339. contract ERC1967 {
  3340. bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
  3341. function _getImplementation() internal view returns (address) {
  3342. return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
  3343. }
  3344. function _setImplementation(address newImplementation) internal {
  3345. require(newImplementation.code.length > 0);
  3346. StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
  3347. }
  3348. }
  3349. ```
  3350. [.contract-index]
  3351. .Functions
  3352. --
  3353. * {xref-StorageSlot-getAddressSlot-bytes32-}[`++getAddressSlot(slot)++`]
  3354. * {xref-StorageSlot-getBooleanSlot-bytes32-}[`++getBooleanSlot(slot)++`]
  3355. * {xref-StorageSlot-getBytes32Slot-bytes32-}[`++getBytes32Slot(slot)++`]
  3356. * {xref-StorageSlot-getUint256Slot-bytes32-}[`++getUint256Slot(slot)++`]
  3357. * {xref-StorageSlot-getStringSlot-bytes32-}[`++getStringSlot(slot)++`]
  3358. * {xref-StorageSlot-getStringSlot-string-}[`++getStringSlot(store)++`]
  3359. * {xref-StorageSlot-getBytesSlot-bytes32-}[`++getBytesSlot(slot)++`]
  3360. * {xref-StorageSlot-getBytesSlot-bytes-}[`++getBytesSlot(store)++`]
  3361. --
  3362. [.contract-item]
  3363. [[StorageSlot-getAddressSlot-bytes32-]]
  3364. ==== `[.contract-item-name]#++getAddressSlot++#++(bytes32 slot) → struct StorageSlot.AddressSlot r++` [.item-kind]#internal#
  3365. Returns an `AddressSlot` with member `value` located at `slot`.
  3366. [.contract-item]
  3367. [[StorageSlot-getBooleanSlot-bytes32-]]
  3368. ==== `[.contract-item-name]#++getBooleanSlot++#++(bytes32 slot) → struct StorageSlot.BooleanSlot r++` [.item-kind]#internal#
  3369. Returns an `BooleanSlot` with member `value` located at `slot`.
  3370. [.contract-item]
  3371. [[StorageSlot-getBytes32Slot-bytes32-]]
  3372. ==== `[.contract-item-name]#++getBytes32Slot++#++(bytes32 slot) → struct StorageSlot.Bytes32Slot r++` [.item-kind]#internal#
  3373. Returns an `Bytes32Slot` with member `value` located at `slot`.
  3374. [.contract-item]
  3375. [[StorageSlot-getUint256Slot-bytes32-]]
  3376. ==== `[.contract-item-name]#++getUint256Slot++#++(bytes32 slot) → struct StorageSlot.Uint256Slot r++` [.item-kind]#internal#
  3377. Returns an `Uint256Slot` with member `value` located at `slot`.
  3378. [.contract-item]
  3379. [[StorageSlot-getStringSlot-bytes32-]]
  3380. ==== `[.contract-item-name]#++getStringSlot++#++(bytes32 slot) → struct StorageSlot.StringSlot r++` [.item-kind]#internal#
  3381. Returns an `StringSlot` with member `value` located at `slot`.
  3382. [.contract-item]
  3383. [[StorageSlot-getStringSlot-string-]]
  3384. ==== `[.contract-item-name]#++getStringSlot++#++(string store) → struct StorageSlot.StringSlot r++` [.item-kind]#internal#
  3385. Returns an `StringSlot` representation of the string storage pointer `store`.
  3386. [.contract-item]
  3387. [[StorageSlot-getBytesSlot-bytes32-]]
  3388. ==== `[.contract-item-name]#++getBytesSlot++#++(bytes32 slot) → struct StorageSlot.BytesSlot r++` [.item-kind]#internal#
  3389. Returns an `BytesSlot` with member `value` located at `slot`.
  3390. [.contract-item]
  3391. [[StorageSlot-getBytesSlot-bytes-]]
  3392. ==== `[.contract-item-name]#++getBytesSlot++#++(bytes store) → struct StorageSlot.BytesSlot r++` [.item-kind]#internal#
  3393. Returns an `BytesSlot` representation of the bytes storage pointer `store`.
  3394. :multicall: pass:normal[xref:#Multicall-multicall-bytes---[`++multicall++`]]
  3395. [.contract]
  3396. [[Multicall]]
  3397. === `++Multicall++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Multicall.sol[{github-icon},role=heading-link]
  3398. [.hljs-theme-light.nopadding]
  3399. ```solidity
  3400. import "@openzeppelin/contracts/utils/Multicall.sol";
  3401. ```
  3402. Provides a function to batch together multiple calls in a single external call.
  3403. Consider any assumption about calldata validation performed by the sender may be violated if it's not especially
  3404. careful about sending transactions invoking {multicall}. For example, a relay address that filters function
  3405. selectors won't filter calls nested within a {multicall} operation.
  3406. NOTE: Since 5.0.1 and 4.9.4, this contract identifies non-canonical contexts (i.e. `msg.sender` is not {_msgSender}).
  3407. If a non-canonical context is identified, the following self `delegatecall` appends the last bytes of `msg.data`
  3408. to the subcall. This makes it safe to use with {ERC2771Context}. Contexts that don't affect the resolution of
  3409. {_msgSender} are not propagated to subcalls.
  3410. [.contract-index]
  3411. .Functions
  3412. --
  3413. * {xref-Multicall-multicall-bytes---}[`++multicall(data)++`]
  3414. --
  3415. [.contract-item]
  3416. [[Multicall-multicall-bytes---]]
  3417. ==== `[.contract-item-name]#++multicall++#++(bytes[] data) → bytes[] results++` [.item-kind]#external#
  3418. Receives and executes a batch of function calls on this contract.
  3419. :_msgSender: pass:normal[xref:#Context-_msgSender--[`++_msgSender++`]]
  3420. :_msgData: pass:normal[xref:#Context-_msgData--[`++_msgData++`]]
  3421. :_contextSuffixLength: pass:normal[xref:#Context-_contextSuffixLength--[`++_contextSuffixLength++`]]
  3422. [.contract]
  3423. [[Context]]
  3424. === `++Context++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Context.sol[{github-icon},role=heading-link]
  3425. [.hljs-theme-light.nopadding]
  3426. ```solidity
  3427. import "@openzeppelin/contracts/utils/Context.sol";
  3428. ```
  3429. Provides information about the current execution context, including the
  3430. sender of the transaction and its data. While these are generally available
  3431. via msg.sender and msg.data, they should not be accessed in such a direct
  3432. manner, since when dealing with meta-transactions the account sending and
  3433. paying for execution may not be the actual sender (as far as an application
  3434. is concerned).
  3435. This contract is only required for intermediate, library-like contracts.
  3436. [.contract-index]
  3437. .Functions
  3438. --
  3439. * {xref-Context-_msgSender--}[`++_msgSender()++`]
  3440. * {xref-Context-_msgData--}[`++_msgData()++`]
  3441. * {xref-Context-_contextSuffixLength--}[`++_contextSuffixLength()++`]
  3442. --
  3443. [.contract-item]
  3444. [[Context-_msgSender--]]
  3445. ==== `[.contract-item-name]#++_msgSender++#++() → address++` [.item-kind]#internal#
  3446. [.contract-item]
  3447. [[Context-_msgData--]]
  3448. ==== `[.contract-item-name]#++_msgData++#++() → bytes++` [.item-kind]#internal#
  3449. [.contract-item]
  3450. [[Context-_contextSuffixLength--]]
  3451. ==== `[.contract-item-name]#++_contextSuffixLength++#++() → uint256++` [.item-kind]#internal#