From 5c9d4abd5e5eb0b1f112a613d418d0c5857692dc Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Fri, 20 Jun 2025 00:11:12 +0200 Subject: [PATCH 1/3] 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 2/3] 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 3/3] 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' ] },