access.adoc 133 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581
  1. :github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
  2. :AccessControl: pass:normal[xref:access.adoc#AccessControl[`AccessControl`]]
  3. :Ownable: pass:normal[xref:access.adoc#Ownable[`Ownable`]]
  4. :xref-Ownable-onlyOwner--: xref:access.adoc#Ownable-onlyOwner--
  5. :xref-Ownable-constructor-address-: xref:access.adoc#Ownable-constructor-address-
  6. :xref-Ownable-owner--: xref:access.adoc#Ownable-owner--
  7. :xref-Ownable-_checkOwner--: xref:access.adoc#Ownable-_checkOwner--
  8. :xref-Ownable-renounceOwnership--: xref:access.adoc#Ownable-renounceOwnership--
  9. :xref-Ownable-transferOwnership-address-: xref:access.adoc#Ownable-transferOwnership-address-
  10. :xref-Ownable-_transferOwnership-address-: xref:access.adoc#Ownable-_transferOwnership-address-
  11. :xref-Ownable-OwnershipTransferred-address-address-: xref:access.adoc#Ownable-OwnershipTransferred-address-address-
  12. :xref-Ownable-OwnableUnauthorizedAccount-address-: xref:access.adoc#Ownable-OwnableUnauthorizedAccount-address-
  13. :xref-Ownable-OwnableInvalidOwner-address-: xref:access.adoc#Ownable-OwnableInvalidOwner-address-
  14. :xref-Ownable2Step-pendingOwner--: xref:access.adoc#Ownable2Step-pendingOwner--
  15. :xref-Ownable2Step-transferOwnership-address-: xref:access.adoc#Ownable2Step-transferOwnership-address-
  16. :xref-Ownable2Step-_transferOwnership-address-: xref:access.adoc#Ownable2Step-_transferOwnership-address-
  17. :xref-Ownable2Step-acceptOwnership--: xref:access.adoc#Ownable2Step-acceptOwnership--
  18. :xref-Ownable-owner--: xref:access.adoc#Ownable-owner--
  19. :xref-Ownable-_checkOwner--: xref:access.adoc#Ownable-_checkOwner--
  20. :xref-Ownable-renounceOwnership--: xref:access.adoc#Ownable-renounceOwnership--
  21. :xref-Ownable2Step-OwnershipTransferStarted-address-address-: xref:access.adoc#Ownable2Step-OwnershipTransferStarted-address-address-
  22. :xref-Ownable-OwnershipTransferred-address-address-: xref:access.adoc#Ownable-OwnershipTransferred-address-address-
  23. :xref-Ownable-OwnableUnauthorizedAccount-address-: xref:access.adoc#Ownable-OwnableUnauthorizedAccount-address-
  24. :xref-Ownable-OwnableInvalidOwner-address-: xref:access.adoc#Ownable-OwnableInvalidOwner-address-
  25. :xref-IAccessControl-hasRole-bytes32-address-: xref:access.adoc#IAccessControl-hasRole-bytes32-address-
  26. :xref-IAccessControl-getRoleAdmin-bytes32-: xref:access.adoc#IAccessControl-getRoleAdmin-bytes32-
  27. :xref-IAccessControl-grantRole-bytes32-address-: xref:access.adoc#IAccessControl-grantRole-bytes32-address-
  28. :xref-IAccessControl-revokeRole-bytes32-address-: xref:access.adoc#IAccessControl-revokeRole-bytes32-address-
  29. :xref-IAccessControl-renounceRole-bytes32-address-: xref:access.adoc#IAccessControl-renounceRole-bytes32-address-
  30. :xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-: xref:access.adoc#IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-
  31. :xref-IAccessControl-RoleGranted-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleGranted-bytes32-address-address-
  32. :xref-IAccessControl-RoleRevoked-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleRevoked-bytes32-address-address-
  33. :xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-: xref:access.adoc#IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-
  34. :xref-IAccessControl-AccessControlBadConfirmation--: xref:access.adoc#IAccessControl-AccessControlBadConfirmation--
  35. :AccessControl-_setRoleAdmin: pass:normal[xref:access.adoc#AccessControl-_setRoleAdmin-bytes32-bytes32-[`AccessControl._setRoleAdmin`]]
  36. :AccessControlEnumerable: pass:normal[xref:access.adoc#AccessControlEnumerable[`AccessControlEnumerable`]]
  37. :AccessControlDefaultAdminRules: pass:normal[xref:access.adoc#AccessControlDefaultAdminRules[`AccessControlDefaultAdminRules`]]
  38. :xref-AccessControl-onlyRole-bytes32-: xref:access.adoc#AccessControl-onlyRole-bytes32-
  39. :xref-AccessControl-supportsInterface-bytes4-: xref:access.adoc#AccessControl-supportsInterface-bytes4-
  40. :xref-AccessControl-hasRole-bytes32-address-: xref:access.adoc#AccessControl-hasRole-bytes32-address-
  41. :xref-AccessControl-_checkRole-bytes32-: xref:access.adoc#AccessControl-_checkRole-bytes32-
  42. :xref-AccessControl-_checkRole-bytes32-address-: xref:access.adoc#AccessControl-_checkRole-bytes32-address-
  43. :xref-AccessControl-getRoleAdmin-bytes32-: xref:access.adoc#AccessControl-getRoleAdmin-bytes32-
  44. :xref-AccessControl-grantRole-bytes32-address-: xref:access.adoc#AccessControl-grantRole-bytes32-address-
  45. :xref-AccessControl-revokeRole-bytes32-address-: xref:access.adoc#AccessControl-revokeRole-bytes32-address-
  46. :xref-AccessControl-renounceRole-bytes32-address-: xref:access.adoc#AccessControl-renounceRole-bytes32-address-
  47. :xref-AccessControl-_setRoleAdmin-bytes32-bytes32-: xref:access.adoc#AccessControl-_setRoleAdmin-bytes32-bytes32-
  48. :xref-AccessControl-_grantRole-bytes32-address-: xref:access.adoc#AccessControl-_grantRole-bytes32-address-
  49. :xref-AccessControl-_revokeRole-bytes32-address-: xref:access.adoc#AccessControl-_revokeRole-bytes32-address-
  50. :xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-: xref:access.adoc#IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-
  51. :xref-IAccessControl-RoleGranted-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleGranted-bytes32-address-address-
  52. :xref-IAccessControl-RoleRevoked-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleRevoked-bytes32-address-address-
  53. :xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-: xref:access.adoc#IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-
  54. :xref-IAccessControl-AccessControlBadConfirmation--: xref:access.adoc#IAccessControl-AccessControlBadConfirmation--
  55. :IERC165-supportsInterface: pass:normal[xref:utils.adoc#IERC165-supportsInterface-bytes4-[`IERC165.supportsInterface`]]
  56. :xref-IAccessControlEnumerable-getRoleMember-bytes32-uint256-: xref:access.adoc#IAccessControlEnumerable-getRoleMember-bytes32-uint256-
  57. :xref-IAccessControlEnumerable-getRoleMemberCount-bytes32-: xref:access.adoc#IAccessControlEnumerable-getRoleMemberCount-bytes32-
  58. :xref-IAccessControl-hasRole-bytes32-address-: xref:access.adoc#IAccessControl-hasRole-bytes32-address-
  59. :xref-IAccessControl-getRoleAdmin-bytes32-: xref:access.adoc#IAccessControl-getRoleAdmin-bytes32-
  60. :xref-IAccessControl-grantRole-bytes32-address-: xref:access.adoc#IAccessControl-grantRole-bytes32-address-
  61. :xref-IAccessControl-revokeRole-bytes32-address-: xref:access.adoc#IAccessControl-revokeRole-bytes32-address-
  62. :xref-IAccessControl-renounceRole-bytes32-address-: xref:access.adoc#IAccessControl-renounceRole-bytes32-address-
  63. :xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-: xref:access.adoc#IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-
  64. :xref-IAccessControl-RoleGranted-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleGranted-bytes32-address-address-
  65. :xref-IAccessControl-RoleRevoked-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleRevoked-bytes32-address-address-
  66. :xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-: xref:access.adoc#IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-
  67. :xref-IAccessControl-AccessControlBadConfirmation--: xref:access.adoc#IAccessControl-AccessControlBadConfirmation--
  68. :AccessControl: pass:normal[xref:access.adoc#AccessControl[`AccessControl`]]
  69. :xref-AccessControlEnumerable-supportsInterface-bytes4-: xref:access.adoc#AccessControlEnumerable-supportsInterface-bytes4-
  70. :xref-AccessControlEnumerable-getRoleMember-bytes32-uint256-: xref:access.adoc#AccessControlEnumerable-getRoleMember-bytes32-uint256-
  71. :xref-AccessControlEnumerable-getRoleMemberCount-bytes32-: xref:access.adoc#AccessControlEnumerable-getRoleMemberCount-bytes32-
  72. :xref-AccessControlEnumerable-_grantRole-bytes32-address-: xref:access.adoc#AccessControlEnumerable-_grantRole-bytes32-address-
  73. :xref-AccessControlEnumerable-_revokeRole-bytes32-address-: xref:access.adoc#AccessControlEnumerable-_revokeRole-bytes32-address-
  74. :xref-AccessControl-hasRole-bytes32-address-: xref:access.adoc#AccessControl-hasRole-bytes32-address-
  75. :xref-AccessControl-_checkRole-bytes32-: xref:access.adoc#AccessControl-_checkRole-bytes32-
  76. :xref-AccessControl-_checkRole-bytes32-address-: xref:access.adoc#AccessControl-_checkRole-bytes32-address-
  77. :xref-AccessControl-getRoleAdmin-bytes32-: xref:access.adoc#AccessControl-getRoleAdmin-bytes32-
  78. :xref-AccessControl-grantRole-bytes32-address-: xref:access.adoc#AccessControl-grantRole-bytes32-address-
  79. :xref-AccessControl-revokeRole-bytes32-address-: xref:access.adoc#AccessControl-revokeRole-bytes32-address-
  80. :xref-AccessControl-renounceRole-bytes32-address-: xref:access.adoc#AccessControl-renounceRole-bytes32-address-
  81. :xref-AccessControl-_setRoleAdmin-bytes32-bytes32-: xref:access.adoc#AccessControl-_setRoleAdmin-bytes32-bytes32-
  82. :xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-: xref:access.adoc#IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-
  83. :xref-IAccessControl-RoleGranted-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleGranted-bytes32-address-address-
  84. :xref-IAccessControl-RoleRevoked-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleRevoked-bytes32-address-address-
  85. :xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-: xref:access.adoc#IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-
  86. :xref-IAccessControl-AccessControlBadConfirmation--: xref:access.adoc#IAccessControl-AccessControlBadConfirmation--
  87. :IERC165-supportsInterface: pass:normal[xref:utils.adoc#IERC165-supportsInterface-bytes4-[`IERC165.supportsInterface`]]
  88. :AccessControl-_grantRole: pass:normal[xref:access.adoc#AccessControl-_grantRole-bytes32-address-[`AccessControl._grantRole`]]
  89. :AccessControl-_revokeRole: pass:normal[xref:access.adoc#AccessControl-_revokeRole-bytes32-address-[`AccessControl._revokeRole`]]
  90. :xref-IAccessControlDefaultAdminRules-defaultAdmin--: xref:access.adoc#IAccessControlDefaultAdminRules-defaultAdmin--
  91. :xref-IAccessControlDefaultAdminRules-pendingDefaultAdmin--: xref:access.adoc#IAccessControlDefaultAdminRules-pendingDefaultAdmin--
  92. :xref-IAccessControlDefaultAdminRules-defaultAdminDelay--: xref:access.adoc#IAccessControlDefaultAdminRules-defaultAdminDelay--
  93. :xref-IAccessControlDefaultAdminRules-pendingDefaultAdminDelay--: xref:access.adoc#IAccessControlDefaultAdminRules-pendingDefaultAdminDelay--
  94. :xref-IAccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-: xref:access.adoc#IAccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-
  95. :xref-IAccessControlDefaultAdminRules-cancelDefaultAdminTransfer--: xref:access.adoc#IAccessControlDefaultAdminRules-cancelDefaultAdminTransfer--
  96. :xref-IAccessControlDefaultAdminRules-acceptDefaultAdminTransfer--: xref:access.adoc#IAccessControlDefaultAdminRules-acceptDefaultAdminTransfer--
  97. :xref-IAccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-: xref:access.adoc#IAccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-
  98. :xref-IAccessControlDefaultAdminRules-rollbackDefaultAdminDelay--: xref:access.adoc#IAccessControlDefaultAdminRules-rollbackDefaultAdminDelay--
  99. :xref-IAccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--: xref:access.adoc#IAccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--
  100. :xref-IAccessControl-hasRole-bytes32-address-: xref:access.adoc#IAccessControl-hasRole-bytes32-address-
  101. :xref-IAccessControl-getRoleAdmin-bytes32-: xref:access.adoc#IAccessControl-getRoleAdmin-bytes32-
  102. :xref-IAccessControl-grantRole-bytes32-address-: xref:access.adoc#IAccessControl-grantRole-bytes32-address-
  103. :xref-IAccessControl-revokeRole-bytes32-address-: xref:access.adoc#IAccessControl-revokeRole-bytes32-address-
  104. :xref-IAccessControl-renounceRole-bytes32-address-: xref:access.adoc#IAccessControl-renounceRole-bytes32-address-
  105. :xref-IAccessControlDefaultAdminRules-DefaultAdminTransferScheduled-address-uint48-: xref:access.adoc#IAccessControlDefaultAdminRules-DefaultAdminTransferScheduled-address-uint48-
  106. :xref-IAccessControlDefaultAdminRules-DefaultAdminTransferCanceled--: xref:access.adoc#IAccessControlDefaultAdminRules-DefaultAdminTransferCanceled--
  107. :xref-IAccessControlDefaultAdminRules-DefaultAdminDelayChangeScheduled-uint48-uint48-: xref:access.adoc#IAccessControlDefaultAdminRules-DefaultAdminDelayChangeScheduled-uint48-uint48-
  108. :xref-IAccessControlDefaultAdminRules-DefaultAdminDelayChangeCanceled--: xref:access.adoc#IAccessControlDefaultAdminRules-DefaultAdminDelayChangeCanceled--
  109. :xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-: xref:access.adoc#IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-
  110. :xref-IAccessControl-RoleGranted-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleGranted-bytes32-address-address-
  111. :xref-IAccessControl-RoleRevoked-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleRevoked-bytes32-address-address-
  112. :xref-IAccessControlDefaultAdminRules-AccessControlInvalidDefaultAdmin-address-: xref:access.adoc#IAccessControlDefaultAdminRules-AccessControlInvalidDefaultAdmin-address-
  113. :xref-IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminRules--: xref:access.adoc#IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminRules--
  114. :xref-IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminDelay-uint48-: xref:access.adoc#IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminDelay-uint48-
  115. :xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-: xref:access.adoc#IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-
  116. :xref-IAccessControl-AccessControlBadConfirmation--: xref:access.adoc#IAccessControl-AccessControlBadConfirmation--
  117. :AccessControl: pass:normal[xref:access.adoc#AccessControl[`AccessControl`]]
  118. :AccessControl: pass:normal[xref:access.adoc#AccessControl[`AccessControl`]]
  119. :xref-AccessControlDefaultAdminRules-constructor-uint48-address-: xref:access.adoc#AccessControlDefaultAdminRules-constructor-uint48-address-
  120. :xref-AccessControlDefaultAdminRules-supportsInterface-bytes4-: xref:access.adoc#AccessControlDefaultAdminRules-supportsInterface-bytes4-
  121. :xref-AccessControlDefaultAdminRules-owner--: xref:access.adoc#AccessControlDefaultAdminRules-owner--
  122. :xref-AccessControlDefaultAdminRules-grantRole-bytes32-address-: xref:access.adoc#AccessControlDefaultAdminRules-grantRole-bytes32-address-
  123. :xref-AccessControlDefaultAdminRules-revokeRole-bytes32-address-: xref:access.adoc#AccessControlDefaultAdminRules-revokeRole-bytes32-address-
  124. :xref-AccessControlDefaultAdminRules-renounceRole-bytes32-address-: xref:access.adoc#AccessControlDefaultAdminRules-renounceRole-bytes32-address-
  125. :xref-AccessControlDefaultAdminRules-_grantRole-bytes32-address-: xref:access.adoc#AccessControlDefaultAdminRules-_grantRole-bytes32-address-
  126. :xref-AccessControlDefaultAdminRules-_revokeRole-bytes32-address-: xref:access.adoc#AccessControlDefaultAdminRules-_revokeRole-bytes32-address-
  127. :xref-AccessControlDefaultAdminRules-_setRoleAdmin-bytes32-bytes32-: xref:access.adoc#AccessControlDefaultAdminRules-_setRoleAdmin-bytes32-bytes32-
  128. :xref-AccessControlDefaultAdminRules-defaultAdmin--: xref:access.adoc#AccessControlDefaultAdminRules-defaultAdmin--
  129. :xref-AccessControlDefaultAdminRules-pendingDefaultAdmin--: xref:access.adoc#AccessControlDefaultAdminRules-pendingDefaultAdmin--
  130. :xref-AccessControlDefaultAdminRules-defaultAdminDelay--: xref:access.adoc#AccessControlDefaultAdminRules-defaultAdminDelay--
  131. :xref-AccessControlDefaultAdminRules-pendingDefaultAdminDelay--: xref:access.adoc#AccessControlDefaultAdminRules-pendingDefaultAdminDelay--
  132. :xref-AccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--: xref:access.adoc#AccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--
  133. :xref-AccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-: xref:access.adoc#AccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-
  134. :xref-AccessControlDefaultAdminRules-_beginDefaultAdminTransfer-address-: xref:access.adoc#AccessControlDefaultAdminRules-_beginDefaultAdminTransfer-address-
  135. :xref-AccessControlDefaultAdminRules-cancelDefaultAdminTransfer--: xref:access.adoc#AccessControlDefaultAdminRules-cancelDefaultAdminTransfer--
  136. :xref-AccessControlDefaultAdminRules-_cancelDefaultAdminTransfer--: xref:access.adoc#AccessControlDefaultAdminRules-_cancelDefaultAdminTransfer--
  137. :xref-AccessControlDefaultAdminRules-acceptDefaultAdminTransfer--: xref:access.adoc#AccessControlDefaultAdminRules-acceptDefaultAdminTransfer--
  138. :xref-AccessControlDefaultAdminRules-_acceptDefaultAdminTransfer--: xref:access.adoc#AccessControlDefaultAdminRules-_acceptDefaultAdminTransfer--
  139. :xref-AccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-: xref:access.adoc#AccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-
  140. :xref-AccessControlDefaultAdminRules-_changeDefaultAdminDelay-uint48-: xref:access.adoc#AccessControlDefaultAdminRules-_changeDefaultAdminDelay-uint48-
  141. :xref-AccessControlDefaultAdminRules-rollbackDefaultAdminDelay--: xref:access.adoc#AccessControlDefaultAdminRules-rollbackDefaultAdminDelay--
  142. :xref-AccessControlDefaultAdminRules-_rollbackDefaultAdminDelay--: xref:access.adoc#AccessControlDefaultAdminRules-_rollbackDefaultAdminDelay--
  143. :xref-AccessControlDefaultAdminRules-_delayChangeWait-uint48-: xref:access.adoc#AccessControlDefaultAdminRules-_delayChangeWait-uint48-
  144. :xref-AccessControl-hasRole-bytes32-address-: xref:access.adoc#AccessControl-hasRole-bytes32-address-
  145. :xref-AccessControl-_checkRole-bytes32-: xref:access.adoc#AccessControl-_checkRole-bytes32-
  146. :xref-AccessControl-_checkRole-bytes32-address-: xref:access.adoc#AccessControl-_checkRole-bytes32-address-
  147. :xref-AccessControl-getRoleAdmin-bytes32-: xref:access.adoc#AccessControl-getRoleAdmin-bytes32-
  148. :xref-IAccessControlDefaultAdminRules-DefaultAdminTransferScheduled-address-uint48-: xref:access.adoc#IAccessControlDefaultAdminRules-DefaultAdminTransferScheduled-address-uint48-
  149. :xref-IAccessControlDefaultAdminRules-DefaultAdminTransferCanceled--: xref:access.adoc#IAccessControlDefaultAdminRules-DefaultAdminTransferCanceled--
  150. :xref-IAccessControlDefaultAdminRules-DefaultAdminDelayChangeScheduled-uint48-uint48-: xref:access.adoc#IAccessControlDefaultAdminRules-DefaultAdminDelayChangeScheduled-uint48-uint48-
  151. :xref-IAccessControlDefaultAdminRules-DefaultAdminDelayChangeCanceled--: xref:access.adoc#IAccessControlDefaultAdminRules-DefaultAdminDelayChangeCanceled--
  152. :xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-: xref:access.adoc#IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-
  153. :xref-IAccessControl-RoleGranted-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleGranted-bytes32-address-address-
  154. :xref-IAccessControl-RoleRevoked-bytes32-address-address-: xref:access.adoc#IAccessControl-RoleRevoked-bytes32-address-address-
  155. :xref-IAccessControlDefaultAdminRules-AccessControlInvalidDefaultAdmin-address-: xref:access.adoc#IAccessControlDefaultAdminRules-AccessControlInvalidDefaultAdmin-address-
  156. :xref-IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminRules--: xref:access.adoc#IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminRules--
  157. :xref-IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminDelay-uint48-: xref:access.adoc#IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminDelay-uint48-
  158. :xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-: xref:access.adoc#IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-
  159. :xref-IAccessControl-AccessControlBadConfirmation--: xref:access.adoc#IAccessControl-AccessControlBadConfirmation--
  160. :IERC165-supportsInterface: pass:normal[xref:utils.adoc#IERC165-supportsInterface-bytes4-[`IERC165.supportsInterface`]]
  161. :IERC5313-owner: pass:normal[xref:interfaces.adoc#IERC5313-owner--[`IERC5313.owner`]]
  162. :AccessControl-grantRole: pass:normal[xref:access.adoc#AccessControl-grantRole-bytes32-address-[`AccessControl.grantRole`]]
  163. :AccessControl-revokeRole: pass:normal[xref:access.adoc#AccessControl-revokeRole-bytes32-address-[`AccessControl.revokeRole`]]
  164. :AccessControl-renounceRole: pass:normal[xref:access.adoc#AccessControl-renounceRole-bytes32-address-[`AccessControl.renounceRole`]]
  165. :AccessControl-_grantRole: pass:normal[xref:access.adoc#AccessControl-_grantRole-bytes32-address-[`AccessControl._grantRole`]]
  166. :AccessControl-_revokeRole: pass:normal[xref:access.adoc#AccessControl-_revokeRole-bytes32-address-[`AccessControl._revokeRole`]]
  167. :AccessControl-_setRoleAdmin: pass:normal[xref:access.adoc#AccessControl-_setRoleAdmin-bytes32-bytes32-[`AccessControl._setRoleAdmin`]]
  168. :xref-IAuthority-canCall-address-address-bytes4-: xref:access.adoc#IAuthority-canCall-address-address-bytes4-
  169. :AccessManaged: pass:normal[xref:access.adoc#AccessManaged[`AccessManaged`]]
  170. :IAuthority: pass:normal[xref:access.adoc#IAuthority[`IAuthority`]]
  171. :Ownable: pass:normal[xref:access.adoc#Ownable[`Ownable`]]
  172. :AccessManager: pass:normal[xref:access.adoc#AccessManager[`AccessManager`]]
  173. :Ownable: pass:normal[xref:access.adoc#Ownable[`Ownable`]]
  174. :AccessManager: pass:normal[xref:access.adoc#AccessManager[`AccessManager`]]
  175. :AccessManager: pass:normal[xref:access.adoc#AccessManager[`AccessManager`]]
  176. :AccessManager: pass:normal[xref:access.adoc#AccessManager[`AccessManager`]]
  177. :Ownable: pass:normal[xref:access.adoc#Ownable[`Ownable`]]
  178. :AccessControl: pass:normal[xref:access.adoc#AccessControl[`AccessControl`]]
  179. :AccessManager: pass:normal[xref:access.adoc#AccessManager[`AccessManager`]]
  180. :Ownable-renounceOwnership: pass:normal[xref:access.adoc#Ownable-renounceOwnership--[`Ownable.renounceOwnership`]]
  181. :AccessControl-renounceRole: pass:normal[xref:access.adoc#AccessControl-renounceRole-bytes32-address-[`AccessControl.renounceRole`]]
  182. :xref-AccessManager-onlyAuthorized--: xref:access.adoc#AccessManager-onlyAuthorized--
  183. :xref-AccessManager-constructor-address-: xref:access.adoc#AccessManager-constructor-address-
  184. :xref-AccessManager-canCall-address-address-bytes4-: xref:access.adoc#AccessManager-canCall-address-address-bytes4-
  185. :xref-AccessManager-expiration--: xref:access.adoc#AccessManager-expiration--
  186. :xref-AccessManager-minSetback--: xref:access.adoc#AccessManager-minSetback--
  187. :xref-AccessManager-isTargetClosed-address-: xref:access.adoc#AccessManager-isTargetClosed-address-
  188. :xref-AccessManager-getTargetFunctionRole-address-bytes4-: xref:access.adoc#AccessManager-getTargetFunctionRole-address-bytes4-
  189. :xref-AccessManager-getTargetAdminDelay-address-: xref:access.adoc#AccessManager-getTargetAdminDelay-address-
  190. :xref-AccessManager-getRoleAdmin-uint64-: xref:access.adoc#AccessManager-getRoleAdmin-uint64-
  191. :xref-AccessManager-getRoleGuardian-uint64-: xref:access.adoc#AccessManager-getRoleGuardian-uint64-
  192. :xref-AccessManager-getRoleGrantDelay-uint64-: xref:access.adoc#AccessManager-getRoleGrantDelay-uint64-
  193. :xref-AccessManager-getAccess-uint64-address-: xref:access.adoc#AccessManager-getAccess-uint64-address-
  194. :xref-AccessManager-hasRole-uint64-address-: xref:access.adoc#AccessManager-hasRole-uint64-address-
  195. :xref-AccessManager-labelRole-uint64-string-: xref:access.adoc#AccessManager-labelRole-uint64-string-
  196. :xref-AccessManager-grantRole-uint64-address-uint32-: xref:access.adoc#AccessManager-grantRole-uint64-address-uint32-
  197. :xref-AccessManager-revokeRole-uint64-address-: xref:access.adoc#AccessManager-revokeRole-uint64-address-
  198. :xref-AccessManager-renounceRole-uint64-address-: xref:access.adoc#AccessManager-renounceRole-uint64-address-
  199. :xref-AccessManager-setRoleAdmin-uint64-uint64-: xref:access.adoc#AccessManager-setRoleAdmin-uint64-uint64-
  200. :xref-AccessManager-setRoleGuardian-uint64-uint64-: xref:access.adoc#AccessManager-setRoleGuardian-uint64-uint64-
  201. :xref-AccessManager-setGrantDelay-uint64-uint32-: xref:access.adoc#AccessManager-setGrantDelay-uint64-uint32-
  202. :xref-AccessManager-_grantRole-uint64-address-uint32-uint32-: xref:access.adoc#AccessManager-_grantRole-uint64-address-uint32-uint32-
  203. :xref-AccessManager-_revokeRole-uint64-address-: xref:access.adoc#AccessManager-_revokeRole-uint64-address-
  204. :xref-AccessManager-_setRoleAdmin-uint64-uint64-: xref:access.adoc#AccessManager-_setRoleAdmin-uint64-uint64-
  205. :xref-AccessManager-_setRoleGuardian-uint64-uint64-: xref:access.adoc#AccessManager-_setRoleGuardian-uint64-uint64-
  206. :xref-AccessManager-_setGrantDelay-uint64-uint32-: xref:access.adoc#AccessManager-_setGrantDelay-uint64-uint32-
  207. :xref-AccessManager-setTargetFunctionRole-address-bytes4---uint64-: xref:access.adoc#AccessManager-setTargetFunctionRole-address-bytes4---uint64-
  208. :xref-AccessManager-_setTargetFunctionRole-address-bytes4-uint64-: xref:access.adoc#AccessManager-_setTargetFunctionRole-address-bytes4-uint64-
  209. :xref-AccessManager-setTargetAdminDelay-address-uint32-: xref:access.adoc#AccessManager-setTargetAdminDelay-address-uint32-
  210. :xref-AccessManager-_setTargetAdminDelay-address-uint32-: xref:access.adoc#AccessManager-_setTargetAdminDelay-address-uint32-
  211. :xref-AccessManager-setTargetClosed-address-bool-: xref:access.adoc#AccessManager-setTargetClosed-address-bool-
  212. :xref-AccessManager-_setTargetClosed-address-bool-: xref:access.adoc#AccessManager-_setTargetClosed-address-bool-
  213. :xref-AccessManager-getSchedule-bytes32-: xref:access.adoc#AccessManager-getSchedule-bytes32-
  214. :xref-AccessManager-getNonce-bytes32-: xref:access.adoc#AccessManager-getNonce-bytes32-
  215. :xref-AccessManager-schedule-address-bytes-uint48-: xref:access.adoc#AccessManager-schedule-address-bytes-uint48-
  216. :xref-AccessManager-execute-address-bytes-: xref:access.adoc#AccessManager-execute-address-bytes-
  217. :xref-AccessManager-consumeScheduledOp-address-bytes-: xref:access.adoc#AccessManager-consumeScheduledOp-address-bytes-
  218. :xref-AccessManager-_consumeScheduledOp-bytes32-: xref:access.adoc#AccessManager-_consumeScheduledOp-bytes32-
  219. :xref-AccessManager-cancel-address-address-bytes-: xref:access.adoc#AccessManager-cancel-address-address-bytes-
  220. :xref-AccessManager-hashOperation-address-address-bytes-: xref:access.adoc#AccessManager-hashOperation-address-address-bytes-
  221. :xref-AccessManager-updateAuthority-address-address-: xref:access.adoc#AccessManager-updateAuthority-address-address-
  222. :xref-Multicall-multicall-bytes---: xref:utils.adoc#Multicall-multicall-bytes---
  223. :xref-IAccessManager-OperationScheduled-bytes32-uint32-uint48-address-address-bytes-: xref:access.adoc#IAccessManager-OperationScheduled-bytes32-uint32-uint48-address-address-bytes-
  224. :xref-IAccessManager-OperationExecuted-bytes32-uint32-: xref:access.adoc#IAccessManager-OperationExecuted-bytes32-uint32-
  225. :xref-IAccessManager-OperationCanceled-bytes32-uint32-: xref:access.adoc#IAccessManager-OperationCanceled-bytes32-uint32-
  226. :xref-IAccessManager-RoleLabel-uint64-string-: xref:access.adoc#IAccessManager-RoleLabel-uint64-string-
  227. :xref-IAccessManager-RoleGranted-uint64-address-uint32-uint48-bool-: xref:access.adoc#IAccessManager-RoleGranted-uint64-address-uint32-uint48-bool-
  228. :xref-IAccessManager-RoleRevoked-uint64-address-: xref:access.adoc#IAccessManager-RoleRevoked-uint64-address-
  229. :xref-IAccessManager-RoleAdminChanged-uint64-uint64-: xref:access.adoc#IAccessManager-RoleAdminChanged-uint64-uint64-
  230. :xref-IAccessManager-RoleGuardianChanged-uint64-uint64-: xref:access.adoc#IAccessManager-RoleGuardianChanged-uint64-uint64-
  231. :xref-IAccessManager-RoleGrantDelayChanged-uint64-uint32-uint48-: xref:access.adoc#IAccessManager-RoleGrantDelayChanged-uint64-uint32-uint48-
  232. :xref-IAccessManager-TargetClosed-address-bool-: xref:access.adoc#IAccessManager-TargetClosed-address-bool-
  233. :xref-IAccessManager-TargetFunctionRoleUpdated-address-bytes4-uint64-: xref:access.adoc#IAccessManager-TargetFunctionRoleUpdated-address-bytes4-uint64-
  234. :xref-IAccessManager-TargetAdminDelayUpdated-address-uint32-uint48-: xref:access.adoc#IAccessManager-TargetAdminDelayUpdated-address-uint32-uint48-
  235. :xref-IAccessManager-AccessManagerAlreadyScheduled-bytes32-: xref:access.adoc#IAccessManager-AccessManagerAlreadyScheduled-bytes32-
  236. :xref-IAccessManager-AccessManagerNotScheduled-bytes32-: xref:access.adoc#IAccessManager-AccessManagerNotScheduled-bytes32-
  237. :xref-IAccessManager-AccessManagerNotReady-bytes32-: xref:access.adoc#IAccessManager-AccessManagerNotReady-bytes32-
  238. :xref-IAccessManager-AccessManagerExpired-bytes32-: xref:access.adoc#IAccessManager-AccessManagerExpired-bytes32-
  239. :xref-IAccessManager-AccessManagerLockedAccount-address-: xref:access.adoc#IAccessManager-AccessManagerLockedAccount-address-
  240. :xref-IAccessManager-AccessManagerLockedRole-uint64-: xref:access.adoc#IAccessManager-AccessManagerLockedRole-uint64-
  241. :xref-IAccessManager-AccessManagerBadConfirmation--: xref:access.adoc#IAccessManager-AccessManagerBadConfirmation--
  242. :xref-IAccessManager-AccessManagerUnauthorizedAccount-address-uint64-: xref:access.adoc#IAccessManager-AccessManagerUnauthorizedAccount-address-uint64-
  243. :xref-IAccessManager-AccessManagerUnauthorizedCall-address-address-bytes4-: xref:access.adoc#IAccessManager-AccessManagerUnauthorizedCall-address-address-bytes4-
  244. :xref-IAccessManager-AccessManagerUnauthorizedConsume-address-: xref:access.adoc#IAccessManager-AccessManagerUnauthorizedConsume-address-
  245. :xref-IAccessManager-AccessManagerUnauthorizedCancel-address-address-address-bytes4-: xref:access.adoc#IAccessManager-AccessManagerUnauthorizedCancel-address-address-address-bytes4-
  246. :xref-IAccessManager-AccessManagerInvalidInitialAdmin-address-: xref:access.adoc#IAccessManager-AccessManagerInvalidInitialAdmin-address-
  247. :AccessManager: pass:normal[xref:access.adoc#AccessManager[`AccessManager`]]
  248. :IAuthority: pass:normal[xref:access.adoc#IAuthority[`IAuthority`]]
  249. :xref-AccessManaged-restricted--: xref:access.adoc#AccessManaged-restricted--
  250. :xref-AccessManaged-constructor-address-: xref:access.adoc#AccessManaged-constructor-address-
  251. :xref-AccessManaged-authority--: xref:access.adoc#AccessManaged-authority--
  252. :xref-AccessManaged-setAuthority-address-: xref:access.adoc#AccessManaged-setAuthority-address-
  253. :xref-AccessManaged-isConsumingScheduledOp--: xref:access.adoc#AccessManaged-isConsumingScheduledOp--
  254. :xref-AccessManaged-_setAuthority-address-: xref:access.adoc#AccessManaged-_setAuthority-address-
  255. :xref-AccessManaged-_checkCanCall-address-bytes-: xref:access.adoc#AccessManaged-_checkCanCall-address-bytes-
  256. :xref-IAccessManaged-AuthorityUpdated-address-: xref:access.adoc#IAccessManaged-AuthorityUpdated-address-
  257. :xref-IAccessManaged-AccessManagedUnauthorized-address-: xref:access.adoc#IAccessManaged-AccessManagedUnauthorized-address-
  258. :xref-IAccessManaged-AccessManagedRequiredDelay-address-uint32-: xref:access.adoc#IAccessManaged-AccessManagedRequiredDelay-address-uint32-
  259. :xref-IAccessManaged-AccessManagedInvalidAuthority-address-: xref:access.adoc#IAccessManaged-AccessManagedInvalidAuthority-address-
  260. = Access Control
  261. [.readme-notice]
  262. NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/access
  263. This directory provides ways to restrict who can access the functions of a contract or when they can do it.
  264. - {AccessControl} provides a general role based access control mechanism. Multiple hierarchical roles can be created and assigned each to multiple accounts.
  265. - {Ownable} is a simpler mechanism with a single owner "role" that can be assigned to a single account. This simpler mechanism can be useful for quick tests but projects with production concerns are likely to outgrow it.
  266. == Core
  267. :OwnableUnauthorizedAccount: pass:normal[xref:#Ownable-OwnableUnauthorizedAccount-address-[`++OwnableUnauthorizedAccount++`]]
  268. :OwnableInvalidOwner: pass:normal[xref:#Ownable-OwnableInvalidOwner-address-[`++OwnableInvalidOwner++`]]
  269. :OwnershipTransferred: pass:normal[xref:#Ownable-OwnershipTransferred-address-address-[`++OwnershipTransferred++`]]
  270. :constructor: pass:normal[xref:#Ownable-constructor-address-[`++constructor++`]]
  271. :onlyOwner: pass:normal[xref:#Ownable-onlyOwner--[`++onlyOwner++`]]
  272. :owner: pass:normal[xref:#Ownable-owner--[`++owner++`]]
  273. :_checkOwner: pass:normal[xref:#Ownable-_checkOwner--[`++_checkOwner++`]]
  274. :renounceOwnership: pass:normal[xref:#Ownable-renounceOwnership--[`++renounceOwnership++`]]
  275. :transferOwnership: pass:normal[xref:#Ownable-transferOwnership-address-[`++transferOwnership++`]]
  276. :_transferOwnership: pass:normal[xref:#Ownable-_transferOwnership-address-[`++_transferOwnership++`]]
  277. [.contract]
  278. [[Ownable]]
  279. === `++Ownable++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/Ownable.sol[{github-icon},role=heading-link]
  280. [.hljs-theme-light.nopadding]
  281. ```solidity
  282. import "@openzeppelin/contracts/access/Ownable.sol";
  283. ```
  284. Contract module which provides a basic access control mechanism, where
  285. there is an account (an owner) that can be granted exclusive access to
  286. specific functions.
  287. The initial owner is set to the address provided by the deployer. This can
  288. later be changed with {transferOwnership}.
  289. This module is used through inheritance. It will make available the modifier
  290. `onlyOwner`, which can be applied to your functions to restrict their use to
  291. the owner.
  292. [.contract-index]
  293. .Modifiers
  294. --
  295. * {xref-Ownable-onlyOwner--}[`++onlyOwner()++`]
  296. --
  297. [.contract-index]
  298. .Functions
  299. --
  300. * {xref-Ownable-constructor-address-}[`++constructor(initialOwner)++`]
  301. * {xref-Ownable-owner--}[`++owner()++`]
  302. * {xref-Ownable-_checkOwner--}[`++_checkOwner()++`]
  303. * {xref-Ownable-renounceOwnership--}[`++renounceOwnership()++`]
  304. * {xref-Ownable-transferOwnership-address-}[`++transferOwnership(newOwner)++`]
  305. * {xref-Ownable-_transferOwnership-address-}[`++_transferOwnership(newOwner)++`]
  306. --
  307. [.contract-index]
  308. .Events
  309. --
  310. * {xref-Ownable-OwnershipTransferred-address-address-}[`++OwnershipTransferred(previousOwner, newOwner)++`]
  311. --
  312. [.contract-index]
  313. .Errors
  314. --
  315. * {xref-Ownable-OwnableUnauthorizedAccount-address-}[`++OwnableUnauthorizedAccount(account)++`]
  316. * {xref-Ownable-OwnableInvalidOwner-address-}[`++OwnableInvalidOwner(owner)++`]
  317. --
  318. [.contract-item]
  319. [[Ownable-onlyOwner--]]
  320. ==== `[.contract-item-name]#++onlyOwner++#++()++` [.item-kind]#modifier#
  321. Throws if called by any account other than the owner.
  322. [.contract-item]
  323. [[Ownable-constructor-address-]]
  324. ==== `[.contract-item-name]#++constructor++#++(address initialOwner)++` [.item-kind]#internal#
  325. Initializes the contract setting the address provided by the deployer as the initial owner.
  326. [.contract-item]
  327. [[Ownable-owner--]]
  328. ==== `[.contract-item-name]#++owner++#++() → address++` [.item-kind]#public#
  329. Returns the address of the current owner.
  330. [.contract-item]
  331. [[Ownable-_checkOwner--]]
  332. ==== `[.contract-item-name]#++_checkOwner++#++()++` [.item-kind]#internal#
  333. Throws if the sender is not the owner.
  334. [.contract-item]
  335. [[Ownable-renounceOwnership--]]
  336. ==== `[.contract-item-name]#++renounceOwnership++#++()++` [.item-kind]#public#
  337. Leaves the contract without owner. It will not be possible to call
  338. `onlyOwner` functions. Can only be called by the current owner.
  339. NOTE: Renouncing ownership will leave the contract without an owner,
  340. thereby disabling any functionality that is only available to the owner.
  341. [.contract-item]
  342. [[Ownable-transferOwnership-address-]]
  343. ==== `[.contract-item-name]#++transferOwnership++#++(address newOwner)++` [.item-kind]#public#
  344. Transfers ownership of the contract to a new account (`newOwner`).
  345. Can only be called by the current owner.
  346. [.contract-item]
  347. [[Ownable-_transferOwnership-address-]]
  348. ==== `[.contract-item-name]#++_transferOwnership++#++(address newOwner)++` [.item-kind]#internal#
  349. Transfers ownership of the contract to a new account (`newOwner`).
  350. Internal function without access restriction.
  351. [.contract-item]
  352. [[Ownable-OwnershipTransferred-address-address-]]
  353. ==== `[.contract-item-name]#++OwnershipTransferred++#++(address indexed previousOwner, address indexed newOwner)++` [.item-kind]#event#
  354. [.contract-item]
  355. [[Ownable-OwnableUnauthorizedAccount-address-]]
  356. ==== `[.contract-item-name]#++OwnableUnauthorizedAccount++#++(address account)++` [.item-kind]#error#
  357. The caller account is not authorized to perform an operation.
  358. [.contract-item]
  359. [[Ownable-OwnableInvalidOwner-address-]]
  360. ==== `[.contract-item-name]#++OwnableInvalidOwner++#++(address owner)++` [.item-kind]#error#
  361. The owner is not a valid owner account. (eg. `address(0)`)
  362. :OwnershipTransferStarted: pass:normal[xref:#Ownable2Step-OwnershipTransferStarted-address-address-[`++OwnershipTransferStarted++`]]
  363. :pendingOwner: pass:normal[xref:#Ownable2Step-pendingOwner--[`++pendingOwner++`]]
  364. :transferOwnership: pass:normal[xref:#Ownable2Step-transferOwnership-address-[`++transferOwnership++`]]
  365. :_transferOwnership: pass:normal[xref:#Ownable2Step-_transferOwnership-address-[`++_transferOwnership++`]]
  366. :acceptOwnership: pass:normal[xref:#Ownable2Step-acceptOwnership--[`++acceptOwnership++`]]
  367. [.contract]
  368. [[Ownable2Step]]
  369. === `++Ownable2Step++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/Ownable2Step.sol[{github-icon},role=heading-link]
  370. [.hljs-theme-light.nopadding]
  371. ```solidity
  372. import "@openzeppelin/contracts/access/Ownable2Step.sol";
  373. ```
  374. Contract module which provides access control mechanism, where
  375. there is an account (an owner) that can be granted exclusive access to
  376. specific functions.
  377. The initial owner is specified at deployment time in the constructor for `Ownable`. This
  378. can later be changed with {transferOwnership} and {acceptOwnership}.
  379. This module is used through inheritance. It will make available all functions
  380. from parent (Ownable).
  381. [.contract-index]
  382. .Functions
  383. --
  384. * {xref-Ownable2Step-pendingOwner--}[`++pendingOwner()++`]
  385. * {xref-Ownable2Step-transferOwnership-address-}[`++transferOwnership(newOwner)++`]
  386. * {xref-Ownable2Step-_transferOwnership-address-}[`++_transferOwnership(newOwner)++`]
  387. * {xref-Ownable2Step-acceptOwnership--}[`++acceptOwnership()++`]
  388. [.contract-subindex-inherited]
  389. .Ownable
  390. * {xref-Ownable-owner--}[`++owner()++`]
  391. * {xref-Ownable-_checkOwner--}[`++_checkOwner()++`]
  392. * {xref-Ownable-renounceOwnership--}[`++renounceOwnership()++`]
  393. --
  394. [.contract-index]
  395. .Events
  396. --
  397. * {xref-Ownable2Step-OwnershipTransferStarted-address-address-}[`++OwnershipTransferStarted(previousOwner, newOwner)++`]
  398. [.contract-subindex-inherited]
  399. .Ownable
  400. * {xref-Ownable-OwnershipTransferred-address-address-}[`++OwnershipTransferred(previousOwner, newOwner)++`]
  401. --
  402. [.contract-index]
  403. .Errors
  404. --
  405. [.contract-subindex-inherited]
  406. .Ownable
  407. * {xref-Ownable-OwnableUnauthorizedAccount-address-}[`++OwnableUnauthorizedAccount(account)++`]
  408. * {xref-Ownable-OwnableInvalidOwner-address-}[`++OwnableInvalidOwner(owner)++`]
  409. --
  410. [.contract-item]
  411. [[Ownable2Step-pendingOwner--]]
  412. ==== `[.contract-item-name]#++pendingOwner++#++() → address++` [.item-kind]#public#
  413. Returns the address of the pending owner.
  414. [.contract-item]
  415. [[Ownable2Step-transferOwnership-address-]]
  416. ==== `[.contract-item-name]#++transferOwnership++#++(address newOwner)++` [.item-kind]#public#
  417. Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
  418. Can only be called by the current owner.
  419. [.contract-item]
  420. [[Ownable2Step-_transferOwnership-address-]]
  421. ==== `[.contract-item-name]#++_transferOwnership++#++(address newOwner)++` [.item-kind]#internal#
  422. Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
  423. Internal function without access restriction.
  424. [.contract-item]
  425. [[Ownable2Step-acceptOwnership--]]
  426. ==== `[.contract-item-name]#++acceptOwnership++#++()++` [.item-kind]#public#
  427. The new owner accepts the ownership transfer.
  428. [.contract-item]
  429. [[Ownable2Step-OwnershipTransferStarted-address-address-]]
  430. ==== `[.contract-item-name]#++OwnershipTransferStarted++#++(address indexed previousOwner, address indexed newOwner)++` [.item-kind]#event#
  431. :AccessControlUnauthorizedAccount: pass:normal[xref:#IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-[`++AccessControlUnauthorizedAccount++`]]
  432. :AccessControlBadConfirmation: pass:normal[xref:#IAccessControl-AccessControlBadConfirmation--[`++AccessControlBadConfirmation++`]]
  433. :RoleAdminChanged: pass:normal[xref:#IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-[`++RoleAdminChanged++`]]
  434. :RoleGranted: pass:normal[xref:#IAccessControl-RoleGranted-bytes32-address-address-[`++RoleGranted++`]]
  435. :RoleRevoked: pass:normal[xref:#IAccessControl-RoleRevoked-bytes32-address-address-[`++RoleRevoked++`]]
  436. :hasRole: pass:normal[xref:#IAccessControl-hasRole-bytes32-address-[`++hasRole++`]]
  437. :getRoleAdmin: pass:normal[xref:#IAccessControl-getRoleAdmin-bytes32-[`++getRoleAdmin++`]]
  438. :grantRole: pass:normal[xref:#IAccessControl-grantRole-bytes32-address-[`++grantRole++`]]
  439. :revokeRole: pass:normal[xref:#IAccessControl-revokeRole-bytes32-address-[`++revokeRole++`]]
  440. :renounceRole: pass:normal[xref:#IAccessControl-renounceRole-bytes32-address-[`++renounceRole++`]]
  441. [.contract]
  442. [[IAccessControl]]
  443. === `++IAccessControl++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/IAccessControl.sol[{github-icon},role=heading-link]
  444. [.hljs-theme-light.nopadding]
  445. ```solidity
  446. import "@openzeppelin/contracts/access/IAccessControl.sol";
  447. ```
  448. External interface of AccessControl declared to support ERC165 detection.
  449. [.contract-index]
  450. .Functions
  451. --
  452. * {xref-IAccessControl-hasRole-bytes32-address-}[`++hasRole(role, account)++`]
  453. * {xref-IAccessControl-getRoleAdmin-bytes32-}[`++getRoleAdmin(role)++`]
  454. * {xref-IAccessControl-grantRole-bytes32-address-}[`++grantRole(role, account)++`]
  455. * {xref-IAccessControl-revokeRole-bytes32-address-}[`++revokeRole(role, account)++`]
  456. * {xref-IAccessControl-renounceRole-bytes32-address-}[`++renounceRole(role, callerConfirmation)++`]
  457. --
  458. [.contract-index]
  459. .Events
  460. --
  461. * {xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-}[`++RoleAdminChanged(role, previousAdminRole, newAdminRole)++`]
  462. * {xref-IAccessControl-RoleGranted-bytes32-address-address-}[`++RoleGranted(role, account, sender)++`]
  463. * {xref-IAccessControl-RoleRevoked-bytes32-address-address-}[`++RoleRevoked(role, account, sender)++`]
  464. --
  465. [.contract-index]
  466. .Errors
  467. --
  468. * {xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-}[`++AccessControlUnauthorizedAccount(account, neededRole)++`]
  469. * {xref-IAccessControl-AccessControlBadConfirmation--}[`++AccessControlBadConfirmation()++`]
  470. --
  471. [.contract-item]
  472. [[IAccessControl-hasRole-bytes32-address-]]
  473. ==== `[.contract-item-name]#++hasRole++#++(bytes32 role, address account) → bool++` [.item-kind]#external#
  474. Returns `true` if `account` has been granted `role`.
  475. [.contract-item]
  476. [[IAccessControl-getRoleAdmin-bytes32-]]
  477. ==== `[.contract-item-name]#++getRoleAdmin++#++(bytes32 role) → bytes32++` [.item-kind]#external#
  478. Returns the admin role that controls `role`. See {grantRole} and
  479. {revokeRole}.
  480. To change a role's admin, use {AccessControl-_setRoleAdmin}.
  481. [.contract-item]
  482. [[IAccessControl-grantRole-bytes32-address-]]
  483. ==== `[.contract-item-name]#++grantRole++#++(bytes32 role, address account)++` [.item-kind]#external#
  484. Grants `role` to `account`.
  485. If `account` had not been already granted `role`, emits a {RoleGranted}
  486. event.
  487. Requirements:
  488. - the caller must have ``role``'s admin role.
  489. [.contract-item]
  490. [[IAccessControl-revokeRole-bytes32-address-]]
  491. ==== `[.contract-item-name]#++revokeRole++#++(bytes32 role, address account)++` [.item-kind]#external#
  492. Revokes `role` from `account`.
  493. If `account` had been granted `role`, emits a {RoleRevoked} event.
  494. Requirements:
  495. - the caller must have ``role``'s admin role.
  496. [.contract-item]
  497. [[IAccessControl-renounceRole-bytes32-address-]]
  498. ==== `[.contract-item-name]#++renounceRole++#++(bytes32 role, address callerConfirmation)++` [.item-kind]#external#
  499. Revokes `role` from the calling account.
  500. Roles are often managed via {grantRole} and {revokeRole}: this function's
  501. purpose is to provide a mechanism for accounts to lose their privileges
  502. if they are compromised (such as when a trusted device is misplaced).
  503. If the calling account had been granted `role`, emits a {RoleRevoked}
  504. event.
  505. Requirements:
  506. - the caller must be `callerConfirmation`.
  507. [.contract-item]
  508. [[IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-]]
  509. ==== `[.contract-item-name]#++RoleAdminChanged++#++(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)++` [.item-kind]#event#
  510. Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
  511. `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
  512. {RoleAdminChanged} not being emitted signaling this.
  513. [.contract-item]
  514. [[IAccessControl-RoleGranted-bytes32-address-address-]]
  515. ==== `[.contract-item-name]#++RoleGranted++#++(bytes32 indexed role, address indexed account, address indexed sender)++` [.item-kind]#event#
  516. Emitted when `account` is granted `role`.
  517. `sender` is the account that originated the contract call, an admin role
  518. bearer except when using {AccessControl-_setupRole}.
  519. [.contract-item]
  520. [[IAccessControl-RoleRevoked-bytes32-address-address-]]
  521. ==== `[.contract-item-name]#++RoleRevoked++#++(bytes32 indexed role, address indexed account, address indexed sender)++` [.item-kind]#event#
  522. Emitted when `account` is revoked `role`.
  523. `sender` is the account that originated the contract call:
  524. - if using `revokeRole`, it is the admin role bearer
  525. - if using `renounceRole`, it is the role bearer (i.e. `account`)
  526. [.contract-item]
  527. [[IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-]]
  528. ==== `[.contract-item-name]#++AccessControlUnauthorizedAccount++#++(address account, bytes32 neededRole)++` [.item-kind]#error#
  529. The `account` is missing a role.
  530. [.contract-item]
  531. [[IAccessControl-AccessControlBadConfirmation--]]
  532. ==== `[.contract-item-name]#++AccessControlBadConfirmation++#++()++` [.item-kind]#error#
  533. The caller of a function is not the expected one.
  534. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
  535. :RoleData: pass:normal[xref:#AccessControl-RoleData[`++RoleData++`]]
  536. :DEFAULT_ADMIN_ROLE: pass:normal[xref:#AccessControl-DEFAULT_ADMIN_ROLE-bytes32[`++DEFAULT_ADMIN_ROLE++`]]
  537. :onlyRole: pass:normal[xref:#AccessControl-onlyRole-bytes32-[`++onlyRole++`]]
  538. :supportsInterface: pass:normal[xref:#AccessControl-supportsInterface-bytes4-[`++supportsInterface++`]]
  539. :hasRole: pass:normal[xref:#AccessControl-hasRole-bytes32-address-[`++hasRole++`]]
  540. :_checkRole: pass:normal[xref:#AccessControl-_checkRole-bytes32-[`++_checkRole++`]]
  541. :_checkRole: pass:normal[xref:#AccessControl-_checkRole-bytes32-address-[`++_checkRole++`]]
  542. :getRoleAdmin: pass:normal[xref:#AccessControl-getRoleAdmin-bytes32-[`++getRoleAdmin++`]]
  543. :grantRole: pass:normal[xref:#AccessControl-grantRole-bytes32-address-[`++grantRole++`]]
  544. :revokeRole: pass:normal[xref:#AccessControl-revokeRole-bytes32-address-[`++revokeRole++`]]
  545. :renounceRole: pass:normal[xref:#AccessControl-renounceRole-bytes32-address-[`++renounceRole++`]]
  546. :_setRoleAdmin: pass:normal[xref:#AccessControl-_setRoleAdmin-bytes32-bytes32-[`++_setRoleAdmin++`]]
  547. :_grantRole: pass:normal[xref:#AccessControl-_grantRole-bytes32-address-[`++_grantRole++`]]
  548. :_revokeRole: pass:normal[xref:#AccessControl-_revokeRole-bytes32-address-[`++_revokeRole++`]]
  549. [.contract]
  550. [[AccessControl]]
  551. === `++AccessControl++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/AccessControl.sol[{github-icon},role=heading-link]
  552. [.hljs-theme-light.nopadding]
  553. ```solidity
  554. import "@openzeppelin/contracts/access/AccessControl.sol";
  555. ```
  556. Contract module that allows children to implement role-based access
  557. control mechanisms. This is a lightweight version that doesn't allow enumerating role
  558. members except through off-chain means by accessing the contract event logs. Some
  559. applications may benefit from on-chain enumerability, for those cases see
  560. {AccessControlEnumerable}.
  561. Roles are referred to by their `bytes32` identifier. These should be exposed
  562. in the external API and be unique. The best way to achieve this is by
  563. using `public constant` hash digests:
  564. ```solidity
  565. bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
  566. ```
  567. Roles can be used to represent a set of permissions. To restrict access to a
  568. function call, use {hasRole}:
  569. ```solidity
  570. function foo() public {
  571. require(hasRole(MY_ROLE, msg.sender));
  572. ...
  573. }
  574. ```
  575. Roles can be granted and revoked dynamically via the {grantRole} and
  576. {revokeRole} functions. Each role has an associated admin role, and only
  577. accounts that have a role's admin role can call {grantRole} and {revokeRole}.
  578. By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
  579. that only accounts with this role will be able to grant or revoke other
  580. roles. More complex role relationships can be created by using
  581. {_setRoleAdmin}.
  582. WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
  583. grant and revoke this role. Extra precautions should be taken to secure
  584. accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
  585. to enforce additional security measures for this role.
  586. [.contract-index]
  587. .Modifiers
  588. --
  589. * {xref-AccessControl-onlyRole-bytes32-}[`++onlyRole(role)++`]
  590. --
  591. [.contract-index]
  592. .Functions
  593. --
  594. * {xref-AccessControl-supportsInterface-bytes4-}[`++supportsInterface(interfaceId)++`]
  595. * {xref-AccessControl-hasRole-bytes32-address-}[`++hasRole(role, account)++`]
  596. * {xref-AccessControl-_checkRole-bytes32-}[`++_checkRole(role)++`]
  597. * {xref-AccessControl-_checkRole-bytes32-address-}[`++_checkRole(role, account)++`]
  598. * {xref-AccessControl-getRoleAdmin-bytes32-}[`++getRoleAdmin(role)++`]
  599. * {xref-AccessControl-grantRole-bytes32-address-}[`++grantRole(role, account)++`]
  600. * {xref-AccessControl-revokeRole-bytes32-address-}[`++revokeRole(role, account)++`]
  601. * {xref-AccessControl-renounceRole-bytes32-address-}[`++renounceRole(role, callerConfirmation)++`]
  602. * {xref-AccessControl-_setRoleAdmin-bytes32-bytes32-}[`++_setRoleAdmin(role, adminRole)++`]
  603. * {xref-AccessControl-_grantRole-bytes32-address-}[`++_grantRole(role, account)++`]
  604. * {xref-AccessControl-_revokeRole-bytes32-address-}[`++_revokeRole(role, account)++`]
  605. [.contract-subindex-inherited]
  606. .ERC165
  607. [.contract-subindex-inherited]
  608. .IERC165
  609. [.contract-subindex-inherited]
  610. .IAccessControl
  611. --
  612. [.contract-index]
  613. .Events
  614. --
  615. [.contract-subindex-inherited]
  616. .ERC165
  617. [.contract-subindex-inherited]
  618. .IERC165
  619. [.contract-subindex-inherited]
  620. .IAccessControl
  621. * {xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-}[`++RoleAdminChanged(role, previousAdminRole, newAdminRole)++`]
  622. * {xref-IAccessControl-RoleGranted-bytes32-address-address-}[`++RoleGranted(role, account, sender)++`]
  623. * {xref-IAccessControl-RoleRevoked-bytes32-address-address-}[`++RoleRevoked(role, account, sender)++`]
  624. --
  625. [.contract-index]
  626. .Errors
  627. --
  628. [.contract-subindex-inherited]
  629. .ERC165
  630. [.contract-subindex-inherited]
  631. .IERC165
  632. [.contract-subindex-inherited]
  633. .IAccessControl
  634. * {xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-}[`++AccessControlUnauthorizedAccount(account, neededRole)++`]
  635. * {xref-IAccessControl-AccessControlBadConfirmation--}[`++AccessControlBadConfirmation()++`]
  636. --
  637. [.contract-item]
  638. [[AccessControl-onlyRole-bytes32-]]
  639. ==== `[.contract-item-name]#++onlyRole++#++(bytes32 role)++` [.item-kind]#modifier#
  640. Modifier that checks that an account has a specific role. Reverts
  641. with an {AccessControlUnauthorizedAccount} error including the required role.
  642. [.contract-item]
  643. [[AccessControl-supportsInterface-bytes4-]]
  644. ==== `[.contract-item-name]#++supportsInterface++#++(bytes4 interfaceId) → bool++` [.item-kind]#public#
  645. See {IERC165-supportsInterface}.
  646. [.contract-item]
  647. [[AccessControl-hasRole-bytes32-address-]]
  648. ==== `[.contract-item-name]#++hasRole++#++(bytes32 role, address account) → bool++` [.item-kind]#public#
  649. Returns `true` if `account` has been granted `role`.
  650. [.contract-item]
  651. [[AccessControl-_checkRole-bytes32-]]
  652. ==== `[.contract-item-name]#++_checkRole++#++(bytes32 role)++` [.item-kind]#internal#
  653. Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
  654. is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
  655. [.contract-item]
  656. [[AccessControl-_checkRole-bytes32-address-]]
  657. ==== `[.contract-item-name]#++_checkRole++#++(bytes32 role, address account)++` [.item-kind]#internal#
  658. Reverts with an {AccessControlUnauthorizedAccount} error if `account`
  659. is missing `role`.
  660. [.contract-item]
  661. [[AccessControl-getRoleAdmin-bytes32-]]
  662. ==== `[.contract-item-name]#++getRoleAdmin++#++(bytes32 role) → bytes32++` [.item-kind]#public#
  663. Returns the admin role that controls `role`. See {grantRole} and
  664. {revokeRole}.
  665. To change a role's admin, use {_setRoleAdmin}.
  666. [.contract-item]
  667. [[AccessControl-grantRole-bytes32-address-]]
  668. ==== `[.contract-item-name]#++grantRole++#++(bytes32 role, address account)++` [.item-kind]#public#
  669. Grants `role` to `account`.
  670. If `account` had not been already granted `role`, emits a {RoleGranted}
  671. event.
  672. Requirements:
  673. - the caller must have ``role``'s admin role.
  674. May emit a {RoleGranted} event.
  675. [.contract-item]
  676. [[AccessControl-revokeRole-bytes32-address-]]
  677. ==== `[.contract-item-name]#++revokeRole++#++(bytes32 role, address account)++` [.item-kind]#public#
  678. Revokes `role` from `account`.
  679. If `account` had been granted `role`, emits a {RoleRevoked} event.
  680. Requirements:
  681. - the caller must have ``role``'s admin role.
  682. May emit a {RoleRevoked} event.
  683. [.contract-item]
  684. [[AccessControl-renounceRole-bytes32-address-]]
  685. ==== `[.contract-item-name]#++renounceRole++#++(bytes32 role, address callerConfirmation)++` [.item-kind]#public#
  686. Revokes `role` from the calling account.
  687. Roles are often managed via {grantRole} and {revokeRole}: this function's
  688. purpose is to provide a mechanism for accounts to lose their privileges
  689. if they are compromised (such as when a trusted device is misplaced).
  690. If the calling account had been revoked `role`, emits a {RoleRevoked}
  691. event.
  692. Requirements:
  693. - the caller must be `callerConfirmation`.
  694. May emit a {RoleRevoked} event.
  695. [.contract-item]
  696. [[AccessControl-_setRoleAdmin-bytes32-bytes32-]]
  697. ==== `[.contract-item-name]#++_setRoleAdmin++#++(bytes32 role, bytes32 adminRole)++` [.item-kind]#internal#
  698. Sets `adminRole` as ``role``'s admin role.
  699. Emits a {RoleAdminChanged} event.
  700. [.contract-item]
  701. [[AccessControl-_grantRole-bytes32-address-]]
  702. ==== `[.contract-item-name]#++_grantRole++#++(bytes32 role, address account) → bool++` [.item-kind]#internal#
  703. Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
  704. Internal function without access restriction.
  705. May emit a {RoleGranted} event.
  706. [.contract-item]
  707. [[AccessControl-_revokeRole-bytes32-address-]]
  708. ==== `[.contract-item-name]#++_revokeRole++#++(bytes32 role, address account) → bool++` [.item-kind]#internal#
  709. Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
  710. Internal function without access restriction.
  711. May emit a {RoleRevoked} event.
  712. == Extensions
  713. :getRoleMember: pass:normal[xref:#IAccessControlEnumerable-getRoleMember-bytes32-uint256-[`++getRoleMember++`]]
  714. :getRoleMemberCount: pass:normal[xref:#IAccessControlEnumerable-getRoleMemberCount-bytes32-[`++getRoleMemberCount++`]]
  715. [.contract]
  716. [[IAccessControlEnumerable]]
  717. === `++IAccessControlEnumerable++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/extensions/IAccessControlEnumerable.sol[{github-icon},role=heading-link]
  718. [.hljs-theme-light.nopadding]
  719. ```solidity
  720. import "@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol";
  721. ```
  722. External interface of AccessControlEnumerable declared to support ERC165 detection.
  723. [.contract-index]
  724. .Functions
  725. --
  726. * {xref-IAccessControlEnumerable-getRoleMember-bytes32-uint256-}[`++getRoleMember(role, index)++`]
  727. * {xref-IAccessControlEnumerable-getRoleMemberCount-bytes32-}[`++getRoleMemberCount(role)++`]
  728. [.contract-subindex-inherited]
  729. .IAccessControl
  730. * {xref-IAccessControl-hasRole-bytes32-address-}[`++hasRole(role, account)++`]
  731. * {xref-IAccessControl-getRoleAdmin-bytes32-}[`++getRoleAdmin(role)++`]
  732. * {xref-IAccessControl-grantRole-bytes32-address-}[`++grantRole(role, account)++`]
  733. * {xref-IAccessControl-revokeRole-bytes32-address-}[`++revokeRole(role, account)++`]
  734. * {xref-IAccessControl-renounceRole-bytes32-address-}[`++renounceRole(role, callerConfirmation)++`]
  735. --
  736. [.contract-index]
  737. .Events
  738. --
  739. [.contract-subindex-inherited]
  740. .IAccessControl
  741. * {xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-}[`++RoleAdminChanged(role, previousAdminRole, newAdminRole)++`]
  742. * {xref-IAccessControl-RoleGranted-bytes32-address-address-}[`++RoleGranted(role, account, sender)++`]
  743. * {xref-IAccessControl-RoleRevoked-bytes32-address-address-}[`++RoleRevoked(role, account, sender)++`]
  744. --
  745. [.contract-index]
  746. .Errors
  747. --
  748. [.contract-subindex-inherited]
  749. .IAccessControl
  750. * {xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-}[`++AccessControlUnauthorizedAccount(account, neededRole)++`]
  751. * {xref-IAccessControl-AccessControlBadConfirmation--}[`++AccessControlBadConfirmation()++`]
  752. --
  753. [.contract-item]
  754. [[IAccessControlEnumerable-getRoleMember-bytes32-uint256-]]
  755. ==== `[.contract-item-name]#++getRoleMember++#++(bytes32 role, uint256 index) → address++` [.item-kind]#external#
  756. Returns one of the accounts that have `role`. `index` must be a
  757. value between 0 and {getRoleMemberCount}, non-inclusive.
  758. Role bearers are not sorted in any particular way, and their ordering may
  759. change at any point.
  760. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
  761. you perform all queries on the same block. See the following
  762. https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
  763. for more information.
  764. [.contract-item]
  765. [[IAccessControlEnumerable-getRoleMemberCount-bytes32-]]
  766. ==== `[.contract-item-name]#++getRoleMemberCount++#++(bytes32 role) → uint256++` [.item-kind]#external#
  767. Returns the number of accounts that have `role`. Can be used
  768. together with {getRoleMember} to enumerate all bearers of a role.
  769. :supportsInterface: pass:normal[xref:#AccessControlEnumerable-supportsInterface-bytes4-[`++supportsInterface++`]]
  770. :getRoleMember: pass:normal[xref:#AccessControlEnumerable-getRoleMember-bytes32-uint256-[`++getRoleMember++`]]
  771. :getRoleMemberCount: pass:normal[xref:#AccessControlEnumerable-getRoleMemberCount-bytes32-[`++getRoleMemberCount++`]]
  772. :_grantRole: pass:normal[xref:#AccessControlEnumerable-_grantRole-bytes32-address-[`++_grantRole++`]]
  773. :_revokeRole: pass:normal[xref:#AccessControlEnumerable-_revokeRole-bytes32-address-[`++_revokeRole++`]]
  774. [.contract]
  775. [[AccessControlEnumerable]]
  776. === `++AccessControlEnumerable++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/extensions/AccessControlEnumerable.sol[{github-icon},role=heading-link]
  777. [.hljs-theme-light.nopadding]
  778. ```solidity
  779. import "@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol";
  780. ```
  781. Extension of {AccessControl} that allows enumerating the members of each role.
  782. [.contract-index]
  783. .Functions
  784. --
  785. * {xref-AccessControlEnumerable-supportsInterface-bytes4-}[`++supportsInterface(interfaceId)++`]
  786. * {xref-AccessControlEnumerable-getRoleMember-bytes32-uint256-}[`++getRoleMember(role, index)++`]
  787. * {xref-AccessControlEnumerable-getRoleMemberCount-bytes32-}[`++getRoleMemberCount(role)++`]
  788. * {xref-AccessControlEnumerable-_grantRole-bytes32-address-}[`++_grantRole(role, account)++`]
  789. * {xref-AccessControlEnumerable-_revokeRole-bytes32-address-}[`++_revokeRole(role, account)++`]
  790. [.contract-subindex-inherited]
  791. .AccessControl
  792. * {xref-AccessControl-hasRole-bytes32-address-}[`++hasRole(role, account)++`]
  793. * {xref-AccessControl-_checkRole-bytes32-}[`++_checkRole(role)++`]
  794. * {xref-AccessControl-_checkRole-bytes32-address-}[`++_checkRole(role, account)++`]
  795. * {xref-AccessControl-getRoleAdmin-bytes32-}[`++getRoleAdmin(role)++`]
  796. * {xref-AccessControl-grantRole-bytes32-address-}[`++grantRole(role, account)++`]
  797. * {xref-AccessControl-revokeRole-bytes32-address-}[`++revokeRole(role, account)++`]
  798. * {xref-AccessControl-renounceRole-bytes32-address-}[`++renounceRole(role, callerConfirmation)++`]
  799. * {xref-AccessControl-_setRoleAdmin-bytes32-bytes32-}[`++_setRoleAdmin(role, adminRole)++`]
  800. [.contract-subindex-inherited]
  801. .ERC165
  802. [.contract-subindex-inherited]
  803. .IERC165
  804. [.contract-subindex-inherited]
  805. .IAccessControlEnumerable
  806. [.contract-subindex-inherited]
  807. .IAccessControl
  808. --
  809. [.contract-index]
  810. .Events
  811. --
  812. [.contract-subindex-inherited]
  813. .AccessControl
  814. [.contract-subindex-inherited]
  815. .ERC165
  816. [.contract-subindex-inherited]
  817. .IERC165
  818. [.contract-subindex-inherited]
  819. .IAccessControlEnumerable
  820. [.contract-subindex-inherited]
  821. .IAccessControl
  822. * {xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-}[`++RoleAdminChanged(role, previousAdminRole, newAdminRole)++`]
  823. * {xref-IAccessControl-RoleGranted-bytes32-address-address-}[`++RoleGranted(role, account, sender)++`]
  824. * {xref-IAccessControl-RoleRevoked-bytes32-address-address-}[`++RoleRevoked(role, account, sender)++`]
  825. --
  826. [.contract-index]
  827. .Errors
  828. --
  829. [.contract-subindex-inherited]
  830. .AccessControl
  831. [.contract-subindex-inherited]
  832. .ERC165
  833. [.contract-subindex-inherited]
  834. .IERC165
  835. [.contract-subindex-inherited]
  836. .IAccessControlEnumerable
  837. [.contract-subindex-inherited]
  838. .IAccessControl
  839. * {xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-}[`++AccessControlUnauthorizedAccount(account, neededRole)++`]
  840. * {xref-IAccessControl-AccessControlBadConfirmation--}[`++AccessControlBadConfirmation()++`]
  841. --
  842. [.contract-item]
  843. [[AccessControlEnumerable-supportsInterface-bytes4-]]
  844. ==== `[.contract-item-name]#++supportsInterface++#++(bytes4 interfaceId) → bool++` [.item-kind]#public#
  845. See {IERC165-supportsInterface}.
  846. [.contract-item]
  847. [[AccessControlEnumerable-getRoleMember-bytes32-uint256-]]
  848. ==== `[.contract-item-name]#++getRoleMember++#++(bytes32 role, uint256 index) → address++` [.item-kind]#public#
  849. Returns one of the accounts that have `role`. `index` must be a
  850. value between 0 and {getRoleMemberCount}, non-inclusive.
  851. Role bearers are not sorted in any particular way, and their ordering may
  852. change at any point.
  853. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
  854. you perform all queries on the same block. See the following
  855. https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
  856. for more information.
  857. [.contract-item]
  858. [[AccessControlEnumerable-getRoleMemberCount-bytes32-]]
  859. ==== `[.contract-item-name]#++getRoleMemberCount++#++(bytes32 role) → uint256++` [.item-kind]#public#
  860. Returns the number of accounts that have `role`. Can be used
  861. together with {getRoleMember} to enumerate all bearers of a role.
  862. [.contract-item]
  863. [[AccessControlEnumerable-_grantRole-bytes32-address-]]
  864. ==== `[.contract-item-name]#++_grantRole++#++(bytes32 role, address account) → bool++` [.item-kind]#internal#
  865. Overload {AccessControl-_grantRole} to track enumerable memberships
  866. [.contract-item]
  867. [[AccessControlEnumerable-_revokeRole-bytes32-address-]]
  868. ==== `[.contract-item-name]#++_revokeRole++#++(bytes32 role, address account) → bool++` [.item-kind]#internal#
  869. Overload {AccessControl-_revokeRole} to track enumerable memberships
  870. :AccessControlInvalidDefaultAdmin: pass:normal[xref:#IAccessControlDefaultAdminRules-AccessControlInvalidDefaultAdmin-address-[`++AccessControlInvalidDefaultAdmin++`]]
  871. :AccessControlEnforcedDefaultAdminRules: pass:normal[xref:#IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminRules--[`++AccessControlEnforcedDefaultAdminRules++`]]
  872. :AccessControlEnforcedDefaultAdminDelay: pass:normal[xref:#IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminDelay-uint48-[`++AccessControlEnforcedDefaultAdminDelay++`]]
  873. :DefaultAdminTransferScheduled: pass:normal[xref:#IAccessControlDefaultAdminRules-DefaultAdminTransferScheduled-address-uint48-[`++DefaultAdminTransferScheduled++`]]
  874. :DefaultAdminTransferCanceled: pass:normal[xref:#IAccessControlDefaultAdminRules-DefaultAdminTransferCanceled--[`++DefaultAdminTransferCanceled++`]]
  875. :DefaultAdminDelayChangeScheduled: pass:normal[xref:#IAccessControlDefaultAdminRules-DefaultAdminDelayChangeScheduled-uint48-uint48-[`++DefaultAdminDelayChangeScheduled++`]]
  876. :DefaultAdminDelayChangeCanceled: pass:normal[xref:#IAccessControlDefaultAdminRules-DefaultAdminDelayChangeCanceled--[`++DefaultAdminDelayChangeCanceled++`]]
  877. :defaultAdmin: pass:normal[xref:#IAccessControlDefaultAdminRules-defaultAdmin--[`++defaultAdmin++`]]
  878. :pendingDefaultAdmin: pass:normal[xref:#IAccessControlDefaultAdminRules-pendingDefaultAdmin--[`++pendingDefaultAdmin++`]]
  879. :defaultAdminDelay: pass:normal[xref:#IAccessControlDefaultAdminRules-defaultAdminDelay--[`++defaultAdminDelay++`]]
  880. :pendingDefaultAdminDelay: pass:normal[xref:#IAccessControlDefaultAdminRules-pendingDefaultAdminDelay--[`++pendingDefaultAdminDelay++`]]
  881. :beginDefaultAdminTransfer: pass:normal[xref:#IAccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-[`++beginDefaultAdminTransfer++`]]
  882. :cancelDefaultAdminTransfer: pass:normal[xref:#IAccessControlDefaultAdminRules-cancelDefaultAdminTransfer--[`++cancelDefaultAdminTransfer++`]]
  883. :acceptDefaultAdminTransfer: pass:normal[xref:#IAccessControlDefaultAdminRules-acceptDefaultAdminTransfer--[`++acceptDefaultAdminTransfer++`]]
  884. :changeDefaultAdminDelay: pass:normal[xref:#IAccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-[`++changeDefaultAdminDelay++`]]
  885. :rollbackDefaultAdminDelay: pass:normal[xref:#IAccessControlDefaultAdminRules-rollbackDefaultAdminDelay--[`++rollbackDefaultAdminDelay++`]]
  886. :defaultAdminDelayIncreaseWait: pass:normal[xref:#IAccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--[`++defaultAdminDelayIncreaseWait++`]]
  887. [.contract]
  888. [[IAccessControlDefaultAdminRules]]
  889. === `++IAccessControlDefaultAdminRules++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/extensions/IAccessControlDefaultAdminRules.sol[{github-icon},role=heading-link]
  890. [.hljs-theme-light.nopadding]
  891. ```solidity
  892. import "@openzeppelin/contracts/access/extensions/IAccessControlDefaultAdminRules.sol";
  893. ```
  894. External interface of AccessControlDefaultAdminRules declared to support ERC165 detection.
  895. [.contract-index]
  896. .Functions
  897. --
  898. * {xref-IAccessControlDefaultAdminRules-defaultAdmin--}[`++defaultAdmin()++`]
  899. * {xref-IAccessControlDefaultAdminRules-pendingDefaultAdmin--}[`++pendingDefaultAdmin()++`]
  900. * {xref-IAccessControlDefaultAdminRules-defaultAdminDelay--}[`++defaultAdminDelay()++`]
  901. * {xref-IAccessControlDefaultAdminRules-pendingDefaultAdminDelay--}[`++pendingDefaultAdminDelay()++`]
  902. * {xref-IAccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-}[`++beginDefaultAdminTransfer(newAdmin)++`]
  903. * {xref-IAccessControlDefaultAdminRules-cancelDefaultAdminTransfer--}[`++cancelDefaultAdminTransfer()++`]
  904. * {xref-IAccessControlDefaultAdminRules-acceptDefaultAdminTransfer--}[`++acceptDefaultAdminTransfer()++`]
  905. * {xref-IAccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-}[`++changeDefaultAdminDelay(newDelay)++`]
  906. * {xref-IAccessControlDefaultAdminRules-rollbackDefaultAdminDelay--}[`++rollbackDefaultAdminDelay()++`]
  907. * {xref-IAccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--}[`++defaultAdminDelayIncreaseWait()++`]
  908. [.contract-subindex-inherited]
  909. .IAccessControl
  910. * {xref-IAccessControl-hasRole-bytes32-address-}[`++hasRole(role, account)++`]
  911. * {xref-IAccessControl-getRoleAdmin-bytes32-}[`++getRoleAdmin(role)++`]
  912. * {xref-IAccessControl-grantRole-bytes32-address-}[`++grantRole(role, account)++`]
  913. * {xref-IAccessControl-revokeRole-bytes32-address-}[`++revokeRole(role, account)++`]
  914. * {xref-IAccessControl-renounceRole-bytes32-address-}[`++renounceRole(role, callerConfirmation)++`]
  915. --
  916. [.contract-index]
  917. .Events
  918. --
  919. * {xref-IAccessControlDefaultAdminRules-DefaultAdminTransferScheduled-address-uint48-}[`++DefaultAdminTransferScheduled(newAdmin, acceptSchedule)++`]
  920. * {xref-IAccessControlDefaultAdminRules-DefaultAdminTransferCanceled--}[`++DefaultAdminTransferCanceled()++`]
  921. * {xref-IAccessControlDefaultAdminRules-DefaultAdminDelayChangeScheduled-uint48-uint48-}[`++DefaultAdminDelayChangeScheduled(newDelay, effectSchedule)++`]
  922. * {xref-IAccessControlDefaultAdminRules-DefaultAdminDelayChangeCanceled--}[`++DefaultAdminDelayChangeCanceled()++`]
  923. [.contract-subindex-inherited]
  924. .IAccessControl
  925. * {xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-}[`++RoleAdminChanged(role, previousAdminRole, newAdminRole)++`]
  926. * {xref-IAccessControl-RoleGranted-bytes32-address-address-}[`++RoleGranted(role, account, sender)++`]
  927. * {xref-IAccessControl-RoleRevoked-bytes32-address-address-}[`++RoleRevoked(role, account, sender)++`]
  928. --
  929. [.contract-index]
  930. .Errors
  931. --
  932. * {xref-IAccessControlDefaultAdminRules-AccessControlInvalidDefaultAdmin-address-}[`++AccessControlInvalidDefaultAdmin(defaultAdmin)++`]
  933. * {xref-IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminRules--}[`++AccessControlEnforcedDefaultAdminRules()++`]
  934. * {xref-IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminDelay-uint48-}[`++AccessControlEnforcedDefaultAdminDelay(schedule)++`]
  935. [.contract-subindex-inherited]
  936. .IAccessControl
  937. * {xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-}[`++AccessControlUnauthorizedAccount(account, neededRole)++`]
  938. * {xref-IAccessControl-AccessControlBadConfirmation--}[`++AccessControlBadConfirmation()++`]
  939. --
  940. [.contract-item]
  941. [[IAccessControlDefaultAdminRules-defaultAdmin--]]
  942. ==== `[.contract-item-name]#++defaultAdmin++#++() → address++` [.item-kind]#external#
  943. Returns the address of the current `DEFAULT_ADMIN_ROLE` holder.
  944. [.contract-item]
  945. [[IAccessControlDefaultAdminRules-pendingDefaultAdmin--]]
  946. ==== `[.contract-item-name]#++pendingDefaultAdmin++#++() → address newAdmin, uint48 acceptSchedule++` [.item-kind]#external#
  947. Returns a tuple of a `newAdmin` and an accept schedule.
  948. After the `schedule` passes, the `newAdmin` will be able to accept the {defaultAdmin} role
  949. by calling {acceptDefaultAdminTransfer}, completing the role transfer.
  950. A zero value only in `acceptSchedule` indicates no pending admin transfer.
  951. NOTE: A zero address `newAdmin` means that {defaultAdmin} is being renounced.
  952. [.contract-item]
  953. [[IAccessControlDefaultAdminRules-defaultAdminDelay--]]
  954. ==== `[.contract-item-name]#++defaultAdminDelay++#++() → uint48++` [.item-kind]#external#
  955. Returns the delay required to schedule the acceptance of a {defaultAdmin} transfer started.
  956. This delay will be added to the current timestamp when calling {beginDefaultAdminTransfer} to set
  957. the acceptance schedule.
  958. NOTE: If a delay change has been scheduled, it will take effect as soon as the schedule passes, making this
  959. function returns the new delay. See {changeDefaultAdminDelay}.
  960. [.contract-item]
  961. [[IAccessControlDefaultAdminRules-pendingDefaultAdminDelay--]]
  962. ==== `[.contract-item-name]#++pendingDefaultAdminDelay++#++() → uint48 newDelay, uint48 effectSchedule++` [.item-kind]#external#
  963. Returns a tuple of `newDelay` and an effect schedule.
  964. After the `schedule` passes, the `newDelay` will get into effect immediately for every
  965. new {defaultAdmin} transfer started with {beginDefaultAdminTransfer}.
  966. A zero value only in `effectSchedule` indicates no pending delay change.
  967. NOTE: A zero value only for `newDelay` means that the next {defaultAdminDelay}
  968. will be zero after the effect schedule.
  969. [.contract-item]
  970. [[IAccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-]]
  971. ==== `[.contract-item-name]#++beginDefaultAdminTransfer++#++(address newAdmin)++` [.item-kind]#external#
  972. Starts a {defaultAdmin} transfer by setting a {pendingDefaultAdmin} scheduled for acceptance
  973. after the current timestamp plus a {defaultAdminDelay}.
  974. Requirements:
  975. - Only can be called by the current {defaultAdmin}.
  976. Emits a DefaultAdminRoleChangeStarted event.
  977. [.contract-item]
  978. [[IAccessControlDefaultAdminRules-cancelDefaultAdminTransfer--]]
  979. ==== `[.contract-item-name]#++cancelDefaultAdminTransfer++#++()++` [.item-kind]#external#
  980. Cancels a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}.
  981. A {pendingDefaultAdmin} not yet accepted can also be cancelled with this function.
  982. Requirements:
  983. - Only can be called by the current {defaultAdmin}.
  984. May emit a DefaultAdminTransferCanceled event.
  985. [.contract-item]
  986. [[IAccessControlDefaultAdminRules-acceptDefaultAdminTransfer--]]
  987. ==== `[.contract-item-name]#++acceptDefaultAdminTransfer++#++()++` [.item-kind]#external#
  988. Completes a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}.
  989. After calling the function:
  990. - `DEFAULT_ADMIN_ROLE` should be granted to the caller.
  991. - `DEFAULT_ADMIN_ROLE` should be revoked from the previous holder.
  992. - {pendingDefaultAdmin} should be reset to zero values.
  993. Requirements:
  994. - Only can be called by the {pendingDefaultAdmin}'s `newAdmin`.
  995. - The {pendingDefaultAdmin}'s `acceptSchedule` should've passed.
  996. [.contract-item]
  997. [[IAccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-]]
  998. ==== `[.contract-item-name]#++changeDefaultAdminDelay++#++(uint48 newDelay)++` [.item-kind]#external#
  999. Initiates a {defaultAdminDelay} update by setting a {pendingDefaultAdminDelay} scheduled for getting
  1000. into effect after the current timestamp plus a {defaultAdminDelay}.
  1001. This function guarantees that any call to {beginDefaultAdminTransfer} done between the timestamp this
  1002. method is called and the {pendingDefaultAdminDelay} effect schedule will use the current {defaultAdminDelay}
  1003. set before calling.
  1004. The {pendingDefaultAdminDelay}'s effect schedule is defined in a way that waiting until the schedule and then
  1005. calling {beginDefaultAdminTransfer} with the new delay will take at least the same as another {defaultAdmin}
  1006. complete transfer (including acceptance).
  1007. The schedule is designed for two scenarios:
  1008. - When the delay is changed for a larger one the schedule is `block.timestamp + newDelay` capped by
  1009. {defaultAdminDelayIncreaseWait}.
  1010. - When the delay is changed for a shorter one, the schedule is `block.timestamp + (current delay - new delay)`.
  1011. A {pendingDefaultAdminDelay} that never got into effect will be canceled in favor of a new scheduled change.
  1012. Requirements:
  1013. - Only can be called by the current {defaultAdmin}.
  1014. Emits a DefaultAdminDelayChangeScheduled event and may emit a DefaultAdminDelayChangeCanceled event.
  1015. [.contract-item]
  1016. [[IAccessControlDefaultAdminRules-rollbackDefaultAdminDelay--]]
  1017. ==== `[.contract-item-name]#++rollbackDefaultAdminDelay++#++()++` [.item-kind]#external#
  1018. Cancels a scheduled {defaultAdminDelay} change.
  1019. Requirements:
  1020. - Only can be called by the current {defaultAdmin}.
  1021. May emit a DefaultAdminDelayChangeCanceled event.
  1022. [.contract-item]
  1023. [[IAccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--]]
  1024. ==== `[.contract-item-name]#++defaultAdminDelayIncreaseWait++#++() → uint48++` [.item-kind]#external#
  1025. Maximum time in seconds for an increase to {defaultAdminDelay} (that is scheduled using {changeDefaultAdminDelay})
  1026. to take effect. Default to 5 days.
  1027. When the {defaultAdminDelay} is scheduled to be increased, it goes into effect after the new delay has passed with
  1028. the purpose of giving enough time for reverting any accidental change (i.e. using milliseconds instead of seconds)
  1029. that may lock the contract. However, to avoid excessive schedules, the wait is capped by this function and it can
  1030. be overrode for a custom {defaultAdminDelay} increase scheduling.
  1031. IMPORTANT: Make sure to add a reasonable amount of time while overriding this value, otherwise,
  1032. there's a risk of setting a high new delay that goes into effect almost immediately without the
  1033. possibility of human intervention in the case of an input error (eg. set milliseconds instead of seconds).
  1034. [.contract-item]
  1035. [[IAccessControlDefaultAdminRules-DefaultAdminTransferScheduled-address-uint48-]]
  1036. ==== `[.contract-item-name]#++DefaultAdminTransferScheduled++#++(address indexed newAdmin, uint48 acceptSchedule)++` [.item-kind]#event#
  1037. Emitted when a {defaultAdmin} transfer is started, setting `newAdmin` as the next
  1038. address to become the {defaultAdmin} by calling {acceptDefaultAdminTransfer} only after `acceptSchedule`
  1039. passes.
  1040. [.contract-item]
  1041. [[IAccessControlDefaultAdminRules-DefaultAdminTransferCanceled--]]
  1042. ==== `[.contract-item-name]#++DefaultAdminTransferCanceled++#++()++` [.item-kind]#event#
  1043. Emitted when a {pendingDefaultAdmin} is reset if it was never accepted, regardless of its schedule.
  1044. [.contract-item]
  1045. [[IAccessControlDefaultAdminRules-DefaultAdminDelayChangeScheduled-uint48-uint48-]]
  1046. ==== `[.contract-item-name]#++DefaultAdminDelayChangeScheduled++#++(uint48 newDelay, uint48 effectSchedule)++` [.item-kind]#event#
  1047. Emitted when a {defaultAdminDelay} change is started, setting `newDelay` as the next
  1048. delay to be applied between default admin transfer after `effectSchedule` has passed.
  1049. [.contract-item]
  1050. [[IAccessControlDefaultAdminRules-DefaultAdminDelayChangeCanceled--]]
  1051. ==== `[.contract-item-name]#++DefaultAdminDelayChangeCanceled++#++()++` [.item-kind]#event#
  1052. Emitted when a {pendingDefaultAdminDelay} is reset if its schedule didn't pass.
  1053. [.contract-item]
  1054. [[IAccessControlDefaultAdminRules-AccessControlInvalidDefaultAdmin-address-]]
  1055. ==== `[.contract-item-name]#++AccessControlInvalidDefaultAdmin++#++(address defaultAdmin)++` [.item-kind]#error#
  1056. The new default admin is not a valid default admin.
  1057. [.contract-item]
  1058. [[IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminRules--]]
  1059. ==== `[.contract-item-name]#++AccessControlEnforcedDefaultAdminRules++#++()++` [.item-kind]#error#
  1060. At least one of the following rules was violated:
  1061. - The `DEFAULT_ADMIN_ROLE` must only be managed by itself.
  1062. - The `DEFAULT_ADMIN_ROLE` must only be held by one account at the time.
  1063. - Any `DEFAULT_ADMIN_ROLE` transfer must be in two delayed steps.
  1064. [.contract-item]
  1065. [[IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminDelay-uint48-]]
  1066. ==== `[.contract-item-name]#++AccessControlEnforcedDefaultAdminDelay++#++(uint48 schedule)++` [.item-kind]#error#
  1067. The delay for transferring the default admin delay is enforced and
  1068. the operation must wait until `schedule`.
  1069. NOTE: `schedule` can be 0 indicating there's no transfer scheduled.
  1070. :constructor: pass:normal[xref:#AccessControlDefaultAdminRules-constructor-uint48-address-[`++constructor++`]]
  1071. :supportsInterface: pass:normal[xref:#AccessControlDefaultAdminRules-supportsInterface-bytes4-[`++supportsInterface++`]]
  1072. :owner: pass:normal[xref:#AccessControlDefaultAdminRules-owner--[`++owner++`]]
  1073. :grantRole: pass:normal[xref:#AccessControlDefaultAdminRules-grantRole-bytes32-address-[`++grantRole++`]]
  1074. :revokeRole: pass:normal[xref:#AccessControlDefaultAdminRules-revokeRole-bytes32-address-[`++revokeRole++`]]
  1075. :renounceRole: pass:normal[xref:#AccessControlDefaultAdminRules-renounceRole-bytes32-address-[`++renounceRole++`]]
  1076. :_grantRole: pass:normal[xref:#AccessControlDefaultAdminRules-_grantRole-bytes32-address-[`++_grantRole++`]]
  1077. :_revokeRole: pass:normal[xref:#AccessControlDefaultAdminRules-_revokeRole-bytes32-address-[`++_revokeRole++`]]
  1078. :_setRoleAdmin: pass:normal[xref:#AccessControlDefaultAdminRules-_setRoleAdmin-bytes32-bytes32-[`++_setRoleAdmin++`]]
  1079. :defaultAdmin: pass:normal[xref:#AccessControlDefaultAdminRules-defaultAdmin--[`++defaultAdmin++`]]
  1080. :pendingDefaultAdmin: pass:normal[xref:#AccessControlDefaultAdminRules-pendingDefaultAdmin--[`++pendingDefaultAdmin++`]]
  1081. :defaultAdminDelay: pass:normal[xref:#AccessControlDefaultAdminRules-defaultAdminDelay--[`++defaultAdminDelay++`]]
  1082. :pendingDefaultAdminDelay: pass:normal[xref:#AccessControlDefaultAdminRules-pendingDefaultAdminDelay--[`++pendingDefaultAdminDelay++`]]
  1083. :defaultAdminDelayIncreaseWait: pass:normal[xref:#AccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--[`++defaultAdminDelayIncreaseWait++`]]
  1084. :beginDefaultAdminTransfer: pass:normal[xref:#AccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-[`++beginDefaultAdminTransfer++`]]
  1085. :_beginDefaultAdminTransfer: pass:normal[xref:#AccessControlDefaultAdminRules-_beginDefaultAdminTransfer-address-[`++_beginDefaultAdminTransfer++`]]
  1086. :cancelDefaultAdminTransfer: pass:normal[xref:#AccessControlDefaultAdminRules-cancelDefaultAdminTransfer--[`++cancelDefaultAdminTransfer++`]]
  1087. :_cancelDefaultAdminTransfer: pass:normal[xref:#AccessControlDefaultAdminRules-_cancelDefaultAdminTransfer--[`++_cancelDefaultAdminTransfer++`]]
  1088. :acceptDefaultAdminTransfer: pass:normal[xref:#AccessControlDefaultAdminRules-acceptDefaultAdminTransfer--[`++acceptDefaultAdminTransfer++`]]
  1089. :_acceptDefaultAdminTransfer: pass:normal[xref:#AccessControlDefaultAdminRules-_acceptDefaultAdminTransfer--[`++_acceptDefaultAdminTransfer++`]]
  1090. :changeDefaultAdminDelay: pass:normal[xref:#AccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-[`++changeDefaultAdminDelay++`]]
  1091. :_changeDefaultAdminDelay: pass:normal[xref:#AccessControlDefaultAdminRules-_changeDefaultAdminDelay-uint48-[`++_changeDefaultAdminDelay++`]]
  1092. :rollbackDefaultAdminDelay: pass:normal[xref:#AccessControlDefaultAdminRules-rollbackDefaultAdminDelay--[`++rollbackDefaultAdminDelay++`]]
  1093. :_rollbackDefaultAdminDelay: pass:normal[xref:#AccessControlDefaultAdminRules-_rollbackDefaultAdminDelay--[`++_rollbackDefaultAdminDelay++`]]
  1094. :_delayChangeWait: pass:normal[xref:#AccessControlDefaultAdminRules-_delayChangeWait-uint48-[`++_delayChangeWait++`]]
  1095. [.contract]
  1096. [[AccessControlDefaultAdminRules]]
  1097. === `++AccessControlDefaultAdminRules++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/extensions/AccessControlDefaultAdminRules.sol[{github-icon},role=heading-link]
  1098. [.hljs-theme-light.nopadding]
  1099. ```solidity
  1100. import "@openzeppelin/contracts/access/extensions/AccessControlDefaultAdminRules.sol";
  1101. ```
  1102. Extension of {AccessControl} that allows specifying special rules to manage
  1103. the `DEFAULT_ADMIN_ROLE` holder, which is a sensitive role with special permissions
  1104. over other roles that may potentially have privileged rights in the system.
  1105. If a specific role doesn't have an admin role assigned, the holder of the
  1106. `DEFAULT_ADMIN_ROLE` will have the ability to grant it and revoke it.
  1107. This contract implements the following risk mitigations on top of {AccessControl}:
  1108. * Only one account holds the `DEFAULT_ADMIN_ROLE` since deployment until it's potentially renounced.
  1109. * Enforces a 2-step process to transfer the `DEFAULT_ADMIN_ROLE` to another account.
  1110. * Enforces a configurable delay between the two steps, with the ability to cancel before the transfer is accepted.
  1111. * The delay can be changed by scheduling, see {changeDefaultAdminDelay}.
  1112. * It is not possible to use another role to manage the `DEFAULT_ADMIN_ROLE`.
  1113. Example usage:
  1114. ```solidity
  1115. contract MyToken is AccessControlDefaultAdminRules {
  1116. constructor() AccessControlDefaultAdminRules(
  1117. 3 days,
  1118. msg.sender // Explicit initial `DEFAULT_ADMIN_ROLE` holder
  1119. ) {}
  1120. }
  1121. ```
  1122. [.contract-index]
  1123. .Functions
  1124. --
  1125. * {xref-AccessControlDefaultAdminRules-constructor-uint48-address-}[`++constructor(initialDelay, initialDefaultAdmin)++`]
  1126. * {xref-AccessControlDefaultAdminRules-supportsInterface-bytes4-}[`++supportsInterface(interfaceId)++`]
  1127. * {xref-AccessControlDefaultAdminRules-owner--}[`++owner()++`]
  1128. * {xref-AccessControlDefaultAdminRules-grantRole-bytes32-address-}[`++grantRole(role, account)++`]
  1129. * {xref-AccessControlDefaultAdminRules-revokeRole-bytes32-address-}[`++revokeRole(role, account)++`]
  1130. * {xref-AccessControlDefaultAdminRules-renounceRole-bytes32-address-}[`++renounceRole(role, account)++`]
  1131. * {xref-AccessControlDefaultAdminRules-_grantRole-bytes32-address-}[`++_grantRole(role, account)++`]
  1132. * {xref-AccessControlDefaultAdminRules-_revokeRole-bytes32-address-}[`++_revokeRole(role, account)++`]
  1133. * {xref-AccessControlDefaultAdminRules-_setRoleAdmin-bytes32-bytes32-}[`++_setRoleAdmin(role, adminRole)++`]
  1134. * {xref-AccessControlDefaultAdminRules-defaultAdmin--}[`++defaultAdmin()++`]
  1135. * {xref-AccessControlDefaultAdminRules-pendingDefaultAdmin--}[`++pendingDefaultAdmin()++`]
  1136. * {xref-AccessControlDefaultAdminRules-defaultAdminDelay--}[`++defaultAdminDelay()++`]
  1137. * {xref-AccessControlDefaultAdminRules-pendingDefaultAdminDelay--}[`++pendingDefaultAdminDelay()++`]
  1138. * {xref-AccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--}[`++defaultAdminDelayIncreaseWait()++`]
  1139. * {xref-AccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-}[`++beginDefaultAdminTransfer(newAdmin)++`]
  1140. * {xref-AccessControlDefaultAdminRules-_beginDefaultAdminTransfer-address-}[`++_beginDefaultAdminTransfer(newAdmin)++`]
  1141. * {xref-AccessControlDefaultAdminRules-cancelDefaultAdminTransfer--}[`++cancelDefaultAdminTransfer()++`]
  1142. * {xref-AccessControlDefaultAdminRules-_cancelDefaultAdminTransfer--}[`++_cancelDefaultAdminTransfer()++`]
  1143. * {xref-AccessControlDefaultAdminRules-acceptDefaultAdminTransfer--}[`++acceptDefaultAdminTransfer()++`]
  1144. * {xref-AccessControlDefaultAdminRules-_acceptDefaultAdminTransfer--}[`++_acceptDefaultAdminTransfer()++`]
  1145. * {xref-AccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-}[`++changeDefaultAdminDelay(newDelay)++`]
  1146. * {xref-AccessControlDefaultAdminRules-_changeDefaultAdminDelay-uint48-}[`++_changeDefaultAdminDelay(newDelay)++`]
  1147. * {xref-AccessControlDefaultAdminRules-rollbackDefaultAdminDelay--}[`++rollbackDefaultAdminDelay()++`]
  1148. * {xref-AccessControlDefaultAdminRules-_rollbackDefaultAdminDelay--}[`++_rollbackDefaultAdminDelay()++`]
  1149. * {xref-AccessControlDefaultAdminRules-_delayChangeWait-uint48-}[`++_delayChangeWait(newDelay)++`]
  1150. [.contract-subindex-inherited]
  1151. .AccessControl
  1152. * {xref-AccessControl-hasRole-bytes32-address-}[`++hasRole(role, account)++`]
  1153. * {xref-AccessControl-_checkRole-bytes32-}[`++_checkRole(role)++`]
  1154. * {xref-AccessControl-_checkRole-bytes32-address-}[`++_checkRole(role, account)++`]
  1155. * {xref-AccessControl-getRoleAdmin-bytes32-}[`++getRoleAdmin(role)++`]
  1156. [.contract-subindex-inherited]
  1157. .ERC165
  1158. [.contract-subindex-inherited]
  1159. .IERC165
  1160. [.contract-subindex-inherited]
  1161. .IERC5313
  1162. [.contract-subindex-inherited]
  1163. .IAccessControlDefaultAdminRules
  1164. [.contract-subindex-inherited]
  1165. .IAccessControl
  1166. --
  1167. [.contract-index]
  1168. .Events
  1169. --
  1170. [.contract-subindex-inherited]
  1171. .AccessControl
  1172. [.contract-subindex-inherited]
  1173. .ERC165
  1174. [.contract-subindex-inherited]
  1175. .IERC165
  1176. [.contract-subindex-inherited]
  1177. .IERC5313
  1178. [.contract-subindex-inherited]
  1179. .IAccessControlDefaultAdminRules
  1180. * {xref-IAccessControlDefaultAdminRules-DefaultAdminTransferScheduled-address-uint48-}[`++DefaultAdminTransferScheduled(newAdmin, acceptSchedule)++`]
  1181. * {xref-IAccessControlDefaultAdminRules-DefaultAdminTransferCanceled--}[`++DefaultAdminTransferCanceled()++`]
  1182. * {xref-IAccessControlDefaultAdminRules-DefaultAdminDelayChangeScheduled-uint48-uint48-}[`++DefaultAdminDelayChangeScheduled(newDelay, effectSchedule)++`]
  1183. * {xref-IAccessControlDefaultAdminRules-DefaultAdminDelayChangeCanceled--}[`++DefaultAdminDelayChangeCanceled()++`]
  1184. [.contract-subindex-inherited]
  1185. .IAccessControl
  1186. * {xref-IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-}[`++RoleAdminChanged(role, previousAdminRole, newAdminRole)++`]
  1187. * {xref-IAccessControl-RoleGranted-bytes32-address-address-}[`++RoleGranted(role, account, sender)++`]
  1188. * {xref-IAccessControl-RoleRevoked-bytes32-address-address-}[`++RoleRevoked(role, account, sender)++`]
  1189. --
  1190. [.contract-index]
  1191. .Errors
  1192. --
  1193. [.contract-subindex-inherited]
  1194. .AccessControl
  1195. [.contract-subindex-inherited]
  1196. .ERC165
  1197. [.contract-subindex-inherited]
  1198. .IERC165
  1199. [.contract-subindex-inherited]
  1200. .IERC5313
  1201. [.contract-subindex-inherited]
  1202. .IAccessControlDefaultAdminRules
  1203. * {xref-IAccessControlDefaultAdminRules-AccessControlInvalidDefaultAdmin-address-}[`++AccessControlInvalidDefaultAdmin(defaultAdmin)++`]
  1204. * {xref-IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminRules--}[`++AccessControlEnforcedDefaultAdminRules()++`]
  1205. * {xref-IAccessControlDefaultAdminRules-AccessControlEnforcedDefaultAdminDelay-uint48-}[`++AccessControlEnforcedDefaultAdminDelay(schedule)++`]
  1206. [.contract-subindex-inherited]
  1207. .IAccessControl
  1208. * {xref-IAccessControl-AccessControlUnauthorizedAccount-address-bytes32-}[`++AccessControlUnauthorizedAccount(account, neededRole)++`]
  1209. * {xref-IAccessControl-AccessControlBadConfirmation--}[`++AccessControlBadConfirmation()++`]
  1210. --
  1211. [.contract-item]
  1212. [[AccessControlDefaultAdminRules-constructor-uint48-address-]]
  1213. ==== `[.contract-item-name]#++constructor++#++(uint48 initialDelay, address initialDefaultAdmin)++` [.item-kind]#internal#
  1214. Sets the initial values for {defaultAdminDelay} and {defaultAdmin} address.
  1215. [.contract-item]
  1216. [[AccessControlDefaultAdminRules-supportsInterface-bytes4-]]
  1217. ==== `[.contract-item-name]#++supportsInterface++#++(bytes4 interfaceId) → bool++` [.item-kind]#public#
  1218. See {IERC165-supportsInterface}.
  1219. [.contract-item]
  1220. [[AccessControlDefaultAdminRules-owner--]]
  1221. ==== `[.contract-item-name]#++owner++#++() → address++` [.item-kind]#public#
  1222. See {IERC5313-owner}.
  1223. [.contract-item]
  1224. [[AccessControlDefaultAdminRules-grantRole-bytes32-address-]]
  1225. ==== `[.contract-item-name]#++grantRole++#++(bytes32 role, address account)++` [.item-kind]#public#
  1226. See {AccessControl-grantRole}. Reverts for `DEFAULT_ADMIN_ROLE`.
  1227. [.contract-item]
  1228. [[AccessControlDefaultAdminRules-revokeRole-bytes32-address-]]
  1229. ==== `[.contract-item-name]#++revokeRole++#++(bytes32 role, address account)++` [.item-kind]#public#
  1230. See {AccessControl-revokeRole}. Reverts for `DEFAULT_ADMIN_ROLE`.
  1231. [.contract-item]
  1232. [[AccessControlDefaultAdminRules-renounceRole-bytes32-address-]]
  1233. ==== `[.contract-item-name]#++renounceRole++#++(bytes32 role, address account)++` [.item-kind]#public#
  1234. See {AccessControl-renounceRole}.
  1235. For the `DEFAULT_ADMIN_ROLE`, it only allows renouncing in two steps by first calling
  1236. {beginDefaultAdminTransfer} to the `address(0)`, so it's required that the {pendingDefaultAdmin} schedule
  1237. has also passed when calling this function.
  1238. After its execution, it will not be possible to call `onlyRole(DEFAULT_ADMIN_ROLE)` functions.
  1239. NOTE: Renouncing `DEFAULT_ADMIN_ROLE` will leave the contract without a {defaultAdmin},
  1240. thereby disabling any functionality that is only available for it, and the possibility of reassigning a
  1241. non-administrated role.
  1242. [.contract-item]
  1243. [[AccessControlDefaultAdminRules-_grantRole-bytes32-address-]]
  1244. ==== `[.contract-item-name]#++_grantRole++#++(bytes32 role, address account) → bool++` [.item-kind]#internal#
  1245. See {AccessControl-_grantRole}.
  1246. For `DEFAULT_ADMIN_ROLE`, it only allows granting if there isn't already a {defaultAdmin} or if the
  1247. role has been previously renounced.
  1248. NOTE: Exposing this function through another mechanism may make the `DEFAULT_ADMIN_ROLE`
  1249. assignable again. Make sure to guarantee this is the expected behavior in your implementation.
  1250. [.contract-item]
  1251. [[AccessControlDefaultAdminRules-_revokeRole-bytes32-address-]]
  1252. ==== `[.contract-item-name]#++_revokeRole++#++(bytes32 role, address account) → bool++` [.item-kind]#internal#
  1253. See {AccessControl-_revokeRole}.
  1254. [.contract-item]
  1255. [[AccessControlDefaultAdminRules-_setRoleAdmin-bytes32-bytes32-]]
  1256. ==== `[.contract-item-name]#++_setRoleAdmin++#++(bytes32 role, bytes32 adminRole)++` [.item-kind]#internal#
  1257. See {AccessControl-_setRoleAdmin}. Reverts for `DEFAULT_ADMIN_ROLE`.
  1258. [.contract-item]
  1259. [[AccessControlDefaultAdminRules-defaultAdmin--]]
  1260. ==== `[.contract-item-name]#++defaultAdmin++#++() → address++` [.item-kind]#public#
  1261. Returns the address of the current `DEFAULT_ADMIN_ROLE` holder.
  1262. [.contract-item]
  1263. [[AccessControlDefaultAdminRules-pendingDefaultAdmin--]]
  1264. ==== `[.contract-item-name]#++pendingDefaultAdmin++#++() → address newAdmin, uint48 schedule++` [.item-kind]#public#
  1265. Returns a tuple of a `newAdmin` and an accept schedule.
  1266. After the `schedule` passes, the `newAdmin` will be able to accept the {defaultAdmin} role
  1267. by calling {acceptDefaultAdminTransfer}, completing the role transfer.
  1268. A zero value only in `acceptSchedule` indicates no pending admin transfer.
  1269. NOTE: A zero address `newAdmin` means that {defaultAdmin} is being renounced.
  1270. [.contract-item]
  1271. [[AccessControlDefaultAdminRules-defaultAdminDelay--]]
  1272. ==== `[.contract-item-name]#++defaultAdminDelay++#++() → uint48++` [.item-kind]#public#
  1273. Returns the delay required to schedule the acceptance of a {defaultAdmin} transfer started.
  1274. This delay will be added to the current timestamp when calling {beginDefaultAdminTransfer} to set
  1275. the acceptance schedule.
  1276. NOTE: If a delay change has been scheduled, it will take effect as soon as the schedule passes, making this
  1277. function returns the new delay. See {changeDefaultAdminDelay}.
  1278. [.contract-item]
  1279. [[AccessControlDefaultAdminRules-pendingDefaultAdminDelay--]]
  1280. ==== `[.contract-item-name]#++pendingDefaultAdminDelay++#++() → uint48 newDelay, uint48 schedule++` [.item-kind]#public#
  1281. Returns a tuple of `newDelay` and an effect schedule.
  1282. After the `schedule` passes, the `newDelay` will get into effect immediately for every
  1283. new {defaultAdmin} transfer started with {beginDefaultAdminTransfer}.
  1284. A zero value only in `effectSchedule` indicates no pending delay change.
  1285. NOTE: A zero value only for `newDelay` means that the next {defaultAdminDelay}
  1286. will be zero after the effect schedule.
  1287. [.contract-item]
  1288. [[AccessControlDefaultAdminRules-defaultAdminDelayIncreaseWait--]]
  1289. ==== `[.contract-item-name]#++defaultAdminDelayIncreaseWait++#++() → uint48++` [.item-kind]#public#
  1290. Maximum time in seconds for an increase to {defaultAdminDelay} (that is scheduled using {changeDefaultAdminDelay})
  1291. to take effect. Default to 5 days.
  1292. When the {defaultAdminDelay} is scheduled to be increased, it goes into effect after the new delay has passed with
  1293. the purpose of giving enough time for reverting any accidental change (i.e. using milliseconds instead of seconds)
  1294. that may lock the contract. However, to avoid excessive schedules, the wait is capped by this function and it can
  1295. be overrode for a custom {defaultAdminDelay} increase scheduling.
  1296. IMPORTANT: Make sure to add a reasonable amount of time while overriding this value, otherwise,
  1297. there's a risk of setting a high new delay that goes into effect almost immediately without the
  1298. possibility of human intervention in the case of an input error (eg. set milliseconds instead of seconds).
  1299. [.contract-item]
  1300. [[AccessControlDefaultAdminRules-beginDefaultAdminTransfer-address-]]
  1301. ==== `[.contract-item-name]#++beginDefaultAdminTransfer++#++(address newAdmin)++` [.item-kind]#public#
  1302. Starts a {defaultAdmin} transfer by setting a {pendingDefaultAdmin} scheduled for acceptance
  1303. after the current timestamp plus a {defaultAdminDelay}.
  1304. Requirements:
  1305. - Only can be called by the current {defaultAdmin}.
  1306. Emits a DefaultAdminRoleChangeStarted event.
  1307. [.contract-item]
  1308. [[AccessControlDefaultAdminRules-_beginDefaultAdminTransfer-address-]]
  1309. ==== `[.contract-item-name]#++_beginDefaultAdminTransfer++#++(address newAdmin)++` [.item-kind]#internal#
  1310. See {beginDefaultAdminTransfer}.
  1311. Internal function without access restriction.
  1312. [.contract-item]
  1313. [[AccessControlDefaultAdminRules-cancelDefaultAdminTransfer--]]
  1314. ==== `[.contract-item-name]#++cancelDefaultAdminTransfer++#++()++` [.item-kind]#public#
  1315. Cancels a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}.
  1316. A {pendingDefaultAdmin} not yet accepted can also be cancelled with this function.
  1317. Requirements:
  1318. - Only can be called by the current {defaultAdmin}.
  1319. May emit a DefaultAdminTransferCanceled event.
  1320. [.contract-item]
  1321. [[AccessControlDefaultAdminRules-_cancelDefaultAdminTransfer--]]
  1322. ==== `[.contract-item-name]#++_cancelDefaultAdminTransfer++#++()++` [.item-kind]#internal#
  1323. See {cancelDefaultAdminTransfer}.
  1324. Internal function without access restriction.
  1325. [.contract-item]
  1326. [[AccessControlDefaultAdminRules-acceptDefaultAdminTransfer--]]
  1327. ==== `[.contract-item-name]#++acceptDefaultAdminTransfer++#++()++` [.item-kind]#public#
  1328. Completes a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}.
  1329. After calling the function:
  1330. - `DEFAULT_ADMIN_ROLE` should be granted to the caller.
  1331. - `DEFAULT_ADMIN_ROLE` should be revoked from the previous holder.
  1332. - {pendingDefaultAdmin} should be reset to zero values.
  1333. Requirements:
  1334. - Only can be called by the {pendingDefaultAdmin}'s `newAdmin`.
  1335. - The {pendingDefaultAdmin}'s `acceptSchedule` should've passed.
  1336. [.contract-item]
  1337. [[AccessControlDefaultAdminRules-_acceptDefaultAdminTransfer--]]
  1338. ==== `[.contract-item-name]#++_acceptDefaultAdminTransfer++#++()++` [.item-kind]#internal#
  1339. See {acceptDefaultAdminTransfer}.
  1340. Internal function without access restriction.
  1341. [.contract-item]
  1342. [[AccessControlDefaultAdminRules-changeDefaultAdminDelay-uint48-]]
  1343. ==== `[.contract-item-name]#++changeDefaultAdminDelay++#++(uint48 newDelay)++` [.item-kind]#public#
  1344. Initiates a {defaultAdminDelay} update by setting a {pendingDefaultAdminDelay} scheduled for getting
  1345. into effect after the current timestamp plus a {defaultAdminDelay}.
  1346. This function guarantees that any call to {beginDefaultAdminTransfer} done between the timestamp this
  1347. method is called and the {pendingDefaultAdminDelay} effect schedule will use the current {defaultAdminDelay}
  1348. set before calling.
  1349. The {pendingDefaultAdminDelay}'s effect schedule is defined in a way that waiting until the schedule and then
  1350. calling {beginDefaultAdminTransfer} with the new delay will take at least the same as another {defaultAdmin}
  1351. complete transfer (including acceptance).
  1352. The schedule is designed for two scenarios:
  1353. - When the delay is changed for a larger one the schedule is `block.timestamp + newDelay` capped by
  1354. {defaultAdminDelayIncreaseWait}.
  1355. - When the delay is changed for a shorter one, the schedule is `block.timestamp + (current delay - new delay)`.
  1356. A {pendingDefaultAdminDelay} that never got into effect will be canceled in favor of a new scheduled change.
  1357. Requirements:
  1358. - Only can be called by the current {defaultAdmin}.
  1359. Emits a DefaultAdminDelayChangeScheduled event and may emit a DefaultAdminDelayChangeCanceled event.
  1360. [.contract-item]
  1361. [[AccessControlDefaultAdminRules-_changeDefaultAdminDelay-uint48-]]
  1362. ==== `[.contract-item-name]#++_changeDefaultAdminDelay++#++(uint48 newDelay)++` [.item-kind]#internal#
  1363. See {changeDefaultAdminDelay}.
  1364. Internal function without access restriction.
  1365. [.contract-item]
  1366. [[AccessControlDefaultAdminRules-rollbackDefaultAdminDelay--]]
  1367. ==== `[.contract-item-name]#++rollbackDefaultAdminDelay++#++()++` [.item-kind]#public#
  1368. Cancels a scheduled {defaultAdminDelay} change.
  1369. Requirements:
  1370. - Only can be called by the current {defaultAdmin}.
  1371. May emit a DefaultAdminDelayChangeCanceled event.
  1372. [.contract-item]
  1373. [[AccessControlDefaultAdminRules-_rollbackDefaultAdminDelay--]]
  1374. ==== `[.contract-item-name]#++_rollbackDefaultAdminDelay++#++()++` [.item-kind]#internal#
  1375. See {rollbackDefaultAdminDelay}.
  1376. Internal function without access restriction.
  1377. [.contract-item]
  1378. [[AccessControlDefaultAdminRules-_delayChangeWait-uint48-]]
  1379. ==== `[.contract-item-name]#++_delayChangeWait++#++(uint48 newDelay) → uint48++` [.item-kind]#internal#
  1380. Returns the amount of seconds to wait after the `newDelay` will
  1381. become the new {defaultAdminDelay}.
  1382. The value returned guarantees that if the delay is reduced, it will go into effect
  1383. after a wait that honors the previously set delay.
  1384. See {defaultAdminDelayIncreaseWait}.
  1385. == AccessManager
  1386. :canCall: pass:normal[xref:#IAuthority-canCall-address-address-bytes4-[`++canCall++`]]
  1387. [.contract]
  1388. [[IAuthority]]
  1389. === `++IAuthority++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/manager/IAuthority.sol[{github-icon},role=heading-link]
  1390. [.hljs-theme-light.nopadding]
  1391. ```solidity
  1392. import "@openzeppelin/contracts/access/manager/IAuthority.sol";
  1393. ```
  1394. Standard interface for permissioning originally defined in Dappsys.
  1395. [.contract-index]
  1396. .Functions
  1397. --
  1398. * {xref-IAuthority-canCall-address-address-bytes4-}[`++canCall(caller, target, selector)++`]
  1399. --
  1400. [.contract-item]
  1401. [[IAuthority-canCall-address-address-bytes4-]]
  1402. ==== `[.contract-item-name]#++canCall++#++(address caller, address target, bytes4 selector) → bool allowed++` [.item-kind]#external#
  1403. Returns true if the caller can invoke on a target the function identified by a function selector.
  1404. :TargetConfig: pass:normal[xref:#AccessManager-TargetConfig[`++TargetConfig++`]]
  1405. :Access: pass:normal[xref:#AccessManager-Access[`++Access++`]]
  1406. :Role: pass:normal[xref:#AccessManager-Role[`++Role++`]]
  1407. :Schedule: pass:normal[xref:#AccessManager-Schedule[`++Schedule++`]]
  1408. :ADMIN_ROLE: pass:normal[xref:#AccessManager-ADMIN_ROLE-uint64[`++ADMIN_ROLE++`]]
  1409. :PUBLIC_ROLE: pass:normal[xref:#AccessManager-PUBLIC_ROLE-uint64[`++PUBLIC_ROLE++`]]
  1410. :onlyAuthorized: pass:normal[xref:#AccessManager-onlyAuthorized--[`++onlyAuthorized++`]]
  1411. :constructor: pass:normal[xref:#AccessManager-constructor-address-[`++constructor++`]]
  1412. :canCall: pass:normal[xref:#AccessManager-canCall-address-address-bytes4-[`++canCall++`]]
  1413. :expiration: pass:normal[xref:#AccessManager-expiration--[`++expiration++`]]
  1414. :minSetback: pass:normal[xref:#AccessManager-minSetback--[`++minSetback++`]]
  1415. :isTargetClosed: pass:normal[xref:#AccessManager-isTargetClosed-address-[`++isTargetClosed++`]]
  1416. :getTargetFunctionRole: pass:normal[xref:#AccessManager-getTargetFunctionRole-address-bytes4-[`++getTargetFunctionRole++`]]
  1417. :getTargetAdminDelay: pass:normal[xref:#AccessManager-getTargetAdminDelay-address-[`++getTargetAdminDelay++`]]
  1418. :getRoleAdmin: pass:normal[xref:#AccessManager-getRoleAdmin-uint64-[`++getRoleAdmin++`]]
  1419. :getRoleGuardian: pass:normal[xref:#AccessManager-getRoleGuardian-uint64-[`++getRoleGuardian++`]]
  1420. :getRoleGrantDelay: pass:normal[xref:#AccessManager-getRoleGrantDelay-uint64-[`++getRoleGrantDelay++`]]
  1421. :getAccess: pass:normal[xref:#AccessManager-getAccess-uint64-address-[`++getAccess++`]]
  1422. :hasRole: pass:normal[xref:#AccessManager-hasRole-uint64-address-[`++hasRole++`]]
  1423. :labelRole: pass:normal[xref:#AccessManager-labelRole-uint64-string-[`++labelRole++`]]
  1424. :grantRole: pass:normal[xref:#AccessManager-grantRole-uint64-address-uint32-[`++grantRole++`]]
  1425. :revokeRole: pass:normal[xref:#AccessManager-revokeRole-uint64-address-[`++revokeRole++`]]
  1426. :renounceRole: pass:normal[xref:#AccessManager-renounceRole-uint64-address-[`++renounceRole++`]]
  1427. :setRoleAdmin: pass:normal[xref:#AccessManager-setRoleAdmin-uint64-uint64-[`++setRoleAdmin++`]]
  1428. :setRoleGuardian: pass:normal[xref:#AccessManager-setRoleGuardian-uint64-uint64-[`++setRoleGuardian++`]]
  1429. :setGrantDelay: pass:normal[xref:#AccessManager-setGrantDelay-uint64-uint32-[`++setGrantDelay++`]]
  1430. :_grantRole: pass:normal[xref:#AccessManager-_grantRole-uint64-address-uint32-uint32-[`++_grantRole++`]]
  1431. :_revokeRole: pass:normal[xref:#AccessManager-_revokeRole-uint64-address-[`++_revokeRole++`]]
  1432. :_setRoleAdmin: pass:normal[xref:#AccessManager-_setRoleAdmin-uint64-uint64-[`++_setRoleAdmin++`]]
  1433. :_setRoleGuardian: pass:normal[xref:#AccessManager-_setRoleGuardian-uint64-uint64-[`++_setRoleGuardian++`]]
  1434. :_setGrantDelay: pass:normal[xref:#AccessManager-_setGrantDelay-uint64-uint32-[`++_setGrantDelay++`]]
  1435. :setTargetFunctionRole: pass:normal[xref:#AccessManager-setTargetFunctionRole-address-bytes4---uint64-[`++setTargetFunctionRole++`]]
  1436. :_setTargetFunctionRole: pass:normal[xref:#AccessManager-_setTargetFunctionRole-address-bytes4-uint64-[`++_setTargetFunctionRole++`]]
  1437. :setTargetAdminDelay: pass:normal[xref:#AccessManager-setTargetAdminDelay-address-uint32-[`++setTargetAdminDelay++`]]
  1438. :_setTargetAdminDelay: pass:normal[xref:#AccessManager-_setTargetAdminDelay-address-uint32-[`++_setTargetAdminDelay++`]]
  1439. :setTargetClosed: pass:normal[xref:#AccessManager-setTargetClosed-address-bool-[`++setTargetClosed++`]]
  1440. :_setTargetClosed: pass:normal[xref:#AccessManager-_setTargetClosed-address-bool-[`++_setTargetClosed++`]]
  1441. :getSchedule: pass:normal[xref:#AccessManager-getSchedule-bytes32-[`++getSchedule++`]]
  1442. :getNonce: pass:normal[xref:#AccessManager-getNonce-bytes32-[`++getNonce++`]]
  1443. :schedule: pass:normal[xref:#AccessManager-schedule-address-bytes-uint48-[`++schedule++`]]
  1444. :execute: pass:normal[xref:#AccessManager-execute-address-bytes-[`++execute++`]]
  1445. :consumeScheduledOp: pass:normal[xref:#AccessManager-consumeScheduledOp-address-bytes-[`++consumeScheduledOp++`]]
  1446. :_consumeScheduledOp: pass:normal[xref:#AccessManager-_consumeScheduledOp-bytes32-[`++_consumeScheduledOp++`]]
  1447. :cancel: pass:normal[xref:#AccessManager-cancel-address-address-bytes-[`++cancel++`]]
  1448. :hashOperation: pass:normal[xref:#AccessManager-hashOperation-address-address-bytes-[`++hashOperation++`]]
  1449. :updateAuthority: pass:normal[xref:#AccessManager-updateAuthority-address-address-[`++updateAuthority++`]]
  1450. [.contract]
  1451. [[AccessManager]]
  1452. === `++AccessManager++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/manager/AccessManager.sol[{github-icon},role=heading-link]
  1453. [.hljs-theme-light.nopadding]
  1454. ```solidity
  1455. import "@openzeppelin/contracts/access/manager/AccessManager.sol";
  1456. ```
  1457. AccessManager is a central contract to store the permissions of a system.
  1458. The smart contracts under the control of an AccessManager instance will have a set of "restricted" functions, and the
  1459. exact details of how access is restricted for each of those functions is configurable by the admins of the instance.
  1460. These restrictions are expressed in terms of "roles".
  1461. An AccessManager instance will define a set of roles. Accounts can be added into any number of these roles. Each of
  1462. them defines a role, and may confer access to some of the restricted functions in the system, as configured by admins
  1463. through the use of {setFunctionAllowedRoles}.
  1464. Note that a function in a target contract may become permissioned in this way only when: 1) said contract is
  1465. {AccessManaged} and is connected to this contract as its manager, and 2) said function is decorated with the
  1466. `restricted` modifier.
  1467. There is a special role defined by default named "public" which all accounts automatically have.
  1468. In addition to the access rules defined by each target's functions being assigned to roles, then entire target can
  1469. be "closed". This "closed" mode is set/unset by the admin using {setTargetClosed} and can be used to lock a contract
  1470. while permissions are being (re-)configured.
  1471. Since all the permissions of the managed system can be modified by the admins of this instance, it is expected that
  1472. they will be highly secured (e.g., a multisig or a well-configured DAO).
  1473. NOTE: This contract implements a form of the {IAuthority} interface, but {canCall} has additional return data so it
  1474. doesn't inherit `IAuthority`. It is however compatible with the `IAuthority` interface since the first 32 bytes of
  1475. the return data are a boolean as expected by that interface.
  1476. NOTE: Systems that implement other access control mechanisms (for example using {Ownable}) can be paired with an
  1477. {AccessManager} by transferring permissions (ownership in the case of {Ownable}) directly to the {AccessManager}.
  1478. Users will be able to interact with these contracts through the {execute} function, following the access rules
  1479. registered in the {AccessManager}. Keep in mind that in that context, the msg.sender seen by restricted functions
  1480. will be {AccessManager} itself.
  1481. WARNING: When granting permissions over an {Ownable} or {AccessControl} contract to an {AccessManager}, be very
  1482. mindful of the danger associated with functions such as {{Ownable-renounceOwnership}} or
  1483. {{AccessControl-renounceRole}}.
  1484. [.contract-index]
  1485. .Modifiers
  1486. --
  1487. * {xref-AccessManager-onlyAuthorized--}[`++onlyAuthorized()++`]
  1488. --
  1489. [.contract-index]
  1490. .Functions
  1491. --
  1492. * {xref-AccessManager-constructor-address-}[`++constructor(initialAdmin)++`]
  1493. * {xref-AccessManager-canCall-address-address-bytes4-}[`++canCall(caller, target, selector)++`]
  1494. * {xref-AccessManager-expiration--}[`++expiration()++`]
  1495. * {xref-AccessManager-minSetback--}[`++minSetback()++`]
  1496. * {xref-AccessManager-isTargetClosed-address-}[`++isTargetClosed(target)++`]
  1497. * {xref-AccessManager-getTargetFunctionRole-address-bytes4-}[`++getTargetFunctionRole(target, selector)++`]
  1498. * {xref-AccessManager-getTargetAdminDelay-address-}[`++getTargetAdminDelay(target)++`]
  1499. * {xref-AccessManager-getRoleAdmin-uint64-}[`++getRoleAdmin(roleId)++`]
  1500. * {xref-AccessManager-getRoleGuardian-uint64-}[`++getRoleGuardian(roleId)++`]
  1501. * {xref-AccessManager-getRoleGrantDelay-uint64-}[`++getRoleGrantDelay(roleId)++`]
  1502. * {xref-AccessManager-getAccess-uint64-address-}[`++getAccess(roleId, account)++`]
  1503. * {xref-AccessManager-hasRole-uint64-address-}[`++hasRole(roleId, account)++`]
  1504. * {xref-AccessManager-labelRole-uint64-string-}[`++labelRole(roleId, label)++`]
  1505. * {xref-AccessManager-grantRole-uint64-address-uint32-}[`++grantRole(roleId, account, executionDelay)++`]
  1506. * {xref-AccessManager-revokeRole-uint64-address-}[`++revokeRole(roleId, account)++`]
  1507. * {xref-AccessManager-renounceRole-uint64-address-}[`++renounceRole(roleId, callerConfirmation)++`]
  1508. * {xref-AccessManager-setRoleAdmin-uint64-uint64-}[`++setRoleAdmin(roleId, admin)++`]
  1509. * {xref-AccessManager-setRoleGuardian-uint64-uint64-}[`++setRoleGuardian(roleId, guardian)++`]
  1510. * {xref-AccessManager-setGrantDelay-uint64-uint32-}[`++setGrantDelay(roleId, newDelay)++`]
  1511. * {xref-AccessManager-_grantRole-uint64-address-uint32-uint32-}[`++_grantRole(roleId, account, grantDelay, executionDelay)++`]
  1512. * {xref-AccessManager-_revokeRole-uint64-address-}[`++_revokeRole(roleId, account)++`]
  1513. * {xref-AccessManager-_setRoleAdmin-uint64-uint64-}[`++_setRoleAdmin(roleId, admin)++`]
  1514. * {xref-AccessManager-_setRoleGuardian-uint64-uint64-}[`++_setRoleGuardian(roleId, guardian)++`]
  1515. * {xref-AccessManager-_setGrantDelay-uint64-uint32-}[`++_setGrantDelay(roleId, newDelay)++`]
  1516. * {xref-AccessManager-setTargetFunctionRole-address-bytes4---uint64-}[`++setTargetFunctionRole(target, selectors, roleId)++`]
  1517. * {xref-AccessManager-_setTargetFunctionRole-address-bytes4-uint64-}[`++_setTargetFunctionRole(target, selector, roleId)++`]
  1518. * {xref-AccessManager-setTargetAdminDelay-address-uint32-}[`++setTargetAdminDelay(target, newDelay)++`]
  1519. * {xref-AccessManager-_setTargetAdminDelay-address-uint32-}[`++_setTargetAdminDelay(target, newDelay)++`]
  1520. * {xref-AccessManager-setTargetClosed-address-bool-}[`++setTargetClosed(target, closed)++`]
  1521. * {xref-AccessManager-_setTargetClosed-address-bool-}[`++_setTargetClosed(target, closed)++`]
  1522. * {xref-AccessManager-getSchedule-bytes32-}[`++getSchedule(id)++`]
  1523. * {xref-AccessManager-getNonce-bytes32-}[`++getNonce(id)++`]
  1524. * {xref-AccessManager-schedule-address-bytes-uint48-}[`++schedule(target, data, when)++`]
  1525. * {xref-AccessManager-execute-address-bytes-}[`++execute(target, data)++`]
  1526. * {xref-AccessManager-consumeScheduledOp-address-bytes-}[`++consumeScheduledOp(caller, data)++`]
  1527. * {xref-AccessManager-_consumeScheduledOp-bytes32-}[`++_consumeScheduledOp(operationId)++`]
  1528. * {xref-AccessManager-cancel-address-address-bytes-}[`++cancel(caller, target, data)++`]
  1529. * {xref-AccessManager-hashOperation-address-address-bytes-}[`++hashOperation(caller, target, data)++`]
  1530. * {xref-AccessManager-updateAuthority-address-address-}[`++updateAuthority(target, newAuthority)++`]
  1531. [.contract-subindex-inherited]
  1532. .IAccessManager
  1533. [.contract-subindex-inherited]
  1534. .Multicall
  1535. * {xref-Multicall-multicall-bytes---}[`++multicall(data)++`]
  1536. --
  1537. [.contract-index]
  1538. .Events
  1539. --
  1540. [.contract-subindex-inherited]
  1541. .IAccessManager
  1542. * {xref-IAccessManager-OperationScheduled-bytes32-uint32-uint48-address-address-bytes-}[`++OperationScheduled(operationId, nonce, schedule, caller, target, data)++`]
  1543. * {xref-IAccessManager-OperationExecuted-bytes32-uint32-}[`++OperationExecuted(operationId, nonce)++`]
  1544. * {xref-IAccessManager-OperationCanceled-bytes32-uint32-}[`++OperationCanceled(operationId, nonce)++`]
  1545. * {xref-IAccessManager-RoleLabel-uint64-string-}[`++RoleLabel(roleId, label)++`]
  1546. * {xref-IAccessManager-RoleGranted-uint64-address-uint32-uint48-bool-}[`++RoleGranted(roleId, account, delay, since, newMember)++`]
  1547. * {xref-IAccessManager-RoleRevoked-uint64-address-}[`++RoleRevoked(roleId, account)++`]
  1548. * {xref-IAccessManager-RoleAdminChanged-uint64-uint64-}[`++RoleAdminChanged(roleId, admin)++`]
  1549. * {xref-IAccessManager-RoleGuardianChanged-uint64-uint64-}[`++RoleGuardianChanged(roleId, guardian)++`]
  1550. * {xref-IAccessManager-RoleGrantDelayChanged-uint64-uint32-uint48-}[`++RoleGrantDelayChanged(roleId, delay, since)++`]
  1551. * {xref-IAccessManager-TargetClosed-address-bool-}[`++TargetClosed(target, closed)++`]
  1552. * {xref-IAccessManager-TargetFunctionRoleUpdated-address-bytes4-uint64-}[`++TargetFunctionRoleUpdated(target, selector, roleId)++`]
  1553. * {xref-IAccessManager-TargetAdminDelayUpdated-address-uint32-uint48-}[`++TargetAdminDelayUpdated(target, delay, since)++`]
  1554. [.contract-subindex-inherited]
  1555. .Multicall
  1556. --
  1557. [.contract-index]
  1558. .Errors
  1559. --
  1560. [.contract-subindex-inherited]
  1561. .IAccessManager
  1562. * {xref-IAccessManager-AccessManagerAlreadyScheduled-bytes32-}[`++AccessManagerAlreadyScheduled(operationId)++`]
  1563. * {xref-IAccessManager-AccessManagerNotScheduled-bytes32-}[`++AccessManagerNotScheduled(operationId)++`]
  1564. * {xref-IAccessManager-AccessManagerNotReady-bytes32-}[`++AccessManagerNotReady(operationId)++`]
  1565. * {xref-IAccessManager-AccessManagerExpired-bytes32-}[`++AccessManagerExpired(operationId)++`]
  1566. * {xref-IAccessManager-AccessManagerLockedAccount-address-}[`++AccessManagerLockedAccount(account)++`]
  1567. * {xref-IAccessManager-AccessManagerLockedRole-uint64-}[`++AccessManagerLockedRole(roleId)++`]
  1568. * {xref-IAccessManager-AccessManagerBadConfirmation--}[`++AccessManagerBadConfirmation()++`]
  1569. * {xref-IAccessManager-AccessManagerUnauthorizedAccount-address-uint64-}[`++AccessManagerUnauthorizedAccount(msgsender, roleId)++`]
  1570. * {xref-IAccessManager-AccessManagerUnauthorizedCall-address-address-bytes4-}[`++AccessManagerUnauthorizedCall(caller, target, selector)++`]
  1571. * {xref-IAccessManager-AccessManagerUnauthorizedConsume-address-}[`++AccessManagerUnauthorizedConsume(target)++`]
  1572. * {xref-IAccessManager-AccessManagerUnauthorizedCancel-address-address-address-bytes4-}[`++AccessManagerUnauthorizedCancel(msgsender, caller, target, selector)++`]
  1573. * {xref-IAccessManager-AccessManagerInvalidInitialAdmin-address-}[`++AccessManagerInvalidInitialAdmin(initialAdmin)++`]
  1574. [.contract-subindex-inherited]
  1575. .Multicall
  1576. --
  1577. [.contract-item]
  1578. [[AccessManager-onlyAuthorized--]]
  1579. ==== `[.contract-item-name]#++onlyAuthorized++#++()++` [.item-kind]#modifier#
  1580. Check that the caller is authorized to perform the operation, following the restrictions encoded in
  1581. {_getAdminRestrictions}.
  1582. [.contract-item]
  1583. [[AccessManager-constructor-address-]]
  1584. ==== `[.contract-item-name]#++constructor++#++(address initialAdmin)++` [.item-kind]#public#
  1585. [.contract-item]
  1586. [[AccessManager-canCall-address-address-bytes4-]]
  1587. ==== `[.contract-item-name]#++canCall++#++(address caller, address target, bytes4 selector) → bool immediate, uint32 delay++` [.item-kind]#public#
  1588. Check if an address (`caller`) is authorised to call a given function on a given contract directly (with
  1589. no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}
  1590. & {execute} workflow.
  1591. This function is usually called by the targeted contract to control immediate execution of restricted functions.
  1592. Therefore we only return true is the call can be performed without any delay. If the call is subject to a delay,
  1593. then the function should return false, and the caller should schedule the operation for future execution.
  1594. We may be able to hash the operation, and check if the call was scheduled, but we would not be able to cleanup
  1595. the schedule, leaving the possibility of multiple executions. Maybe this function should not be view?
  1596. NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that
  1597. is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail
  1598. to identify the indirect workflow, and will consider calls that require a delay to be forbidden.
  1599. [.contract-item]
  1600. [[AccessManager-expiration--]]
  1601. ==== `[.contract-item-name]#++expiration++#++() → uint32++` [.item-kind]#public#
  1602. Expiration delay for scheduled proposals. Defaults to 1 week.
  1603. [.contract-item]
  1604. [[AccessManager-minSetback--]]
  1605. ==== `[.contract-item-name]#++minSetback++#++() → uint32++` [.item-kind]#public#
  1606. Minimum setback for all delay updates, with the exception of execution delays, which
  1607. can be increased without setback (and in the event of an accidental increase can be reset
  1608. via {revokeRole}). Defaults to 5 days.
  1609. [.contract-item]
  1610. [[AccessManager-isTargetClosed-address-]]
  1611. ==== `[.contract-item-name]#++isTargetClosed++#++(address target) → bool++` [.item-kind]#public#
  1612. Get the mode under which a contract is operating.
  1613. [.contract-item]
  1614. [[AccessManager-getTargetFunctionRole-address-bytes4-]]
  1615. ==== `[.contract-item-name]#++getTargetFunctionRole++#++(address target, bytes4 selector) → uint64++` [.item-kind]#public#
  1616. Get the role required to call a function.
  1617. [.contract-item]
  1618. [[AccessManager-getTargetAdminDelay-address-]]
  1619. ==== `[.contract-item-name]#++getTargetAdminDelay++#++(address target) → uint32++` [.item-kind]#public#
  1620. Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.
  1621. [.contract-item]
  1622. [[AccessManager-getRoleAdmin-uint64-]]
  1623. ==== `[.contract-item-name]#++getRoleAdmin++#++(uint64 roleId) → uint64++` [.item-kind]#public#
  1624. Get the id of the role that acts as an admin for given role.
  1625. The admin permission is required to grant the role, revoke the role and update the execution delay to execute
  1626. an operation that is restricted to this role.
  1627. [.contract-item]
  1628. [[AccessManager-getRoleGuardian-uint64-]]
  1629. ==== `[.contract-item-name]#++getRoleGuardian++#++(uint64 roleId) → uint64++` [.item-kind]#public#
  1630. Get the role that acts as a guardian for a given role.
  1631. The guardian permission allows canceling operations that have been scheduled under the role.
  1632. [.contract-item]
  1633. [[AccessManager-getRoleGrantDelay-uint64-]]
  1634. ==== `[.contract-item-name]#++getRoleGrantDelay++#++(uint64 roleId) → uint32++` [.item-kind]#public#
  1635. Get the role current grant delay, that value may change at any point, without an event emitted, following
  1636. a call to {setGrantDelay}. Changes to this value, including effect timepoint are notified by the
  1637. {RoleGrantDelayChanged} event.
  1638. [.contract-item]
  1639. [[AccessManager-getAccess-uint64-address-]]
  1640. ==== `[.contract-item-name]#++getAccess++#++(uint64 roleId, address account) → uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect++` [.item-kind]#public#
  1641. Get the access details for a given account for a given role. These details include the timepoint at which
  1642. membership becomes active, and the delay applied to all operation by this user that requires this permission
  1643. level.
  1644. Returns:
  1645. [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.
  1646. [1] Current execution delay for the account.
  1647. [2] Pending execution delay for the account.
  1648. [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.
  1649. [.contract-item]
  1650. [[AccessManager-hasRole-uint64-address-]]
  1651. ==== `[.contract-item-name]#++hasRole++#++(uint64 roleId, address account) → bool isMember, uint32 executionDelay++` [.item-kind]#public#
  1652. Check if a given account currently had the permission level corresponding to a given role. Note that this
  1653. permission might be associated with a delay. {getAccess} can provide more details.
  1654. [.contract-item]
  1655. [[AccessManager-labelRole-uint64-string-]]
  1656. ==== `[.contract-item-name]#++labelRole++#++(uint64 roleId, string label)++` [.item-kind]#public#
  1657. Give a label to a role, for improved role discoverabily by UIs.
  1658. Emits a {RoleLabel} event.
  1659. [.contract-item]
  1660. [[AccessManager-grantRole-uint64-address-uint32-]]
  1661. ==== `[.contract-item-name]#++grantRole++#++(uint64 roleId, address account, uint32 executionDelay)++` [.item-kind]#public#
  1662. Add `account` to `roleId`, or change its execution delay.
  1663. This gives the account the authorization to call any function that is restricted to this role. An optional
  1664. execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation
  1665. that is restricted to members this role. The user will only be able to execute the operation after the delay has
  1666. passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).
  1667. If the account has already been granted this role, the execution delay will be updated. This update is not
  1668. immediate and follows the delay rules. For example, If a user currently has a delay of 3 hours, and this is
  1669. called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any
  1670. operation executed in the 3 hours that follows this update was indeed scheduled before this update.
  1671. Requirements:
  1672. - the caller must be an admin for the role (see {getRoleAdmin})
  1673. Emits a {RoleGranted} event
  1674. [.contract-item]
  1675. [[AccessManager-revokeRole-uint64-address-]]
  1676. ==== `[.contract-item-name]#++revokeRole++#++(uint64 roleId, address account)++` [.item-kind]#public#
  1677. Remove an account from a role, with immediate effect. If the account does not have the role, this call has
  1678. no effect.
  1679. Requirements:
  1680. - the caller must be an admin for the role (see {getRoleAdmin})
  1681. Emits a {RoleRevoked} event if the account had the role.
  1682. [.contract-item]
  1683. [[AccessManager-renounceRole-uint64-address-]]
  1684. ==== `[.contract-item-name]#++renounceRole++#++(uint64 roleId, address callerConfirmation)++` [.item-kind]#public#
  1685. Renounce role permissions for the calling account, with immediate effect. If the sender is not in
  1686. the role, this call has no effect.
  1687. Requirements:
  1688. - the caller must be `callerConfirmation`.
  1689. Emits a {RoleRevoked} event if the account had the role.
  1690. [.contract-item]
  1691. [[AccessManager-setRoleAdmin-uint64-uint64-]]
  1692. ==== `[.contract-item-name]#++setRoleAdmin++#++(uint64 roleId, uint64 admin)++` [.item-kind]#public#
  1693. Change admin role for a given role.
  1694. Requirements:
  1695. - the caller must be a global admin
  1696. Emits a {RoleAdminChanged} event
  1697. [.contract-item]
  1698. [[AccessManager-setRoleGuardian-uint64-uint64-]]
  1699. ==== `[.contract-item-name]#++setRoleGuardian++#++(uint64 roleId, uint64 guardian)++` [.item-kind]#public#
  1700. Change guardian role for a given role.
  1701. Requirements:
  1702. - the caller must be a global admin
  1703. Emits a {RoleGuardianChanged} event
  1704. [.contract-item]
  1705. [[AccessManager-setGrantDelay-uint64-uint32-]]
  1706. ==== `[.contract-item-name]#++setGrantDelay++#++(uint64 roleId, uint32 newDelay)++` [.item-kind]#public#
  1707. Update the delay for granting a `roleId`.
  1708. Requirements:
  1709. - the caller must be a global admin
  1710. Emits a {RoleGrantDelayChanged} event.
  1711. [.contract-item]
  1712. [[AccessManager-_grantRole-uint64-address-uint32-uint32-]]
  1713. ==== `[.contract-item-name]#++_grantRole++#++(uint64 roleId, address account, uint32 grantDelay, uint32 executionDelay) → bool++` [.item-kind]#internal#
  1714. Internal version of {grantRole} without access control. Returns true if the role was newly granted.
  1715. Emits a {RoleGranted} event.
  1716. [.contract-item]
  1717. [[AccessManager-_revokeRole-uint64-address-]]
  1718. ==== `[.contract-item-name]#++_revokeRole++#++(uint64 roleId, address account) → bool++` [.item-kind]#internal#
  1719. Internal version of {revokeRole} without access control. This logic is also used by {renounceRole}.
  1720. Returns true if the role was previously granted.
  1721. Emits a {RoleRevoked} event if the account had the role.
  1722. [.contract-item]
  1723. [[AccessManager-_setRoleAdmin-uint64-uint64-]]
  1724. ==== `[.contract-item-name]#++_setRoleAdmin++#++(uint64 roleId, uint64 admin)++` [.item-kind]#internal#
  1725. Internal version of {setRoleAdmin} without access control.
  1726. Emits a {RoleAdminChanged} event
  1727. [.contract-item]
  1728. [[AccessManager-_setRoleGuardian-uint64-uint64-]]
  1729. ==== `[.contract-item-name]#++_setRoleGuardian++#++(uint64 roleId, uint64 guardian)++` [.item-kind]#internal#
  1730. Internal version of {setRoleGuardian} without access control.
  1731. Emits a {RoleGuardianChanged} event
  1732. [.contract-item]
  1733. [[AccessManager-_setGrantDelay-uint64-uint32-]]
  1734. ==== `[.contract-item-name]#++_setGrantDelay++#++(uint64 roleId, uint32 newDelay)++` [.item-kind]#internal#
  1735. Internal version of {setGrantDelay} without access control.
  1736. Emits a {RoleGrantDelayChanged} event
  1737. [.contract-item]
  1738. [[AccessManager-setTargetFunctionRole-address-bytes4---uint64-]]
  1739. ==== `[.contract-item-name]#++setTargetFunctionRole++#++(address target, bytes4[] selectors, uint64 roleId)++` [.item-kind]#public#
  1740. Set the role required to call functions identified by the `selectors` in the `target` contract.
  1741. Requirements:
  1742. - the caller must be a global admin
  1743. Emits a {TargetFunctionRoleUpdated} event per selector.
  1744. [.contract-item]
  1745. [[AccessManager-_setTargetFunctionRole-address-bytes4-uint64-]]
  1746. ==== `[.contract-item-name]#++_setTargetFunctionRole++#++(address target, bytes4 selector, uint64 roleId)++` [.item-kind]#internal#
  1747. Internal version of {setFunctionAllowedRole} without access control.
  1748. Emits a {TargetFunctionRoleUpdated} event
  1749. [.contract-item]
  1750. [[AccessManager-setTargetAdminDelay-address-uint32-]]
  1751. ==== `[.contract-item-name]#++setTargetAdminDelay++#++(address target, uint32 newDelay)++` [.item-kind]#public#
  1752. Set the delay for changing the configuration of a given target contract.
  1753. Requirements:
  1754. - the caller must be a global admin
  1755. Emits a {TargetAdminDelayUpdated} event per selector
  1756. [.contract-item]
  1757. [[AccessManager-_setTargetAdminDelay-address-uint32-]]
  1758. ==== `[.contract-item-name]#++_setTargetAdminDelay++#++(address target, uint32 newDelay)++` [.item-kind]#internal#
  1759. Internal version of {setTargetAdminDelay} without access control.
  1760. Emits a {TargetAdminDelayUpdated} event
  1761. [.contract-item]
  1762. [[AccessManager-setTargetClosed-address-bool-]]
  1763. ==== `[.contract-item-name]#++setTargetClosed++#++(address target, bool closed)++` [.item-kind]#public#
  1764. Set the closed flag for a contract.
  1765. Requirements:
  1766. - the caller must be a global admin
  1767. Emits a {TargetClosed} event.
  1768. [.contract-item]
  1769. [[AccessManager-_setTargetClosed-address-bool-]]
  1770. ==== `[.contract-item-name]#++_setTargetClosed++#++(address target, bool closed)++` [.item-kind]#internal#
  1771. Set the closed flag for a contract. This is an internal setter with no access restrictions.
  1772. Emits a {TargetClosed} event.
  1773. [.contract-item]
  1774. [[AccessManager-getSchedule-bytes32-]]
  1775. ==== `[.contract-item-name]#++getSchedule++#++(bytes32 id) → uint48++` [.item-kind]#public#
  1776. Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the
  1777. operation is not yet scheduled, has expired, was executed, or was canceled.
  1778. [.contract-item]
  1779. [[AccessManager-getNonce-bytes32-]]
  1780. ==== `[.contract-item-name]#++getNonce++#++(bytes32 id) → uint32++` [.item-kind]#public#
  1781. Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never
  1782. been scheduled.
  1783. [.contract-item]
  1784. [[AccessManager-schedule-address-bytes-uint48-]]
  1785. ==== `[.contract-item-name]#++schedule++#++(address target, bytes data, uint48 when) → bytes32 operationId, uint32 nonce++` [.item-kind]#public#
  1786. Schedule a delayed operation for future execution, and return the operation identifier. It is possible to
  1787. choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays
  1788. required for the caller. The special value zero will automatically set the earliest possible time.
  1789. Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when
  1790. the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this
  1791. scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.
  1792. Emits a {OperationScheduled} event.
  1793. NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If
  1794. this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target
  1795. contract if it is using standard Solidity ABI encoding.
  1796. [.contract-item]
  1797. [[AccessManager-execute-address-bytes-]]
  1798. ==== `[.contract-item-name]#++execute++#++(address target, bytes data) → uint32++` [.item-kind]#public#
  1799. Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the
  1800. execution delay is 0.
  1801. Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the
  1802. operation wasn't previously scheduled (if the caller doesn't have an execution delay).
  1803. Emits an {OperationExecuted} event only if the call was scheduled and delayed.
  1804. [.contract-item]
  1805. [[AccessManager-consumeScheduledOp-address-bytes-]]
  1806. ==== `[.contract-item-name]#++consumeScheduledOp++#++(address caller, bytes data)++` [.item-kind]#public#
  1807. Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed
  1808. (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.
  1809. This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,
  1810. with all the verifications that it implies.
  1811. Emit a {OperationExecuted} event
  1812. [.contract-item]
  1813. [[AccessManager-_consumeScheduledOp-bytes32-]]
  1814. ==== `[.contract-item-name]#++_consumeScheduledOp++#++(bytes32 operationId) → uint32++` [.item-kind]#internal#
  1815. Internal variant of {consumeScheduledOp} that operates on bytes32 operationId.
  1816. Returns the nonce of the scheduled operation that is consumed.
  1817. [.contract-item]
  1818. [[AccessManager-cancel-address-address-bytes-]]
  1819. ==== `[.contract-item-name]#++cancel++#++(address caller, address target, bytes data) → uint32++` [.item-kind]#public#
  1820. Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled
  1821. operation that is cancelled.
  1822. Requirements:
  1823. - the caller must be the proposer, a guardian of the targeted function, or a global admin
  1824. Emits a {OperationCanceled} event.
  1825. [.contract-item]
  1826. [[AccessManager-hashOperation-address-address-bytes-]]
  1827. ==== `[.contract-item-name]#++hashOperation++#++(address caller, address target, bytes data) → bytes32++` [.item-kind]#public#
  1828. Hashing function for delayed operations
  1829. [.contract-item]
  1830. [[AccessManager-updateAuthority-address-address-]]
  1831. ==== `[.contract-item-name]#++updateAuthority++#++(address target, address newAuthority)++` [.item-kind]#public#
  1832. Change the AccessManager instance used by a contract that correctly uses this instance.
  1833. Requirements:
  1834. - the caller must be a global admin
  1835. :constructor: pass:normal[xref:#AccessManaged-constructor-address-[`++constructor++`]]
  1836. :restricted: pass:normal[xref:#AccessManaged-restricted--[`++restricted++`]]
  1837. :authority: pass:normal[xref:#AccessManaged-authority--[`++authority++`]]
  1838. :setAuthority: pass:normal[xref:#AccessManaged-setAuthority-address-[`++setAuthority++`]]
  1839. :isConsumingScheduledOp: pass:normal[xref:#AccessManaged-isConsumingScheduledOp--[`++isConsumingScheduledOp++`]]
  1840. :_setAuthority: pass:normal[xref:#AccessManaged-_setAuthority-address-[`++_setAuthority++`]]
  1841. :_checkCanCall: pass:normal[xref:#AccessManaged-_checkCanCall-address-bytes-[`++_checkCanCall++`]]
  1842. [.contract]
  1843. [[AccessManaged]]
  1844. === `++AccessManaged++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0-rc.2/contracts/access/manager/AccessManaged.sol[{github-icon},role=heading-link]
  1845. [.hljs-theme-light.nopadding]
  1846. ```solidity
  1847. import "@openzeppelin/contracts/access/manager/AccessManaged.sol";
  1848. ```
  1849. This contract module makes available a {restricted} modifier. Functions decorated with this modifier will be
  1850. permissioned according to an "authority": a contract like {AccessManager} that follows the {IAuthority} interface,
  1851. implementing a policy that allows certain callers to access certain functions.
  1852. IMPORTANT: The `restricted` modifier should never be used on `internal` functions, judiciously used in `public`
  1853. functions, and ideally only used in `external` functions. See {restricted}.
  1854. [.contract-index]
  1855. .Modifiers
  1856. --
  1857. * {xref-AccessManaged-restricted--}[`++restricted()++`]
  1858. --
  1859. [.contract-index]
  1860. .Functions
  1861. --
  1862. * {xref-AccessManaged-constructor-address-}[`++constructor(initialAuthority)++`]
  1863. * {xref-AccessManaged-authority--}[`++authority()++`]
  1864. * {xref-AccessManaged-setAuthority-address-}[`++setAuthority(newAuthority)++`]
  1865. * {xref-AccessManaged-isConsumingScheduledOp--}[`++isConsumingScheduledOp()++`]
  1866. * {xref-AccessManaged-_setAuthority-address-}[`++_setAuthority(newAuthority)++`]
  1867. * {xref-AccessManaged-_checkCanCall-address-bytes-}[`++_checkCanCall(caller, data)++`]
  1868. [.contract-subindex-inherited]
  1869. .IAccessManaged
  1870. --
  1871. [.contract-index]
  1872. .Events
  1873. --
  1874. [.contract-subindex-inherited]
  1875. .IAccessManaged
  1876. * {xref-IAccessManaged-AuthorityUpdated-address-}[`++AuthorityUpdated(authority)++`]
  1877. --
  1878. [.contract-index]
  1879. .Errors
  1880. --
  1881. [.contract-subindex-inherited]
  1882. .IAccessManaged
  1883. * {xref-IAccessManaged-AccessManagedUnauthorized-address-}[`++AccessManagedUnauthorized(caller)++`]
  1884. * {xref-IAccessManaged-AccessManagedRequiredDelay-address-uint32-}[`++AccessManagedRequiredDelay(caller, delay)++`]
  1885. * {xref-IAccessManaged-AccessManagedInvalidAuthority-address-}[`++AccessManagedInvalidAuthority(authority)++`]
  1886. --
  1887. [.contract-item]
  1888. [[AccessManaged-restricted--]]
  1889. ==== `[.contract-item-name]#++restricted++#++()++` [.item-kind]#modifier#
  1890. Restricts access to a function as defined by the connected Authority for this contract and the
  1891. caller and selector of the function that entered the contract.
  1892. [IMPORTANT]
  1893. ====
  1894. In general, this modifier should only be used on `external` functions. It is okay to use it on `public`
  1895. functions that are used as external entry points and are not called internally. Unless you know what you're
  1896. doing, it should never be used on `internal` functions. Failure to follow these rules can have critical security
  1897. implications! This is because the permissions are determined by the function that entered the contract, i.e. the
  1898. function at the bottom of the call stack, and not the function where the modifier is visible in the source code.
  1899. ====
  1900. [WARNING]
  1901. ====
  1902. Avoid adding this modifier to the https://docs.soliditylang.org/en/v0.8.20/contracts.html#receive-ether-function[`receive()`]
  1903. function or the https://docs.soliditylang.org/en/v0.8.20/contracts.html#fallback-function[`fallback()`]. These
  1904. functions are the only execution paths where a function selector cannot be unambiguosly determined from the calldata
  1905. since the selector defaults to `0x00000000` in the `receive()` function and similarly in the `fallback()` function
  1906. if no calldata is provided. (See {_checkCanCall}).
  1907. The `receive()` function will always panic whereas the `fallback()` may panic depending on the calldata length.
  1908. ====
  1909. [.contract-item]
  1910. [[AccessManaged-constructor-address-]]
  1911. ==== `[.contract-item-name]#++constructor++#++(address initialAuthority)++` [.item-kind]#internal#
  1912. Initializes the contract connected to an initial authority.
  1913. [.contract-item]
  1914. [[AccessManaged-authority--]]
  1915. ==== `[.contract-item-name]#++authority++#++() → address++` [.item-kind]#public#
  1916. Returns the current authority.
  1917. [.contract-item]
  1918. [[AccessManaged-setAuthority-address-]]
  1919. ==== `[.contract-item-name]#++setAuthority++#++(address newAuthority)++` [.item-kind]#public#
  1920. Transfers control to a new authority. The caller must be the current authority.
  1921. [.contract-item]
  1922. [[AccessManaged-isConsumingScheduledOp--]]
  1923. ==== `[.contract-item-name]#++isConsumingScheduledOp++#++() → bytes4++` [.item-kind]#public#
  1924. Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is
  1925. being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs
  1926. attacker controlled calls.
  1927. [.contract-item]
  1928. [[AccessManaged-_setAuthority-address-]]
  1929. ==== `[.contract-item-name]#++_setAuthority++#++(address newAuthority)++` [.item-kind]#internal#
  1930. Transfers control to a new authority. Internal function with no access restriction. Allows bypassing the
  1931. permissions set by the current authority.
  1932. [.contract-item]
  1933. [[AccessManaged-_checkCanCall-address-bytes-]]
  1934. ==== `[.contract-item-name]#++_checkCanCall++#++(address caller, bytes data)++` [.item-kind]#internal#
  1935. Reverts if the caller is not allowed to call the function identified by a selector. Panics if the calldata
  1936. is less than 4 bytes long.