account.adoc 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602
  1. :github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
  2. :Account: pass:normal[xref:account.adoc#Account[`Account`]]
  3. :AccountERC7579: pass:normal[xref:account.adoc#AccountERC7579[`AccountERC7579`]]
  4. :AccountERC7579Hooked: pass:normal[xref:account.adoc#AccountERC7579Hooked[`AccountERC7579Hooked`]]
  5. :ERC7821: pass:normal[xref:account.adoc#ERC7821[`ERC7821`]]
  6. :ERC4337Utils: pass:normal[xref:account.adoc#ERC4337Utils[`ERC4337Utils`]]
  7. :ERC7579Utils: pass:normal[xref:account.adoc#ERC7579Utils[`ERC7579Utils`]]
  8. :AbstractSigner-_rawSignatureValidation: pass:normal[xref:utils/cryptography.adoc#AbstractSigner-_rawSignatureValidation-bytes32-bytes-[`AbstractSigner._rawSignatureValidation`]]
  9. :SignerECDSA: pass:normal[xref:utils/cryptography.adoc#SignerECDSA[`SignerECDSA`]]
  10. :SignerP256: pass:normal[xref:utils/cryptography.adoc#SignerP256[`SignerP256`]]
  11. :SignerRSA: pass:normal[xref:utils/cryptography.adoc#SignerRSA[`SignerRSA`]]
  12. :xref-Account-onlyEntryPointOrSelf--: xref:account.adoc#Account-onlyEntryPointOrSelf--
  13. :xref-Account-onlyEntryPoint--: xref:account.adoc#Account-onlyEntryPoint--
  14. :xref-Account-entryPoint--: xref:account.adoc#Account-entryPoint--
  15. :xref-Account-getNonce--: xref:account.adoc#Account-getNonce--
  16. :xref-Account-getNonce-uint192-: xref:account.adoc#Account-getNonce-uint192-
  17. :xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-: xref:account.adoc#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-
  18. :xref-Account-_validateUserOp-struct-PackedUserOperation-bytes32-: xref:account.adoc#Account-_validateUserOp-struct-PackedUserOperation-bytes32-
  19. :xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-: xref:account.adoc#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-
  20. :xref-Account-_payPrefund-uint256-: xref:account.adoc#Account-_payPrefund-uint256-
  21. :xref-Account-_checkEntryPoint--: xref:account.adoc#Account-_checkEntryPoint--
  22. :xref-Account-_checkEntryPointOrSelf--: xref:account.adoc#Account-_checkEntryPointOrSelf--
  23. :xref-Account-receive--: xref:account.adoc#Account-receive--
  24. :xref-AbstractSigner-_rawSignatureValidation-bytes32-bytes-: xref:utils/cryptography.adoc#AbstractSigner-_rawSignatureValidation-bytes32-bytes-
  25. :xref-Account-AccountUnauthorized-address-: xref:account.adoc#Account-AccountUnauthorized-address-
  26. :AbstractSigner-_rawSignatureValidation: pass:normal[xref:utils/cryptography.adoc#AbstractSigner-_rawSignatureValidation-bytes32-bytes-[`AbstractSigner._rawSignatureValidation`]]
  27. :Account: pass:normal[xref:account.adoc#Account[`Account`]]
  28. :IERC7579Validator-isValidSignatureWithSender: pass:normal[xref:interfaces.adoc#IERC7579Validator-isValidSignatureWithSender-address-bytes32-bytes-[`IERC7579Validator.isValidSignatureWithSender`]]
  29. :AccountERC7579Hooked: pass:normal[xref:account.adoc#AccountERC7579Hooked[`AccountERC7579Hooked`]]
  30. :ERC7739: pass:normal[xref:utils/cryptography.adoc#ERC7739[`ERC7739`]]
  31. :ERC7739: pass:normal[xref:utils/cryptography.adoc#ERC7739[`ERC7739`]]
  32. :xref-AccountERC7579-onlyModule-uint256-bytes-: xref:account.adoc#AccountERC7579-onlyModule-uint256-bytes-
  33. :xref-AccountERC7579-fallback-bytes-: xref:account.adoc#AccountERC7579-fallback-bytes-
  34. :xref-AccountERC7579-accountId--: xref:account.adoc#AccountERC7579-accountId--
  35. :xref-AccountERC7579-supportsExecutionMode-bytes32-: xref:account.adoc#AccountERC7579-supportsExecutionMode-bytes32-
  36. :xref-AccountERC7579-supportsModule-uint256-: xref:account.adoc#AccountERC7579-supportsModule-uint256-
  37. :xref-AccountERC7579-installModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-installModule-uint256-address-bytes-
  38. :xref-AccountERC7579-uninstallModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-uninstallModule-uint256-address-bytes-
  39. :xref-AccountERC7579-isModuleInstalled-uint256-address-bytes-: xref:account.adoc#AccountERC7579-isModuleInstalled-uint256-address-bytes-
  40. :xref-AccountERC7579-execute-bytes32-bytes-: xref:account.adoc#AccountERC7579-execute-bytes32-bytes-
  41. :xref-AccountERC7579-executeFromExecutor-bytes32-bytes-: xref:account.adoc#AccountERC7579-executeFromExecutor-bytes32-bytes-
  42. :xref-AccountERC7579-isValidSignature-bytes32-bytes-: xref:account.adoc#AccountERC7579-isValidSignature-bytes32-bytes-
  43. :xref-AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-: xref:account.adoc#AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-
  44. :xref-AccountERC7579-_execute-Mode-bytes-: xref:account.adoc#AccountERC7579-_execute-Mode-bytes-
  45. :xref-AccountERC7579-_installModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-_installModule-uint256-address-bytes-
  46. :xref-AccountERC7579-_uninstallModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-_uninstallModule-uint256-address-bytes-
  47. :xref-AccountERC7579-_fallback--: xref:account.adoc#AccountERC7579-_fallback--
  48. :xref-AccountERC7579-_fallbackHandler-bytes4-: xref:account.adoc#AccountERC7579-_fallbackHandler-bytes4-
  49. :xref-AccountERC7579-_checkModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-_checkModule-uint256-address-bytes-
  50. :xref-AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-: xref:account.adoc#AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-
  51. :xref-AccountERC7579-_extractSignatureValidator-bytes-: xref:account.adoc#AccountERC7579-_extractSignatureValidator-bytes-
  52. :xref-AccountERC7579-_decodeFallbackData-bytes-: xref:account.adoc#AccountERC7579-_decodeFallbackData-bytes-
  53. :xref-AccountERC7579-_rawSignatureValidation-bytes32-bytes-: xref:account.adoc#AccountERC7579-_rawSignatureValidation-bytes32-bytes-
  54. :xref-Account-entryPoint--: xref:account.adoc#Account-entryPoint--
  55. :xref-Account-getNonce--: xref:account.adoc#Account-getNonce--
  56. :xref-Account-getNonce-uint192-: xref:account.adoc#Account-getNonce-uint192-
  57. :xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-: xref:account.adoc#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-
  58. :xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-: xref:account.adoc#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-
  59. :xref-Account-_payPrefund-uint256-: xref:account.adoc#Account-_payPrefund-uint256-
  60. :xref-Account-_checkEntryPoint--: xref:account.adoc#Account-_checkEntryPoint--
  61. :xref-Account-_checkEntryPointOrSelf--: xref:account.adoc#Account-_checkEntryPointOrSelf--
  62. :xref-Account-receive--: xref:account.adoc#Account-receive--
  63. :xref-IERC7579ModuleConfig-ModuleInstalled-uint256-address-: xref:interfaces.adoc#IERC7579ModuleConfig-ModuleInstalled-uint256-address-
  64. :xref-IERC7579ModuleConfig-ModuleUninstalled-uint256-address-: xref:interfaces.adoc#IERC7579ModuleConfig-ModuleUninstalled-uint256-address-
  65. :xref-AccountERC7579-ERC7579MissingFallbackHandler-bytes4-: xref:account.adoc#AccountERC7579-ERC7579MissingFallbackHandler-bytes4-
  66. :xref-Account-AccountUnauthorized-address-: xref:account.adoc#Account-AccountUnauthorized-address-
  67. :ERC7739: pass:normal[xref:utils/cryptography.adoc#ERC7739[`ERC7739`]]
  68. :ERC7739: pass:normal[xref:utils/cryptography.adoc#ERC7739[`ERC7739`]]
  69. :Account-_validateUserOp: pass:normal[xref:account.adoc#Account-_validateUserOp-struct-PackedUserOperation-bytes32-[`Account._validateUserOp`]]
  70. :IERC7579Module-onInstall: pass:normal[xref:interfaces.adoc#IERC7579Module-onInstall-bytes-[`IERC7579Module.onInstall`]]
  71. :ERC7579Utils-ERC7579UnsupportedModuleType: pass:normal[xref:account.adoc#ERC7579Utils-ERC7579UnsupportedModuleType-uint256-[`ERC7579Utils.ERC7579UnsupportedModuleType`]]
  72. :ERC7579Utils-ERC7579MismatchedModuleTypeId: pass:normal[xref:account.adoc#ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-[`ERC7579Utils.ERC7579MismatchedModuleTypeId`]]
  73. :ERC7579Utils-ERC7579AlreadyInstalledModule: pass:normal[xref:account.adoc#ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-[`ERC7579Utils.ERC7579AlreadyInstalledModule`]]
  74. :IERC7579ModuleConfig-ModuleInstalled: pass:normal[xref:interfaces.adoc#IERC7579ModuleConfig-ModuleInstalled-uint256-address-[`IERC7579ModuleConfig.ModuleInstalled`]]
  75. :IERC7579Module-onUninstall: pass:normal[xref:interfaces.adoc#IERC7579Module-onUninstall-bytes-[`IERC7579Module.onUninstall`]]
  76. :ERC7579Utils-ERC7579UninstalledModule: pass:normal[xref:account.adoc#ERC7579Utils-ERC7579UninstalledModule-uint256-address-[`ERC7579Utils.ERC7579UninstalledModule`]]
  77. :AccountERC7579: pass:normal[xref:account.adoc#AccountERC7579[`AccountERC7579`]]
  78. :IERC7579Hook-preCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-preCheck-address-uint256-bytes-[`IERC7579Hook.preCheck`]]
  79. :IERC7579Hook-postCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-postCheck-bytes-[`IERC7579Hook.postCheck`]]
  80. :IERC7579Hook-preCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-preCheck-address-uint256-bytes-[`IERC7579Hook.preCheck`]]
  81. :xref-AccountERC7579Hooked-withHook--: xref:account.adoc#AccountERC7579Hooked-withHook--
  82. :xref-AccountERC7579Hooked-accountId--: xref:account.adoc#AccountERC7579Hooked-accountId--
  83. :xref-AccountERC7579Hooked-hook--: xref:account.adoc#AccountERC7579Hooked-hook--
  84. :xref-AccountERC7579Hooked-supportsModule-uint256-: xref:account.adoc#AccountERC7579Hooked-supportsModule-uint256-
  85. :xref-AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-: xref:account.adoc#AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-
  86. :xref-AccountERC7579Hooked-_installModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579Hooked-_installModule-uint256-address-bytes-
  87. :xref-AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-
  88. :xref-AccountERC7579Hooked-_execute-Mode-bytes-: xref:account.adoc#AccountERC7579Hooked-_execute-Mode-bytes-
  89. :xref-AccountERC7579Hooked-_fallback--: xref:account.adoc#AccountERC7579Hooked-_fallback--
  90. :xref-AccountERC7579-fallback-bytes-: xref:account.adoc#AccountERC7579-fallback-bytes-
  91. :xref-AccountERC7579-supportsExecutionMode-bytes32-: xref:account.adoc#AccountERC7579-supportsExecutionMode-bytes32-
  92. :xref-AccountERC7579-installModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-installModule-uint256-address-bytes-
  93. :xref-AccountERC7579-uninstallModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-uninstallModule-uint256-address-bytes-
  94. :xref-AccountERC7579-execute-bytes32-bytes-: xref:account.adoc#AccountERC7579-execute-bytes32-bytes-
  95. :xref-AccountERC7579-executeFromExecutor-bytes32-bytes-: xref:account.adoc#AccountERC7579-executeFromExecutor-bytes32-bytes-
  96. :xref-AccountERC7579-isValidSignature-bytes32-bytes-: xref:account.adoc#AccountERC7579-isValidSignature-bytes32-bytes-
  97. :xref-AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-: xref:account.adoc#AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-
  98. :xref-AccountERC7579-_fallbackHandler-bytes4-: xref:account.adoc#AccountERC7579-_fallbackHandler-bytes4-
  99. :xref-AccountERC7579-_checkModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-_checkModule-uint256-address-bytes-
  100. :xref-AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-: xref:account.adoc#AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-
  101. :xref-AccountERC7579-_extractSignatureValidator-bytes-: xref:account.adoc#AccountERC7579-_extractSignatureValidator-bytes-
  102. :xref-AccountERC7579-_decodeFallbackData-bytes-: xref:account.adoc#AccountERC7579-_decodeFallbackData-bytes-
  103. :xref-AccountERC7579-_rawSignatureValidation-bytes32-bytes-: xref:account.adoc#AccountERC7579-_rawSignatureValidation-bytes32-bytes-
  104. :xref-Account-entryPoint--: xref:account.adoc#Account-entryPoint--
  105. :xref-Account-getNonce--: xref:account.adoc#Account-getNonce--
  106. :xref-Account-getNonce-uint192-: xref:account.adoc#Account-getNonce-uint192-
  107. :xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-: xref:account.adoc#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-
  108. :xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-: xref:account.adoc#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-
  109. :xref-Account-_payPrefund-uint256-: xref:account.adoc#Account-_payPrefund-uint256-
  110. :xref-Account-_checkEntryPoint--: xref:account.adoc#Account-_checkEntryPoint--
  111. :xref-Account-_checkEntryPointOrSelf--: xref:account.adoc#Account-_checkEntryPointOrSelf--
  112. :xref-Account-receive--: xref:account.adoc#Account-receive--
  113. :xref-IERC7579ModuleConfig-ModuleInstalled-uint256-address-: xref:interfaces.adoc#IERC7579ModuleConfig-ModuleInstalled-uint256-address-
  114. :xref-IERC7579ModuleConfig-ModuleUninstalled-uint256-address-: xref:interfaces.adoc#IERC7579ModuleConfig-ModuleUninstalled-uint256-address-
  115. :xref-AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-: xref:account.adoc#AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-
  116. :xref-AccountERC7579-ERC7579MissingFallbackHandler-bytes4-: xref:account.adoc#AccountERC7579-ERC7579MissingFallbackHandler-bytes4-
  117. :xref-Account-AccountUnauthorized-address-: xref:account.adoc#Account-AccountUnauthorized-address-
  118. :IERC7579Hook-preCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-preCheck-address-uint256-bytes-[`IERC7579Hook.preCheck`]]
  119. :IERC7579Hook-postCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-postCheck-bytes-[`IERC7579Hook.postCheck`]]
  120. :AccountERC7579-supportsModule: pass:normal[xref:account.adoc#AccountERC7579-supportsModule-uint256-[`AccountERC7579.supportsModule`]]
  121. :AccountERC7579-_installModule: pass:normal[xref:account.adoc#AccountERC7579-_installModule-uint256-address-bytes-[`AccountERC7579._installModule`]]
  122. :AccountERC7579-_uninstallModule: pass:normal[xref:account.adoc#AccountERC7579-_uninstallModule-uint256-address-bytes-[`AccountERC7579._uninstallModule`]]
  123. :AccountERC7579-_execute: pass:normal[xref:account.adoc#AccountERC7579-_execute-Mode-bytes-[`AccountERC7579._execute`]]
  124. :AccountERC7579-_fallback: pass:normal[xref:account.adoc#AccountERC7579-_fallback--[`AccountERC7579._fallback`]]
  125. :xref-ERC7821-execute-bytes32-bytes-: xref:account.adoc#ERC7821-execute-bytes32-bytes-
  126. :xref-ERC7821-supportsExecutionMode-bytes32-: xref:account.adoc#ERC7821-supportsExecutionMode-bytes32-
  127. :xref-ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-: xref:account.adoc#ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-
  128. :xref-ERC7821-UnsupportedExecutionMode--: xref:account.adoc#ERC7821-UnsupportedExecutionMode--
  129. :xref-ERC4337Utils-parseValidationData-uint256-: xref:account.adoc#ERC4337Utils-parseValidationData-uint256-
  130. :xref-ERC4337Utils-packValidationData-address-uint48-uint48-: xref:account.adoc#ERC4337Utils-packValidationData-address-uint48-uint48-
  131. :xref-ERC4337Utils-packValidationData-bool-uint48-uint48-: xref:account.adoc#ERC4337Utils-packValidationData-bool-uint48-uint48-
  132. :xref-ERC4337Utils-combineValidationData-uint256-uint256-: xref:account.adoc#ERC4337Utils-combineValidationData-uint256-uint256-
  133. :xref-ERC4337Utils-getValidationData-uint256-: xref:account.adoc#ERC4337Utils-getValidationData-uint256-
  134. :xref-ERC4337Utils-hash-struct-PackedUserOperation-address-: xref:account.adoc#ERC4337Utils-hash-struct-PackedUserOperation-address-
  135. :xref-ERC4337Utils-factory-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-factory-struct-PackedUserOperation-
  136. :xref-ERC4337Utils-factoryData-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-factoryData-struct-PackedUserOperation-
  137. :xref-ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-
  138. :xref-ERC4337Utils-callGasLimit-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-callGasLimit-struct-PackedUserOperation-
  139. :xref-ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-
  140. :xref-ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-
  141. :xref-ERC4337Utils-gasPrice-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-gasPrice-struct-PackedUserOperation-
  142. :xref-ERC4337Utils-paymaster-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-paymaster-struct-PackedUserOperation-
  143. :xref-ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-
  144. :xref-ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-
  145. :xref-ERC4337Utils-paymasterData-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-paymasterData-struct-PackedUserOperation-
  146. :xref-ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint: xref:account.adoc#ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint
  147. :xref-ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint: xref:account.adoc#ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint
  148. :xref-ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256: xref:account.adoc#ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256
  149. :xref-ERC4337Utils-SIG_VALIDATION_FAILED-uint256: xref:account.adoc#ERC4337Utils-SIG_VALIDATION_FAILED-uint256
  150. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  151. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  152. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  153. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  154. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  155. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  156. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  157. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  158. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  159. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  160. :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
  161. :xref-ERC7579Utils-execSingle-bytes-ExecType-: xref:account.adoc#ERC7579Utils-execSingle-bytes-ExecType-
  162. :xref-ERC7579Utils-execBatch-bytes-ExecType-: xref:account.adoc#ERC7579Utils-execBatch-bytes-ExecType-
  163. :xref-ERC7579Utils-execDelegateCall-bytes-ExecType-: xref:account.adoc#ERC7579Utils-execDelegateCall-bytes-ExecType-
  164. :xref-ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-: xref:account.adoc#ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-
  165. :xref-ERC7579Utils-decodeMode-Mode-: xref:account.adoc#ERC7579Utils-decodeMode-Mode-
  166. :xref-ERC7579Utils-encodeSingle-address-uint256-bytes-: xref:account.adoc#ERC7579Utils-encodeSingle-address-uint256-bytes-
  167. :xref-ERC7579Utils-decodeSingle-bytes-: xref:account.adoc#ERC7579Utils-decodeSingle-bytes-
  168. :xref-ERC7579Utils-encodeDelegate-address-bytes-: xref:account.adoc#ERC7579Utils-encodeDelegate-address-bytes-
  169. :xref-ERC7579Utils-decodeDelegate-bytes-: xref:account.adoc#ERC7579Utils-decodeDelegate-bytes-
  170. :xref-ERC7579Utils-encodeBatch-struct-Execution---: xref:account.adoc#ERC7579Utils-encodeBatch-struct-Execution---
  171. :xref-ERC7579Utils-decodeBatch-bytes-: xref:account.adoc#ERC7579Utils-decodeBatch-bytes-
  172. :xref-ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-: xref:account.adoc#ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-
  173. :xref-ERC7579Utils-ERC7579UnsupportedCallType-CallType-: xref:account.adoc#ERC7579Utils-ERC7579UnsupportedCallType-CallType-
  174. :xref-ERC7579Utils-ERC7579UnsupportedExecType-ExecType-: xref:account.adoc#ERC7579Utils-ERC7579UnsupportedExecType-ExecType-
  175. :xref-ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-: xref:account.adoc#ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-
  176. :xref-ERC7579Utils-ERC7579UninstalledModule-uint256-address-: xref:account.adoc#ERC7579Utils-ERC7579UninstalledModule-uint256-address-
  177. :xref-ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-: xref:account.adoc#ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-
  178. :xref-ERC7579Utils-ERC7579UnsupportedModuleType-uint256-: xref:account.adoc#ERC7579Utils-ERC7579UnsupportedModuleType-uint256-
  179. :xref-ERC7579Utils-ERC7579DecodingError--: xref:account.adoc#ERC7579Utils-ERC7579DecodingError--
  180. :xref-ERC7579Utils-CALLTYPE_SINGLE-CallType: xref:account.adoc#ERC7579Utils-CALLTYPE_SINGLE-CallType
  181. :xref-ERC7579Utils-CALLTYPE_BATCH-CallType: xref:account.adoc#ERC7579Utils-CALLTYPE_BATCH-CallType
  182. :xref-ERC7579Utils-CALLTYPE_DELEGATECALL-CallType: xref:account.adoc#ERC7579Utils-CALLTYPE_DELEGATECALL-CallType
  183. :xref-ERC7579Utils-EXECTYPE_DEFAULT-ExecType: xref:account.adoc#ERC7579Utils-EXECTYPE_DEFAULT-ExecType
  184. :xref-ERC7579Utils-EXECTYPE_TRY-ExecType: xref:account.adoc#ERC7579Utils-EXECTYPE_TRY-ExecType
  185. :CallType: pass:normal[xref:account.adoc#CallType[`CallType`]]
  186. :ExecType: pass:normal[xref:account.adoc#ExecType[`ExecType`]]
  187. = Account
  188. [.readme-notice]
  189. NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/account
  190. This directory includes contracts to build accounts for ERC-4337. These include:
  191. * {Account}: An ERC-4337 smart account implementation that includes the core logic to process user operations.
  192. * {AccountERC7579}: An extension of `Account` that implements support for ERC-7579 modules.
  193. * {AccountERC7579Hooked}: An extension of `AccountERC7579` with support for a single hook module (type 4).
  194. * {ERC7821}: Minimal batch executor implementation contracts. Useful to enable easy batch execution for smart contracts.
  195. * {ERC4337Utils}: Utility functions for working with ERC-4337 user operations.
  196. * {ERC7579Utils}: Utility functions for working with ERC-7579 modules and account modularity.
  197. == Core
  198. :AccountUnauthorized: pass:normal[xref:#Account-AccountUnauthorized-address-[`++AccountUnauthorized++`]]
  199. :onlyEntryPointOrSelf: pass:normal[xref:#Account-onlyEntryPointOrSelf--[`++onlyEntryPointOrSelf++`]]
  200. :onlyEntryPoint: pass:normal[xref:#Account-onlyEntryPoint--[`++onlyEntryPoint++`]]
  201. :entryPoint: pass:normal[xref:#Account-entryPoint--[`++entryPoint++`]]
  202. :getNonce: pass:normal[xref:#Account-getNonce--[`++getNonce++`]]
  203. :getNonce: pass:normal[xref:#Account-getNonce-uint192-[`++getNonce++`]]
  204. :validateUserOp: pass:normal[xref:#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-[`++validateUserOp++`]]
  205. :_validateUserOp: pass:normal[xref:#Account-_validateUserOp-struct-PackedUserOperation-bytes32-[`++_validateUserOp++`]]
  206. :_signableUserOpHash: pass:normal[xref:#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-[`++_signableUserOpHash++`]]
  207. :_payPrefund: pass:normal[xref:#Account-_payPrefund-uint256-[`++_payPrefund++`]]
  208. :_checkEntryPoint: pass:normal[xref:#Account-_checkEntryPoint--[`++_checkEntryPoint++`]]
  209. :_checkEntryPointOrSelf: pass:normal[xref:#Account-_checkEntryPointOrSelf--[`++_checkEntryPointOrSelf++`]]
  210. :receive: pass:normal[xref:#Account-receive--[`++receive++`]]
  211. :entryPoint-: pass:normal[xref:#Account-entryPoint--[`++entryPoint++`]]
  212. :getNonce-: pass:normal[xref:#Account-getNonce--[`++getNonce++`]]
  213. :getNonce-uint192: pass:normal[xref:#Account-getNonce-uint192-[`++getNonce++`]]
  214. :validateUserOp-struct-PackedUserOperation-bytes32-uint256: pass:normal[xref:#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-[`++validateUserOp++`]]
  215. :_validateUserOp-struct-PackedUserOperation-bytes32: pass:normal[xref:#Account-_validateUserOp-struct-PackedUserOperation-bytes32-[`++_validateUserOp++`]]
  216. :_signableUserOpHash-struct-PackedUserOperation-bytes32: pass:normal[xref:#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-[`++_signableUserOpHash++`]]
  217. :_payPrefund-uint256: pass:normal[xref:#Account-_payPrefund-uint256-[`++_payPrefund++`]]
  218. :_checkEntryPoint-: pass:normal[xref:#Account-_checkEntryPoint--[`++_checkEntryPoint++`]]
  219. :_checkEntryPointOrSelf-: pass:normal[xref:#Account-_checkEntryPointOrSelf--[`++_checkEntryPointOrSelf++`]]
  220. :receive-: pass:normal[xref:#Account-receive--[`++receive++`]]
  221. [.contract]
  222. [[Account]]
  223. === `++Account++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/Account.sol[{github-icon},role=heading-link]
  224. [.hljs-theme-light.nopadding]
  225. ```solidity
  226. import "@openzeppelin/contracts/account/Account.sol";
  227. ```
  228. A simple ERC4337 account implementation. This base implementation only includes the minimal logic to process
  229. user operations.
  230. Developers must implement the {AbstractSigner-_rawSignatureValidation} function to define the account's validation logic.
  231. NOTE: This core account doesn't include any mechanism for performing arbitrary external calls. This is an essential
  232. feature that all Account should have. We leave it up to the developers to implement the mechanism of their choice.
  233. Common choices include ERC-6900, ERC-7579 and ERC-7821 (among others).
  234. IMPORTANT: Implementing a mechanism to validate signatures is a security-sensitive operation as it may allow an
  235. attacker to bypass the account's security measures. Check out {SignerECDSA}, {SignerP256}, or {SignerRSA} for
  236. digital signature validation implementations.
  237. @custom:stateless
  238. [.contract-index]
  239. .Modifiers
  240. --
  241. * {xref-Account-onlyEntryPointOrSelf--}[`++onlyEntryPointOrSelf()++`]
  242. * {xref-Account-onlyEntryPoint--}[`++onlyEntryPoint()++`]
  243. --
  244. [.contract-index]
  245. .Functions
  246. --
  247. * {xref-Account-entryPoint--}[`++entryPoint()++`]
  248. * {xref-Account-getNonce--}[`++getNonce()++`]
  249. * {xref-Account-getNonce-uint192-}[`++getNonce(key)++`]
  250. * {xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-}[`++validateUserOp(userOp, userOpHash, missingAccountFunds)++`]
  251. * {xref-Account-_validateUserOp-struct-PackedUserOperation-bytes32-}[`++_validateUserOp(userOp, userOpHash)++`]
  252. * {xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-}[`++_signableUserOpHash(, userOpHash)++`]
  253. * {xref-Account-_payPrefund-uint256-}[`++_payPrefund(missingAccountFunds)++`]
  254. * {xref-Account-_checkEntryPoint--}[`++_checkEntryPoint()++`]
  255. * {xref-Account-_checkEntryPointOrSelf--}[`++_checkEntryPointOrSelf()++`]
  256. * {xref-Account-receive--}[`++receive()++`]
  257. [.contract-subindex-inherited]
  258. .IAccount
  259. [.contract-subindex-inherited]
  260. .AbstractSigner
  261. * {xref-AbstractSigner-_rawSignatureValidation-bytes32-bytes-}[`++_rawSignatureValidation(hash, signature)++`]
  262. --
  263. [.contract-index]
  264. .Errors
  265. --
  266. * {xref-Account-AccountUnauthorized-address-}[`++AccountUnauthorized(sender)++`]
  267. [.contract-subindex-inherited]
  268. .IAccount
  269. [.contract-subindex-inherited]
  270. .AbstractSigner
  271. --
  272. [.contract-item]
  273. [[Account-onlyEntryPointOrSelf--]]
  274. ==== `[.contract-item-name]#++onlyEntryPointOrSelf++#++()++` [.item-kind]#modifier#
  275. Revert if the caller is not the entry point or the account itself.
  276. [.contract-item]
  277. [[Account-onlyEntryPoint--]]
  278. ==== `[.contract-item-name]#++onlyEntryPoint++#++()++` [.item-kind]#modifier#
  279. Revert if the caller is not the entry point.
  280. [.contract-item]
  281. [[Account-entryPoint--]]
  282. ==== `[.contract-item-name]#++entryPoint++#++() → contract IEntryPoint++` [.item-kind]#public#
  283. Canonical entry point for the account that forwards and validates user operations.
  284. [.contract-item]
  285. [[Account-getNonce--]]
  286. ==== `[.contract-item-name]#++getNonce++#++() → uint256++` [.item-kind]#public#
  287. Return the account nonce for the canonical sequence.
  288. [.contract-item]
  289. [[Account-getNonce-uint192-]]
  290. ==== `[.contract-item-name]#++getNonce++#++(uint192 key) → uint256++` [.item-kind]#public#
  291. Return the account nonce for a given sequence (key).
  292. [.contract-item]
  293. [[Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-]]
  294. ==== `[.contract-item-name]#++validateUserOp++#++(struct PackedUserOperation userOp, bytes32 userOpHash, uint256 missingAccountFunds) → uint256++` [.item-kind]#public#
  295. Validates a user operation.
  296. * MUST validate the caller is a trusted EntryPoint
  297. * MUST validate that the signature is a valid signature of the userOpHash, and SHOULD
  298. return SIG_VALIDATION_FAILED (and not revert) on signature mismatch. Any other error MUST revert.
  299. * MUST pay the entryPoint (caller) at least the “missingAccountFunds” (which might
  300. be zero, in case the current account’s deposit is high enough)
  301. Returns an encoded packed validation data that is composed of the following elements:
  302. - `authorizer` (`address`): 0 for success, 1 for failure, otherwise the address of an authorizer contract
  303. - `validUntil` (`uint48`): The UserOp is valid only up to this time. Zero for “infinite”.
  304. - `validAfter` (`uint48`): The UserOp is valid only after this time.
  305. [.contract-item]
  306. [[Account-_validateUserOp-struct-PackedUserOperation-bytes32-]]
  307. ==== `[.contract-item-name]#++_validateUserOp++#++(struct PackedUserOperation userOp, bytes32 userOpHash) → uint256++` [.item-kind]#internal#
  308. Returns the validationData for a given user operation. By default, this checks the signature of the
  309. signable hash (produced by {_signableUserOpHash}) using the abstract signer ({AbstractSigner-_rawSignatureValidation}).
  310. NOTE: The userOpHash is assumed to be correct. Calling this function with a userOpHash that does not match the
  311. userOp will result in undefined behavior.
  312. [.contract-item]
  313. [[Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-]]
  314. ==== `[.contract-item-name]#++_signableUserOpHash++#++(struct PackedUserOperation, bytes32 userOpHash) → bytes32++` [.item-kind]#internal#
  315. Virtual function that returns the signable hash for a user operations. Since v0.8.0 of the entrypoint,
  316. `userOpHash` is an EIP-712 hash that can be signed directly.
  317. [.contract-item]
  318. [[Account-_payPrefund-uint256-]]
  319. ==== `[.contract-item-name]#++_payPrefund++#++(uint256 missingAccountFunds)++` [.item-kind]#internal#
  320. Sends the missing funds for executing the user operation to the {entrypoint}.
  321. The `missingAccountFunds` must be defined by the entrypoint when calling {validateUserOp}.
  322. [.contract-item]
  323. [[Account-_checkEntryPoint--]]
  324. ==== `[.contract-item-name]#++_checkEntryPoint++#++()++` [.item-kind]#internal#
  325. Ensures the caller is the {entrypoint}.
  326. [.contract-item]
  327. [[Account-_checkEntryPointOrSelf--]]
  328. ==== `[.contract-item-name]#++_checkEntryPointOrSelf++#++()++` [.item-kind]#internal#
  329. Ensures the caller is the {entrypoint} or the account itself.
  330. [.contract-item]
  331. [[Account-receive--]]
  332. ==== `[.contract-item-name]#++receive++#++()++` [.item-kind]#external#
  333. Receive Ether.
  334. [.contract-item]
  335. [[Account-AccountUnauthorized-address-]]
  336. ==== `[.contract-item-name]#++AccountUnauthorized++#++(address sender)++` [.item-kind]#error#
  337. Unauthorized call to the account.
  338. == Extensions
  339. :ERC7579MissingFallbackHandler: pass:normal[xref:#AccountERC7579-ERC7579MissingFallbackHandler-bytes4-[`++ERC7579MissingFallbackHandler++`]]
  340. :onlyModule: pass:normal[xref:#AccountERC7579-onlyModule-uint256-bytes-[`++onlyModule++`]]
  341. :fallback: pass:normal[xref:#AccountERC7579-fallback-bytes-[`++fallback++`]]
  342. :accountId: pass:normal[xref:#AccountERC7579-accountId--[`++accountId++`]]
  343. :supportsExecutionMode: pass:normal[xref:#AccountERC7579-supportsExecutionMode-bytes32-[`++supportsExecutionMode++`]]
  344. :supportsModule: pass:normal[xref:#AccountERC7579-supportsModule-uint256-[`++supportsModule++`]]
  345. :installModule: pass:normal[xref:#AccountERC7579-installModule-uint256-address-bytes-[`++installModule++`]]
  346. :uninstallModule: pass:normal[xref:#AccountERC7579-uninstallModule-uint256-address-bytes-[`++uninstallModule++`]]
  347. :isModuleInstalled: pass:normal[xref:#AccountERC7579-isModuleInstalled-uint256-address-bytes-[`++isModuleInstalled++`]]
  348. :execute: pass:normal[xref:#AccountERC7579-execute-bytes32-bytes-[`++execute++`]]
  349. :executeFromExecutor: pass:normal[xref:#AccountERC7579-executeFromExecutor-bytes32-bytes-[`++executeFromExecutor++`]]
  350. :isValidSignature: pass:normal[xref:#AccountERC7579-isValidSignature-bytes32-bytes-[`++isValidSignature++`]]
  351. :_validateUserOp: pass:normal[xref:#AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-[`++_validateUserOp++`]]
  352. :_execute: pass:normal[xref:#AccountERC7579-_execute-Mode-bytes-[`++_execute++`]]
  353. :_installModule: pass:normal[xref:#AccountERC7579-_installModule-uint256-address-bytes-[`++_installModule++`]]
  354. :_uninstallModule: pass:normal[xref:#AccountERC7579-_uninstallModule-uint256-address-bytes-[`++_uninstallModule++`]]
  355. :_fallback: pass:normal[xref:#AccountERC7579-_fallback--[`++_fallback++`]]
  356. :_fallbackHandler: pass:normal[xref:#AccountERC7579-_fallbackHandler-bytes4-[`++_fallbackHandler++`]]
  357. :_checkModule: pass:normal[xref:#AccountERC7579-_checkModule-uint256-address-bytes-[`++_checkModule++`]]
  358. :_extractUserOpValidator: pass:normal[xref:#AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-[`++_extractUserOpValidator++`]]
  359. :_extractSignatureValidator: pass:normal[xref:#AccountERC7579-_extractSignatureValidator-bytes-[`++_extractSignatureValidator++`]]
  360. :_decodeFallbackData: pass:normal[xref:#AccountERC7579-_decodeFallbackData-bytes-[`++_decodeFallbackData++`]]
  361. :_rawSignatureValidation: pass:normal[xref:#AccountERC7579-_rawSignatureValidation-bytes32-bytes-[`++_rawSignatureValidation++`]]
  362. :fallback-bytes: pass:normal[xref:#AccountERC7579-fallback-bytes-[`++fallback++`]]
  363. :accountId-: pass:normal[xref:#AccountERC7579-accountId--[`++accountId++`]]
  364. :supportsExecutionMode-bytes32: pass:normal[xref:#AccountERC7579-supportsExecutionMode-bytes32-[`++supportsExecutionMode++`]]
  365. :supportsModule-uint256: pass:normal[xref:#AccountERC7579-supportsModule-uint256-[`++supportsModule++`]]
  366. :installModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-installModule-uint256-address-bytes-[`++installModule++`]]
  367. :uninstallModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-uninstallModule-uint256-address-bytes-[`++uninstallModule++`]]
  368. :isModuleInstalled-uint256-address-bytes: pass:normal[xref:#AccountERC7579-isModuleInstalled-uint256-address-bytes-[`++isModuleInstalled++`]]
  369. :execute-bytes32-bytes: pass:normal[xref:#AccountERC7579-execute-bytes32-bytes-[`++execute++`]]
  370. :executeFromExecutor-bytes32-bytes: pass:normal[xref:#AccountERC7579-executeFromExecutor-bytes32-bytes-[`++executeFromExecutor++`]]
  371. :isValidSignature-bytes32-bytes: pass:normal[xref:#AccountERC7579-isValidSignature-bytes32-bytes-[`++isValidSignature++`]]
  372. :_validateUserOp-struct-PackedUserOperation-bytes32: pass:normal[xref:#AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-[`++_validateUserOp++`]]
  373. :_execute-Mode-bytes: pass:normal[xref:#AccountERC7579-_execute-Mode-bytes-[`++_execute++`]]
  374. :_installModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-_installModule-uint256-address-bytes-[`++_installModule++`]]
  375. :_uninstallModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-_uninstallModule-uint256-address-bytes-[`++_uninstallModule++`]]
  376. :_fallback-: pass:normal[xref:#AccountERC7579-_fallback--[`++_fallback++`]]
  377. :_fallbackHandler-bytes4: pass:normal[xref:#AccountERC7579-_fallbackHandler-bytes4-[`++_fallbackHandler++`]]
  378. :_checkModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-_checkModule-uint256-address-bytes-[`++_checkModule++`]]
  379. :_extractUserOpValidator-struct-PackedUserOperation: pass:normal[xref:#AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-[`++_extractUserOpValidator++`]]
  380. :_extractSignatureValidator-bytes: pass:normal[xref:#AccountERC7579-_extractSignatureValidator-bytes-[`++_extractSignatureValidator++`]]
  381. :_decodeFallbackData-bytes: pass:normal[xref:#AccountERC7579-_decodeFallbackData-bytes-[`++_decodeFallbackData++`]]
  382. :_rawSignatureValidation-bytes32-bytes: pass:normal[xref:#AccountERC7579-_rawSignatureValidation-bytes32-bytes-[`++_rawSignatureValidation++`]]
  383. [.contract]
  384. [[AccountERC7579]]
  385. === `++AccountERC7579++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/extensions/draft-AccountERC7579.sol[{github-icon},role=heading-link]
  386. [.hljs-theme-light.nopadding]
  387. ```solidity
  388. import "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";
  389. ```
  390. Extension of {Account} that implements support for ERC-7579 modules.
  391. To comply with the ERC-1271 support requirement, this contract defers signature validation to
  392. installed validator modules by calling {IERC7579Validator-isValidSignatureWithSender}.
  393. This contract does not implement validation logic for user operations since this functionality
  394. is often delegated to self-contained validation modules. Developers must install a validator module
  395. upon initialization (or any other mechanism to enable execution from the account):
  396. ```solidity
  397. contract MyAccountERC7579 is AccountERC7579, Initializable {
  398. function initializeAccount(address validator, bytes calldata validatorData) public initializer {
  399. _installModule(MODULE_TYPE_VALIDATOR, validator, validatorData);
  400. }
  401. }
  402. ```
  403. [NOTE]
  404. ====
  405. * Hook support is not included. See {AccountERC7579Hooked} for a version that hooks to execution.
  406. * Validator selection, when verifying either ERC-1271 signature or ERC-4337 UserOperation is implemented in
  407. internal virtual functions {_extractUserOpValidator} and {_extractSignatureValidator}. Both are implemented
  408. following common practices. However, this part is not standardized in ERC-7579 (or in any follow-up ERC). Some
  409. accounts may want to override these internal functions.
  410. * When combined with {ERC7739}, resolution ordering of {isValidSignature} may have an impact ({ERC7739} does not
  411. call super). Manual resolution might be necessary.
  412. * Static calls (using callType `0xfe`) are currently NOT supported.
  413. ====
  414. WARNING: Removing all validator modules will render the account inoperable, as no user operations can be validated thereafter.
  415. [.contract-index]
  416. .Modifiers
  417. --
  418. * {xref-AccountERC7579-onlyModule-uint256-bytes-}[`++onlyModule(moduleTypeId, additionalContext)++`]
  419. --
  420. [.contract-index]
  421. .Functions
  422. --
  423. * {xref-AccountERC7579-fallback-bytes-}[`++fallback()++`]
  424. * {xref-AccountERC7579-accountId--}[`++accountId()++`]
  425. * {xref-AccountERC7579-supportsExecutionMode-bytes32-}[`++supportsExecutionMode(encodedMode)++`]
  426. * {xref-AccountERC7579-supportsModule-uint256-}[`++supportsModule(moduleTypeId)++`]
  427. * {xref-AccountERC7579-installModule-uint256-address-bytes-}[`++installModule(moduleTypeId, module, initData)++`]
  428. * {xref-AccountERC7579-uninstallModule-uint256-address-bytes-}[`++uninstallModule(moduleTypeId, module, deInitData)++`]
  429. * {xref-AccountERC7579-isModuleInstalled-uint256-address-bytes-}[`++isModuleInstalled(moduleTypeId, module, additionalContext)++`]
  430. * {xref-AccountERC7579-execute-bytes32-bytes-}[`++execute(mode, executionCalldata)++`]
  431. * {xref-AccountERC7579-executeFromExecutor-bytes32-bytes-}[`++executeFromExecutor(mode, executionCalldata)++`]
  432. * {xref-AccountERC7579-isValidSignature-bytes32-bytes-}[`++isValidSignature(hash, signature)++`]
  433. * {xref-AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-}[`++_validateUserOp(userOp, userOpHash)++`]
  434. * {xref-AccountERC7579-_execute-Mode-bytes-}[`++_execute(mode, executionCalldata)++`]
  435. * {xref-AccountERC7579-_installModule-uint256-address-bytes-}[`++_installModule(moduleTypeId, module, initData)++`]
  436. * {xref-AccountERC7579-_uninstallModule-uint256-address-bytes-}[`++_uninstallModule(moduleTypeId, module, deInitData)++`]
  437. * {xref-AccountERC7579-_fallback--}[`++_fallback()++`]
  438. * {xref-AccountERC7579-_fallbackHandler-bytes4-}[`++_fallbackHandler(selector)++`]
  439. * {xref-AccountERC7579-_checkModule-uint256-address-bytes-}[`++_checkModule(moduleTypeId, module, additionalContext)++`]
  440. * {xref-AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-}[`++_extractUserOpValidator(userOp)++`]
  441. * {xref-AccountERC7579-_extractSignatureValidator-bytes-}[`++_extractSignatureValidator(signature)++`]
  442. * {xref-AccountERC7579-_decodeFallbackData-bytes-}[`++_decodeFallbackData(data)++`]
  443. * {xref-AccountERC7579-_rawSignatureValidation-bytes32-bytes-}[`++_rawSignatureValidation(, )++`]
  444. [.contract-subindex-inherited]
  445. .IERC7579ModuleConfig
  446. [.contract-subindex-inherited]
  447. .IERC7579AccountConfig
  448. [.contract-subindex-inherited]
  449. .IERC7579Execution
  450. [.contract-subindex-inherited]
  451. .IERC1271
  452. [.contract-subindex-inherited]
  453. .Account
  454. * {xref-Account-entryPoint--}[`++entryPoint()++`]
  455. * {xref-Account-getNonce--}[`++getNonce()++`]
  456. * {xref-Account-getNonce-uint192-}[`++getNonce(key)++`]
  457. * {xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-}[`++validateUserOp(userOp, userOpHash, missingAccountFunds)++`]
  458. * {xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-}[`++_signableUserOpHash(, userOpHash)++`]
  459. * {xref-Account-_payPrefund-uint256-}[`++_payPrefund(missingAccountFunds)++`]
  460. * {xref-Account-_checkEntryPoint--}[`++_checkEntryPoint()++`]
  461. * {xref-Account-_checkEntryPointOrSelf--}[`++_checkEntryPointOrSelf()++`]
  462. * {xref-Account-receive--}[`++receive()++`]
  463. [.contract-subindex-inherited]
  464. .IAccount
  465. [.contract-subindex-inherited]
  466. .AbstractSigner
  467. --
  468. [.contract-index]
  469. .Events
  470. --
  471. [.contract-subindex-inherited]
  472. .IERC7579ModuleConfig
  473. * {xref-IERC7579ModuleConfig-ModuleInstalled-uint256-address-}[`++ModuleInstalled(moduleTypeId, module)++`]
  474. * {xref-IERC7579ModuleConfig-ModuleUninstalled-uint256-address-}[`++ModuleUninstalled(moduleTypeId, module)++`]
  475. [.contract-subindex-inherited]
  476. .IERC7579AccountConfig
  477. [.contract-subindex-inherited]
  478. .IERC7579Execution
  479. [.contract-subindex-inherited]
  480. .IERC1271
  481. [.contract-subindex-inherited]
  482. .Account
  483. [.contract-subindex-inherited]
  484. .IAccount
  485. [.contract-subindex-inherited]
  486. .AbstractSigner
  487. --
  488. [.contract-index]
  489. .Errors
  490. --
  491. * {xref-AccountERC7579-ERC7579MissingFallbackHandler-bytes4-}[`++ERC7579MissingFallbackHandler(selector)++`]
  492. [.contract-subindex-inherited]
  493. .IERC7579ModuleConfig
  494. [.contract-subindex-inherited]
  495. .IERC7579AccountConfig
  496. [.contract-subindex-inherited]
  497. .IERC7579Execution
  498. [.contract-subindex-inherited]
  499. .IERC1271
  500. [.contract-subindex-inherited]
  501. .Account
  502. * {xref-Account-AccountUnauthorized-address-}[`++AccountUnauthorized(sender)++`]
  503. [.contract-subindex-inherited]
  504. .IAccount
  505. [.contract-subindex-inherited]
  506. .AbstractSigner
  507. --
  508. [.contract-item]
  509. [[AccountERC7579-onlyModule-uint256-bytes-]]
  510. ==== `[.contract-item-name]#++onlyModule++#++(uint256 moduleTypeId, bytes additionalContext)++` [.item-kind]#modifier#
  511. Modifier that checks if the caller is an installed module of the given type.
  512. [.contract-item]
  513. [[AccountERC7579-fallback-bytes-]]
  514. ==== `[.contract-item-name]#++fallback++#++(bytes) → bytes++` [.item-kind]#external#
  515. See {_fallback}.
  516. [.contract-item]
  517. [[AccountERC7579-accountId--]]
  518. ==== `[.contract-item-name]#++accountId++#++() → string++` [.item-kind]#public#
  519. Returns the account id of the smart account
  520. [.contract-item]
  521. [[AccountERC7579-supportsExecutionMode-bytes32-]]
  522. ==== `[.contract-item-name]#++supportsExecutionMode++#++(bytes32 encodedMode) → bool++` [.item-kind]#public#
  523. Supported call types:
  524. * Single (`0x00`): A single transaction execution.
  525. * Batch (`0x01`): A batch of transactions execution.
  526. * Delegate (`0xff`): A delegate call execution.
  527. Supported exec types:
  528. * Default (`0x00`): Default execution type (revert on failure).
  529. * Try (`0x01`): Try execution type (emits ERC7579TryExecuteFail on failure).
  530. [.contract-item]
  531. [[AccountERC7579-supportsModule-uint256-]]
  532. ==== `[.contract-item-name]#++supportsModule++#++(uint256 moduleTypeId) → bool++` [.item-kind]#public#
  533. Supported module types:
  534. * Validator: A module used during the validation phase to determine if a transaction is valid and
  535. should be executed on the account.
  536. * Executor: A module that can execute transactions on behalf of the smart account via a callback.
  537. * Fallback Handler: A module that can extend the fallback functionality of a smart account.
  538. [.contract-item]
  539. [[AccountERC7579-installModule-uint256-address-bytes-]]
  540. ==== `[.contract-item-name]#++installModule++#++(uint256 moduleTypeId, address module, bytes initData)++` [.item-kind]#public#
  541. Installs a Module of a certain type on the smart account
  542. [.contract-item]
  543. [[AccountERC7579-uninstallModule-uint256-address-bytes-]]
  544. ==== `[.contract-item-name]#++uninstallModule++#++(uint256 moduleTypeId, address module, bytes deInitData)++` [.item-kind]#public#
  545. Uninstalls a Module of a certain type on the smart account
  546. [.contract-item]
  547. [[AccountERC7579-isModuleInstalled-uint256-address-bytes-]]
  548. ==== `[.contract-item-name]#++isModuleInstalled++#++(uint256 moduleTypeId, address module, bytes additionalContext) → bool++` [.item-kind]#public#
  549. Returns whether a module is installed on the smart account
  550. [.contract-item]
  551. [[AccountERC7579-execute-bytes32-bytes-]]
  552. ==== `[.contract-item-name]#++execute++#++(bytes32 mode, bytes executionCalldata)++` [.item-kind]#public#
  553. Executes a transaction on behalf of the account.
  554. [.contract-item]
  555. [[AccountERC7579-executeFromExecutor-bytes32-bytes-]]
  556. ==== `[.contract-item-name]#++executeFromExecutor++#++(bytes32 mode, bytes executionCalldata) → bytes[] returnData++` [.item-kind]#public#
  557. Executes a transaction on behalf of the account.
  558. This function is intended to be called by Executor Modules
  559. [.contract-item]
  560. [[AccountERC7579-isValidSignature-bytes32-bytes-]]
  561. ==== `[.contract-item-name]#++isValidSignature++#++(bytes32 hash, bytes signature) → bytes4++` [.item-kind]#public#
  562. Implement ERC-1271 through IERC7579Validator modules. If module based validation fails, fallback to
  563. "native" validation by the abstract signer.
  564. NOTE: when combined with {ERC7739}, resolution ordering may have an impact ({ERC7739} does not call super).
  565. Manual resolution might be necessary.
  566. [.contract-item]
  567. [[AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-]]
  568. ==== `[.contract-item-name]#++_validateUserOp++#++(struct PackedUserOperation userOp, bytes32 userOpHash) → uint256++` [.item-kind]#internal#
  569. Validates a user operation with {_signableUserOpHash} and returns the validation data
  570. if the module specified by the first 20 bytes of the nonce key is installed. Falls back to
  571. {Account-_validateUserOp} otherwise.
  572. See {_extractUserOpValidator} for the module extraction logic.
  573. [.contract-item]
  574. [[AccountERC7579-_execute-Mode-bytes-]]
  575. ==== `[.contract-item-name]#++_execute++#++(Mode mode, bytes executionCalldata) → bytes[] returnData++` [.item-kind]#internal#
  576. ERC-7579 execution logic. See {supportsExecutionMode} for supported modes.
  577. Reverts if the call type is not supported.
  578. [.contract-item]
  579. [[AccountERC7579-_installModule-uint256-address-bytes-]]
  580. ==== `[.contract-item-name]#++_installModule++#++(uint256 moduleTypeId, address module, bytes initData)++` [.item-kind]#internal#
  581. Installs a module of the given type with the given initialization data.
  582. For the fallback module type, the `initData` is expected to be the (packed) concatenation of a 4-byte
  583. selector and the rest of the data to be sent to the handler when calling {IERC7579Module-onInstall}.
  584. Requirements:
  585. * Module type must be supported. See {supportsModule}. Reverts with {ERC7579Utils-ERC7579UnsupportedModuleType}.
  586. * Module must be of the given type. Reverts with {ERC7579Utils-ERC7579MismatchedModuleTypeId}.
  587. * Module must not be already installed. Reverts with {ERC7579Utils-ERC7579AlreadyInstalledModule}.
  588. Emits a {IERC7579ModuleConfig-ModuleInstalled} event.
  589. [.contract-item]
  590. [[AccountERC7579-_uninstallModule-uint256-address-bytes-]]
  591. ==== `[.contract-item-name]#++_uninstallModule++#++(uint256 moduleTypeId, address module, bytes deInitData)++` [.item-kind]#internal#
  592. Uninstalls a module of the given type with the given de-initialization data.
  593. For the fallback module type, the `deInitData` is expected to be the (packed) concatenation of a 4-byte
  594. selector and the rest of the data to be sent to the handler when calling {IERC7579Module-onUninstall}.
  595. Requirements:
  596. * Module must be already installed. Reverts with {ERC7579Utils-ERC7579UninstalledModule} otherwise.
  597. [.contract-item]
  598. [[AccountERC7579-_fallback--]]
  599. ==== `[.contract-item-name]#++_fallback++#++() → bytes++` [.item-kind]#internal#
  600. Fallback function that delegates the call to the installed handler for the given selector.
  601. Reverts with {ERC7579MissingFallbackHandler} if the handler is not installed.
  602. Calls the handler with the original `msg.sender` appended at the end of the calldata following
  603. the ERC-2771 format.
  604. [.contract-item]
  605. [[AccountERC7579-_fallbackHandler-bytes4-]]
  606. ==== `[.contract-item-name]#++_fallbackHandler++#++(bytes4 selector) → address++` [.item-kind]#internal#
  607. Returns the fallback handler for the given selector. Returns `address(0)` if not installed.
  608. [.contract-item]
  609. [[AccountERC7579-_checkModule-uint256-address-bytes-]]
  610. ==== `[.contract-item-name]#++_checkModule++#++(uint256 moduleTypeId, address module, bytes additionalContext)++` [.item-kind]#internal#
  611. Checks if the module is installed. Reverts if the module is not installed.
  612. [.contract-item]
  613. [[AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-]]
  614. ==== `[.contract-item-name]#++_extractUserOpValidator++#++(struct PackedUserOperation userOp) → address++` [.item-kind]#internal#
  615. Extracts the nonce validator from the user operation.
  616. To construct a nonce key, set nonce as follows:
  617. ```
  618. <module address (20 bytes)> | <key (4 bytes)> | <nonce (8 bytes)>
  619. ```
  620. NOTE: The default behavior of this function replicates the behavior of
  621. https://github.com/rhinestonewtf/safe7579/blob/bb29e8b1a66658790c4169e72608e27d220f79be/src/Safe7579.sol#L266[Safe adapter],
  622. https://github.com/etherspot/etherspot-prime-contracts/blob/cfcdb48c4172cea0d66038324c0bae3288aa8caa/src/modular-etherspot-wallet/wallet/ModularEtherspotWallet.sol#L227[Etherspot's Prime Account], and
  623. https://github.com/erc7579/erc7579-implementation/blob/16138d1afd4e9711f6c1425133538837bd7787b5/src/MSAAdvanced.sol#L247[ERC7579 reference implementation].
  624. This is not standardized in ERC-7579 (or in any follow-up ERC). Some accounts may want to override these internal functions.
  625. For example, https://github.com/bcnmy/nexus/blob/54f4e19baaff96081a8843672977caf712ef19f4/contracts/lib/NonceLib.sol#L17[Biconomy's Nexus]
  626. uses a similar yet incompatible approach (the validator address is also part of the nonce, but not at the same location)
  627. [.contract-item]
  628. [[AccountERC7579-_extractSignatureValidator-bytes-]]
  629. ==== `[.contract-item-name]#++_extractSignatureValidator++#++(bytes signature) → address module, bytes innerSignature++` [.item-kind]#internal#
  630. Extracts the signature validator from the signature.
  631. To construct a signature, set the first 20 bytes as the module address and the remaining bytes as the
  632. signature data:
  633. ```
  634. <module address (20 bytes)> | <signature data>
  635. ```
  636. NOTE: The default behavior of this function replicates the behavior of
  637. https://github.com/rhinestonewtf/safe7579/blob/bb29e8b1a66658790c4169e72608e27d220f79be/src/Safe7579.sol#L350[Safe adapter],
  638. https://github.com/bcnmy/nexus/blob/54f4e19baaff96081a8843672977caf712ef19f4/contracts/Nexus.sol#L239[Biconomy's Nexus],
  639. https://github.com/etherspot/etherspot-prime-contracts/blob/cfcdb48c4172cea0d66038324c0bae3288aa8caa/src/modular-etherspot-wallet/wallet/ModularEtherspotWallet.sol#L252[Etherspot's Prime Account], and
  640. https://github.com/erc7579/erc7579-implementation/blob/16138d1afd4e9711f6c1425133538837bd7787b5/src/MSAAdvanced.sol#L296[ERC7579 reference implementation].
  641. This is not standardized in ERC-7579 (or in any follow-up ERC). Some accounts may want to override these internal functions.
  642. [.contract-item]
  643. [[AccountERC7579-_decodeFallbackData-bytes-]]
  644. ==== `[.contract-item-name]#++_decodeFallbackData++#++(bytes data) → bytes4 selector, bytes remaining++` [.item-kind]#internal#
  645. Extract the function selector from initData/deInitData for MODULE_TYPE_FALLBACK
  646. NOTE: If we had calldata here, we could use calldata slice which are cheaper to manipulate and don't require
  647. actual copy. However, this would require `_installModule` to get a calldata bytes object instead of a memory
  648. bytes object. This would prevent calling `_installModule` from a contract constructor and would force the use
  649. of external initializers. That may change in the future, as most accounts will probably be deployed as
  650. clones/proxy/ERC-7702 delegates and therefore rely on initializers anyway.
  651. [.contract-item]
  652. [[AccountERC7579-_rawSignatureValidation-bytes32-bytes-]]
  653. ==== `[.contract-item-name]#++_rawSignatureValidation++#++(bytes32, bytes) → bool++` [.item-kind]#internal#
  654. By default, only use the modules for validation of userOp and signature. Disable raw signatures.
  655. [.contract-item]
  656. [[AccountERC7579-ERC7579MissingFallbackHandler-bytes4-]]
  657. ==== `[.contract-item-name]#++ERC7579MissingFallbackHandler++#++(bytes4 selector)++` [.item-kind]#error#
  658. The account's {fallback} was called with a selector that doesn't have an installed handler.
  659. :ERC7579HookModuleAlreadyPresent: pass:normal[xref:#AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-[`++ERC7579HookModuleAlreadyPresent++`]]
  660. :withHook: pass:normal[xref:#AccountERC7579Hooked-withHook--[`++withHook++`]]
  661. :accountId: pass:normal[xref:#AccountERC7579Hooked-accountId--[`++accountId++`]]
  662. :hook: pass:normal[xref:#AccountERC7579Hooked-hook--[`++hook++`]]
  663. :supportsModule: pass:normal[xref:#AccountERC7579Hooked-supportsModule-uint256-[`++supportsModule++`]]
  664. :isModuleInstalled: pass:normal[xref:#AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-[`++isModuleInstalled++`]]
  665. :_installModule: pass:normal[xref:#AccountERC7579Hooked-_installModule-uint256-address-bytes-[`++_installModule++`]]
  666. :_uninstallModule: pass:normal[xref:#AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-[`++_uninstallModule++`]]
  667. :_execute: pass:normal[xref:#AccountERC7579Hooked-_execute-Mode-bytes-[`++_execute++`]]
  668. :_fallback: pass:normal[xref:#AccountERC7579Hooked-_fallback--[`++_fallback++`]]
  669. :accountId-: pass:normal[xref:#AccountERC7579Hooked-accountId--[`++accountId++`]]
  670. :hook-: pass:normal[xref:#AccountERC7579Hooked-hook--[`++hook++`]]
  671. :supportsModule-uint256: pass:normal[xref:#AccountERC7579Hooked-supportsModule-uint256-[`++supportsModule++`]]
  672. :isModuleInstalled-uint256-address-bytes: pass:normal[xref:#AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-[`++isModuleInstalled++`]]
  673. :_installModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579Hooked-_installModule-uint256-address-bytes-[`++_installModule++`]]
  674. :_uninstallModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-[`++_uninstallModule++`]]
  675. :_execute-Mode-bytes: pass:normal[xref:#AccountERC7579Hooked-_execute-Mode-bytes-[`++_execute++`]]
  676. :_fallback-: pass:normal[xref:#AccountERC7579Hooked-_fallback--[`++_fallback++`]]
  677. [.contract]
  678. [[AccountERC7579Hooked]]
  679. === `++AccountERC7579Hooked++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/extensions/draft-AccountERC7579Hooked.sol[{github-icon},role=heading-link]
  680. [.hljs-theme-light.nopadding]
  681. ```solidity
  682. import "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";
  683. ```
  684. Extension of {AccountERC7579} with support for a single hook module (type 4).
  685. If installed, this extension will call the hook module's {IERC7579Hook-preCheck} before executing any operation
  686. with {_execute} (including {execute} and {executeFromExecutor} by default) and {IERC7579Hook-postCheck} thereafter.
  687. NOTE: Hook modules break the check-effect-interaction pattern. In particular, the {IERC7579Hook-preCheck} hook can
  688. lead to potentially dangerous reentrancy. Using the `withHook()` modifier is safe if no effect is performed
  689. before the preHook or after the postHook. That is the case on all functions here, but it may not be the case if
  690. functions that have this modifier are overridden. Developers should be extremely careful when implementing hook
  691. modules or further overriding functions that involve hooks.
  692. [.contract-index]
  693. .Modifiers
  694. --
  695. * {xref-AccountERC7579Hooked-withHook--}[`++withHook()++`]
  696. --
  697. [.contract-index]
  698. .Functions
  699. --
  700. * {xref-AccountERC7579Hooked-accountId--}[`++accountId()++`]
  701. * {xref-AccountERC7579Hooked-hook--}[`++hook()++`]
  702. * {xref-AccountERC7579Hooked-supportsModule-uint256-}[`++supportsModule(moduleTypeId)++`]
  703. * {xref-AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-}[`++isModuleInstalled(moduleTypeId, module, data)++`]
  704. * {xref-AccountERC7579Hooked-_installModule-uint256-address-bytes-}[`++_installModule(moduleTypeId, module, initData)++`]
  705. * {xref-AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-}[`++_uninstallModule(moduleTypeId, module, deInitData)++`]
  706. * {xref-AccountERC7579Hooked-_execute-Mode-bytes-}[`++_execute(mode, executionCalldata)++`]
  707. * {xref-AccountERC7579Hooked-_fallback--}[`++_fallback()++`]
  708. [.contract-subindex-inherited]
  709. .AccountERC7579
  710. * {xref-AccountERC7579-fallback-bytes-}[`++fallback()++`]
  711. * {xref-AccountERC7579-supportsExecutionMode-bytes32-}[`++supportsExecutionMode(encodedMode)++`]
  712. * {xref-AccountERC7579-installModule-uint256-address-bytes-}[`++installModule(moduleTypeId, module, initData)++`]
  713. * {xref-AccountERC7579-uninstallModule-uint256-address-bytes-}[`++uninstallModule(moduleTypeId, module, deInitData)++`]
  714. * {xref-AccountERC7579-execute-bytes32-bytes-}[`++execute(mode, executionCalldata)++`]
  715. * {xref-AccountERC7579-executeFromExecutor-bytes32-bytes-}[`++executeFromExecutor(mode, executionCalldata)++`]
  716. * {xref-AccountERC7579-isValidSignature-bytes32-bytes-}[`++isValidSignature(hash, signature)++`]
  717. * {xref-AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-}[`++_validateUserOp(userOp, userOpHash)++`]
  718. * {xref-AccountERC7579-_fallbackHandler-bytes4-}[`++_fallbackHandler(selector)++`]
  719. * {xref-AccountERC7579-_checkModule-uint256-address-bytes-}[`++_checkModule(moduleTypeId, module, additionalContext)++`]
  720. * {xref-AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-}[`++_extractUserOpValidator(userOp)++`]
  721. * {xref-AccountERC7579-_extractSignatureValidator-bytes-}[`++_extractSignatureValidator(signature)++`]
  722. * {xref-AccountERC7579-_decodeFallbackData-bytes-}[`++_decodeFallbackData(data)++`]
  723. * {xref-AccountERC7579-_rawSignatureValidation-bytes32-bytes-}[`++_rawSignatureValidation(, )++`]
  724. [.contract-subindex-inherited]
  725. .IERC7579ModuleConfig
  726. [.contract-subindex-inherited]
  727. .IERC7579AccountConfig
  728. [.contract-subindex-inherited]
  729. .IERC7579Execution
  730. [.contract-subindex-inherited]
  731. .IERC1271
  732. [.contract-subindex-inherited]
  733. .Account
  734. * {xref-Account-entryPoint--}[`++entryPoint()++`]
  735. * {xref-Account-getNonce--}[`++getNonce()++`]
  736. * {xref-Account-getNonce-uint192-}[`++getNonce(key)++`]
  737. * {xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-}[`++validateUserOp(userOp, userOpHash, missingAccountFunds)++`]
  738. * {xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-}[`++_signableUserOpHash(, userOpHash)++`]
  739. * {xref-Account-_payPrefund-uint256-}[`++_payPrefund(missingAccountFunds)++`]
  740. * {xref-Account-_checkEntryPoint--}[`++_checkEntryPoint()++`]
  741. * {xref-Account-_checkEntryPointOrSelf--}[`++_checkEntryPointOrSelf()++`]
  742. * {xref-Account-receive--}[`++receive()++`]
  743. [.contract-subindex-inherited]
  744. .IAccount
  745. [.contract-subindex-inherited]
  746. .AbstractSigner
  747. --
  748. [.contract-index]
  749. .Events
  750. --
  751. [.contract-subindex-inherited]
  752. .AccountERC7579
  753. [.contract-subindex-inherited]
  754. .IERC7579ModuleConfig
  755. * {xref-IERC7579ModuleConfig-ModuleInstalled-uint256-address-}[`++ModuleInstalled(moduleTypeId, module)++`]
  756. * {xref-IERC7579ModuleConfig-ModuleUninstalled-uint256-address-}[`++ModuleUninstalled(moduleTypeId, module)++`]
  757. [.contract-subindex-inherited]
  758. .IERC7579AccountConfig
  759. [.contract-subindex-inherited]
  760. .IERC7579Execution
  761. [.contract-subindex-inherited]
  762. .IERC1271
  763. [.contract-subindex-inherited]
  764. .Account
  765. [.contract-subindex-inherited]
  766. .IAccount
  767. [.contract-subindex-inherited]
  768. .AbstractSigner
  769. --
  770. [.contract-index]
  771. .Errors
  772. --
  773. * {xref-AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-}[`++ERC7579HookModuleAlreadyPresent(hook)++`]
  774. [.contract-subindex-inherited]
  775. .AccountERC7579
  776. * {xref-AccountERC7579-ERC7579MissingFallbackHandler-bytes4-}[`++ERC7579MissingFallbackHandler(selector)++`]
  777. [.contract-subindex-inherited]
  778. .IERC7579ModuleConfig
  779. [.contract-subindex-inherited]
  780. .IERC7579AccountConfig
  781. [.contract-subindex-inherited]
  782. .IERC7579Execution
  783. [.contract-subindex-inherited]
  784. .IERC1271
  785. [.contract-subindex-inherited]
  786. .Account
  787. * {xref-Account-AccountUnauthorized-address-}[`++AccountUnauthorized(sender)++`]
  788. [.contract-subindex-inherited]
  789. .IAccount
  790. [.contract-subindex-inherited]
  791. .AbstractSigner
  792. --
  793. [.contract-item]
  794. [[AccountERC7579Hooked-withHook--]]
  795. ==== `[.contract-item-name]#++withHook++#++()++` [.item-kind]#modifier#
  796. Calls {IERC7579Hook-preCheck} before executing the modified function and {IERC7579Hook-postCheck}
  797. thereafter.
  798. [.contract-item]
  799. [[AccountERC7579Hooked-accountId--]]
  800. ==== `[.contract-item-name]#++accountId++#++() → string++` [.item-kind]#public#
  801. Returns the account id of the smart account
  802. [.contract-item]
  803. [[AccountERC7579Hooked-hook--]]
  804. ==== `[.contract-item-name]#++hook++#++() → address++` [.item-kind]#public#
  805. Returns the hook module address if installed, or `address(0)` otherwise.
  806. [.contract-item]
  807. [[AccountERC7579Hooked-supportsModule-uint256-]]
  808. ==== `[.contract-item-name]#++supportsModule++#++(uint256 moduleTypeId) → bool++` [.item-kind]#public#
  809. Supports hook modules. See {AccountERC7579-supportsModule}
  810. [.contract-item]
  811. [[AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-]]
  812. ==== `[.contract-item-name]#++isModuleInstalled++#++(uint256 moduleTypeId, address module, bytes data) → bool++` [.item-kind]#public#
  813. Returns whether a module is installed on the smart account
  814. [.contract-item]
  815. [[AccountERC7579Hooked-_installModule-uint256-address-bytes-]]
  816. ==== `[.contract-item-name]#++_installModule++#++(uint256 moduleTypeId, address module, bytes initData)++` [.item-kind]#internal#
  817. Installs a module with support for hook modules. See {AccountERC7579-_installModule}
  818. [.contract-item]
  819. [[AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-]]
  820. ==== `[.contract-item-name]#++_uninstallModule++#++(uint256 moduleTypeId, address module, bytes deInitData)++` [.item-kind]#internal#
  821. Uninstalls a module with support for hook modules. See {AccountERC7579-_uninstallModule}
  822. [.contract-item]
  823. [[AccountERC7579Hooked-_execute-Mode-bytes-]]
  824. ==== `[.contract-item-name]#++_execute++#++(Mode mode, bytes executionCalldata) → bytes[]++` [.item-kind]#internal#
  825. Hooked version of {AccountERC7579-_execute}.
  826. [.contract-item]
  827. [[AccountERC7579Hooked-_fallback--]]
  828. ==== `[.contract-item-name]#++_fallback++#++() → bytes++` [.item-kind]#internal#
  829. Hooked version of {AccountERC7579-_fallback}.
  830. [.contract-item]
  831. [[AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-]]
  832. ==== `[.contract-item-name]#++ERC7579HookModuleAlreadyPresent++#++(address hook)++` [.item-kind]#error#
  833. A hook module is already present. This contract only supports one hook module.
  834. :UnsupportedExecutionMode: pass:normal[xref:#ERC7821-UnsupportedExecutionMode--[`++UnsupportedExecutionMode++`]]
  835. :execute: pass:normal[xref:#ERC7821-execute-bytes32-bytes-[`++execute++`]]
  836. :supportsExecutionMode: pass:normal[xref:#ERC7821-supportsExecutionMode-bytes32-[`++supportsExecutionMode++`]]
  837. :_erc7821AuthorizedExecutor: pass:normal[xref:#ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-[`++_erc7821AuthorizedExecutor++`]]
  838. :execute-bytes32-bytes: pass:normal[xref:#ERC7821-execute-bytes32-bytes-[`++execute++`]]
  839. :supportsExecutionMode-bytes32: pass:normal[xref:#ERC7821-supportsExecutionMode-bytes32-[`++supportsExecutionMode++`]]
  840. :_erc7821AuthorizedExecutor-address-bytes32-bytes: pass:normal[xref:#ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-[`++_erc7821AuthorizedExecutor++`]]
  841. [.contract]
  842. [[ERC7821]]
  843. === `++ERC7821++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/extensions/draft-ERC7821.sol[{github-icon},role=heading-link]
  844. [.hljs-theme-light.nopadding]
  845. ```solidity
  846. import "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";
  847. ```
  848. Minimal batch executor following ERC-7821.
  849. Only supports supports single batch mode (`0x01000000000000000000`). Does not support optional "opData".
  850. @custom:stateless
  851. [.contract-index]
  852. .Functions
  853. --
  854. * {xref-ERC7821-execute-bytes32-bytes-}[`++execute(mode, executionData)++`]
  855. * {xref-ERC7821-supportsExecutionMode-bytes32-}[`++supportsExecutionMode(mode)++`]
  856. * {xref-ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-}[`++_erc7821AuthorizedExecutor(caller, , )++`]
  857. [.contract-subindex-inherited]
  858. .IERC7821
  859. --
  860. [.contract-index]
  861. .Errors
  862. --
  863. * {xref-ERC7821-UnsupportedExecutionMode--}[`++UnsupportedExecutionMode()++`]
  864. [.contract-subindex-inherited]
  865. .IERC7821
  866. --
  867. [.contract-item]
  868. [[ERC7821-execute-bytes32-bytes-]]
  869. ==== `[.contract-item-name]#++execute++#++(bytes32 mode, bytes executionData)++` [.item-kind]#public#
  870. Executes the calls in `executionData` with no optional `opData` support.
  871. NOTE: Access to this function is controlled by {_erc7821AuthorizedExecutor}. Changing access permissions, for
  872. example to approve calls by the ERC-4337 entrypoint, should be implemented by overriding it.
  873. Reverts and bubbles up error if any call fails.
  874. [.contract-item]
  875. [[ERC7821-supportsExecutionMode-bytes32-]]
  876. ==== `[.contract-item-name]#++supportsExecutionMode++#++(bytes32 mode) → bool result++` [.item-kind]#public#
  877. This function is provided for frontends to detect support.
  878. Only returns true for:
  879. - `bytes32(0x01000000000000000000...)`: does not support optional `opData`.
  880. - `bytes32(0x01000000000078210001...)`: supports optional `opData`.
  881. [.contract-item]
  882. [[ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-]]
  883. ==== `[.contract-item-name]#++_erc7821AuthorizedExecutor++#++(address caller, bytes32, bytes) → bool++` [.item-kind]#internal#
  884. Access control mechanism for the {execute} function.
  885. By default, only the contract itself is allowed to execute.
  886. Override this function to implement custom access control, for example to allow the
  887. ERC-4337 entrypoint to execute.
  888. ```solidity
  889. function _erc7821AuthorizedExecutor(
  890. address caller,
  891. bytes32 mode,
  892. bytes calldata executionData
  893. ) internal view virtual override returns (bool) {
  894. return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);
  895. }
  896. ```
  897. [.contract-item]
  898. [[ERC7821-UnsupportedExecutionMode--]]
  899. ==== `[.contract-item-name]#++UnsupportedExecutionMode++#++()++` [.item-kind]#error#
  900. == Utilities
  901. :ENTRYPOINT_V07: pass:normal[xref:#ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint[`++ENTRYPOINT_V07++`]]
  902. :ENTRYPOINT_V08: pass:normal[xref:#ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint[`++ENTRYPOINT_V08++`]]
  903. :SIG_VALIDATION_SUCCESS: pass:normal[xref:#ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256[`++SIG_VALIDATION_SUCCESS++`]]
  904. :SIG_VALIDATION_FAILED: pass:normal[xref:#ERC4337Utils-SIG_VALIDATION_FAILED-uint256[`++SIG_VALIDATION_FAILED++`]]
  905. :parseValidationData: pass:normal[xref:#ERC4337Utils-parseValidationData-uint256-[`++parseValidationData++`]]
  906. :packValidationData: pass:normal[xref:#ERC4337Utils-packValidationData-address-uint48-uint48-[`++packValidationData++`]]
  907. :packValidationData: pass:normal[xref:#ERC4337Utils-packValidationData-bool-uint48-uint48-[`++packValidationData++`]]
  908. :combineValidationData: pass:normal[xref:#ERC4337Utils-combineValidationData-uint256-uint256-[`++combineValidationData++`]]
  909. :getValidationData: pass:normal[xref:#ERC4337Utils-getValidationData-uint256-[`++getValidationData++`]]
  910. :hash: pass:normal[xref:#ERC4337Utils-hash-struct-PackedUserOperation-address-[`++hash++`]]
  911. :factory: pass:normal[xref:#ERC4337Utils-factory-struct-PackedUserOperation-[`++factory++`]]
  912. :factoryData: pass:normal[xref:#ERC4337Utils-factoryData-struct-PackedUserOperation-[`++factoryData++`]]
  913. :verificationGasLimit: pass:normal[xref:#ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-[`++verificationGasLimit++`]]
  914. :callGasLimit: pass:normal[xref:#ERC4337Utils-callGasLimit-struct-PackedUserOperation-[`++callGasLimit++`]]
  915. :maxPriorityFeePerGas: pass:normal[xref:#ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-[`++maxPriorityFeePerGas++`]]
  916. :maxFeePerGas: pass:normal[xref:#ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-[`++maxFeePerGas++`]]
  917. :gasPrice: pass:normal[xref:#ERC4337Utils-gasPrice-struct-PackedUserOperation-[`++gasPrice++`]]
  918. :paymaster: pass:normal[xref:#ERC4337Utils-paymaster-struct-PackedUserOperation-[`++paymaster++`]]
  919. :paymasterVerificationGasLimit: pass:normal[xref:#ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-[`++paymasterVerificationGasLimit++`]]
  920. :paymasterPostOpGasLimit: pass:normal[xref:#ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-[`++paymasterPostOpGasLimit++`]]
  921. :paymasterData: pass:normal[xref:#ERC4337Utils-paymasterData-struct-PackedUserOperation-[`++paymasterData++`]]
  922. :parseValidationData-uint256: pass:normal[xref:#ERC4337Utils-parseValidationData-uint256-[`++parseValidationData++`]]
  923. :packValidationData-address-uint48-uint48: pass:normal[xref:#ERC4337Utils-packValidationData-address-uint48-uint48-[`++packValidationData++`]]
  924. :packValidationData-bool-uint48-uint48: pass:normal[xref:#ERC4337Utils-packValidationData-bool-uint48-uint48-[`++packValidationData++`]]
  925. :combineValidationData-uint256-uint256: pass:normal[xref:#ERC4337Utils-combineValidationData-uint256-uint256-[`++combineValidationData++`]]
  926. :getValidationData-uint256: pass:normal[xref:#ERC4337Utils-getValidationData-uint256-[`++getValidationData++`]]
  927. :hash-struct-PackedUserOperation-address: pass:normal[xref:#ERC4337Utils-hash-struct-PackedUserOperation-address-[`++hash++`]]
  928. :factory-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-factory-struct-PackedUserOperation-[`++factory++`]]
  929. :factoryData-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-factoryData-struct-PackedUserOperation-[`++factoryData++`]]
  930. :verificationGasLimit-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-[`++verificationGasLimit++`]]
  931. :callGasLimit-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-callGasLimit-struct-PackedUserOperation-[`++callGasLimit++`]]
  932. :maxPriorityFeePerGas-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-[`++maxPriorityFeePerGas++`]]
  933. :maxFeePerGas-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-[`++maxFeePerGas++`]]
  934. :gasPrice-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-gasPrice-struct-PackedUserOperation-[`++gasPrice++`]]
  935. :paymaster-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-paymaster-struct-PackedUserOperation-[`++paymaster++`]]
  936. :paymasterVerificationGasLimit-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-[`++paymasterVerificationGasLimit++`]]
  937. :paymasterPostOpGasLimit-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-[`++paymasterPostOpGasLimit++`]]
  938. :paymasterData-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-paymasterData-struct-PackedUserOperation-[`++paymasterData++`]]
  939. [.contract]
  940. [[ERC4337Utils]]
  941. === `++ERC4337Utils++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/utils/draft-ERC4337Utils.sol[{github-icon},role=heading-link]
  942. [.hljs-theme-light.nopadding]
  943. ```solidity
  944. import "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol";
  945. ```
  946. Library with common ERC-4337 utility functions.
  947. See https://eips.ethereum.org/EIPS/eip-4337[ERC-4337].
  948. [.contract-index]
  949. .Functions
  950. --
  951. * {xref-ERC4337Utils-parseValidationData-uint256-}[`++parseValidationData(validationData)++`]
  952. * {xref-ERC4337Utils-packValidationData-address-uint48-uint48-}[`++packValidationData(aggregator, validAfter, validUntil)++`]
  953. * {xref-ERC4337Utils-packValidationData-bool-uint48-uint48-}[`++packValidationData(sigSuccess, validAfter, validUntil)++`]
  954. * {xref-ERC4337Utils-combineValidationData-uint256-uint256-}[`++combineValidationData(validationData1, validationData2)++`]
  955. * {xref-ERC4337Utils-getValidationData-uint256-}[`++getValidationData(validationData)++`]
  956. * {xref-ERC4337Utils-hash-struct-PackedUserOperation-address-}[`++hash(self, entrypoint)++`]
  957. * {xref-ERC4337Utils-factory-struct-PackedUserOperation-}[`++factory(self)++`]
  958. * {xref-ERC4337Utils-factoryData-struct-PackedUserOperation-}[`++factoryData(self)++`]
  959. * {xref-ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-}[`++verificationGasLimit(self)++`]
  960. * {xref-ERC4337Utils-callGasLimit-struct-PackedUserOperation-}[`++callGasLimit(self)++`]
  961. * {xref-ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-}[`++maxPriorityFeePerGas(self)++`]
  962. * {xref-ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-}[`++maxFeePerGas(self)++`]
  963. * {xref-ERC4337Utils-gasPrice-struct-PackedUserOperation-}[`++gasPrice(self)++`]
  964. * {xref-ERC4337Utils-paymaster-struct-PackedUserOperation-}[`++paymaster(self)++`]
  965. * {xref-ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-}[`++paymasterVerificationGasLimit(self)++`]
  966. * {xref-ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-}[`++paymasterPostOpGasLimit(self)++`]
  967. * {xref-ERC4337Utils-paymasterData-struct-PackedUserOperation-}[`++paymasterData(self)++`]
  968. --
  969. [.contract-index]
  970. .Internal Variables
  971. --
  972. * {xref-ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint}[`++contract IEntryPoint constant ENTRYPOINT_V07++`]
  973. * {xref-ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint}[`++contract IEntryPoint constant ENTRYPOINT_V08++`]
  974. * {xref-ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256}[`++uint256 constant SIG_VALIDATION_SUCCESS++`]
  975. * {xref-ERC4337Utils-SIG_VALIDATION_FAILED-uint256}[`++uint256 constant SIG_VALIDATION_FAILED++`]
  976. --
  977. [.contract-item]
  978. [[ERC4337Utils-parseValidationData-uint256-]]
  979. ==== `[.contract-item-name]#++parseValidationData++#++(uint256 validationData) → address aggregator, uint48 validAfter, uint48 validUntil++` [.item-kind]#internal#
  980. Parses the validation data into its components. See {packValidationData}.
  981. [.contract-item]
  982. [[ERC4337Utils-packValidationData-address-uint48-uint48-]]
  983. ==== `[.contract-item-name]#++packValidationData++#++(address aggregator, uint48 validAfter, uint48 validUntil) → uint256++` [.item-kind]#internal#
  984. Packs the validation data into a single uint256. See {parseValidationData}.
  985. [.contract-item]
  986. [[ERC4337Utils-packValidationData-bool-uint48-uint48-]]
  987. ==== `[.contract-item-name]#++packValidationData++#++(bool sigSuccess, uint48 validAfter, uint48 validUntil) → uint256++` [.item-kind]#internal#
  988. Same as {packValidationData}, but with a boolean signature success flag.
  989. [.contract-item]
  990. [[ERC4337Utils-combineValidationData-uint256-uint256-]]
  991. ==== `[.contract-item-name]#++combineValidationData++#++(uint256 validationData1, uint256 validationData2) → uint256++` [.item-kind]#internal#
  992. Combines two validation data into a single one.
  993. The `aggregator` is set to {SIG_VALIDATION_SUCCESS} if both are successful, while
  994. the `validAfter` is the maximum and the `validUntil` is the minimum of both.
  995. [.contract-item]
  996. [[ERC4337Utils-getValidationData-uint256-]]
  997. ==== `[.contract-item-name]#++getValidationData++#++(uint256 validationData) → address aggregator, bool outOfTimeRange++` [.item-kind]#internal#
  998. Returns the aggregator of the `validationData` and whether it is out of time range.
  999. [.contract-item]
  1000. [[ERC4337Utils-hash-struct-PackedUserOperation-address-]]
  1001. ==== `[.contract-item-name]#++hash++#++(struct PackedUserOperation self, address entrypoint) → bytes32++` [.item-kind]#internal#
  1002. Get the hash of a user operation for a given entrypoint
  1003. [.contract-item]
  1004. [[ERC4337Utils-factory-struct-PackedUserOperation-]]
  1005. ==== `[.contract-item-name]#++factory++#++(struct PackedUserOperation self) → address++` [.item-kind]#internal#
  1006. Returns `factory` from the {PackedUserOperation}, or address(0) if the initCode is empty or not properly formatted.
  1007. [.contract-item]
  1008. [[ERC4337Utils-factoryData-struct-PackedUserOperation-]]
  1009. ==== `[.contract-item-name]#++factoryData++#++(struct PackedUserOperation self) → bytes++` [.item-kind]#internal#
  1010. Returns `factoryData` from the {PackedUserOperation}, or empty bytes if the initCode is empty or not properly formatted.
  1011. [.contract-item]
  1012. [[ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-]]
  1013. ==== `[.contract-item-name]#++verificationGasLimit++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
  1014. Returns `verificationGasLimit` from the {PackedUserOperation}.
  1015. [.contract-item]
  1016. [[ERC4337Utils-callGasLimit-struct-PackedUserOperation-]]
  1017. ==== `[.contract-item-name]#++callGasLimit++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
  1018. Returns `callGasLimit` from the {PackedUserOperation}.
  1019. [.contract-item]
  1020. [[ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-]]
  1021. ==== `[.contract-item-name]#++maxPriorityFeePerGas++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
  1022. Returns the first section of `gasFees` from the {PackedUserOperation}.
  1023. [.contract-item]
  1024. [[ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-]]
  1025. ==== `[.contract-item-name]#++maxFeePerGas++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
  1026. Returns the second section of `gasFees` from the {PackedUserOperation}.
  1027. [.contract-item]
  1028. [[ERC4337Utils-gasPrice-struct-PackedUserOperation-]]
  1029. ==== `[.contract-item-name]#++gasPrice++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
  1030. Returns the total gas price for the {PackedUserOperation} (ie. `maxFeePerGas` or `maxPriorityFeePerGas + basefee`).
  1031. [.contract-item]
  1032. [[ERC4337Utils-paymaster-struct-PackedUserOperation-]]
  1033. ==== `[.contract-item-name]#++paymaster++#++(struct PackedUserOperation self) → address++` [.item-kind]#internal#
  1034. Returns the first section of `paymasterAndData` from the {PackedUserOperation}.
  1035. [.contract-item]
  1036. [[ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-]]
  1037. ==== `[.contract-item-name]#++paymasterVerificationGasLimit++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
  1038. Returns the second section of `paymasterAndData` from the {PackedUserOperation}.
  1039. [.contract-item]
  1040. [[ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-]]
  1041. ==== `[.contract-item-name]#++paymasterPostOpGasLimit++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
  1042. Returns the third section of `paymasterAndData` from the {PackedUserOperation}.
  1043. [.contract-item]
  1044. [[ERC4337Utils-paymasterData-struct-PackedUserOperation-]]
  1045. ==== `[.contract-item-name]#++paymasterData++#++(struct PackedUserOperation self) → bytes++` [.item-kind]#internal#
  1046. Returns the fourth section of `paymasterAndData` from the {PackedUserOperation}.
  1047. [.contract-item]
  1048. [[ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint]]
  1049. ==== `contract IEntryPoint [.contract-item-name]#++ENTRYPOINT_V07++#` [.item-kind]#internal constant#
  1050. Address of the entrypoint v0.7.0
  1051. [.contract-item]
  1052. [[ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint]]
  1053. ==== `contract IEntryPoint [.contract-item-name]#++ENTRYPOINT_V08++#` [.item-kind]#internal constant#
  1054. Address of the entrypoint v0.8.0
  1055. [.contract-item]
  1056. [[ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256]]
  1057. ==== `uint256 [.contract-item-name]#++SIG_VALIDATION_SUCCESS++#` [.item-kind]#internal constant#
  1058. For simulation purposes, validateUserOp (and validatePaymasterUserOp) return this value on success.
  1059. [.contract-item]
  1060. [[ERC4337Utils-SIG_VALIDATION_FAILED-uint256]]
  1061. ==== `uint256 [.contract-item-name]#++SIG_VALIDATION_FAILED++#` [.item-kind]#internal constant#
  1062. For simulation purposes, validateUserOp (and validatePaymasterUserOp) must return this value in case of signature failure, instead of revert.
  1063. :CALLTYPE_SINGLE: pass:normal[xref:#ERC7579Utils-CALLTYPE_SINGLE-CallType[`++CALLTYPE_SINGLE++`]]
  1064. :CALLTYPE_BATCH: pass:normal[xref:#ERC7579Utils-CALLTYPE_BATCH-CallType[`++CALLTYPE_BATCH++`]]
  1065. :CALLTYPE_DELEGATECALL: pass:normal[xref:#ERC7579Utils-CALLTYPE_DELEGATECALL-CallType[`++CALLTYPE_DELEGATECALL++`]]
  1066. :EXECTYPE_DEFAULT: pass:normal[xref:#ERC7579Utils-EXECTYPE_DEFAULT-ExecType[`++EXECTYPE_DEFAULT++`]]
  1067. :EXECTYPE_TRY: pass:normal[xref:#ERC7579Utils-EXECTYPE_TRY-ExecType[`++EXECTYPE_TRY++`]]
  1068. :ERC7579TryExecuteFail: pass:normal[xref:#ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-[`++ERC7579TryExecuteFail++`]]
  1069. :ERC7579UnsupportedCallType: pass:normal[xref:#ERC7579Utils-ERC7579UnsupportedCallType-CallType-[`++ERC7579UnsupportedCallType++`]]
  1070. :ERC7579UnsupportedExecType: pass:normal[xref:#ERC7579Utils-ERC7579UnsupportedExecType-ExecType-[`++ERC7579UnsupportedExecType++`]]
  1071. :ERC7579MismatchedModuleTypeId: pass:normal[xref:#ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-[`++ERC7579MismatchedModuleTypeId++`]]
  1072. :ERC7579UninstalledModule: pass:normal[xref:#ERC7579Utils-ERC7579UninstalledModule-uint256-address-[`++ERC7579UninstalledModule++`]]
  1073. :ERC7579AlreadyInstalledModule: pass:normal[xref:#ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-[`++ERC7579AlreadyInstalledModule++`]]
  1074. :ERC7579UnsupportedModuleType: pass:normal[xref:#ERC7579Utils-ERC7579UnsupportedModuleType-uint256-[`++ERC7579UnsupportedModuleType++`]]
  1075. :ERC7579DecodingError: pass:normal[xref:#ERC7579Utils-ERC7579DecodingError--[`++ERC7579DecodingError++`]]
  1076. :execSingle: pass:normal[xref:#ERC7579Utils-execSingle-bytes-ExecType-[`++execSingle++`]]
  1077. :execBatch: pass:normal[xref:#ERC7579Utils-execBatch-bytes-ExecType-[`++execBatch++`]]
  1078. :execDelegateCall: pass:normal[xref:#ERC7579Utils-execDelegateCall-bytes-ExecType-[`++execDelegateCall++`]]
  1079. :encodeMode: pass:normal[xref:#ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-[`++encodeMode++`]]
  1080. :decodeMode: pass:normal[xref:#ERC7579Utils-decodeMode-Mode-[`++decodeMode++`]]
  1081. :encodeSingle: pass:normal[xref:#ERC7579Utils-encodeSingle-address-uint256-bytes-[`++encodeSingle++`]]
  1082. :decodeSingle: pass:normal[xref:#ERC7579Utils-decodeSingle-bytes-[`++decodeSingle++`]]
  1083. :encodeDelegate: pass:normal[xref:#ERC7579Utils-encodeDelegate-address-bytes-[`++encodeDelegate++`]]
  1084. :decodeDelegate: pass:normal[xref:#ERC7579Utils-decodeDelegate-bytes-[`++decodeDelegate++`]]
  1085. :encodeBatch: pass:normal[xref:#ERC7579Utils-encodeBatch-struct-Execution---[`++encodeBatch++`]]
  1086. :decodeBatch: pass:normal[xref:#ERC7579Utils-decodeBatch-bytes-[`++decodeBatch++`]]
  1087. :execSingle-bytes-ExecType: pass:normal[xref:#ERC7579Utils-execSingle-bytes-ExecType-[`++execSingle++`]]
  1088. :execBatch-bytes-ExecType: pass:normal[xref:#ERC7579Utils-execBatch-bytes-ExecType-[`++execBatch++`]]
  1089. :execDelegateCall-bytes-ExecType: pass:normal[xref:#ERC7579Utils-execDelegateCall-bytes-ExecType-[`++execDelegateCall++`]]
  1090. :encodeMode-CallType-ExecType-ModeSelector-ModePayload: pass:normal[xref:#ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-[`++encodeMode++`]]
  1091. :decodeMode-Mode: pass:normal[xref:#ERC7579Utils-decodeMode-Mode-[`++decodeMode++`]]
  1092. :encodeSingle-address-uint256-bytes: pass:normal[xref:#ERC7579Utils-encodeSingle-address-uint256-bytes-[`++encodeSingle++`]]
  1093. :decodeSingle-bytes: pass:normal[xref:#ERC7579Utils-decodeSingle-bytes-[`++decodeSingle++`]]
  1094. :encodeDelegate-address-bytes: pass:normal[xref:#ERC7579Utils-encodeDelegate-address-bytes-[`++encodeDelegate++`]]
  1095. :decodeDelegate-bytes: pass:normal[xref:#ERC7579Utils-decodeDelegate-bytes-[`++decodeDelegate++`]]
  1096. :encodeBatch-struct-Execution--: pass:normal[xref:#ERC7579Utils-encodeBatch-struct-Execution---[`++encodeBatch++`]]
  1097. :decodeBatch-bytes: pass:normal[xref:#ERC7579Utils-decodeBatch-bytes-[`++decodeBatch++`]]
  1098. [.contract]
  1099. [[ERC7579Utils]]
  1100. === `++ERC7579Utils++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/utils/draft-ERC7579Utils.sol[{github-icon},role=heading-link]
  1101. [.hljs-theme-light.nopadding]
  1102. ```solidity
  1103. import "@openzeppelin/contracts/account/utils/draft-ERC7579Utils.sol";
  1104. ```
  1105. Library with common ERC-7579 utility functions.
  1106. See https://eips.ethereum.org/EIPS/eip-7579[ERC-7579].
  1107. [.contract-index]
  1108. .Functions
  1109. --
  1110. * {xref-ERC7579Utils-execSingle-bytes-ExecType-}[`++execSingle(executionCalldata, execType)++`]
  1111. * {xref-ERC7579Utils-execBatch-bytes-ExecType-}[`++execBatch(executionCalldata, execType)++`]
  1112. * {xref-ERC7579Utils-execDelegateCall-bytes-ExecType-}[`++execDelegateCall(executionCalldata, execType)++`]
  1113. * {xref-ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-}[`++encodeMode(callType, execType, selector, payload)++`]
  1114. * {xref-ERC7579Utils-decodeMode-Mode-}[`++decodeMode(mode)++`]
  1115. * {xref-ERC7579Utils-encodeSingle-address-uint256-bytes-}[`++encodeSingle(target, value, callData)++`]
  1116. * {xref-ERC7579Utils-decodeSingle-bytes-}[`++decodeSingle(executionCalldata)++`]
  1117. * {xref-ERC7579Utils-encodeDelegate-address-bytes-}[`++encodeDelegate(target, callData)++`]
  1118. * {xref-ERC7579Utils-decodeDelegate-bytes-}[`++decodeDelegate(executionCalldata)++`]
  1119. * {xref-ERC7579Utils-encodeBatch-struct-Execution---}[`++encodeBatch(executionBatch)++`]
  1120. * {xref-ERC7579Utils-decodeBatch-bytes-}[`++decodeBatch(executionCalldata)++`]
  1121. --
  1122. [.contract-index]
  1123. .Events
  1124. --
  1125. * {xref-ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-}[`++ERC7579TryExecuteFail(batchExecutionIndex, returndata)++`]
  1126. --
  1127. [.contract-index]
  1128. .Errors
  1129. --
  1130. * {xref-ERC7579Utils-ERC7579UnsupportedCallType-CallType-}[`++ERC7579UnsupportedCallType(callType)++`]
  1131. * {xref-ERC7579Utils-ERC7579UnsupportedExecType-ExecType-}[`++ERC7579UnsupportedExecType(execType)++`]
  1132. * {xref-ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-}[`++ERC7579MismatchedModuleTypeId(moduleTypeId, module)++`]
  1133. * {xref-ERC7579Utils-ERC7579UninstalledModule-uint256-address-}[`++ERC7579UninstalledModule(moduleTypeId, module)++`]
  1134. * {xref-ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-}[`++ERC7579AlreadyInstalledModule(moduleTypeId, module)++`]
  1135. * {xref-ERC7579Utils-ERC7579UnsupportedModuleType-uint256-}[`++ERC7579UnsupportedModuleType(moduleTypeId)++`]
  1136. * {xref-ERC7579Utils-ERC7579DecodingError--}[`++ERC7579DecodingError()++`]
  1137. --
  1138. [.contract-index]
  1139. .Internal Variables
  1140. --
  1141. * {xref-ERC7579Utils-CALLTYPE_SINGLE-CallType}[`++CallType constant CALLTYPE_SINGLE++`]
  1142. * {xref-ERC7579Utils-CALLTYPE_BATCH-CallType}[`++CallType constant CALLTYPE_BATCH++`]
  1143. * {xref-ERC7579Utils-CALLTYPE_DELEGATECALL-CallType}[`++CallType constant CALLTYPE_DELEGATECALL++`]
  1144. * {xref-ERC7579Utils-EXECTYPE_DEFAULT-ExecType}[`++ExecType constant EXECTYPE_DEFAULT++`]
  1145. * {xref-ERC7579Utils-EXECTYPE_TRY-ExecType}[`++ExecType constant EXECTYPE_TRY++`]
  1146. --
  1147. [.contract-item]
  1148. [[ERC7579Utils-execSingle-bytes-ExecType-]]
  1149. ==== `[.contract-item-name]#++execSingle++#++(bytes executionCalldata, ExecType execType) → bytes[] returnData++` [.item-kind]#internal#
  1150. Executes a single call.
  1151. [.contract-item]
  1152. [[ERC7579Utils-execBatch-bytes-ExecType-]]
  1153. ==== `[.contract-item-name]#++execBatch++#++(bytes executionCalldata, ExecType execType) → bytes[] returnData++` [.item-kind]#internal#
  1154. Executes a batch of calls.
  1155. [.contract-item]
  1156. [[ERC7579Utils-execDelegateCall-bytes-ExecType-]]
  1157. ==== `[.contract-item-name]#++execDelegateCall++#++(bytes executionCalldata, ExecType execType) → bytes[] returnData++` [.item-kind]#internal#
  1158. Executes a delegate call.
  1159. [.contract-item]
  1160. [[ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-]]
  1161. ==== `[.contract-item-name]#++encodeMode++#++(CallType callType, ExecType execType, ModeSelector selector, ModePayload payload) → Mode mode++` [.item-kind]#internal#
  1162. Encodes the mode with the provided parameters. See {decodeMode}.
  1163. [.contract-item]
  1164. [[ERC7579Utils-decodeMode-Mode-]]
  1165. ==== `[.contract-item-name]#++decodeMode++#++(Mode mode) → CallType callType, ExecType execType, ModeSelector selector, ModePayload payload++` [.item-kind]#internal#
  1166. Decodes the mode into its parameters. See {encodeMode}.
  1167. [.contract-item]
  1168. [[ERC7579Utils-encodeSingle-address-uint256-bytes-]]
  1169. ==== `[.contract-item-name]#++encodeSingle++#++(address target, uint256 value, bytes callData) → bytes executionCalldata++` [.item-kind]#internal#
  1170. Encodes a single call execution. See {decodeSingle}.
  1171. [.contract-item]
  1172. [[ERC7579Utils-decodeSingle-bytes-]]
  1173. ==== `[.contract-item-name]#++decodeSingle++#++(bytes executionCalldata) → address target, uint256 value, bytes callData++` [.item-kind]#internal#
  1174. Decodes a single call execution. See {encodeSingle}.
  1175. [.contract-item]
  1176. [[ERC7579Utils-encodeDelegate-address-bytes-]]
  1177. ==== `[.contract-item-name]#++encodeDelegate++#++(address target, bytes callData) → bytes executionCalldata++` [.item-kind]#internal#
  1178. Encodes a delegate call execution. See {decodeDelegate}.
  1179. [.contract-item]
  1180. [[ERC7579Utils-decodeDelegate-bytes-]]
  1181. ==== `[.contract-item-name]#++decodeDelegate++#++(bytes executionCalldata) → address target, bytes callData++` [.item-kind]#internal#
  1182. Decodes a delegate call execution. See {encodeDelegate}.
  1183. [.contract-item]
  1184. [[ERC7579Utils-encodeBatch-struct-Execution---]]
  1185. ==== `[.contract-item-name]#++encodeBatch++#++(struct Execution[] executionBatch) → bytes executionCalldata++` [.item-kind]#internal#
  1186. Encodes a batch of executions. See {decodeBatch}.
  1187. [.contract-item]
  1188. [[ERC7579Utils-decodeBatch-bytes-]]
  1189. ==== `[.contract-item-name]#++decodeBatch++#++(bytes executionCalldata) → struct Execution[] executionBatch++` [.item-kind]#internal#
  1190. Decodes a batch of executions. See {encodeBatch}.
  1191. NOTE: This function runs some checks and will throw a {ERC7579DecodingError} if the input is not properly formatted.
  1192. [.contract-item]
  1193. [[ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-]]
  1194. ==== `[.contract-item-name]#++ERC7579TryExecuteFail++#++(uint256 batchExecutionIndex, bytes returndata)++` [.item-kind]#event#
  1195. Emits when an {EXECTYPE_TRY} execution fails.
  1196. [.contract-item]
  1197. [[ERC7579Utils-ERC7579UnsupportedCallType-CallType-]]
  1198. ==== `[.contract-item-name]#++ERC7579UnsupportedCallType++#++(CallType callType)++` [.item-kind]#error#
  1199. The provided {CallType} is not supported.
  1200. [.contract-item]
  1201. [[ERC7579Utils-ERC7579UnsupportedExecType-ExecType-]]
  1202. ==== `[.contract-item-name]#++ERC7579UnsupportedExecType++#++(ExecType execType)++` [.item-kind]#error#
  1203. The provided {ExecType} is not supported.
  1204. [.contract-item]
  1205. [[ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-]]
  1206. ==== `[.contract-item-name]#++ERC7579MismatchedModuleTypeId++#++(uint256 moduleTypeId, address module)++` [.item-kind]#error#
  1207. The provided module doesn't match the provided module type.
  1208. [.contract-item]
  1209. [[ERC7579Utils-ERC7579UninstalledModule-uint256-address-]]
  1210. ==== `[.contract-item-name]#++ERC7579UninstalledModule++#++(uint256 moduleTypeId, address module)++` [.item-kind]#error#
  1211. The module is not installed.
  1212. [.contract-item]
  1213. [[ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-]]
  1214. ==== `[.contract-item-name]#++ERC7579AlreadyInstalledModule++#++(uint256 moduleTypeId, address module)++` [.item-kind]#error#
  1215. The module is already installed.
  1216. [.contract-item]
  1217. [[ERC7579Utils-ERC7579UnsupportedModuleType-uint256-]]
  1218. ==== `[.contract-item-name]#++ERC7579UnsupportedModuleType++#++(uint256 moduleTypeId)++` [.item-kind]#error#
  1219. The module type is not supported.
  1220. [.contract-item]
  1221. [[ERC7579Utils-ERC7579DecodingError--]]
  1222. ==== `[.contract-item-name]#++ERC7579DecodingError++#++()++` [.item-kind]#error#
  1223. Input calldata not properly formatted and possibly malicious.
  1224. [.contract-item]
  1225. [[ERC7579Utils-CALLTYPE_SINGLE-CallType]]
  1226. ==== `CallType [.contract-item-name]#++CALLTYPE_SINGLE++#` [.item-kind]#internal constant#
  1227. A single `call` execution.
  1228. [.contract-item]
  1229. [[ERC7579Utils-CALLTYPE_BATCH-CallType]]
  1230. ==== `CallType [.contract-item-name]#++CALLTYPE_BATCH++#` [.item-kind]#internal constant#
  1231. A batch of `call` executions.
  1232. [.contract-item]
  1233. [[ERC7579Utils-CALLTYPE_DELEGATECALL-CallType]]
  1234. ==== `CallType [.contract-item-name]#++CALLTYPE_DELEGATECALL++#` [.item-kind]#internal constant#
  1235. A `delegatecall` execution.
  1236. [.contract-item]
  1237. [[ERC7579Utils-EXECTYPE_DEFAULT-ExecType]]
  1238. ==== `ExecType [.contract-item-name]#++EXECTYPE_DEFAULT++#` [.item-kind]#internal constant#
  1239. Default execution type that reverts on failure.
  1240. [.contract-item]
  1241. [[ERC7579Utils-EXECTYPE_TRY-ExecType]]
  1242. ==== `ExecType [.contract-item-name]#++EXECTYPE_TRY++#` [.item-kind]#internal constant#
  1243. Execution type that does not revert on failure.