From 5ec5d8fd237ffe570e6818aa0dcf36496243187c Mon Sep 17 00:00:00 2001 From: ernestognw Date: Wed, 23 Apr 2025 12:21:37 -0600 Subject: [PATCH 1/4] Address feedback for Account --- packages/core/solidity/src/account.ts | 2 +- packages/ui/src/solidity/AccountControls.svelte | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index fbd292d69..438e05c26 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -12,7 +12,7 @@ export const defaults: Required = { signatureValidation: 'ERC7739', ERC721Holder: true, ERC1155Holder: true, - signer: false, + signer: 'ECDSA', batchedExecution: false, ERC7579Modules: false, } as const; diff --git a/packages/ui/src/solidity/AccountControls.svelte b/packages/ui/src/solidity/AccountControls.svelte index f92c34a21..640f82972 100644 --- a/packages/ui/src/solidity/AccountControls.svelte +++ b/packages/ui/src/solidity/AccountControls.svelte @@ -72,8 +72,8 @@ Account Bound Enhances signature security by using a defensive rehashing scheme that prevents signature replay attacks across - multiple smart accounts owned by the same EOA. This preserves the readability of signed contents while ensuring - each signature is uniquely bound to a specific account and chain. + multiple smart accounts owned by the same private key. This preserves the readability of signed contents while + ensuring each signature is uniquely bound to a specific account and chain. From 482e9d7fecbae59346ce9d2b7d1aeb475323ca27 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Wed, 23 Apr 2025 15:41:43 -0600 Subject: [PATCH 2/4] Update snapshots --- packages/core/solidity/src/account.test.ts.md | 146 ++++++++++-------- .../core/solidity/src/account.test.ts.snap | Bin 2982 -> 2943 bytes 2 files changed, 79 insertions(+), 67 deletions(-) diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index 8cbc7a7c3..44f783aff 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -15,18 +15,14 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccount is Account, EIP712, ERC7739 {␊ + contract CustomAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ constructor() EIP712("CustomAccount", "1") {}␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - // Custom validation logic␊ - return false;␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ }␊ }␊ ` @@ -41,8 +37,10 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC1271 is Account, IERC1271 {␊ + contract CustomAccountERC1271 is Initializable, Account, IERC1271, SignerECDSA {␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ @@ -52,14 +50,8 @@ Generated by [AVA](https://avajs.dev). return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - // Custom validation logic␊ - return false;␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ }␊ }␊ ` @@ -75,18 +67,14 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC7739 is Account, EIP712, ERC7739 {␊ + contract CustomAccountERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ constructor() EIP712("CustomAccountERC7739", "1") {}␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - // Custom validation logic␊ - return false;␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ }␊ }␊ ` @@ -103,18 +91,14 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC721Holder is Account, EIP712, ERC7739, ERC721Holder {␊ + contract CustomAccountERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder {␊ constructor() EIP712("CustomAccountERC721Holder", "1") {}␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - // Custom validation logic␊ - return false;␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ }␊ }␊ ` @@ -131,18 +115,14 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC1155Holder is Account, EIP712, ERC7739, ERC1155Holder {␊ + contract CustomAccountERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC1155Holder {␊ constructor() EIP712("CustomAccountERC1155Holder", "1") {}␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - // Custom validation logic␊ - return false;␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ }␊ }␊ ` @@ -160,18 +140,14 @@ Generated by [AVA](https://avajs.dev). import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC721HolderERC1155Holder is Account, EIP712, ERC7739, ERC721Holder, ERC1155Holder {␊ + contract CustomAccountERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ constructor() EIP712("CustomAccountERC721HolderERC1155Holder", "1") {}␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - // Custom validation logic␊ - return false;␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ }␊ }␊ ` @@ -188,27 +164,23 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/community-contracts/contracts/account/extensions/ERC7821.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, ERC7821 {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ }␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ view␊ override␊ returns (bool)␊ {␊ - // Custom validation logic␊ - return false;␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ ` @@ -221,13 +193,16 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.0.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Account, EIP712, AccountERC7579, ERC7739 {␊ + contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerECDSA {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -241,6 +216,10 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ + ␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ + }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -251,6 +230,19 @@ Generated by [AVA](https://avajs.dev). {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ + ␊ + // IMPORTANT: Make sure SignerECDSA is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerECDSA)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerECDSA, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ` @@ -262,14 +254,17 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.0.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ import {AccountERC7579Hooked} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Account, EIP712, AccountERC7579Hooked, ERC7739 {␊ + contract MyAccount is Initializable, Account, EIP712, AccountERC7579Hooked, ERC7739, SignerECDSA {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -283,6 +278,10 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ + ␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ + }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -293,6 +292,19 @@ Generated by [AVA](https://avajs.dev). {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ + ␊ + // IMPORTANT: Make sure SignerECDSA is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerECDSA)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerECDSA, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ` diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index c03d953fcab53163f3628b90c105194ba76a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z__xk$^F>>>HT{$f12?-1d?5McU}@ zk*fj){ujDOmdxe4ni?Z9c5z0+=HasUi>*&FUW7t8$pc8C6j zUSPYOBgpgQwoBbGNbDZ@o**XAp?hS>#3Xc&fRxRFl#S^f0YM9b76dH_S`f4#Xr%@1 zry~SyE8&SF&^=Okf#oMbrXr{%{|$nziJmpmn)J)fTT;&%X&vo3+<>~cOW6SV`zP+- zhJ3ZdRb)h9@v|{lOlcl@SAgWt3kAugXdYQCR3_*gX~C05&UpRBdII2@Z6Cin*ElK=a2mk;8 From 13e19f63415560db3d759fe113f5c292a1bf25df Mon Sep 17 00:00:00 2001 From: ernestognw Date: Wed, 23 Apr 2025 15:56:02 -0600 Subject: [PATCH 3/4] Improve test cases --- packages/core/solidity/src/account.test.ts | 14 +- packages/core/solidity/src/account.test.ts.md | 674 ++++++++++++++++-- .../core/solidity/src/account.test.ts.snap | Bin 2943 -> 3407 bytes 3 files changed, 609 insertions(+), 79 deletions(-) diff --git a/packages/core/solidity/src/account.test.ts b/packages/core/solidity/src/account.test.ts index e4dd16f95..72a76a992 100644 --- a/packages/core/solidity/src/account.test.ts +++ b/packages/core/solidity/src/account.test.ts @@ -50,7 +50,7 @@ test('account API assert defaults', async t => { t.is(account.print(account.defaults), account.print()); }); -for (const signer of [undefined, 'ERC7702', 'ECDSA', 'P256', 'RSA'] as const) { +for (const signer of [false, 'ERC7702', 'ECDSA', 'P256', 'RSA'] as const) { let title = 'Account'; if (signer) { title += ` with Signer${signer}`; @@ -102,6 +102,18 @@ for (const signer of [undefined, 'ERC7702', 'ECDSA', 'P256', 'RSA'] as const) { ERC7579Modules: 'AccountERC7579', }); + testAccount(`${title} with ERC7579 with ERC1271`, { + signer, + ERC7579Modules: 'AccountERC7579', + signatureValidation: 'ERC1271', + }); + + testAccount(`${title} with ERC7579 with ERC7739`, { + signer, + ERC7579Modules: 'AccountERC7579', + signatureValidation: 'ERC7739', + }); + testAccount(`${title} with ERC7579 hooks`, { signer, ERC7579Modules: 'AccountERC7579Hooked', diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index 44f783aff..bcb305a4a 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -15,14 +15,18 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ - import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ + contract CustomAccount is Account, EIP712, ERC7739 {␊ constructor() EIP712("CustomAccount", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ - _setSigner(signer);␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + // Custom validation logic␊ + return false;␊ }␊ }␊ ` @@ -37,10 +41,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ - import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC1271 is Initializable, Account, IERC1271, SignerECDSA {␊ + contract CustomAccountERC1271 is Account, IERC1271 {␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ @@ -50,8 +52,14 @@ Generated by [AVA](https://avajs.dev). return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - function initializeECDSA(address signer) public initializer {␊ - _setSigner(signer);␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + // Custom validation logic␊ + return false;␊ }␊ }␊ ` @@ -67,14 +75,18 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ - import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ + contract CustomAccountERC7739 is Account, EIP712, ERC7739 {␊ constructor() EIP712("CustomAccountERC7739", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ - _setSigner(signer);␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + // Custom validation logic␊ + return false;␊ }␊ }␊ ` @@ -91,14 +103,18 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ - import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder {␊ + contract CustomAccountERC721Holder is Account, EIP712, ERC7739, ERC721Holder {␊ constructor() EIP712("CustomAccountERC721Holder", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ - _setSigner(signer);␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + // Custom validation logic␊ + return false;␊ }␊ }␊ ` @@ -115,14 +131,18 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ - import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC1155Holder {␊ + contract CustomAccountERC1155Holder is Account, EIP712, ERC7739, ERC1155Holder {␊ constructor() EIP712("CustomAccountERC1155Holder", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ - _setSigner(signer);␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + // Custom validation logic␊ + return false;␊ }␊ }␊ ` @@ -140,14 +160,18 @@ Generated by [AVA](https://avajs.dev). import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ - import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract CustomAccountERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ + contract CustomAccountERC721HolderERC1155Holder is Account, EIP712, ERC7739, ERC721Holder, ERC1155Holder {␊ constructor() EIP712("CustomAccountERC721HolderERC1155Holder", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ - _setSigner(signer);␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + // Custom validation logic␊ + return false;␊ }␊ }␊ ` @@ -164,15 +188,9 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/community-contracts/contracts/account/extensions/ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ - import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ + contract MyAccount is Account, EIP712, ERC7739, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ - ␊ - function initializeECDSA(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -182,6 +200,16 @@ Generated by [AVA](https://avajs.dev). {␊ return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ + ␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + // Custom validation logic␊ + return false;␊ + }␊ }␊ ` @@ -193,16 +221,13 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.0.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerECDSA {␊ + contract MyAccount is Account, EIP712, AccountERC7579, ERC7739 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -217,10 +242,32 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeECDSA(address signer) public initializer {␊ - _setSigner(signer);␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ + }␊ + ` + +## Account with ERC7579 with ERC1271 + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ + contract MyAccount is Account, AccountERC7579, IERC1271 {␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ @@ -231,22 +278,18 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerECDSA is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerECDSA)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ view␊ - override(SignerECDSA, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ + override(AccountERC7579, IERC1271)␊ + returns (bytes4)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return super.isValidSignature(hash, signature);␊ }␊ }␊ ` -## Account with ERC7579 hooks +## Account with ERC7579 with ERC7739 > Snapshot 1 @@ -254,17 +297,13 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.0.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ - import {AccountERC7579Hooked} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579Hooked, ERC7739, SignerECDSA {␊ + contract MyAccount is Account, EIP712, AccountERC7579, ERC7739 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -278,10 +317,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initializeECDSA(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -292,18 +327,47 @@ Generated by [AVA](https://avajs.dev). {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ + }␊ + ` + +## Account with ERC7579 hooks + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ ␊ - // IMPORTANT: Make sure SignerECDSA is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerECDSA)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {AccountERC7579Hooked} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579Hooked.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + ␊ + contract MyAccount is Account, EIP712, AccountERC7579Hooked, ERC7739 {␊ + constructor() EIP712("MyAccount", "1") {}␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ view␊ - override(SignerECDSA, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ + override(AccountERC7579, ERC7739)␊ + returns (bytes4)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + // ERC-7739 can return the ERC-1271 magic value, 0xffffffff (invalid) or 0x77390001 (detection).␊ + // If the returned value is 0xffffffff, fallback to ERC-7579 validation.␊ + bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ }␊ ` @@ -458,6 +522,112 @@ Generated by [AVA](https://avajs.dev). ## Account with SignerERC7702 with ERC7579 +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerERC7702} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerERC7702.sol";␊ + ␊ + contract MyAccount is Account, EIP712, AccountERC7579, ERC7739, SignerERC7702 {␊ + constructor() EIP712("MyAccount", "1") {}␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579, ERC7739)␊ + returns (bytes4)␊ + {␊ + // ERC-7739 can return the ERC-1271 magic value, 0xffffffff (invalid) or 0x77390001 (detection).␊ + // If the returned value is 0xffffffff, fallback to ERC-7579 validation.␊ + bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerERC7702 is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerERC7702)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerERC7702, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerERC7702 with ERC7579 with ERC1271 + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerERC7702} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerERC7702.sol";␊ + ␊ + contract MyAccount is Account, AccountERC7579, IERC1271, SignerERC7702 {␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579, IERC1271)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerERC7702 is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerERC7702)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerERC7702, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerERC7702 with ERC7579 with ERC7739 + > Snapshot 1 `// SPDX-License-Identifier: MIT␊ @@ -734,25 +904,141 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ - constructor() EIP712("MyAccount", "1") {}␊ - ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ + constructor() EIP712("MyAccount", "1") {}␊ + ␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ + }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + }␊ + }␊ + ` + +## Account with SignerECDSA with ERC7579 + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerECDSA {␊ + constructor() EIP712("MyAccount", "1") {}␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579, ERC7739)␊ + returns (bytes4)␊ + {␊ + // ERC-7739 can return the ERC-1271 magic value, 0xffffffff (invalid) or 0x77390001 (detection).␊ + // If the returned value is 0xffffffff, fallback to ERC-7579 validation.␊ + bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function initializeECDSA(address signer) public initializer {␊ + _setSigner(signer);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerECDSA is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerECDSA)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerECDSA, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerECDSA with ERC7579 with ERC1271 + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ + ␊ + contract MyAccount is Initializable, Account, AccountERC7579, IERC1271, SignerECDSA {␊ function initializeECDSA(address signer) public initializer {␊ _setSigner(signer);␊ }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579, IERC1271)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerECDSA is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerECDSA)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override␊ + override(SignerECDSA, AbstractSigner, AccountERC7579)␊ returns (bool)␊ {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7579 +## Account with SignerECDSA with ERC7579 with ERC7739 > Snapshot 1 @@ -1060,6 +1346,122 @@ Generated by [AVA](https://avajs.dev). ## Account with SignerP256 with ERC7579 +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerP256.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerP256 {␊ + constructor() EIP712("MyAccount", "1") {}␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579, ERC7739)␊ + returns (bytes4)␊ + {␊ + // ERC-7739 can return the ERC-1271 magic value, 0xffffffff (invalid) or 0x77390001 (detection).␊ + // If the returned value is 0xffffffff, fallback to ERC-7579 validation.␊ + bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + _setSigner(qx, qy);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256 is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerP256)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC1271 + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerP256.sol";␊ + ␊ + contract MyAccount is Initializable, Account, AccountERC7579, IERC1271, SignerP256 {␊ + function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + _setSigner(qx, qy);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579, IERC1271)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256 is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerP256)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC7739 + > Snapshot 1 `// SPDX-License-Identifier: MIT␊ @@ -1366,6 +1768,122 @@ Generated by [AVA](https://avajs.dev). ## Account with SignerRSA with ERC7579 +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerRSA.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerRSA {␊ + constructor() EIP712("MyAccount", "1") {}␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579, ERC7739)␊ + returns (bytes4)␊ + {␊ + // ERC-7739 can return the ERC-1271 magic value, 0xffffffff (invalid) or 0x77390001 (detection).␊ + // If the returned value is 0xffffffff, fallback to ERC-7579 validation.␊ + bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + _setSigner(e, n);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSA is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerRSA)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSA, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7579 with ERC1271 + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.0.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/community-contracts/contracts/utils/cryptography/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/community-contracts/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/community-contracts/contracts/account/extensions/AccountERC7579.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerRSA.sol";␊ + ␊ + contract MyAccount is Initializable, Account, AccountERC7579, IERC1271, SignerRSA {␊ + function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + _setSigner(e, n);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579, IERC1271)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSA is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerRSA)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579 returns false for \`_rawSignatureValidation\`␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSA, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7579 with ERC7739 + > Snapshot 1 `// SPDX-License-Identifier: MIT␊ diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index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;4HWyWiT6nZ(sN3{cDz;YD?;!&m)AUz3&New5Z)Z1XTeJcn?}zNhDX4U;UE;wr&8n%IjCpA-qH@ z=sfsZ#P1mlut3|Vhp?~AGkGQPh;RH-fZWdja^Mj!1(?G<-V05f31IGifm>ug4T8S) zy>J@-?IiGz@n~=SPeA;?0P&^wXs;ih!hYslfLq>04F=~}gLATloKg z!Hg@#qsY~}JaWT~ai-)1Yhz&R09(hBwhnMytiW;MZHZ>!xv)A1*M*}r^W?iovT7P- zCBE@DL6Q9l6j{L(8CZ!y4<^!sVOC#Ig`f&S6@n@RRahQX_)3r}G+o z9}AE_Di!2m7S12Ftmk<185qnutk(?CFU12i!o>Y|0j2K(N=s_u{t)0ltMkwUDIxm< z(qE0&>QQ#s_XT433lKwj9q8rfh71o-4`PQr9BKUJ<3f(1M@^ zLA#Wo{cM1sJ?iYd7FsiMEJ)aUV0S5>!1A&nRS{$aOu7qfrr`X0H)gYi94AK01iLuK z+gy%#a_P+yPbSIdJEPr`NdOo>9|p#lqLDucnEX|#Fj62C|rTs`tpfdc;v)guKn{1uPpi)p#bA-l)aj>Il)gVPS2cIi9qRwf6) zaF@Q}&T+A<-*0#1Ug(F|Zf6PdJh|;+Hw+@HM}8!T$t$QHDVUgq>JgB#Igqj;wId*C zLC}Jr1wjjf76ff#LHn5iLEDRX;s{ialwM%DNsy`t>Louxu(!~&MtX}LZr)4uoRQw~ zzQqk_h=-I-kh_0kzt)n^cDRnT04#nk1dB1nBku^1{B@}yS%~71Y@xD1Fltbyryrm Date: Wed, 23 Apr 2025 16:07:43 -0600 Subject: [PATCH 4/4] Update order in which signature validation is added --- packages/core/solidity/src/account.test.ts.md | 50 +++++++++--------- .../core/solidity/src/account.test.ts.snap | Bin 3407 -> 3406 bytes packages/core/solidity/src/account.ts | 2 +- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index bcb305a4a..bae9e7638 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -227,7 +227,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Account, EIP712, AccountERC7579, ERC7739 {␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -267,7 +267,7 @@ Generated by [AVA](https://avajs.dev). import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Account, AccountERC7579, IERC1271 {␊ + contract MyAccount is Account, IERC1271, AccountERC7579 {␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ @@ -281,7 +281,7 @@ Generated by [AVA](https://avajs.dev). function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, IERC1271)␊ + override(IERC1271, AccountERC7579)␊ returns (bytes4)␊ {␊ return super.isValidSignature(hash, signature);␊ @@ -303,7 +303,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Account, EIP712, AccountERC7579, ERC7739 {␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -345,7 +345,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/contracts/utils/cryptography/ERC7739.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Account, EIP712, AccountERC7579Hooked, ERC7739 {␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -536,7 +536,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerERC7702} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerERC7702.sol";␊ ␊ - contract MyAccount is Account, EIP712, AccountERC7579, ERC7739, SignerERC7702 {␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerERC7702 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -591,7 +591,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerERC7702} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerERC7702.sol";␊ ␊ - contract MyAccount is Account, AccountERC7579, IERC1271, SignerERC7702 {␊ + contract MyAccount is Account, IERC1271, AccountERC7579, SignerERC7702 {␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ @@ -605,7 +605,7 @@ Generated by [AVA](https://avajs.dev). function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, IERC1271)␊ + override(IERC1271, AccountERC7579)␊ returns (bytes4)␊ {␊ return super.isValidSignature(hash, signature);␊ @@ -642,7 +642,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerERC7702} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerERC7702.sol";␊ ␊ - contract MyAccount is Account, EIP712, AccountERC7579, ERC7739, SignerERC7702 {␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerERC7702 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -699,7 +699,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerERC7702} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerERC7702.sol";␊ ␊ - contract MyAccount is Account, EIP712, AccountERC7579Hooked, ERC7739, SignerERC7702 {␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerERC7702 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -939,7 +939,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerECDSA {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -999,7 +999,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, AccountERC7579, IERC1271, SignerECDSA {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerECDSA {␊ function initializeECDSA(address signer) public initializer {␊ _setSigner(signer);␊ }␊ @@ -1017,7 +1017,7 @@ Generated by [AVA](https://avajs.dev). function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, IERC1271)␊ + override(IERC1271, AccountERC7579)␊ returns (bytes4)␊ {␊ return super.isValidSignature(hash, signature);␊ @@ -1055,7 +1055,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerECDSA {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -1117,7 +1117,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579Hooked, ERC7739, SignerECDSA {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerECDSA {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -1361,7 +1361,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerP256 {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -1421,7 +1421,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, AccountERC7579, IERC1271, SignerP256 {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerP256 {␊ function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ @@ -1439,7 +1439,7 @@ Generated by [AVA](https://avajs.dev). function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, IERC1271)␊ + override(IERC1271, AccountERC7579)␊ returns (bytes4)␊ {␊ return super.isValidSignature(hash, signature);␊ @@ -1477,7 +1477,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerP256 {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -1539,7 +1539,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579Hooked, ERC7739, SignerP256 {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerP256 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -1783,7 +1783,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerRSA {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -1843,7 +1843,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, AccountERC7579, IERC1271, SignerRSA {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerRSA {␊ function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ @@ -1861,7 +1861,7 @@ Generated by [AVA](https://avajs.dev). function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, IERC1271)␊ + override(IERC1271, AccountERC7579)␊ returns (bytes4)␊ {␊ return super.isValidSignature(hash, signature);␊ @@ -1899,7 +1899,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579, ERC7739, SignerRSA {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -1961,7 +1961,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/contracts/utils/cryptography/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, AccountERC7579Hooked, ERC7739, SignerRSA {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerRSA {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index b8621f0cd2aec854eba4bf75313857fecdcbf1e8..84f2901cc0ca56f9cfdd20422b709f833f49d5ec 100644 GIT binary patch delta 3314 zcmVU)5A> zSa@xxiw&yvG;Cf)cXsYonoYD#21A8v`#MICG}=dZhuHWQ9)Aw8t{G^X7}Qi$YN6LR z8|#hr%Ft8}1`4u>u5~p!Mz60oE;m~3Yn6&N7!s4BC*BgDqMk_xX!VO^h>geId`*=M z1|vhG<2BWvxf%YZxI>%X6b*~$tJi{wZ|&^1H(GJ?`g4q^rdv(b91kfuFqL6{+;j&< zXX|XY+ZV6QvVTn8CEVG(YgGK_qV17IN${>|7V>_rBX?1C>u7ajwT7NNtvEw^BSWPcG0=Ted9x{CdHb$?8;b+Lu| ziq)?p=P#rxx^71dvit!xXEOUoGblCOLX5 zJIj;cpLTpXi$@QG1tFarXli6U>M6Q~uQ`uCtvs!G0Z;vx&I!$1o$ZZQdt*B8SFSK| z|KduS;(o`wZBgVq?^{n%vDNg4B*&xoBql8Vk=}b41eazx5f#MOv7>4@+Se!Eb=jD* z=e-n-Dt|9z;sV}XQn&_mBe<+eGhTlaq9AGg!D%s-%-W7W@}dG$$p8*l4;V zybDYY&j-r<)g(c!&cx60fai}|F7!P&rS>*9H-BT{_X-2Q8vwr~_=T^eH2&-%AppY( za)H2bIYJ0dJoPvj42LZj2w#d#fk-jBLR9{lLFMlOm5W1VDKqZzupbOd!vy?mFBdC3 zKg9}{TN~)s5mra`T+>8w=2eCWzI+CVU=g1bC$Dk26}yKd^HSg=iVaI6hD#5ZThrT1 zcYnqbTb=bFe3C#IOcjqaY^wG&TO-;hruG&RPR6&utX?-I?R)mja``6jYPLu@t@Zq2_X_g2`oFY|WQW}CBJ zb@l~@g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idity/src/account.ts index 438e05c26..11eea122e 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -83,8 +83,8 @@ function addParents(c: ContractBuilder, opts: AccountOptions): void { if (opts.signatureValidation === 'ERC7739') addEIP712(c, opts); // Extensions - addERC7579Modules(c, opts); addSignatureValidation(c, opts); + addERC7579Modules(c, opts); addSigner(c, opts.signer ?? false); addBatchedExecution(c, opts); addERC721Holder(c, opts);