From 5c9d4abd5e5eb0b1f112a613d418d0c5857692dc Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Fri, 20 Jun 2025 00:11:12 +0200 Subject: [PATCH 01/17] Add factory contracts for relevant accounts --- packages/core/solidity/src/account.test.ts | 15 +- packages/core/solidity/src/account.test.ts.md | 110 ++++++------- .../core/solidity/src/account.test.ts.snap | Bin 4560 -> 4544 bytes packages/core/solidity/src/account.ts | 155 ++++++++++++------ packages/core/solidity/src/print.ts | 57 ++++--- packages/core/solidity/src/signer.ts | 40 +++-- 6 files changed, 226 insertions(+), 151 deletions(-) diff --git a/packages/core/solidity/src/account.test.ts b/packages/core/solidity/src/account.test.ts index fbf809721..b78bfc4c7 100644 --- a/packages/core/solidity/src/account.test.ts +++ b/packages/core/solidity/src/account.test.ts @@ -2,7 +2,7 @@ import test from 'ava'; import { account } from '.'; import type { AccountOptions } from './account'; -import { buildAccount } from './account'; +import { buildAccount, buildFactory } from './account'; import { printContract } from './print'; /** @@ -12,7 +12,7 @@ function testAPIEquivalence(title: string, opts?: AccountOptions) { test(title, t => { t.is( account.print(opts), - printContract( + printContract([ buildAccount({ name: 'MyAccount', signatureValidation: 'ERC7739', @@ -22,7 +22,16 @@ function testAPIEquivalence(title: string, opts?: AccountOptions) { ERC7579Modules: false, ...opts, }), - ), + buildFactory({ + name: 'MyAccount', + signatureValidation: 'ERC7739', + ERC721Holder: true, + ERC1155Holder: true, + batchedExecution: false, + ERC7579Modules: false, + ...opts, + }), + ].filter(c => c !== null)), ); }); } diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index 0e25e37f3..01d7e2e4c 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -756,7 +756,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSA is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ constructor() EIP712("CustomAccount with SignerECDSA", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ }␊ @@ -785,7 +785,7 @@ Generated by [AVA](https://avajs.dev). return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ }␊ @@ -808,7 +808,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ constructor() EIP712("CustomAccount with SignerECDSAERC7739", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ }␊ @@ -832,7 +832,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder {␊ constructor() EIP712("CustomAccount with SignerECDSAERC721Holder", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ }␊ @@ -856,7 +856,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC1155Holder {␊ constructor() EIP712("CustomAccount with SignerECDSAERC1155Holder", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ }␊ @@ -883,7 +883,7 @@ Generated by [AVA](https://avajs.dev). EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ }␊ @@ -907,7 +907,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ ␊ @@ -954,7 +954,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ ␊ @@ -1000,7 +1000,7 @@ Generated by [AVA](https://avajs.dev). import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerECDSA {␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ ␊ @@ -1070,7 +1070,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ ␊ @@ -1132,7 +1132,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeECDSA(address signer) public initializer {␊ + function initialize(address signer) public initializer {␊ _setSigner(signer);␊ }␊ ␊ @@ -1178,7 +1178,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256 {␊ constructor() EIP712("CustomAccount with SignerP256", "1") {}␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ }␊ @@ -1207,7 +1207,7 @@ Generated by [AVA](https://avajs.dev). return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ }␊ @@ -1230,7 +1230,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256 {␊ constructor() EIP712("CustomAccount with SignerP256ERC7739", "1") {}␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ }␊ @@ -1254,7 +1254,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC721Holder {␊ constructor() EIP712("CustomAccount with SignerP256ERC721Holder", "1") {}␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ }␊ @@ -1278,7 +1278,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC1155Holder {␊ constructor() EIP712("CustomAccount with SignerP256ERC1155Holder", "1") {}␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ }␊ @@ -1305,7 +1305,7 @@ Generated by [AVA](https://avajs.dev). EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ {}␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ }␊ @@ -1329,7 +1329,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ ␊ @@ -1376,7 +1376,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ ␊ @@ -1422,7 +1422,7 @@ Generated by [AVA](https://avajs.dev). import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerP256 {␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ ␊ @@ -1492,7 +1492,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ ␊ @@ -1554,7 +1554,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeP256(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ _setSigner(qx, qy);␊ }␊ ␊ @@ -1600,7 +1600,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSA {␊ constructor() EIP712("CustomAccount with SignerRSA", "1") {}␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ }␊ @@ -1629,7 +1629,7 @@ Generated by [AVA](https://avajs.dev). return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ }␊ @@ -1652,7 +1652,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSA {␊ constructor() EIP712("CustomAccount with SignerRSAERC7739", "1") {}␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ }␊ @@ -1676,7 +1676,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC721Holder {␊ constructor() EIP712("CustomAccount with SignerRSAERC721Holder", "1") {}␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ }␊ @@ -1700,7 +1700,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC1155Holder {␊ constructor() EIP712("CustomAccount with SignerRSAERC1155Holder", "1") {}␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ }␊ @@ -1727,7 +1727,7 @@ Generated by [AVA](https://avajs.dev). EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ {}␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ }␊ @@ -1751,7 +1751,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ ␊ @@ -1798,7 +1798,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ ␊ @@ -1844,7 +1844,7 @@ Generated by [AVA](https://avajs.dev). import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerRSA {␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ ␊ @@ -1914,7 +1914,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ ␊ @@ -1976,7 +1976,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeRSA(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ _setSigner(e, n);␊ }␊ ␊ @@ -2022,7 +2022,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913 {␊ constructor() EIP712("CustomAccount with SignerMultisig", "1") {}␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2067,7 +2067,7 @@ Generated by [AVA](https://avajs.dev). return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2106,7 +2106,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913 {␊ constructor() EIP712("CustomAccount with SignerMultisigERC7739", "1") {}␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2146,7 +2146,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder {␊ constructor() EIP712("CustomAccount with SignerMultisigERC721Holder", "1") {}␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2186,7 +2186,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC1155Holder {␊ constructor() EIP712("CustomAccount with SignerMultisigERC1155Holder", "1") {}␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2229,7 +2229,7 @@ Generated by [AVA](https://avajs.dev). EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ {}␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2269,7 +2269,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2332,7 +2332,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2394,7 +2394,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, MultiSignerERC7913 {␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2480,7 +2480,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2558,7 +2558,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeMultisig(bytes[] memory signers, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2620,7 +2620,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigWeighted is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ constructor() EIP712("CustomAccount with SignerMultisigWeighted", "1") {}␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2673,7 +2673,7 @@ Generated by [AVA](https://avajs.dev). return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2722,7 +2722,7 @@ Generated by [AVA](https://avajs.dev). EIP712("CustomAccount with SignerMultisigWeightedERC7739", "1")␊ {}␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2772,7 +2772,7 @@ Generated by [AVA](https://avajs.dev). EIP712("CustomAccount with SignerMultisigWeightedERC721Holder", "1")␊ {}␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2822,7 +2822,7 @@ Generated by [AVA](https://avajs.dev). EIP712("CustomAccount with SignerMultisigWeightedERC1155Holder", "1")␊ {}␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2873,7 +2873,7 @@ Generated by [AVA](https://avajs.dev). EIP712("CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder", "1")␊ {}␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2921,7 +2921,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -2993,7 +2993,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -3064,7 +3064,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, MultiSignerERC7913Weighted {␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -3159,7 +3159,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ @@ -3246,7 +3246,7 @@ Generated by [AVA](https://avajs.dev). return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initializeMultisigWeighted(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ + function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ public␊ initializer␊ {␊ diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index dcc00923870cd1622088516267b1a2e7dc7e124f..ee6c8b5eaf7729f1eed551eb67d9aeddb1d24aff 100644 GIT binary patch literal 4544 zcmYMwWk3^-q6Khp)aaJpXheE+r!*o62uR6DX^>`sbVv$Fj-1p)x{*+%{&Yd%-=Q;ymj2D9yK$R%29+ z1ln*JO{CcdV1=M0BAovT;K0hpjYX4HNZYOE5CmjPQ*P2jn-)}sZ7F#dE|R%ysB_V= zr_)#vm+oA9>|0)WETGW3`-t>kiV@1H5z&U}hBYnVNJ_0HEwD9Zycs2RUDwHXI4>6$ z@uPzScqgh5UD%E8%tzmx&@M?eHn#q~>+y7iee=ZpLc8poh5bDn^)%LPwrC3bV!a@j zry*XU&s<&ggwWBrb<7OoDo(2#biX)}ih=m1-W>sqFG7zODN^QKH-63ih1=XFTYS#b zek?3e=~>FCjU!sk`9xR-&Pzm4a3m?efCMvN>;K1b41SnS$I|cWx;Ai+QY3tKLb! z#k;Bw@eo_S5cil*!Mg61^Hf20Rl(IA4Lve)H7yi=0~`U%>?_=zu`4{j&-Vylh72Fn znJz3Hq#!Iblit;B<*kWVwv*K$R`QlkJ3GC0cCSx#UV2)CSascVn>)PyYxue>cX_D345ZifQXhD^4lW&2x!&&y8zSRNy8Su4?t+HYk~f z%JvS`yhPM%FdD99<G8Ch|OhBW-7Y73BUuA731=pyMks}MBzwg$$i?eRGx-ZVS z&s=tHUe?G6E|Z)}fp|;1M8EgBM&>@I=~F%cDhravuUzmZ zOLS^exOI~c#<#41sj>4HQ{sVp68QqX3RK$e>QhV!M7MNNy&ynj*)!XOPvWfOcaG+U z6W`9E8WC}7RI9TiV(ng9d#s&xBHPbvA;onCINNa_itdY^Bh?R&)G?9@O_h$-9lv|; zXLSMxwocM}v)A7%sjS)l4xszM)X{|TumKdMP0XIqH=_@m4nN90lMSJulDc_ zvhwD4;{?;E;xvx;5+=7IGn(>m_nxc)2!FVl;gdO;WnC+}hmMyIW&v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?KOuT8-ibM#fN-SU zy}rBC{-)g$BCM|y?hqs2QdZnH{YS#I{8zgiAaWM1^$>X3M_NNhqqZ}wESuIH5tU4Ha@VzuJ6 z#*~Vw;_PAw+74esY-X`;Y>zK$YiH3&V^mi*j#B*dA67Em_F>>I->$RYJ-*mn7{!a6 zL;~FPyA^;~`0olLXUKl`-b(CU2Oq_YGQ~J=d_tkH+>Q|+WpkTg|6J>^W?e3`1wMFr l;gtw+_REf76;1~HGde51u>T5pLPYBgkeSD4aGe0S^)Htmr^WyP diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index da79a0809..aa3c199f6 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -5,6 +5,7 @@ import { printContract } from './print'; import { defaults as commonDefaults, withCommonDefaults, type CommonOptions } from './common-options'; import { setInfo } from './set-info'; import { addSigner, signerFunctions, signers, type SignerOptions } from './signer'; +import { formatLines } from './utils/format-lines'; export const defaults: Required = { ...commonDefaults, @@ -47,13 +48,16 @@ function withDefaults(opts: AccountOptions): Required { } export function printAccount(opts: AccountOptions = defaults): string { - return printContract(buildAccount(opts)); + return printContract([ + buildAccount(opts), + buildFactory(opts), // Todo: enable/disable factory from opts + ].filter(c => c !== null)); } export function buildAccount(opts: AccountOptions): Contract { const allOpts = withDefaults(opts); - allOpts.upgradeable = false; // Upgradeability is not yet available for the community contracts + allOpts.upgradeable = false; // Upgradeability is not yet available for the accounts contracts allOpts.access = false; // Access control options are not used for Account const c = new ContractBuilder(allOpts.name); @@ -244,53 +248,102 @@ function overrideRawSignatureValidation(c: ContractBuilder, opts: AccountOptions } } -const functions = { - ...defineFunctions({ - isValidSignature: { - kind: 'public' as const, - mutability: 'view' as const, - args: [ - { name: 'hash', type: 'bytes32' }, - { name: 'signature', type: 'bytes calldata' }, - ], - returns: ['bytes4'], - }, - _validateUserOp: { - kind: 'internal' as const, - args: [ - { name: 'userOp', type: 'PackedUserOperation calldata' }, - { name: 'userOpHash', type: 'bytes32' }, - ], - returns: ['uint256'], - }, - _erc7821AuthorizedExecutor: { - kind: 'internal' as const, - args: [ - { name: 'caller', type: 'address' }, - { name: 'mode', type: 'bytes32' }, - { name: 'executionData', type: 'bytes calldata' }, - ], - returns: ['bool'], - mutability: 'view' as const, - }, - addSigners: { - kind: 'public' as const, - args: [{ name: 'signers', type: 'bytes[] memory' }], - }, - removeSigners: { - kind: 'public' as const, - args: [{ name: 'signers', type: 'bytes[] memory' }], - }, - setThreshold: { - kind: 'public' as const, - args: [{ name: 'threshold', type: 'uint256' }], - }, - setSignerWeights: { - kind: 'public' as const, - args: [ - { name: 'signers', type: 'bytes[] memory' }, - { name: 'weights', type: 'uint256[] memory' }, +export function buildFactory(opts: AccountOptions): Contract | null { + const allOpts = withDefaults(opts); + + if (!allOpts.signer || allOpts.signer === "ERC7702") return null; + + allOpts.upgradeable = false; // Upgradeability is not yet available for the accounts contracts + allOpts.access = false; // Access control options are not used for Account + + const c = new ContractBuilder(allOpts.name + 'Factory'); + + // Non upgradeable accounts + c.addImportOnly({ + name: 'Clones', + path: '@openzeppelin/contracts/proxy/Clones.sol', + }); + + // implementation address + c.addVariable(`${allOpts.name} public immutable implementation = new ${allOpts.name}();`); + + // account initializer args + const initializer = signerFunctions.initialize[allOpts.signer]; + const args = [ ...initializer.args, { name: 'salt', type: 'bytes32' }]; + + c.setFunctionBody( + formatLines([ + `bytes32 effectiveSalt = _salt(${args.map(arg => arg.name).join(', ')});`, + `address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);`, + `if (instance.code.length) {`, + [ + `Clones.cloneDeterministic(address(implementation), effectiveSalt);`, + `${allOpts.name}(instance).${initializer.name}(${initializer.args.map(arg => arg.name).join(', ')});`, ], - }, - }), -}; + `}`, + `return instance;`, + ]).split('\n'), + { name: 'create', kind: 'public' as const, args, returns: [ 'address' ] }, + ); + + c.addFunctionCode( + `return Clones.predictDeterministicAddress(address(implementation), _salt(${args.map(arg => arg.name).join(', ')}));`, + { name: 'predict', kind: 'public' as const, args, returns: [ 'address' ] }, + ); + + c.addFunctionCode( + `return keccak256(abi.encode(${args.map(arg => arg.name).join(', ')}));`, + { name: '_salt', kind: 'internal' as const, args, returns: [ 'bytes32' ] }, + ); + + return c; +} + +const functions = defineFunctions({ + isValidSignature: { + kind: 'public' as const, + mutability: 'view' as const, + args: [ + { name: 'hash', type: 'bytes32' }, + { name: 'signature', type: 'bytes calldata' }, + ], + returns: ['bytes4'], + }, + _validateUserOp: { + kind: 'internal' as const, + args: [ + { name: 'userOp', type: 'PackedUserOperation calldata' }, + { name: 'userOpHash', type: 'bytes32' }, + ], + returns: ['uint256'], + }, + _erc7821AuthorizedExecutor: { + kind: 'internal' as const, + args: [ + { name: 'caller', type: 'address' }, + { name: 'mode', type: 'bytes32' }, + { name: 'executionData', type: 'bytes calldata' }, + ], + returns: ['bool'], + mutability: 'view' as const, + }, + addSigners: { + kind: 'public' as const, + args: [{ name: 'signers', type: 'bytes[] memory' }], + }, + removeSigners: { + kind: 'public' as const, + args: [{ name: 'signers', type: 'bytes[] memory' }], + }, + setThreshold: { + kind: 'public' as const, + args: [{ name: 'threshold', type: 'uint256' }], + }, + setSignerWeights: { + kind: 'public' as const, + args: [ + { name: 'signers', type: 'bytes[] memory' }, + { name: 'weights', type: 'uint256[] memory' }, + ], + }, +}); diff --git a/packages/core/solidity/src/print.ts b/packages/core/solidity/src/print.ts index c9e85615a..0ba102432 100644 --- a/packages/core/solidity/src/print.ts +++ b/packages/core/solidity/src/print.ts @@ -18,39 +18,46 @@ import { inferTranspiled } from './infer-transpiled'; import { compatibleContractsSemver } from './utils/version'; import { stringifyUnicodeSafe } from './utils/sanitize'; -export function printContract(contract: Contract, opts?: Options): string { - const helpers = withHelpers(contract, opts); - - const fns = mapValues(sortedFunctions(contract), fns => fns.map(fn => printFunction(fn, helpers))); - - const hasOverrides = fns.override.some(l => l.length > 0); +export function printContract(contracts: Contract | Contract [], opts?: Options): string { + contracts = Array.isArray(contracts) ? contracts : [ contracts ]; + if (contracts.length == 0) throw new Error('no contract'); + if (contracts.some(c1 => contracts.some(c2 => c1.license != c2.license))) throw new Error('multiple licences'); return formatLines( ...spaceBetween( + // Header [ - `// SPDX-License-Identifier: ${contract.license}`, + `// SPDX-License-Identifier: ${contracts.at(0)!.license}`, `// Compatible with OpenZeppelin Contracts ${compatibleContractsSemver}`, `pragma solidity ^${SOLIDITY_VERSION};`, ], - printImports(contract.imports, helpers), - - [ - ...printNatspecTags(contract.natspecTags), - [`contract ${contract.name}`, ...printInheritance(contract, helpers), '{'].join(' '), - - spaceBetween( - contract.variables, - printConstructor(contract, helpers), - ...fns.code, - ...fns.modifiers, - hasOverrides ? [`// The following functions are overrides required by Solidity.`] : [], - ...fns.override, - ), - - `}`, - ], - ), + // Imports + // TODO: consolidate imports from same file + contracts + .flatMap(contract => printImports(contract.imports, withHelpers(contract, opts))) + .filter((line, i, lines) => lines.indexOf(line) === i), + + // contracts + ...contracts.map(contract => { + const helpers = withHelpers(contract, opts); + const fns = mapValues(sortedFunctions(contract), fns => fns.map(fn => printFunction(fn, helpers))); + const hasOverrides = fns.override.some(l => l.length > 0); + return [ + ...printNatspecTags(contract.natspecTags), + [`contract ${contract.name}`, ...printInheritance(contract, helpers), '{'].join(' '), + spaceBetween( + contract.variables, + printConstructor(contract, helpers), + ...fns.code, + ...fns.modifiers, + hasOverrides ? [`// The following functions are overrides required by Solidity.`] : [], + ...fns.override, + ), + `}`, + ]; + }) + ) ); } diff --git a/packages/core/solidity/src/signer.ts b/packages/core/solidity/src/signer.ts index b5441e6f0..db7b94ac9 100644 --- a/packages/core/solidity/src/signer.ts +++ b/packages/core/solidity/src/signer.ts @@ -21,7 +21,7 @@ export function addSigner(c: ContractBuilder, signer: SignerOptions): void { name: 'Initializable', path: '@openzeppelin/contracts/proxy/utils/Initializable.sol', }); - const fn = signerFunctions[`initialize${signer}`]; + const fn = signerFunctions.initialize[signer]; c.addModifier('initializer', fn); const args = fn.args; @@ -77,33 +77,38 @@ export const signers = { }; export const signerFunctions = { - ...defineFunctions({ - initializeECDSA: { + initialize: { + ECDSA: { + name: 'initialize', kind: 'public' as const, args: [{ name: 'signer', type: 'address' }], }, - initializeP256: { + P256: { + name: 'initialize', kind: 'public' as const, args: [ { name: 'qx', type: 'bytes32' }, { name: 'qy', type: 'bytes32' }, ], }, - initializeRSA: { + RSA: { + name: 'initialize', kind: 'public' as const, args: [ { name: 'e', type: 'bytes memory' }, { name: 'n', type: 'bytes memory' }, ], }, - initializeMultisig: { + Multisig: { + name: 'initialize', kind: 'public' as const, args: [ { name: 'signers', type: 'bytes[] memory' }, { name: 'threshold', type: 'uint256' }, ], }, - initializeMultisigWeighted: { + MultisigWeighted: { + name: 'initialize', kind: 'public' as const, args: [ { name: 'signers', type: 'bytes[] memory' }, @@ -111,14 +116,15 @@ export const signerFunctions = { { name: 'threshold', type: 'uint256' }, ], }, - _rawSignatureValidation: { - kind: 'internal' as const, - args: [ - { name: 'hash', type: 'bytes32' }, - { name: 'signature', type: 'bytes calldata' }, - ], - returns: ['bool'], - mutability: 'view' as const, - }, - }), + }, + _rawSignatureValidation: { + name: '_rawSignatureValidation', + kind: 'internal' as const, + args: [ + { name: 'hash', type: 'bytes32' }, + { name: 'signature', type: 'bytes calldata' }, + ], + returns: ['bool'], + mutability: 'view' as const, + }, }; From 7c9772a96c0e954d4351c93eb5a5e611ecf6da27 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Fri, 20 Jun 2025 00:15:29 +0200 Subject: [PATCH 02/17] snapshot with factory --- packages/core/solidity/src/account.test.ts | 3 +- packages/core/solidity/src/account.test.ts.md | 1621 ++++++++++++++++- .../core/solidity/src/account.test.ts.snap | Bin 4544 -> 6369 bytes 3 files changed, 1620 insertions(+), 4 deletions(-) diff --git a/packages/core/solidity/src/account.test.ts b/packages/core/solidity/src/account.test.ts index b78bfc4c7..0b7a766fe 100644 --- a/packages/core/solidity/src/account.test.ts +++ b/packages/core/solidity/src/account.test.ts @@ -47,8 +47,7 @@ function testAccount(title: string, opts: Partial) { ...opts, }; test(title, t => { - const c = buildAccount(fullOpts); - t.snapshot(printContract(c)); + t.snapshot(account.print(fullOpts)); }); testAPIEquivalence(`${title} API equivalence`, fullOpts); } diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index 01d7e2e4c..c69803eef 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -752,6 +752,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerECDSA is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ constructor() EIP712("CustomAccount with SignerECDSA", "1") {}␊ @@ -760,6 +761,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(signer);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerECDSAFactory {␊ + CustomAccount with SignerECDSA public immutable implementation = new CustomAccount with SignerECDSA();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerECDSA(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC1271 @@ -774,6 +798,7 @@ Generated by [AVA](https://avajs.dev). import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSA {␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -789,6 +814,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(signer);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerECDSAERC1271Factory {␊ + CustomAccount with SignerECDSAERC1271 public immutable implementation = new CustomAccount with SignerECDSAERC1271();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerECDSAERC1271(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC7739 @@ -804,6 +852,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ constructor() EIP712("CustomAccount with SignerECDSAERC7739", "1") {}␊ @@ -812,6 +861,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(signer);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerECDSAERC7739Factory {␊ + CustomAccount with SignerECDSAERC7739 public immutable implementation = new CustomAccount with SignerECDSAERC7739();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerECDSAERC7739(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC721Holder @@ -828,6 +900,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder {␊ constructor() EIP712("CustomAccount with SignerECDSAERC721Holder", "1") {}␊ @@ -836,6 +909,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(signer);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerECDSAERC721HolderFactory {␊ + CustomAccount with SignerECDSAERC721Holder public immutable implementation = new CustomAccount with SignerECDSAERC721Holder();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerECDSAERC721Holder(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC1155Holder @@ -852,6 +948,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC1155Holder {␊ constructor() EIP712("CustomAccount with SignerECDSAERC1155Holder", "1") {}␊ @@ -860,6 +957,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(signer);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerECDSAERC1155HolderFactory {␊ + CustomAccount with SignerECDSAERC1155Holder public immutable implementation = new CustomAccount with SignerECDSAERC1155Holder();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerECDSAERC1155Holder(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC721Holder and ERC1155Holder @@ -877,6 +997,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ constructor()␊ @@ -887,6 +1008,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(signer);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerECDSAERC721HolderERC1155HolderFactory {␊ + CustomAccount with SignerECDSAERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerECDSAERC721HolderERC1155Holder();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerECDSAERC721HolderERC1155Holder(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC7821 Execution @@ -903,6 +1047,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7821} from "@openzeppelin/community-contracts/account/extensions/ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -920,6 +1065,29 @@ Generated by [AVA](https://avajs.dev). return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC7579 @@ -938,6 +1106,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -981,6 +1150,29 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC7579 with ERC1271 @@ -998,6 +1190,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerECDSA {␊ function initialize(address signer) public initializer {␊ @@ -1036,6 +1229,29 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC7579 with ERC7739 @@ -1054,6 +1270,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -1097,6 +1314,29 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerECDSA with ERC7579 hooks @@ -1116,6 +1356,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerECDSA {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -1159,6 +1400,29 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 named @@ -1174,6 +1438,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256 {␊ constructor() EIP712("CustomAccount with SignerP256", "1") {}␊ @@ -1182,6 +1447,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(qx, qy);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerP256Factory {␊ + CustomAccount with SignerP256 public immutable implementation = new CustomAccount with SignerP256();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerP256(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC1271 @@ -1196,6 +1484,7 @@ Generated by [AVA](https://avajs.dev). import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256 {␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -1211,6 +1500,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(qx, qy);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerP256ERC1271Factory {␊ + CustomAccount with SignerP256ERC1271 public immutable implementation = new CustomAccount with SignerP256ERC1271();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerP256ERC1271(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC7739 @@ -1226,6 +1538,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256 {␊ constructor() EIP712("CustomAccount with SignerP256ERC7739", "1") {}␊ @@ -1234,6 +1547,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(qx, qy);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerP256ERC7739Factory {␊ + CustomAccount with SignerP256ERC7739 public immutable implementation = new CustomAccount with SignerP256ERC7739();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerP256ERC7739(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC721Holder @@ -1250,6 +1586,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC721Holder {␊ constructor() EIP712("CustomAccount with SignerP256ERC721Holder", "1") {}␊ @@ -1258,6 +1595,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(qx, qy);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderFactory {␊ + CustomAccount with SignerP256ERC721Holder public immutable implementation = new CustomAccount with SignerP256ERC721Holder();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerP256ERC721Holder(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC1155Holder @@ -1274,6 +1634,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC1155Holder {␊ constructor() EIP712("CustomAccount with SignerP256ERC1155Holder", "1") {}␊ @@ -1282,6 +1643,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(qx, qy);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerP256ERC1155HolderFactory {␊ + CustomAccount with SignerP256ERC1155Holder public immutable implementation = new CustomAccount with SignerP256ERC1155Holder();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerP256ERC1155Holder(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC721Holder and ERC1155Holder @@ -1299,6 +1683,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC721Holder, ERC1155Holder {␊ constructor()␊ @@ -1309,6 +1694,29 @@ Generated by [AVA](https://avajs.dev). _setSigner(qx, qy);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155HolderFactory {␊ + CustomAccount with SignerP256ERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerP256ERC721HolderERC1155Holder();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerP256ERC721HolderERC1155Holder(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC7821 Execution @@ -1325,6 +1733,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7821} from "@openzeppelin/community-contracts/account/extensions/ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -1342,6 +1751,29 @@ Generated by [AVA](https://avajs.dev). return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC7579 @@ -1360,6 +1792,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -1403,6 +1836,29 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC7579 with ERC1271 @@ -1420,6 +1876,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerP256 {␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ @@ -1458,6 +1915,29 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC7579 with ERC7739 @@ -1476,6 +1956,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -1519,6 +2000,29 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerP256 with ERC7579 hooks @@ -1538,6 +2042,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/community-contracts/utils/cryptography/SignerP256.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerP256 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -1581,6 +2086,29 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA named @@ -1596,6 +2124,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSA {␊ constructor() EIP712("CustomAccount with SignerRSA", "1") {}␊ @@ -1604,6 +2133,38 @@ Generated by [AVA](https://avajs.dev). _setSigner(e, n);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerRSAFactory {␊ + CustomAccount with SignerRSA public immutable implementation = new CustomAccount with SignerRSA();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerRSA(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC1271 @@ -1618,6 +2179,7 @@ Generated by [AVA](https://avajs.dev). import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSA {␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -1633,6 +2195,38 @@ Generated by [AVA](https://avajs.dev). _setSigner(e, n);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerRSAERC1271Factory {␊ + CustomAccount with SignerRSAERC1271 public immutable implementation = new CustomAccount with SignerRSAERC1271();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerRSAERC1271(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC7739 @@ -1648,6 +2242,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSA {␊ constructor() EIP712("CustomAccount with SignerRSAERC7739", "1") {}␊ @@ -1656,6 +2251,38 @@ Generated by [AVA](https://avajs.dev). _setSigner(e, n);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerRSAERC7739Factory {␊ + CustomAccount with SignerRSAERC7739 public immutable implementation = new CustomAccount with SignerRSAERC7739();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerRSAERC7739(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC721Holder @@ -1672,6 +2299,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC721Holder {␊ constructor() EIP712("CustomAccount with SignerRSAERC721Holder", "1") {}␊ @@ -1680,6 +2308,38 @@ Generated by [AVA](https://avajs.dev). _setSigner(e, n);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerRSAERC721HolderFactory {␊ + CustomAccount with SignerRSAERC721Holder public immutable implementation = new CustomAccount with SignerRSAERC721Holder();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerRSAERC721Holder(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC1155Holder @@ -1696,6 +2356,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC1155Holder {␊ constructor() EIP712("CustomAccount with SignerRSAERC1155Holder", "1") {}␊ @@ -1704,6 +2365,38 @@ Generated by [AVA](https://avajs.dev). _setSigner(e, n);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerRSAERC1155HolderFactory {␊ + CustomAccount with SignerRSAERC1155Holder public immutable implementation = new CustomAccount with SignerRSAERC1155Holder();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerRSAERC1155Holder(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC721Holder and ERC1155Holder @@ -1721,6 +2414,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC721Holder, ERC1155Holder {␊ constructor()␊ @@ -1731,6 +2425,38 @@ Generated by [AVA](https://avajs.dev). _setSigner(e, n);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155HolderFactory {␊ + CustomAccount with SignerRSAERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerRSAERC721HolderERC1155Holder();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerRSAERC721HolderERC1155Holder(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC7821 Execution @@ -1747,6 +2473,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7821} from "@openzeppelin/community-contracts/account/extensions/ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -1764,6 +2491,38 @@ Generated by [AVA](https://avajs.dev). return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC7579 @@ -1782,6 +2541,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -1825,6 +2585,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC7579 with ERC1271 @@ -1842,6 +2634,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerRSA {␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ @@ -1880,6 +2673,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC7579 with ERC7739 @@ -1898,6 +2723,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -1941,6 +2767,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerRSA with ERC7579 hooks @@ -1960,6 +2818,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerRSA.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerRSA {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -2003,6 +2862,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig named @@ -2018,6 +2909,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913 {␊ constructor() EIP712("CustomAccount with SignerMultisig", "1") {}␊ @@ -2042,6 +2934,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigFactory {␊ + CustomAccount with SignerMultisig public immutable implementation = new CustomAccount with SignerMultisig();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisig(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig with ERC1271 @@ -2056,6 +2980,7 @@ Generated by [AVA](https://avajs.dev). import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913 {␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -2087,6 +3012,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigERC1271Factory {␊ + CustomAccount with SignerMultisigERC1271 public immutable implementation = new CustomAccount with SignerMultisigERC1271();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigERC1271(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig with ERC7739 @@ -2102,6 +3059,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913 {␊ constructor() EIP712("CustomAccount with SignerMultisigERC7739", "1") {}␊ @@ -2126,6 +3084,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigERC7739Factory {␊ + CustomAccount with SignerMultisigERC7739 public immutable implementation = new CustomAccount with SignerMultisigERC7739();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigERC7739(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig with ERC721Holder @@ -2142,6 +3132,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder {␊ constructor() EIP712("CustomAccount with SignerMultisigERC721Holder", "1") {}␊ @@ -2162,8 +3153,40 @@ Generated by [AVA](https://avajs.dev). _removeSigners(signers);␊ }␊ ␊ - function setThreshold(uint256 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ + function setThreshold(uint256 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerMultisigERC721HolderFactory {␊ + CustomAccount with SignerMultisigERC721Holder public immutable implementation = new CustomAccount with SignerMultisigERC721Holder();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigERC721Holder(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ }␊ }␊ ` @@ -2182,6 +3205,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC1155Holder {␊ constructor() EIP712("CustomAccount with SignerMultisigERC1155Holder", "1") {}␊ @@ -2206,6 +3230,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigERC1155HolderFactory {␊ + CustomAccount with SignerMultisigERC1155Holder public immutable implementation = new CustomAccount with SignerMultisigERC1155Holder();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigERC1155Holder(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig with ERC721Holder and ERC1155Holder @@ -2223,6 +3279,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder, ERC1155Holder {␊ constructor()␊ @@ -2249,6 +3306,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155HolderFactory {␊ + CustomAccount with SignerMultisigERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerMultisigERC721HolderERC1155Holder();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigERC721HolderERC1155Holder(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig with ERC7821 Execution @@ -2265,6 +3354,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7821} from "@openzeppelin/community-contracts/account/extensions/ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -2298,6 +3388,38 @@ Generated by [AVA](https://avajs.dev). return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig with ERC7579 @@ -2316,6 +3438,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -2375,6 +3498,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig with ERC7579 with ERC1271 @@ -2392,6 +3547,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, MultiSignerERC7913 {␊ function initialize(bytes[] memory signers, uint256 threshold)␊ @@ -2446,6 +3602,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig with ERC7579 with ERC7739 @@ -2464,6 +3652,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -2523,6 +3712,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisig with ERC7579 hooks @@ -2542,6 +3763,7 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -2601,6 +3823,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted named @@ -2616,6 +3870,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigWeighted is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ constructor() EIP712("CustomAccount with SignerMultisigWeighted", "1") {}␊ @@ -2648,6 +3903,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedFactory {␊ + CustomAccount with SignerMultisigWeighted public immutable implementation = new CustomAccount with SignerMultisigWeighted();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigWeighted(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC1271 @@ -2662,6 +3949,7 @@ Generated by [AVA](https://avajs.dev). import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Weighted {␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -2701,6 +3989,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC1271Factory {␊ + CustomAccount with SignerMultisigWeightedERC1271 public immutable implementation = new CustomAccount with SignerMultisigWeightedERC1271();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigWeightedERC1271(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC7739 @@ -2716,6 +4036,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ constructor()␊ @@ -2750,6 +4071,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC7739Factory {␊ + CustomAccount with SignerMultisigWeightedERC7739 public immutable implementation = new CustomAccount with SignerMultisigWeightedERC7739();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigWeightedERC7739(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC721Holder @@ -2766,6 +4119,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder {␊ constructor()␊ @@ -2800,6 +4154,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC721HolderFactory {␊ + CustomAccount with SignerMultisigWeightedERC721Holder public immutable implementation = new CustomAccount with SignerMultisigWeightedERC721Holder();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigWeightedERC721Holder(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC1155Holder @@ -2816,6 +4202,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC1155Holder {␊ constructor()␊ @@ -2850,6 +4237,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC1155HolderFactory {␊ + CustomAccount with SignerMultisigWeightedERC1155Holder public immutable implementation = new CustomAccount with SignerMultisigWeightedERC1155Holder();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigWeightedERC1155Holder(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC721Holder and ERC1155Holder @@ -2867,6 +4286,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/community-contracts/utils/cryptography/ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder, ERC1155Holder {␊ constructor()␊ @@ -2901,6 +4321,38 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155HolderFactory {␊ + CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC7821 Execution @@ -2917,6 +4369,7 @@ Generated by [AVA](https://avajs.dev). import {ERC7821} from "@openzeppelin/community-contracts/account/extensions/ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC7821 {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -2958,6 +4411,38 @@ Generated by [AVA](https://avajs.dev). return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC7579 @@ -2977,6 +4462,7 @@ Generated by [AVA](https://avajs.dev). import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -3044,6 +4530,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC7579 with ERC1271 @@ -3062,6 +4580,7 @@ Generated by [AVA](https://avajs.dev). import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, MultiSignerERC7913Weighted {␊ function initialize(bytes[] memory signers, uint256[] memory weights, uint256 threshold)␊ @@ -3124,6 +4643,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC7579 with ERC7739 @@ -3143,6 +4694,7 @@ Generated by [AVA](https://avajs.dev). import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -3210,6 +4762,38 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted with ERC7579 hooks @@ -3230,6 +4814,7 @@ Generated by [AVA](https://avajs.dev). import {MultiSignerERC7913} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/community-contracts/utils/cryptography/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913Weighted {␊ constructor() EIP712("MyAccount", "1") {}␊ @@ -3297,4 +4882,36 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, weights, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, weights, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ + internal␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, weights, threshold, salt));␊ + }␊ + }␊ ` diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index ee6c8b5eaf7729f1eed551eb67d9aeddb1d24aff..4a5dd99638eedab54d4d0ad9dbc93159b1340b63 100644 GIT binary patch literal 6369 z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8ok^cET)$dT zt;*=WLg(%br>xHGEzPw+MSH6$KZvWt-Z zJa+?nGkYI(p>{BeIL9_6(hUZhF%(_!&ojPqvMr2!NAT|YD| z5k+L&r95p81IzCcXQjOzxCr!=V2H@WpS!rdAoNSOQ0Cp2Mp2vI2c}cPYrx%)DNJV7 zIqiDw8;t$s(aow7LuAhTN4}5%2Wb&cOS8j>zW25&UyE@_V8O*2#qm+sWBh7KssBXK zV~ffA=`4K7KZM5ZeJu)nTI?_>=4>93EoC(2^B#ShJSg&qOhk15w*&WR*Z!9IJaYw^ z!VqxdBg5qo8dqM-zS%n9jk*^L<2ZR!7pJ-^Gw&Cg6=`;`uy;6B0 znb@Fd^O3BcwEne4eRAR{)};Jm!6&6o49$$sKYIa18Y*S_Q)L@!27(++p%eWCW*v0q z*j Date: Fri, 20 Jun 2025 00:21:14 +0200 Subject: [PATCH 03/17] names --- packages/core/solidity/src/account.test.ts.md | 120 +++++++++--------- .../core/solidity/src/account.test.ts.snap | Bin 6369 -> 6367 bytes packages/core/solidity/src/account.ts | 18 ++- 3 files changed, 71 insertions(+), 67 deletions(-) diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index c69803eef..533c99997 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -763,14 +763,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerECDSAFactory {␊ - CustomAccount with SignerECDSA public immutable implementation = new CustomAccount with SignerECDSA();␊ + CustomAccountWithSignerECDSA public immutable implementation = new CustomAccountWithSignerECDSA();␊ ␊ function create(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerECDSA(instance).initialize(signer);␊ + CustomAccountWithSignerECDSA(instance).initialize(signer);␊ }␊ return instance;␊ ␊ @@ -816,14 +816,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerECDSAERC1271Factory {␊ - CustomAccount with SignerECDSAERC1271 public immutable implementation = new CustomAccount with SignerECDSAERC1271();␊ + CustomAccountWithSignerECDSAERC1271 public immutable implementation = new CustomAccountWithSignerECDSAERC1271();␊ ␊ function create(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerECDSAERC1271(instance).initialize(signer);␊ + CustomAccountWithSignerECDSAERC1271(instance).initialize(signer);␊ }␊ return instance;␊ ␊ @@ -863,14 +863,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerECDSAERC7739Factory {␊ - CustomAccount with SignerECDSAERC7739 public immutable implementation = new CustomAccount with SignerECDSAERC7739();␊ + CustomAccountWithSignerECDSAERC7739 public immutable implementation = new CustomAccountWithSignerECDSAERC7739();␊ ␊ function create(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerECDSAERC7739(instance).initialize(signer);␊ + CustomAccountWithSignerECDSAERC7739(instance).initialize(signer);␊ }␊ return instance;␊ ␊ @@ -911,14 +911,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerECDSAERC721HolderFactory {␊ - CustomAccount with SignerECDSAERC721Holder public immutable implementation = new CustomAccount with SignerECDSAERC721Holder();␊ + CustomAccountWithSignerECDSAERC721Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721Holder();␊ ␊ function create(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerECDSAERC721Holder(instance).initialize(signer);␊ + CustomAccountWithSignerECDSAERC721Holder(instance).initialize(signer);␊ }␊ return instance;␊ ␊ @@ -959,14 +959,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerECDSAERC1155HolderFactory {␊ - CustomAccount with SignerECDSAERC1155Holder public immutable implementation = new CustomAccount with SignerECDSAERC1155Holder();␊ + CustomAccountWithSignerECDSAERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC1155Holder();␊ ␊ function create(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerECDSAERC1155Holder(instance).initialize(signer);␊ + CustomAccountWithSignerECDSAERC1155Holder(instance).initialize(signer);␊ }␊ return instance;␊ ␊ @@ -1010,14 +1010,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerECDSAERC721HolderERC1155HolderFactory {␊ - CustomAccount with SignerECDSAERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerECDSAERC721HolderERC1155Holder();␊ + CustomAccountWithSignerECDSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721HolderERC1155Holder();␊ ␊ function create(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerECDSAERC721HolderERC1155Holder(instance).initialize(signer);␊ + CustomAccountWithSignerECDSAERC721HolderERC1155Holder(instance).initialize(signer);␊ }␊ return instance;␊ ␊ @@ -1449,14 +1449,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerP256Factory {␊ - CustomAccount with SignerP256 public immutable implementation = new CustomAccount with SignerP256();␊ + CustomAccountWithSignerP256 public immutable implementation = new CustomAccountWithSignerP256();␊ ␊ function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerP256(instance).initialize(qx, qy);␊ + CustomAccountWithSignerP256(instance).initialize(qx, qy);␊ }␊ return instance;␊ ␊ @@ -1502,14 +1502,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerP256ERC1271Factory {␊ - CustomAccount with SignerP256ERC1271 public immutable implementation = new CustomAccount with SignerP256ERC1271();␊ + CustomAccountWithSignerP256ERC1271 public immutable implementation = new CustomAccountWithSignerP256ERC1271();␊ ␊ function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerP256ERC1271(instance).initialize(qx, qy);␊ + CustomAccountWithSignerP256ERC1271(instance).initialize(qx, qy);␊ }␊ return instance;␊ ␊ @@ -1549,14 +1549,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerP256ERC7739Factory {␊ - CustomAccount with SignerP256ERC7739 public immutable implementation = new CustomAccount with SignerP256ERC7739();␊ + CustomAccountWithSignerP256ERC7739 public immutable implementation = new CustomAccountWithSignerP256ERC7739();␊ ␊ function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerP256ERC7739(instance).initialize(qx, qy);␊ + CustomAccountWithSignerP256ERC7739(instance).initialize(qx, qy);␊ }␊ return instance;␊ ␊ @@ -1597,14 +1597,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerP256ERC721HolderFactory {␊ - CustomAccount with SignerP256ERC721Holder public immutable implementation = new CustomAccount with SignerP256ERC721Holder();␊ + CustomAccountWithSignerP256ERC721Holder public immutable implementation = new CustomAccountWithSignerP256ERC721Holder();␊ ␊ function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerP256ERC721Holder(instance).initialize(qx, qy);␊ + CustomAccountWithSignerP256ERC721Holder(instance).initialize(qx, qy);␊ }␊ return instance;␊ ␊ @@ -1645,14 +1645,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerP256ERC1155HolderFactory {␊ - CustomAccount with SignerP256ERC1155Holder public immutable implementation = new CustomAccount with SignerP256ERC1155Holder();␊ + CustomAccountWithSignerP256ERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC1155Holder();␊ ␊ function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerP256ERC1155Holder(instance).initialize(qx, qy);␊ + CustomAccountWithSignerP256ERC1155Holder(instance).initialize(qx, qy);␊ }␊ return instance;␊ ␊ @@ -1696,14 +1696,14 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerP256ERC721HolderERC1155HolderFactory {␊ - CustomAccount with SignerP256ERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerP256ERC721HolderERC1155Holder();␊ + CustomAccountWithSignerP256ERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC721HolderERC1155Holder();␊ ␊ function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerP256ERC721HolderERC1155Holder(instance).initialize(qx, qy);␊ + CustomAccountWithSignerP256ERC721HolderERC1155Holder(instance).initialize(qx, qy);␊ }␊ return instance;␊ ␊ @@ -2135,7 +2135,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerRSAFactory {␊ - CustomAccount with SignerRSA public immutable implementation = new CustomAccount with SignerRSA();␊ + CustomAccountWithSignerRSA public immutable implementation = new CustomAccountWithSignerRSA();␊ ␊ function create(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ @@ -2145,7 +2145,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerRSA(instance).initialize(e, n);␊ + CustomAccountWithSignerRSA(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ @@ -2197,7 +2197,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerRSAERC1271Factory {␊ - CustomAccount with SignerRSAERC1271 public immutable implementation = new CustomAccount with SignerRSAERC1271();␊ + CustomAccountWithSignerRSAERC1271 public immutable implementation = new CustomAccountWithSignerRSAERC1271();␊ ␊ function create(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ @@ -2207,7 +2207,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerRSAERC1271(instance).initialize(e, n);␊ + CustomAccountWithSignerRSAERC1271(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ @@ -2253,7 +2253,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerRSAERC7739Factory {␊ - CustomAccount with SignerRSAERC7739 public immutable implementation = new CustomAccount with SignerRSAERC7739();␊ + CustomAccountWithSignerRSAERC7739 public immutable implementation = new CustomAccountWithSignerRSAERC7739();␊ ␊ function create(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ @@ -2263,7 +2263,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerRSAERC7739(instance).initialize(e, n);␊ + CustomAccountWithSignerRSAERC7739(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ @@ -2310,7 +2310,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerRSAERC721HolderFactory {␊ - CustomAccount with SignerRSAERC721Holder public immutable implementation = new CustomAccount with SignerRSAERC721Holder();␊ + CustomAccountWithSignerRSAERC721Holder public immutable implementation = new CustomAccountWithSignerRSAERC721Holder();␊ ␊ function create(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ @@ -2320,7 +2320,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerRSAERC721Holder(instance).initialize(e, n);␊ + CustomAccountWithSignerRSAERC721Holder(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ @@ -2367,7 +2367,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerRSAERC1155HolderFactory {␊ - CustomAccount with SignerRSAERC1155Holder public immutable implementation = new CustomAccount with SignerRSAERC1155Holder();␊ + CustomAccountWithSignerRSAERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC1155Holder();␊ ␊ function create(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ @@ -2377,7 +2377,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerRSAERC1155Holder(instance).initialize(e, n);␊ + CustomAccountWithSignerRSAERC1155Holder(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ @@ -2427,7 +2427,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerRSAERC721HolderERC1155HolderFactory {␊ - CustomAccount with SignerRSAERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerRSAERC721HolderERC1155Holder();␊ + CustomAccountWithSignerRSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC721HolderERC1155Holder();␊ ␊ function create(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ @@ -2437,7 +2437,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerRSAERC721HolderERC1155Holder(instance).initialize(e, n);␊ + CustomAccountWithSignerRSAERC721HolderERC1155Holder(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ @@ -2936,7 +2936,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigFactory {␊ - CustomAccount with SignerMultisig public immutable implementation = new CustomAccount with SignerMultisig();␊ + CustomAccountWithSignerMultisig public immutable implementation = new CustomAccountWithSignerMultisig();␊ ␊ function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ public␊ @@ -2946,7 +2946,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisig(instance).initialize(signers, threshold);␊ + CustomAccountWithSignerMultisig(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -3014,7 +3014,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigERC1271Factory {␊ - CustomAccount with SignerMultisigERC1271 public immutable implementation = new CustomAccount with SignerMultisigERC1271();␊ + CustomAccountWithSignerMultisigERC1271 public immutable implementation = new CustomAccountWithSignerMultisigERC1271();␊ ␊ function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ public␊ @@ -3024,7 +3024,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigERC1271(instance).initialize(signers, threshold);␊ + CustomAccountWithSignerMultisigERC1271(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -3086,7 +3086,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigERC7739Factory {␊ - CustomAccount with SignerMultisigERC7739 public immutable implementation = new CustomAccount with SignerMultisigERC7739();␊ + CustomAccountWithSignerMultisigERC7739 public immutable implementation = new CustomAccountWithSignerMultisigERC7739();␊ ␊ function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ public␊ @@ -3096,7 +3096,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigERC7739(instance).initialize(signers, threshold);␊ + CustomAccountWithSignerMultisigERC7739(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -3159,7 +3159,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigERC721HolderFactory {␊ - CustomAccount with SignerMultisigERC721Holder public immutable implementation = new CustomAccount with SignerMultisigERC721Holder();␊ + CustomAccountWithSignerMultisigERC721Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721Holder();␊ ␊ function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ public␊ @@ -3169,7 +3169,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigERC721Holder(instance).initialize(signers, threshold);␊ + CustomAccountWithSignerMultisigERC721Holder(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -3232,7 +3232,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigERC1155HolderFactory {␊ - CustomAccount with SignerMultisigERC1155Holder public immutable implementation = new CustomAccount with SignerMultisigERC1155Holder();␊ + CustomAccountWithSignerMultisigERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC1155Holder();␊ ␊ function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ public␊ @@ -3242,7 +3242,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigERC1155Holder(instance).initialize(signers, threshold);␊ + CustomAccountWithSignerMultisigERC1155Holder(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -3308,7 +3308,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigERC721HolderERC1155HolderFactory {␊ - CustomAccount with SignerMultisigERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerMultisigERC721HolderERC1155Holder();␊ + CustomAccountWithSignerMultisigERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721HolderERC1155Holder();␊ ␊ function create(bytes[] memory signers, uint256 threshold, bytes32 salt)␊ public␊ @@ -3318,7 +3318,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigERC721HolderERC1155Holder(instance).initialize(signers, threshold);␊ + CustomAccountWithSignerMultisigERC721HolderERC1155Holder(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -3905,7 +3905,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigWeightedFactory {␊ - CustomAccount with SignerMultisigWeighted public immutable implementation = new CustomAccount with SignerMultisigWeighted();␊ + CustomAccountWithSignerMultisigWeighted public immutable implementation = new CustomAccountWithSignerMultisigWeighted();␊ ␊ function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ public␊ @@ -3915,7 +3915,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigWeighted(instance).initialize(signers, weights, threshold);␊ + CustomAccountWithSignerMultisigWeighted(instance).initialize(signers, weights, threshold);␊ }␊ return instance;␊ ␊ @@ -3991,7 +3991,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC1271Factory {␊ - CustomAccount with SignerMultisigWeightedERC1271 public immutable implementation = new CustomAccount with SignerMultisigWeightedERC1271();␊ + CustomAccountWithSignerMultisigWeightedERC1271 public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC1271();␊ ␊ function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ public␊ @@ -4001,7 +4001,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigWeightedERC1271(instance).initialize(signers, weights, threshold);␊ + CustomAccountWithSignerMultisigWeightedERC1271(instance).initialize(signers, weights, threshold);␊ }␊ return instance;␊ ␊ @@ -4073,7 +4073,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC7739Factory {␊ - CustomAccount with SignerMultisigWeightedERC7739 public immutable implementation = new CustomAccount with SignerMultisigWeightedERC7739();␊ + CustomAccountWithSignerMultisigWeightedERC7739 public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC7739();␊ ␊ function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ public␊ @@ -4083,7 +4083,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigWeightedERC7739(instance).initialize(signers, weights, threshold);␊ + CustomAccountWithSignerMultisigWeightedERC7739(instance).initialize(signers, weights, threshold);␊ }␊ return instance;␊ ␊ @@ -4156,7 +4156,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC721HolderFactory {␊ - CustomAccount with SignerMultisigWeightedERC721Holder public immutable implementation = new CustomAccount with SignerMultisigWeightedERC721Holder();␊ + CustomAccountWithSignerMultisigWeightedERC721Holder public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC721Holder();␊ ␊ function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ public␊ @@ -4166,7 +4166,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigWeightedERC721Holder(instance).initialize(signers, weights, threshold);␊ + CustomAccountWithSignerMultisigWeightedERC721Holder(instance).initialize(signers, weights, threshold);␊ }␊ return instance;␊ ␊ @@ -4239,7 +4239,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC1155HolderFactory {␊ - CustomAccount with SignerMultisigWeightedERC1155Holder public immutable implementation = new CustomAccount with SignerMultisigWeightedERC1155Holder();␊ + CustomAccountWithSignerMultisigWeightedERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC1155Holder();␊ ␊ function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ public␊ @@ -4249,7 +4249,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigWeightedERC1155Holder(instance).initialize(signers, weights, threshold);␊ + CustomAccountWithSignerMultisigWeightedERC1155Holder(instance).initialize(signers, weights, threshold);␊ }␊ return instance;␊ ␊ @@ -4323,7 +4323,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155HolderFactory {␊ - CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder public immutable implementation = new CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder();␊ + CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder();␊ ␊ function create(bytes[] memory signers, uint256[] memory weights, uint256 threshold, bytes32 salt)␊ public␊ @@ -4333,7 +4333,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder(instance).initialize(signers, weights, threshold);␊ + CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder(instance).initialize(signers, weights, threshold);␊ }␊ return instance;␊ ␊ diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index 4a5dd99638eedab54d4d0ad9dbc93159b1340b63..e1c4784b8f052849122f388bb99a619af170706c 100644 GIT binary patch literal 6367 zcmZYDWl$SRv9Jr z-uv#8dGGu_?9ACOJF|0kX8-aA@=UsJR&TxDxO+4Cf^g6PGD_I4P9gI*NT ze@gnCI7-k?_IWAsnH)q+1nyU*v0yIJSl90G5JkcuXM&B5Nbg`J*?zXI%B)kt@fvCg z#U&wOVujlH%cZ53DWhUME4@20^{GEFFx0>Pc;Ievn0MUe;VOU#f!Xk;-zrKvOCw@h}5aHxB887jT_cyL3H6EG9?d5OFuJzUXm!R1r7x3y?I7S-^>Dt`#WD7TN`^#^fCdxA^I7c0 z(5Rvhu(Y}~bMw!5mF{^v@Q<^B4k4FN?c`A$!OJvB?T?`IW&Z_AAS1bpRvkC zf#$)Q1o$CfzNfNKg*JAJAb6h)gO>23WcU2F=`q(ahWW`*a%~FVCNRG{_%%bRgd(WIEJ=fY~k0koguqb zHX0j6#02(r@D-NnN~ z`tE`kL2grF-pSMm#5(+^t2@;7A%@T9ubr5?^&4~dCS!x+o{x%^S~HDd>Rsf4mez@1 z`{#qaBGhZEY*Zukf3#O-Obos`Fn@274nJP3;SGpQx7~Hi8Inouh_do2`|D?}w~{M6 z%Q9Tv%=Ke2L!hkdCQc5l_ptUIsRA;=<5RyJ&{z+6R<6vM2JME_qE7B>LBV|;9;%G^ zHG|mPhSc3p{%AulZ+%Z>`x-=fA9J0|uW?Q=7jpRL%O7MaIu~hdxNkp9_d9h;AF|4n)&a-R-c9m1se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ZJ>IR@$?y5ubv+a5jaH*N*ZZuhlpRXI>KShkHUF;)yuhGZq+r5|+?hl+skjN}*tb zfLIJ_?4v=1$V@KF8zMVegh;NdBnl@m*Oe<_aC!nEBCb9gk{}l@tIY--RtmcllwZDn zow(K*n|?>3!7q1}k>v|VcIS`TOyi}$)XnK}E(~TdT4Ptwl;0j~T2x<3NL}kkU0B+> z!R=ahuC=kpP$DOq(Q)`mTKV_Qox z`%9MYlZW`KDroi$&}MK9I1VZi{a1QCh1iNraTic}y@^l{T`#d3SA$IB+l|(@CcJ|{JiJ-= z<`JGgHK(8q7Le@q{g;tQf2HB~y+BEIY8mz36g^gn$a+ITDclU84B)R)AC%6jDQly8 z=(1TKTUoAa{PXyv0!>&UtZ+P~(9gCA>v_IipV;ryKT2VZe#G@Q%k@}$f@AU#!Jc|F zqIicI!n*6kSoOGnl~#skMRDkia_OKFiA%^!bO9KE3G|6{-icPj2wM{*guN+eCg@v3 zd>zC2CxW_GY+FI$sP&F4t5qYkNh254ahjM52 ziUg;UsU1YDdFvVq$bJyYO?xfnlTZASi4}N(TIL?miYgl3#JoO-HaU6j6KslC=k@gM zK-)HM+$ETuZV~s4Eix8&Jnq59E?M#}bknr0xm>wi(eLcLS_VYzpKho4WH%K|71kJ$ zc*KICUJdy;i2Pm1T{Ou=CL72mLLvH7iqg?bGgg@!)1(xHL?>HN`KZ>9x*enG-!=`|ev)TZtrTDFY z!~x!83vz&;9HSQqDLTgg{>|DT6&U=O^oD6i9g&kOAr)xf^r*wp)l9}F-x^@&_N92m z=I;+aX30A45Aaf$BaSX%Xz_HX`7)1H^S#3|%v{|C=JLa_h< diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index aa3c199f6..6c52acabe 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -6,6 +6,7 @@ import { defaults as commonDefaults, withCommonDefaults, type CommonOptions } fr import { setInfo } from './set-info'; import { addSigner, signerFunctions, signers, type SignerOptions } from './signer'; import { formatLines } from './utils/format-lines'; +import { toIdentifier } from './utils/to-identifier'; export const defaults: Required = { ...commonDefaults, @@ -258,19 +259,20 @@ export function buildFactory(opts: AccountOptions): Contract | null { const c = new ContractBuilder(allOpts.name + 'Factory'); + const accountName = toIdentifier(allOpts.name); + const accountInitializer = signerFunctions.initialize[allOpts.signer]; + const args = [ ...accountInitializer.args, { name: 'salt', type: 'bytes32' }]; + // Non upgradeable accounts c.addImportOnly({ name: 'Clones', path: '@openzeppelin/contracts/proxy/Clones.sol', }); - // implementation address - c.addVariable(`${allOpts.name} public immutable implementation = new ${allOpts.name}();`); - - // account initializer args - const initializer = signerFunctions.initialize[allOpts.signer]; - const args = [ ...initializer.args, { name: 'salt', type: 'bytes32' }]; + // Implementation address + c.addVariable(`${accountName} public immutable implementation = new ${accountName}();`); + // Functions - create c.setFunctionBody( formatLines([ `bytes32 effectiveSalt = _salt(${args.map(arg => arg.name).join(', ')});`, @@ -278,7 +280,7 @@ export function buildFactory(opts: AccountOptions): Contract | null { `if (instance.code.length) {`, [ `Clones.cloneDeterministic(address(implementation), effectiveSalt);`, - `${allOpts.name}(instance).${initializer.name}(${initializer.args.map(arg => arg.name).join(', ')});`, + `${accountName}(instance).${accountInitializer.name}(${accountInitializer.args.map(arg => arg.name).join(', ')});`, ], `}`, `return instance;`, @@ -286,11 +288,13 @@ export function buildFactory(opts: AccountOptions): Contract | null { { name: 'create', kind: 'public' as const, args, returns: [ 'address' ] }, ); + // Functions - predict c.addFunctionCode( `return Clones.predictDeterministicAddress(address(implementation), _salt(${args.map(arg => arg.name).join(', ')}));`, { name: 'predict', kind: 'public' as const, args, returns: [ 'address' ] }, ); + // Functions - _salt c.addFunctionCode( `return keccak256(abi.encode(${args.map(arg => arg.name).join(', ')}));`, { name: '_salt', kind: 'internal' as const, args, returns: [ 'bytes32' ] }, From 2674a1cd566ed79b39f43342abb90695a603c875 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 8 Sep 2025 21:16:15 +0200 Subject: [PATCH 04/17] refactor Account upgradeability --- packages/core/solidity/src/account.test.ts.md | 1462 ++++++----------- .../core/solidity/src/account.test.ts.snap | Bin 12030 -> 11692 bytes packages/core/solidity/src/account.ts | 121 +- packages/core/solidity/src/contract.ts | 20 +- packages/core/solidity/src/helpers.ts | 31 - packages/core/solidity/src/options.ts | 20 +- packages/core/solidity/src/print.ts | 58 +- packages/core/solidity/src/set-upgradeable.ts | 23 +- packages/core/solidity/src/signer.ts | 49 +- .../core/solidity/src/zip-foundry.test.ts | 5 +- .../core/solidity/src/zip-foundry.test.ts.md | 223 +-- .../solidity/src/zip-foundry.test.ts.snap | Bin 4520 -> 4256 bytes packages/core/solidity/src/zip-foundry.ts | 66 +- .../core/solidity/src/zip-hardhat.test.ts.md | 108 +- .../solidity/src/zip-hardhat.test.ts.snap | Bin 3313 -> 3079 bytes packages/core/solidity/src/zip-hardhat.ts | 32 +- 16 files changed, 636 insertions(+), 1582 deletions(-) delete mode 100644 packages/core/solidity/src/helpers.ts diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index 59f7f04d9..1ea211d9d 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -411,6 +411,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -448,6 +452,10 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -495,6 +503,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccountERC7739", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -534,6 +546,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccountERC721Holder", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -573,6 +589,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccountERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -613,6 +633,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccountERC721HolderERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -652,6 +676,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -706,6 +734,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + __UUPSUpgradeable_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -765,6 +796,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + __UUPSUpgradeable_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -822,6 +856,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + __UUPSUpgradeable_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -865,8 +902,8 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -883,6 +920,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579Hooked_init();␊ + __UUPSUpgradeable_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1181,6 +1221,8 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1233,6 +1275,8 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1283,6 +1327,8 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1320,8 +1366,8 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -1337,6 +1383,8 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579Hooked_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1743,23 +1791,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSA is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSA is Account, EIP712, ERC7739, SignerECDSA {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSA", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1773,16 +1811,10 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/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/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract CustomAccountWithSignerECDSAERC1271 is Account, IERC1271, SignerECDSA {␊ + constructor(address signer) SignerECDSA(signer) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -1792,10 +1824,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ }␊ ` @@ -1810,23 +1838,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSAERC7739 is Account, EIP712, ERC7739, SignerECDSA {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSAERC7739", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1842,23 +1860,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSAERC721Holder is Account, EIP712, ERC7739, SignerECDSA, ERC721Holder {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSAERC721Holder", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1874,23 +1882,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSAERC1155Holder is Account, EIP712, ERC7739, SignerECDSA, ERC1155Holder {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSAERC1155Holder", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1907,23 +1905,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1939,20 +1927,10 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ + constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {}␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -1978,17 +1956,11 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ + constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2001,10 +1973,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -2043,21 +2011,11 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-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/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + contract MyAccount is Account, IERC1271, AccountERC7579, SignerECDSA {␊ + constructor(address signer) SignerECDSA(signer) {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -2106,17 +2064,11 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ + constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2129,10 +2081,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -2173,17 +2121,11 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerECDSA {␊ + constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2196,10 +2138,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -2249,6 +2187,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2278,6 +2217,11 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2287,10 +2231,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2323,6 +2263,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2357,6 +2298,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2391,6 +2333,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2428,6 +2371,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2462,6 +2406,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ @@ -2504,6 +2449,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2516,10 +2467,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2576,7 +2523,9 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2642,6 +2591,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2654,10 +2609,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2700,8 +2651,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -2714,6 +2665,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2726,10 +2683,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2806,6 +2759,10 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2815,10 +2772,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ }␊ ` @@ -2990,6 +2943,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3002,10 +2960,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3055,6 +3009,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ }␊ ␊ @@ -3114,6 +3069,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3126,10 +3086,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3166,8 +3122,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -3179,6 +3135,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3191,10 +3152,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3232,23 +3189,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256 is Account, EIP712, ERC7739, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3262,16 +3209,10 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract CustomAccountWithSignerP256ERC1271 is Account, IERC1271, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3281,10 +3222,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ }␊ ` @@ -3299,23 +3236,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256ERC7739 is Account, EIP712, ERC7739, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256ERC7739", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3331,23 +3258,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256ERC721Holder is Account, EIP712, ERC7739, SignerP256, ERC721Holder {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256ERC721Holder", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3363,23 +3280,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256ERC1155Holder is Account, EIP712, ERC7739, SignerP256, ERC1155Holder {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256ERC1155Holder", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3396,23 +3303,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerP256, ERC721Holder, ERC1155Holder {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3428,23 +3325,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, SignerP256, ERC7821 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("MyAccount", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -3470,20 +3357,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("MyAccount", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3496,10 +3377,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3538,21 +3415,11 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-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/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + contract MyAccount is Account, IERC1271, AccountERC7579, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3601,20 +3468,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("MyAccount", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3627,10 +3488,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3671,20 +3528,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("MyAccount", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3697,10 +3548,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3750,6 +3597,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3780,18 +3628,19 @@ Generated by [AVA](https://avajs.dev). _disableInitializers();␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ view␊ override␊ returns (bytes4)␊ {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -3824,6 +3673,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3858,6 +3708,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3892,6 +3743,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3929,6 +3781,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3963,6 +3816,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ @@ -4005,6 +3859,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4017,10 +3877,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -4077,7 +3933,9 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -4143,6 +4001,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4155,10 +4019,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -4201,8 +4061,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -4215,6 +4075,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4227,10 +4093,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -4307,6 +4169,10 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4316,10 +4182,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ }␊ ` @@ -4491,6 +4353,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4503,10 +4370,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -4556,6 +4419,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ __SignerP256_init(qx, qy);␊ }␊ ␊ @@ -4615,6 +4479,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4627,10 +4496,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -4667,8 +4532,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -4680,6 +4545,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4692,10 +4562,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -4733,23 +4599,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSA is Account, EIP712, ERC7739, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSA", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4763,16 +4619,10 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract CustomAccountWithSignerRSAERC1271 is Account, IERC1271, SignerRSA {␊ + constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4782,10 +4632,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ }␊ ` @@ -4800,23 +4646,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSAERC7739 is Account, EIP712, ERC7739, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSAERC7739", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4832,23 +4668,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSAERC721Holder is Account, EIP712, ERC7739, SignerRSA, ERC721Holder {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSAERC721Holder", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4864,23 +4690,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSAERC1155Holder is Account, EIP712, ERC7739, SignerRSA, ERC1155Holder {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSAERC1155Holder", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4897,23 +4713,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerRSA, ERC721Holder, ERC1155Holder {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4929,23 +4735,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, SignerRSA, ERC7821 {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("MyAccount", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -4971,20 +4767,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("MyAccount", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4997,10 +4787,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5039,21 +4825,11 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-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/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + contract MyAccount is Account, IERC1271, AccountERC7579, SignerRSA {␊ + constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5102,20 +4878,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("MyAccount", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5128,10 +4898,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5172,20 +4938,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("MyAccount", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5198,10 +4958,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5251,6 +5007,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5280,6 +5037,11 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5289,10 +5051,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -5325,6 +5083,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5359,6 +5118,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5393,6 +5153,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5430,6 +5191,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5464,6 +5226,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ @@ -5506,6 +5269,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5518,10 +5287,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -5578,7 +5343,9 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5644,6 +5411,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5656,10 +5429,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -5702,8 +5471,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -5716,6 +5485,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5728,10 +5503,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -5808,6 +5579,10 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5817,10 +5592,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ }␊ ` @@ -5992,6 +5763,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6004,10 +5780,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -6057,6 +5829,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ __SignerRSA_init(e, n);␊ }␊ ␊ @@ -6116,6 +5889,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6128,10 +5906,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -6168,8 +5942,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -6181,6 +5955,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6193,10 +5972,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -6234,27 +6009,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisig is Account, EIP712, ERC7739, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisig", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6280,18 +6041,12 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC1271 is Account, IERC1271, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6301,14 +6056,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6335,30 +6082,16 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC7739 is Account, EIP712, ERC7739, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigERC7739", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ + {}␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -6383,27 +6116,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC721Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigERC721Holder", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6431,27 +6150,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC1155Holder {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigERC1155Holder", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6480,27 +6185,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder, ERC1155Holder {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6528,27 +6219,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, MultiSignerERC7913, ERC7821 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6586,20 +6263,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6612,14 +6283,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6670,27 +6333,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, IERC1271, AccountERC7579, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6751,20 +6400,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6777,14 +6420,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6837,20 +6472,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6863,14 +6492,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6935,6 +6556,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -6976,6 +6598,14 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6985,13 +6615,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7039,6 +6662,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7088,6 +6712,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7137,6 +6762,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7189,6 +6815,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7238,6 +6865,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7292,6 +6920,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7304,13 +6941,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7382,7 +7012,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7460,6 +7092,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7472,13 +7113,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7533,8 +7167,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -7547,6 +7181,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7559,13 +7202,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7669,6 +7305,13 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7678,13 +7321,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7943,6 +7579,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7955,13 +7599,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -8026,6 +7663,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ }␊ ␊ @@ -8097,6 +7735,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8109,13 +7755,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -8164,8 +7803,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -8177,6 +7816,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8189,13 +7836,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -8245,28 +7885,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeighted is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeighted is Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeighted", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8299,18 +7924,12 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC1271 is Account, IERC1271, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8320,15 +7939,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8362,28 +7972,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC7739 is Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeightedERC7739", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8418,28 +8013,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC721Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeightedERC721Holder", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8474,28 +8054,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC1155Holder {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeightedERC1155Holder", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8531,28 +8096,13 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder, ERC1155Holder {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8587,28 +8137,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC7821 {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8653,21 +8188,15 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8680,15 +8209,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8746,29 +8266,14 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, IERC1271, AccountERC7579, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8836,21 +8341,15 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8863,15 +8362,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8931,21 +8421,15 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8958,15 +8442,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9038,6 +8513,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9086,6 +8562,14 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9095,13 +8579,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9158,6 +8635,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9216,6 +8694,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9274,6 +8753,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9333,6 +8813,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9389,6 +8870,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9451,6 +8933,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9463,13 +8954,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9549,7 +9033,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9635,6 +9121,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9647,13 +9142,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9715,8 +9203,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -9730,6 +9218,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9742,13 +9239,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9866,6 +9356,13 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9875,13 +9372,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -10189,6 +9679,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -10201,13 +9699,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -10280,6 +9771,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ }␊ ␊ @@ -10359,6 +9851,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -10371,13 +9871,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -10433,8 +9926,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -10447,6 +9940,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -10459,13 +9960,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index 8539b23ac06b570f8ab57d81626c6000c8ca4d5e..8f9f873c2ea1bf88fb2689393ec8b5675bb1da98 100644 GIT binary patch literal 11692 zcmYkBV{|6UwsvFNwylnB+ji1%$MzfBw(X>2+v(Uw$9g-yy}z^XxnIpOsz#0azh!{j%0_)BnTA_FGSFpZBViyAjuq+=qwm z#@~hwzqh+iPFj{zmyn6M)pl9rH@O@1*{9w8njN&qTAHV@%l^Kq&0MAJ)EU{~Y@~Yo z$nmYRP3N=eG8U_FwW=vJ+n?jx>-k*XUKXy0s4>d*wba_WH>=byZ}M%JL0e&4VaE~V zXH_}2XKCtntpprVw<=WstljojYPQHwdaUPa-#2try!lwy|C+P9vOHWl+>uC2(~6sB zzO7sMzKZ|671p|B!^N!QZEI^)2NeBUp3UcVK6)+|)1R#~VndwDtJZn7d=viS{is&@ zS^rDX?b6+4^P}#fZRKkYw-(6FuKSg`(MqeZ)Dm0vy}fo;vg^CT&CS=$W9<=L`>b{Q z>~5z~*YlA&kTRRlrP#nRYooK&NT=3_?a6(N&9Ic~;@kGi$KyzDo5^l(f&KaOO3ccK zkiD2AM~++J`ZfHs2lL7MubDQJOz)w$kw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join(', ')});`, fn); - break; - } -} - function addMultisigFunctions(c: ContractBuilder, opts: AccountOptions): void { switch (opts.signer) { case 'MultisigWeighted': @@ -296,6 +233,7 @@ function addEIP712(c: ContractBuilder, opts: AccountOptions): void { { name: 'EIP712', path: '@openzeppelin/contracts/utils/cryptography/EIP712.sol', + transpiled: false, // do not use the upgradeable variant for in Accounts }, [opts.name, '1'], ); @@ -309,21 +247,22 @@ function overrideRawSignatureValidation(c: ContractBuilder, opts: AccountOptions // to provide a custom validation logic if (!opts.signer && !opts.ERC7579Modules) { // Custom validation logic - c.addOverride({ name: 'Account' }, signerFunctions._rawSignatureValidation); + c.addOverride({ name: 'Account', transpiled: false }, signerFunctions._rawSignatureValidation); c.setFunctionBody(['// Custom validation logic', 'return false;'], signerFunctions._rawSignatureValidation); } // Disambiguate between Signer and AccountERC7579 if (opts.signer && opts.ERC7579Modules) { - const accountName = makeUpgradeable('AccountERC7579', opts.upgradeable); - const signerName = makeUpgradeable(`Signer${opts.signer}`, opts.upgradeable); + const accountName = opts.upgradeable ? upgradeableName('AccountERC7579') : 'AccountERC7579'; + const signerName = opts.upgradeable ? upgradeableName(`Signer${opts.signer}`) : `Signer${opts.signer}`; c.addImportOnly({ name: 'AbstractSigner', path: '@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol', + transpiled: false, }); - c.addOverride({ name: 'AbstractSigner' }, signerFunctions._rawSignatureValidation); - c.addOverride({ name: accountName }, signerFunctions._rawSignatureValidation); + c.addOverride({ name: 'AbstractSigner', transpiled: false }, signerFunctions._rawSignatureValidation); + c.addOverride({ name: 'AccountERC7579' }, signerFunctions._rawSignatureValidation); c.setFunctionComments( [ `// IMPORTANT: Make sure ${signerName} is most derived than ${accountName}`, @@ -337,8 +276,8 @@ function overrideRawSignatureValidation(c: ContractBuilder, opts: AccountOptions // Base override for `_rawSignatureValidation` given MultiSignerERC7913Weighted is MultiSignerERC7913 if (opts.signer === 'MultisigWeighted') { c.addImportOnly({ - name: makeUpgradeable(signers.Multisig.name, opts.upgradeable), - path: makeUpgradeable(signers.Multisig.path, opts.upgradeable), + name: signers.Multisig.name, + path: signers.Multisig.path, }); } } diff --git a/packages/core/solidity/src/contract.ts b/packages/core/solidity/src/contract.ts index d3a89333c..6ed276124 100644 --- a/packages/core/solidity/src/contract.ts +++ b/packages/core/solidity/src/contract.ts @@ -9,11 +9,8 @@ export interface Contract { functions: ContractFunction[]; constructorCode: string[]; constructorArgs: FunctionArgument[]; - constructorComments: string[]; variables: string[]; - shouldAutoTranspileImports: boolean; - shouldInstallContractsUpgradeable: boolean; - shouldUseUpgradesPluginsForProxyDeployment: boolean; + upgradeable: boolean; } export type Value = string | number | { lit: string } | { note: string; value: Value }; @@ -78,17 +75,13 @@ export interface NatspecTag { export class ContractBuilder implements Contract { readonly name: string; license: string = 'MIT'; - - shouldAutoTranspileImports: boolean = false; - shouldInstallContractsUpgradeable: boolean = false; - shouldUseUpgradesPluginsForProxyDeployment: boolean = false; + upgradeable = false; readonly using: Using[] = []; readonly natspecTags: NatspecTag[] = []; readonly constructorArgs: FunctionArgument[] = []; readonly constructorCode: string[] = []; - readonly constructorComments: string[] = []; readonly variableSet: Set = new Set(); private parentMap: Map = new Map(); @@ -187,15 +180,6 @@ export class ContractBuilder implements Contract { this.constructorCode.push(code); } - addConstructorComment(comment: string) { - if (this.shouldAutoTranspileImports) { - throw new Error( - 'Constructor comments are not supported when `shouldAutoTranspileImports` is true, since constructor will be transformed into an initializer', - ); - } - this.constructorComments.push(comment); - } - addFunctionCode(code: string, baseFn: BaseFunction, mutability?: FunctionMutability) { const fn = this.addFunction(baseFn); if (fn.final) { diff --git a/packages/core/solidity/src/helpers.ts b/packages/core/solidity/src/helpers.ts deleted file mode 100644 index fe1d92bfe..000000000 --- a/packages/core/solidity/src/helpers.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Use posix to ensure forward slashes on all platforms -import { posix as path } from 'path'; -import type { CommonOptions } from './common-options'; - -// If upgradeable is true-ish, translate a contract name or contract path into its corresponding upgradeable variant. -// Otherwise, return the input unmodified. -// -// Example: -// - makeUpgradeable('AccountERC7579', false) == 'AccountERC7579' -// - makeUpgradeable('AccountERC7579', 'uups') == 'AccountERC7579Upgradeable' -// - makeUpgradeable('@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol', false) == '@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol' -// - makeUpgradeable('@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol', 'uups') == '@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol' -export function makeUpgradeable(input: string, upgradeable: CommonOptions['upgradeable'] = false): string { - switch (upgradeable) { - case false: - return input; - case 'uups': - case 'transparent': { - const { dir, name, ext } = path.parse(input); - return path.format({ - dir: dir.replace('/contracts/', '/contracts-upgradeable/'), - name: name + 'Upgradeable', - ext, - }); - } - default: { - const _: never = upgradeable; - throw new Error('Unknown upgradeable option'); - } - } -} diff --git a/packages/core/solidity/src/options.ts b/packages/core/solidity/src/options.ts index d2fbeba18..311a0de96 100644 --- a/packages/core/solidity/src/options.ts +++ b/packages/core/solidity/src/options.ts @@ -3,7 +3,7 @@ import path from 'path'; import type { Contract, ReferencedContract, ImportContract } from './contract'; import { inferTranspiled } from './infer-transpiled'; -const upgradeableName = (n: string) => { +export function upgradeableName(n: string) { if (n === 'Initializable') { return n; } else { @@ -11,7 +11,7 @@ const upgradeableName = (n: string) => { } }; -const upgradeableImport = (p: ImportContract): ImportContract => { +export function upgradeableImport(p: ImportContract): ImportContract { const { dir, ext, name } = path.parse(p.path); // Use path.posix to get forward slashes return { @@ -30,19 +30,19 @@ export interface Options { } export interface Helpers extends Required { - shouldUseInitializers: boolean; + upgradeable: boolean; transformName: (name: ReferencedContract) => string; + transformImport: (name: ImportContract) => ImportContract; } export function withHelpers(contract: Contract, opts: Options = {}): Helpers { - const shouldAutoTranspileImports = contract.shouldAutoTranspileImports; - const transformName = (n: ReferencedContract) => - shouldAutoTranspileImports && inferTranspiled(n) ? upgradeableName(n.name) : n.name; + const contractUpgradeable = contract.upgradeable; return { - shouldUseInitializers: shouldAutoTranspileImports, - transformName, - transformImport: p1 => { - const p2 = shouldAutoTranspileImports && inferTranspiled(p1) ? upgradeableImport(p1) : p1; + upgradeable: contractUpgradeable, + transformName: (n: ReferencedContract) => + contractUpgradeable && inferTranspiled(n) ? upgradeableName(n.name) : n.name, + transformImport: (p1: ImportContract) => { + const p2 = contractUpgradeable && inferTranspiled(p1) ? upgradeableImport(p1) : p1; return opts.transformImport?.(p2) ?? p2; }, }; diff --git a/packages/core/solidity/src/print.ts b/packages/core/solidity/src/print.ts index fbf484151..0fa7d56b5 100644 --- a/packages/core/solidity/src/print.ts +++ b/packages/core/solidity/src/print.ts @@ -81,24 +81,48 @@ function printConstructor(contract: Contract, helpers: Helpers): Lines[] { const hasParentParams = contract.parents.some(p => p.params.length > 0); const hasConstructorCode = contract.constructorCode.length > 0; const parentsWithInitializers = contract.parents.filter(hasInitializer); - if (hasParentParams || hasConstructorCode || (helpers.shouldUseInitializers && parentsWithInitializers.length > 0)) { - const parents = parentsWithInitializers.flatMap(p => printParentConstructor(p, helpers)); - const modifiers = helpers.shouldUseInitializers ? ['public initializer'] : parents; - const args = contract.constructorArgs.map(a => printArgument(a, helpers)); - const body = helpers.shouldUseInitializers - ? spaceBetween( - parents.map(p => p + ';'), - contract.constructorCode, - ) - : contract.constructorCode; - const head = helpers.shouldUseInitializers ? 'function initialize' : 'constructor'; - const ctor = printFunction2(contract.constructorComments, head, args, modifiers, body); - if (!helpers.shouldUseInitializers) { - return ctor; + if (hasParentParams || hasConstructorCode || (helpers.upgradeable && parentsWithInitializers.length > 0)) { + if (helpers.upgradeable) { + const upgradeableParents = parentsWithInitializers.filter(p => inferTranspiled(p.contract)); + const nonUpgradeableParents = parentsWithInitializers.filter(p => !inferTranspiled(p.contract)); + + return spaceBetween( + // constructor + printFunction2( + [ + nonUpgradeableParents.length > 0 + ? '/// @custom:oz-upgrades-unsafe-allow-reachable constructor' + : '/// @custom:oz-upgrades-unsafe-allow constructor', + ], + 'constructor', + [], + nonUpgradeableParents.flatMap(p => printParentConstructor(p, helpers)), + ['_disableInitializers();'] + ), + // initializer + upgradeableParents.length > 0 + ? printFunction2( + [], + 'function initialize', + contract.constructorArgs.map(a => printArgument(a, helpers)), + [ 'public', 'initializer' ], + spaceBetween( + upgradeableParents.flatMap(p => printParentConstructor(p, helpers)).map(p => p + ';'), + contract.constructorCode, + ) + ) + : [], + ); } else { - return spaceBetween(DISABLE_INITIALIZERS, ctor); + return printFunction2( + [], + 'constructor', + contract.constructorArgs.map(a => printArgument(a, helpers)), + parentsWithInitializers.flatMap(p => printParentConstructor(p, helpers)), + contract.constructorCode + ); } - } else if (!helpers.shouldUseInitializers) { + } else if (!helpers.upgradeable) { return []; } else { return DISABLE_INITIALIZERS; @@ -139,7 +163,7 @@ function sortedFunctions(contract: Contract): SortedFunctions { } function printParentConstructor({ contract, params }: Parent, helpers: Helpers): [] | [string] { - const useTranspiled = helpers.shouldUseInitializers && inferTranspiled(contract); + const useTranspiled = helpers.upgradeable && inferTranspiled(contract); const fn = useTranspiled ? `__${contract.name}_init` : contract.name; if (useTranspiled || params.length > 0) { return [fn + '(' + params.map(printValue).join(', ') + ')']; diff --git a/packages/core/solidity/src/set-upgradeable.ts b/packages/core/solidity/src/set-upgradeable.ts index 361184145..26a2edef8 100644 --- a/packages/core/solidity/src/set-upgradeable.ts +++ b/packages/core/solidity/src/set-upgradeable.ts @@ -11,19 +11,16 @@ function setUpgradeableBase( c: ContractBuilder, upgradeable: Upgradeable, restrictAuthorizeUpgradeWhenUUPS: () => void, - onlyUseUpgradeableInitializableAndUUPS: boolean = false, ) { if (upgradeable === false) { return; } - c.shouldAutoTranspileImports = !onlyUseUpgradeableInitializableAndUUPS; - c.shouldInstallContractsUpgradeable = true; - c.shouldUseUpgradesPluginsForProxyDeployment = true; + c.upgradeable = true; c.addParent({ name: 'Initializable', - path: `@openzeppelin/${onlyUseUpgradeableInitializableAndUUPS ? 'contracts-upgradeable' : 'contracts'}/proxy/utils/Initializable.sol`, + path: '@openzeppelin/contracts/proxy/utils/Initializable.sol', }); switch (upgradeable) { @@ -34,7 +31,7 @@ function setUpgradeableBase( restrictAuthorizeUpgradeWhenUUPS(); const UUPSUpgradeable = { name: 'UUPSUpgradeable', - path: `@openzeppelin/${onlyUseUpgradeableInitializableAndUUPS ? 'contracts-upgradeable' : 'contracts'}/proxy/utils/UUPSUpgradeable.sol`, + path: '@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol', }; c.addParent(UUPSUpgradeable); c.addOverride(UUPSUpgradeable, functions._authorizeUpgrade); @@ -62,19 +59,9 @@ export function setUpgradeableGovernor(c: ContractBuilder, upgradeable: Upgradea } export function setUpgradeableAccount(c: ContractBuilder, upgradeable: Upgradeable) { - if (upgradeable === false) { - return; - } - setUpgradeableBase( - c, - upgradeable, - () => { + setUpgradeableBase(c, upgradeable, () => { c.addModifier('onlyEntryPointOrSelf', functions._authorizeUpgrade); - }, - true, // account.ts handles usage of transpiled imports (when needed) rather than using helpers. - ); - c.shouldInstallContractsUpgradeable = true; - c.shouldUseUpgradesPluginsForProxyDeployment = false; // this will eventually use a factory to deploy proxies + }); } const functions = defineFunctions({ diff --git a/packages/core/solidity/src/signer.ts b/packages/core/solidity/src/signer.ts index 42e209a35..a9a156930 100644 --- a/packages/core/solidity/src/signer.ts +++ b/packages/core/solidity/src/signer.ts @@ -1,7 +1,6 @@ import type { ContractBuilder } from './contract'; import { OptionsError } from './error'; import type { Upgradeable } from './set-upgradeable'; -import { makeUpgradeable } from './helpers'; import { defineFunctions } from './utils/define-functions'; export const SignerOptions = [false, 'ERC7702', 'ECDSA', 'P256', 'RSA', 'Multisig', 'MultisigWeighted'] as const; @@ -11,7 +10,7 @@ export function addSigner(c: ContractBuilder, signer: SignerOptions, upgradeable if (!signer) return; const signerName = signer === 'MultisigWeighted' ? signers.Multisig.name : signers[signer].name; - c.addOverride({ name: makeUpgradeable(signerName, upgradeable) }, signerFunctions._rawSignatureValidation); + c.addOverride({ name: signerName }, signerFunctions._rawSignatureValidation); switch (signer) { case 'ERC7702': @@ -28,52 +27,16 @@ export function addSigner(c: ContractBuilder, signer: SignerOptions, upgradeable case 'RSA': case 'Multisig': case 'MultisigWeighted': { - if (upgradeable) { - c.addParent({ - name: 'Initializable', - path: '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol', - }); - addLockingConstructorAllowReachable(c); - - const fn = { name: 'initialize', kind: 'public' as const, args: signerArgs[signer] }; - c.addModifier('initializer', fn); - c.addFunctionCode(`__${signers[signer].name}_init(${signerArgs[signer].map(arg => arg.name).join(', ')});`, fn); - c.addParent({ - name: `${signers[signer].name}Upgradeable`, - path: makeUpgradeable(signers[signer].path, upgradeable), - }); - } else { - signerArgs[signer].forEach(arg => c.addConstructorArgument(arg)); - c.addParent( - signers[signer], - signerArgs[signer].map(arg => ({ lit: arg.name })), - ); - } - + signerArgs[signer].forEach(arg => c.addConstructorArgument(arg)); + c.addParent( + signers[signer], + signerArgs[signer].map(arg => ({ lit: arg.name })), + ); break; } } } -/** - * Adds a locking constructor that disables initializers and annotates it to allow reachable constructors during Upgrades Plugins validations, - * which includes constructors in parent contracts. - * - * IMPORTANT: If a locking constructor is already present, it will not be added again, even if the body comments are different. - * - * @param c The contract builder. - * @param bodyComments Optional comments to add to the constructor body, before disabling initializers. - */ -export function addLockingConstructorAllowReachable(c: ContractBuilder, bodyComments?: string[]): void { - const disableInitializers = '_disableInitializers();'; - - if (!c.constructorCode.includes(disableInitializers)) { - c.addConstructorComment('/// @custom:oz-upgrades-unsafe-allow-reachable constructor'); - bodyComments?.forEach(comment => c.addConstructorCode(comment)); - c.addConstructorCode(disableInitializers); - } -} - export const signers = { ERC7702: { name: 'SignerERC7702', diff --git a/packages/core/solidity/src/zip-foundry.test.ts b/packages/core/solidity/src/zip-foundry.test.ts index 527147d2f..cc28602ce 100644 --- a/packages/core/solidity/src/zip-foundry.test.ts +++ b/packages/core/solidity/src/zip-foundry.test.ts @@ -187,9 +187,8 @@ async function extractAndRunPackage(zip: JSZip, c: Contract, t: ExecutionContext const setGitUser = 'git init && git config user.email "test@test.test" && git config user.name "Test"'; const setup = 'bash setup.sh'; - const test = 'forge test' + (c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''); - const script = - `forge script script/${c.name}.s.sol` + (c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''); + const test = 'forge test' + (c.upgradeable ? ' --force' : ''); + const script = `forge script script/${c.name}.s.sol` + (c.upgradeable ? ' --force' : ''); const exec = (cmd: string) => util.promisify(child.exec)(cmd, { env: { ...process.env, NO_COLOR: '' } }); diff --git a/packages/core/solidity/src/zip-foundry.test.ts.md b/packages/core/solidity/src/zip-foundry.test.ts.md index dcccd0261..fedff385e 100644 --- a/packages/core/solidity/src/zip-foundry.test.ts.md +++ b/packages/core/solidity/src/zip-foundry.test.ts.md @@ -38,7 +38,6 @@ Generated by [AVA](https://avajs.dev). ␊ # Install OpenZeppelin Contracts␊ forge install OpenZeppelin/openzeppelin-contracts@vX.Y.Z --quiet␊ - ␊ ␊ # Remove unneeded Foundry template files␊ rm src/Counter.sol␊ @@ -55,7 +54,6 @@ Generated by [AVA](https://avajs.dev). echo "" >> remappings.txt␊ fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - ␊ ␊ # Perform initial git commit␊ git add .␊ @@ -235,9 +233,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -256,6 +253,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -324,7 +322,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (tokenBridge_, recipient, initialOwner))␊ );␊ - MyToken instance = MyToken(proxy);␊ + MyToken instance = MyToken(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -435,7 +433,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (tokenBridge_, recipient, initialOwner))␊ );␊ - instance = MyToken(proxy);␊ + instance = MyToken(payable(proxy));␊ }␊ ␊ function testName() public view {␊ @@ -477,9 +475,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -498,6 +495,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -565,7 +563,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (defaultAdmin, upgrader))␊ );␊ - MyToken instance = MyToken(proxy);␊ + MyToken instance = MyToken(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -626,7 +624,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (defaultAdmin, upgrader))␊ );␊ - instance = MyToken(proxy);␊ + instance = MyToken(payable(proxy));␊ }␊ ␊ function testName() public view {␊ @@ -668,9 +666,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -689,6 +686,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -755,7 +753,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - MyToken instance = MyToken(proxy);␊ + MyToken instance = MyToken(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -806,7 +804,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - instance = MyToken(proxy);␊ + instance = MyToken(payable(proxy));␊ }␊ ␊ function testName() public view {␊ @@ -850,7 +848,6 @@ Generated by [AVA](https://avajs.dev). ␊ # Install OpenZeppelin Contracts␊ forge install OpenZeppelin/openzeppelin-contracts@vX.Y.Z --quiet␊ - ␊ ␊ # Remove unneeded Foundry template files␊ rm src/Counter.sol␊ @@ -867,7 +864,6 @@ Generated by [AVA](https://avajs.dev). echo "" >> remappings.txt␊ fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - ␊ ␊ # Perform initial git commit␊ git add .␊ @@ -1001,9 +997,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -1022,6 +1017,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -1089,7 +1085,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - MyToken instance = MyToken(proxy);␊ + MyToken instance = MyToken(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -1137,7 +1133,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - instance = MyToken(proxy);␊ + instance = MyToken(payable(proxy));␊ }␊ ␊ function testUri() public view {␊ @@ -1181,7 +1177,6 @@ Generated by [AVA](https://avajs.dev). ␊ # Install OpenZeppelin Contracts␊ forge install OpenZeppelin/openzeppelin-contracts@vX.Y.Z --quiet␊ - ␊ ␊ # Remove unneeded Foundry template files␊ rm src/Counter.sol␊ @@ -1198,7 +1193,6 @@ Generated by [AVA](https://avajs.dev). echo "" >> remappings.txt␊ fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - ␊ ␊ # Perform initial git commit␊ git add .␊ @@ -1270,20 +1264,10 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("My Account", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ + constructor(address signer) EIP712("My Account", "1") SignerECDSA(signer) {}␊ }␊ `, `// SPDX-License-Identifier: MIT␊ @@ -1307,167 +1291,6 @@ Generated by [AVA](https://avajs.dev). `, ] -## account ecdsa uups - -> Snapshot 1 - - [ - `#!/usr/bin/env bash␊ - ␊ - # Check if git is installed␊ - if ! which git &> /dev/null␊ - then␊ - echo "git command not found. Install git and try again."␊ - exit 1␊ - fi␊ - ␊ - # Check if Foundry is installed␊ - if ! which forge &> /dev/null␊ - then␊ - echo "forge command not found. Install Foundry and try again. See https://book.getfoundry.sh/getting-started/installation"␊ - exit 1␊ - fi␊ - ␊ - # Setup Foundry project␊ - if ! [ -f "foundry.toml" ]␊ - then␊ - echo "Initializing Foundry project..."␊ - ␊ - # Backup Wizard template readme to avoid it being overwritten␊ - mv README.md README-oz.md␊ - ␊ - # Initialize sample Foundry project␊ - forge init --force --quiet␊ - ␊ - # Install OpenZeppelin Contracts␊ - forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - ␊ - ␊ - # Remove unneeded Foundry template files␊ - rm src/Counter.sol␊ - rm script/Counter.s.sol␊ - rm test/Counter.t.sol␊ - rm README.md␊ - ␊ - # Restore Wizard template readme␊ - mv README-oz.md README.md␊ - ␊ - # Add remappings␊ - if [ -f "remappings.txt" ]␊ - then␊ - echo "" >> remappings.txt␊ - fi␊ - echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ - ␊ - ␊ - # Perform initial git commit␊ - git add .␊ - git commit -m "openzeppelin: add wizard output" --quiet␊ - ␊ - echo "Done."␊ - else␊ - echo "Foundry project already initialized."␊ - fi␊ - `, - `# Sample Foundry Project␊ - ␊ - This project demonstrates a basic Foundry use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, and a script that deploys that contract.␊ - ␊ - ## Installing Foundry␊ - ␊ - See [Foundry installation guide](https://book.getfoundry.sh/getting-started/installation).␊ - ␊ - ## Initializing the project␊ - ␊ - \`\`\`␊ - bash setup.sh␊ - \`\`\`␊ - ␊ - ## Testing the contract␊ - ␊ - \`\`\`␊ - forge test␊ - \`\`\`␊ - ␊ - ## Deploying the contract␊ - ␊ - You can simulate a deployment by running the script:␊ - ␊ - \`\`\`␊ - forge script script/MyAccount.s.sol␊ - \`\`\`␊ - ␊ - See [Solidity scripting guide](https://book.getfoundry.sh/guides/scripting-with-solidity) for more information.␊ - `, - `// SPDX-License-Identifier: MIT␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Script} from "forge-std/Script.sol";␊ - import {console} from "forge-std/console.sol";␊ - import {MyAccount} from "src/MyAccount.sol";␊ - ␊ - contract MyAccountScript is Script {␊ - function setUp() public {}␊ - ␊ - function run() public {␊ - vm.startBroadcast();␊ - MyAccount instance = new MyAccount();␊ - console.log("Contract deployed to %s", address(instance));␊ - vm.stopBroadcast();␊ - }␊ - }␊ - `, - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("My Account", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ - }␊ - `, - `// SPDX-License-Identifier: MIT␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Test} from "forge-std/Test.sol";␊ - import {MyAccount} from "src/MyAccount.sol";␊ - ␊ - contract MyAccountTest is Test {␊ - MyAccount public instance;␊ - ␊ - function setUp() public {␊ - instance = new MyAccount();␊ - }␊ - ␊ - function testSomething() public {␊ - // Add your test here␊ - }␊ - }␊ - `, - ] - ## custom basic > Snapshot 1 @@ -1502,7 +1325,6 @@ Generated by [AVA](https://avajs.dev). ␊ # Install OpenZeppelin Contracts␊ forge install OpenZeppelin/openzeppelin-contracts@vX.Y.Z --quiet␊ - ␊ ␊ # Remove unneeded Foundry template files␊ rm src/Counter.sol␊ @@ -1519,7 +1341,6 @@ Generated by [AVA](https://avajs.dev). echo "" >> remappings.txt␊ fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - ␊ ␊ # Perform initial git commit␊ git add .␊ @@ -1637,9 +1458,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -1658,6 +1478,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -1726,7 +1547,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyContract.initialize, (initialAuthority))␊ );␊ - MyContract instance = MyContract(proxy);␊ + MyContract instance = MyContract(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -1769,7 +1590,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyContract.initialize, (initialAuthority))␊ );␊ - instance = MyContract(proxy);␊ + instance = MyContract(payable(proxy));␊ }␊ ␊ function testSomething() public {␊ diff --git a/packages/core/solidity/src/zip-foundry.test.ts.snap b/packages/core/solidity/src/zip-foundry.test.ts.snap index 065cc82899c83421ac58813bcf2991b2970fd695..fccd0bc032affd10bb7c392427d6442947479873 100644 GIT binary patch literal 4256 zcmV;R5MS>>RzV_&L?9PyMWX6)|m?G(f zIng3S^3H!lH)ncxJDQnZclVH5>4ZZPj`49o}7(X6x zIP`S)?ELB3UH(~eDUBY)-RbJ;>YD1Bu3uHp{;IR@6Zby*>8}yT+($n^)Lonhoyhkw z3t^x22xmY1mFGbYKls`&p0U1UiGOof=AL`YvaH*dWqs$eWxa64vfg;XvIehM)+=+* zy*zh$g;F?}o710Odg&!=u4c_$w&q^6UYWaOeRb{`Ywq&Pm%e!R+G|e4sI!kl2ZaY< zAF^Jpb`7ldkb58C4(MVIFatPb9Qr=;YPbVl1BX5A_TsjGej7L*I&i|s_iMa|!Wsa` z?GaEHtu6@y7W9w(GST0N226=-!X| z;NS5>NIk$&(DxxnfFkGx2yg=60l^-?9PA^(h#Vk#NHOQ}NWlTPx4yErxo!uZ`qU;5 z?ZA`F6A=(#FzEZJFd3k31P(C=?RJMy7lC&Bvj`)uc}RWV?W6ER)bAr7hhUY2oI;ng z6oVp}L;5IusJ^sa-RGTy_w5ht53|GELjgHJAPPf-Jme*UCK~BrABo{;02pbVeZ!cW~+gX#|QYKy7>0y?z^iV)T#wp~80Vtd$c9Sj<_?4nMEKC<&%bXH&O$3S~a#y0;kymFg8N5Q~>Wm zp0IDl?h7j8m2DpC`((hfgm$fVEm?~xhf=Evhxbw9ZBy@j8S` zGXV;@xEVAGL)}g4?`C=srBdYO2CpLUZ+wea=<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Wm*66E0*=g zwQ5^S1;t!1D5ip6s%u@aI1$RBoz`5z9KV=*m_w^A8`BMySqSQM(ZwMh z320G>{dCF2V;z5DT_DzB&^~x+S`K`AvCDx|+m2yHkaX+}mIPU|INLSB^KYm{LFV3x z0EV!Oyy6<+*Z!~U-ihC;S=KLZTh?}U??kmmxMpjF>fVVfzBak6sp0D0iA%9M{FiEV zc)3@HGrM;pyGoq1t0(^EdR#p*FH6qZpQf1R4hluLCeu)SkgGp@ex~WrLwKyJoV(Hv|0((m?HmAD}Latb;Q^xY5()UJi! { function getImports(c: Contract) { const result = ['import {Test} from "forge-std/Test.sol";']; - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { result.push('import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";'); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); @@ -37,20 +37,20 @@ const test = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { if (opts?.upgradeable === 'transparent') { return [ `address proxy = Upgrades.deployTransparentProxy(`, [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], ');', - `instance = ${c.name}(proxy);`, + `instance = ${c.name}(payable(proxy));`, ]; } else { return [ `address proxy = Upgrades.deployUUPSProxy(`, [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], ');', - `instance = ${c.name}(proxy);`, + `instance = ${c.name}(payable(proxy));`, ]; } } else { @@ -61,11 +61,7 @@ const test = (c: Contract, opts?: GenericOptions) => { function getAddressVariables(c: Contract, args: string[]): Lines[] { const vars = []; let i = 1; // private key index starts from 1 since it must be non-zero - if ( - c.shouldUseUpgradesPluginsForProxyDeployment && - opts?.upgradeable === 'transparent' && - !args.includes('initialOwner') - ) { + if (c.upgradeable && opts?.upgradeable === 'transparent' && !args.includes('initialOwner')) { vars.push(`address initialOwner = vm.addr(${i++});`); } for (const arg of args) { @@ -112,7 +108,7 @@ const script = (c: Contract, opts?: GenericOptions) => { function getImports(c: Contract) { const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { result.push('import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";'); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); @@ -125,7 +121,7 @@ const script = (c: Contract, opts?: GenericOptions) => { 'vm.startBroadcast();', ...getAddressVariables(c, args), ...getDeploymentCode(c, args), - `console.log("${c.shouldUseUpgradesPluginsForProxyDeployment ? 'Proxy' : 'Contract'} deployed to %s", address(instance));`, + `console.log("${c.upgradeable ? 'Proxy' : 'Contract'} deployed to %s", address(instance));`, 'vm.stopBroadcast();', ]; return [ @@ -139,20 +135,20 @@ const script = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { if (opts?.upgradeable === 'transparent') { return [ `address proxy = Upgrades.deployTransparentProxy(`, [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], ');', - `${c.name} instance = ${c.name}(proxy);`, + `${c.name} instance = ${c.name}(payable(proxy));`, ]; } else { return [ `address proxy = Upgrades.deployUUPSProxy(`, [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], ');', - `${c.name} instance = ${c.name}(proxy);`, + `${c.name} instance = ${c.name}(payable(proxy));`, ]; } } else { @@ -162,11 +158,7 @@ const script = (c: Contract, opts?: GenericOptions) => { function getAddressVariables(c: Contract, args: string[]): Lines[] { const vars = []; - if ( - c.shouldUseUpgradesPluginsForProxyDeployment && - opts?.upgradeable === 'transparent' && - !args.includes('initialOwner') - ) { + if (c.upgradeable && opts?.upgradeable === 'transparent' && !args.includes('initialOwner')) { vars.push('address initialOwner = ;'); } for (const arg of args) { @@ -214,23 +206,16 @@ then forge init --force --quiet ${ - c.shouldInstallContractsUpgradeable + c.upgradeable ? `\ - # Install OpenZeppelin Contracts - forge install OpenZeppelin/openzeppelin-contracts-upgradeable@v${contracts.version} --quiet\ + # Install OpenZeppelin Contracts and Upgrades + forge install OpenZeppelin/openzeppelin-contracts-upgradeable@v${contracts.version} --quiet + forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet\ ` : `\ # Install OpenZeppelin Contracts forge install OpenZeppelin/openzeppelin-contracts@v${contracts.version} --quiet\ ` -} -${ - c.shouldUseUpgradesPluginsForProxyDeployment - ? `\ - # Install OpenZeppelin Foundry Upgrades - forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet\ -` - : '' } # Remove unneeded Foundry template files @@ -248,18 +233,11 @@ ${ echo "" >> remappings.txt fi ${ - c.shouldInstallContractsUpgradeable + c.upgradeable ? `\ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt - echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt\ -` - : `\ - echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt\ -` -} -${ - c.shouldUseUpgradesPluginsForProxyDeployment - ? `\ + echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt + # Add settings in foundry.toml echo "" >> foundry.toml echo "ffi = true" >> foundry.toml @@ -267,7 +245,9 @@ ${ echo "build_info = true" >> foundry.toml echo "extra_output = [\\"storageLayout\\"]" >> foundry.toml\ ` - : '' + : `\ + echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt\ +` } # Perform initial git commit @@ -298,7 +278,7 @@ bash setup.sh ## Testing the contract \`\`\` -forge test${c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''} +forge test${c.upgradeable ? ' --force' : ''} \`\`\` ## Deploying the contract @@ -306,7 +286,7 @@ forge test${c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''} You can simulate a deployment by running the script: \`\`\` -forge script script/${c.name}.s.sol${c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''} +forge script script/${c.name}.s.sol${c.upgradeable ? ' --force' : ''} \`\`\` See [Solidity scripting guide](https://book.getfoundry.sh/guides/scripting-with-solidity) for more information. diff --git a/packages/core/solidity/src/zip-hardhat.test.ts.md b/packages/core/solidity/src/zip-hardhat.test.ts.md index c0068444e..3c1f723d0 100644 --- a/packages/core/solidity/src/zip-hardhat.test.ts.md +++ b/packages/core/solidity/src/zip-hardhat.test.ts.md @@ -499,20 +499,10 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("My Account", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ + constructor(address signer) EIP712("My Account", "1") SignerECDSA(signer) {}␊ }␊ `, `import { HardhatUserConfig } from "hardhat/config";␊ @@ -574,100 +564,6 @@ Generated by [AVA](https://avajs.dev). `, ] -## account ecdsa uups - -> Snapshot 1 - - [ - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("My Account", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ - }␊ - `, - `import { HardhatUserConfig } from "hardhat/config";␊ - import "@nomicfoundation/hardhat-toolbox";␊ - ␊ - ␊ - const config: HardhatUserConfig = {␊ - solidity: {␊ - version: "0.8.27",␊ - settings: {␊ - optimizer: {␊ - enabled: true,␊ - },␊ - },␊ - },␊ - };␊ - ␊ - export default config;␊ - `, - `{␊ - "name": "hardhat-sample",␊ - "version": "0.0.1",␊ - "description": "",␊ - "main": "index.js",␊ - "scripts": {␊ - "test": "hardhat test"␊ - },␊ - "author": "",␊ - "license": "MIT",␊ - "devDependencies": {␊ - "@openzeppelin/contracts": "^5.4.0",␊ - "@openzeppelin/contracts-upgradeable": "^5.4.0",␊ - "@openzeppelin/hardhat-upgrades": "^3.0.0",␊ - "@nomicfoundation/hardhat-toolbox": "^6.1.0",␊ - "hardhat": "^2.16.1"␊ - }␊ - }`, - `import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";␊ - ␊ - export default buildModule("MyAccountModule", (m) => {␊ - ␊ - ␊ - const myAccount = m.contract("MyAccount", []);␊ - ␊ - return { myAccount };␊ - });␊ - `, - `import { expect } from "chai";␊ - import { ethers } from "hardhat";␊ - ␊ - describe("MyAccount", function () {␊ - it("Test contract", async function () {␊ - const ContractFactory = await ethers.getContractFactory("MyAccount");␊ - ␊ - const instance = await ContractFactory.deploy();␊ - await instance.waitForDeployment();␊ - });␊ - });␊ - `, - ] - ## custom basic > Snapshot 1 diff --git a/packages/core/solidity/src/zip-hardhat.test.ts.snap b/packages/core/solidity/src/zip-hardhat.test.ts.snap index ed7a6bb80d37ea6aedce470a85865cd2d71a1813..481b2bf3bc12d4ba31c20532af0dc09030a9da24 100644 GIT binary patch literal 3079 zcmV+i4EXawRzVl~u@CMJ zCDPQxfhoWix%zUuDz#C^hk`v=4^_t9sFx}6s6#=ehP=tQhfIQ#Wi zp677qm#=?22d)9}Q@LJw>3sme9RR==*8%v`%K(5^0C@jZ0N$#+^k!v#l~QL=sU)9n z+_(WMRZy7+l~=)Al`G)w${eW7zj>u~z1f6Y57vLN@DX-V$k4)uheD3K7||uTxv^bs zHsKlxB8THWAHf66`|y5*!e5~%LOu@R8VNadT+ZMpx9lI;t!hM_Uf@7ReC%O9fS12q#BO$A6z}=ig)RvhcR~&ytnO^xeYpGZ z{zrG=3VecG*Ll*pb=#`tZq(|_Ct_@Fe7tSM$lVYa5=6G5vC9dy9M7YOF-Vb%BaA}c zfXO8fb)DGft6qS^>}ur14AJa+fJ2UGT>^_AIdrSGIe;>>wFazhZvV7aFi=6unW_6n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a~PT!=uWYM%H^rQ=I1|5(1h(R}$V3Kzbrm%%6<4_*HCqX4Wfylt9MJTGI zX-+ktrc&LwOyUf$7?+W=B3~m945wXLR4pQpO=0g8_Fh5Q`|5?kUY#V)3HV02HxGT2 zRQ6bH#D3Tt4IKo0KRILIo0xP-&^Iz53x1V*&KLG(a^Wa|xBne;2Cd5P7a1VyUrmtp zcQXL|{U!jvm<8Zy?03u`&P*Ze6tbQHWIfdz`V<74=*uT3q1r3(_I^SXoj;*F2vAS* zo_|DyJq%Ny*;##4#t=*8^JrzYI{B>>>R1pv0L1F&>sT-^IpaDlit z1p}f{@Mu~Zrj*H5qD;QLu&f>Jfs@j9yjSvhdnL((hQu8Y87g=1p# diff --git a/packages/core/solidity/src/zip-hardhat.ts b/packages/core/solidity/src/zip-hardhat.ts index 2531d4c57..23ed27a0c 100644 --- a/packages/core/solidity/src/zip-hardhat.ts +++ b/packages/core/solidity/src/zip-hardhat.ts @@ -6,10 +6,10 @@ import SOLIDITY_VERSION from './solidity-version.json'; import type { Lines } from './utils/format-lines'; import { formatLinesWithSpaces, spaceBetween } from './utils/format-lines'; -const hardhatConfig = (useHardhatUpgrades: boolean) => `\ +const hardhatConfig = (upgradeable: boolean) => `\ import { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox"; -${useHardhatUpgrades ? `import "@openzeppelin/hardhat-upgrades";` : ''} +${upgradeable ? `import "@openzeppelin/hardhat-upgrades";` : ''} const config: HardhatUserConfig = { solidity: { @@ -119,7 +119,7 @@ function getAddressArgs(c: Contract): string[] { } function getDeploymentCall(c: Contract, args: string[]): string { - return c.shouldUseUpgradesPluginsForProxyDeployment + return c.upgradeable ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` : `ContractFactory.deploy(${args.join(', ')})`; } @@ -136,7 +136,7 @@ async function main() { const instance = await ${getDeploymentCall(c, args)}; await instance.waitForDeployment(); - console.log(\`${c.shouldUseUpgradesPluginsForProxyDeployment ? 'Proxy' : 'Contract'} deployed to \${await instance.getAddress()}\`); + console.log(\`${c.upgradeable ? 'Proxy' : 'Contract'} deployed to \${await instance.getAddress()}\`); } // We recommend this pattern to be able to use async/await everywhere @@ -169,7 +169,7 @@ export default buildModule("${c.name}Module", (m) => { const readme = (c: Contract) => `\ # Sample Hardhat Project -This project demonstrates a basic Hardhat use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, ${c.shouldUseUpgradesPluginsForProxyDeployment ? 'and a script that deploys that contract' : 'and a Hardhat Ignition module that deploys that contract'}. +This project demonstrates a basic Hardhat use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, ${c.upgradeable ? 'and a script that deploys that contract' : 'and a Hardhat Ignition module that deploys that contract'}. ## Installing dependencies @@ -188,13 +188,13 @@ npm test You can target any network from your Hardhat config using: \`\`\` -${c.shouldUseUpgradesPluginsForProxyDeployment ? 'npx hardhat run --network scripts/deploy.ts' : `npx hardhat ignition deploy ignition/modules/${c.name}.ts --network `} +${c.upgradeable ? 'npx hardhat run --network scripts/deploy.ts' : `npx hardhat ignition deploy ignition/modules/${c.name}.ts --network `} \`\`\` `; function getHardhatPlugins(c: Contract) { const plugins = ['ethers']; - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { plugins.push('upgrades'); } return plugins; @@ -203,29 +203,27 @@ function getHardhatPlugins(c: Contract) { export async function zipHardhat(c: Contract, opts?: GenericOptions) { const zip = new JSZip(); - const { default: packageJson } = - c.shouldInstallContractsUpgradeable || c.shouldUseUpgradesPluginsForProxyDeployment - ? await import('./environments/hardhat/upgradeable/package.json') - : await import('./environments/hardhat/package.json'); + const { default: packageJson } = c.upgradeable + ? await import('./environments/hardhat/upgradeable/package.json') + : await import('./environments/hardhat/package.json'); packageJson.license = c.license; - const { default: packageLock } = - c.shouldInstallContractsUpgradeable || c.shouldUseUpgradesPluginsForProxyDeployment - ? await import('./environments/hardhat/upgradeable/package-lock.json') - : await import('./environments/hardhat/package-lock.json'); + const { default: packageLock } = c.upgradeable + ? await import('./environments/hardhat/upgradeable/package-lock.json') + : await import('./environments/hardhat/package-lock.json'); packageLock.packages[''].license = c.license; zip.file(`contracts/${c.name}.sol`, printContract(c)); zip.file('test/test.ts', test(c, opts)); - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { zip.file('scripts/deploy.ts', script(c)); } else { zip.file(`ignition/modules/${c.name}.ts`, ignitionModule(c)); } zip.file('.gitignore', gitIgnore); - zip.file('hardhat.config.ts', hardhatConfig(c.shouldUseUpgradesPluginsForProxyDeployment)); + zip.file('hardhat.config.ts', hardhatConfig(c.upgradeable)); zip.file('package.json', JSON.stringify(packageJson, null, 2)); zip.file(`package-lock.json`, JSON.stringify(packageLock, null, 2)); zip.file('README.md', readme(c)); From d92a0fd8646098079cc2549e8b252ed6c702d338 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 8 Sep 2025 22:22:47 +0200 Subject: [PATCH 05/17] lint and changeset --- .changeset/lovely-groups-run.md | 5 +++ packages/core/solidity/src/account.ts | 7 +-- packages/core/solidity/src/options.ts | 4 +- packages/core/solidity/src/print.ts | 44 ++++++++----------- packages/core/solidity/src/set-upgradeable.ts | 2 +- 5 files changed, 28 insertions(+), 34 deletions(-) create mode 100644 .changeset/lovely-groups-run.md diff --git a/.changeset/lovely-groups-run.md b/.changeset/lovely-groups-run.md new file mode 100644 index 000000000..9bbc9f7ae --- /dev/null +++ b/.changeset/lovely-groups-run.md @@ -0,0 +1,5 @@ +--- +'@openzeppelin/wizard': patch +--- + +Remove all initializers from non-upgradeable accounts. diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index 35e373f71..7ee580150 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -5,12 +5,7 @@ import { printContract } from './print'; import { defaults as commonDefaults, withCommonDefaults, type CommonOptions } from './common-options'; import { upgradeableName } from './options'; import { setInfo } from './set-info'; -import { - addSigner, - signerFunctions, - signers, - type SignerOptions, -} from './signer'; +import { addSigner, signerFunctions, signers, type SignerOptions } from './signer'; import { setUpgradeableAccount } from './set-upgradeable'; export const defaults: Required = { diff --git a/packages/core/solidity/src/options.ts b/packages/core/solidity/src/options.ts index 311a0de96..9a1606490 100644 --- a/packages/core/solidity/src/options.ts +++ b/packages/core/solidity/src/options.ts @@ -9,7 +9,7 @@ export function upgradeableName(n: string) { } else { return n.replace(/(Upgradeable)?(?=\.|$)/, 'Upgradeable'); } -}; +} export function upgradeableImport(p: ImportContract): ImportContract { const { dir, ext, name } = path.parse(p.path); @@ -23,7 +23,7 @@ export function upgradeableImport(p: ImportContract): ImportContract { name: upgradeableName(name), // Solidity file name }), }; -}; +} export interface Options { transformImport?: (parent: ImportContract) => ImportContract; diff --git a/packages/core/solidity/src/print.ts b/packages/core/solidity/src/print.ts index 0fa7d56b5..e10eee6cc 100644 --- a/packages/core/solidity/src/print.ts +++ b/packages/core/solidity/src/print.ts @@ -85,41 +85,35 @@ function printConstructor(contract: Contract, helpers: Helpers): Lines[] { if (helpers.upgradeable) { const upgradeableParents = parentsWithInitializers.filter(p => inferTranspiled(p.contract)); const nonUpgradeableParents = parentsWithInitializers.filter(p => !inferTranspiled(p.contract)); - - return spaceBetween( - // constructor - printFunction2( - [ - nonUpgradeableParents.length > 0 + const constructor = printFunction2( + [ + nonUpgradeableParents.length > 0 ? '/// @custom:oz-upgrades-unsafe-allow-reachable constructor' : '/// @custom:oz-upgrades-unsafe-allow constructor', - ], - 'constructor', - [], - nonUpgradeableParents.flatMap(p => printParentConstructor(p, helpers)), - ['_disableInitializers();'] + ], + 'constructor', + [], + nonUpgradeableParents.flatMap(p => printParentConstructor(p, helpers)), + ['_disableInitializers();'], + ); + const initializer = printFunction2( + [], + 'function initialize', + contract.constructorArgs.map(a => printArgument(a, helpers)), + ['public', 'initializer'], + spaceBetween( + upgradeableParents.flatMap(p => printParentConstructor(p, helpers)).map(p => p + ';'), + contract.constructorCode, ), - // initializer - upgradeableParents.length > 0 - ? printFunction2( - [], - 'function initialize', - contract.constructorArgs.map(a => printArgument(a, helpers)), - [ 'public', 'initializer' ], - spaceBetween( - upgradeableParents.flatMap(p => printParentConstructor(p, helpers)).map(p => p + ';'), - contract.constructorCode, - ) - ) - : [], ); + return spaceBetween(constructor, upgradeableParents.length > 0 ? initializer : []); } else { return printFunction2( [], 'constructor', contract.constructorArgs.map(a => printArgument(a, helpers)), parentsWithInitializers.flatMap(p => printParentConstructor(p, helpers)), - contract.constructorCode + contract.constructorCode, ); } } else if (!helpers.upgradeable) { diff --git a/packages/core/solidity/src/set-upgradeable.ts b/packages/core/solidity/src/set-upgradeable.ts index 26a2edef8..723dbe77f 100644 --- a/packages/core/solidity/src/set-upgradeable.ts +++ b/packages/core/solidity/src/set-upgradeable.ts @@ -60,7 +60,7 @@ export function setUpgradeableGovernor(c: ContractBuilder, upgradeable: Upgradea export function setUpgradeableAccount(c: ContractBuilder, upgradeable: Upgradeable) { setUpgradeableBase(c, upgradeable, () => { - c.addModifier('onlyEntryPointOrSelf', functions._authorizeUpgrade); + c.addModifier('onlyEntryPointOrSelf', functions._authorizeUpgrade); }); } From 36b2d0ccf9ddf727e2ba42e5cca66764bfa62bcf Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 09:54:54 +0200 Subject: [PATCH 06/17] fix foundry zip tests --- .../core/solidity/src/zip-foundry.test.ts | 4 +- .../core/solidity/src/zip-foundry.test.ts.md | 212 ++++++++++++++++-- .../solidity/src/zip-foundry.test.ts.snap | Bin 4256 -> 4529 bytes packages/core/solidity/src/zip-foundry.ts | 162 +++++++++---- 4 files changed, 323 insertions(+), 55 deletions(-) diff --git a/packages/core/solidity/src/zip-foundry.test.ts b/packages/core/solidity/src/zip-foundry.test.ts index cc28602ce..8667b6d36 100644 --- a/packages/core/solidity/src/zip-foundry.test.ts +++ b/packages/core/solidity/src/zip-foundry.test.ts @@ -156,9 +156,7 @@ async function runTest(c: Contract, t: ExecutionContext, opts: GenericO } function assertLayout(zip: JSZip, c: Contract, t: ExecutionContext) { - const sorted = Object.values(zip.files) - .map(f => f.name) - .sort(); + const sorted = Object.keys(zip.files).sort(); t.deepEqual(sorted, [ 'README.md', 'script/', diff --git a/packages/core/solidity/src/zip-foundry.test.ts.md b/packages/core/solidity/src/zip-foundry.test.ts.md index fedff385e..5456c5940 100644 --- a/packages/core/solidity/src/zip-foundry.test.ts.md +++ b/packages/core/solidity/src/zip-foundry.test.ts.md @@ -322,7 +322,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (tokenBridge_, recipient, initialOwner))␊ );␊ - MyToken instance = MyToken(payable(proxy));␊ + MyToken instance = MyToken(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -355,7 +355,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address tokenBridge_, address recipient, address initialOwner)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("My Token", "MTK");␊ __ERC20Bridgeable_init();␊ @@ -433,7 +434,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (tokenBridge_, recipient, initialOwner))␊ );␊ - instance = MyToken(payable(proxy));␊ + instance = MyToken(proxy);␊ }␊ ␊ function testName() public view {␊ @@ -563,7 +564,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (defaultAdmin, upgrader))␊ );␊ - MyToken instance = MyToken(payable(proxy));␊ + MyToken instance = MyToken(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -588,9 +589,7 @@ Generated by [AVA](https://avajs.dev). _disableInitializers();␊ }␊ ␊ - function initialize(address defaultAdmin, address upgrader)␊ - public initializer␊ - {␊ + function initialize(address defaultAdmin, address upgrader) public initializer {␊ __ERC20_init("My Token", "MTK");␊ __ERC20Permit_init("My Token");␊ __AccessControl_init();␊ @@ -624,7 +623,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (defaultAdmin, upgrader))␊ );␊ - instance = MyToken(payable(proxy));␊ + instance = MyToken(proxy);␊ }␊ ␊ function testName() public view {␊ @@ -753,7 +752,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - MyToken instance = MyToken(payable(proxy));␊ + MyToken instance = MyToken(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -804,7 +803,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - instance = MyToken(payable(proxy));␊ + instance = MyToken(proxy);␊ }␊ ␊ function testName() public view {␊ @@ -1085,7 +1084,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - MyToken instance = MyToken(payable(proxy));␊ + MyToken instance = MyToken(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -1133,7 +1132,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - instance = MyToken(payable(proxy));␊ + instance = MyToken(proxy);␊ }␊ ␊ function testUri() public view {␊ @@ -1291,6 +1290,191 @@ Generated by [AVA](https://avajs.dev). `, ] +## account ecdsa uups + +> Snapshot 1 + + [ + `#!/usr/bin/env bash␊ + ␊ + # Check if git is installed␊ + if ! which git &> /dev/null␊ + then␊ + echo "git command not found. Install git and try again."␊ + exit 1␊ + fi␊ + ␊ + # Check if Foundry is installed␊ + if ! which forge &> /dev/null␊ + then␊ + echo "forge command not found. Install Foundry and try again. See https://book.getfoundry.sh/getting-started/installation"␊ + exit 1␊ + fi␊ + ␊ + # Setup Foundry project␊ + if ! [ -f "foundry.toml" ]␊ + then␊ + echo "Initializing Foundry project..."␊ + ␊ + # Backup Wizard template readme to avoid it being overwritten␊ + mv README.md README-oz.md␊ + ␊ + # Initialize sample Foundry project␊ + forge init --force --quiet␊ + ␊ + # Install OpenZeppelin Contracts and Upgrades␊ + forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ + forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ + ␊ + # Remove unneeded Foundry template files␊ + rm src/Counter.sol␊ + rm script/Counter.s.sol␊ + rm test/Counter.t.sol␊ + rm README.md␊ + ␊ + # Restore Wizard template readme␊ + mv README-oz.md README.md␊ + ␊ + # Add remappings␊ + if [ -f "remappings.txt" ]␊ + then␊ + echo "" >> remappings.txt␊ + fi␊ + echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ + echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ + # Add settings in foundry.toml␊ + echo "" >> foundry.toml␊ + echo "ffi = true" >> foundry.toml␊ + echo "ast = true" >> foundry.toml␊ + echo "build_info = true" >> foundry.toml␊ + echo "extra_output = [\\"storageLayout\\"]" >> foundry.toml␊ + ␊ + # Perform initial git commit␊ + git add .␊ + git commit -m "openzeppelin: add wizard output" --quiet␊ + ␊ + echo "Done."␊ + else␊ + echo "Foundry project already initialized."␊ + fi␊ + `, + `# Sample Foundry Project␊ + ␊ + This project demonstrates a basic Foundry use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, and a script that deploys that contract.␊ + ␊ + ## Installing Foundry␊ + ␊ + See [Foundry installation guide](https://book.getfoundry.sh/getting-started/installation).␊ + ␊ + ## Initializing the project␊ + ␊ + \`\`\`␊ + bash setup.sh␊ + \`\`\`␊ + ␊ + ## Testing the contract␊ + ␊ + \`\`\`␊ + forge test --force␊ + \`\`\`␊ + ␊ + ## Deploying the contract␊ + ␊ + You can simulate a deployment by running the script:␊ + ␊ + \`\`\`␊ + forge script script/MyAccount.s.sol --force␊ + \`\`\`␊ + ␊ + See [Solidity scripting guide](https://book.getfoundry.sh/guides/scripting-with-solidity) for more information.␊ + `, + `// SPDX-License-Identifier: MIT␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Script} from "forge-std/Script.sol";␊ + import {console} from "forge-std/console.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + import {MyAccount} from "src/MyAccount.sol";␊ + ␊ + contract MyAccountScript is Script {␊ + function setUp() public {}␊ + ␊ + function run() public {␊ + // TODO: Set addresses for the variables below, then uncomment the following section:␊ + /*␊ + vm.startBroadcast();␊ + address signer = ;␊ + MyAccount implementation = new MyAccount();␊ + address proxy = address(new ERC1967Proxy(␊ + address(implementation),␊ + abi.encodeCall(MyAccount.initialize, (signer))␊ + ));␊ + MyAccount instance = MyAccount(payable(proxy));␊ + console.log("Proxy deployed to %s", address(instance));␊ + vm.stopBroadcast();␊ + */␊ + }␊ + }␊ + `, + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("My Account", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + `, + `// SPDX-License-Identifier: MIT␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Test} from "forge-std/Test.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + import {MyAccount} from "src/MyAccount.sol";␊ + ␊ + contract MyAccountTest is Test {␊ + MyAccount public instance;␊ + ␊ + function setUp() public {␊ + address signer = vm.addr(1);␊ + MyAccount implementation = new MyAccount();␊ + address proxy = address(new ERC1967Proxy(␊ + address(implementation),␊ + abi.encodeCall(MyAccount.initialize, (signer))␊ + ));␊ + instance = MyAccount(payable(proxy));␊ + }␊ + ␊ + function testSomething() public {␊ + // Add your test here␊ + }␊ + }␊ + `, + ] + ## custom basic > Snapshot 1 @@ -1547,7 +1731,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyContract.initialize, (initialAuthority))␊ );␊ - MyContract instance = MyContract(payable(proxy));␊ + MyContract instance = MyContract(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -1590,7 +1774,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyContract.initialize, (initialAuthority))␊ );␊ - instance = MyContract(payable(proxy));␊ + instance = MyContract(proxy);␊ }␊ ␊ function testSomething() public {␊ diff --git a/packages/core/solidity/src/zip-foundry.test.ts.snap b/pack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w9Tn+_!<0WCYXnc)n{UTNwUaK`Vo5OEnQj)5aq$(w;(1fa# zWO8(2y(%TCAd2IalI#q_jqz!`^jJ?rmC5^K*VXi}larR2q#>0jw$Nn48jze0Ohq71 zK+T7kr7HR;LmVcp`#5`qYETt#oPF`eIXnO3)^$t=f(xMQif|hs*JH2$0&9XkfS`~OyklV$D+^PbP*@eZPX|C>*qiwh52dy2 zjx|wbVb7{so;VbR;cf~)QQwTk9ZCbmY_V!+$j;|g+EG6bcp_&+BkC~(nUgiI1moD) zT3T3~?5ECMI_PuKrLf-{II?5$Z9^jV{Vwr6M2}W;B8SK@C^BDKTsR_camFWMopd*F zUV8n_V`xE|UFv6c1fLxD?U-hLb!~g)1S6!llzRx_8`Q@ZkatKPy;*ww%@#%vdCPiSt3vH6 z)UHD9D%7q*?W2U+pI4!F6>1+T)YdL*ref_spTZ_?y0NxaTXy3&RAyo4r<+bW+%AoV zha(pEf4ZeH&B)dm(*D>w!;sdXeelQ>GkkcqF~hNK#}GCo6FYj`FvcuSHzIiOstO4* z_3r@;VHbJD2;m>TD64<}zvnIMcULWIxvGD!B7_SZAyoD6PiOQ|)xTHu@6(I`|5QbQ z7drwxxBB;NBsgOw@V|aKO5kTDtUUiL?n!Fl72S$_RT&@T`VX(4YCV1CE*+_=GU;h5 ztW2cMSJs>2`&1A&1NHTXV@oEc_M{m|-D*J!_`%wvbt^fco C3^eNi diff --git a/packages/core/solidity/src/zip-foundry.ts b/packages/core/solidity/src/zip-foundry.ts index d1f247ff8..a7bbf0a98 100644 --- a/packages/core/solidity/src/zip-foundry.ts +++ b/packages/core/solidity/src/zip-foundry.ts @@ -17,7 +17,16 @@ const test = (c: Contract, opts?: GenericOptions) => { function getImports(c: Contract) { const result = ['import {Test} from "forge-std/Test.sol";']; if (c.upgradeable) { - result.push('import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";'); + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + result.push( + useUpgradePlugin + ? 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : opts?.upgradeable == 'transparent' + ? 'import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";' + : 'import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";', + ); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); return result; @@ -37,24 +46,58 @@ const test = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - if (c.upgradeable) { - if (opts?.upgradeable === 'transparent') { - return [ - `address proxy = Upgrades.deployTransparentProxy(`, - [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - `instance = ${c.name}(payable(proxy));`, - ]; - } else { - return [ - `address proxy = Upgrades.deployUUPSProxy(`, - [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - `instance = ${c.name}(payable(proxy));`, - ]; - } - } else { - return [`instance = new ${c.name}(${args.join(', ')});`]; + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + switch (opts?.upgradeable) { + case 'transparent': + return useUpgradePlugin + ? [ + `address proxy = Upgrades.deployTransparentProxy(`, + [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ] + : [ + `${c.name} implementation = new ${c.name}();`, + `address proxy = address(new TransparentUpgradeableProxy(`, + [ + `address(implementation),`, + `initialOwner,`, + `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`, + ], + '));', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ]; + case 'uups': + return useUpgradePlugin + ? [ + `address proxy = Upgrades.deployUUPSProxy(`, + [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ] + : [ + `${c.name} implementation = new ${c.name}();`, + `address proxy = address(new ERC1967Proxy(`, + [`address(implementation),`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + '));', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ]; + default: + return [`instance = new ${c.name}(${args.join(', ')});`]; } } @@ -109,7 +152,16 @@ const script = (c: Contract, opts?: GenericOptions) => { function getImports(c: Contract) { const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; if (c.upgradeable) { - result.push('import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";'); + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + result.push( + useUpgradePlugin + ? 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : opts?.upgradeable == 'transparent' + ? 'import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";' + : 'import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";', + ); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); return result; @@ -135,24 +187,58 @@ const script = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - if (c.upgradeable) { - if (opts?.upgradeable === 'transparent') { - return [ - `address proxy = Upgrades.deployTransparentProxy(`, - [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - `${c.name} instance = ${c.name}(payable(proxy));`, - ]; - } else { - return [ - `address proxy = Upgrades.deployUUPSProxy(`, - [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - `${c.name} instance = ${c.name}(payable(proxy));`, - ]; - } - } else { - return [`${c.name} instance = new ${c.name}(${args.join(', ')});`]; + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + switch (opts?.upgradeable) { + case 'transparent': + return useUpgradePlugin + ? [ + `address proxy = Upgrades.deployTransparentProxy(`, + [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ] + : [ + `${c.name} implementation = new ${c.name}();`, + `address proxy = address(new TransparentUpgradeableProxy(`, + [ + `address(implementation),`, + `initialOwner,`, + `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`, + ], + '));', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ]; + case 'uups': + return useUpgradePlugin + ? [ + `address proxy = Upgrades.deployUUPSProxy(`, + [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ] + : [ + `${c.name} implementation = new ${c.name}();`, + `address proxy = address(new ERC1967Proxy(`, + [`address(implementation),`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + '));', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ]; + default: + return [`${c.name} instance = new ${c.name}(${args.join(', ')});`]; } } From 27d8f1326050f12bbdde73c1aaf3ad11a6c36239 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 10:24:02 +0200 Subject: [PATCH 07/17] fix hardhat zip tests --- .../core/solidity/src/zip-hardhat.test.ts | 10 +- .../core/solidity/src/zip-hardhat.test.ts.md | 109 +++++++++++++++++- .../solidity/src/zip-hardhat.test.ts.snap | Bin 3079 -> 3264 bytes packages/core/solidity/src/zip-hardhat.ts | 9 +- 4 files changed, 118 insertions(+), 10 deletions(-) diff --git a/packages/core/solidity/src/zip-hardhat.test.ts b/packages/core/solidity/src/zip-hardhat.test.ts index 4daa63619..9caab3734 100644 --- a/packages/core/solidity/src/zip-hardhat.test.ts +++ b/packages/core/solidity/src/zip-hardhat.test.ts @@ -102,7 +102,7 @@ test.serial('account ecdsa', async t => { test.serial('account ecdsa uups', async t => { const opts: GenericOptions = { kind: 'Account', name: 'My Account', signer: 'ECDSA', upgradeable: 'uups' }; const c = buildAccount(opts); - await runIgnitionTest(c, t, opts); // Account does not use proxies for deployment, until factories are added + await runDeployScriptTest(c, t, opts); }); test.serial('custom basic', async t => { @@ -138,9 +138,7 @@ async function runIgnitionTest(c: Contract, t: ExecutionContext, opts: } function assertDeployScriptLayout(zip: JSZip, c: Contract, t: ExecutionContext) { - const sorted = Object.values(zip.files) - .map(f => f.name) - .sort(); + const sorted = Object.keys(zip.files).sort(); t.deepEqual(sorted, [ '.gitignore', 'README.md', @@ -158,9 +156,7 @@ function assertDeployScriptLayout(zip: JSZip, c: Contract, t: ExecutionContext) { - const sorted = Object.values(zip.files) - .map(f => f.name) - .sort(); + const sorted = Object.keys(zip.files).sort(); t.deepEqual(sorted, [ '.gitignore', 'README.md', diff --git a/packages/core/solidity/src/zip-hardhat.test.ts.md b/packages/core/solidity/src/zip-hardhat.test.ts.md index 3c1f723d0..745b178b5 100644 --- a/packages/core/solidity/src/zip-hardhat.test.ts.md +++ b/packages/core/solidity/src/zip-hardhat.test.ts.md @@ -162,7 +162,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address tokenBridge_, address recipient, address initialOwner)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("My Token", "MTK");␊ __ERC20Bridgeable_init();␊ @@ -564,6 +565,112 @@ Generated by [AVA](https://avajs.dev). `, ] +## account ecdsa uups + +> Snapshot 1 + + [ + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("My Account", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + `, + `import { HardhatUserConfig } from "hardhat/config";␊ + import "@nomicfoundation/hardhat-toolbox";␊ + import "@openzeppelin/hardhat-upgrades";␊ + ␊ + const config: HardhatUserConfig = {␊ + solidity: {␊ + version: "0.8.27",␊ + settings: {␊ + optimizer: {␊ + enabled: true,␊ + },␊ + },␊ + },␊ + };␊ + ␊ + export default config;␊ + `, + `{␊ + "name": "hardhat-sample",␊ + "version": "0.0.1",␊ + "description": "",␊ + "main": "index.js",␊ + "scripts": {␊ + "test": "hardhat test"␊ + },␊ + "author": "",␊ + "license": "MIT",␊ + "devDependencies": {␊ + "@openzeppelin/contracts": "^5.4.0",␊ + "@openzeppelin/contracts-upgradeable": "^5.4.0",␊ + "@openzeppelin/hardhat-upgrades": "^3.0.0",␊ + "@nomicfoundation/hardhat-toolbox": "^6.1.0",␊ + "hardhat": "^2.16.1"␊ + }␊ + }`, + `import { ethers, upgrades } from "hardhat";␊ + ␊ + async function main() {␊ + const ContractFactory = await ethers.getContractFactory("MyAccount");␊ + ␊ + // TODO: Set addresses for the contract arguments below␊ + const instance = await upgrades.deployProxy(ContractFactory, [signer], { unsafeAllow: 'constructor' });␊ + await instance.waitForDeployment();␊ + ␊ + console.log(\`Proxy deployed to ${await instance.getAddress()}\`);␊ + }␊ + ␊ + // We recommend this pattern to be able to use async/await everywhere␊ + // and properly handle errors.␊ + main().catch((error) => {␊ + console.error(error);␊ + process.exitCode = 1;␊ + });␊ + `, + `import { expect } from "chai";␊ + import { ethers, upgrades } from "hardhat";␊ + ␊ + describe("MyAccount", function () {␊ + it("Test contract", async function () {␊ + const ContractFactory = await ethers.getContractFactory("MyAccount");␊ + ␊ + const signer = (await ethers.getSigners())[0].address;␊ + ␊ + const instance = await upgrades.deployProxy(ContractFactory, [signer], { unsafeAllow: 'constructor' });␊ + await instance.waitForDeployment();␊ + });␊ + });␊ + `, + ] + ## custom basic > Snapshot 1 diff --git a/packages/core/solidity/src/zip-hardhat.test.ts.snap b/packages/core/solidity/src/zip-hardhat.test.ts.snap index 481b2bf3bc12d4ba31c20532af0dc09030a9da24..29d2250f42da5e5abdc94cc6518077cc54c321ea 100644 GIT binary patch literal 3264 zcmV;x3_tThRzV3SW?yxJ1B#>`%!5d3xX z=1ov2g2F5)ybRtbTm!cXGoUd0`nCF8tp>NZ)_yks0k#nF(EPfM2*)jq*dp9m-znB= zaFuplljD5{!9&bDaMMNP7sz#yg9%)vgfr9P9{lJ|^#|2@(Pd`4YeJ7Y*v7mEKdM)M zSZyvW6^pp*QpVx&ie(|slLe`B0$YrBVd*{UBJxzD)~o=vW=i8)qD;t zSw9Vj())%t_|#WC z1qP37)G~dCuh?BoqNlFudx%A!yO?mq$`V-o$fg^mjUJStEmdG?W9P@Elz|Fb%uKyM z4z2bCt`YO9S+CdO+ptlGZ@&#~WZ|yqct%;rMHXo@lkkVsLB`ts2P?ZD?Che8X5!D?tF1;facH%O@7clqeLV9P}3@PA^?mIo@h*pAY7fQQ^W8 z`G7LUK}T|0fj%a@dFL)PyVNH<`#rd=H<@b6NVms zKbq>%bWRUV&vy~42978PM8&GY{74hI{)ArBLlU1eD$L=>1B?#)xEU-qYCVe(7~(!7 z9yE08(>|;B+I8)Waw72eq^KE0p%74rTZLe$h3}ip?wEYnLu{3j7H-2}-R-D1V#RIY zcC>P-07e5t@CyE7l96h>m1K^tz#) zTnfWnK-m!!w_YC}D>k!LaNa{Wdu_9CdxG#%+S- zgRU&#m9iZf!xI~j+<(-^QUw~_GF<)nhRYhmork&7%IhRy1jIL4qL;vK}i^jsD(Q)6=<#r+LeGea%@VguhnYW~W`l`7Em zdc?|D1`!ETiU+13A3eAX%|jD&?MJnZc*-KGK0#h0x&oJ>k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#$C6M+$Y4Wh^3-8&(}sw2vq+Z9tPF202cyis=-+ z62uv*cqQx;mAfqBX)N^0OZyAa!G_Q|M4=!n@i7#)>_Xy^+WX%py>QF~V@w*)pP)G8 zbBTSNv&{JZdCQEc=@4^C?2;_1Ny+zKj{N$Cl_O6lrl&P3tqEa&({5di=6U~0L6~d6 z#1WH3SCHDoOlg95Mq=Bv`e#Y5N=Bn~st2MLo$fb1bC zSw1H)W=IL4O&#%lL=+zZH)VUr zb;Z+Rh+L035?k<}T;&7sWWoNYTQqsm+UTw{1LF zYs&F*m zP~1^(QPOl2KlQ3}TVmnKg04FKSO z6#%y809d&?DW~}jxIj*mOJzwbcr;5Iv!wAnC5>;uMJ0`74;ZsX?)XplO7Z+(%TCfq z<)c4sHtOtOKjX7M=guV^{;3DW3VFN}e44YH>a+XA*GR6fm`?D&RsguJHRyl6H0cSB zE<=Mpx0gGNIimPd#KphdFnd%#dsIJrRBuk0|E*m9qx!F6Sj56l0084W2;l$# diff --git a/packages/core/solidity/src/zip-hardhat.ts b/packages/core/solidity/src/zip-hardhat.ts index 23ed27a0c..8e283cee1 100644 --- a/packages/core/solidity/src/zip-hardhat.ts +++ b/packages/core/solidity/src/zip-hardhat.ts @@ -119,9 +119,14 @@ function getAddressArgs(c: Contract): string[] { } function getDeploymentCall(c: Contract, args: string[]): string { - return c.upgradeable + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + return !c.upgradeable + ? `ContractFactory.deploy(${args.join(', ')})` + : useUpgradePlugin ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` - : `ContractFactory.deploy(${args.join(', ')})`; + : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })` } const script = (c: Contract) => { From 0d3ae13042a2b9079c55eafc96e5faeac7788f94 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 16:12:30 +0200 Subject: [PATCH 08/17] Update account.ts --- packages/core/solidity/src/account.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index 7ee580150..e41f6c127 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -159,9 +159,6 @@ function addBatchedExecution(c: ContractBuilder, opts: AccountOptions): void { function addERC7579Modules(c: ContractBuilder, opts: AccountOptions): void { if (!opts.ERC7579Modules) return; - // Base AccountERC7579 account (upgradeable or not) - const name = 'AccountERC7579'; - c.addParent({ name: opts.ERC7579Modules, path: `@openzeppelin/contracts/account/extensions/draft-${opts.ERC7579Modules}.sol`, @@ -182,8 +179,9 @@ function addERC7579Modules(c: ContractBuilder, opts: AccountOptions): void { c.addConstructorCode('_installModule(moduleTypeId, module, initData);'); } - // isValidSignature override - c.addOverride({ name }, functions.isValidSignature); + c.addOverride({ name: 'AccountERC7579' }, functions._validateUserOp); + c.addOverride({ name: 'AccountERC7579' }, functions.isValidSignature); + if (opts.signatureValidation === 'ERC7739') { c.addOverride({ name: 'ERC7739', transpiled: false }, functions.isValidSignature); c.setFunctionBody( @@ -191,14 +189,11 @@ function addERC7579Modules(c: ContractBuilder, opts: AccountOptions): void { '// 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) ? ${opts.upgradeable ? upgradeableName(name) : name}.isValidSignature(hash, signature) : erc7739magic;`, + `return erc7739magic == bytes4(0xffffffff) ? ${opts.upgradeable ? upgradeableName('AccountERC7579') : 'AccountERC7579'}.isValidSignature(hash, signature) : erc7739magic;`, ], functions.isValidSignature, ); } - - // _validateUserOp override - c.addOverride({ name }, functions._validateUserOp); } function addMultisigFunctions(c: ContractBuilder, opts: AccountOptions): void { From 03f895b38e55488b83eaf3773526a00097e52554 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 16:28:43 +0200 Subject: [PATCH 09/17] up --- packages/core/solidity/src/account.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index e41f6c127..919fe86fc 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -265,10 +265,7 @@ function overrideRawSignatureValidation(c: ContractBuilder, opts: AccountOptions // Base override for `_rawSignatureValidation` given MultiSignerERC7913Weighted is MultiSignerERC7913 if (opts.signer === 'MultisigWeighted') { - c.addImportOnly({ - name: signers.Multisig.name, - path: signers.Multisig.path, - }); + c.addImportOnly(signers.Multisig); } } } From b3e3dba32a26efa97aa6715a98e0d1d87197d340 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 18:46:42 +0200 Subject: [PATCH 10/17] use unsafeAllow for EIP-712 constructor in foundry zip tests --- packages/core/solidity/src/erc1155.test.ts.md | 6 +- .../core/solidity/src/erc1155.test.ts.snap | Bin 1803 -> 1807 bytes packages/core/solidity/src/erc20.test.ts.md | 12 +- packages/core/solidity/src/erc20.test.ts.snap | Bin 3446 -> 3450 bytes .../core/solidity/src/governor.test.ts.md | 3 +- .../core/solidity/src/governor.test.ts.snap | Bin 2350 -> 2347 bytes .../core/solidity/src/zip-foundry.test.ts.md | 28 +-- .../solidity/src/zip-foundry.test.ts.snap | Bin 4529 -> 4530 bytes packages/core/solidity/src/zip-foundry.ts | 174 ++++++++---------- packages/core/solidity/src/zip-hardhat.ts | 4 +- 10 files changed, 104 insertions(+), 123 deletions(-) diff --git a/packages/core/solidity/src/erc1155.test.ts.md b/packages/core/solidity/src/erc1155.test.ts.md index 5b7de2840..470826aa4 100644 --- a/packages/core/solidity/src/erc1155.test.ts.md +++ b/packages/core/solidity/src/erc1155.test.ts.md @@ -377,7 +377,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address defaultAdmin, address pauser, address minter)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC1155_init("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/");␊ __AccessControl_init();␊ @@ -462,7 +463,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address defaultAdmin, address pauser, address minter, address upgrader)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC1155_init("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/");␊ __AccessControl_init();␊ diff --git a/packages/core/solidity/src/erc1155.test.ts.snap b/packages/core/solidity/src/erc1155.test.ts.snap index 2809eaab0f3d8ab4bf97ae90655b179bb80cf196..a7faff1b154bdeb246bb2cdcf2939104f5cd729c 100644 GIT binary patch delta 1766 zcmVZ*N;sM|VxGGnuFM#?2h+B|-OA;#rc)-s>0WhbZEa)Y473^5 z!15ESBXZ)%lVn$(BU%`!iZfc$b-2%SHcqz)9Q z2m3`G6DVL&R;i&#SZ{ObOHHn9c8?j^S*vf9>J{zvI)_hD>0qs|KYg*eO-j7CqkO)- z`Nht6`z2}FSK@%n$03}a<*e_vL1cj`0UU`&wVdaIVbTE_(kSZ#f_etSD?m3|DwY8y zYTuH7;aF>an$C^R)Gce^EO(Z32*wH2kom+6f@P|p8f>GCZWGW=&geD)-89RefsX;B zD&ldXE&UrJ+Fwg45Upe_yLBT~$K*)po(S8fK-}RzE~MO9j8i$#Ru&T>5ui~m zH*0(K`d+nJJ>1^|pMfJJ%kXG@<6(X|GPt~dvXvXiV+FOLp^B2CVKPG=2dLIzkccW( zQGR#tX{oVaZ6P42%AZLsAH4J{iopf)hjLuq-^|$B9llp}^2h@|grO z7><+jx)LH~bSx0z zW=xSHa%Np-6+i?)mIx1UHC-JVJek@zzY026vX0rD2t zBv=8s{{$@n0~4{n@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JGlz+>6qf@+U{=&8Fr ze9a&nw$U0iJ#sKw#Sf2zK3>7rbM@8;F+S)70DE&rG&igx05-VU;h68si}l@_&eAr` zIad-$1D%a#h<&!o(0GJ{gJ-x*^kz)2=@MX5!Fj+7)tyN=Jc`=2dbzWxq2iLyrLx}9 zwdx(Emq(5nvM!Tf&Z&WV_$rc5N7C!m+|2vTXm*s#zBSQW8EEpmaLyRo= z3z=0HS#>d=)rDUfK>M)m)D1wMO$7DInyw-Z5dqD)V`Tkt$f2zfZo_AB6;4*+Bv&{m ztHTZo?8;=|YXf(_3za?J+)4YjfyCTGSDr10WmA5BGuq%CmCz7Kk3z{s?O_q^ja+|$KG?O$oiZjbxCw}+iKbc=8O(;kJ E0AplQHUIzs diff --git a/packages/core/solidity/src/erc20.test.ts.md b/packages/core/solidity/src/erc20.test.ts.md index 9c9af9619..e422ee059 100644 --- a/packages/core/solidity/src/erc20.test.ts.md +++ b/packages/core/solidity/src/erc20.test.ts.md @@ -1049,7 +1049,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address defaultAdmin, address tokenBridge, address recipient, address pauser, address minter, address upgrader)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("MyToken", "MTK");␊ __ERC20Bridgeable_init();␊ @@ -1152,7 +1153,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address recipient, address defaultAdmin, address pauser, address minter)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("MyToken", "MTK");␊ __ERC20Burnable_init();␊ @@ -1241,7 +1243,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address recipient, address defaultAdmin, address pauser, address minter, address upgrader)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("MyToken", "MTK");␊ __ERC20Burnable_init();␊ @@ -1334,7 +1337,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address recipient, address initialAuthority)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("MyToken", "MTK");␊ __ERC20Burnable_init();␊ diff --git a/packages/core/solidity/src/erc20.test.ts.snap b/packages/core/solidity/src/erc20.test.ts.snap index fe5aa7f886c5e07b261f689582143ece4a961b75..c78c752bc840a89a9df2bbf0425f5cdc36f6a9f2 100644 GIT binary patch literal 3450 zcmV-=4TbVSRzVX8 z?3(OUGarix00000000B+UCnPJNfn<@Ey}Vh%>`*$p{?-|*U? z66FI}5F1sx%W)~))!ypre9SP1m5>mEKLCl-?h$c-8;HYR5Zn+PIKTyNfRMN#A%TR1 z`n#)LZMPkNw3CXoJF>g_)vK!aepSC$ugV`ck2FI$F@N}_PY}aQLnlYj#0o%EsaCK_ zVB2gN%>3wMRfP<`fAjmdZ@hBD{=0ei#=TqLzF97Vy`7D(m!4t;5fhafDk2OwF`|#a zR%3srTn6ig-i8bxX$YKQ)&kpYM81LAZKPoW)(yfaRG0}qsLd_TRc6{09_tX8hK5zl zF2Dzsxs|!<^5dBqthWuyz>Ce@^=joMXi`H5xhF;&k>{SYvf@iCGvfr2vQyOk|D0)P zxyQVa9Yl4^`VocB86qY&h*^$E@MO>U?|`j~efuSVP2dzOf=FrbVg>*J6oZ(IS_(60 zzTiI3=e!qlMUdOte=k>vz85|%fEO=kUe0(UcK(JlSb#ts*)>`OD~5{pU=s-j@JHML z{y+|3mjP7z9zd_}y^;FWcf|wQQHmc>;*RH$MF~98M1%NWZV>-5-GlhH*Urlfqc0;1 zUheBMQm6N9qzx@oY$JDWaW?X=+f!{LJ6=04HHw~$G1!PNd;2VvWkW?lrdjq%r=Cr` z_7s8lVlRV(s!EY*0!%Q&P}@Euh!&hu_FsZA2G6}p@?GBUFj?pEi(BT zT9hwV%$DpujwGo~3D|aikD|0LHo7=HK@WH}$Zfa=A6yU~hINbR8oeAK^ zn&S`7i-wlcdAN5(E`A+xs1FR``cH%;M;8p43sv9c9AJTjft|I3z0KXj-R-BFU=^Go zMS&;P+EP9jd5|kSo=Jow6*Zxyu{Bl4By=9fcl&^+ZU7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w@F86b8a`@yr#pUEAapg(E>)8BG5`#zRdaQ)A1n}gVIG-fn+l;U}Clsnk zO!Du)#sS~VBv!?a2_A-8_Hg@3q(MpCipc2>VMC~}7qa!x#r3-3>LC^!t9{FLWBk0| zN;}lJxb)7ia6-D_ELYHj*NAQj1WrCnwCC!{Gu3JpJa!%Aq4C^rq*<|u30tTF?R8cZ zX$7Is$U53P$P%;^Q8O(W1P5irxy62C!g5?X$dS__NA}Yss6UFA3p>?)BU!@j+L%1Q zlfVs5;Ryk@nq_6#9b`Y{K=x-6WF^Q>9mq~-wVMZ^&I>358G)JXTD!^L--u6$L6PY; zYfA;^ZDb#!WP-UOw>K{3^QiU|UF%rSdOf4RknpX?x0-&ACjN=DncvBTj;RVKjWg$e zRQ5ksKHwv`d!c}v<)nhuRWM(RPU{2srR$rykM^IaIs*VA6>k0|pmF`5j$@8TOr^Ll0!c zgo@zs21bqivzsG`8wo^rz3^oODu`rv`>nE3M9-3?pS&YMQj;;Qrd9M3x4~)mKq%QJWl-F_PasC>XBlOGp5N1TvAXV=9oc=u*g_W7mtHT#q>)5 z32~71w-I6mIZrKzhC2-hsPp}M>ErwLiP#tg{pI;cP&Yy6TY5)BIwJ0GVP&`gGyKBW zj5AqAQ8+aEb0)U5IY_ok_3U;t20QKR@X^ldeX1g;yy_;wy=-B)*dP zO5&RY#K{ofob$x=i`a6<{Jar$pC|Ob#!RpWsiMgK<#2@s_x*wXnUq+@km!?G_(VBV YsFI{fll|58aq@@%16opTS!uTb0EmyWy#N3J diff --git a/packages/core/solidity/src/governor.test.ts.md b/packages/core/solidity/src/governor.test.ts.md index e49920a89..8ab51e516 100644 --- a/packages/core/solidity/src/governor.test.ts.md +++ b/packages/core/solidity/src/governor.test.ts.md @@ -1624,7 +1624,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(IVotes _token, TimelockControllerUpgradeable _timelock)␊ - public initializer␊ + public␊ + initializer␊ {␊ __Governor_init("MyGovernor");␊ __GovernorCountingSimple_init();␊ diff --git a/packages/core/solidity/src/governor.test.ts.snap b/packages/core/solidity/src/governor.test.ts.snap index 63d7cb468e9308c72c3d501ca633eea81519e06c..6eca252ca88728c3009edf80814685eee7ceb940 100644 GIT binary patch literal 2347 zcmV+`3DovMRzVmmVcv=PuG zPGlE7pb=KPBWdd0nf1)9B--#rfWASVAbpFzL0aUxZBXPgKri|b#U6&_?17}Xq_w2} zy0N)C`<-TX_WSKOLw23`r@xtGab-Naw^WL;7SF_`QW_mu3DE|YEA{sDG9ty6d>uE(k+uhvR?5#!8Jq=x=M8JHe z`{c9U=HBM^{r$By7Dhs9^77ZY)vw5j6d}3uzKAG)kqdM@BhbmbbGb(ybIGO>!JYk* zq=zErn(@;^7DfTRf?Rs3DOXHz1SuIf^(S)iPQDmMx-4CqxxSNY;x`kHA@KI|L62vfxTze}n| z&G2|?YvH3El;O#O8RX>}A%u8>D=lMB3)#tBCr4U5qr6MXc9SEWAG@1goctN_ojXG( z?vzibqC1)BnzOdyot<*Cf<>KzIWJ$WrT?D9JQXpRvYwb3t88wml}t48Wt=X@Ay3XIIT1l1E*L)@C|ATCQKN{Y&toR3PmcTKFrSV$3-&7QYHAD_ zbjN`|?ApwQ!N+q(F9sisu1@)eD2#-=1rHVJJkFIJCMM+LqZkJjN6F2Y8aZNIbvK&^ zA5rS7PhuJ~etJEw9Sd`~#-mD8CpviaJf<=IIHJ-``@6!qE^&QdQllz7JeAo{hLtbfG51^pbk9Ua=q#W0?oB?B$%p=p_%k8> z_@4y@-vSD5I27E#%)HIX_w~NezjqVf=MQu}PZ?*BSfuY#K8nL*D(4qNPy#4nbrM(t zN&qFaB~GQm2ui4tQ#d%c*+5a9JYp-zVEv^<1_8D*%tQus<|njQ^%){1qJD)E6`UXUupiECQ?mRsbv4KNtZkHLwyF zU_}e*o>uIAc;gF;RsQk@SY;+w$>Q4(RWczU6_84k8cjZomJw8zc)vwksxknln+i@x zSqnPfq)us>jH3L+NUk(Uvh(0kIa{KaPgk=hc*f}|Gra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jK#(SlR7-7+!xX@6Wu8ZSO9li7a8RD@ykm&_9Xf+ySgS47#P-`3DU`EG* z4i@BP;K8iZaq0P>*1E=kuwes2`sE`${qm76iKE2!B&r|tGvk*QE--9iLPhp!6UhoC zDptB8`~J2mzV_XIUVGi!%Z_cQF}X^Qq9FT9k0Rs=$`+v@ds*Xaq&Se`XrrI5eCxIz zVHTF+*cwAHT=0!)DCYJ*EsFUDNe}FV0$^Y#)Kc$++RD=p>590>Tt~)LX>U1LEpxU5 zfK#^UhUYp!37~{F`l&P-K?!w~aL=ZMU-8%D%SH$;TOr&A_8TniO`frJMV9^jEB z;gOY2c%+FA)ip6VG8+i|k=a0IqrzKY7BEX|CL@@oj#(Z|!z@#$IR0XB%b$?qK#BuM zffUDbr#MpN8TV^}jguQWP2o$QKsLYw;K8g;1|9$pY~vc^!8@hj)7$QyXHiESol4hF zh@cDtZ~ol^fj_@_jUeze)srTQPKeqz;$hP&J{XZS6)H6Ec_KkfR;e&a7NS#qALDpn zA*vK5PY)!EQ>V6{1tQAbofn#MB`hWWL@!^a;j+$5y zGXc#khYT0u5dn43R@tODS;wMWWxM)2uS*K1%?6u U@^5bP%;␊ - MyAccount implementation = new MyAccount();␊ - address proxy = address(new ERC1967Proxy(␊ - address(implementation),␊ - abi.encodeCall(MyAccount.initialize, (signer))␊ - ));␊ + Options memory opts;␊ + opts.unsafeAllow = "constructor";␊ + address proxy = Upgrades.deployUUPSProxy(␊ + "MyAccount.sol",␊ + abi.encodeCall(MyAccount.initialize, (signer)),␊ + opts␊ + );␊ MyAccount instance = MyAccount(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ @@ -1452,7 +1454,7 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Test} from "forge-std/Test.sol";␊ - import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";␊ import {MyAccount} from "src/MyAccount.sol";␊ ␊ contract MyAccountTest is Test {␊ @@ -1460,11 +1462,13 @@ Generated by [AVA](https://avajs.dev). ␊ function setUp() public {␊ address signer = vm.addr(1);␊ - MyAccount implementation = new MyAccount();␊ - address proxy = address(new ERC1967Proxy(␊ - address(implementation),␊ - abi.encodeCall(MyAccount.initialize, (signer))␊ - ));␊ + Options memory opts;␊ + opts.unsafeAllow = "constructor";␊ + address proxy = Upgrades.deployUUPSProxy(␊ + "MyAccount.sol",␊ + abi.encodeCall(MyAccount.initialize, (signer)),␊ + opts␊ + );␊ instance = MyAccount(payable(proxy));␊ }␊ ␊ diff --git a/packages/core/solidity/src/zip-foundry.test.ts.snap b/packages/core/solidity/src/zip-foundry.test.ts.snap index 2d7ea8ddc7bee740c17c0901906c53b7b009e4e0..7debb3adfe7ff4fb7bda4090285ede867da2d7cc 100644 GIT binary patch literal 4530 zcmV;j5l!wvRzV0+TIl z#sLvO3LlFI00000000B+UCnPBNp^2~#mP|WFkOaBRHJ2nt5>h8Uf27*SH+*Uk6mIvVPF3Yam-!xV?^!MWzY^> z7c(FBSeJ12M?ZBO$l+(d@{`w$Zy4fVL^tuN%f&Hw@#0w+y3y(=cvU z-gu{SeS=ciuT=D>x8Hu-s8o&0b))i4<7VZW@ynIhjLP+QuKoAxx8Ah^My+G)TgX2F z$B=ca)mvb*i|i)=w?PMUfEmC(maL^`!@0egmatbSpB2N1Nb|Ci6nyC5=bFflvkC=C`g;o z4jLkgEFU6_ZXhWT*hdI-Iq$K%mUT?X6SISOTaucrYjqIk*zdF$hm<47QnEpgiJ$4r zKH@=EQSr;LBtWc6`h+bn$cSchXEu)2vmi0Ner(p#3E1 zf#1i^A$0&pUeARb0g9mGA;1ZMCj>hHb8w6VBXWZ1DaD+JEqN#4@%F~n?zZVU>Qjq6 zH$6u(k3>L#L9gecOlN=^2<&4HTCFyrHUh2I(*Pr`c}RUf>LLGg)axM^`(Ts!oI;zk z7=tXCMS948uD-NvU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OdJykw08Aj9+}cEF3AL&Bcv2%fgYDGmWhG-)e57=cSMu=! zRCtJ4suGVPpkdr9kIM(9dS$7`<(F#A*yo?Iieox}n+I)M1lIuB4ue^M?aj@ia*m~I zhVjFyVf=ilEaxZzw#5b5%5skR1;JkAa*m&s0L)?oFqaOzY{*abTorU2&3!?K(pqw( z8mTg~RaGr79A?6BCx(`&-*QVilm@c7VbxHVoo7|ZQJV!Skusto)fa-yN}5*$ZS3r= zt*nms=gDo_?{U(hu-ENdvSaqrAQAHZ0dXBf&sJd~he$BUGGAL=IU{dzkSAgtb4K_7K81s2`g^z9D(OX6>E#n;^zQpSqFi zh!7e1>yWA&wagUn@ZgFXPaIuYsWsw*=tWs@6y#4YxA5hBJ~sy-(7HZ9L=gGCk)}`J z!J7v1_Fz9eJ|Z)tGbw}l^BLWBT>?%E060y(f+&XZO!P-^M*&@PaA{2pSW6W#jfJzN zFZeEk+$Oo+rbQ97yJ4r{Wl+VS-GvoMX~b_tX;e%@vfwEJ--CI&&}Q4`w7*BN&mYiz zRD~ z7@RA_&ITi9bNsrcKF#W-Tomaqj7vn3aOX${x?%jol3~1C-e^)r2n!q`l=UAkXY^6lf0Xqf z(~JQBt&9K{I|7_p{YNqqoU;Ouzn${}kPA9ZJ}+VA>}x(Ix!pw3ZO9ZI@2C0?o?qw< zDT%jqrUUa)&%879k+kW%Qu5;aSP(b68&gh4W+kWgXVG_MKsnh>BQh$bRuRj~Dt^cX zFmlTRa>bnA+e`)~Jt}RVm|Nnek^zq)7mEDd0$wOGC+N@_FBi#ixo7-y&~xKiN4e7r P0>*v=jQigk|HA+PFzUqP diff --git a/packages/core/solidity/src/zip-foundry.ts b/packages/core/solidity/src/zip-foundry.ts index a7bbf0a98..44a44bda5 100644 --- a/packages/core/solidity/src/zip-foundry.ts +++ b/packages/core/solidity/src/zip-foundry.ts @@ -18,14 +18,12 @@ const test = (c: Contract, opts?: GenericOptions) => { const result = ['import {Test} from "forge-std/Test.sol";']; if (c.upgradeable) { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; result.push( - useUpgradePlugin - ? 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";' - : opts?.upgradeable == 'transparent' - ? 'import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";' - : 'import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";', + unsafeAllowConstructor + ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', ); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); @@ -47,55 +45,42 @@ const test = (c: Contract, opts?: GenericOptions) => { function getDeploymentCode(c: Contract, args: string[]): Lines[] { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; switch (opts?.upgradeable) { case 'transparent': - return useUpgradePlugin - ? [ - `address proxy = Upgrades.deployTransparentProxy(`, - [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ] - : [ - `${c.name} implementation = new ${c.name}();`, - `address proxy = address(new TransparentUpgradeableProxy(`, - [ - `address(implementation),`, - `initialOwner,`, - `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`, - ], - '));', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ]; + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.deployTransparentProxy(`, + unsafeAllowConstructor + ? [ + `"${c.name}.sol",`, + 'initialOwner,', + `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, + 'opts', + ] + : [`"${c.name}.sol",`, 'initialOwner,', `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ].filter(line => line !== false); case 'uups': - return useUpgradePlugin - ? [ - `address proxy = Upgrades.deployUUPSProxy(`, - [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ] - : [ - `${c.name} implementation = new ${c.name}();`, - `address proxy = address(new ERC1967Proxy(`, - [`address(implementation),`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - '));', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ]; + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.deployUUPSProxy(`, + unsafeAllowConstructor + ? [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, 'opts'] + : [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ].filter(line => line !== false); default: return [`instance = new ${c.name}(${args.join(', ')});`]; } @@ -153,14 +138,12 @@ const script = (c: Contract, opts?: GenericOptions) => { const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; if (c.upgradeable) { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; result.push( - useUpgradePlugin - ? 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";' - : opts?.upgradeable == 'transparent' - ? 'import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";' - : 'import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";', + unsafeAllowConstructor + ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', ); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); @@ -188,55 +171,42 @@ const script = (c: Contract, opts?: GenericOptions) => { function getDeploymentCode(c: Contract, args: string[]): Lines[] { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; switch (opts?.upgradeable) { case 'transparent': - return useUpgradePlugin - ? [ - `address proxy = Upgrades.deployTransparentProxy(`, - [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ] - : [ - `${c.name} implementation = new ${c.name}();`, - `address proxy = address(new TransparentUpgradeableProxy(`, - [ - `address(implementation),`, - `initialOwner,`, - `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`, - ], - '));', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ]; + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.deployTransparentProxy(`, + unsafeAllowConstructor + ? [ + `"${c.name}.sol",`, + 'initialOwner,', + `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, + 'opts', + ] + : [`"${c.name}.sol",`, 'initialOwner,', `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ].filter(line => line !== false); case 'uups': - return useUpgradePlugin - ? [ - `address proxy = Upgrades.deployUUPSProxy(`, - [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ] - : [ - `${c.name} implementation = new ${c.name}();`, - `address proxy = address(new ERC1967Proxy(`, - [`address(implementation),`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - '));', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ]; + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.deployUUPSProxy(`, + unsafeAllowConstructor + ? [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, 'opts'] + : [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ].filter(line => line !== false); default: return [`${c.name} instance = new ${c.name}(${args.join(', ')});`]; } diff --git a/packages/core/solidity/src/zip-hardhat.ts b/packages/core/solidity/src/zip-hardhat.ts index 8e283cee1..a6cdc71fe 100644 --- a/packages/core/solidity/src/zip-hardhat.ts +++ b/packages/core/solidity/src/zip-hardhat.ts @@ -125,8 +125,8 @@ function getDeploymentCall(c: Contract, args: string[]): string { return !c.upgradeable ? `ContractFactory.deploy(${args.join(', ')})` : useUpgradePlugin - ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` - : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })` + ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` + : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })`; } const script = (c: Contract) => { From e3038184cbf5ca9bc7658373846f794491ff6f02 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 18:50:16 +0200 Subject: [PATCH 11/17] address PR comment --- packages/core/solidity/src/zip-hardhat.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/solidity/src/zip-hardhat.ts b/packages/core/solidity/src/zip-hardhat.ts index a6cdc71fe..b85d36663 100644 --- a/packages/core/solidity/src/zip-hardhat.ts +++ b/packages/core/solidity/src/zip-hardhat.ts @@ -120,13 +120,13 @@ function getAddressArgs(c: Contract): string[] { function getDeploymentCall(c: Contract, args: string[]): string { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; return !c.upgradeable ? `ContractFactory.deploy(${args.join(', ')})` - : useUpgradePlugin - ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` - : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })`; + : unsafeAllowConstructor + ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })` + : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])`; } const script = (c: Contract) => { From d7e4f7bda62687283068cf8457c300cb8394107f Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Tue, 9 Sep 2025 14:58:14 -0400 Subject: [PATCH 12/17] Use contract.parents for non-upgradeable --- packages/core/solidity/src/print.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/solidity/src/print.ts b/packages/core/solidity/src/print.ts index e10eee6cc..bc6202d7d 100644 --- a/packages/core/solidity/src/print.ts +++ b/packages/core/solidity/src/print.ts @@ -84,7 +84,7 @@ function printConstructor(contract: Contract, helpers: Helpers): Lines[] { if (hasParentParams || hasConstructorCode || (helpers.upgradeable && parentsWithInitializers.length > 0)) { if (helpers.upgradeable) { const upgradeableParents = parentsWithInitializers.filter(p => inferTranspiled(p.contract)); - const nonUpgradeableParents = parentsWithInitializers.filter(p => !inferTranspiled(p.contract)); + const nonUpgradeableParents = contract.parents.filter(p => !inferTranspiled(p.contract)); const constructor = printFunction2( [ nonUpgradeableParents.length > 0 @@ -112,7 +112,7 @@ function printConstructor(contract: Contract, helpers: Helpers): Lines[] { [], 'constructor', contract.constructorArgs.map(a => printArgument(a, helpers)), - parentsWithInitializers.flatMap(p => printParentConstructor(p, helpers)), + contract.parents.flatMap(p => printParentConstructor(p, helpers)), contract.constructorCode, ); } From ba52fb73c0e39e0f40d1998293c05597dae5e1b3 Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Tue, 9 Sep 2025 15:18:57 -0400 Subject: [PATCH 13/17] Extract helper function for shouldUseUnsafeAllowConstructor --- packages/core/solidity/src/zip-foundry.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/core/solidity/src/zip-foundry.ts b/packages/core/solidity/src/zip-foundry.ts index 44a44bda5..05cda2f1a 100644 --- a/packages/core/solidity/src/zip-foundry.ts +++ b/packages/core/solidity/src/zip-foundry.ts @@ -11,14 +11,18 @@ function getHeader(c: Contract) { return [`// SPDX-License-Identifier: ${c.license}`, `pragma solidity ^${SOLIDITY_VERSION};`]; } +function shouldUseUnsafeAllowConstructor(c: Contract): boolean { + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + return c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; +} + const test = (c: Contract, opts?: GenericOptions) => { return formatLinesWithSpaces(2, ...spaceBetween(getHeader(c), getImports(c), getTestCase(c))); function getImports(c: Contract) { const result = ['import {Test} from "forge-std/Test.sol";']; if (c.upgradeable) { - // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); result.push( unsafeAllowConstructor @@ -44,8 +48,7 @@ const test = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); switch (opts?.upgradeable) { case 'transparent': @@ -137,8 +140,7 @@ const script = (c: Contract, opts?: GenericOptions) => { function getImports(c: Contract) { const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; if (c.upgradeable) { - // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); result.push( unsafeAllowConstructor @@ -170,8 +172,7 @@ const script = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); switch (opts?.upgradeable) { case 'transparent': From 9c122f35252189c708132bb87db2f8f8b4e110f7 Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Tue, 9 Sep 2025 16:07:31 -0400 Subject: [PATCH 14/17] Refactor zip-foundry to reduce duplication --- packages/core/solidity/src/zip-foundry.ts | 196 +++++++++------------- 1 file changed, 79 insertions(+), 117 deletions(-) diff --git a/packages/core/solidity/src/zip-foundry.ts b/packages/core/solidity/src/zip-foundry.ts index 05cda2f1a..c6cb7890f 100644 --- a/packages/core/solidity/src/zip-foundry.ts +++ b/packages/core/solidity/src/zip-foundry.ts @@ -6,6 +6,7 @@ import SOLIDITY_VERSION from './solidity-version.json'; import contracts from '../openzeppelin-contracts'; import type { Lines } from './utils/format-lines'; import { formatLinesWithSpaces, spaceBetween } from './utils/format-lines'; +import type { Upgradeable } from './set-upgradeable'; function getHeader(c: Contract) { return [`// SPDX-License-Identifier: ${c.license}`, `pragma solidity ^${SOLIDITY_VERSION};`]; @@ -16,23 +17,71 @@ function shouldUseUnsafeAllowConstructor(c: Contract): boolean { return c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; } -const test = (c: Contract, opts?: GenericOptions) => { - return formatLinesWithSpaces(2, ...spaceBetween(getHeader(c), getImports(c), getTestCase(c))); - - function getImports(c: Contract) { - const result = ['import {Test} from "forge-std/Test.sol";']; - if (c.upgradeable) { - const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); - - result.push( - unsafeAllowConstructor - ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' - : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', - ); +function getImports(c: Contract, prepopulateImports: string[]): string[] { + const result: string[] = [...prepopulateImports]; + if (c.upgradeable) { + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); + + result.push( + unsafeAllowConstructor + ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', + ); + } + result.push(`import {${c.name}} from "src/${c.name}.sol";`); + return result; +} + +function getDeploymentCode( + c: Contract, + args: string[], + declareContractVariable: boolean, + upgradeable?: Upgradeable, +): Lines[] { + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); + const instanceDeclaration = declareContractVariable ? `${c.name} ` : ''; + + switch (upgradeable) { + case 'transparent': + return printDeployProxyAndAssignInstance('deployTransparentProxy', true); + case 'uups': + return printDeployProxyAndAssignInstance('deployUUPSProxy', false); + default: + return [`${instanceDeclaration}instance = new ${c.name}(${args.join(', ')});`]; + } + + function printDeployProxyAndAssignInstance(deployProxyFunctionName: string, includeInitialOwner: boolean) { + const deployProxyArgs = [`"${c.name}.sol"`]; + if (includeInitialOwner) { + deployProxyArgs.push('initialOwner'); + } + deployProxyArgs.push(`abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`); + if (unsafeAllowConstructor) { + deployProxyArgs.push('opts'); } - result.push(`import {${c.name}} from "src/${c.name}.sol";`); - return result; + for (let i = 0; i < deployProxyArgs.length - 1; i++) { + deployProxyArgs[i] += ','; + } + + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.${deployProxyFunctionName}(`, + deployProxyArgs, + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${instanceDeclaration}instance = ${c.name}(payable(proxy));` + : `${instanceDeclaration}instance = ${c.name}(proxy);`, + ].filter(line => line !== false); } +} + +const test = (c: Contract, opts?: GenericOptions) => { + return formatLinesWithSpaces( + 2, + ...spaceBetween(getHeader(c), getImports(c, ['import {Test} from "forge-std/Test.sol";']), getTestCase(c)), + ); function getTestCase(c: Contract) { const args = getAddressArgs(c); @@ -40,55 +89,18 @@ const test = (c: Contract, opts?: GenericOptions) => { `contract ${c.name}Test is Test {`, spaceBetween( [`${c.name} public instance;`], - ['function setUp() public {', getAddressVariables(c, args), getDeploymentCode(c, args), '}'], + [ + 'function setUp() public {', + getAddressVariables(c, args), + getDeploymentCode(c, args, false, opts?.upgradeable), + '}', + ], getContractSpecificTestFunction(), ), '}', ]; } - function getDeploymentCode(c: Contract, args: string[]): Lines[] { - const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); - - switch (opts?.upgradeable) { - case 'transparent': - return [ - unsafeAllowConstructor && 'Options memory opts;', - unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', - `address proxy = Upgrades.deployTransparentProxy(`, - unsafeAllowConstructor - ? [ - `"${c.name}.sol",`, - 'initialOwner,', - `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, - 'opts', - ] - : [`"${c.name}.sol",`, 'initialOwner,', `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ].filter(line => line !== false); - case 'uups': - return [ - unsafeAllowConstructor && 'Options memory opts;', - unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', - `address proxy = Upgrades.deployUUPSProxy(`, - unsafeAllowConstructor - ? [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, 'opts'] - : [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ].filter(line => line !== false); - default: - return [`instance = new ${c.name}(${args.join(', ')});`]; - } - } - function getAddressVariables(c: Contract, args: string[]): Lines[] { const vars = []; let i = 1; // private key index starts from 1 since it must be non-zero @@ -135,29 +147,21 @@ function getAddressArgs(c: Contract): string[] { } const script = (c: Contract, opts?: GenericOptions) => { - return formatLinesWithSpaces(2, ...spaceBetween(getHeader(c), getImports(c), getScript(c))); - - function getImports(c: Contract) { - const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; - if (c.upgradeable) { - const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); - - result.push( - unsafeAllowConstructor - ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' - : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', - ); - } - result.push(`import {${c.name}} from "src/${c.name}.sol";`); - return result; - } + return formatLinesWithSpaces( + 2, + ...spaceBetween( + getHeader(c), + getImports(c, ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']), + getScript(c), + ), + ); function getScript(c: Contract) { const args = getAddressArgs(c); const deploymentLines = [ 'vm.startBroadcast();', ...getAddressVariables(c, args), - ...getDeploymentCode(c, args), + ...getDeploymentCode(c, args, true, opts?.upgradeable), `console.log("${c.upgradeable ? 'Proxy' : 'Contract'} deployed to %s", address(instance));`, 'vm.stopBroadcast();', ]; @@ -171,48 +175,6 @@ const script = (c: Contract, opts?: GenericOptions) => { ]; } - function getDeploymentCode(c: Contract, args: string[]): Lines[] { - const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); - - switch (opts?.upgradeable) { - case 'transparent': - return [ - unsafeAllowConstructor && 'Options memory opts;', - unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', - `address proxy = Upgrades.deployTransparentProxy(`, - unsafeAllowConstructor - ? [ - `"${c.name}.sol",`, - 'initialOwner,', - `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, - 'opts', - ] - : [`"${c.name}.sol",`, 'initialOwner,', `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ].filter(line => line !== false); - case 'uups': - return [ - unsafeAllowConstructor && 'Options memory opts;', - unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', - `address proxy = Upgrades.deployUUPSProxy(`, - unsafeAllowConstructor - ? [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, 'opts'] - : [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ].filter(line => line !== false); - default: - return [`${c.name} instance = new ${c.name}(${args.join(', ')});`]; - } - } - function getAddressVariables(c: Contract, args: string[]): Lines[] { const vars = []; if (c.upgradeable && opts?.upgradeable === 'transparent' && !args.includes('initialOwner')) { From 4c9b0cdcb5d44335f596799930ea28ff2d1f77c4 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 11 Sep 2025 10:33:03 +0200 Subject: [PATCH 15/17] rename create -> deploy --- packages/core/solidity/src/account.test.ts.md | 118 +++++++++--------- .../core/solidity/src/account.test.ts.snap | Bin 18845 -> 18853 bytes packages/core/solidity/src/account.ts | 2 +- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index 955ac85af..51d46f145 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -1309,7 +1309,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + function deploy(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -1444,7 +1444,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + function deploy(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -1587,7 +1587,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + function deploy(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -1732,7 +1732,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + function deploy(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -3119,7 +3119,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSAFactory {␊ CustomAccountWithSignerECDSA public immutable implementation = new CustomAccountWithSignerECDSA();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -3211,7 +3211,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSAERC1271Factory {␊ CustomAccountWithSignerECDSAERC1271 public immutable implementation = new CustomAccountWithSignerECDSAERC1271();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -3287,7 +3287,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSAERC7739Factory {␊ CustomAccountWithSignerECDSAERC7739 public immutable implementation = new CustomAccountWithSignerECDSAERC7739();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -3365,7 +3365,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSAERC721HolderFactory {␊ CustomAccountWithSignerECDSAERC721Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721Holder();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -3443,7 +3443,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSAERC1155HolderFactory {␊ CustomAccountWithSignerECDSAERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC1155Holder();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -3527,7 +3527,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerECDSAERC721HolderERC1155HolderFactory {␊ CustomAccountWithSignerECDSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721HolderERC1155Holder();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -3623,7 +3623,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -3777,7 +3777,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -3923,7 +3923,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -4077,7 +4077,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -4233,7 +4233,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(address signer, bytes32 salt) public returns (address) {␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -5256,7 +5256,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256Factory {␊ CustomAccountWithSignerP256 public immutable implementation = new CustomAccountWithSignerP256();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -5348,7 +5348,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256ERC1271Factory {␊ CustomAccountWithSignerP256ERC1271 public immutable implementation = new CustomAccountWithSignerP256ERC1271();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -5424,7 +5424,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256ERC7739Factory {␊ CustomAccountWithSignerP256ERC7739 public immutable implementation = new CustomAccountWithSignerP256ERC7739();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -5502,7 +5502,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256ERC721HolderFactory {␊ CustomAccountWithSignerP256ERC721Holder public immutable implementation = new CustomAccountWithSignerP256ERC721Holder();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -5580,7 +5580,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256ERC1155HolderFactory {␊ CustomAccountWithSignerP256ERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC1155Holder();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -5664,7 +5664,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerP256ERC721HolderERC1155HolderFactory {␊ CustomAccountWithSignerP256ERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC721HolderERC1155Holder();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -5760,7 +5760,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -5914,7 +5914,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -6060,7 +6060,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -6214,7 +6214,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -6370,7 +6370,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(qx, qy, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ @@ -7393,7 +7393,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSAFactory {␊ CustomAccountWithSignerRSA public immutable implementation = new CustomAccountWithSignerRSA();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -7494,7 +7494,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSAERC1271Factory {␊ CustomAccountWithSignerRSAERC1271 public immutable implementation = new CustomAccountWithSignerRSAERC1271();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -7579,7 +7579,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSAERC7739Factory {␊ CustomAccountWithSignerRSAERC7739 public immutable implementation = new CustomAccountWithSignerRSAERC7739();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -7666,7 +7666,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSAERC721HolderFactory {␊ CustomAccountWithSignerRSAERC721Holder public immutable implementation = new CustomAccountWithSignerRSAERC721Holder();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -7753,7 +7753,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSAERC1155HolderFactory {␊ CustomAccountWithSignerRSAERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC1155Holder();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -7846,7 +7846,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerRSAERC721HolderERC1155HolderFactory {␊ CustomAccountWithSignerRSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC721HolderERC1155Holder();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -7951,7 +7951,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -8114,7 +8114,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -8269,7 +8269,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -8432,7 +8432,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -8597,7 +8597,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -9960,7 +9960,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigFactory {␊ CustomAccountWithSignerMultisig public immutable implementation = new CustomAccountWithSignerMultisig();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -10091,7 +10091,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigERC1271Factory {␊ CustomAccountWithSignerMultisigERC1271 public immutable implementation = new CustomAccountWithSignerMultisigERC1271();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -10206,7 +10206,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigERC7739Factory {␊ CustomAccountWithSignerMultisigERC7739 public immutable implementation = new CustomAccountWithSignerMultisigERC7739();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -10323,7 +10323,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigERC721HolderFactory {␊ CustomAccountWithSignerMultisigERC721Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721Holder();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -10440,7 +10440,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigERC1155HolderFactory {␊ CustomAccountWithSignerMultisigERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC1155Holder();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -10563,7 +10563,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigERC721HolderERC1155HolderFactory {␊ CustomAccountWithSignerMultisigERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721HolderERC1155Holder();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -10698,7 +10698,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -10891,7 +10891,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -11076,7 +11076,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -11269,7 +11269,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -11464,7 +11464,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -13009,7 +13009,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigWeightedFactory {␊ CustomAccountWithSignerMultisigWeighted public immutable implementation = new CustomAccountWithSignerMultisigWeighted();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -13154,7 +13154,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigWeightedERC1271Factory {␊ CustomAccountWithSignerMultisigWeightedERC1271 public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC1271();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -13287,7 +13287,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigWeightedERC7739Factory {␊ CustomAccountWithSignerMultisigWeightedERC7739 public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC7739();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -13422,7 +13422,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigWeightedERC721HolderFactory {␊ CustomAccountWithSignerMultisigWeightedERC721Holder public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC721Holder();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -13557,7 +13557,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigWeightedERC1155HolderFactory {␊ CustomAccountWithSignerMultisigWeightedERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC1155Holder();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -13694,7 +13694,7 @@ Generated by [AVA](https://avajs.dev). contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155HolderFactory {␊ CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -13843,7 +13843,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -14052,7 +14052,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -14253,7 +14253,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -14462,7 +14462,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ @@ -14673,7 +14673,7 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function create(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index 31b2e9bfa152a515b766ed2ee984eeb7d25c3d01..5b9da4d3291943731754860054f9e5362aa00e88 100644 GIT binary patch delta 16374 zcmZ|WWl&t(wl-kg9fCFv!QCB#LlWFQ1b0br77&~Sx8UyX?(XjH?yeu%d!KX9xwpQ4 zs=8-Dy<^O=lB2-0qrh23R7FUXtPN}(Ol=%VzOx}fg4L{XjoapBGt-`Hw(BPp z7PXn3ikAYq^!#iEsA;)ITji|02ml|+qv)YNtK-j=noQK?rDo!mGX1$NL`1Ik`xJ?q z+WpW*NzUu^!eTQm$FJbN3=g%fUC4bz?VTSg<*GOs%0eGG@o+tE5$uARP2&AG@t?2T z()&OmPm4$N7nd?i17~Pmt)FUbkfofYh8j;$mfd%GgJ82?p)mI+0lP`uQ{ZK30M2A$ zzvpLKG_w9{Q{1CcS<-yjxE$ND#F@QTd5O<&xr=#O`d0qia;^?#T}gxyXH1utxXTaU zrCUo+Z&Xus$4+r|zD!VRUEql$ST!k!WUltoRM{xih>G%IB|yLvAKN|1M8CICu!i3n zR=76hDiU1`B;)V6NE?(Q-ok&`@rP*d zMIvT%A39?x+%g=o=KFo3rhKIR0zow_2)oO=fGtALxdWVh_V`5I0*?kE(ib?PdnGM^X8ztJ)Ub-UI>V=a7Ev3_!f*ky}Q1@}4$3k^(o zpVB4j2Bv2OGA$uOBgPHNVwbLlIUL@mQa5@Q%Dz~29t2+t3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6TI5*X~SBJ2`M*@V~$5dR

G@s-dZQj{HTuS7s}cV{`$vf61C0~FYPtXVU;9T^ z=LO#&M0ay}&&%^gjWlNU9GlYhkidR)x+;a}J%#!!U9Ftt^c!5tYu9)jC-+bf;JluH zZRQ-;_cTKQFIJrXXi|3gkpHm`f2^k7`R?!ous{Aodmam_k9_^}fcQaC?Py0S$iyn&nm88@XMK~-1(1`v&CIVC?e!>~4qtphbU?v)=kF?(OfUTGtA_`Q9ryCtb=tQ_ign3m9X8KE^JtR z6I$Qci;-^H1%}GiT~rit8EkeUB5&e%=F|gVEja%Jz-jR$aAnQWL>UXTz!Ix1!Wg?W zvLxJyHa+FJG^8`v8+^Em{t+Np`SQy5>aIa=?QUZpyZh(-FBFwv0L%MBsVho>y5MTC ziWB;yJ?^*&7yK4oa4pKe7PFglHVi|*e$2r+2)m5wbM+Pfo*-?3vch|(Aj|Yh5`Bi05LBdGXMYp diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index dca2a84dd..9cd82bad5 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -317,7 +317,7 @@ export function buildFactory(account: Contract, opts: AccountOptions): Contract `}`, `return instance;`, ]).split('\n'), - { name: 'create', kind: 'public' as const, args, returns: ['address'] }, + { name: 'deploy', kind: 'public' as const, args, returns: ['address'] }, ); // Functions - predict From bbf0c3f82d18a9ee0b3890a61c416d7a6e86150c Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 11 Sep 2025 11:23:35 +0200 Subject: [PATCH 16/17] support uups --- packages/core/solidity/src/account.test.ts | 2 +- packages/core/solidity/src/account.test.ts.md | 14158 +++++++++++----- .../core/solidity/src/account.test.ts.snap | Bin 18853 -> 25977 bytes packages/core/solidity/src/account.ts | 127 +- 4 files changed, 9960 insertions(+), 4327 deletions(-) diff --git a/packages/core/solidity/src/account.test.ts b/packages/core/solidity/src/account.test.ts index 45948e093..a5d0dac27 100644 --- a/packages/core/solidity/src/account.test.ts +++ b/packages/core/solidity/src/account.test.ts @@ -48,7 +48,7 @@ function testAccount(title: string, opts: Partial) { testAPIEquivalence(`${title} - API equivalence`, { ...fullOpts, factory: false }); if ( - fullOpts.upgradeable == 'transparent' && + (fullOpts.upgradeable == 'transparent' || fullOpts.upgradeable == 'uups') && (fullOpts.signer || fullOpts.ERC7579Modules) && fullOpts.signer !== 'ERC7702' ) { diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index 51d46f145..c49946130 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -225,6 +225,8 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Account, EIP712, ERC7739, AccountERC7579 {␊ @@ -270,6 +272,8 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Account, IERC1271, AccountERC7579 {␊ @@ -311,6 +315,8 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Account, EIP712, ERC7739, AccountERC7579 {␊ @@ -358,6 +364,8 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked {␊ @@ -721,6 +729,8 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ @@ -771,6 +781,106 @@ Generated by [AVA](https://avajs.dev). }␊ ` +## Account with ERC7579 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(uint256 moduleTypeId, address module, bytes calldata initData)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __UUPSUpgradeable_init();␊ + ␊ + require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ + _installModule(moduleTypeId, module, initData);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (moduleTypeId, module, initData));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (moduleTypeId, module, initData)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + ## Account with ERC7579 with ERC1271 upgradeable uups > Snapshot 1 @@ -783,6 +893,8 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ @@ -830,7 +942,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with ERC7579 with ERC7739 upgradeable uups +## Account with ERC7579 with ERC1271 upgradeable uups with factory > Snapshot 1 @@ -840,15 +952,18 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ @@ -862,18 +977,6 @@ Generated by [AVA](https://avajs.dev). require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -890,10 +993,52 @@ Generated by [AVA](https://avajs.dev). {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (moduleTypeId, module, initData));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (moduleTypeId, module, initData)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ }␊ ` -## Account with ERC7579 hooks upgradeable uups +## Account with ERC7579 with ERC7739 upgradeable uups > Snapshot 1 @@ -903,14 +1048,15 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ @@ -920,7 +1066,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ - __AccountERC7579Hooked_init();␊ + __AccountERC7579_init();␊ __UUPSUpgradeable_init();␊ ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ @@ -957,7 +1103,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account named upgradeable transparent +## Account with ERC7579 with ERC7739 upgradeable uups with factory > Snapshot 1 @@ -966,68 +1112,98 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccount is Initializable, Account, EIP712, ERC7739 {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ + function initialize(uint256 moduleTypeId, address module, bytes calldata initData)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __UUPSUpgradeable_init();␊ + ␊ + require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ + _installModule(moduleTypeId, module, initData);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ override␊ - returns (bool)␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ {␊ - // Custom validation logic␊ - return false;␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ }␊ - ` - -## Account with ERC1271 upgradeable transparent - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ - contract CustomAccountERC1271 is Initializable, Account, IERC1271 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ + function deploy(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (moduleTypeId, module, initData));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function predict(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ public␊ view␊ - override␊ - returns (bytes4)␊ + returns (address)␊ {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (moduleTypeId, module, initData)));␊ }␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ view␊ - override␊ - returns (bool)␊ + returns (address)␊ {␊ - // Custom validation logic␊ - return false;␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with ERC7739 upgradeable transparent +## Account with ERC7579 hooks upgradeable uups > Snapshot 1 @@ -1036,23 +1212,260 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountERC7739 is Initializable, Account, EIP712, ERC7739 {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccountERC7739", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ + function initialize(uint256 moduleTypeId, address module, bytes calldata initData)␊ + public␊ + initializer␊ {␊ - // Custom validation logic␊ + __AccountERC7579Hooked_init();␊ + __UUPSUpgradeable_init();␊ + ␊ + require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ + _installModule(moduleTypeId, module, initData);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + }␊ + ` + +## Account with ERC7579 hooks upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(uint256 moduleTypeId, address module, bytes calldata initData)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __UUPSUpgradeable_init();␊ + ␊ + require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ + _installModule(moduleTypeId, module, initData);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (moduleTypeId, module, initData));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (moduleTypeId, module, initData)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account named upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + ␊ + contract CustomAccount is Initializable, Account, EIP712, ERC7739 {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + // Custom validation logic␊ + return false;␊ + }␊ + }␊ + ` + +## Account with ERC1271 upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + ␊ + contract CustomAccountERC1271 is Initializable, Account, IERC1271 {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + 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;␊ + }␊ + }␊ + ` + +## Account with ERC7739 upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + ␊ + contract CustomAccountERC7739 is Initializable, Account, EIP712, ERC7739 {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccountERC7739", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + // Custom validation logic␊ return false;␊ }␊ }␊ @@ -1209,6 +1622,8 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable {␊ @@ -1264,6 +1679,8 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ @@ -1325,6 +1742,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(moduleTypeId, module, initData, salt));␊ @@ -1332,6 +1750,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(moduleTypeId, module, initData, salt));␊ @@ -1351,6 +1770,8 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable {␊ @@ -1402,6 +1823,8 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ @@ -1460,6 +1883,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(moduleTypeId, module, initData, salt));␊ @@ -1467,6 +1891,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(moduleTypeId, module, initData, salt));␊ @@ -1487,6 +1912,8 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable {␊ @@ -1542,6 +1969,8 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ @@ -1603,6 +2032,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(moduleTypeId, module, initData, salt));␊ @@ -1610,6 +2040,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(moduleTypeId, module, initData, salt));␊ @@ -1631,6 +2062,8 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable {␊ @@ -1687,6 +2120,8 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MODULE_TYPE_EXECUTOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ + import {MODULE_TYPE_VALIDATOR} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ @@ -1748,6 +2183,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(moduleTypeId, module, initData, salt));␊ @@ -1755,6 +2191,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(uint256 moduleTypeId, address module, bytes calldata initData, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(moduleTypeId, module, initData, salt));␊ @@ -2547,7 +2984,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerECDSA with ERC1271 upgradeable uups +## Account with SignerECDSA named upgradeable uups with factory > Snapshot 1 @@ -2556,14 +2993,17 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSAUpgradeable, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSA is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("CustomAccount with SignerECDSA", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -2571,15 +3011,6 @@ Generated by [AVA](https://avajs.dev). __SignerECDSA_init(signer);␊ __UUPSUpgradeable_init();␊ }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override␊ - returns (bytes4)␊ - {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2587,26 +3018,51 @@ Generated by [AVA](https://avajs.dev). onlyEntryPointOrSelf␊ {}␊ }␊ - ` - -## Account with SignerECDSA with ERC7739 upgradeable uups - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + contract CustomAccountWithSignerECDSAFactory {␊ + CustomAccountWithSignerECDSA public immutable implementation = new CustomAccountWithSignerECDSA();␊ + ␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerECDSA.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerECDSA.initialize, (signer)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerECDSA with ERC1271 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSAERC7739", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ @@ -2614,6 +3070,15 @@ Generated by [AVA](https://avajs.dev). __SignerECDSA_init(signer);␊ __UUPSUpgradeable_init();␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2623,7 +3088,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerECDSA with ERC721Holder upgradeable uups +## Account with SignerECDSA with ERC1271 upgradeable uups with factory > Snapshot 1 @@ -2632,16 +3097,16 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSAERC721Holder", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ @@ -2649,6 +3114,15 @@ Generated by [AVA](https://avajs.dev). __SignerECDSA_init(signer);␊ __UUPSUpgradeable_init();␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2656,9 +3130,35 @@ Generated by [AVA](https://avajs.dev). onlyEntryPointOrSelf␊ {}␊ }␊ + ␊ + contract CustomAccountWithSignerECDSAERC1271Factory {␊ + CustomAccountWithSignerECDSAERC1271 public immutable implementation = new CustomAccountWithSignerECDSAERC1271();␊ + ␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerECDSAERC1271.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerECDSAERC1271.initialize, (signer)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ ` -## Account with SignerECDSA with ERC1155Holder upgradeable uups +## Account with SignerECDSA with ERC7739 upgradeable uups > Snapshot 1 @@ -2668,15 +3168,14 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC1155Holder, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSAERC1155Holder", "1") {␊ + constructor() EIP712("CustomAccount with SignerECDSAERC7739", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -2693,7 +3192,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerECDSA with ERC721Holder and ERC1155Holder upgradeable uups +## Account with SignerECDSA with ERC7739 upgradeable uups with factory > Snapshot 1 @@ -2703,18 +3202,16 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ - {␊ + constructor() EIP712("CustomAccount with SignerECDSAERC7739", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -2729,9 +3226,35 @@ Generated by [AVA](https://avajs.dev). onlyEntryPointOrSelf␊ {}␊ }␊ + ␊ + contract CustomAccountWithSignerECDSAERC7739Factory {␊ + CustomAccountWithSignerECDSAERC7739 public immutable implementation = new CustomAccountWithSignerECDSAERC7739();␊ + ␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerECDSAERC7739.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerECDSAERC7739.initialize, (signer)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ ` -## Account with SignerECDSA with ERC7821 Execution upgradeable uups +## Account with SignerECDSA with ERC721Holder upgradeable uups > Snapshot 1 @@ -2741,15 +3264,15 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC7821, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerECDSAERC721Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -2757,15 +3280,6 @@ Generated by [AVA](https://avajs.dev). __SignerECDSA_init(signer);␊ __UUPSUpgradeable_init();␊ }␊ - ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2775,7 +3289,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerECDSA with ERC7579 upgradeable uups +## Account with SignerECDSA with ERC721Holder upgradeable uups with factory > Snapshot 1 @@ -2783,72 +3297,62 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerECDSAERC721Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ __UUPSUpgradeable_init();␊ }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ override␊ onlyEntryPointOrSelf␊ {}␊ + }␊ ␊ - // The following functions are overrides required by Solidity.␊ + contract CustomAccountWithSignerECDSAERC721HolderFactory {␊ + CustomAccountWithSignerECDSAERC721Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721Holder();␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerECDSAERC721Holder.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerECDSAERC721Holder.initialize, (signer)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ + returns (address)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7579 with ERC1271 upgradeable uups +## Account with SignerECDSA with ERC1155Holder upgradeable uups > Snapshot 1 @@ -2856,23 +3360,21 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC1155Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("CustomAccount with SignerECDSAERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ __UUPSUpgradeable_init();␊ }␊ @@ -2882,42 +3384,10 @@ Generated by [AVA](https://avajs.dev). override␊ onlyEntryPointOrSelf␊ {}␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ - {␊ - return super.isValidSignature(hash, signature);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ }␊ ` -## Account with SignerECDSA with ERC7579 with ERC7739 upgradeable uups +## Account with SignerECDSA with ERC1155Holder upgradeable uups with factory > Snapshot 1 @@ -2925,72 +3395,62 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC1155Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerECDSAERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ __UUPSUpgradeable_init();␊ }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ override␊ onlyEntryPointOrSelf␊ {}␊ + }␊ ␊ - // The following functions are overrides required by Solidity.␊ + contract CustomAccountWithSignerECDSAERC1155HolderFactory {␊ + CustomAccountWithSignerECDSAERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC1155Holder();␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerECDSAERC1155Holder.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerECDSAERC1155Holder.initialize, (signer)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ + returns (address)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7579 hooks upgradeable uups +## Account with SignerECDSA with ERC721Holder and ERC1155Holder upgradeable uups > Snapshot 1 @@ -2998,73 +3458,37 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor()␊ + EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ + {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579Hooked_init();␊ __SignerECDSA_init(signer);␊ __UUPSUpgradeable_init();␊ }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ override␊ onlyEntryPointOrSelf␊ {}␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ }␊ ` -## Account with SignerECDSA named upgradeable transparent +## Account with SignerECDSA with ERC721Holder and ERC1155Holder upgradeable uups with factory > Snapshot 1 @@ -3074,73 +3498,63 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerECDSA is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSA", "1") {␊ + constructor()␊ + EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ + {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ - }␊ - }␊ - ` - -## Account with SignerECDSA named upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ - ␊ - contract CustomAccountWithSignerECDSA is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSA", "1") {␊ - _disableInitializers();␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ - contract CustomAccountWithSignerECDSAFactory {␊ - CustomAccountWithSignerECDSA public immutable implementation = new CustomAccountWithSignerECDSA();␊ + contract CustomAccountWithSignerECDSAERC721HolderERC1155HolderFactory {␊ + CustomAccountWithSignerECDSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721HolderERC1155Holder();␊ ␊ function deploy(address signer, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(signer, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerECDSAERC721HolderERC1155Holder.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerECDSA(instance).initialize(signer);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerECDSAERC721HolderERC1155Holder.initialize, (signer)));␊ }␊ ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(signer, salt));␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC1271 upgradeable transparent +## Account with SignerECDSA with ERC7821 Execution upgradeable uups > Snapshot 1 @@ -3149,32 +3563,42 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC7821, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ view␊ override␊ - returns (bytes4)␊ + returns (bool)␊ {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerECDSA with ERC1271 upgradeable transparent with factory +## Account with SignerECDSA with ERC7821 Execution upgradeable uups with factory > Snapshot 1 @@ -3183,56 +3607,70 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC7821, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ view␊ override␊ - returns (bytes4)␊ + returns (bool)␊ {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ - contract CustomAccountWithSignerECDSAERC1271Factory {␊ - CustomAccountWithSignerECDSAERC1271 public immutable implementation = new CustomAccountWithSignerECDSAERC1271();␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ function deploy(address signer, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(signer, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerECDSAERC1271(instance).initialize(signer);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signer)));␊ }␊ ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(signer, salt));␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7739 upgradeable transparent +## Account with SignerECDSA with ERC7579 upgradeable uups > Snapshot 1 @@ -3240,25 +3678,72 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSAERC7739", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7739 upgradeable transparent with factory +## Account with SignerECDSA with ERC7579 upgradeable uups with factory > Snapshot 1 @@ -3266,49 +3751,100 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSAERC7739", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ - }␊ ␊ - contract CustomAccountWithSignerECDSAERC7739Factory {␊ - CustomAccountWithSignerECDSAERC7739 public immutable implementation = new CustomAccountWithSignerECDSAERC7739();␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ function deploy(address signer, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(signer, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerECDSAERC7739(instance).initialize(signer);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signer)));␊ }␊ ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(signer, salt));␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC721Holder upgradeable transparent +## Account with SignerECDSA with ERC7579 with ERC1271 upgradeable uups > Snapshot 1 @@ -3316,26 +3852,68 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSAERC721Holder", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ` -## Account with SignerECDSA with ERC721Holder upgradeable transparent with factory +## Account with SignerECDSA with ERC7579 with ERC1271 upgradeable uups with factory > Snapshot 1 @@ -3343,50 +3921,96 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSAERC721Holder", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ␊ - contract CustomAccountWithSignerECDSAERC721HolderFactory {␊ - CustomAccountWithSignerECDSAERC721Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721Holder();␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ function deploy(address signer, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(signer, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerECDSAERC721Holder(instance).initialize(signer);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signer)));␊ }␊ ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(signer, salt));␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC1155Holder upgradeable transparent +## Account with SignerECDSA with ERC7579 with ERC7739 upgradeable uups > Snapshot 1 @@ -3394,26 +4018,72 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC1155Holder {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSAERC1155Holder", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ` -## Account with SignerECDSA with ERC1155Holder upgradeable transparent with factory +## Account with SignerECDSA with ERC7579 with ERC7739 upgradeable uups with factory > Snapshot 1 @@ -3421,202 +4091,69 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC1155Holder {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerECDSAERC1155Holder", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ - }␊ - ␊ - contract CustomAccountWithSignerECDSAERC1155HolderFactory {␊ - CustomAccountWithSignerECDSAERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC1155Holder();␊ ␊ - function deploy(address signer, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(signer, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerECDSAERC1155Holder(instance).initialize(signer);␊ - }␊ - return instance;␊ - ␊ - }␊ - ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ - }␊ - ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(signer, salt));␊ - }␊ - }␊ - ` - -## Account with SignerECDSA with ERC721Holder and ERC1155Holder upgradeable transparent - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - ␊ - contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ - {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ - }␊ - ` - -## Account with SignerECDSA with ERC721Holder and ERC1155Holder upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ - ␊ - contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, ERC7739)␊ + returns (bytes4)␊ {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ - }␊ - ␊ - contract CustomAccountWithSignerECDSAERC721HolderERC1155HolderFactory {␊ - CustomAccountWithSignerECDSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721HolderERC1155Holder();␊ - ␊ - function deploy(address signer, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(signer, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerECDSAERC721HolderERC1155Holder(instance).initialize(signer);␊ - }␊ - return instance;␊ - ␊ - }␊ - ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ - }␊ - ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(signer, salt));␊ - }␊ - }␊ - ` - -## Account with SignerECDSA with ERC7821 Execution upgradeable transparent - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ + // 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - view␊ override␊ - returns (bool)␊ - {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ - }␊ - }␊ - ` - -## Account with SignerECDSA with ERC7821 Execution upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ + // The following functions are overrides required by Solidity.␊ ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ␊ @@ -3624,27 +4161,30 @@ Generated by [AVA](https://avajs.dev). MyAccount public immutable implementation = new MyAccount();␊ ␊ function deploy(address signer, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(signer, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signer);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signer)));␊ }␊ ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(signer, salt));␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7579 upgradeable transparent +## Account with SignerECDSA with ERC7579 hooks upgradeable uups > Snapshot 1 @@ -3655,21 +4195,24 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579_init();␊ + __AccountERC7579Hooked_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -3683,6 +4226,12 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3709,7 +4258,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerECDSA with ERC7579 upgradeable transparent with factory +## Account with SignerECDSA with ERC7579 hooks upgradeable uups with factory > Snapshot 1 @@ -3720,22 +4269,26 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerECDSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579_init();␊ + __AccountERC7579Hooked_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -3749,6 +4302,12 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3778,27 +4337,30 @@ Generated by [AVA](https://avajs.dev). MyAccount public immutable implementation = new MyAccount();␊ ␊ function deploy(address signer, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(signer, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signer));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signer);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signer)));␊ }␊ ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(signer, salt));␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7579 with ERC1271 upgradeable transparent +## Account with SignerECDSA named upgradeable transparent > Snapshot 1 @@ -3806,145 +4368,75 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ + contract CustomAccountWithSignerECDSA is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("CustomAccount with SignerECDSA", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ }␊ + }␊ + ` + +## Account with SignerECDSA named upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ ␊ - // The following functions are overrides required by Solidity.␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ - {␊ - return super.isValidSignature(hash, signature);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ - }␊ - ` - -## Account with SignerECDSA with ERC7579 with ERC1271 upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ - ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ + contract CustomAccountWithSignerECDSA is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("CustomAccount with SignerECDSA", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ - {␊ - return super.isValidSignature(hash, signature);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ }␊ ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ + contract CustomAccountWithSignerECDSAFactory {␊ + CustomAccountWithSignerECDSA public immutable implementation = new CustomAccountWithSignerECDSA();␊ ␊ function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signer);␊ + CustomAccountWithSignerECDSA(instance).initialize(signer);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ }␊ ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ return keccak256(abi.encode(signer, salt));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7579 with ERC7739 upgradeable transparent +## Account with SignerECDSA with ERC1271 upgradeable transparent > Snapshot 1 @@ -3952,64 +4444,33 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ + override␊ 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7579 with ERC7739 upgradeable transparent with factory +## Account with SignerECDSA with ERC1271 upgradeable transparent with factory > Snapshot 1 @@ -4017,88 +4478,57 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ + override␊ 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ }␊ ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ + contract CustomAccountWithSignerECDSAERC1271Factory {␊ + CustomAccountWithSignerECDSAERC1271 public immutable implementation = new CustomAccountWithSignerECDSAERC1271();␊ ␊ function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signer);␊ + CustomAccountWithSignerECDSAERC1271(instance).initialize(signer);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ }␊ ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ return keccak256(abi.encode(signer, salt));␊ }␊ }␊ ` -## Account with SignerECDSA with ERC7579 hooks upgradeable transparent +## Account with SignerECDSA with ERC7739 upgradeable transparent > Snapshot 1 @@ -4106,65 +4536,25 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerECDSAUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerECDSAERC7739", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579Hooked_init();␊ __SignerECDSA_init(signer);␊ }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ }␊ ` -## Account with SignerECDSA with ERC7579 hooks upgradeable transparent with factory +## Account with SignerECDSA with ERC7739 upgradeable transparent with factory > Snapshot 1 @@ -4172,89 +4562,49 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerECDSAUpgradeable {␊ + contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerECDSAERC7739", "1") {␊ _disableInitializers();␊ }␊ ␊ function initialize(address signer) public initializer {␊ - __AccountERC7579Hooked_init();␊ __SignerECDSA_init(signer);␊ }␊ + }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ - }␊ - ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ + contract CustomAccountWithSignerECDSAERC7739Factory {␊ + CustomAccountWithSignerECDSAERC7739 public immutable implementation = new CustomAccountWithSignerECDSAERC7739();␊ ␊ function deploy(address signer, bytes32 salt) public returns (address) {␊ bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signer);␊ + CustomAccountWithSignerECDSAERC7739(instance).initialize(signer);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(address signer, bytes32 salt) public returns (address) {␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ }␊ ␊ - function _salt(address signer, bytes32 salt) internal returns (bytes32) {␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ return keccak256(abi.encode(signer, salt));␊ }␊ }␊ ` -## Account with SignerP256 named non-upgradeable +## Account with SignerECDSA with ERC721Holder upgradeable transparent > Snapshot 1 @@ -4264,18 +4614,24 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerP256 is Account, EIP712, ERC7739, SignerP256 {␊ - constructor(bytes32 qx, bytes32 qy)␊ - EIP712("CustomAccount with SignerP256", "1")␊ - SignerP256(qx, qy)␊ - {}␊ + contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerECDSAERC721Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + }␊ }␊ ` -## Account with SignerP256 with ERC1271 non-upgradeable +## Account with SignerECDSA with ERC721Holder upgradeable transparent with factory > Snapshot 1 @@ -4284,24 +4640,49 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC1271 is Account, IERC1271, SignerP256 {␊ - constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {}␊ + contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerECDSAERC721Holder", "1") {␊ + _disableInitializers();␊ + }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override␊ - returns (bytes4)␊ - {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerECDSAERC721HolderFactory {␊ + CustomAccountWithSignerECDSAERC721Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721Holder();␊ + ␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerECDSAERC721Holder(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC7739 non-upgradeable +## Account with SignerECDSA with ERC1155Holder upgradeable transparent > Snapshot 1 @@ -4311,18 +4692,24 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC7739 is Account, EIP712, ERC7739, SignerP256 {␊ - constructor(bytes32 qx, bytes32 qy)␊ - EIP712("CustomAccount with SignerP256ERC7739", "1")␊ - SignerP256(qx, qy)␊ - {}␊ + contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerECDSAERC1155Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + }␊ }␊ ` -## Account with SignerP256 with ERC721Holder non-upgradeable +## Account with SignerECDSA with ERC1155Holder upgradeable transparent with factory > Snapshot 1 @@ -4332,19 +4719,48 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721Holder is Account, EIP712, ERC7739, SignerP256, ERC721Holder {␊ - constructor(bytes32 qx, bytes32 qy)␊ - EIP712("CustomAccount with SignerP256ERC721Holder", "1")␊ - SignerP256(qx, qy)␊ - {}␊ + contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerECDSAERC1155Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerECDSAERC1155HolderFactory {␊ + CustomAccountWithSignerECDSAERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC1155Holder();␊ + ␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerECDSAERC1155Holder(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ }␊ ` -## Account with SignerP256 with ERC1155Holder non-upgradeable +## Account with SignerECDSA with ERC721Holder and ERC1155Holder upgradeable transparent > Snapshot 1 @@ -4355,18 +4771,26 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC1155Holder is Account, EIP712, ERC7739, SignerP256, ERC1155Holder {␊ - constructor(bytes32 qx, bytes32 qy)␊ - EIP712("CustomAccount with SignerP256ERC1155Holder", "1")␊ - SignerP256(qx, qy)␊ - {}␊ + contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + }␊ }␊ ` -## Account with SignerP256 with ERC721Holder and ERC1155Holder non-upgradeable +## Account with SignerECDSA with ERC721Holder and ERC1155Holder upgradeable transparent with factory > Snapshot 1 @@ -4379,17 +4803,48 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerP256, ERC721Holder, ERC1155Holder {␊ - constructor(bytes32 qx, bytes32 qy)␊ - EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ - SignerP256(qx, qy)␊ - {}␊ + contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerECDSAERC721HolderERC1155HolderFactory {␊ + CustomAccountWithSignerECDSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerECDSAERC721HolderERC1155Holder();␊ + ␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerECDSAERC721HolderERC1155Holder(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ }␊ ` -## Account with SignerP256 with ERC7821 Execution non-upgradeable +## Account with SignerECDSA with ERC7821 Execution upgradeable transparent > Snapshot 1 @@ -4401,13 +4856,18 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, SignerP256, ERC7821 {␊ - constructor(bytes32 qx, bytes32 qy)␊ - EIP712("MyAccount", "1")␊ - SignerP256(qx, qy)␊ - {}␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC7821 {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -4420,7 +4880,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerP256 with ERC7579 non-upgradeable +## Account with SignerECDSA with ERC7821 Execution upgradeable transparent with factory > Snapshot 1 @@ -4428,110 +4888,59 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ - constructor(bytes32 qx, bytes32 qy)␊ - EIP712("MyAccount", "1")␊ - SignerP256(qx, qy)␊ - {}␊ - ␊ - 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;␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC7821 {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ }␊ ␊ - // 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 initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ }␊ ␊ - // 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)␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ view␊ - override(SignerP256, AbstractSigner, AccountERC7579)␊ + override␊ returns (bool)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ - ` - -## Account with SignerP256 with ERC7579 with ERC1271 non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Account, IERC1271, AccountERC7579, SignerP256 {␊ - constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {}␊ - ␊ - // The following functions are overrides required by Solidity.␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579)␊ - returns (bytes4)␊ - {␊ - return super.isValidSignature(hash, signature);␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ }␊ ␊ - // 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);␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC7579 with ERC7739 non-upgradeable +## Account with SignerECDSA with ERC7579 upgradeable transparent > Snapshot 1 @@ -4541,48 +4950,54 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ - constructor(bytes32 qx, bytes32 qy)␊ - EIP712("MyAccount", "1")␊ - SignerP256(qx, qy)␊ - {}␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, ERC7739)␊ + override(AccountERC7579Upgradeable, 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;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579)␊ + override(Account, AccountERC7579Upgradeable)␊ 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)␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerP256, AbstractSigner, AccountERC7579)␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -4590,7 +5005,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerP256 with ERC7579 hooks non-upgradeable +## Account with SignerECDSA with ERC7579 upgradeable transparent with factory > Snapshot 1 @@ -4600,91 +5015,86 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ - import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerP256 {␊ - constructor(bytes32 qx, bytes32 qy)␊ - EIP712("MyAccount", "1")␊ - SignerP256(qx, qy)␊ - {}␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, ERC7739)␊ + override(AccountERC7579Upgradeable, 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;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579)␊ + override(Account, AccountERC7579Upgradeable)␊ 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)␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerP256, AbstractSigner, AccountERC7579)␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ - ` - -## Account with SignerP256 named upgradeable uups - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ - contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256", "1") {␊ - _disableInitializers();␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ }␊ ` -## Account with SignerP256 with ERC1271 upgradeable uups +## Account with SignerECDSA with ERC7579 with ERC1271 upgradeable transparent > Snapshot 1 @@ -4692,41 +5102,60 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override␊ + override(IERC1271, AccountERC7579Upgradeable)␊ returns (bytes4)␊ {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + return super.isValidSignature(hash, signature);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + view␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ` -## Account with SignerP256 with ERC7739 upgradeable uups +## Account with SignerECDSA with ERC7579 with ERC1271 upgradeable transparent with factory > Snapshot 1 @@ -4734,103 +5163,84 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256ERC7739", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ - }␊ - ` - -## Account with SignerP256 with ERC721Holder upgradeable uups - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + // The following functions are overrides required by Solidity.␊ ␊ - contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256ERC721Holder", "1") {␊ - _disableInitializers();␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + view␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ - ` - -## Account with SignerP256 with ERC1155Holder upgradeable uups - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ - contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC1155Holder, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256ERC1155Holder", "1") {␊ - _disableInitializers();␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ }␊ ` -## Account with SignerP256 with ERC721Holder and ERC1155Holder upgradeable uups +## Account with SignerECDSA with ERC7579 with ERC7739 upgradeable transparent > Snapshot 1 @@ -4838,81 +5248,64 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ - {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ - }␊ - ` - -## Account with SignerP256 with ERC7821 Execution upgradeable uups - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC7821, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ }␊ ` -## Account with SignerP256 with ERC7579 upgradeable uups +## Account with SignerECDSA with ERC7579 with ERC7739 upgradeable transparent with factory > Snapshot 1 @@ -4927,19 +5320,18 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(address signer) public initializer {␊ __AccountERC7579_init();␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + __SignerECDSA_init(signer);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -4953,12 +5345,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -4970,91 +5356,45 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signer);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ + }␊ + ␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ + }␊ + }␊ ` -## Account with SignerP256 with ERC7579 with ERC1271 upgradeable uups - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579_init();␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ - }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ - {␊ - return super.isValidSignature(hash, signature);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ - }␊ - ` - -## Account with SignerP256 with ERC7579 with ERC7739 upgradeable uups +## Account with SignerECDSA with ERC7579 hooks upgradeable transparent > Snapshot 1 @@ -5065,23 +5405,22 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579_init();␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerECDSA_init(signer);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -5095,12 +5434,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5112,14 +5445,14 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -5127,7 +5460,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerP256 with ERC7579 hooks upgradeable uups +## Account with SignerECDSA with ERC7579 hooks upgradeable transparent with factory > Snapshot 1 @@ -5143,19 +5476,18 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerECDSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + function initialize(address signer) public initializer {␊ __AccountERC7579Hooked_init();␊ - __SignerP256_init(qx, qy);␊ - __UUPSUpgradeable_init();␊ + __SignerECDSA_init(signer);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -5169,12 +5501,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5186,98 +5512,45 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // IMPORTANT: Make sure SignerECDSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerECDSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(SignerECDSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ - ` - -## Account with SignerP256 named upgradeable transparent - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - ␊ - contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ - }␊ - ` - -## Account with SignerP256 named upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ - ␊ - contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ - }␊ ␊ - contract CustomAccountWithSignerP256Factory {␊ - CustomAccountWithSignerP256 public immutable implementation = new CustomAccountWithSignerP256();␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + function deploy(address signer, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(signer, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerP256(instance).initialize(qx, qy);␊ + MyAccount(instance).initialize(signer);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(address signer, bytes32 salt) public view returns (address) {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signer, salt));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _salt(address signer, bytes32 salt) internal pure returns (bytes32) {␊ + return keccak256(abi.encode(signer, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC1271 upgradeable transparent +## Account with SignerP256 named non-upgradeable > Snapshot 1 @@ -5286,32 +5559,19 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - ␊ - contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override␊ - returns (bytes4)␊ - {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ - }␊ + contract CustomAccountWithSignerP256 is Account, EIP712, ERC7739, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy)␊ + EIP712("CustomAccount with SignerP256", "1")␊ + SignerP256(qx, qy)␊ + {}␊ }␊ ` -## Account with SignerP256 with ERC1271 upgradeable transparent with factory +## Account with SignerP256 with ERC1271 non-upgradeable > Snapshot 1 @@ -5321,19 +5581,10 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ - ␊ - contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ - }␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ + contract CustomAccountWithSignerP256ERC1271 is Account, IERC1271, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5344,32 +5595,9 @@ Generated by [AVA](https://avajs.dev). return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ }␊ - ␊ - contract CustomAccountWithSignerP256ERC1271Factory {␊ - CustomAccountWithSignerP256ERC1271 public immutable implementation = new CustomAccountWithSignerP256ERC1271();␊ - ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerP256ERC1271(instance).initialize(qx, qy);␊ - }␊ - return instance;␊ - ␊ - }␊ - ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ - }␊ - ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ - }␊ - }␊ ` -## Account with SignerP256 with ERC7739 upgradeable transparent +## Account with SignerP256 with ERC7739 non-upgradeable > Snapshot 1 @@ -5380,22 +5608,4596 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC7739 is Account, EIP712, ERC7739, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy)␊ + EIP712("CustomAccount with SignerP256ERC7739", "1")␊ + SignerP256(qx, qy)␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721Holder is Account, EIP712, ERC7739, SignerP256, ERC721Holder {␊ + constructor(bytes32 qx, bytes32 qy)␊ + EIP712("CustomAccount with SignerP256ERC721Holder", "1")␊ + SignerP256(qx, qy)␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC1155Holder non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC1155Holder is Account, EIP712, ERC7739, SignerP256, ERC1155Holder {␊ + constructor(bytes32 qx, bytes32 qy)␊ + EIP712("CustomAccount with SignerP256ERC1155Holder", "1")␊ + SignerP256(qx, qy)␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder and ERC1155Holder non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerP256, ERC721Holder, ERC1155Holder {␊ + constructor(bytes32 qx, bytes32 qy)␊ + EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ + SignerP256(qx, qy)␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC7821 Execution non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + ␊ + contract MyAccount is Account, EIP712, ERC7739, SignerP256, ERC7821 {␊ + constructor(bytes32 qx, bytes32 qy)␊ + EIP712("MyAccount", "1")␊ + SignerP256(qx, qy)␊ + {}␊ + ␊ + 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 SignerP256 with ERC7579 non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + ␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy)␊ + EIP712("MyAccount", "1")␊ + SignerP256(qx, qy)␊ + {}␊ + ␊ + 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 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 non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + ␊ + contract MyAccount is Account, IERC1271, AccountERC7579, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy) SignerP256(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(IERC1271, AccountERC7579)␊ + 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 non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + ␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy)␊ + EIP712("MyAccount", "1")␊ + SignerP256(qx, qy)␊ + {}␊ + ␊ + 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 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 hooks non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ + ␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy)␊ + EIP712("MyAccount", "1")␊ + SignerP256(qx, qy)␊ + {}␊ + ␊ + 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 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 named upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerP256 named upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerP256Factory {␊ + CustomAccountWithSignerP256 public immutable implementation = new CustomAccountWithSignerP256();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerP256.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerP256.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC1271 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC1271 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC1271Factory {␊ + CustomAccountWithSignerP256ERC1271 public immutable implementation = new CustomAccountWithSignerP256ERC1271();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerP256ERC1271.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerP256ERC1271.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7739 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC7739", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC7739 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC7739", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC7739Factory {␊ + CustomAccountWithSignerP256ERC7739 public immutable implementation = new CustomAccountWithSignerP256ERC7739();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerP256ERC7739.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerP256ERC7739.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC721Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC721Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderFactory {␊ + CustomAccountWithSignerP256ERC721Holder public immutable implementation = new CustomAccountWithSignerP256ERC721Holder();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerP256ERC721Holder.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerP256ERC721Holder.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC1155Holder upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC1155Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC1155Holder upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC1155Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC1155HolderFactory {␊ + CustomAccountWithSignerP256ERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC1155Holder();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerP256ERC1155Holder.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerP256ERC1155Holder.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder and ERC1155Holder upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder and ERC1155Holder upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155HolderFactory {␊ + CustomAccountWithSignerP256ERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC721HolderERC1155Holder();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerP256ERC721HolderERC1155Holder.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerP256ERC721HolderERC1155Holder.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7821 Execution upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC7821, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerP256 with ERC7821 Execution upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC7821, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC1271 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC1271 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC7739 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC7739 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 hooks upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 hooks upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerP256Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (qx, qy));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (qx, qy)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerP256 named upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ` + +## Account with SignerP256 named upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerP256Factory {␊ + CustomAccountWithSignerP256 public immutable implementation = new CustomAccountWithSignerP256();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerP256(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC1271 upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC1271 upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC1271Factory {␊ + CustomAccountWithSignerP256ERC1271 public immutable implementation = new CustomAccountWithSignerP256ERC1271();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerP256ERC1271(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7739 upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC7739", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7739 upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC7739", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC7739Factory {␊ + CustomAccountWithSignerP256ERC7739 public immutable implementation = new CustomAccountWithSignerP256ERC7739();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerP256ERC7739(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC721Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC721Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderFactory {␊ + CustomAccountWithSignerP256ERC721Holder public immutable implementation = new CustomAccountWithSignerP256ERC721Holder();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerP256ERC721Holder(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC1155Holder upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC1155Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC1155Holder upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerP256ERC1155Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC1155HolderFactory {␊ + CustomAccountWithSignerP256ERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC1155Holder();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerP256ERC1155Holder(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder and ERC1155Holder upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC721Holder and ERC1155Holder upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155HolderFactory {␊ + CustomAccountWithSignerP256ERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC721HolderERC1155Holder();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerP256ERC721HolderERC1155Holder(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7821 Execution upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC7821 {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + 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 SignerP256 with ERC7821 Execution upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC7821 {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC1271 upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC1271 upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC7739 upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 with ERC7739 upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 hooks upgradeable transparent + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerP256 with ERC7579 hooks upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerP256Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ + bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(qx, qy);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes32 qx, bytes32 qy, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + }␊ + ␊ + function _salt(bytes32 qx, bytes32 qy, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(qx, qy, salt));␊ + }␊ + }␊ + ` + +## Account with SignerRSA named non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract CustomAccountWithSignerRSA is Account, EIP712, ERC7739, SignerRSA {␊ + constructor(bytes memory e, bytes memory n)␊ + EIP712("CustomAccount with SignerRSA", "1")␊ + SignerRSA(e, n)␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC1271 non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC1271 is Account, IERC1271, SignerRSA {␊ + constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {}␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7739 non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC7739 is Account, EIP712, ERC7739, SignerRSA {␊ + constructor(bytes memory e, bytes memory n)␊ + EIP712("CustomAccount with SignerRSAERC7739", "1")␊ + SignerRSA(e, n)␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC721Holder non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC721Holder is Account, EIP712, ERC7739, SignerRSA, ERC721Holder {␊ + constructor(bytes memory e, bytes memory n)␊ + EIP712("CustomAccount with SignerRSAERC721Holder", "1")␊ + SignerRSA(e, n)␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC1155Holder non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC1155Holder is Account, EIP712, ERC7739, SignerRSA, ERC1155Holder {␊ + constructor(bytes memory e, bytes memory n)␊ + EIP712("CustomAccount with SignerRSAERC1155Holder", "1")␊ + SignerRSA(e, n)␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC721Holder and ERC1155Holder non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerRSA, ERC721Holder, ERC1155Holder {␊ + constructor(bytes memory e, bytes memory n)␊ + EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ + SignerRSA(e, n)␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC7821 Execution non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract MyAccount is Account, EIP712, ERC7739, SignerRSA, ERC7821 {␊ + constructor(bytes memory e, bytes memory n)␊ + EIP712("MyAccount", "1")␊ + SignerRSA(e, n)␊ + {}␊ + ␊ + 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 SignerRSA with ERC7579 non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ + constructor(bytes memory e, bytes memory n)␊ + EIP712("MyAccount", "1")␊ + SignerRSA(e, n)␊ + {}␊ + ␊ + 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 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 non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract MyAccount is Account, IERC1271, AccountERC7579, SignerRSA {␊ + constructor(bytes memory e, bytes memory n) SignerRSA(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(IERC1271, AccountERC7579)␊ + 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 non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ + constructor(bytes memory e, bytes memory n)␊ + EIP712("MyAccount", "1")␊ + SignerRSA(e, n)␊ + {}␊ + ␊ + 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 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 hooks non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + ␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerRSA {␊ + constructor(bytes memory e, bytes memory n)␊ + EIP712("MyAccount", "1")␊ + SignerRSA(e, n)␊ + {}␊ + ␊ + 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 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 named upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerRSA", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerRSA named upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerRSA", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerRSAFactory {␊ + CustomAccountWithSignerRSA public immutable implementation = new CustomAccountWithSignerRSA();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerRSA.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerRSA.initialize, (e, n)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC1271 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC1271 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerRSAERC1271Factory {␊ + CustomAccountWithSignerRSAERC1271 public immutable implementation = new CustomAccountWithSignerRSAERC1271();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerRSAERC1271.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerRSAERC1271.initialize, (e, n)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7739 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerRSAERC7739", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC7739 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerRSAERC7739", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerRSAERC7739Factory {␊ + CustomAccountWithSignerRSAERC7739 public immutable implementation = new CustomAccountWithSignerRSAERC7739();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerRSAERC7739.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerRSAERC7739.initialize, (e, n)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC721Holder upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerRSAERC721Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC721Holder upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerRSAERC721Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerRSAERC721HolderFactory {␊ + CustomAccountWithSignerRSAERC721Holder public immutable implementation = new CustomAccountWithSignerRSAERC721Holder();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerRSAERC721Holder.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerRSAERC721Holder.initialize, (e, n)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC1155Holder upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerRSAERC1155Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC1155Holder upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerRSAERC1155Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerRSAERC1155HolderFactory {␊ + CustomAccountWithSignerRSAERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC1155Holder();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerRSAERC1155Holder.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerRSAERC1155Holder.initialize, (e, n)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC721Holder and ERC1155Holder upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC721Holder and ERC1155Holder upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155HolderFactory {␊ + CustomAccountWithSignerRSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC721HolderERC1155Holder();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerRSAERC721HolderERC1155Holder.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerRSAERC721HolderERC1155Holder.initialize, (e, n)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7821 Execution upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC7821, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ` + +## Account with SignerRSA with ERC7821 Execution upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC7821, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (e, n)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7579 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7579 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (e, n)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7579 with ERC1271 upgradeable uups + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256ERC7739", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ` -## Account with SignerP256 with ERC7739 upgradeable transparent with factory +## Account with SignerRSA with ERC7579 with ERC1271 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (e, n)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7579 with ERC7739 upgradeable uups > Snapshot 1 @@ -5403,49 +10205,180 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ` + +## Account with SignerRSA with ERC7579 with ERC7739 upgradeable uups with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ - contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256ERC7739", "1") {␊ - _disableInitializers();␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ␊ - contract CustomAccountWithSignerP256ERC7739Factory {␊ - CustomAccountWithSignerP256ERC7739 public immutable implementation = new CustomAccountWithSignerP256ERC7739();␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerP256ERC7739(instance).initialize(qx, qy);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (e, n)));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerP256 with ERC721Holder upgradeable transparent +## Account with SignerRSA with ERC7579 hooks upgradeable uups > Snapshot 1 @@ -5453,26 +10386,73 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256ERC721Holder", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ` -## Account with SignerP256 with ERC721Holder upgradeable transparent with factory +## Account with SignerRSA with ERC7579 hooks upgradeable uups with factory > Snapshot 1 @@ -5480,50 +10460,108 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256ERC721Holder", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ␊ - contract CustomAccountWithSignerP256ERC721HolderFactory {␊ - CustomAccountWithSignerP256ERC721Holder public immutable implementation = new CustomAccountWithSignerP256ERC721Holder();␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (e, n));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerP256ERC721Holder(instance).initialize(qx, qy);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (e, n)));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerP256 with ERC1155Holder upgradeable transparent +## Account with SignerRSA named upgradeable transparent > Snapshot 1 @@ -5533,24 +10571,23 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC1155Holder {␊ + contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256ERC1155Holder", "1") {␊ + constructor() EIP712("CustomAccount with SignerRSA", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ }␊ ` -## Account with SignerP256 with ERC1155Holder upgradeable transparent with factory +## Account with SignerRSA named upgradeable transparent with factory > Snapshot 1 @@ -5560,48 +10597,58 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC1155Holder {␊ + contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerP256ERC1155Holder", "1") {␊ + constructor() EIP712("CustomAccount with SignerRSA", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ }␊ ␊ - contract CustomAccountWithSignerP256ERC1155HolderFactory {␊ - CustomAccountWithSignerP256ERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC1155Holder();␊ + contract CustomAccountWithSignerRSAFactory {␊ + CustomAccountWithSignerRSA public immutable implementation = new CustomAccountWithSignerRSA();␊ ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerP256ERC1155Holder(instance).initialize(qx, qy);␊ + CustomAccountWithSignerRSA(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC721Holder and ERC1155Holder upgradeable transparent +## Account with SignerRSA with ERC1271 upgradeable transparent > Snapshot 1 @@ -5610,28 +10657,32 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, ERC1155Holder {␊ + contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ - {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ }␊ ` -## Account with SignerP256 with ERC721Holder and ERC1155Holder upgradeable transparent with factory +## Account with SignerRSA with ERC1271 upgradeable transparent with factory > Snapshot 1 @@ -5640,52 +10691,67 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC721Holder, ERC1155Holder {␊ + contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ - {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ }␊ ␊ - contract CustomAccountWithSignerP256ERC721HolderERC1155HolderFactory {␊ - CustomAccountWithSignerP256ERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerP256ERC721HolderERC1155Holder();␊ + contract CustomAccountWithSignerRSAERC1271Factory {␊ + CustomAccountWithSignerRSAERC1271 public immutable implementation = new CustomAccountWithSignerRSAERC1271();␊ ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerP256ERC721HolderERC1155Holder(instance).initialize(qx, qy);␊ + CustomAccountWithSignerRSAERC1271(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC7821 Execution upgradeable transparent +## Account with SignerRSA with ERC7739 upgradeable transparent > Snapshot 1 @@ -5696,32 +10762,22 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC7821 {␊ + contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerRSAERC7739", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ - ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ }␊ ` -## Account with SignerP256 with ERC7821 Execution upgradeable transparent with factory +## Account with SignerRSA with ERC7739 upgradeable transparent with factory > Snapshot 1 @@ -5732,56 +10788,57 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256Upgradeable, ERC7821 {␊ + contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerRSAERC7739", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ - ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ - internal␊ - view␊ - override␊ - returns (bool)␊ - {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ }␊ ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ + contract CustomAccountWithSignerRSAERC7739Factory {␊ + CustomAccountWithSignerRSAERC7739 public immutable implementation = new CustomAccountWithSignerRSAERC7739();␊ ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(qx, qy);␊ + CustomAccountWithSignerRSAERC7739(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC7579 upgradeable transparent +## Account with SignerRSA with ERC721Holder upgradeable transparent > Snapshot 1 @@ -5789,64 +10846,26 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerRSAERC721Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579_init();␊ - __SignerP256_init(qx, qy);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ }␊ ` -## Account with SignerP256 with ERC7579 upgradeable transparent with factory +## Account with SignerRSA with ERC721Holder upgradeable transparent with factory > Snapshot 1 @@ -5854,88 +10873,61 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerRSAERC721Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579_init();␊ - __SignerP256_init(qx, qy);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ }␊ ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ - ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + contract CustomAccountWithSignerRSAERC721HolderFactory {␊ + CustomAccountWithSignerRSAERC721Holder public immutable implementation = new CustomAccountWithSignerRSAERC721Holder();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(qx, qy);␊ + CustomAccountWithSignerRSAERC721Holder(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC7579 with ERC1271 upgradeable transparent +## Account with SignerRSA with ERC1155Holder upgradeable transparent > Snapshot 1 @@ -5943,60 +10935,88 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC1155Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("CustomAccount with SignerRSAERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579_init();␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ + }␊ + ` + +## Account with SignerRSA with ERC1155Holder upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ ␊ - // The following functions are overrides required by Solidity.␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ + contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerRSAERC1155Holder", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + }␊ + }␊ + ␊ + contract CustomAccountWithSignerRSAERC1155HolderFactory {␊ + CustomAccountWithSignerRSAERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC1155Holder();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ {␊ - return super._validateUserOp(userOp, userOpHash);␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerRSAERC1155Holder(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ public␊ view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ + returns (address)␊ {␊ - return super.isValidSignature(hash, signature);␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ }␊ ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ internal␊ - view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ + pure␊ + returns (bytes32)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return keccak256(abi.encode(e, n, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC7579 with ERC1271 upgradeable transparent with factory +## Account with SignerRSA with ERC721Holder and ERC1155Holder upgradeable transparent > Snapshot 1 @@ -6004,84 +11024,94 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, ERC1155Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor()␊ + EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ + {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579_init();␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ + }␊ + ` + +## Account with SignerRSA with ERC721Holder and ERC1155Holder upgradeable transparent with factory + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, ERC1155Holder {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ {␊ - return super.isValidSignature(hash, signature);␊ + _disableInitializers();␊ }␊ ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ }␊ ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155HolderFactory {␊ + CustomAccountWithSignerRSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC721HolderERC1155Holder();␊ ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(qx, qy);␊ + CustomAccountWithSignerRSAERC721HolderERC1155Holder(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC7579 with ERC7739 upgradeable transparent +## Account with SignerRSA with ERC7821 Execution upgradeable transparent > Snapshot 1 @@ -6089,64 +11119,35 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC7821 {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579_init();␊ - __SignerP256_init(qx, qy);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override␊ returns (bool)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ ` -## Account with SignerP256 with ERC7579 with ERC7739 upgradeable transparent with factory +## Account with SignerRSA with ERC7821 Execution upgradeable transparent with factory > Snapshot 1 @@ -6154,88 +11155,70 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerP256Upgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC7821 {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579_init();␊ - __SignerP256_init(qx, qy);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ - }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ }␊ ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override␊ returns (bool)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ ␊ contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(qx, qy);␊ + MyAccount(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ }␊ }␊ ` -## Account with SignerP256 with ERC7579 hooks upgradeable transparent +## Account with SignerRSA with ERC7579 upgradeable transparent > Snapshot 1 @@ -6246,22 +11229,21 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerP256Upgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579Hooked_init();␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -6286,14 +11268,14 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -6301,7 +11283,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerP256 with ERC7579 hooks upgradeable transparent with factory +## Account with SignerRSA with ERC7579 upgradeable transparent with factory > Snapshot 1 @@ -6312,23 +11294,22 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerP256Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerP256Upgradeable.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerP256Upgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __AccountERC7579Hooked_init();␊ - __SignerP256_init(qx, qy);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -6353,14 +11334,14 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerP256Upgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerP256Upgradeable)␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerP256Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -6370,49 +11351,39 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function deploy(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - bytes32 effectiveSalt = _salt(qx, qy, salt);␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(qx, qy);␊ + MyAccount(instance).initialize(e, n);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes32 qx, bytes32 qy, bytes32 salt) public returns (address) {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(qx, qy, salt));␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ }␊ ␊ - function _salt(bytes32 qx, bytes32 qy, bytes32 salt) internal returns (bytes32) {␊ - return keccak256(abi.encode(qx, qy, salt));␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ }␊ }␊ ` -## Account with SignerRSA named non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ - ␊ - contract CustomAccountWithSignerRSA is Account, EIP712, ERC7739, SignerRSA {␊ - constructor(bytes memory e, bytes memory n)␊ - EIP712("CustomAccount with SignerRSA", "1")␊ - SignerRSA(e, n)␊ - {}␊ - }␊ - ` - -## Account with SignerRSA with ERC1271 non-upgradeable +## Account with SignerRSA with ERC7579 with ERC1271 upgradeable transparent > Snapshot 1 @@ -6420,113 +11391,60 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ - ␊ - contract CustomAccountWithSignerRSAERC1271 is Account, IERC1271, SignerRSA {␊ - constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {}␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override␊ - returns (bytes4)␊ - {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ }␊ - }␊ - ` - -## Account with SignerRSA with ERC7739 non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ - ␊ - contract CustomAccountWithSignerRSAERC7739 is Account, EIP712, ERC7739, SignerRSA {␊ - constructor(bytes memory e, bytes memory n)␊ - EIP712("CustomAccount with SignerRSAERC7739", "1")␊ - SignerRSA(e, n)␊ - {}␊ - }␊ - ` - -## Account with SignerRSA with ERC721Holder non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721Holder is Account, EIP712, ERC7739, SignerRSA, ERC721Holder {␊ - constructor(bytes memory e, bytes memory n)␊ - EIP712("CustomAccount with SignerRSAERC721Holder", "1")␊ - SignerRSA(e, n)␊ - {}␊ - }␊ - ` - -## Account with SignerRSA with ERC1155Holder non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + // The following functions are overrides required by Solidity.␊ ␊ - contract CustomAccountWithSignerRSAERC1155Holder is Account, EIP712, ERC7739, SignerRSA, ERC1155Holder {␊ - constructor(bytes memory e, bytes memory n)␊ - EIP712("CustomAccount with SignerRSAERC1155Holder", "1")␊ - SignerRSA(e, n)␊ - {}␊ - }␊ - ` - -## Account with SignerRSA with ERC721Holder and ERC1155Holder non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ ␊ - contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerRSA, ERC721Holder, ERC1155Holder {␊ - constructor(bytes memory e, bytes memory n)␊ - EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ - SignerRSA(e, n)␊ - {}␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ` -## Account with SignerRSA with ERC7821 Execution non-upgradeable +## Account with SignerRSA with ERC7579 with ERC1271 upgradeable transparent with factory > Snapshot 1 @@ -6534,30 +11452,95 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, SignerRSA, ERC7821 {␊ - constructor(bytes memory e, bytes memory n)␊ - EIP712("MyAccount", "1")␊ - SignerRSA(e, n)␊ - {}␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ }␊ }␊ ` -## Account with SignerRSA with ERC7579 non-upgradeable +## Account with SignerRSA with ERC7579 with ERC7739 upgradeable transparent > Snapshot 1 @@ -6567,48 +11550,54 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ - constructor(bytes memory e, bytes memory n)␊ - EIP712("MyAccount", "1")␊ - SignerRSA(e, n)␊ - {}␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, ERC7739)␊ + override(AccountERC7579Upgradeable, 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;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579)␊ + override(Account, AccountERC7579Upgradeable)␊ 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)␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSA, AbstractSigner, AccountERC7579)␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -6616,7 +11605,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerRSA with ERC7579 with ERC1271 non-upgradeable +## Account with SignerRSA with ERC7579 with ERC7739 upgradeable transparent with factory > Snapshot 1 @@ -6626,49 +11615,97 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ - ␊ - contract MyAccount is Account, IERC1271, AccountERC7579, SignerRSA {␊ - constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {}␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - // The following functions are overrides required by Solidity.␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(IERC1271, AccountERC7579)␊ + override(AccountERC7579Upgradeable, ERC7739)␊ returns (bytes4)␊ {␊ - return super.isValidSignature(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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSA is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerRSA)␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSA, AbstractSigner, AccountERC7579)␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` -## Account with SignerRSA with ERC7579 with ERC7739 non-upgradeable +## Account with SignerRSA with ERC7579 hooks upgradeable transparent > Snapshot 1 @@ -6678,48 +11715,55 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerRSAUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ - constructor(bytes memory e, bytes memory n)␊ - EIP712("MyAccount", "1")␊ - SignerRSA(e, n)␊ - {}␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, ERC7739)␊ + override(AccountERC7579Upgradeable, 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;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579)␊ + override(Account, AccountERC7579Upgradeable)␊ 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)␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSA, AbstractSigner, AccountERC7579)␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -6727,7 +11771,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerRSA with ERC7579 hooks non-upgradeable +## Account with SignerRSA with ERC7579 hooks upgradeable transparent with factory > Snapshot 1 @@ -6737,57 +11781,98 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ - import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ + import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerRSA {␊ - constructor(bytes memory e, bytes memory n)␊ - EIP712("MyAccount", "1")␊ - SignerRSA(e, n)␊ - {}␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerRSAUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, ERC7739)␊ + override(AccountERC7579Upgradeable, 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;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579)␊ + override(Account, AccountERC7579Upgradeable)␊ 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)␊ + // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSA, AbstractSigner, AccountERC7579)␊ + override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(e, n, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(e, n);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + }␊ + ␊ + function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(e, n, salt));␊ + }␊ + }␊ ` -## Account with SignerRSA named upgradeable uups +## Account with SignerMultisig named non-upgradeable > Snapshot 1 @@ -6798,30 +11883,29 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSA", "1") {␊ - _disableInitializers();␊ + contract CustomAccountWithSignerMultisig is Account, EIP712, ERC7739, MultiSignerERC7913 {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisig", "1")␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ }␊ ` -## Account with SignerRSA with ERC1271 upgradeable uups +## Account with SignerMultisig with ERC1271 non-upgradeable > Snapshot 1 @@ -6831,20 +11915,12 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSAUpgradeable, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ - }␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ - }␊ + contract CustomAccountWithSignerMultisigERC1271 is Account, IERC1271, MultiSignerERC7913 {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6855,15 +11931,21 @@ Generated by [AVA](https://avajs.dev). return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ }␊ ` -## Account with SignerRSA with ERC7739 upgradeable uups +## Account with SignerMultisig with ERC7739 non-upgradeable > Snapshot 1 @@ -6874,30 +11956,29 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSAERC7739", "1") {␊ - _disableInitializers();␊ + contract CustomAccountWithSignerMultisigERC7739 is Account, EIP712, ERC7739, MultiSignerERC7913 {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisigERC7739", "1")␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ }␊ ` -## Account with SignerRSA with ERC721Holder upgradeable uups +## Account with SignerMultisig with ERC721Holder non-upgradeable > Snapshot 1 @@ -6909,30 +11990,29 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSAERC721Holder", "1") {␊ - _disableInitializers();␊ + contract CustomAccountWithSignerMultisigERC721Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisigERC721Holder", "1")␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ }␊ ` -## Account with SignerRSA with ERC1155Holder upgradeable uups +## Account with SignerMultisig with ERC1155Holder non-upgradeable > Snapshot 1 @@ -6944,30 +12024,29 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC1155Holder, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSAERC1155Holder", "1") {␊ - _disableInitializers();␊ + contract CustomAccountWithSignerMultisigERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC1155Holder {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisigERC1155Holder", "1")␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ }␊ ` -## Account with SignerRSA with ERC721Holder and ERC1155Holder upgradeable uups +## Account with SignerMultisig with ERC721Holder and ERC1155Holder non-upgradeable > Snapshot 1 @@ -6980,32 +12059,29 @@ 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/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ - {␊ - _disableInitializers();␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder, ERC1155Holder {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ }␊ ` -## Account with SignerRSA with ERC7821 Execution upgradeable uups +## Account with SignerMultisig with ERC7821 Execution non-upgradeable > Snapshot 1 @@ -7017,19 +12093,24 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC7821, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ + contract MyAccount is Account, EIP712, ERC7739, MultiSignerERC7913, ERC7821 {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + EIP712("MyAccount", "1")␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ @@ -7040,16 +12121,10 @@ Generated by [AVA](https://avajs.dev). {␊ return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ }␊ ` -## Account with SignerRSA with ERC7579 upgradeable uups +## Account with SignerMultisig with ERC7579 non-upgradeable > Snapshot 1 @@ -7059,62 +12134,60 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __AccountERC7579_init();␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + EIP712("MyAccount", "1")␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ + 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579Upgradeable)␊ + override(Account, AccountERC7579)␊ returns (uint256)␊ {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisig is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisig)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + // AccountERC7579 returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -7122,7 +12195,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerRSA with ERC7579 with ERC1271 upgradeable uups +## Account with SignerMultisig with ERC7579 with ERC1271 non-upgradeable > Snapshot 1 @@ -7132,36 +12205,33 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ + contract MyAccount is Account, IERC1271, AccountERC7579, MultiSignerERC7913 {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __AccountERC7579_init();␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579Upgradeable)␊ + override(Account, AccountERC7579)␊ returns (uint256)␊ {␊ return super._validateUserOp(userOp, userOpHash);␊ @@ -7170,20 +12240,20 @@ Generated by [AVA](https://avajs.dev). function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ + override(IERC1271, AccountERC7579)␊ returns (bytes4)␊ {␊ return super.isValidSignature(hash, signature);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisig is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisig)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + // AccountERC7579 returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -7191,7 +12261,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerRSA with ERC7579 with ERC7739 upgradeable uups +## Account with SignerMultisig with ERC7579 with ERC7739 non-upgradeable > Snapshot 1 @@ -7201,62 +12271,60 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __AccountERC7579_init();␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + EIP712("MyAccount", "1")␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ + 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579Upgradeable)␊ + override(Account, AccountERC7579)␊ returns (uint256)␊ {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisig is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisig)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + // AccountERC7579 returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -7264,7 +12332,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerRSA with ERC7579 hooks upgradeable uups +## Account with SignerMultisig with ERC7579 hooks non-upgradeable > Snapshot 1 @@ -7274,63 +12342,61 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerRSAUpgradeable, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __AccountERC7579Hooked_init();␊ - __SignerRSA_init(e, n);␊ - __UUPSUpgradeable_init();␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913 {␊ + constructor(bytes[] memory signers, uint64 threshold)␊ + EIP712("MyAccount", "1")␊ + MultiSignerERC7913(signers, threshold)␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ + 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579Upgradeable)␊ + override(Account, AccountERC7579)␊ returns (uint256)␊ {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisig is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisig)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + // AccountERC7579 returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -7338,7 +12404,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerRSA named upgradeable transparent +## Account with SignerMultisig named upgradeable uups > Snapshot 1 @@ -7350,21 +12416,44 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable {␊ + contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSA", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisig", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerRSA named upgradeable transparent with factory +## Account with SignerMultisig named upgradeable uups with factory > Snapshot 1 @@ -7376,54 +12465,79 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable {␊ + contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSA", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisig", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ - contract CustomAccountWithSignerRSAFactory {␊ - CustomAccountWithSignerRSA public immutable implementation = new CustomAccountWithSignerRSA();␊ + contract CustomAccountWithSignerMultisigFactory {␊ + CustomAccountWithSignerMultisig public immutable implementation = new CustomAccountWithSignerMultisig();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisig.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerRSA(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisig.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerRSA with ERC1271 upgradeable transparent +## Account with SignerMultisig with ERC1271 upgradeable uups > Snapshot 1 @@ -7434,16 +12548,21 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSAUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -7454,10 +12573,28 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerRSA with ERC1271 upgradeable transparent with factory +## Account with SignerMultisig with ERC1271 upgradeable uups with factory > Snapshot 1 @@ -7468,17 +12605,23 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSAUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -7489,42 +12632,61 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ - contract CustomAccountWithSignerRSAERC1271Factory {␊ - CustomAccountWithSignerRSAERC1271 public immutable implementation = new CustomAccountWithSignerRSAERC1271();␊ + contract CustomAccountWithSignerMultisigERC1271Factory {␊ + CustomAccountWithSignerMultisigERC1271 public immutable implementation = new CustomAccountWithSignerMultisigERC1271();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigERC1271.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerRSAERC1271(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigERC1271.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerRSA with ERC7739 upgradeable transparent +## Account with SignerMultisig with ERC7739 upgradeable uups > Snapshot 1 @@ -7536,80 +12698,44 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSAERC7739", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisigERC7739", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ - }␊ - ` - -## Account with SignerRSA with ERC7739 upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ - ␊ - contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSAERC7739", "1") {␊ - _disableInitializers();␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ - }␊ - ␊ - contract CustomAccountWithSignerRSAERC7739Factory {␊ - CustomAccountWithSignerRSAERC7739 public immutable implementation = new CustomAccountWithSignerRSAERC7739();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerRSAERC7739(instance).initialize(e, n);␊ - }␊ - return instance;␊ - ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - returns (bytes32)␊ - {␊ - return keccak256(abi.encode(e, n, salt));␊ - }␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerRSA with ERC721Holder upgradeable transparent +## Account with SignerMultisig with ERC7739 upgradeable uups with factory > Snapshot 1 @@ -7619,84 +12745,81 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder {␊ + contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSAERC721Holder", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisigERC7739", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ - }␊ - ` - -## Account with SignerRSA with ERC721Holder upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ ␊ - contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSAERC721Holder", "1") {␊ - _disableInitializers();␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ - contract CustomAccountWithSignerRSAERC721HolderFactory {␊ - CustomAccountWithSignerRSAERC721Holder public immutable implementation = new CustomAccountWithSignerRSAERC721Holder();␊ + contract CustomAccountWithSignerMultisigERC7739Factory {␊ + CustomAccountWithSignerMultisigERC7739 public immutable implementation = new CustomAccountWithSignerMultisigERC7739();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigERC7739.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerRSAERC721Holder(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigERC7739.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerRSA with ERC1155Holder upgradeable transparent +## Account with SignerMultisig with ERC721Holder upgradeable uups > Snapshot 1 @@ -7706,24 +12829,47 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC1155Holder {␊ + contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSAERC1155Holder", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisigERC721Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerRSA with ERC1155Holder upgradeable transparent with factory +## Account with SignerMultisig with ERC721Holder upgradeable uups with factory > Snapshot 1 @@ -7733,57 +12879,82 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC1155Holder {␊ + contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerRSAERC1155Holder", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisigERC721Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ - contract CustomAccountWithSignerRSAERC1155HolderFactory {␊ - CustomAccountWithSignerRSAERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC1155Holder();␊ + contract CustomAccountWithSignerMultisigERC721HolderFactory {␊ + CustomAccountWithSignerMultisigERC721Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721Holder();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigERC721Holder.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerRSAERC1155Holder(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigERC721Holder.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerRSA with ERC721Holder and ERC1155Holder upgradeable transparent +## Account with SignerMultisig with ERC1155Holder upgradeable uups > Snapshot 1 @@ -7794,26 +12965,46 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, ERC1155Holder {␊ + contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC1155Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ - {␊ + constructor() EIP712("CustomAccount with SignerMultisigERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerRSA with ERC721Holder and ERC1155Holder upgradeable transparent with factory +## Account with SignerMultisig with ERC1155Holder upgradeable uups with factory > Snapshot 1 @@ -7824,59 +13015,81 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC721Holder, ERC1155Holder {␊ + contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC1155Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ - {␊ + constructor() EIP712("CustomAccount with SignerMultisigERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ - contract CustomAccountWithSignerRSAERC721HolderERC1155HolderFactory {␊ - CustomAccountWithSignerRSAERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerRSAERC721HolderERC1155Holder();␊ + contract CustomAccountWithSignerMultisigERC1155HolderFactory {␊ + CustomAccountWithSignerMultisigERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC1155Holder();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigERC1155Holder.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerRSAERC721HolderERC1155Holder(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigERC1155Holder.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerRSA with ERC7821 Execution upgradeable transparent +## Account with SignerMultisig with ERC721Holder and ERC1155Holder upgradeable uups > Snapshot 1 @@ -7886,33 +13099,50 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC7821 {␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ + {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - view␊ override␊ - returns (bool)␊ - {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ - }␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerRSA with ERC7821 Execution upgradeable transparent with factory +## Account with SignerMultisig with ERC721Holder and ERC1155Holder upgradeable uups with factory > Snapshot 1 @@ -7922,66 +13152,85 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSAUpgradeable, ERC7821 {␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ + {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - view␊ override␊ - returns (bool)␊ - {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ - }␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155HolderFactory {␊ + CustomAccountWithSignerMultisigERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721HolderERC1155Holder();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigERC721HolderERC1155Holder.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigERC721HolderERC1155Holder.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerRSA with ERC7579 upgradeable transparent +## Account with SignerMultisig with ERC7821 Execution upgradeable uups > Snapshot 1 @@ -7989,64 +13238,58 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC7821, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __AccountERC7579_init();␊ - __SignerRSA_init(e, n);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ public␊ - view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ - returns (bytes4)␊ + initializer␊ {␊ - // 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - // The following functions are overrides required by Solidity.␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override␊ returns (bool)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerRSA with ERC7579 upgradeable transparent with factory +## Account with SignerMultisig with ERC7821 Execution upgradeable uups with factory > Snapshot 1 @@ -8054,97 +13297,93 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC7821, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __AccountERC7579_init();␊ - __SignerRSA_init(e, n);␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ public␊ - view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ - returns (bytes4)␊ + initializer␊ {␊ - // 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - // The following functions are overrides required by Solidity.␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override␊ returns (bool)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerRSA with ERC7579 with ERC1271 upgradeable transparent +## Account with SignerMultisig with ERC7579 upgradeable uups > Snapshot 1 @@ -8155,21 +13394,57 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ __AccountERC7579_init();␊ - __SignerRSA_init(e, n);␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -8181,23 +13456,14 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ - {␊ - return super.isValidSignature(hash, signature);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -8205,7 +13471,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerRSA with ERC7579 with ERC1271 upgradeable transparent with factory +## Account with SignerMultisig with ERC7579 upgradeable uups with factory > Snapshot 1 @@ -8216,22 +13482,59 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ __AccountERC7579_init();␊ - __SignerRSA_init(e, n);␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -8243,23 +13546,14 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ - {␊ - return super.isValidSignature(hash, signature);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -8269,37 +13563,38 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerRSA with ERC7579 with ERC7739 upgradeable transparent +## Account with SignerMultisig with ERC7579 with ERC1271 upgradeable uups > Snapshot 1 @@ -8310,34 +13605,44 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ __AccountERC7579_init();␊ - __SignerRSA_init(e, n);␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -8349,14 +13654,23 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -8364,7 +13678,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerRSA with ERC7579 with ERC7739 upgradeable transparent with factory +## Account with SignerMultisig with ERC7579 with ERC1271 upgradeable uups with factory > Snapshot 1 @@ -8375,35 +13689,46 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, SignerRSAUpgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ __AccountERC7579_init();␊ - __SignerRSA_init(e, n);␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -8415,14 +13740,23 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -8432,37 +13766,38 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerRSA with ERC7579 hooks upgradeable transparent +## Account with SignerMultisig with ERC7579 with ERC7739 upgradeable uups > Snapshot 1 @@ -8473,22 +13808,26 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerRSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __AccountERC7579Hooked_init();␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -8502,6 +13841,24 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -8513,14 +13870,14 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -8528,7 +13885,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerRSA with ERC7579 hooks upgradeable transparent with factory +## Account with SignerMultisig with ERC7579 with ERC7739 upgradeable uups with factory > Snapshot 1 @@ -8539,23 +13896,28 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {SignerRSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerRSAUpgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, SignerRSAUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __AccountERC7579Hooked_init();␊ - __SignerRSA_init(e, n);␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -8569,6 +13931,24 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -8580,14 +13960,14 @@ Generated by [AVA](https://avajs.dev). return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerRSAUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerRSAUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ // to ensure the correct order of function resolution.␊ // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(SignerRSAUpgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -8597,37 +13977,38 @@ Generated by [AVA](https://avajs.dev). contract MyAccountFactory {␊ MyAccount public immutable implementation = new MyAccount();␊ ␊ - function deploy(bytes memory e, bytes memory n, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(e, n, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(e, n);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes memory e, bytes memory n, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(e, n, salt));␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, threshold)));␊ }␊ ␊ - function _salt(bytes memory e, bytes memory n, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(e, n, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerMultisig named non-upgradeable +## Account with SignerMultisig with ERC7579 hooks upgradeable uups > Snapshot 1 @@ -8635,123 +14016,43 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - ␊ - contract CustomAccountWithSignerMultisig is Account, EIP712, ERC7739, MultiSignerERC7913 {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - EIP712("CustomAccount with SignerMultisig", "1")␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ - }␊ - ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ - }␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ }␊ - }␊ - ` - -## Account with SignerMultisig with ERC1271 non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - ␊ - contract CustomAccountWithSignerMultisigERC1271 is Account, IERC1271, MultiSignerERC7913 {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ public␊ - view␊ - override␊ - returns (bytes4)␊ + initializer␊ {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ - }␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ - }␊ - ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ - }␊ - ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ - }␊ - }␊ - ` - -## Account with SignerMultisig with ERC7739 non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - ␊ - contract CustomAccountWithSignerMultisigERC7739 is Account, EIP712, ERC7739, MultiSignerERC7913 {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - EIP712("CustomAccount with SignerMultisigERC7739", "1")␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ - }␊ - ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ - }␊ - ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ - }␊ - ` - -## Account with SignerMultisig with ERC721Holder non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - EIP712("CustomAccount with SignerMultisigERC721Holder", "1")␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -8764,10 +14065,39 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ` -## Account with SignerMultisig with ERC1155Holder non-upgradeable +## Account with SignerMultisig with ERC7579 hooks upgradeable uups with factory > Snapshot 1 @@ -8775,17 +14105,45 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC1155Holder {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - EIP712("CustomAccount with SignerMultisigERC1155Holder", "1")␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("MyAccount", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -8798,45 +14156,72 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - }␊ - ` - -## Account with SignerMultisig with ERC721Holder and ERC1155Holder non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder, ERC1155Holder {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ - MultiSignerERC7913(signers, threshold)␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ {}␊ ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, threshold)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7821 Execution non-upgradeable +## Account with SignerMultisig named upgradeable transparent > Snapshot 1 @@ -8847,14 +14232,21 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, MultiSignerERC7913, ERC7821 {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - EIP712("MyAccount", "1")␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerMultisig", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -8867,19 +14259,10 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - 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 SignerMultisig with ERC7579 non-upgradeable +## Account with SignerMultisig named upgradeable transparent with factory > Snapshot 1 @@ -8887,30 +14270,24 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - EIP712("MyAccount", "1")␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerMultisig", "1") {␊ + _disableInitializers();␊ + }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ public␊ - view␊ - override(AccountERC7579, ERC7739)␊ - returns (bytes4)␊ + initializer␊ {␊ - // 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;␊ + __MultiSignerERC7913_init(signers, threshold);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -8924,33 +14301,44 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + }␊ ␊ - // The following functions are overrides required by Solidity.␊ + contract CustomAccountWithSignerMultisigFactory {␊ + CustomAccountWithSignerMultisig public immutable implementation = new CustomAccountWithSignerMultisig();␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579)␊ - returns (uint256)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ {␊ - return super._validateUserOp(userOp, userOpHash);␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerMultisig(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - // IMPORTANT: Make sure SignerMultisig is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisig)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ view␊ - override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ + returns (address)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7579 with ERC1271 non-upgradeable +## Account with SignerMultisig with ERC1271 upgradeable transparent > Snapshot 1 @@ -8958,65 +14346,48 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - ␊ - contract MyAccount is Account, IERC1271, AccountERC7579, MultiSignerERC7913 {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ - }␊ - ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ - }␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ + contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ }␊ ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579)␊ - returns (uint256)␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ {␊ - return super._validateUserOp(userOp, userOpHash);␊ + __MultiSignerERC7913_init(signers, threshold);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(IERC1271, AccountERC7579)␊ + override␊ returns (bytes4)␊ {␊ - return super.isValidSignature(hash, signature);␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - // IMPORTANT: Make sure SignerMultisig is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisig)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ + }␊ + ␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7579 with ERC7739 non-upgradeable +## Account with SignerMultisig with ERC1271 upgradeable transparent with factory > Snapshot 1 @@ -9024,30 +14395,32 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - EIP712("MyAccount", "1")␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579, ERC7739)␊ + override␊ 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;␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9061,33 +14434,44 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + }␊ ␊ - // The following functions are overrides required by Solidity.␊ + contract CustomAccountWithSignerMultisigERC1271Factory {␊ + CustomAccountWithSignerMultisigERC1271 public immutable implementation = new CustomAccountWithSignerMultisigERC1271();␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579)␊ - returns (uint256)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ {␊ - return super._validateUserOp(userOp, userOpHash);␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerMultisigERC1271(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - // IMPORTANT: Make sure SignerMultisig is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisig)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ view␊ - override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ + returns (address)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + internal␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7579 hooks non-upgradeable +## Account with SignerMultisig with ERC7739 upgradeable transparent > Snapshot 1 @@ -9095,31 +14479,23 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ - import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913 {␊ - constructor(bytes[] memory signers, uint64 threshold)␊ - EIP712("MyAccount", "1")␊ - MultiSignerERC7913(signers, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("CustomAccount with SignerMultisigERC7739", "1") {␊ + _disableInitializers();␊ + }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ public␊ - view␊ - override(AccountERC7579, ERC7739)␊ - returns (bytes4)␊ + initializer␊ {␊ - // 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;␊ + __MultiSignerERC7913_init(signers, threshold);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9133,33 +14509,10 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - // 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 SignerMultisig is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisig)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ }␊ ` -## Account with SignerMultisig named upgradeable uups +## Account with SignerMultisig with ERC7739 upgradeable transparent with factory > Snapshot 1 @@ -9172,11 +14525,11 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisig", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisigERC7739", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -9185,7 +14538,6 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9199,16 +14551,44 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ + contract CustomAccountWithSignerMultisigERC7739Factory {␊ + CustomAccountWithSignerMultisigERC7739 public immutable implementation = new CustomAccountWithSignerMultisigERC7739();␊ + ␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerMultisigERC7739(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ }␊ ` -## Account with SignerMultisig with ERC1271 upgradeable uups +## Account with SignerMultisig with ERC721Holder upgradeable transparent > Snapshot 1 @@ -9217,32 +14597,23 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ + constructor() EIP712("CustomAccount with SignerMultisigERC721Holder", "1") {␊ + _disableInitializers();␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ public␊ - view␊ - override␊ - returns (bytes4)␊ + initializer␊ {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + __MultiSignerERC7913_init(signers, threshold);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9256,16 +14627,10 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ }␊ ` -## Account with SignerMultisig with ERC7739 upgradeable uups +## Account with SignerMultisig with ERC721Holder upgradeable transparent with factory > Snapshot 1 @@ -9275,14 +14640,15 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisigERC7739", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisigERC721Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -9291,7 +14657,6 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9305,16 +14670,44 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ + contract CustomAccountWithSignerMultisigERC721HolderFactory {␊ + CustomAccountWithSignerMultisigERC721Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721Holder();␊ + ␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerMultisigERC721Holder(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ }␊ ` -## Account with SignerMultisig with ERC721Holder upgradeable uups +## Account with SignerMultisig with ERC1155Holder upgradeable transparent > Snapshot 1 @@ -9324,15 +14717,14 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, UUPSUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC1155Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisigERC721Holder", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisigERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -9341,7 +14733,6 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9355,16 +14746,10 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ }␊ ` -## Account with SignerMultisig with ERC1155Holder upgradeable uups +## Account with SignerMultisig with ERC1155Holder upgradeable transparent with factory > Snapshot 1 @@ -9378,9 +14763,9 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC1155Holder, UUPSUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC1155Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("CustomAccount with SignerMultisigERC1155Holder", "1") {␊ _disableInitializers();␊ @@ -9391,7 +14776,6 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9405,16 +14789,44 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ + contract CustomAccountWithSignerMultisigERC1155HolderFactory {␊ + CustomAccountWithSignerMultisigERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC1155Holder();␊ + ␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerMultisigERC1155Holder(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + }␊ + ␊ + function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ }␊ ` -## Account with SignerMultisig with ERC721Holder and ERC1155Holder upgradeable uups +## Account with SignerMultisig with ERC721Holder and ERC1155Holder upgradeable transparent > Snapshot 1 @@ -9429,9 +14841,8 @@ Generated by [AVA](https://avajs.dev). import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, ERC1155Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor()␊ EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ @@ -9444,7 +14855,6 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9458,16 +14868,10 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ }␊ ` -## Account with SignerMultisig with ERC7821 Execution upgradeable uups +## Account with SignerMultisig with ERC721Holder and ERC1155Holder upgradeable transparent with factory > Snapshot 1 @@ -9477,15 +14881,18 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC7821, UUPSUpgradeable {␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, ERC1155Holder {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ + {␊ _disableInitializers();␊ }␊ ␊ @@ -9494,7 +14901,6 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9508,25 +14914,44 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ - internal␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155HolderFactory {␊ + CustomAccountWithSignerMultisigERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721HolderERC1155Holder();␊ + ␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + CustomAccountWithSignerMultisigERC721HolderERC1155Holder(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ view␊ - override␊ - returns (bool)␊ + returns (address)␊ {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ + function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ + pure␊ + returns (bytes32)␊ + {␊ + return keccak256(abi.encode(signers, threshold, salt));␊ + }␊ }␊ ` -## Account with SignerMultisig with ERC7579 upgradeable uups +## Account with SignerMultisig with ERC7821 Execution upgradeable transparent > Snapshot 1 @@ -9534,17 +14959,14 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC7821 {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ @@ -9554,21 +14976,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ - __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ - }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9583,38 +14991,18 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override␊ returns (bool)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7579 with ERC1271 upgradeable uups +## Account with SignerMultisig with ERC7821 Execution upgradeable transparent with factory > Snapshot 1 @@ -9622,18 +15010,17 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC7821 {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -9641,9 +15028,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ - __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -9658,47 +15043,52 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - function _authorizeUpgrade(address newImplementation)␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ + view␊ override␊ - onlyEntryPointOrSelf␊ - {}␊ + returns (bool)␊ + {␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + }␊ + }␊ ␊ - // The following functions are overrides required by Solidity.␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ + function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ {␊ - return super._validateUserOp(userOp, userOpHash);␊ + bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ + address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + if (instance.code.length == 0) {␊ + Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ + MyAccount(instance).initialize(signers, threshold);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ + returns (address)␊ {␊ - return super.isValidSignature(hash, signature);␊ + return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ }␊ ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ internal␊ - view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ + pure␊ + returns (bytes32)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return keccak256(abi.encode(signers, threshold, salt));␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7579 with ERC7739 upgradeable uups +## Account with SignerMultisig with ERC7579 upgradeable transparent > Snapshot 1 @@ -9714,9 +15104,8 @@ Generated by [AVA](https://avajs.dev). import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ @@ -9728,7 +15117,6 @@ Generated by [AVA](https://avajs.dev). {␊ __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -9754,12 +15142,6 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -9786,7 +15168,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisig with ERC7579 hooks upgradeable uups +## Account with SignerMultisig with ERC7579 upgradeable transparent with factory > Snapshot 1 @@ -9797,15 +15179,14 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, MultiSignerERC7913Upgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ @@ -9815,9 +15196,8 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ - __AccountERC7579Hooked_init();␊ + __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ - __UUPSUpgradeable_init();␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ @@ -9843,12 +15223,6 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -9873,92 +15247,9 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ - ` - -## Account with SignerMultisig named upgradeable transparent - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - ␊ - contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisig", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ - }␊ - ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ - }␊ - ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ - }␊ - }␊ - ` - -## Account with SignerMultisig named upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ - ␊ - contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisig", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ - }␊ - ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ - }␊ - ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ - }␊ - }␊ ␊ - contract CustomAccountWithSignerMultisigFactory {␊ - CustomAccountWithSignerMultisig public immutable implementation = new CustomAccountWithSignerMultisig();␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ @@ -9968,7 +15259,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerMultisig(instance).initialize(signers, threshold);␊ + MyAccount(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -9976,6 +15267,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ @@ -9983,6 +15275,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, threshold, salt));␊ @@ -9990,7 +15283,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisig with ERC1271 upgradeable transparent +## Account with SignerMultisig with ERC7579 with ERC1271 upgradeable transparent > Snapshot 1 @@ -9998,12 +15291,15 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Upgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() {␊ _disableInitializers();␊ @@ -10013,17 +15309,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override␊ - returns (bytes4)␊ - {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -10036,92 +15324,42 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - }␊ - ` - -## Account with SignerMultisig with ERC1271 upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ - }␊ + // The following functions are overrides required by Solidity.␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ {␊ - __MultiSignerERC7913_init(signers, threshold);␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override␊ + override(IERC1271, AccountERC7579Upgradeable)␊ returns (bytes4)␊ {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ - }␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ - }␊ - ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ - }␊ - ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ - }␊ - }␊ - ␊ - contract CustomAccountWithSignerMultisigERC1271Factory {␊ - CustomAccountWithSignerMultisigERC1271 public immutable implementation = new CustomAccountWithSignerMultisigERC1271();␊ - ␊ - function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerMultisigERC1271(instance).initialize(signers, threshold);␊ - }␊ - return instance;␊ - ␊ - }␊ - ␊ - function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + return super.isValidSignature(hash, signature);␊ }␊ ␊ - function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ - returns (bytes32)␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ {␊ - return keccak256(abi.encode(signers, threshold, salt));␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7739 upgradeable transparent +## Account with SignerMultisig with ERC7579 with ERC1271 upgradeable transparent with factory > Snapshot 1 @@ -10129,15 +15367,18 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisigERC7739", "1") {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ @@ -10145,6 +15386,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ }␊ ␊ @@ -10159,52 +15401,42 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - }␊ - ` - -## Account with SignerMultisig with ERC7739 upgradeable transparent with factory - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + // The following functions are overrides required by Solidity.␊ ␊ - contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisigERC7739", "1") {␊ - _disableInitializers();␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ - initializer␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ - }␊ - ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ + return super.isValidSignature(hash, signature);␊ }␊ ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ␊ - contract CustomAccountWithSignerMultisigERC7739Factory {␊ - CustomAccountWithSignerMultisigERC7739 public immutable implementation = new CustomAccountWithSignerMultisigERC7739();␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ @@ -10214,7 +15446,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerMultisigERC7739(instance).initialize(signers, threshold);␊ + MyAccount(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -10222,6 +15454,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ @@ -10229,6 +15462,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, threshold, salt));␊ @@ -10236,7 +15470,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisig with ERC721Holder upgradeable transparent +## Account with SignerMultisig with ERC7579 with ERC7739 upgradeable transparent > Snapshot 1 @@ -10244,16 +15478,18 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisigERC721Holder", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -10261,8 +15497,21 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -10275,10 +15524,33 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ` -## Account with SignerMultisig with ERC721Holder upgradeable transparent with factory +## Account with SignerMultisig with ERC7579 with ERC7739 upgradeable transparent with factory > Snapshot 1 @@ -10286,17 +15558,19 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisigERC721Holder", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -10304,8 +15578,21 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -10318,10 +15605,33 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ␊ - contract CustomAccountWithSignerMultisigERC721HolderFactory {␊ - CustomAccountWithSignerMultisigERC721Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721Holder();␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ @@ -10331,7 +15641,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerMultisigERC721Holder(instance).initialize(signers, threshold);␊ + MyAccount(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -10339,6 +15649,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ @@ -10346,6 +15657,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, threshold, salt));␊ @@ -10353,7 +15665,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisig with ERC1155Holder upgradeable transparent +## Account with SignerMultisig with ERC7579 hooks upgradeable transparent > Snapshot 1 @@ -10361,16 +15673,19 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC1155Holder {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, MultiSignerERC7913Upgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisigERC1155Holder", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -10378,8 +15693,21 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579Hooked_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -10392,10 +15720,33 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ` -## Account with SignerMultisig with ERC1155Holder upgradeable transparent with factory +## Account with SignerMultisig with ERC7579 hooks upgradeable transparent with factory > Snapshot 1 @@ -10403,17 +15754,20 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC1155Holder {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, MultiSignerERC7913Upgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisigERC1155Holder", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -10421,8 +15775,21 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579Hooked_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -10432,13 +15799,36 @@ Generated by [AVA](https://avajs.dev). _removeSigners(signers);␊ }␊ ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ + }␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ␊ - contract CustomAccountWithSignerMultisigERC1155HolderFactory {␊ - CustomAccountWithSignerMultisigERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC1155Holder();␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ @@ -10448,7 +15838,7 @@ Generated by [AVA](https://avajs.dev). address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ if (instance.code.length == 0) {␊ Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerMultisigERC1155Holder(instance).initialize(signers, threshold);␊ + MyAccount(instance).initialize(signers, threshold);␊ }␊ return instance;␊ ␊ @@ -10456,6 +15846,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ @@ -10463,6 +15854,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, threshold, salt));␊ @@ -10470,7 +15862,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisig with ERC721Holder and ERC1155Holder upgradeable transparent +## Account with SignerMultisigWeighted named non-upgradeable > Snapshot 1 @@ -10480,25 +15872,20 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ - {␊ - _disableInitializers();␊ - }␊ + contract CustomAccountWithSignerMultisigWeighted is Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisigWeighted", "1")␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - initializer␊ + onlyEntryPointOrSelf␊ {␊ - __MultiSignerERC7913_init(signers, threshold);␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -10515,7 +15902,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisig with ERC721Holder and ERC1155Holder upgradeable transparent with factory +## Account with SignerMultisigWeighted with ERC1271 non-upgradeable > Snapshot 1 @@ -10524,27 +15911,28 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ + contract CustomAccountWithSignerMultisigWeightedERC1271 is Account, IERC1271, MultiSignerERC7913Weighted {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ {␊ - _disableInitializers();␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - initializer␊ + onlyEntryPointOrSelf␊ {␊ - __MultiSignerERC7913_init(signers, threshold);␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -10559,41 +15947,9 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ }␊ - ␊ - contract CustomAccountWithSignerMultisigERC721HolderERC1155HolderFactory {␊ - CustomAccountWithSignerMultisigERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigERC721HolderERC1155Holder();␊ - ␊ - function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - CustomAccountWithSignerMultisigERC721HolderERC1155Holder(instance).initialize(signers, threshold);␊ - }␊ - return instance;␊ - ␊ - }␊ - ␊ - function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ - }␊ - ␊ - function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - internal␊ - returns (bytes32)␊ - {␊ - return keccak256(abi.encode(signers, threshold, salt));␊ - }␊ - }␊ ` -## Account with SignerMultisig with ERC7821 Execution upgradeable transparent +## Account with SignerMultisigWeighted with ERC7739 non-upgradeable > Snapshot 1 @@ -10604,21 +15960,19 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ + contract CustomAccountWithSignerMultisigWeightedERC7739 is Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisigWeightedERC7739", "1")␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - initializer␊ + onlyEntryPointOrSelf␊ {␊ - __MultiSignerERC7913_init(signers, threshold);␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -10632,19 +15986,10 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - 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 SignerMultisig with ERC7821 Execution upgradeable transparent with factory +## Account with SignerMultisigWeighted with ERC721Holder non-upgradeable > Snapshot 1 @@ -10654,23 +15999,21 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Upgradeable, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ + contract CustomAccountWithSignerMultisigWeightedERC721Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisigWeightedERC721Holder", "1")␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - initializer␊ + onlyEntryPointOrSelf␊ {␊ - __MultiSignerERC7913_init(signers, threshold);␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -10684,51 +16027,51 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - 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 SignerMultisigWeighted with ERC1155Holder non-upgradeable + +> Snapshot 1 + + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC1155Holder {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisigWeightedERC1155Holder", "1")␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ + ␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - returns (address)␊ + onlyEntryPointOrSelf␊ {␊ - bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signers, threshold);␊ - }␊ - return instance;␊ - ␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ - function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ - function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - internal␊ - returns (bytes32)␊ - {␊ - return keccak256(abi.encode(signers, threshold, salt));␊ + function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _removeSigners(signers);␊ + }␊ + ␊ + function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ + _setThreshold(threshold);␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7579 upgradeable transparent +## Account with SignerMultisigWeighted with ERC721Holder and ERC1155Holder non-upgradeable > Snapshot 1 @@ -10736,39 +16079,24 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __AccountERC7579_init();␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ + contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder, ERC1155Holder {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + EIP712("CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder", "1")␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ - returns (bytes4)␊ + onlyEntryPointOrSelf␊ {␊ - // 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -10782,33 +16110,10 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ - internal␊ - view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ }␊ ` -## Account with SignerMultisig with ERC7579 upgradeable transparent with factory +## Account with SignerMultisigWeighted with ERC7821 Execution non-upgradeable > Snapshot 1 @@ -10816,40 +16121,23 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __AccountERC7579_init();␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC7821 {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + EIP712("MyAccount", "1")␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ - returns (bytes4)␊ + onlyEntryPointOrSelf␊ {␊ - // 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -10864,64 +16152,18 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override␊ returns (bool)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ - }␊ - ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ - ␊ - function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signers, threshold);␊ - }␊ - return instance;␊ - ␊ - }␊ - ␊ - function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ - }␊ - ␊ - function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - internal␊ - returns (bytes32)␊ - {␊ - return keccak256(abi.encode(signers, threshold, salt));␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7579 with ERC1271 upgradeable transparent +## Account with SignerMultisigWeighted with ERC7579 non-upgradeable > Snapshot 1 @@ -10931,24 +16173,36 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + EIP712("MyAccount", "1")␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ + ␊ + 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 initialize(bytes[] memory signers, uint64 threshold)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - initializer␊ + onlyEntryPointOrSelf␊ {␊ - __AccountERC7579_init();␊ - __MultiSignerERC7913_init(signers, threshold);␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -10967,29 +16221,20 @@ Generated by [AVA](https://avajs.dev). ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579Upgradeable)␊ + override(Account, AccountERC7579)␊ returns (uint256)␊ {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ - {␊ - return super.isValidSignature(hash, signature);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisigWeighted is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisigWeighted)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + // AccountERC7579 returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -10997,7 +16242,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisig with ERC7579 with ERC1271 upgradeable transparent with factory +## Account with SignerMultisigWeighted with ERC7579 with ERC1271 non-upgradeable > Snapshot 1 @@ -11007,25 +16252,22 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ - _disableInitializers();␊ - }␊ + contract MyAccount is Account, IERC1271, AccountERC7579, MultiSignerERC7913Weighted {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - initializer␊ + onlyEntryPointOrSelf␊ {␊ - __AccountERC7579_init();␊ - __MultiSignerERC7913_init(signers, threshold);␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -11044,7 +16286,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579Upgradeable)␊ + override(Account, AccountERC7579)␊ returns (uint256)␊ {␊ return super._validateUserOp(userOp, userOpHash);␊ @@ -11053,60 +16295,28 @@ Generated by [AVA](https://avajs.dev). function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ + override(IERC1271, AccountERC7579)␊ returns (bytes4)␊ {␊ return super.isValidSignature(hash, signature);␊ }␊ ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisigWeighted is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisigWeighted)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + // AccountERC7579 returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ - view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ - }␊ - ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ - ␊ - function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signers, threshold);␊ - }␊ - return instance;␊ - ␊ - }␊ - ␊ - function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ - }␊ - ␊ - function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - internal␊ - returns (bytes32)␊ + view␊ + override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ + returns (bool)␊ {␊ - return keccak256(abi.encode(signers, threshold, salt));␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ ` -## Account with SignerMultisig with ERC7579 with ERC7739 upgradeable transparent +## Account with SignerMultisigWeighted with ERC7579 with ERC7739 non-upgradeable > Snapshot 1 @@ -11116,37 +16326,36 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __AccountERC7579_init();␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + EIP712("MyAccount", "1")␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ + 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ + public␊ + onlyEntryPointOrSelf␊ + {␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -11165,20 +16374,20 @@ Generated by [AVA](https://avajs.dev). ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579Upgradeable)␊ + override(Account, AccountERC7579)␊ returns (uint256)␊ {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisigWeighted is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisigWeighted)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + // AccountERC7579 returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ @@ -11186,7 +16395,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisig with ERC7579 with ERC7739 upgradeable transparent with factory +## Account with SignerMultisigWeighted with ERC7579 hooks non-upgradeable > Snapshot 1 @@ -11196,38 +16405,37 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ + import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ + import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ + import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913Upgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ - }␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __AccountERC7579_init();␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913Weighted {␊ + constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + EIP712("MyAccount", "1")␊ + MultiSignerERC7913Weighted(signers, weights, threshold)␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ + 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ + ␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ + public␊ + onlyEntryPointOrSelf␊ + {␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -11246,60 +16454,28 @@ Generated by [AVA](https://avajs.dev). ␊ function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ internal␊ - override(Account, AccountERC7579Upgradeable)␊ + override(Account, AccountERC7579)␊ returns (uint256)␊ {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ + // IMPORTANT: Make sure SignerMultisigWeighted is most derived than AccountERC7579␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisigWeighted)␊ // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + // AccountERC7579 returns false for _rawSignatureValidation␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ returns (bool)␊ {␊ return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ - ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ - ␊ - function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ - if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signers, threshold);␊ - }␊ - return instance;␊ - ␊ - }␊ - ␊ - function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - public␊ - returns (address)␊ - {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ - }␊ - ␊ - function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ - internal␊ - returns (bytes32)␊ - {␊ - return keccak256(abi.encode(signers, threshold, salt));␊ - }␊ - }␊ ` -## Account with SignerMultisig with ERC7579 hooks upgradeable transparent +## Account with SignerMultisigWeighted named upgradeable uups > Snapshot 1 @@ -11307,40 +16483,32 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, MultiSignerERC7913Upgradeable {␊ + contract CustomAccountWithSignerMultisigWeighted is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisigWeighted", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ public␊ initializer␊ {␊ - __AccountERC7579Hooked_init();␊ - __MultiSignerERC7913_init(signers, threshold);␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ - returns (bytes4)␊ + onlyEntryPointOrSelf␊ {␊ - // 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -11355,32 +16523,15 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerMultisig with ERC7579 hooks upgradeable transparent with factory +## Account with SignerMultisigWeighted named upgradeable uups with factory > Snapshot 1 @@ -11388,41 +16539,34 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ - import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, MultiSignerERC7913Upgradeable {␊ + contract CustomAccountWithSignerMultisigWeighted is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ + constructor() EIP712("CustomAccount with SignerMultisigWeighted", "1") {␊ _disableInitializers();␊ }␊ ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ public␊ initializer␊ {␊ - __AccountERC7579Hooked_init();␊ - __MultiSignerERC7913_init(signers, threshold);␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ - view␊ - override(AccountERC7579Upgradeable, ERC7739)␊ - returns (bytes4)␊ + onlyEntryPointOrSelf␊ {␊ - // 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + _setSignerWeights(signers, weights);␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -11437,64 +16581,48 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ - internal␊ - override(Account, AccountERC7579Upgradeable)␊ - returns (uint256)␊ - {␊ - return super._validateUserOp(userOp, userOpHash);␊ - }␊ - ␊ - // IMPORTANT: Make sure SignerMultisigUpgradeable is most derived than AccountERC7579Upgradeable␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigUpgradeable)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - view␊ - override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ␊ - contract MyAccountFactory {␊ - MyAccount public immutable implementation = new MyAccount();␊ + contract CustomAccountWithSignerMultisigWeightedFactory {␊ + CustomAccountWithSignerMultisigWeighted public immutable implementation = new CustomAccountWithSignerMultisigWeighted();␊ ␊ - function deploy(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ returns (address)␊ {␊ - bytes32 effectiveSalt = _salt(signers, threshold, salt);␊ - address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigWeighted.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ if (instance.code.length == 0) {␊ - Clones.cloneDeterministic(address(implementation), effectiveSalt);␊ - MyAccount(instance).initialize(signers, threshold);␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ }␊ return instance;␊ ␊ }␊ ␊ - function predict(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ - return Clones.predictDeterministicAddress(address(implementation), _salt(signers, threshold, salt));␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigWeighted.initialize, (signers, weights, threshold)));␊ }␊ ␊ - function _salt(bytes[] memory signers, uint64 threshold, bytes32 salt)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ - returns (bytes32)␊ + view␊ + returns (address)␊ {␊ - return keccak256(abi.encode(signers, threshold, salt));␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerMultisigWeighted named non-upgradeable +## Account with SignerMultisigWeighted with ERC1271 upgradeable uups > Snapshot 1 @@ -11503,15 +16631,33 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeighted is Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - EIP712("CustomAccount with SignerMultisigWeighted", "1")␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigWeightedERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override␊ + returns (bytes4)␊ + {␊ + return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ + }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -11531,10 +16677,16 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerMultisigWeighted with ERC1271 non-upgradeable +## Account with SignerMultisigWeighted with ERC1271 upgradeable uups with factory > Snapshot 1 @@ -11544,12 +16696,25 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC1271 is Account, IERC1271, MultiSignerERC7913Weighted {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigWeightedERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -11578,10 +16743,49 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC1271Factory {␊ + CustomAccountWithSignerMultisigWeightedERC1271 public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC1271();␊ + ␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC1271.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC1271.initialize, (signers, weights, threshold)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ }␊ ` -## Account with SignerMultisigWeighted with ERC7739 non-upgradeable +## Account with SignerMultisigWeighted with ERC7739 upgradeable uups > Snapshot 1 @@ -11592,13 +16796,25 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC7739 is Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + contract CustomAccountWithSignerMultisigWeightedERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ EIP712("CustomAccount with SignerMultisigWeightedERC7739", "1")␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -11618,10 +16834,16 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerMultisigWeighted with ERC721Holder non-upgradeable +## Account with SignerMultisigWeighted with ERC7739 upgradeable uups with factory > Snapshot 1 @@ -11631,15 +16853,28 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC721Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - EIP712("CustomAccount with SignerMultisigWeightedERC721Holder", "1")␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigWeightedERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigWeightedERC7739", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -11659,51 +16894,49 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ - }␊ - ` - -## Account with SignerMultisigWeighted with ERC1155Holder non-upgradeable - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC1155Holder {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - EIP712("CustomAccount with SignerMultisigWeightedERC1155Holder", "1")␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ {}␊ + }␊ ␊ - function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ + contract CustomAccountWithSignerMultisigWeightedERC7739Factory {␊ + CustomAccountWithSignerMultisigWeightedERC7739 public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC7739();␊ + ␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ - onlyEntryPointOrSelf␊ + returns (address)␊ {␊ - _setSignerWeights(signers, weights);␊ - }␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC7739.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC7739.initialize, (signers, weights, threshold)));␊ }␊ ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerMultisigWeighted with ERC721Holder and ERC1155Holder non-upgradeable +## Account with SignerMultisigWeighted with ERC721Holder upgradeable uups > Snapshot 1 @@ -11713,16 +16946,27 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder, ERC1155Holder {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - EIP712("CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder", "1")␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigWeightedERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC721Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigWeightedERC721Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -11742,10 +16986,16 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerMultisigWeighted with ERC7821 Execution non-upgradeable +## Account with SignerMultisigWeighted with ERC721Holder upgradeable uups with factory > Snapshot 1 @@ -11753,17 +17003,31 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC721Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigWeightedERC721Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC7821 {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - EIP712("MyAccount", "1")␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -11784,18 +17048,48 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - view␊ override␊ - returns (bool)␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC721HolderFactory {␊ + CustomAccountWithSignerMultisigWeightedERC721Holder public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC721Holder();␊ + ␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC721Holder.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC721Holder.initialize, (signers, weights, threshold)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerMultisigWeighted with ERC7579 non-upgradeable +## Account with SignerMultisigWeighted with ERC1155Holder upgradeable uups > Snapshot 1 @@ -11803,31 +17097,28 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - EIP712("MyAccount", "1")␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigWeightedERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ public␊ - view␊ - override(AccountERC7579, ERC7739)␊ - returns (bytes4)␊ + initializer␊ {␊ - // 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;␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -11849,32 +17140,15 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - // 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 SignerMultisigWeighted is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisigWeighted)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - view␊ - override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerMultisigWeighted with ERC7579 with ERC1271 non-upgradeable +## Account with SignerMultisigWeighted with ERC1155Holder upgradeable uups with factory > Snapshot 1 @@ -11882,18 +17156,31 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Account, IERC1271, AccountERC7579, MultiSignerERC7913Weighted {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigWeightedERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -11914,41 +17201,48 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - override(Account, AccountERC7579)␊ - returns (uint256)␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC1155HolderFactory {␊ + CustomAccountWithSignerMultisigWeightedERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC1155Holder();␊ + ␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ {␊ - return super._validateUserOp(userOp, userOpHash);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC1155Holder.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ view␊ - override(IERC1271, AccountERC7579)␊ - returns (bytes4)␊ + returns (address)␊ {␊ - return super.isValidSignature(hash, signature);␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC1155Holder.initialize, (signers, weights, threshold)));␊ }␊ ␊ - // IMPORTANT: Make sure SignerMultisigWeighted is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisigWeighted)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ view␊ - override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ + returns (address)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerMultisigWeighted with ERC7579 with ERC7739 non-upgradeable +## Account with SignerMultisigWeighted with ERC721Holder and ERC1155Holder upgradeable uups > Snapshot 1 @@ -11956,31 +17250,29 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - EIP712("MyAccount", "1")␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ public␊ - view␊ - override(AccountERC7579, ERC7739)␊ - returns (bytes4)␊ + initializer␊ {␊ - // 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;␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -12002,32 +17294,15 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - // 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 SignerMultisigWeighted is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisigWeighted)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - view␊ - override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ - {␊ - return super._rawSignatureValidation(hash, signature);␊ - }␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ }␊ ` -## Account with SignerMultisigWeighted with ERC7579 hooks non-upgradeable +## Account with SignerMultisigWeighted with ERC721Holder and ERC1155Holder upgradeable uups with factory > Snapshot 1 @@ -12035,32 +17310,31 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ - import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ - import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ - import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ - import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913Weighted {␊ - constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - EIP712("MyAccount", "1")␊ - MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {}␊ + contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor()␊ + EIP712("CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder", "1")␊ + {␊ + _disableInitializers();␊ + }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ public␊ - view␊ - override(AccountERC7579, ERC7739)␊ - returns (bytes4)␊ + initializer␊ {␊ - // 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;␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -12082,32 +17356,48 @@ Generated by [AVA](https://avajs.dev). _setThreshold(threshold);␊ }␊ ␊ - // The following functions are overrides required by Solidity.␊ - ␊ - function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + function _authorizeUpgrade(address newImplementation)␊ internal␊ - override(Account, AccountERC7579)␊ - returns (uint256)␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + ␊ + contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155HolderFactory {␊ + CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder public immutable implementation = new CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder();␊ + ␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ {␊ - return super._validateUserOp(userOp, userOpHash);␊ + bytes memory initcall = abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - // IMPORTANT: Make sure SignerMultisigWeighted is most derived than AccountERC7579␊ - // in the inheritance chain (i.e. contract ... is AccountERC7579, ..., SignerMultisigWeighted)␊ - // to ensure the correct order of function resolution.␊ - // AccountERC7579 returns false for _rawSignatureValidation␊ - function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder.initialize, (signers, weights, threshold)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ view␊ - override(MultiSignerERC7913, AbstractSigner, AccountERC7579)␊ - returns (bool)␊ + returns (address)␊ {␊ - return super._rawSignatureValidation(hash, signature);␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ }␊ ` -## Account with SignerMultisigWeighted named upgradeable uups +## Account with SignerMultisigWeighted with ERC7821 Execution upgradeable uups > Snapshot 1 @@ -12118,13 +17408,14 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeighted is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC7821, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("CustomAccount with SignerMultisigWeighted", "1") {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -12154,6 +17445,15 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -12163,7 +17463,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisigWeighted with ERC1271 upgradeable uups +## Account with SignerMultisigWeighted with ERC7821 Execution upgradeable uups with factory > Snapshot 1 @@ -12172,14 +17472,18 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC7821, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -12190,15 +17494,6 @@ Generated by [AVA](https://avajs.dev). __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ __UUPSUpgradeable_init();␊ }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override␊ - returns (bytes4)␊ - {␊ - return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -12218,6 +17513,15 @@ Generated by [AVA](https://avajs.dev). function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ _setThreshold(threshold);␊ }␊ + ␊ + function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + internal␊ + view␊ + override␊ + returns (bool)␊ + {␊ + return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -12225,9 +17529,42 @@ Generated by [AVA](https://avajs.dev). onlyEntryPointOrSelf␊ {}␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, weights, threshold)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ ` -## Account with SignerMultisigWeighted with ERC7739 upgradeable uups +## Account with SignerMultisigWeighted with ERC7579 upgradeable uups > Snapshot 1 @@ -12235,18 +17572,20 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerMultisigWeightedERC7739", "1")␊ - {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -12254,9 +17593,22 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ __UUPSUpgradeable_init();␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -12282,10 +17634,33 @@ Generated by [AVA](https://avajs.dev). override␊ onlyEntryPointOrSelf␊ {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigWeightedUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigWeightedUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ` -## Account with SignerMultisigWeighted with ERC721Holder upgradeable uups +## Account with SignerMultisigWeighted with ERC7579 upgradeable uups with factory > Snapshot 1 @@ -12293,19 +17668,22 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC721Holder, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerMultisigWeightedERC721Holder", "1")␊ - {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -12313,9 +17691,22 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ __UUPSUpgradeable_init();␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -12341,10 +17732,66 @@ Generated by [AVA](https://avajs.dev). override␊ onlyEntryPointOrSelf␊ {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigWeightedUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigWeightedUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ + }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, weights, threshold)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ }␊ ` -## Account with SignerMultisigWeighted with ERC1155Holder upgradeable uups +## Account with SignerMultisigWeighted with ERC7579 with ERC1271 upgradeable uups > Snapshot 1 @@ -12352,19 +17799,19 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC1155Holder, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerMultisigWeightedERC1155Holder", "1")␊ - {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ @@ -12372,6 +17819,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ __UUPSUpgradeable_init();␊ }␊ @@ -12400,10 +17848,42 @@ Generated by [AVA](https://avajs.dev). override␊ onlyEntryPointOrSelf␊ {}␊ + ␊ + // The following functions are overrides required by Solidity.␊ + ␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ + {␊ + return super.isValidSignature(hash, signature);␊ + }␊ + ␊ + // IMPORTANT: Make sure SignerMultisigWeightedUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigWeightedUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ + {␊ + return super._rawSignatureValidation(hash, signature);␊ + }␊ }␊ ` -## Account with SignerMultisigWeighted with ERC721Holder and ERC1155Holder upgradeable uups +## Account with SignerMultisigWeighted with ERC7579 with ERC1271 upgradeable uups with factory > Snapshot 1 @@ -12411,20 +17891,21 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Contracts ^5.4.0␊ pragma solidity ^0.8.27;␊ ␊ + import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ + import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor()␊ - EIP712("CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder", "1")␊ - {␊ + constructor() {␊ _disableInitializers();␊ }␊ ␊ @@ -12432,6 +17913,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ __UUPSUpgradeable_init();␊ }␊ @@ -12460,76 +17942,75 @@ Generated by [AVA](https://avajs.dev). override␊ onlyEntryPointOrSelf␊ {}␊ - }␊ - ` - -## Account with SignerMultisigWeighted with ERC7821 Execution upgradeable uups - -> Snapshot 1 - - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + // The following functions are overrides required by Solidity.␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913WeightedUpgradeable, ERC7821, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("MyAccount", "1") {␊ - _disableInitializers();␊ + function _validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash)␊ + internal␊ + override(Account, AccountERC7579Upgradeable)␊ + returns (uint256)␊ + {␊ + return super._validateUserOp(userOp, userOpHash);␊ }␊ ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ - initializer␊ + view␊ + override(IERC1271, AccountERC7579Upgradeable)␊ + returns (bytes4)␊ {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - __UUPSUpgradeable_init();␊ + return super.isValidSignature(hash, signature);␊ }␊ ␊ - function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ - public␊ - onlyEntryPointOrSelf␊ + // IMPORTANT: Make sure SignerMultisigWeightedUpgradeable is most derived than AccountERC7579Upgradeable␊ + // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigWeightedUpgradeable)␊ + // to ensure the correct order of function resolution.␊ + // AccountERC7579Upgradeable returns false for _rawSignatureValidation␊ + function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ + internal␊ + view␊ + override(MultiSignerERC7913Upgradeable, AbstractSigner, AccountERC7579Upgradeable)␊ + returns (bool)␊ {␊ - _setSignerWeights(signers, weights);␊ + return super._rawSignatureValidation(hash, signature);␊ }␊ + }␊ ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ - }␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ ␊ - function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _removeSigners(signers);␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ }␊ ␊ - function setThreshold(uint64 threshold) public onlyEntryPointOrSelf {␊ - _setThreshold(threshold);␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, weights, threshold)));␊ }␊ ␊ - function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ + function _predict(bytes32 salt, bytes memory initcall)␊ internal␊ view␊ - override␊ - returns (bool)␊ + returns (address)␊ {␊ - return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ }␊ ` -## Account with SignerMultisigWeighted with ERC7579 upgradeable uups +## Account with SignerMultisigWeighted with ERC7579 with ERC7739 upgradeable uups > Snapshot 1 @@ -12625,7 +18106,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisigWeighted with ERC7579 with ERC1271 upgradeable uups +## Account with SignerMultisigWeighted with ERC7579 with ERC7739 upgradeable uups with factory > Snapshot 1 @@ -12636,16 +18117,19 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ - import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913Upgradeable.sol";␊ import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579Upgradeable, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() {␊ + constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ ␊ @@ -12657,6 +18141,18 @@ Generated by [AVA](https://avajs.dev). __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ __UUPSUpgradeable_init();␊ }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ + view␊ + override(AccountERC7579Upgradeable, 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) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ + }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -12692,15 +18188,6 @@ Generated by [AVA](https://avajs.dev). {␊ return super._validateUserOp(userOp, userOpHash);␊ }␊ - ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ - view␊ - override(IERC1271, AccountERC7579Upgradeable)␊ - returns (bytes4)␊ - {␊ - return super.isValidSignature(hash, signature);␊ - }␊ ␊ // IMPORTANT: Make sure SignerMultisigWeightedUpgradeable is most derived than AccountERC7579Upgradeable␊ // in the inheritance chain (i.e. contract ... is AccountERC7579Upgradeable, ..., SignerMultisigWeightedUpgradeable)␊ @@ -12715,9 +18202,42 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, weights, threshold)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ ` -## Account with SignerMultisigWeighted with ERC7579 with ERC7739 upgradeable uups +## Account with SignerMultisigWeighted with ERC7579 hooks upgradeable uups > Snapshot 1 @@ -12728,6 +18248,7 @@ Generated by [AVA](https://avajs.dev). import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -12736,7 +18257,7 @@ Generated by [AVA](https://avajs.dev). import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Upgradeable, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ @@ -12746,7 +18267,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ - __AccountERC7579_init();␊ + __AccountERC7579Hooked_init();␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ __UUPSUpgradeable_init();␊ }␊ @@ -12813,7 +18334,7 @@ Generated by [AVA](https://avajs.dev). }␊ ` -## Account with SignerMultisigWeighted with ERC7579 hooks upgradeable uups +## Account with SignerMultisigWeighted with ERC7579 hooks upgradeable uups with factory > Snapshot 1 @@ -12832,6 +18353,8 @@ Generated by [AVA](https://avajs.dev). import {MultiSignerERC7913WeightedUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/MultiSignerERC7913WeightedUpgradeable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ ␊ contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579HookedUpgradeable, MultiSignerERC7913WeightedUpgradeable, UUPSUpgradeable {␊ /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ @@ -12908,6 +18431,39 @@ Generated by [AVA](https://avajs.dev). return super._rawSignatureValidation(hash, signature);␊ }␊ }␊ + ␊ + contract MyAccountFactory {␊ + MyAccount public immutable implementation = new MyAccount();␊ + ␊ + function deploy(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + returns (address)␊ + {␊ + bytes memory initcall = abi.encodeCall(MyAccount.initialize, (signers, weights, threshold));␊ + address instance = _predict(salt, initcall);␊ + if (instance.code.length == 0) {␊ + new ERC1967Proxy{salt: salt}(address(implementation), initcall);␊ + }␊ + return instance;␊ + ␊ + }␊ + ␊ + function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ + public␊ + view␊ + returns (address)␊ + {␊ + return _predict(salt, abi.encodeCall(MyAccount.initialize, (signers, weights, threshold)));␊ + }␊ + ␊ + function _predict(bytes32 salt, bytes memory initcall)␊ + internal␊ + view␊ + returns (address)␊ + {␊ + return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));␊ + }␊ + }␊ ` ## Account with SignerMultisigWeighted named upgradeable transparent @@ -13025,6 +18581,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -13032,6 +18589,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -13170,6 +18728,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -13177,6 +18736,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -13303,6 +18863,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -13310,6 +18871,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -13438,6 +19000,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -13445,6 +19008,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -13573,6 +19137,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -13580,6 +19145,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -13710,6 +19276,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -13717,6 +19284,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -13859,6 +19427,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -13866,6 +19435,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -14068,6 +19638,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -14075,6 +19646,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -14269,6 +19841,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -14276,6 +19849,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -14478,6 +20052,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -14485,6 +20060,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ @@ -14689,6 +20265,7 @@ Generated by [AVA](https://avajs.dev). ␊ function predict(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ public␊ + view␊ returns (address)␊ {␊ return Clones.predictDeterministicAddress(address(implementation), _salt(signers, weights, threshold, salt));␊ @@ -14696,6 +20273,7 @@ Generated by [AVA](https://avajs.dev). ␊ function _salt(bytes[] memory signers, uint64[] memory weights, uint64 threshold, bytes32 salt)␊ internal␊ + pure␊ returns (bytes32)␊ {␊ return keccak256(abi.encode(signers, weights, threshold, salt));␊ diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index 5b9da4d3291943731754860054f9e5362aa00e88..088c817a2dc1de6f4b80dfa195bc2705c3403166 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I%b{8@^={uhle3Az{gv{BDn+Hi|`L6 zeDN`^98k+2yQEx<)9=UTh@5F@9nWB$3r6#Nq4{+KCGr>7 zNil#>FWZHMJb6fOGm z%-=QF_~HW^JQE)lhi?aLb1kdgXMGF)rj2qw@g%vMko&3!?bjrL41VSG%m%yG5N22r zi$sTQtU`Me9mbrvGsLX5yG_9G&4p6}F<4blR_GM1Gj%}RS7})i1Kd09bdRm87Uah7 zzQ%=z$D9a)#rSnq4gl2^oTL}qX>O!o(X#1^Mo;f&Mz|tFO$C35ygfRfm6G8}vM9+nIZ_0;R2>QjL+$9`i1g)KmSG=q;fl+eMQ z5oY15)o1zlrY_t<+s`v6=I@i3B7M6KI(^wWmgvs90FnP!ltIsbLaz_~I+Kfq;E&28eLxe2@i9k>qbIA#&84J=al$$q(` zJAN}vz}WHtr#+4*VGO3afk5K12`HqN{9ezh>aCK6vRJ9=q;=I>me4ed*jR=V2Is&T zSZC@EtieR^tvbDUp6tAtu(Pm-;Z{MzNL`^Hc-bF>disZ``LZ4(^Nz;-w8_Iri2N?7 z=IRE$%<3W1K^+M?Cgae>Mm+?<_6ICyf~ZS_F=A!jShNtC`&Yz`$NEcqT1%kX+}eL6 zQ?m*gBShI51Id{5Rw=x8rWi)+qX0Yyf!6`(e|Z;vBaE6Scgb0{8$wK5&%F(MG7!RESHt&p_l x#hcL9!6@kH&UNNZ3q;xU&)=Bt9tAI5?bUj|0-be=>!q$LElc;}43;-<_!snV2_gUh diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index 9cd82bad5..cf50a0bff 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -183,6 +183,8 @@ function addERC7579Modules(c: ContractBuilder, opts: AccountOptions): void { // Accounts that use ERC7579 without a signer must be constructed with at least one module (executor of validation) if (!opts.signer) { + c.addImportOnly({name: 'MODULE_TYPE_VALIDATOR', path: '@openzeppelin/contracts/interfaces/draft-IERC7579.sol', transpiled: false}); + c.addImportOnly({name: 'MODULE_TYPE_EXECUTOR', path: '@openzeppelin/contracts/interfaces/draft-IERC7579.sol', transpiled: false}); c.addConstructorArgument({ type: 'uint256', name: 'moduleTypeId' }); c.addConstructorArgument({ type: 'address', name: 'module' }); c.addConstructorArgument({ type: 'bytes calldata', name: 'initData' }); @@ -282,10 +284,6 @@ function overrideRawSignatureValidation(c: ContractBuilder, opts: AccountOptions } export function buildFactory(account: Contract, opts: AccountOptions): Contract { - // TODO: add UUPS support - if (opts.upgradeable !== 'transparent') { - throw new OptionsError({ factory: 'Factory requires the account to be transparent upgradeable' }); - } if (opts.signer === 'ERC7702') { throw new OptionsError({ factory: 'Factory cannot deploy accounts with ERC-7702 signers' }); } @@ -296,43 +294,100 @@ export function buildFactory(account: Contract, opts: AccountOptions): Contract const factory = new ContractBuilder(account.name + 'Factory'); const args = [...account.constructorArgs, { name: 'salt', type: 'bytes32' }]; - factory.addImportOnly({ - name: 'Clones', - path: '@openzeppelin/contracts/proxy/Clones.sol', - }); - // Implementation address factory.addVariable(`${account.name} public immutable implementation = new ${account.name}();`); - // Functions - create - factory.setFunctionBody( - formatLines([ - `bytes32 effectiveSalt = _salt(${args.map(arg => arg.name).join(', ')});`, - `address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);`, - `if (instance.code.length == 0) {`, - [ - `Clones.cloneDeterministic(address(implementation), effectiveSalt);`, - `${account.name}(instance).initialize(${account.constructorArgs.map(arg => arg.name).join(', ')});`, - ], - `}`, - `return instance;`, - ]).split('\n'), - { name: 'deploy', kind: 'public' as const, args, returns: ['address'] }, - ); + switch(opts.upgradeable) { + case 'transparent': { + // Import helpers + factory.addImportOnly({ + name: 'Clones', + path: '@openzeppelin/contracts/proxy/Clones.sol', + }); - // Functions - predict - factory.addFunctionCode( - `return Clones.predictDeterministicAddress(address(implementation), _salt(${args.map(arg => arg.name).join(', ')}));`, - { name: 'predict', kind: 'public' as const, args, returns: ['address'] }, - ); + // Functions - create + factory.setFunctionBody( + formatLines([ + `bytes32 effectiveSalt = _salt(${args.map(arg => arg.name).join(', ')});`, + `address instance = Clones.predictDeterministicAddress(address(implementation), effectiveSalt);`, + `if (instance.code.length == 0) {`, + [ + `Clones.cloneDeterministic(address(implementation), effectiveSalt);`, + `${account.name}(instance).initialize(${account.constructorArgs.map(arg => arg.name).join(', ')});`, + ], + `}`, + `return instance;`, + ]).split('\n'), + { name: 'deploy', kind: 'public' as const, args, returns: ['address'] }, + ); - // Functions - _salt - factory.addFunctionCode(`return keccak256(abi.encode(${args.map(arg => arg.name).join(', ')}));`, { - name: '_salt', - kind: 'internal' as const, - args, - returns: ['bytes32'], - }); + // Functions - predict + factory.setFunctionBody( + [`return Clones.predictDeterministicAddress(address(implementation), _salt(${args.map(arg => arg.name).join(', ')}));`], + { name: 'predict', kind: 'public' as const, args, returns: ['address'] }, + 'view', + ); + + // Functions - _salt + factory.setFunctionBody( + [`return keccak256(abi.encode(${args.map(arg => arg.name).join(', ')}));`], + { name: '_salt', kind: 'internal' as const, args, returns: ['bytes32'] }, + 'pure', + ); + break; + } + + case 'uups': { + // Import helpers + factory.addImportOnly({ + name: 'ERC1967Proxy', + path: '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol', + }); + + factory.addImportOnly({ + name: 'Create2', + path: '@openzeppelin/contracts/utils/Create2.sol', + }); + + // Functions - create + factory.setFunctionBody( + formatLines([ + `bytes memory initcall = abi.encodeCall(${account.name}.initialize, (${account.constructorArgs.map(arg => arg.name).join(', ')}));`, + 'address instance = _predict(salt, initcall);', + `if (instance.code.length == 0) {`, + [ + `new ERC1967Proxy{salt: salt}(address(implementation), initcall);`, + ], + `}`, + `return instance;`, + ]).split('\n'), + { name: 'deploy', kind: 'public' as const, args, returns: ['address'] }, + ); + + // Functions - predict + factory.setFunctionBody( + [`return _predict(salt, abi.encodeCall(${account.name}.initialize, (${account.constructorArgs.map(arg => arg.name).join(', ')})));`], + { name: 'predict', kind: 'public' as const, args, returns: ['address'] }, + 'view', + ); + + // Functions - _salt + factory.setFunctionBody( + [ 'return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));' ], + { + name: '_predict', + kind: 'internal' as const, + args: [{name: 'salt', type: 'bytes32'}, {name: 'initcall', type: 'bytes memory'}], + returns: ['address'], + }, + 'view', + ); + break; + } + + defaults: + throw new OptionsError({ factory: 'Factory requires the account to be transparent upgradeable' }); + } return factory; } From 83e20de9b53f1b570d3fcf8695a88e00766e917b Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 11 Sep 2025 13:25:52 +0200 Subject: [PATCH 17/17] lint --- packages/core/solidity/src/account.test.ts | 2 +- packages/core/solidity/src/account.ts | 43 ++++++++++++------- .../core/solidity/src/zip-foundry.test.ts | 24 ++++++++++- .../core/solidity/src/zip-hardhat.test.ts | 25 +++++++++-- 4 files changed, 73 insertions(+), 21 deletions(-) diff --git a/packages/core/solidity/src/account.test.ts b/packages/core/solidity/src/account.test.ts index a5d0dac27..f68aaf9b3 100644 --- a/packages/core/solidity/src/account.test.ts +++ b/packages/core/solidity/src/account.test.ts @@ -53,7 +53,7 @@ function testAccount(title: string, opts: Partial) { fullOpts.signer !== 'ERC7702' ) { test(`${title} with factory`, t => { - t.snapshot(account.print({...fullOpts, factory: true })); + t.snapshot(account.print({ ...fullOpts, factory: true })); }); testAPIEquivalence(`${title} with factory - API equivalence`, { ...fullOpts, factory: true }); } diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index cf50a0bff..ff91d569e 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -183,8 +183,16 @@ function addERC7579Modules(c: ContractBuilder, opts: AccountOptions): void { // Accounts that use ERC7579 without a signer must be constructed with at least one module (executor of validation) if (!opts.signer) { - c.addImportOnly({name: 'MODULE_TYPE_VALIDATOR', path: '@openzeppelin/contracts/interfaces/draft-IERC7579.sol', transpiled: false}); - c.addImportOnly({name: 'MODULE_TYPE_EXECUTOR', path: '@openzeppelin/contracts/interfaces/draft-IERC7579.sol', transpiled: false}); + c.addImportOnly({ + name: 'MODULE_TYPE_VALIDATOR', + path: '@openzeppelin/contracts/interfaces/draft-IERC7579.sol', + transpiled: false, + }); + c.addImportOnly({ + name: 'MODULE_TYPE_EXECUTOR', + path: '@openzeppelin/contracts/interfaces/draft-IERC7579.sol', + transpiled: false, + }); c.addConstructorArgument({ type: 'uint256', name: 'moduleTypeId' }); c.addConstructorArgument({ type: 'address', name: 'module' }); c.addConstructorArgument({ type: 'bytes calldata', name: 'initData' }); @@ -297,8 +305,8 @@ export function buildFactory(account: Contract, opts: AccountOptions): Contract // Implementation address factory.addVariable(`${account.name} public immutable implementation = new ${account.name}();`); - switch(opts.upgradeable) { - case 'transparent': { + switch (opts.upgradeable) { + case 'transparent': // Import helpers factory.addImportOnly({ name: 'Clones', @@ -323,7 +331,9 @@ export function buildFactory(account: Contract, opts: AccountOptions): Contract // Functions - predict factory.setFunctionBody( - [`return Clones.predictDeterministicAddress(address(implementation), _salt(${args.map(arg => arg.name).join(', ')}));`], + [ + `return Clones.predictDeterministicAddress(address(implementation), _salt(${args.map(arg => arg.name).join(', ')}));`, + ], { name: 'predict', kind: 'public' as const, args, returns: ['address'] }, 'view', ); @@ -335,9 +345,8 @@ export function buildFactory(account: Contract, opts: AccountOptions): Contract 'pure', ); break; - } - case 'uups': { + case 'uups': // Import helpers factory.addImportOnly({ name: 'ERC1967Proxy', @@ -355,9 +364,7 @@ export function buildFactory(account: Contract, opts: AccountOptions): Contract `bytes memory initcall = abi.encodeCall(${account.name}.initialize, (${account.constructorArgs.map(arg => arg.name).join(', ')}));`, 'address instance = _predict(salt, initcall);', `if (instance.code.length == 0) {`, - [ - `new ERC1967Proxy{salt: salt}(address(implementation), initcall);`, - ], + [`new ERC1967Proxy{salt: salt}(address(implementation), initcall);`], `}`, `return instance;`, ]).split('\n'), @@ -366,26 +373,32 @@ export function buildFactory(account: Contract, opts: AccountOptions): Contract // Functions - predict factory.setFunctionBody( - [`return _predict(salt, abi.encodeCall(${account.name}.initialize, (${account.constructorArgs.map(arg => arg.name).join(', ')})));`], + [ + `return _predict(salt, abi.encodeCall(${account.name}.initialize, (${account.constructorArgs.map(arg => arg.name).join(', ')})));`, + ], { name: 'predict', kind: 'public' as const, args, returns: ['address'] }, 'view', ); // Functions - _salt factory.setFunctionBody( - [ 'return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));' ], + [ + 'return Create2.computeAddress(salt, keccak256(bytes.concat(type(ERC1967Proxy).creationCode, abi.encode(implementation, initcall))));', + ], { name: '_predict', kind: 'internal' as const, - args: [{name: 'salt', type: 'bytes32'}, {name: 'initcall', type: 'bytes memory'}], + args: [ + { name: 'salt', type: 'bytes32' }, + { name: 'initcall', type: 'bytes memory' }, + ], returns: ['address'], }, 'view', ); break; - } - defaults: + default: throw new OptionsError({ factory: 'Factory requires the account to be transparent upgradeable' }); } diff --git a/packages/core/solidity/src/zip-foundry.test.ts b/packages/core/solidity/src/zip-foundry.test.ts index 9fb2b9196..ddf65cbe4 100644 --- a/packages/core/solidity/src/zip-foundry.test.ts +++ b/packages/core/solidity/src/zip-foundry.test.ts @@ -6,7 +6,7 @@ import { zipFoundry } from './zip-foundry'; import { buildERC20 } from './erc20'; import { buildERC721 } from './erc721'; import { buildERC1155 } from './erc1155'; -import { buildAccount } from './account'; +import { buildAccount, buildFactory } from './account'; import { buildCustom } from './custom'; import { promises as fs } from 'fs'; import path from 'path'; @@ -131,8 +131,28 @@ test.serial('account ecdsa uups', async t => { }); test.skip('account P256 transparent with factory', async t => { - const opts: GenericOptions = { kind: 'Account', name: 'My Account', signer: 'P256', upgradeable: 'transparent', factory: true }; + const opts: GenericOptions = { + kind: 'Account', + name: 'My Account', + signer: 'P256', + upgradeable: 'transparent', + factory: true, + }; + const c = buildAccount(opts); + const _ = buildFactory(c, opts); + await runTest(c, t, opts); +}); + +test.skip('account modular uups with factory', async t => { + const opts: GenericOptions = { + kind: 'Account', + name: 'My Account', + ERC7579Modules: 'AccountERC7579', + upgradeable: 'uups', + factory: true, + }; const c = buildAccount(opts); + const _ = buildFactory(c, opts); await runTest(c, t, opts); }); diff --git a/packages/core/solidity/src/zip-hardhat.test.ts b/packages/core/solidity/src/zip-hardhat.test.ts index 680d13f2e..f68f85560 100644 --- a/packages/core/solidity/src/zip-hardhat.test.ts +++ b/packages/core/solidity/src/zip-hardhat.test.ts @@ -106,9 +106,28 @@ test.serial('account ecdsa uups', async t => { }); test.skip('account P256 transparent with factory', async t => { - const opts: GenericOptions = { kind: 'Account', name: 'My Account', signer: 'P256', upgradeable: 'transparent', factory: true }; + const opts: GenericOptions = { + kind: 'Account', + name: 'My Account', + signer: 'P256', + upgradeable: 'transparent', + factory: true, + }; + const c = buildAccount(opts); + const _ = buildFactory(c, opts); + await runDeployScriptTest(c, t, opts); +}); + +test.skip('account modular uups with factory', async t => { + const opts: GenericOptions = { + kind: 'Account', + name: 'My Account', + ERC7579Modules: 'AccountERC7579', + upgradeable: 'uups', + factory: true, + }; const c = buildAccount(opts); - const f = buildFactory(c, opts); + const _ = buildFactory(c, opts); await runDeployScriptTest(c, t, opts); }); @@ -128,7 +147,7 @@ test.serial('custom upgradeable', async t => { await runDeployScriptTest(c, t, opts); }); -async function runDeployScriptTest(c: Contract | Contract[], t: ExecutionContext, opts: GenericOptions) { +async function runDeployScriptTest(c: Contract, t: ExecutionContext, opts: GenericOptions) { const zip = await zipHardhat(c, opts); assertDeployScriptLayout(zip, c, t);