123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602 |
- :github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
- :Account: pass:normal[xref:account.adoc#Account[`Account`]]
- :AccountERC7579: pass:normal[xref:account.adoc#AccountERC7579[`AccountERC7579`]]
- :AccountERC7579Hooked: pass:normal[xref:account.adoc#AccountERC7579Hooked[`AccountERC7579Hooked`]]
- :ERC7821: pass:normal[xref:account.adoc#ERC7821[`ERC7821`]]
- :ERC4337Utils: pass:normal[xref:account.adoc#ERC4337Utils[`ERC4337Utils`]]
- :ERC7579Utils: pass:normal[xref:account.adoc#ERC7579Utils[`ERC7579Utils`]]
- :AbstractSigner-_rawSignatureValidation: pass:normal[xref:utils/cryptography.adoc#AbstractSigner-_rawSignatureValidation-bytes32-bytes-[`AbstractSigner._rawSignatureValidation`]]
- :SignerECDSA: pass:normal[xref:utils/cryptography.adoc#SignerECDSA[`SignerECDSA`]]
- :SignerP256: pass:normal[xref:utils/cryptography.adoc#SignerP256[`SignerP256`]]
- :SignerRSA: pass:normal[xref:utils/cryptography.adoc#SignerRSA[`SignerRSA`]]
- :xref-Account-onlyEntryPointOrSelf--: xref:account.adoc#Account-onlyEntryPointOrSelf--
- :xref-Account-onlyEntryPoint--: xref:account.adoc#Account-onlyEntryPoint--
- :xref-Account-entryPoint--: xref:account.adoc#Account-entryPoint--
- :xref-Account-getNonce--: xref:account.adoc#Account-getNonce--
- :xref-Account-getNonce-uint192-: xref:account.adoc#Account-getNonce-uint192-
- :xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-: xref:account.adoc#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-
- :xref-Account-_validateUserOp-struct-PackedUserOperation-bytes32-: xref:account.adoc#Account-_validateUserOp-struct-PackedUserOperation-bytes32-
- :xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-: xref:account.adoc#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-
- :xref-Account-_payPrefund-uint256-: xref:account.adoc#Account-_payPrefund-uint256-
- :xref-Account-_checkEntryPoint--: xref:account.adoc#Account-_checkEntryPoint--
- :xref-Account-_checkEntryPointOrSelf--: xref:account.adoc#Account-_checkEntryPointOrSelf--
- :xref-Account-receive--: xref:account.adoc#Account-receive--
- :xref-AbstractSigner-_rawSignatureValidation-bytes32-bytes-: xref:utils/cryptography.adoc#AbstractSigner-_rawSignatureValidation-bytes32-bytes-
- :xref-Account-AccountUnauthorized-address-: xref:account.adoc#Account-AccountUnauthorized-address-
- :AbstractSigner-_rawSignatureValidation: pass:normal[xref:utils/cryptography.adoc#AbstractSigner-_rawSignatureValidation-bytes32-bytes-[`AbstractSigner._rawSignatureValidation`]]
- :Account: pass:normal[xref:account.adoc#Account[`Account`]]
- :IERC7579Validator-isValidSignatureWithSender: pass:normal[xref:interfaces.adoc#IERC7579Validator-isValidSignatureWithSender-address-bytes32-bytes-[`IERC7579Validator.isValidSignatureWithSender`]]
- :AccountERC7579Hooked: pass:normal[xref:account.adoc#AccountERC7579Hooked[`AccountERC7579Hooked`]]
- :ERC7739: pass:normal[xref:utils/cryptography.adoc#ERC7739[`ERC7739`]]
- :ERC7739: pass:normal[xref:utils/cryptography.adoc#ERC7739[`ERC7739`]]
- :xref-AccountERC7579-onlyModule-uint256-bytes-: xref:account.adoc#AccountERC7579-onlyModule-uint256-bytes-
- :xref-AccountERC7579-fallback-bytes-: xref:account.adoc#AccountERC7579-fallback-bytes-
- :xref-AccountERC7579-accountId--: xref:account.adoc#AccountERC7579-accountId--
- :xref-AccountERC7579-supportsExecutionMode-bytes32-: xref:account.adoc#AccountERC7579-supportsExecutionMode-bytes32-
- :xref-AccountERC7579-supportsModule-uint256-: xref:account.adoc#AccountERC7579-supportsModule-uint256-
- :xref-AccountERC7579-installModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-installModule-uint256-address-bytes-
- :xref-AccountERC7579-uninstallModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-uninstallModule-uint256-address-bytes-
- :xref-AccountERC7579-isModuleInstalled-uint256-address-bytes-: xref:account.adoc#AccountERC7579-isModuleInstalled-uint256-address-bytes-
- :xref-AccountERC7579-execute-bytes32-bytes-: xref:account.adoc#AccountERC7579-execute-bytes32-bytes-
- :xref-AccountERC7579-executeFromExecutor-bytes32-bytes-: xref:account.adoc#AccountERC7579-executeFromExecutor-bytes32-bytes-
- :xref-AccountERC7579-isValidSignature-bytes32-bytes-: xref:account.adoc#AccountERC7579-isValidSignature-bytes32-bytes-
- :xref-AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-: xref:account.adoc#AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-
- :xref-AccountERC7579-_execute-Mode-bytes-: xref:account.adoc#AccountERC7579-_execute-Mode-bytes-
- :xref-AccountERC7579-_installModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-_installModule-uint256-address-bytes-
- :xref-AccountERC7579-_uninstallModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-_uninstallModule-uint256-address-bytes-
- :xref-AccountERC7579-_fallback--: xref:account.adoc#AccountERC7579-_fallback--
- :xref-AccountERC7579-_fallbackHandler-bytes4-: xref:account.adoc#AccountERC7579-_fallbackHandler-bytes4-
- :xref-AccountERC7579-_checkModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-_checkModule-uint256-address-bytes-
- :xref-AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-: xref:account.adoc#AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-
- :xref-AccountERC7579-_extractSignatureValidator-bytes-: xref:account.adoc#AccountERC7579-_extractSignatureValidator-bytes-
- :xref-AccountERC7579-_decodeFallbackData-bytes-: xref:account.adoc#AccountERC7579-_decodeFallbackData-bytes-
- :xref-AccountERC7579-_rawSignatureValidation-bytes32-bytes-: xref:account.adoc#AccountERC7579-_rawSignatureValidation-bytes32-bytes-
- :xref-Account-entryPoint--: xref:account.adoc#Account-entryPoint--
- :xref-Account-getNonce--: xref:account.adoc#Account-getNonce--
- :xref-Account-getNonce-uint192-: xref:account.adoc#Account-getNonce-uint192-
- :xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-: xref:account.adoc#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-
- :xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-: xref:account.adoc#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-
- :xref-Account-_payPrefund-uint256-: xref:account.adoc#Account-_payPrefund-uint256-
- :xref-Account-_checkEntryPoint--: xref:account.adoc#Account-_checkEntryPoint--
- :xref-Account-_checkEntryPointOrSelf--: xref:account.adoc#Account-_checkEntryPointOrSelf--
- :xref-Account-receive--: xref:account.adoc#Account-receive--
- :xref-IERC7579ModuleConfig-ModuleInstalled-uint256-address-: xref:interfaces.adoc#IERC7579ModuleConfig-ModuleInstalled-uint256-address-
- :xref-IERC7579ModuleConfig-ModuleUninstalled-uint256-address-: xref:interfaces.adoc#IERC7579ModuleConfig-ModuleUninstalled-uint256-address-
- :xref-AccountERC7579-ERC7579MissingFallbackHandler-bytes4-: xref:account.adoc#AccountERC7579-ERC7579MissingFallbackHandler-bytes4-
- :xref-Account-AccountUnauthorized-address-: xref:account.adoc#Account-AccountUnauthorized-address-
- :ERC7739: pass:normal[xref:utils/cryptography.adoc#ERC7739[`ERC7739`]]
- :ERC7739: pass:normal[xref:utils/cryptography.adoc#ERC7739[`ERC7739`]]
- :Account-_validateUserOp: pass:normal[xref:account.adoc#Account-_validateUserOp-struct-PackedUserOperation-bytes32-[`Account._validateUserOp`]]
- :IERC7579Module-onInstall: pass:normal[xref:interfaces.adoc#IERC7579Module-onInstall-bytes-[`IERC7579Module.onInstall`]]
- :ERC7579Utils-ERC7579UnsupportedModuleType: pass:normal[xref:account.adoc#ERC7579Utils-ERC7579UnsupportedModuleType-uint256-[`ERC7579Utils.ERC7579UnsupportedModuleType`]]
- :ERC7579Utils-ERC7579MismatchedModuleTypeId: pass:normal[xref:account.adoc#ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-[`ERC7579Utils.ERC7579MismatchedModuleTypeId`]]
- :ERC7579Utils-ERC7579AlreadyInstalledModule: pass:normal[xref:account.adoc#ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-[`ERC7579Utils.ERC7579AlreadyInstalledModule`]]
- :IERC7579ModuleConfig-ModuleInstalled: pass:normal[xref:interfaces.adoc#IERC7579ModuleConfig-ModuleInstalled-uint256-address-[`IERC7579ModuleConfig.ModuleInstalled`]]
- :IERC7579Module-onUninstall: pass:normal[xref:interfaces.adoc#IERC7579Module-onUninstall-bytes-[`IERC7579Module.onUninstall`]]
- :ERC7579Utils-ERC7579UninstalledModule: pass:normal[xref:account.adoc#ERC7579Utils-ERC7579UninstalledModule-uint256-address-[`ERC7579Utils.ERC7579UninstalledModule`]]
- :AccountERC7579: pass:normal[xref:account.adoc#AccountERC7579[`AccountERC7579`]]
- :IERC7579Hook-preCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-preCheck-address-uint256-bytes-[`IERC7579Hook.preCheck`]]
- :IERC7579Hook-postCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-postCheck-bytes-[`IERC7579Hook.postCheck`]]
- :IERC7579Hook-preCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-preCheck-address-uint256-bytes-[`IERC7579Hook.preCheck`]]
- :xref-AccountERC7579Hooked-withHook--: xref:account.adoc#AccountERC7579Hooked-withHook--
- :xref-AccountERC7579Hooked-accountId--: xref:account.adoc#AccountERC7579Hooked-accountId--
- :xref-AccountERC7579Hooked-hook--: xref:account.adoc#AccountERC7579Hooked-hook--
- :xref-AccountERC7579Hooked-supportsModule-uint256-: xref:account.adoc#AccountERC7579Hooked-supportsModule-uint256-
- :xref-AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-: xref:account.adoc#AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-
- :xref-AccountERC7579Hooked-_installModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579Hooked-_installModule-uint256-address-bytes-
- :xref-AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-
- :xref-AccountERC7579Hooked-_execute-Mode-bytes-: xref:account.adoc#AccountERC7579Hooked-_execute-Mode-bytes-
- :xref-AccountERC7579Hooked-_fallback--: xref:account.adoc#AccountERC7579Hooked-_fallback--
- :xref-AccountERC7579-fallback-bytes-: xref:account.adoc#AccountERC7579-fallback-bytes-
- :xref-AccountERC7579-supportsExecutionMode-bytes32-: xref:account.adoc#AccountERC7579-supportsExecutionMode-bytes32-
- :xref-AccountERC7579-installModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-installModule-uint256-address-bytes-
- :xref-AccountERC7579-uninstallModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-uninstallModule-uint256-address-bytes-
- :xref-AccountERC7579-execute-bytes32-bytes-: xref:account.adoc#AccountERC7579-execute-bytes32-bytes-
- :xref-AccountERC7579-executeFromExecutor-bytes32-bytes-: xref:account.adoc#AccountERC7579-executeFromExecutor-bytes32-bytes-
- :xref-AccountERC7579-isValidSignature-bytes32-bytes-: xref:account.adoc#AccountERC7579-isValidSignature-bytes32-bytes-
- :xref-AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-: xref:account.adoc#AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-
- :xref-AccountERC7579-_fallbackHandler-bytes4-: xref:account.adoc#AccountERC7579-_fallbackHandler-bytes4-
- :xref-AccountERC7579-_checkModule-uint256-address-bytes-: xref:account.adoc#AccountERC7579-_checkModule-uint256-address-bytes-
- :xref-AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-: xref:account.adoc#AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-
- :xref-AccountERC7579-_extractSignatureValidator-bytes-: xref:account.adoc#AccountERC7579-_extractSignatureValidator-bytes-
- :xref-AccountERC7579-_decodeFallbackData-bytes-: xref:account.adoc#AccountERC7579-_decodeFallbackData-bytes-
- :xref-AccountERC7579-_rawSignatureValidation-bytes32-bytes-: xref:account.adoc#AccountERC7579-_rawSignatureValidation-bytes32-bytes-
- :xref-Account-entryPoint--: xref:account.adoc#Account-entryPoint--
- :xref-Account-getNonce--: xref:account.adoc#Account-getNonce--
- :xref-Account-getNonce-uint192-: xref:account.adoc#Account-getNonce-uint192-
- :xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-: xref:account.adoc#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-
- :xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-: xref:account.adoc#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-
- :xref-Account-_payPrefund-uint256-: xref:account.adoc#Account-_payPrefund-uint256-
- :xref-Account-_checkEntryPoint--: xref:account.adoc#Account-_checkEntryPoint--
- :xref-Account-_checkEntryPointOrSelf--: xref:account.adoc#Account-_checkEntryPointOrSelf--
- :xref-Account-receive--: xref:account.adoc#Account-receive--
- :xref-IERC7579ModuleConfig-ModuleInstalled-uint256-address-: xref:interfaces.adoc#IERC7579ModuleConfig-ModuleInstalled-uint256-address-
- :xref-IERC7579ModuleConfig-ModuleUninstalled-uint256-address-: xref:interfaces.adoc#IERC7579ModuleConfig-ModuleUninstalled-uint256-address-
- :xref-AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-: xref:account.adoc#AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-
- :xref-AccountERC7579-ERC7579MissingFallbackHandler-bytes4-: xref:account.adoc#AccountERC7579-ERC7579MissingFallbackHandler-bytes4-
- :xref-Account-AccountUnauthorized-address-: xref:account.adoc#Account-AccountUnauthorized-address-
- :IERC7579Hook-preCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-preCheck-address-uint256-bytes-[`IERC7579Hook.preCheck`]]
- :IERC7579Hook-postCheck: pass:normal[xref:interfaces.adoc#IERC7579Hook-postCheck-bytes-[`IERC7579Hook.postCheck`]]
- :AccountERC7579-supportsModule: pass:normal[xref:account.adoc#AccountERC7579-supportsModule-uint256-[`AccountERC7579.supportsModule`]]
- :AccountERC7579-_installModule: pass:normal[xref:account.adoc#AccountERC7579-_installModule-uint256-address-bytes-[`AccountERC7579._installModule`]]
- :AccountERC7579-_uninstallModule: pass:normal[xref:account.adoc#AccountERC7579-_uninstallModule-uint256-address-bytes-[`AccountERC7579._uninstallModule`]]
- :AccountERC7579-_execute: pass:normal[xref:account.adoc#AccountERC7579-_execute-Mode-bytes-[`AccountERC7579._execute`]]
- :AccountERC7579-_fallback: pass:normal[xref:account.adoc#AccountERC7579-_fallback--[`AccountERC7579._fallback`]]
- :xref-ERC7821-execute-bytes32-bytes-: xref:account.adoc#ERC7821-execute-bytes32-bytes-
- :xref-ERC7821-supportsExecutionMode-bytes32-: xref:account.adoc#ERC7821-supportsExecutionMode-bytes32-
- :xref-ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-: xref:account.adoc#ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-
- :xref-ERC7821-UnsupportedExecutionMode--: xref:account.adoc#ERC7821-UnsupportedExecutionMode--
- :xref-ERC4337Utils-parseValidationData-uint256-: xref:account.adoc#ERC4337Utils-parseValidationData-uint256-
- :xref-ERC4337Utils-packValidationData-address-uint48-uint48-: xref:account.adoc#ERC4337Utils-packValidationData-address-uint48-uint48-
- :xref-ERC4337Utils-packValidationData-bool-uint48-uint48-: xref:account.adoc#ERC4337Utils-packValidationData-bool-uint48-uint48-
- :xref-ERC4337Utils-combineValidationData-uint256-uint256-: xref:account.adoc#ERC4337Utils-combineValidationData-uint256-uint256-
- :xref-ERC4337Utils-getValidationData-uint256-: xref:account.adoc#ERC4337Utils-getValidationData-uint256-
- :xref-ERC4337Utils-hash-struct-PackedUserOperation-address-: xref:account.adoc#ERC4337Utils-hash-struct-PackedUserOperation-address-
- :xref-ERC4337Utils-factory-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-factory-struct-PackedUserOperation-
- :xref-ERC4337Utils-factoryData-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-factoryData-struct-PackedUserOperation-
- :xref-ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-
- :xref-ERC4337Utils-callGasLimit-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-callGasLimit-struct-PackedUserOperation-
- :xref-ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-
- :xref-ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-
- :xref-ERC4337Utils-gasPrice-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-gasPrice-struct-PackedUserOperation-
- :xref-ERC4337Utils-paymaster-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-paymaster-struct-PackedUserOperation-
- :xref-ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-
- :xref-ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-
- :xref-ERC4337Utils-paymasterData-struct-PackedUserOperation-: xref:account.adoc#ERC4337Utils-paymasterData-struct-PackedUserOperation-
- :xref-ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint: xref:account.adoc#ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint
- :xref-ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint: xref:account.adoc#ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint
- :xref-ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256: xref:account.adoc#ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256
- :xref-ERC4337Utils-SIG_VALIDATION_FAILED-uint256: xref:account.adoc#ERC4337Utils-SIG_VALIDATION_FAILED-uint256
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :PackedUserOperation: pass:normal[xref:interfaces.adoc#PackedUserOperation[`PackedUserOperation`]]
- :xref-ERC7579Utils-execSingle-bytes-ExecType-: xref:account.adoc#ERC7579Utils-execSingle-bytes-ExecType-
- :xref-ERC7579Utils-execBatch-bytes-ExecType-: xref:account.adoc#ERC7579Utils-execBatch-bytes-ExecType-
- :xref-ERC7579Utils-execDelegateCall-bytes-ExecType-: xref:account.adoc#ERC7579Utils-execDelegateCall-bytes-ExecType-
- :xref-ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-: xref:account.adoc#ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-
- :xref-ERC7579Utils-decodeMode-Mode-: xref:account.adoc#ERC7579Utils-decodeMode-Mode-
- :xref-ERC7579Utils-encodeSingle-address-uint256-bytes-: xref:account.adoc#ERC7579Utils-encodeSingle-address-uint256-bytes-
- :xref-ERC7579Utils-decodeSingle-bytes-: xref:account.adoc#ERC7579Utils-decodeSingle-bytes-
- :xref-ERC7579Utils-encodeDelegate-address-bytes-: xref:account.adoc#ERC7579Utils-encodeDelegate-address-bytes-
- :xref-ERC7579Utils-decodeDelegate-bytes-: xref:account.adoc#ERC7579Utils-decodeDelegate-bytes-
- :xref-ERC7579Utils-encodeBatch-struct-Execution---: xref:account.adoc#ERC7579Utils-encodeBatch-struct-Execution---
- :xref-ERC7579Utils-decodeBatch-bytes-: xref:account.adoc#ERC7579Utils-decodeBatch-bytes-
- :xref-ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-: xref:account.adoc#ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-
- :xref-ERC7579Utils-ERC7579UnsupportedCallType-CallType-: xref:account.adoc#ERC7579Utils-ERC7579UnsupportedCallType-CallType-
- :xref-ERC7579Utils-ERC7579UnsupportedExecType-ExecType-: xref:account.adoc#ERC7579Utils-ERC7579UnsupportedExecType-ExecType-
- :xref-ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-: xref:account.adoc#ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-
- :xref-ERC7579Utils-ERC7579UninstalledModule-uint256-address-: xref:account.adoc#ERC7579Utils-ERC7579UninstalledModule-uint256-address-
- :xref-ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-: xref:account.adoc#ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-
- :xref-ERC7579Utils-ERC7579UnsupportedModuleType-uint256-: xref:account.adoc#ERC7579Utils-ERC7579UnsupportedModuleType-uint256-
- :xref-ERC7579Utils-ERC7579DecodingError--: xref:account.adoc#ERC7579Utils-ERC7579DecodingError--
- :xref-ERC7579Utils-CALLTYPE_SINGLE-CallType: xref:account.adoc#ERC7579Utils-CALLTYPE_SINGLE-CallType
- :xref-ERC7579Utils-CALLTYPE_BATCH-CallType: xref:account.adoc#ERC7579Utils-CALLTYPE_BATCH-CallType
- :xref-ERC7579Utils-CALLTYPE_DELEGATECALL-CallType: xref:account.adoc#ERC7579Utils-CALLTYPE_DELEGATECALL-CallType
- :xref-ERC7579Utils-EXECTYPE_DEFAULT-ExecType: xref:account.adoc#ERC7579Utils-EXECTYPE_DEFAULT-ExecType
- :xref-ERC7579Utils-EXECTYPE_TRY-ExecType: xref:account.adoc#ERC7579Utils-EXECTYPE_TRY-ExecType
- :CallType: pass:normal[xref:account.adoc#CallType[`CallType`]]
- :ExecType: pass:normal[xref:account.adoc#ExecType[`ExecType`]]
- = Account
- [.readme-notice]
- NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/account
- This directory includes contracts to build accounts for ERC-4337. These include:
- * {Account}: An ERC-4337 smart account implementation that includes the core logic to process user operations.
- * {AccountERC7579}: An extension of `Account` that implements support for ERC-7579 modules.
- * {AccountERC7579Hooked}: An extension of `AccountERC7579` with support for a single hook module (type 4).
- * {ERC7821}: Minimal batch executor implementation contracts. Useful to enable easy batch execution for smart contracts.
- * {ERC4337Utils}: Utility functions for working with ERC-4337 user operations.
- * {ERC7579Utils}: Utility functions for working with ERC-7579 modules and account modularity.
- == Core
- :AccountUnauthorized: pass:normal[xref:#Account-AccountUnauthorized-address-[`++AccountUnauthorized++`]]
- :onlyEntryPointOrSelf: pass:normal[xref:#Account-onlyEntryPointOrSelf--[`++onlyEntryPointOrSelf++`]]
- :onlyEntryPoint: pass:normal[xref:#Account-onlyEntryPoint--[`++onlyEntryPoint++`]]
- :entryPoint: pass:normal[xref:#Account-entryPoint--[`++entryPoint++`]]
- :getNonce: pass:normal[xref:#Account-getNonce--[`++getNonce++`]]
- :getNonce: pass:normal[xref:#Account-getNonce-uint192-[`++getNonce++`]]
- :validateUserOp: pass:normal[xref:#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-[`++validateUserOp++`]]
- :_validateUserOp: pass:normal[xref:#Account-_validateUserOp-struct-PackedUserOperation-bytes32-[`++_validateUserOp++`]]
- :_signableUserOpHash: pass:normal[xref:#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-[`++_signableUserOpHash++`]]
- :_payPrefund: pass:normal[xref:#Account-_payPrefund-uint256-[`++_payPrefund++`]]
- :_checkEntryPoint: pass:normal[xref:#Account-_checkEntryPoint--[`++_checkEntryPoint++`]]
- :_checkEntryPointOrSelf: pass:normal[xref:#Account-_checkEntryPointOrSelf--[`++_checkEntryPointOrSelf++`]]
- :receive: pass:normal[xref:#Account-receive--[`++receive++`]]
- :entryPoint-: pass:normal[xref:#Account-entryPoint--[`++entryPoint++`]]
- :getNonce-: pass:normal[xref:#Account-getNonce--[`++getNonce++`]]
- :getNonce-uint192: pass:normal[xref:#Account-getNonce-uint192-[`++getNonce++`]]
- :validateUserOp-struct-PackedUserOperation-bytes32-uint256: pass:normal[xref:#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-[`++validateUserOp++`]]
- :_validateUserOp-struct-PackedUserOperation-bytes32: pass:normal[xref:#Account-_validateUserOp-struct-PackedUserOperation-bytes32-[`++_validateUserOp++`]]
- :_signableUserOpHash-struct-PackedUserOperation-bytes32: pass:normal[xref:#Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-[`++_signableUserOpHash++`]]
- :_payPrefund-uint256: pass:normal[xref:#Account-_payPrefund-uint256-[`++_payPrefund++`]]
- :_checkEntryPoint-: pass:normal[xref:#Account-_checkEntryPoint--[`++_checkEntryPoint++`]]
- :_checkEntryPointOrSelf-: pass:normal[xref:#Account-_checkEntryPointOrSelf--[`++_checkEntryPointOrSelf++`]]
- :receive-: pass:normal[xref:#Account-receive--[`++receive++`]]
- [.contract]
- [[Account]]
- === `++Account++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/Account.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/account/Account.sol";
- ```
- A simple ERC4337 account implementation. This base implementation only includes the minimal logic to process
- user operations.
- Developers must implement the {AbstractSigner-_rawSignatureValidation} function to define the account's validation logic.
- NOTE: This core account doesn't include any mechanism for performing arbitrary external calls. This is an essential
- feature that all Account should have. We leave it up to the developers to implement the mechanism of their choice.
- Common choices include ERC-6900, ERC-7579 and ERC-7821 (among others).
- IMPORTANT: Implementing a mechanism to validate signatures is a security-sensitive operation as it may allow an
- attacker to bypass the account's security measures. Check out {SignerECDSA}, {SignerP256}, or {SignerRSA} for
- digital signature validation implementations.
- @custom:stateless
- [.contract-index]
- .Modifiers
- --
- * {xref-Account-onlyEntryPointOrSelf--}[`++onlyEntryPointOrSelf()++`]
- * {xref-Account-onlyEntryPoint--}[`++onlyEntryPoint()++`]
- --
- [.contract-index]
- .Functions
- --
- * {xref-Account-entryPoint--}[`++entryPoint()++`]
- * {xref-Account-getNonce--}[`++getNonce()++`]
- * {xref-Account-getNonce-uint192-}[`++getNonce(key)++`]
- * {xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-}[`++validateUserOp(userOp, userOpHash, missingAccountFunds)++`]
- * {xref-Account-_validateUserOp-struct-PackedUserOperation-bytes32-}[`++_validateUserOp(userOp, userOpHash)++`]
- * {xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-}[`++_signableUserOpHash(, userOpHash)++`]
- * {xref-Account-_payPrefund-uint256-}[`++_payPrefund(missingAccountFunds)++`]
- * {xref-Account-_checkEntryPoint--}[`++_checkEntryPoint()++`]
- * {xref-Account-_checkEntryPointOrSelf--}[`++_checkEntryPointOrSelf()++`]
- * {xref-Account-receive--}[`++receive()++`]
- [.contract-subindex-inherited]
- .IAccount
- [.contract-subindex-inherited]
- .AbstractSigner
- * {xref-AbstractSigner-_rawSignatureValidation-bytes32-bytes-}[`++_rawSignatureValidation(hash, signature)++`]
- --
- [.contract-index]
- .Errors
- --
- * {xref-Account-AccountUnauthorized-address-}[`++AccountUnauthorized(sender)++`]
- [.contract-subindex-inherited]
- .IAccount
- [.contract-subindex-inherited]
- .AbstractSigner
- --
- [.contract-item]
- [[Account-onlyEntryPointOrSelf--]]
- ==== `[.contract-item-name]#++onlyEntryPointOrSelf++#++()++` [.item-kind]#modifier#
- Revert if the caller is not the entry point or the account itself.
- [.contract-item]
- [[Account-onlyEntryPoint--]]
- ==== `[.contract-item-name]#++onlyEntryPoint++#++()++` [.item-kind]#modifier#
- Revert if the caller is not the entry point.
- [.contract-item]
- [[Account-entryPoint--]]
- ==== `[.contract-item-name]#++entryPoint++#++() → contract IEntryPoint++` [.item-kind]#public#
- Canonical entry point for the account that forwards and validates user operations.
- [.contract-item]
- [[Account-getNonce--]]
- ==== `[.contract-item-name]#++getNonce++#++() → uint256++` [.item-kind]#public#
- Return the account nonce for the canonical sequence.
- [.contract-item]
- [[Account-getNonce-uint192-]]
- ==== `[.contract-item-name]#++getNonce++#++(uint192 key) → uint256++` [.item-kind]#public#
- Return the account nonce for a given sequence (key).
- [.contract-item]
- [[Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-]]
- ==== `[.contract-item-name]#++validateUserOp++#++(struct PackedUserOperation userOp, bytes32 userOpHash, uint256 missingAccountFunds) → uint256++` [.item-kind]#public#
- Validates a user operation.
- * MUST validate the caller is a trusted EntryPoint
- * MUST validate that the signature is a valid signature of the userOpHash, and SHOULD
- return SIG_VALIDATION_FAILED (and not revert) on signature mismatch. Any other error MUST revert.
- * MUST pay the entryPoint (caller) at least the “missingAccountFunds” (which might
- be zero, in case the current account’s deposit is high enough)
- Returns an encoded packed validation data that is composed of the following elements:
- - `authorizer` (`address`): 0 for success, 1 for failure, otherwise the address of an authorizer contract
- - `validUntil` (`uint48`): The UserOp is valid only up to this time. Zero for “infinite”.
- - `validAfter` (`uint48`): The UserOp is valid only after this time.
- [.contract-item]
- [[Account-_validateUserOp-struct-PackedUserOperation-bytes32-]]
- ==== `[.contract-item-name]#++_validateUserOp++#++(struct PackedUserOperation userOp, bytes32 userOpHash) → uint256++` [.item-kind]#internal#
- Returns the validationData for a given user operation. By default, this checks the signature of the
- signable hash (produced by {_signableUserOpHash}) using the abstract signer ({AbstractSigner-_rawSignatureValidation}).
- NOTE: The userOpHash is assumed to be correct. Calling this function with a userOpHash that does not match the
- userOp will result in undefined behavior.
- [.contract-item]
- [[Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-]]
- ==== `[.contract-item-name]#++_signableUserOpHash++#++(struct PackedUserOperation, bytes32 userOpHash) → bytes32++` [.item-kind]#internal#
- Virtual function that returns the signable hash for a user operations. Since v0.8.0 of the entrypoint,
- `userOpHash` is an EIP-712 hash that can be signed directly.
- [.contract-item]
- [[Account-_payPrefund-uint256-]]
- ==== `[.contract-item-name]#++_payPrefund++#++(uint256 missingAccountFunds)++` [.item-kind]#internal#
- Sends the missing funds for executing the user operation to the {entrypoint}.
- The `missingAccountFunds` must be defined by the entrypoint when calling {validateUserOp}.
- [.contract-item]
- [[Account-_checkEntryPoint--]]
- ==== `[.contract-item-name]#++_checkEntryPoint++#++()++` [.item-kind]#internal#
- Ensures the caller is the {entrypoint}.
- [.contract-item]
- [[Account-_checkEntryPointOrSelf--]]
- ==== `[.contract-item-name]#++_checkEntryPointOrSelf++#++()++` [.item-kind]#internal#
- Ensures the caller is the {entrypoint} or the account itself.
- [.contract-item]
- [[Account-receive--]]
- ==== `[.contract-item-name]#++receive++#++()++` [.item-kind]#external#
- Receive Ether.
- [.contract-item]
- [[Account-AccountUnauthorized-address-]]
- ==== `[.contract-item-name]#++AccountUnauthorized++#++(address sender)++` [.item-kind]#error#
- Unauthorized call to the account.
- == Extensions
- :ERC7579MissingFallbackHandler: pass:normal[xref:#AccountERC7579-ERC7579MissingFallbackHandler-bytes4-[`++ERC7579MissingFallbackHandler++`]]
- :onlyModule: pass:normal[xref:#AccountERC7579-onlyModule-uint256-bytes-[`++onlyModule++`]]
- :fallback: pass:normal[xref:#AccountERC7579-fallback-bytes-[`++fallback++`]]
- :accountId: pass:normal[xref:#AccountERC7579-accountId--[`++accountId++`]]
- :supportsExecutionMode: pass:normal[xref:#AccountERC7579-supportsExecutionMode-bytes32-[`++supportsExecutionMode++`]]
- :supportsModule: pass:normal[xref:#AccountERC7579-supportsModule-uint256-[`++supportsModule++`]]
- :installModule: pass:normal[xref:#AccountERC7579-installModule-uint256-address-bytes-[`++installModule++`]]
- :uninstallModule: pass:normal[xref:#AccountERC7579-uninstallModule-uint256-address-bytes-[`++uninstallModule++`]]
- :isModuleInstalled: pass:normal[xref:#AccountERC7579-isModuleInstalled-uint256-address-bytes-[`++isModuleInstalled++`]]
- :execute: pass:normal[xref:#AccountERC7579-execute-bytes32-bytes-[`++execute++`]]
- :executeFromExecutor: pass:normal[xref:#AccountERC7579-executeFromExecutor-bytes32-bytes-[`++executeFromExecutor++`]]
- :isValidSignature: pass:normal[xref:#AccountERC7579-isValidSignature-bytes32-bytes-[`++isValidSignature++`]]
- :_validateUserOp: pass:normal[xref:#AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-[`++_validateUserOp++`]]
- :_execute: pass:normal[xref:#AccountERC7579-_execute-Mode-bytes-[`++_execute++`]]
- :_installModule: pass:normal[xref:#AccountERC7579-_installModule-uint256-address-bytes-[`++_installModule++`]]
- :_uninstallModule: pass:normal[xref:#AccountERC7579-_uninstallModule-uint256-address-bytes-[`++_uninstallModule++`]]
- :_fallback: pass:normal[xref:#AccountERC7579-_fallback--[`++_fallback++`]]
- :_fallbackHandler: pass:normal[xref:#AccountERC7579-_fallbackHandler-bytes4-[`++_fallbackHandler++`]]
- :_checkModule: pass:normal[xref:#AccountERC7579-_checkModule-uint256-address-bytes-[`++_checkModule++`]]
- :_extractUserOpValidator: pass:normal[xref:#AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-[`++_extractUserOpValidator++`]]
- :_extractSignatureValidator: pass:normal[xref:#AccountERC7579-_extractSignatureValidator-bytes-[`++_extractSignatureValidator++`]]
- :_decodeFallbackData: pass:normal[xref:#AccountERC7579-_decodeFallbackData-bytes-[`++_decodeFallbackData++`]]
- :_rawSignatureValidation: pass:normal[xref:#AccountERC7579-_rawSignatureValidation-bytes32-bytes-[`++_rawSignatureValidation++`]]
- :fallback-bytes: pass:normal[xref:#AccountERC7579-fallback-bytes-[`++fallback++`]]
- :accountId-: pass:normal[xref:#AccountERC7579-accountId--[`++accountId++`]]
- :supportsExecutionMode-bytes32: pass:normal[xref:#AccountERC7579-supportsExecutionMode-bytes32-[`++supportsExecutionMode++`]]
- :supportsModule-uint256: pass:normal[xref:#AccountERC7579-supportsModule-uint256-[`++supportsModule++`]]
- :installModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-installModule-uint256-address-bytes-[`++installModule++`]]
- :uninstallModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-uninstallModule-uint256-address-bytes-[`++uninstallModule++`]]
- :isModuleInstalled-uint256-address-bytes: pass:normal[xref:#AccountERC7579-isModuleInstalled-uint256-address-bytes-[`++isModuleInstalled++`]]
- :execute-bytes32-bytes: pass:normal[xref:#AccountERC7579-execute-bytes32-bytes-[`++execute++`]]
- :executeFromExecutor-bytes32-bytes: pass:normal[xref:#AccountERC7579-executeFromExecutor-bytes32-bytes-[`++executeFromExecutor++`]]
- :isValidSignature-bytes32-bytes: pass:normal[xref:#AccountERC7579-isValidSignature-bytes32-bytes-[`++isValidSignature++`]]
- :_validateUserOp-struct-PackedUserOperation-bytes32: pass:normal[xref:#AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-[`++_validateUserOp++`]]
- :_execute-Mode-bytes: pass:normal[xref:#AccountERC7579-_execute-Mode-bytes-[`++_execute++`]]
- :_installModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-_installModule-uint256-address-bytes-[`++_installModule++`]]
- :_uninstallModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-_uninstallModule-uint256-address-bytes-[`++_uninstallModule++`]]
- :_fallback-: pass:normal[xref:#AccountERC7579-_fallback--[`++_fallback++`]]
- :_fallbackHandler-bytes4: pass:normal[xref:#AccountERC7579-_fallbackHandler-bytes4-[`++_fallbackHandler++`]]
- :_checkModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579-_checkModule-uint256-address-bytes-[`++_checkModule++`]]
- :_extractUserOpValidator-struct-PackedUserOperation: pass:normal[xref:#AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-[`++_extractUserOpValidator++`]]
- :_extractSignatureValidator-bytes: pass:normal[xref:#AccountERC7579-_extractSignatureValidator-bytes-[`++_extractSignatureValidator++`]]
- :_decodeFallbackData-bytes: pass:normal[xref:#AccountERC7579-_decodeFallbackData-bytes-[`++_decodeFallbackData++`]]
- :_rawSignatureValidation-bytes32-bytes: pass:normal[xref:#AccountERC7579-_rawSignatureValidation-bytes32-bytes-[`++_rawSignatureValidation++`]]
- [.contract]
- [[AccountERC7579]]
- === `++AccountERC7579++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/extensions/draft-AccountERC7579.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";
- ```
- Extension of {Account} that implements support for ERC-7579 modules.
- To comply with the ERC-1271 support requirement, this contract defers signature validation to
- installed validator modules by calling {IERC7579Validator-isValidSignatureWithSender}.
- This contract does not implement validation logic for user operations since this functionality
- is often delegated to self-contained validation modules. Developers must install a validator module
- upon initialization (or any other mechanism to enable execution from the account):
- ```solidity
- contract MyAccountERC7579 is AccountERC7579, Initializable {
- function initializeAccount(address validator, bytes calldata validatorData) public initializer {
- _installModule(MODULE_TYPE_VALIDATOR, validator, validatorData);
- }
- }
- ```
- [NOTE]
- ====
- * Hook support is not included. See {AccountERC7579Hooked} for a version that hooks to execution.
- * Validator selection, when verifying either ERC-1271 signature or ERC-4337 UserOperation is implemented in
- internal virtual functions {_extractUserOpValidator} and {_extractSignatureValidator}. Both are implemented
- following common practices. However, this part is not standardized in ERC-7579 (or in any follow-up ERC). Some
- accounts may want to override these internal functions.
- * When combined with {ERC7739}, resolution ordering of {isValidSignature} may have an impact ({ERC7739} does not
- call super). Manual resolution might be necessary.
- * Static calls (using callType `0xfe`) are currently NOT supported.
- ====
- WARNING: Removing all validator modules will render the account inoperable, as no user operations can be validated thereafter.
- [.contract-index]
- .Modifiers
- --
- * {xref-AccountERC7579-onlyModule-uint256-bytes-}[`++onlyModule(moduleTypeId, additionalContext)++`]
- --
- [.contract-index]
- .Functions
- --
- * {xref-AccountERC7579-fallback-bytes-}[`++fallback()++`]
- * {xref-AccountERC7579-accountId--}[`++accountId()++`]
- * {xref-AccountERC7579-supportsExecutionMode-bytes32-}[`++supportsExecutionMode(encodedMode)++`]
- * {xref-AccountERC7579-supportsModule-uint256-}[`++supportsModule(moduleTypeId)++`]
- * {xref-AccountERC7579-installModule-uint256-address-bytes-}[`++installModule(moduleTypeId, module, initData)++`]
- * {xref-AccountERC7579-uninstallModule-uint256-address-bytes-}[`++uninstallModule(moduleTypeId, module, deInitData)++`]
- * {xref-AccountERC7579-isModuleInstalled-uint256-address-bytes-}[`++isModuleInstalled(moduleTypeId, module, additionalContext)++`]
- * {xref-AccountERC7579-execute-bytes32-bytes-}[`++execute(mode, executionCalldata)++`]
- * {xref-AccountERC7579-executeFromExecutor-bytes32-bytes-}[`++executeFromExecutor(mode, executionCalldata)++`]
- * {xref-AccountERC7579-isValidSignature-bytes32-bytes-}[`++isValidSignature(hash, signature)++`]
- * {xref-AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-}[`++_validateUserOp(userOp, userOpHash)++`]
- * {xref-AccountERC7579-_execute-Mode-bytes-}[`++_execute(mode, executionCalldata)++`]
- * {xref-AccountERC7579-_installModule-uint256-address-bytes-}[`++_installModule(moduleTypeId, module, initData)++`]
- * {xref-AccountERC7579-_uninstallModule-uint256-address-bytes-}[`++_uninstallModule(moduleTypeId, module, deInitData)++`]
- * {xref-AccountERC7579-_fallback--}[`++_fallback()++`]
- * {xref-AccountERC7579-_fallbackHandler-bytes4-}[`++_fallbackHandler(selector)++`]
- * {xref-AccountERC7579-_checkModule-uint256-address-bytes-}[`++_checkModule(moduleTypeId, module, additionalContext)++`]
- * {xref-AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-}[`++_extractUserOpValidator(userOp)++`]
- * {xref-AccountERC7579-_extractSignatureValidator-bytes-}[`++_extractSignatureValidator(signature)++`]
- * {xref-AccountERC7579-_decodeFallbackData-bytes-}[`++_decodeFallbackData(data)++`]
- * {xref-AccountERC7579-_rawSignatureValidation-bytes32-bytes-}[`++_rawSignatureValidation(, )++`]
- [.contract-subindex-inherited]
- .IERC7579ModuleConfig
- [.contract-subindex-inherited]
- .IERC7579AccountConfig
- [.contract-subindex-inherited]
- .IERC7579Execution
- [.contract-subindex-inherited]
- .IERC1271
- [.contract-subindex-inherited]
- .Account
- * {xref-Account-entryPoint--}[`++entryPoint()++`]
- * {xref-Account-getNonce--}[`++getNonce()++`]
- * {xref-Account-getNonce-uint192-}[`++getNonce(key)++`]
- * {xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-}[`++validateUserOp(userOp, userOpHash, missingAccountFunds)++`]
- * {xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-}[`++_signableUserOpHash(, userOpHash)++`]
- * {xref-Account-_payPrefund-uint256-}[`++_payPrefund(missingAccountFunds)++`]
- * {xref-Account-_checkEntryPoint--}[`++_checkEntryPoint()++`]
- * {xref-Account-_checkEntryPointOrSelf--}[`++_checkEntryPointOrSelf()++`]
- * {xref-Account-receive--}[`++receive()++`]
- [.contract-subindex-inherited]
- .IAccount
- [.contract-subindex-inherited]
- .AbstractSigner
- --
- [.contract-index]
- .Events
- --
- [.contract-subindex-inherited]
- .IERC7579ModuleConfig
- * {xref-IERC7579ModuleConfig-ModuleInstalled-uint256-address-}[`++ModuleInstalled(moduleTypeId, module)++`]
- * {xref-IERC7579ModuleConfig-ModuleUninstalled-uint256-address-}[`++ModuleUninstalled(moduleTypeId, module)++`]
- [.contract-subindex-inherited]
- .IERC7579AccountConfig
- [.contract-subindex-inherited]
- .IERC7579Execution
- [.contract-subindex-inherited]
- .IERC1271
- [.contract-subindex-inherited]
- .Account
- [.contract-subindex-inherited]
- .IAccount
- [.contract-subindex-inherited]
- .AbstractSigner
- --
- [.contract-index]
- .Errors
- --
- * {xref-AccountERC7579-ERC7579MissingFallbackHandler-bytes4-}[`++ERC7579MissingFallbackHandler(selector)++`]
- [.contract-subindex-inherited]
- .IERC7579ModuleConfig
- [.contract-subindex-inherited]
- .IERC7579AccountConfig
- [.contract-subindex-inherited]
- .IERC7579Execution
- [.contract-subindex-inherited]
- .IERC1271
- [.contract-subindex-inherited]
- .Account
- * {xref-Account-AccountUnauthorized-address-}[`++AccountUnauthorized(sender)++`]
- [.contract-subindex-inherited]
- .IAccount
- [.contract-subindex-inherited]
- .AbstractSigner
- --
- [.contract-item]
- [[AccountERC7579-onlyModule-uint256-bytes-]]
- ==== `[.contract-item-name]#++onlyModule++#++(uint256 moduleTypeId, bytes additionalContext)++` [.item-kind]#modifier#
- Modifier that checks if the caller is an installed module of the given type.
- [.contract-item]
- [[AccountERC7579-fallback-bytes-]]
- ==== `[.contract-item-name]#++fallback++#++(bytes) → bytes++` [.item-kind]#external#
- See {_fallback}.
- [.contract-item]
- [[AccountERC7579-accountId--]]
- ==== `[.contract-item-name]#++accountId++#++() → string++` [.item-kind]#public#
- Returns the account id of the smart account
- [.contract-item]
- [[AccountERC7579-supportsExecutionMode-bytes32-]]
- ==== `[.contract-item-name]#++supportsExecutionMode++#++(bytes32 encodedMode) → bool++` [.item-kind]#public#
- Supported call types:
- * Single (`0x00`): A single transaction execution.
- * Batch (`0x01`): A batch of transactions execution.
- * Delegate (`0xff`): A delegate call execution.
- Supported exec types:
- * Default (`0x00`): Default execution type (revert on failure).
- * Try (`0x01`): Try execution type (emits ERC7579TryExecuteFail on failure).
- [.contract-item]
- [[AccountERC7579-supportsModule-uint256-]]
- ==== `[.contract-item-name]#++supportsModule++#++(uint256 moduleTypeId) → bool++` [.item-kind]#public#
- Supported module types:
- * Validator: A module used during the validation phase to determine if a transaction is valid and
- should be executed on the account.
- * Executor: A module that can execute transactions on behalf of the smart account via a callback.
- * Fallback Handler: A module that can extend the fallback functionality of a smart account.
- [.contract-item]
- [[AccountERC7579-installModule-uint256-address-bytes-]]
- ==== `[.contract-item-name]#++installModule++#++(uint256 moduleTypeId, address module, bytes initData)++` [.item-kind]#public#
- Installs a Module of a certain type on the smart account
- [.contract-item]
- [[AccountERC7579-uninstallModule-uint256-address-bytes-]]
- ==== `[.contract-item-name]#++uninstallModule++#++(uint256 moduleTypeId, address module, bytes deInitData)++` [.item-kind]#public#
- Uninstalls a Module of a certain type on the smart account
- [.contract-item]
- [[AccountERC7579-isModuleInstalled-uint256-address-bytes-]]
- ==== `[.contract-item-name]#++isModuleInstalled++#++(uint256 moduleTypeId, address module, bytes additionalContext) → bool++` [.item-kind]#public#
- Returns whether a module is installed on the smart account
- [.contract-item]
- [[AccountERC7579-execute-bytes32-bytes-]]
- ==== `[.contract-item-name]#++execute++#++(bytes32 mode, bytes executionCalldata)++` [.item-kind]#public#
- Executes a transaction on behalf of the account.
- [.contract-item]
- [[AccountERC7579-executeFromExecutor-bytes32-bytes-]]
- ==== `[.contract-item-name]#++executeFromExecutor++#++(bytes32 mode, bytes executionCalldata) → bytes[] returnData++` [.item-kind]#public#
- Executes a transaction on behalf of the account.
- This function is intended to be called by Executor Modules
- [.contract-item]
- [[AccountERC7579-isValidSignature-bytes32-bytes-]]
- ==== `[.contract-item-name]#++isValidSignature++#++(bytes32 hash, bytes signature) → bytes4++` [.item-kind]#public#
- Implement ERC-1271 through IERC7579Validator modules. If module based validation fails, fallback to
- "native" validation by the abstract signer.
- NOTE: when combined with {ERC7739}, resolution ordering may have an impact ({ERC7739} does not call super).
- Manual resolution might be necessary.
- [.contract-item]
- [[AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-]]
- ==== `[.contract-item-name]#++_validateUserOp++#++(struct PackedUserOperation userOp, bytes32 userOpHash) → uint256++` [.item-kind]#internal#
- Validates a user operation with {_signableUserOpHash} and returns the validation data
- if the module specified by the first 20 bytes of the nonce key is installed. Falls back to
- {Account-_validateUserOp} otherwise.
- See {_extractUserOpValidator} for the module extraction logic.
- [.contract-item]
- [[AccountERC7579-_execute-Mode-bytes-]]
- ==== `[.contract-item-name]#++_execute++#++(Mode mode, bytes executionCalldata) → bytes[] returnData++` [.item-kind]#internal#
- ERC-7579 execution logic. See {supportsExecutionMode} for supported modes.
- Reverts if the call type is not supported.
- [.contract-item]
- [[AccountERC7579-_installModule-uint256-address-bytes-]]
- ==== `[.contract-item-name]#++_installModule++#++(uint256 moduleTypeId, address module, bytes initData)++` [.item-kind]#internal#
- Installs a module of the given type with the given initialization data.
- For the fallback module type, the `initData` is expected to be the (packed) concatenation of a 4-byte
- selector and the rest of the data to be sent to the handler when calling {IERC7579Module-onInstall}.
- Requirements:
- * Module type must be supported. See {supportsModule}. Reverts with {ERC7579Utils-ERC7579UnsupportedModuleType}.
- * Module must be of the given type. Reverts with {ERC7579Utils-ERC7579MismatchedModuleTypeId}.
- * Module must not be already installed. Reverts with {ERC7579Utils-ERC7579AlreadyInstalledModule}.
- Emits a {IERC7579ModuleConfig-ModuleInstalled} event.
- [.contract-item]
- [[AccountERC7579-_uninstallModule-uint256-address-bytes-]]
- ==== `[.contract-item-name]#++_uninstallModule++#++(uint256 moduleTypeId, address module, bytes deInitData)++` [.item-kind]#internal#
- Uninstalls a module of the given type with the given de-initialization data.
- For the fallback module type, the `deInitData` is expected to be the (packed) concatenation of a 4-byte
- selector and the rest of the data to be sent to the handler when calling {IERC7579Module-onUninstall}.
- Requirements:
- * Module must be already installed. Reverts with {ERC7579Utils-ERC7579UninstalledModule} otherwise.
- [.contract-item]
- [[AccountERC7579-_fallback--]]
- ==== `[.contract-item-name]#++_fallback++#++() → bytes++` [.item-kind]#internal#
- Fallback function that delegates the call to the installed handler for the given selector.
- Reverts with {ERC7579MissingFallbackHandler} if the handler is not installed.
- Calls the handler with the original `msg.sender` appended at the end of the calldata following
- the ERC-2771 format.
- [.contract-item]
- [[AccountERC7579-_fallbackHandler-bytes4-]]
- ==== `[.contract-item-name]#++_fallbackHandler++#++(bytes4 selector) → address++` [.item-kind]#internal#
- Returns the fallback handler for the given selector. Returns `address(0)` if not installed.
- [.contract-item]
- [[AccountERC7579-_checkModule-uint256-address-bytes-]]
- ==== `[.contract-item-name]#++_checkModule++#++(uint256 moduleTypeId, address module, bytes additionalContext)++` [.item-kind]#internal#
- Checks if the module is installed. Reverts if the module is not installed.
- [.contract-item]
- [[AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++_extractUserOpValidator++#++(struct PackedUserOperation userOp) → address++` [.item-kind]#internal#
- Extracts the nonce validator from the user operation.
- To construct a nonce key, set nonce as follows:
- ```
- <module address (20 bytes)> | <key (4 bytes)> | <nonce (8 bytes)>
- ```
- NOTE: The default behavior of this function replicates the behavior of
- https://github.com/rhinestonewtf/safe7579/blob/bb29e8b1a66658790c4169e72608e27d220f79be/src/Safe7579.sol#L266[Safe adapter],
- https://github.com/etherspot/etherspot-prime-contracts/blob/cfcdb48c4172cea0d66038324c0bae3288aa8caa/src/modular-etherspot-wallet/wallet/ModularEtherspotWallet.sol#L227[Etherspot's Prime Account], and
- https://github.com/erc7579/erc7579-implementation/blob/16138d1afd4e9711f6c1425133538837bd7787b5/src/MSAAdvanced.sol#L247[ERC7579 reference implementation].
- This is not standardized in ERC-7579 (or in any follow-up ERC). Some accounts may want to override these internal functions.
- For example, https://github.com/bcnmy/nexus/blob/54f4e19baaff96081a8843672977caf712ef19f4/contracts/lib/NonceLib.sol#L17[Biconomy's Nexus]
- uses a similar yet incompatible approach (the validator address is also part of the nonce, but not at the same location)
- [.contract-item]
- [[AccountERC7579-_extractSignatureValidator-bytes-]]
- ==== `[.contract-item-name]#++_extractSignatureValidator++#++(bytes signature) → address module, bytes innerSignature++` [.item-kind]#internal#
- Extracts the signature validator from the signature.
- To construct a signature, set the first 20 bytes as the module address and the remaining bytes as the
- signature data:
- ```
- <module address (20 bytes)> | <signature data>
- ```
- NOTE: The default behavior of this function replicates the behavior of
- https://github.com/rhinestonewtf/safe7579/blob/bb29e8b1a66658790c4169e72608e27d220f79be/src/Safe7579.sol#L350[Safe adapter],
- https://github.com/bcnmy/nexus/blob/54f4e19baaff96081a8843672977caf712ef19f4/contracts/Nexus.sol#L239[Biconomy's Nexus],
- https://github.com/etherspot/etherspot-prime-contracts/blob/cfcdb48c4172cea0d66038324c0bae3288aa8caa/src/modular-etherspot-wallet/wallet/ModularEtherspotWallet.sol#L252[Etherspot's Prime Account], and
- https://github.com/erc7579/erc7579-implementation/blob/16138d1afd4e9711f6c1425133538837bd7787b5/src/MSAAdvanced.sol#L296[ERC7579 reference implementation].
- This is not standardized in ERC-7579 (or in any follow-up ERC). Some accounts may want to override these internal functions.
- [.contract-item]
- [[AccountERC7579-_decodeFallbackData-bytes-]]
- ==== `[.contract-item-name]#++_decodeFallbackData++#++(bytes data) → bytes4 selector, bytes remaining++` [.item-kind]#internal#
- Extract the function selector from initData/deInitData for MODULE_TYPE_FALLBACK
- NOTE: If we had calldata here, we could use calldata slice which are cheaper to manipulate and don't require
- actual copy. However, this would require `_installModule` to get a calldata bytes object instead of a memory
- bytes object. This would prevent calling `_installModule` from a contract constructor and would force the use
- of external initializers. That may change in the future, as most accounts will probably be deployed as
- clones/proxy/ERC-7702 delegates and therefore rely on initializers anyway.
- [.contract-item]
- [[AccountERC7579-_rawSignatureValidation-bytes32-bytes-]]
- ==== `[.contract-item-name]#++_rawSignatureValidation++#++(bytes32, bytes) → bool++` [.item-kind]#internal#
- By default, only use the modules for validation of userOp and signature. Disable raw signatures.
- [.contract-item]
- [[AccountERC7579-ERC7579MissingFallbackHandler-bytes4-]]
- ==== `[.contract-item-name]#++ERC7579MissingFallbackHandler++#++(bytes4 selector)++` [.item-kind]#error#
- The account's {fallback} was called with a selector that doesn't have an installed handler.
- :ERC7579HookModuleAlreadyPresent: pass:normal[xref:#AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-[`++ERC7579HookModuleAlreadyPresent++`]]
- :withHook: pass:normal[xref:#AccountERC7579Hooked-withHook--[`++withHook++`]]
- :accountId: pass:normal[xref:#AccountERC7579Hooked-accountId--[`++accountId++`]]
- :hook: pass:normal[xref:#AccountERC7579Hooked-hook--[`++hook++`]]
- :supportsModule: pass:normal[xref:#AccountERC7579Hooked-supportsModule-uint256-[`++supportsModule++`]]
- :isModuleInstalled: pass:normal[xref:#AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-[`++isModuleInstalled++`]]
- :_installModule: pass:normal[xref:#AccountERC7579Hooked-_installModule-uint256-address-bytes-[`++_installModule++`]]
- :_uninstallModule: pass:normal[xref:#AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-[`++_uninstallModule++`]]
- :_execute: pass:normal[xref:#AccountERC7579Hooked-_execute-Mode-bytes-[`++_execute++`]]
- :_fallback: pass:normal[xref:#AccountERC7579Hooked-_fallback--[`++_fallback++`]]
- :accountId-: pass:normal[xref:#AccountERC7579Hooked-accountId--[`++accountId++`]]
- :hook-: pass:normal[xref:#AccountERC7579Hooked-hook--[`++hook++`]]
- :supportsModule-uint256: pass:normal[xref:#AccountERC7579Hooked-supportsModule-uint256-[`++supportsModule++`]]
- :isModuleInstalled-uint256-address-bytes: pass:normal[xref:#AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-[`++isModuleInstalled++`]]
- :_installModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579Hooked-_installModule-uint256-address-bytes-[`++_installModule++`]]
- :_uninstallModule-uint256-address-bytes: pass:normal[xref:#AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-[`++_uninstallModule++`]]
- :_execute-Mode-bytes: pass:normal[xref:#AccountERC7579Hooked-_execute-Mode-bytes-[`++_execute++`]]
- :_fallback-: pass:normal[xref:#AccountERC7579Hooked-_fallback--[`++_fallback++`]]
- [.contract]
- [[AccountERC7579Hooked]]
- === `++AccountERC7579Hooked++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/extensions/draft-AccountERC7579Hooked.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";
- ```
- Extension of {AccountERC7579} with support for a single hook module (type 4).
- If installed, this extension will call the hook module's {IERC7579Hook-preCheck} before executing any operation
- with {_execute} (including {execute} and {executeFromExecutor} by default) and {IERC7579Hook-postCheck} thereafter.
- NOTE: Hook modules break the check-effect-interaction pattern. In particular, the {IERC7579Hook-preCheck} hook can
- lead to potentially dangerous reentrancy. Using the `withHook()` modifier is safe if no effect is performed
- before the preHook or after the postHook. That is the case on all functions here, but it may not be the case if
- functions that have this modifier are overridden. Developers should be extremely careful when implementing hook
- modules or further overriding functions that involve hooks.
- [.contract-index]
- .Modifiers
- --
- * {xref-AccountERC7579Hooked-withHook--}[`++withHook()++`]
- --
- [.contract-index]
- .Functions
- --
- * {xref-AccountERC7579Hooked-accountId--}[`++accountId()++`]
- * {xref-AccountERC7579Hooked-hook--}[`++hook()++`]
- * {xref-AccountERC7579Hooked-supportsModule-uint256-}[`++supportsModule(moduleTypeId)++`]
- * {xref-AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-}[`++isModuleInstalled(moduleTypeId, module, data)++`]
- * {xref-AccountERC7579Hooked-_installModule-uint256-address-bytes-}[`++_installModule(moduleTypeId, module, initData)++`]
- * {xref-AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-}[`++_uninstallModule(moduleTypeId, module, deInitData)++`]
- * {xref-AccountERC7579Hooked-_execute-Mode-bytes-}[`++_execute(mode, executionCalldata)++`]
- * {xref-AccountERC7579Hooked-_fallback--}[`++_fallback()++`]
- [.contract-subindex-inherited]
- .AccountERC7579
- * {xref-AccountERC7579-fallback-bytes-}[`++fallback()++`]
- * {xref-AccountERC7579-supportsExecutionMode-bytes32-}[`++supportsExecutionMode(encodedMode)++`]
- * {xref-AccountERC7579-installModule-uint256-address-bytes-}[`++installModule(moduleTypeId, module, initData)++`]
- * {xref-AccountERC7579-uninstallModule-uint256-address-bytes-}[`++uninstallModule(moduleTypeId, module, deInitData)++`]
- * {xref-AccountERC7579-execute-bytes32-bytes-}[`++execute(mode, executionCalldata)++`]
- * {xref-AccountERC7579-executeFromExecutor-bytes32-bytes-}[`++executeFromExecutor(mode, executionCalldata)++`]
- * {xref-AccountERC7579-isValidSignature-bytes32-bytes-}[`++isValidSignature(hash, signature)++`]
- * {xref-AccountERC7579-_validateUserOp-struct-PackedUserOperation-bytes32-}[`++_validateUserOp(userOp, userOpHash)++`]
- * {xref-AccountERC7579-_fallbackHandler-bytes4-}[`++_fallbackHandler(selector)++`]
- * {xref-AccountERC7579-_checkModule-uint256-address-bytes-}[`++_checkModule(moduleTypeId, module, additionalContext)++`]
- * {xref-AccountERC7579-_extractUserOpValidator-struct-PackedUserOperation-}[`++_extractUserOpValidator(userOp)++`]
- * {xref-AccountERC7579-_extractSignatureValidator-bytes-}[`++_extractSignatureValidator(signature)++`]
- * {xref-AccountERC7579-_decodeFallbackData-bytes-}[`++_decodeFallbackData(data)++`]
- * {xref-AccountERC7579-_rawSignatureValidation-bytes32-bytes-}[`++_rawSignatureValidation(, )++`]
- [.contract-subindex-inherited]
- .IERC7579ModuleConfig
- [.contract-subindex-inherited]
- .IERC7579AccountConfig
- [.contract-subindex-inherited]
- .IERC7579Execution
- [.contract-subindex-inherited]
- .IERC1271
- [.contract-subindex-inherited]
- .Account
- * {xref-Account-entryPoint--}[`++entryPoint()++`]
- * {xref-Account-getNonce--}[`++getNonce()++`]
- * {xref-Account-getNonce-uint192-}[`++getNonce(key)++`]
- * {xref-Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-}[`++validateUserOp(userOp, userOpHash, missingAccountFunds)++`]
- * {xref-Account-_signableUserOpHash-struct-PackedUserOperation-bytes32-}[`++_signableUserOpHash(, userOpHash)++`]
- * {xref-Account-_payPrefund-uint256-}[`++_payPrefund(missingAccountFunds)++`]
- * {xref-Account-_checkEntryPoint--}[`++_checkEntryPoint()++`]
- * {xref-Account-_checkEntryPointOrSelf--}[`++_checkEntryPointOrSelf()++`]
- * {xref-Account-receive--}[`++receive()++`]
- [.contract-subindex-inherited]
- .IAccount
- [.contract-subindex-inherited]
- .AbstractSigner
- --
- [.contract-index]
- .Events
- --
- [.contract-subindex-inherited]
- .AccountERC7579
- [.contract-subindex-inherited]
- .IERC7579ModuleConfig
- * {xref-IERC7579ModuleConfig-ModuleInstalled-uint256-address-}[`++ModuleInstalled(moduleTypeId, module)++`]
- * {xref-IERC7579ModuleConfig-ModuleUninstalled-uint256-address-}[`++ModuleUninstalled(moduleTypeId, module)++`]
- [.contract-subindex-inherited]
- .IERC7579AccountConfig
- [.contract-subindex-inherited]
- .IERC7579Execution
- [.contract-subindex-inherited]
- .IERC1271
- [.contract-subindex-inherited]
- .Account
- [.contract-subindex-inherited]
- .IAccount
- [.contract-subindex-inherited]
- .AbstractSigner
- --
- [.contract-index]
- .Errors
- --
- * {xref-AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-}[`++ERC7579HookModuleAlreadyPresent(hook)++`]
- [.contract-subindex-inherited]
- .AccountERC7579
- * {xref-AccountERC7579-ERC7579MissingFallbackHandler-bytes4-}[`++ERC7579MissingFallbackHandler(selector)++`]
- [.contract-subindex-inherited]
- .IERC7579ModuleConfig
- [.contract-subindex-inherited]
- .IERC7579AccountConfig
- [.contract-subindex-inherited]
- .IERC7579Execution
- [.contract-subindex-inherited]
- .IERC1271
- [.contract-subindex-inherited]
- .Account
- * {xref-Account-AccountUnauthorized-address-}[`++AccountUnauthorized(sender)++`]
- [.contract-subindex-inherited]
- .IAccount
- [.contract-subindex-inherited]
- .AbstractSigner
- --
- [.contract-item]
- [[AccountERC7579Hooked-withHook--]]
- ==== `[.contract-item-name]#++withHook++#++()++` [.item-kind]#modifier#
- Calls {IERC7579Hook-preCheck} before executing the modified function and {IERC7579Hook-postCheck}
- thereafter.
- [.contract-item]
- [[AccountERC7579Hooked-accountId--]]
- ==== `[.contract-item-name]#++accountId++#++() → string++` [.item-kind]#public#
- Returns the account id of the smart account
- [.contract-item]
- [[AccountERC7579Hooked-hook--]]
- ==== `[.contract-item-name]#++hook++#++() → address++` [.item-kind]#public#
- Returns the hook module address if installed, or `address(0)` otherwise.
- [.contract-item]
- [[AccountERC7579Hooked-supportsModule-uint256-]]
- ==== `[.contract-item-name]#++supportsModule++#++(uint256 moduleTypeId) → bool++` [.item-kind]#public#
- Supports hook modules. See {AccountERC7579-supportsModule}
- [.contract-item]
- [[AccountERC7579Hooked-isModuleInstalled-uint256-address-bytes-]]
- ==== `[.contract-item-name]#++isModuleInstalled++#++(uint256 moduleTypeId, address module, bytes data) → bool++` [.item-kind]#public#
- Returns whether a module is installed on the smart account
- [.contract-item]
- [[AccountERC7579Hooked-_installModule-uint256-address-bytes-]]
- ==== `[.contract-item-name]#++_installModule++#++(uint256 moduleTypeId, address module, bytes initData)++` [.item-kind]#internal#
- Installs a module with support for hook modules. See {AccountERC7579-_installModule}
- [.contract-item]
- [[AccountERC7579Hooked-_uninstallModule-uint256-address-bytes-]]
- ==== `[.contract-item-name]#++_uninstallModule++#++(uint256 moduleTypeId, address module, bytes deInitData)++` [.item-kind]#internal#
- Uninstalls a module with support for hook modules. See {AccountERC7579-_uninstallModule}
- [.contract-item]
- [[AccountERC7579Hooked-_execute-Mode-bytes-]]
- ==== `[.contract-item-name]#++_execute++#++(Mode mode, bytes executionCalldata) → bytes[]++` [.item-kind]#internal#
- Hooked version of {AccountERC7579-_execute}.
- [.contract-item]
- [[AccountERC7579Hooked-_fallback--]]
- ==== `[.contract-item-name]#++_fallback++#++() → bytes++` [.item-kind]#internal#
- Hooked version of {AccountERC7579-_fallback}.
- [.contract-item]
- [[AccountERC7579Hooked-ERC7579HookModuleAlreadyPresent-address-]]
- ==== `[.contract-item-name]#++ERC7579HookModuleAlreadyPresent++#++(address hook)++` [.item-kind]#error#
- A hook module is already present. This contract only supports one hook module.
- :UnsupportedExecutionMode: pass:normal[xref:#ERC7821-UnsupportedExecutionMode--[`++UnsupportedExecutionMode++`]]
- :execute: pass:normal[xref:#ERC7821-execute-bytes32-bytes-[`++execute++`]]
- :supportsExecutionMode: pass:normal[xref:#ERC7821-supportsExecutionMode-bytes32-[`++supportsExecutionMode++`]]
- :_erc7821AuthorizedExecutor: pass:normal[xref:#ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-[`++_erc7821AuthorizedExecutor++`]]
- :execute-bytes32-bytes: pass:normal[xref:#ERC7821-execute-bytes32-bytes-[`++execute++`]]
- :supportsExecutionMode-bytes32: pass:normal[xref:#ERC7821-supportsExecutionMode-bytes32-[`++supportsExecutionMode++`]]
- :_erc7821AuthorizedExecutor-address-bytes32-bytes: pass:normal[xref:#ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-[`++_erc7821AuthorizedExecutor++`]]
- [.contract]
- [[ERC7821]]
- === `++ERC7821++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/extensions/draft-ERC7821.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";
- ```
- Minimal batch executor following ERC-7821.
- Only supports supports single batch mode (`0x01000000000000000000`). Does not support optional "opData".
- @custom:stateless
- [.contract-index]
- .Functions
- --
- * {xref-ERC7821-execute-bytes32-bytes-}[`++execute(mode, executionData)++`]
- * {xref-ERC7821-supportsExecutionMode-bytes32-}[`++supportsExecutionMode(mode)++`]
- * {xref-ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-}[`++_erc7821AuthorizedExecutor(caller, , )++`]
- [.contract-subindex-inherited]
- .IERC7821
- --
- [.contract-index]
- .Errors
- --
- * {xref-ERC7821-UnsupportedExecutionMode--}[`++UnsupportedExecutionMode()++`]
- [.contract-subindex-inherited]
- .IERC7821
- --
- [.contract-item]
- [[ERC7821-execute-bytes32-bytes-]]
- ==== `[.contract-item-name]#++execute++#++(bytes32 mode, bytes executionData)++` [.item-kind]#public#
- Executes the calls in `executionData` with no optional `opData` support.
- NOTE: Access to this function is controlled by {_erc7821AuthorizedExecutor}. Changing access permissions, for
- example to approve calls by the ERC-4337 entrypoint, should be implemented by overriding it.
- Reverts and bubbles up error if any call fails.
- [.contract-item]
- [[ERC7821-supportsExecutionMode-bytes32-]]
- ==== `[.contract-item-name]#++supportsExecutionMode++#++(bytes32 mode) → bool result++` [.item-kind]#public#
- This function is provided for frontends to detect support.
- Only returns true for:
- - `bytes32(0x01000000000000000000...)`: does not support optional `opData`.
- - `bytes32(0x01000000000078210001...)`: supports optional `opData`.
- [.contract-item]
- [[ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-]]
- ==== `[.contract-item-name]#++_erc7821AuthorizedExecutor++#++(address caller, bytes32, bytes) → bool++` [.item-kind]#internal#
- Access control mechanism for the {execute} function.
- By default, only the contract itself is allowed to execute.
- Override this function to implement custom access control, for example to allow the
- ERC-4337 entrypoint to execute.
- ```solidity
- function _erc7821AuthorizedExecutor(
- address caller,
- bytes32 mode,
- bytes calldata executionData
- ) internal view virtual override returns (bool) {
- return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);
- }
- ```
- [.contract-item]
- [[ERC7821-UnsupportedExecutionMode--]]
- ==== `[.contract-item-name]#++UnsupportedExecutionMode++#++()++` [.item-kind]#error#
- == Utilities
- :ENTRYPOINT_V07: pass:normal[xref:#ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint[`++ENTRYPOINT_V07++`]]
- :ENTRYPOINT_V08: pass:normal[xref:#ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint[`++ENTRYPOINT_V08++`]]
- :SIG_VALIDATION_SUCCESS: pass:normal[xref:#ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256[`++SIG_VALIDATION_SUCCESS++`]]
- :SIG_VALIDATION_FAILED: pass:normal[xref:#ERC4337Utils-SIG_VALIDATION_FAILED-uint256[`++SIG_VALIDATION_FAILED++`]]
- :parseValidationData: pass:normal[xref:#ERC4337Utils-parseValidationData-uint256-[`++parseValidationData++`]]
- :packValidationData: pass:normal[xref:#ERC4337Utils-packValidationData-address-uint48-uint48-[`++packValidationData++`]]
- :packValidationData: pass:normal[xref:#ERC4337Utils-packValidationData-bool-uint48-uint48-[`++packValidationData++`]]
- :combineValidationData: pass:normal[xref:#ERC4337Utils-combineValidationData-uint256-uint256-[`++combineValidationData++`]]
- :getValidationData: pass:normal[xref:#ERC4337Utils-getValidationData-uint256-[`++getValidationData++`]]
- :hash: pass:normal[xref:#ERC4337Utils-hash-struct-PackedUserOperation-address-[`++hash++`]]
- :factory: pass:normal[xref:#ERC4337Utils-factory-struct-PackedUserOperation-[`++factory++`]]
- :factoryData: pass:normal[xref:#ERC4337Utils-factoryData-struct-PackedUserOperation-[`++factoryData++`]]
- :verificationGasLimit: pass:normal[xref:#ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-[`++verificationGasLimit++`]]
- :callGasLimit: pass:normal[xref:#ERC4337Utils-callGasLimit-struct-PackedUserOperation-[`++callGasLimit++`]]
- :maxPriorityFeePerGas: pass:normal[xref:#ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-[`++maxPriorityFeePerGas++`]]
- :maxFeePerGas: pass:normal[xref:#ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-[`++maxFeePerGas++`]]
- :gasPrice: pass:normal[xref:#ERC4337Utils-gasPrice-struct-PackedUserOperation-[`++gasPrice++`]]
- :paymaster: pass:normal[xref:#ERC4337Utils-paymaster-struct-PackedUserOperation-[`++paymaster++`]]
- :paymasterVerificationGasLimit: pass:normal[xref:#ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-[`++paymasterVerificationGasLimit++`]]
- :paymasterPostOpGasLimit: pass:normal[xref:#ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-[`++paymasterPostOpGasLimit++`]]
- :paymasterData: pass:normal[xref:#ERC4337Utils-paymasterData-struct-PackedUserOperation-[`++paymasterData++`]]
- :parseValidationData-uint256: pass:normal[xref:#ERC4337Utils-parseValidationData-uint256-[`++parseValidationData++`]]
- :packValidationData-address-uint48-uint48: pass:normal[xref:#ERC4337Utils-packValidationData-address-uint48-uint48-[`++packValidationData++`]]
- :packValidationData-bool-uint48-uint48: pass:normal[xref:#ERC4337Utils-packValidationData-bool-uint48-uint48-[`++packValidationData++`]]
- :combineValidationData-uint256-uint256: pass:normal[xref:#ERC4337Utils-combineValidationData-uint256-uint256-[`++combineValidationData++`]]
- :getValidationData-uint256: pass:normal[xref:#ERC4337Utils-getValidationData-uint256-[`++getValidationData++`]]
- :hash-struct-PackedUserOperation-address: pass:normal[xref:#ERC4337Utils-hash-struct-PackedUserOperation-address-[`++hash++`]]
- :factory-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-factory-struct-PackedUserOperation-[`++factory++`]]
- :factoryData-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-factoryData-struct-PackedUserOperation-[`++factoryData++`]]
- :verificationGasLimit-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-[`++verificationGasLimit++`]]
- :callGasLimit-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-callGasLimit-struct-PackedUserOperation-[`++callGasLimit++`]]
- :maxPriorityFeePerGas-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-[`++maxPriorityFeePerGas++`]]
- :maxFeePerGas-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-[`++maxFeePerGas++`]]
- :gasPrice-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-gasPrice-struct-PackedUserOperation-[`++gasPrice++`]]
- :paymaster-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-paymaster-struct-PackedUserOperation-[`++paymaster++`]]
- :paymasterVerificationGasLimit-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-[`++paymasterVerificationGasLimit++`]]
- :paymasterPostOpGasLimit-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-[`++paymasterPostOpGasLimit++`]]
- :paymasterData-struct-PackedUserOperation: pass:normal[xref:#ERC4337Utils-paymasterData-struct-PackedUserOperation-[`++paymasterData++`]]
- [.contract]
- [[ERC4337Utils]]
- === `++ERC4337Utils++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/utils/draft-ERC4337Utils.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol";
- ```
- Library with common ERC-4337 utility functions.
- See https://eips.ethereum.org/EIPS/eip-4337[ERC-4337].
- [.contract-index]
- .Functions
- --
- * {xref-ERC4337Utils-parseValidationData-uint256-}[`++parseValidationData(validationData)++`]
- * {xref-ERC4337Utils-packValidationData-address-uint48-uint48-}[`++packValidationData(aggregator, validAfter, validUntil)++`]
- * {xref-ERC4337Utils-packValidationData-bool-uint48-uint48-}[`++packValidationData(sigSuccess, validAfter, validUntil)++`]
- * {xref-ERC4337Utils-combineValidationData-uint256-uint256-}[`++combineValidationData(validationData1, validationData2)++`]
- * {xref-ERC4337Utils-getValidationData-uint256-}[`++getValidationData(validationData)++`]
- * {xref-ERC4337Utils-hash-struct-PackedUserOperation-address-}[`++hash(self, entrypoint)++`]
- * {xref-ERC4337Utils-factory-struct-PackedUserOperation-}[`++factory(self)++`]
- * {xref-ERC4337Utils-factoryData-struct-PackedUserOperation-}[`++factoryData(self)++`]
- * {xref-ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-}[`++verificationGasLimit(self)++`]
- * {xref-ERC4337Utils-callGasLimit-struct-PackedUserOperation-}[`++callGasLimit(self)++`]
- * {xref-ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-}[`++maxPriorityFeePerGas(self)++`]
- * {xref-ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-}[`++maxFeePerGas(self)++`]
- * {xref-ERC4337Utils-gasPrice-struct-PackedUserOperation-}[`++gasPrice(self)++`]
- * {xref-ERC4337Utils-paymaster-struct-PackedUserOperation-}[`++paymaster(self)++`]
- * {xref-ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-}[`++paymasterVerificationGasLimit(self)++`]
- * {xref-ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-}[`++paymasterPostOpGasLimit(self)++`]
- * {xref-ERC4337Utils-paymasterData-struct-PackedUserOperation-}[`++paymasterData(self)++`]
- --
- [.contract-index]
- .Internal Variables
- --
- * {xref-ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint}[`++contract IEntryPoint constant ENTRYPOINT_V07++`]
- * {xref-ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint}[`++contract IEntryPoint constant ENTRYPOINT_V08++`]
- * {xref-ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256}[`++uint256 constant SIG_VALIDATION_SUCCESS++`]
- * {xref-ERC4337Utils-SIG_VALIDATION_FAILED-uint256}[`++uint256 constant SIG_VALIDATION_FAILED++`]
- --
- [.contract-item]
- [[ERC4337Utils-parseValidationData-uint256-]]
- ==== `[.contract-item-name]#++parseValidationData++#++(uint256 validationData) → address aggregator, uint48 validAfter, uint48 validUntil++` [.item-kind]#internal#
- Parses the validation data into its components. See {packValidationData}.
- [.contract-item]
- [[ERC4337Utils-packValidationData-address-uint48-uint48-]]
- ==== `[.contract-item-name]#++packValidationData++#++(address aggregator, uint48 validAfter, uint48 validUntil) → uint256++` [.item-kind]#internal#
- Packs the validation data into a single uint256. See {parseValidationData}.
- [.contract-item]
- [[ERC4337Utils-packValidationData-bool-uint48-uint48-]]
- ==== `[.contract-item-name]#++packValidationData++#++(bool sigSuccess, uint48 validAfter, uint48 validUntil) → uint256++` [.item-kind]#internal#
- Same as {packValidationData}, but with a boolean signature success flag.
- [.contract-item]
- [[ERC4337Utils-combineValidationData-uint256-uint256-]]
- ==== `[.contract-item-name]#++combineValidationData++#++(uint256 validationData1, uint256 validationData2) → uint256++` [.item-kind]#internal#
- Combines two validation data into a single one.
- The `aggregator` is set to {SIG_VALIDATION_SUCCESS} if both are successful, while
- the `validAfter` is the maximum and the `validUntil` is the minimum of both.
- [.contract-item]
- [[ERC4337Utils-getValidationData-uint256-]]
- ==== `[.contract-item-name]#++getValidationData++#++(uint256 validationData) → address aggregator, bool outOfTimeRange++` [.item-kind]#internal#
- Returns the aggregator of the `validationData` and whether it is out of time range.
- [.contract-item]
- [[ERC4337Utils-hash-struct-PackedUserOperation-address-]]
- ==== `[.contract-item-name]#++hash++#++(struct PackedUserOperation self, address entrypoint) → bytes32++` [.item-kind]#internal#
- Get the hash of a user operation for a given entrypoint
- [.contract-item]
- [[ERC4337Utils-factory-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++factory++#++(struct PackedUserOperation self) → address++` [.item-kind]#internal#
- Returns `factory` from the {PackedUserOperation}, or address(0) if the initCode is empty or not properly formatted.
- [.contract-item]
- [[ERC4337Utils-factoryData-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++factoryData++#++(struct PackedUserOperation self) → bytes++` [.item-kind]#internal#
- Returns `factoryData` from the {PackedUserOperation}, or empty bytes if the initCode is empty or not properly formatted.
- [.contract-item]
- [[ERC4337Utils-verificationGasLimit-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++verificationGasLimit++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
- Returns `verificationGasLimit` from the {PackedUserOperation}.
- [.contract-item]
- [[ERC4337Utils-callGasLimit-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++callGasLimit++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
- Returns `callGasLimit` from the {PackedUserOperation}.
- [.contract-item]
- [[ERC4337Utils-maxPriorityFeePerGas-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++maxPriorityFeePerGas++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
- Returns the first section of `gasFees` from the {PackedUserOperation}.
- [.contract-item]
- [[ERC4337Utils-maxFeePerGas-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++maxFeePerGas++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
- Returns the second section of `gasFees` from the {PackedUserOperation}.
- [.contract-item]
- [[ERC4337Utils-gasPrice-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++gasPrice++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
- Returns the total gas price for the {PackedUserOperation} (ie. `maxFeePerGas` or `maxPriorityFeePerGas + basefee`).
- [.contract-item]
- [[ERC4337Utils-paymaster-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++paymaster++#++(struct PackedUserOperation self) → address++` [.item-kind]#internal#
- Returns the first section of `paymasterAndData` from the {PackedUserOperation}.
- [.contract-item]
- [[ERC4337Utils-paymasterVerificationGasLimit-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++paymasterVerificationGasLimit++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
- Returns the second section of `paymasterAndData` from the {PackedUserOperation}.
- [.contract-item]
- [[ERC4337Utils-paymasterPostOpGasLimit-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++paymasterPostOpGasLimit++#++(struct PackedUserOperation self) → uint256++` [.item-kind]#internal#
- Returns the third section of `paymasterAndData` from the {PackedUserOperation}.
- [.contract-item]
- [[ERC4337Utils-paymasterData-struct-PackedUserOperation-]]
- ==== `[.contract-item-name]#++paymasterData++#++(struct PackedUserOperation self) → bytes++` [.item-kind]#internal#
- Returns the fourth section of `paymasterAndData` from the {PackedUserOperation}.
- [.contract-item]
- [[ERC4337Utils-ENTRYPOINT_V07-contract-IEntryPoint]]
- ==== `contract IEntryPoint [.contract-item-name]#++ENTRYPOINT_V07++#` [.item-kind]#internal constant#
- Address of the entrypoint v0.7.0
- [.contract-item]
- [[ERC4337Utils-ENTRYPOINT_V08-contract-IEntryPoint]]
- ==== `contract IEntryPoint [.contract-item-name]#++ENTRYPOINT_V08++#` [.item-kind]#internal constant#
- Address of the entrypoint v0.8.0
- [.contract-item]
- [[ERC4337Utils-SIG_VALIDATION_SUCCESS-uint256]]
- ==== `uint256 [.contract-item-name]#++SIG_VALIDATION_SUCCESS++#` [.item-kind]#internal constant#
- For simulation purposes, validateUserOp (and validatePaymasterUserOp) return this value on success.
- [.contract-item]
- [[ERC4337Utils-SIG_VALIDATION_FAILED-uint256]]
- ==== `uint256 [.contract-item-name]#++SIG_VALIDATION_FAILED++#` [.item-kind]#internal constant#
- For simulation purposes, validateUserOp (and validatePaymasterUserOp) must return this value in case of signature failure, instead of revert.
- :CALLTYPE_SINGLE: pass:normal[xref:#ERC7579Utils-CALLTYPE_SINGLE-CallType[`++CALLTYPE_SINGLE++`]]
- :CALLTYPE_BATCH: pass:normal[xref:#ERC7579Utils-CALLTYPE_BATCH-CallType[`++CALLTYPE_BATCH++`]]
- :CALLTYPE_DELEGATECALL: pass:normal[xref:#ERC7579Utils-CALLTYPE_DELEGATECALL-CallType[`++CALLTYPE_DELEGATECALL++`]]
- :EXECTYPE_DEFAULT: pass:normal[xref:#ERC7579Utils-EXECTYPE_DEFAULT-ExecType[`++EXECTYPE_DEFAULT++`]]
- :EXECTYPE_TRY: pass:normal[xref:#ERC7579Utils-EXECTYPE_TRY-ExecType[`++EXECTYPE_TRY++`]]
- :ERC7579TryExecuteFail: pass:normal[xref:#ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-[`++ERC7579TryExecuteFail++`]]
- :ERC7579UnsupportedCallType: pass:normal[xref:#ERC7579Utils-ERC7579UnsupportedCallType-CallType-[`++ERC7579UnsupportedCallType++`]]
- :ERC7579UnsupportedExecType: pass:normal[xref:#ERC7579Utils-ERC7579UnsupportedExecType-ExecType-[`++ERC7579UnsupportedExecType++`]]
- :ERC7579MismatchedModuleTypeId: pass:normal[xref:#ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-[`++ERC7579MismatchedModuleTypeId++`]]
- :ERC7579UninstalledModule: pass:normal[xref:#ERC7579Utils-ERC7579UninstalledModule-uint256-address-[`++ERC7579UninstalledModule++`]]
- :ERC7579AlreadyInstalledModule: pass:normal[xref:#ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-[`++ERC7579AlreadyInstalledModule++`]]
- :ERC7579UnsupportedModuleType: pass:normal[xref:#ERC7579Utils-ERC7579UnsupportedModuleType-uint256-[`++ERC7579UnsupportedModuleType++`]]
- :ERC7579DecodingError: pass:normal[xref:#ERC7579Utils-ERC7579DecodingError--[`++ERC7579DecodingError++`]]
- :execSingle: pass:normal[xref:#ERC7579Utils-execSingle-bytes-ExecType-[`++execSingle++`]]
- :execBatch: pass:normal[xref:#ERC7579Utils-execBatch-bytes-ExecType-[`++execBatch++`]]
- :execDelegateCall: pass:normal[xref:#ERC7579Utils-execDelegateCall-bytes-ExecType-[`++execDelegateCall++`]]
- :encodeMode: pass:normal[xref:#ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-[`++encodeMode++`]]
- :decodeMode: pass:normal[xref:#ERC7579Utils-decodeMode-Mode-[`++decodeMode++`]]
- :encodeSingle: pass:normal[xref:#ERC7579Utils-encodeSingle-address-uint256-bytes-[`++encodeSingle++`]]
- :decodeSingle: pass:normal[xref:#ERC7579Utils-decodeSingle-bytes-[`++decodeSingle++`]]
- :encodeDelegate: pass:normal[xref:#ERC7579Utils-encodeDelegate-address-bytes-[`++encodeDelegate++`]]
- :decodeDelegate: pass:normal[xref:#ERC7579Utils-decodeDelegate-bytes-[`++decodeDelegate++`]]
- :encodeBatch: pass:normal[xref:#ERC7579Utils-encodeBatch-struct-Execution---[`++encodeBatch++`]]
- :decodeBatch: pass:normal[xref:#ERC7579Utils-decodeBatch-bytes-[`++decodeBatch++`]]
- :execSingle-bytes-ExecType: pass:normal[xref:#ERC7579Utils-execSingle-bytes-ExecType-[`++execSingle++`]]
- :execBatch-bytes-ExecType: pass:normal[xref:#ERC7579Utils-execBatch-bytes-ExecType-[`++execBatch++`]]
- :execDelegateCall-bytes-ExecType: pass:normal[xref:#ERC7579Utils-execDelegateCall-bytes-ExecType-[`++execDelegateCall++`]]
- :encodeMode-CallType-ExecType-ModeSelector-ModePayload: pass:normal[xref:#ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-[`++encodeMode++`]]
- :decodeMode-Mode: pass:normal[xref:#ERC7579Utils-decodeMode-Mode-[`++decodeMode++`]]
- :encodeSingle-address-uint256-bytes: pass:normal[xref:#ERC7579Utils-encodeSingle-address-uint256-bytes-[`++encodeSingle++`]]
- :decodeSingle-bytes: pass:normal[xref:#ERC7579Utils-decodeSingle-bytes-[`++decodeSingle++`]]
- :encodeDelegate-address-bytes: pass:normal[xref:#ERC7579Utils-encodeDelegate-address-bytes-[`++encodeDelegate++`]]
- :decodeDelegate-bytes: pass:normal[xref:#ERC7579Utils-decodeDelegate-bytes-[`++decodeDelegate++`]]
- :encodeBatch-struct-Execution--: pass:normal[xref:#ERC7579Utils-encodeBatch-struct-Execution---[`++encodeBatch++`]]
- :decodeBatch-bytes: pass:normal[xref:#ERC7579Utils-decodeBatch-bytes-[`++decodeBatch++`]]
- [.contract]
- [[ERC7579Utils]]
- === `++ERC7579Utils++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.4.0/contracts/account/utils/draft-ERC7579Utils.sol[{github-icon},role=heading-link]
- [.hljs-theme-light.nopadding]
- ```solidity
- import "@openzeppelin/contracts/account/utils/draft-ERC7579Utils.sol";
- ```
- Library with common ERC-7579 utility functions.
- See https://eips.ethereum.org/EIPS/eip-7579[ERC-7579].
- [.contract-index]
- .Functions
- --
- * {xref-ERC7579Utils-execSingle-bytes-ExecType-}[`++execSingle(executionCalldata, execType)++`]
- * {xref-ERC7579Utils-execBatch-bytes-ExecType-}[`++execBatch(executionCalldata, execType)++`]
- * {xref-ERC7579Utils-execDelegateCall-bytes-ExecType-}[`++execDelegateCall(executionCalldata, execType)++`]
- * {xref-ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-}[`++encodeMode(callType, execType, selector, payload)++`]
- * {xref-ERC7579Utils-decodeMode-Mode-}[`++decodeMode(mode)++`]
- * {xref-ERC7579Utils-encodeSingle-address-uint256-bytes-}[`++encodeSingle(target, value, callData)++`]
- * {xref-ERC7579Utils-decodeSingle-bytes-}[`++decodeSingle(executionCalldata)++`]
- * {xref-ERC7579Utils-encodeDelegate-address-bytes-}[`++encodeDelegate(target, callData)++`]
- * {xref-ERC7579Utils-decodeDelegate-bytes-}[`++decodeDelegate(executionCalldata)++`]
- * {xref-ERC7579Utils-encodeBatch-struct-Execution---}[`++encodeBatch(executionBatch)++`]
- * {xref-ERC7579Utils-decodeBatch-bytes-}[`++decodeBatch(executionCalldata)++`]
- --
- [.contract-index]
- .Events
- --
- * {xref-ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-}[`++ERC7579TryExecuteFail(batchExecutionIndex, returndata)++`]
- --
- [.contract-index]
- .Errors
- --
- * {xref-ERC7579Utils-ERC7579UnsupportedCallType-CallType-}[`++ERC7579UnsupportedCallType(callType)++`]
- * {xref-ERC7579Utils-ERC7579UnsupportedExecType-ExecType-}[`++ERC7579UnsupportedExecType(execType)++`]
- * {xref-ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-}[`++ERC7579MismatchedModuleTypeId(moduleTypeId, module)++`]
- * {xref-ERC7579Utils-ERC7579UninstalledModule-uint256-address-}[`++ERC7579UninstalledModule(moduleTypeId, module)++`]
- * {xref-ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-}[`++ERC7579AlreadyInstalledModule(moduleTypeId, module)++`]
- * {xref-ERC7579Utils-ERC7579UnsupportedModuleType-uint256-}[`++ERC7579UnsupportedModuleType(moduleTypeId)++`]
- * {xref-ERC7579Utils-ERC7579DecodingError--}[`++ERC7579DecodingError()++`]
- --
- [.contract-index]
- .Internal Variables
- --
- * {xref-ERC7579Utils-CALLTYPE_SINGLE-CallType}[`++CallType constant CALLTYPE_SINGLE++`]
- * {xref-ERC7579Utils-CALLTYPE_BATCH-CallType}[`++CallType constant CALLTYPE_BATCH++`]
- * {xref-ERC7579Utils-CALLTYPE_DELEGATECALL-CallType}[`++CallType constant CALLTYPE_DELEGATECALL++`]
- * {xref-ERC7579Utils-EXECTYPE_DEFAULT-ExecType}[`++ExecType constant EXECTYPE_DEFAULT++`]
- * {xref-ERC7579Utils-EXECTYPE_TRY-ExecType}[`++ExecType constant EXECTYPE_TRY++`]
- --
- [.contract-item]
- [[ERC7579Utils-execSingle-bytes-ExecType-]]
- ==== `[.contract-item-name]#++execSingle++#++(bytes executionCalldata, ExecType execType) → bytes[] returnData++` [.item-kind]#internal#
- Executes a single call.
- [.contract-item]
- [[ERC7579Utils-execBatch-bytes-ExecType-]]
- ==== `[.contract-item-name]#++execBatch++#++(bytes executionCalldata, ExecType execType) → bytes[] returnData++` [.item-kind]#internal#
- Executes a batch of calls.
- [.contract-item]
- [[ERC7579Utils-execDelegateCall-bytes-ExecType-]]
- ==== `[.contract-item-name]#++execDelegateCall++#++(bytes executionCalldata, ExecType execType) → bytes[] returnData++` [.item-kind]#internal#
- Executes a delegate call.
- [.contract-item]
- [[ERC7579Utils-encodeMode-CallType-ExecType-ModeSelector-ModePayload-]]
- ==== `[.contract-item-name]#++encodeMode++#++(CallType callType, ExecType execType, ModeSelector selector, ModePayload payload) → Mode mode++` [.item-kind]#internal#
- Encodes the mode with the provided parameters. See {decodeMode}.
- [.contract-item]
- [[ERC7579Utils-decodeMode-Mode-]]
- ==== `[.contract-item-name]#++decodeMode++#++(Mode mode) → CallType callType, ExecType execType, ModeSelector selector, ModePayload payload++` [.item-kind]#internal#
- Decodes the mode into its parameters. See {encodeMode}.
- [.contract-item]
- [[ERC7579Utils-encodeSingle-address-uint256-bytes-]]
- ==== `[.contract-item-name]#++encodeSingle++#++(address target, uint256 value, bytes callData) → bytes executionCalldata++` [.item-kind]#internal#
- Encodes a single call execution. See {decodeSingle}.
- [.contract-item]
- [[ERC7579Utils-decodeSingle-bytes-]]
- ==== `[.contract-item-name]#++decodeSingle++#++(bytes executionCalldata) → address target, uint256 value, bytes callData++` [.item-kind]#internal#
- Decodes a single call execution. See {encodeSingle}.
- [.contract-item]
- [[ERC7579Utils-encodeDelegate-address-bytes-]]
- ==== `[.contract-item-name]#++encodeDelegate++#++(address target, bytes callData) → bytes executionCalldata++` [.item-kind]#internal#
- Encodes a delegate call execution. See {decodeDelegate}.
- [.contract-item]
- [[ERC7579Utils-decodeDelegate-bytes-]]
- ==== `[.contract-item-name]#++decodeDelegate++#++(bytes executionCalldata) → address target, bytes callData++` [.item-kind]#internal#
- Decodes a delegate call execution. See {encodeDelegate}.
- [.contract-item]
- [[ERC7579Utils-encodeBatch-struct-Execution---]]
- ==== `[.contract-item-name]#++encodeBatch++#++(struct Execution[] executionBatch) → bytes executionCalldata++` [.item-kind]#internal#
- Encodes a batch of executions. See {decodeBatch}.
- [.contract-item]
- [[ERC7579Utils-decodeBatch-bytes-]]
- ==== `[.contract-item-name]#++decodeBatch++#++(bytes executionCalldata) → struct Execution[] executionBatch++` [.item-kind]#internal#
- Decodes a batch of executions. See {encodeBatch}.
- NOTE: This function runs some checks and will throw a {ERC7579DecodingError} if the input is not properly formatted.
- [.contract-item]
- [[ERC7579Utils-ERC7579TryExecuteFail-uint256-bytes-]]
- ==== `[.contract-item-name]#++ERC7579TryExecuteFail++#++(uint256 batchExecutionIndex, bytes returndata)++` [.item-kind]#event#
- Emits when an {EXECTYPE_TRY} execution fails.
- [.contract-item]
- [[ERC7579Utils-ERC7579UnsupportedCallType-CallType-]]
- ==== `[.contract-item-name]#++ERC7579UnsupportedCallType++#++(CallType callType)++` [.item-kind]#error#
- The provided {CallType} is not supported.
- [.contract-item]
- [[ERC7579Utils-ERC7579UnsupportedExecType-ExecType-]]
- ==== `[.contract-item-name]#++ERC7579UnsupportedExecType++#++(ExecType execType)++` [.item-kind]#error#
- The provided {ExecType} is not supported.
- [.contract-item]
- [[ERC7579Utils-ERC7579MismatchedModuleTypeId-uint256-address-]]
- ==== `[.contract-item-name]#++ERC7579MismatchedModuleTypeId++#++(uint256 moduleTypeId, address module)++` [.item-kind]#error#
- The provided module doesn't match the provided module type.
- [.contract-item]
- [[ERC7579Utils-ERC7579UninstalledModule-uint256-address-]]
- ==== `[.contract-item-name]#++ERC7579UninstalledModule++#++(uint256 moduleTypeId, address module)++` [.item-kind]#error#
- The module is not installed.
- [.contract-item]
- [[ERC7579Utils-ERC7579AlreadyInstalledModule-uint256-address-]]
- ==== `[.contract-item-name]#++ERC7579AlreadyInstalledModule++#++(uint256 moduleTypeId, address module)++` [.item-kind]#error#
- The module is already installed.
- [.contract-item]
- [[ERC7579Utils-ERC7579UnsupportedModuleType-uint256-]]
- ==== `[.contract-item-name]#++ERC7579UnsupportedModuleType++#++(uint256 moduleTypeId)++` [.item-kind]#error#
- The module type is not supported.
- [.contract-item]
- [[ERC7579Utils-ERC7579DecodingError--]]
- ==== `[.contract-item-name]#++ERC7579DecodingError++#++()++` [.item-kind]#error#
- Input calldata not properly formatted and possibly malicious.
- [.contract-item]
- [[ERC7579Utils-CALLTYPE_SINGLE-CallType]]
- ==== `CallType [.contract-item-name]#++CALLTYPE_SINGLE++#` [.item-kind]#internal constant#
- A single `call` execution.
- [.contract-item]
- [[ERC7579Utils-CALLTYPE_BATCH-CallType]]
- ==== `CallType [.contract-item-name]#++CALLTYPE_BATCH++#` [.item-kind]#internal constant#
- A batch of `call` executions.
- [.contract-item]
- [[ERC7579Utils-CALLTYPE_DELEGATECALL-CallType]]
- ==== `CallType [.contract-item-name]#++CALLTYPE_DELEGATECALL++#` [.item-kind]#internal constant#
- A `delegatecall` execution.
- [.contract-item]
- [[ERC7579Utils-EXECTYPE_DEFAULT-ExecType]]
- ==== `ExecType [.contract-item-name]#++EXECTYPE_DEFAULT++#` [.item-kind]#internal constant#
- Default execution type that reverts on failure.
- [.contract-item]
- [[ERC7579Utils-EXECTYPE_TRY-ExecType]]
- ==== `ExecType [.contract-item-name]#++EXECTYPE_TRY++#` [.item-kind]#internal constant#
- Execution type that does not revert on failure.
|