utils.adoc 208 KB

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