From 2674a1cd566ed79b39f43342abb90695a603c875 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 8 Sep 2025 21:16:15 +0200 Subject: [PATCH 01/11] refactor Account upgradeability --- packages/core/solidity/src/account.test.ts.md | 1462 ++++++----------- .../core/solidity/src/account.test.ts.snap | Bin 12030 -> 11692 bytes packages/core/solidity/src/account.ts | 121 +- packages/core/solidity/src/contract.ts | 20 +- packages/core/solidity/src/helpers.ts | 31 - packages/core/solidity/src/options.ts | 20 +- packages/core/solidity/src/print.ts | 58 +- packages/core/solidity/src/set-upgradeable.ts | 23 +- packages/core/solidity/src/signer.ts | 49 +- .../core/solidity/src/zip-foundry.test.ts | 5 +- .../core/solidity/src/zip-foundry.test.ts.md | 223 +-- .../solidity/src/zip-foundry.test.ts.snap | Bin 4520 -> 4256 bytes packages/core/solidity/src/zip-foundry.ts | 66 +- .../core/solidity/src/zip-hardhat.test.ts.md | 108 +- .../solidity/src/zip-hardhat.test.ts.snap | Bin 3313 -> 3079 bytes packages/core/solidity/src/zip-hardhat.ts | 32 +- 16 files changed, 636 insertions(+), 1582 deletions(-) delete mode 100644 packages/core/solidity/src/helpers.ts diff --git a/packages/core/solidity/src/account.test.ts.md b/packages/core/solidity/src/account.test.ts.md index 59f7f04d9..1ea211d9d 100644 --- a/packages/core/solidity/src/account.test.ts.md +++ b/packages/core/solidity/src/account.test.ts.md @@ -411,6 +411,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -448,6 +452,10 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -495,6 +503,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccountERC7739", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -534,6 +546,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccountERC721Holder", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -573,6 +589,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccountERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -613,6 +633,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("CustomAccountERC721HolderERC1155Holder", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _rawSignatureValidation(bytes32 hash, bytes calldata signature)␊ internal␊ @@ -652,6 +676,10 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize() public initializer {␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -706,6 +734,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + __UUPSUpgradeable_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -765,6 +796,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + __UUPSUpgradeable_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -822,6 +856,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + __UUPSUpgradeable_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -865,8 +902,8 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -883,6 +920,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579Hooked_init();␊ + __UUPSUpgradeable_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1181,6 +1221,8 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1233,6 +1275,8 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1283,6 +1327,8 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1320,8 +1366,8 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -1337,6 +1383,8 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579Hooked_init();␊ + ␊ require(moduleTypeId == MODULE_TYPE_VALIDATOR || moduleTypeId == MODULE_TYPE_EXECUTOR);␊ _installModule(moduleTypeId, module, initData);␊ }␊ @@ -1743,23 +1791,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSA is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSA is Account, EIP712, ERC7739, SignerECDSA {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSA", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1773,16 +1811,10 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1271 is Initializable, Account, IERC1271, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract CustomAccountWithSignerECDSAERC1271 is Account, IERC1271, SignerECDSA {␊ + constructor(address signer) SignerECDSA(signer) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -1792,10 +1824,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ }␊ ` @@ -1810,23 +1838,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSAERC7739 is Account, EIP712, ERC7739, SignerECDSA {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSAERC7739", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1842,23 +1860,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSAERC721Holder is Account, EIP712, ERC7739, SignerECDSA, ERC721Holder {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSAERC721Holder", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1874,23 +1882,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSAERC1155Holder is Account, EIP712, ERC7739, SignerECDSA, ERC1155Holder {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSAERC1155Holder", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1907,23 +1905,13 @@ Generated by [AVA](https://avajs.dev). import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerECDSAERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ constructor(address signer)␊ EIP712("CustomAccount with SignerECDSAERC721HolderERC1155Holder", "1")␊ SignerECDSA(signer)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + {}␊ }␊ ` @@ -1939,20 +1927,10 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, SignerECDSA, ERC7821 {␊ + constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {}␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -1978,17 +1956,11 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ + constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2001,10 +1973,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -2043,21 +2011,11 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + contract MyAccount is Account, IERC1271, AccountERC7579, SignerECDSA {␊ + constructor(address signer) SignerECDSA(signer) {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -2106,17 +2064,11 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerECDSA {␊ + constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2129,10 +2081,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -2173,17 +2121,11 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerECDSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerECDSA {␊ + constructor(address signer) EIP712("MyAccount", "1") SignerECDSA(signer) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2196,10 +2138,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -2249,6 +2187,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2278,6 +2217,11 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2287,10 +2231,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2323,6 +2263,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2357,6 +2298,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2391,6 +2333,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2428,6 +2371,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2462,6 +2406,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(address signer) public initializer {␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ @@ -2504,6 +2449,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2516,10 +2467,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2576,7 +2523,9 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -2642,6 +2591,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2654,10 +2609,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2700,8 +2651,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -2714,6 +2665,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2726,10 +2683,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -2806,6 +2759,10 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -2815,10 +2772,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ }␊ ` @@ -2990,6 +2943,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3002,10 +2960,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3055,6 +3009,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ __SignerECDSA_init(signer);␊ }␊ ␊ @@ -3114,6 +3069,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579_init();␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3126,10 +3086,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3166,8 +3122,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -3179,6 +3135,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(address signer) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerECDSA_init(signer);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3191,10 +3152,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3232,23 +3189,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256 is Initializable, Account, EIP712, ERC7739, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256 is Account, EIP712, ERC7739, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3262,16 +3209,10 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC1271 is Initializable, Account, IERC1271, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract CustomAccountWithSignerP256ERC1271 is Account, IERC1271, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3281,10 +3222,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ }␊ ` @@ -3299,23 +3236,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC7739 is Initializable, Account, EIP712, ERC7739, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256ERC7739 is Account, EIP712, ERC7739, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256ERC7739", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3331,23 +3258,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256ERC721Holder is Account, EIP712, ERC7739, SignerP256, ERC721Holder {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256ERC721Holder", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3363,23 +3280,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256ERC1155Holder is Account, EIP712, ERC7739, SignerP256, ERC1155Holder {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256ERC1155Holder", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3396,23 +3303,13 @@ Generated by [AVA](https://avajs.dev). import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerP256, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerP256ERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerP256, ERC721Holder, ERC1155Holder {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("CustomAccount with SignerP256ERC721HolderERC1155Holder", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ }␊ ` @@ -3428,23 +3325,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerP256, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, SignerP256, ERC7821 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("MyAccount", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + {}␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -3470,20 +3357,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("MyAccount", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3496,10 +3377,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3538,21 +3415,11 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ + contract MyAccount is Account, IERC1271, AccountERC7579, SignerP256 {␊ + constructor(bytes32 qx, bytes32 qy) SignerP256(qx, qy) {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3601,20 +3468,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("MyAccount", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3627,10 +3488,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3671,20 +3528,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerP256} from "@openzeppelin/contracts/utils/cryptography/signers/SignerP256.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerP256 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerP256 {␊ constructor(bytes32 qx, bytes32 qy)␊ EIP712("MyAccount", "1")␊ SignerP256(qx, qy)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -3697,10 +3548,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - _setSigner(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -3750,6 +3597,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3780,18 +3628,19 @@ Generated by [AVA](https://avajs.dev). _disableInitializers();␊ }␊ ␊ - function isValidSignature(bytes32 hash, bytes calldata signature)␊ - public␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function isValidSignature(bytes32 hash, bytes calldata signature)␊ + public␊ view␊ override␊ returns (bytes4)␊ {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -3824,6 +3673,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3858,6 +3708,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3892,6 +3743,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3929,6 +3781,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -3963,6 +3816,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ @@ -4005,6 +3859,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4017,10 +3877,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -4077,7 +3933,9 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -4143,6 +4001,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4155,10 +4019,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -4201,8 +4061,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -4215,6 +4075,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerP256_init(qx, qy);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4227,10 +4093,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -4307,6 +4169,10 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __SignerP256_init(qx, qy);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4316,10 +4182,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ }␊ ` @@ -4491,6 +4353,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4503,10 +4370,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -4556,6 +4419,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ __SignerP256_init(qx, qy);␊ }␊ ␊ @@ -4615,6 +4479,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4627,10 +4496,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -4667,8 +4532,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -4680,6 +4545,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes32 qx, bytes32 qy) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerP256_init(qx, qy);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4692,10 +4562,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes32 qx, bytes32 qy) public initializer {␊ - __SignerP256_init(qx, qy);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -4733,23 +4599,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSA is Initializable, Account, EIP712, ERC7739, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSA is Account, EIP712, ERC7739, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSA", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4763,16 +4619,10 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC1271 is Initializable, Account, IERC1271, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + contract CustomAccountWithSignerRSAERC1271 is Account, IERC1271, SignerRSA {␊ + constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4782,10 +4632,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ }␊ ` @@ -4800,23 +4646,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC7739 is Initializable, Account, EIP712, ERC7739, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSAERC7739 is Account, EIP712, ERC7739, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSAERC7739", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4832,23 +4668,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSAERC721Holder is Account, EIP712, ERC7739, SignerRSA, ERC721Holder {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSAERC721Holder", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4864,23 +4690,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSAERC1155Holder is Account, EIP712, ERC7739, SignerRSA, ERC1155Holder {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSAERC1155Holder", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4897,23 +4713,13 @@ Generated by [AVA](https://avajs.dev). import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerRSAERC721HolderERC1155Holder is Account, EIP712, ERC7739, SignerRSA, ERC721Holder, ERC1155Holder {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("CustomAccount with SignerRSAERC721HolderERC1155Holder", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ }␊ ` @@ -4929,23 +4735,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerRSA, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, SignerRSA, ERC7821 {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("MyAccount", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + {}␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ internal␊ @@ -4971,20 +4767,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("MyAccount", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -4997,10 +4787,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5039,21 +4825,11 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ + contract MyAccount is Account, IERC1271, AccountERC7579, SignerRSA {␊ + constructor(bytes memory e, bytes memory n) SignerRSA(e, n) {}␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5102,20 +4878,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("MyAccount", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5128,10 +4898,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5172,20 +4938,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ import {SignerRSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerRSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, SignerRSA {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, SignerRSA {␊ constructor(bytes memory e, bytes memory n)␊ EIP712("MyAccount", "1")␊ SignerRSA(e, n)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5198,10 +4958,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - _setSigner(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -5251,6 +5007,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5280,6 +5037,11 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5289,10 +5051,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -5325,6 +5083,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5359,6 +5118,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5393,6 +5153,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5430,6 +5191,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5464,6 +5226,7 @@ Generated by [AVA](https://avajs.dev). ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _erc7821AuthorizedExecutor(address caller, bytes32 mode, bytes calldata executionData)␊ @@ -5506,6 +5269,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5518,10 +5287,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -5578,7 +5343,9 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ @@ -5644,6 +5411,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5656,10 +5429,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -5702,8 +5471,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -5716,6 +5485,12 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerRSA_init(e, n);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5728,10 +5503,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ function _authorizeUpgrade(address newImplementation)␊ internal␊ @@ -5808,6 +5579,10 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -5817,10 +5592,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ }␊ ` @@ -5992,6 +5763,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6004,10 +5780,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -6057,6 +5829,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ __SignerRSA_init(e, n);␊ }␊ ␊ @@ -6116,6 +5889,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6128,10 +5906,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -6168,8 +5942,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -6181,6 +5955,11 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes memory e, bytes memory n) public initializer {␊ + __AccountERC7579Hooked_init();␊ + __SignerRSA_init(e, n);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6193,10 +5972,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes memory e, bytes memory n) public initializer {␊ - __SignerRSA_init(e, n);␊ - }␊ ␊ // The following functions are overrides required by Solidity.␊ ␊ @@ -6234,27 +6009,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisig is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisig is Account, EIP712, ERC7739, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisig", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6280,18 +6041,12 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC1271 is Account, IERC1271, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6301,14 +6056,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6335,30 +6082,16 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC7739 is Account, EIP712, ERC7739, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigERC7739", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ - ␊ - function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ - _addSigners(signers);␊ + {}␊ + ␊ + function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ + _addSigners(signers);␊ }␊ ␊ function removeSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -6383,27 +6116,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC721Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigERC721Holder", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6431,27 +6150,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC1155Holder {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigERC1155Holder", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6480,27 +6185,13 @@ Generated by [AVA](https://avajs.dev). import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigERC721HolderERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913, ERC721Holder, ERC1155Holder {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigERC721HolderERC1155Holder", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6528,27 +6219,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, MultiSignerERC7913, ERC7821 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6586,20 +6263,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6612,14 +6283,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6670,27 +6333,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, IERC1271, AccountERC7579, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6751,20 +6400,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6777,14 +6420,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6837,20 +6472,14 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913 {␊ constructor(bytes[] memory signers, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913(signers, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6863,14 +6492,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setThreshold(threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -6935,6 +6556,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -6976,6 +6598,14 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -6985,13 +6615,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7039,6 +6662,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7088,6 +6712,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7137,6 +6762,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7189,6 +6815,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7238,6 +6865,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7292,6 +6920,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7304,13 +6941,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7382,7 +7012,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ @@ -7460,6 +7092,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7472,13 +7113,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7533,8 +7167,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -7547,6 +7181,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7559,13 +7202,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7669,6 +7305,13 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7678,13 +7321,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -7943,6 +7579,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -7955,13 +7599,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -8026,6 +7663,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913_init(signers, threshold);␊ }␊ ␊ @@ -8097,6 +7735,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8109,13 +7755,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -8164,8 +7803,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -8177,6 +7816,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913_init(signers, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8189,13 +7836,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913_init(signers, threshold);␊ - }␊ ␊ function addSigners(bytes[] memory signers) public onlyEntryPointOrSelf {␊ _addSigners(signers);␊ @@ -8245,28 +7885,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeighted is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeighted is Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeighted", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8299,18 +7924,12 @@ Generated by [AVA](https://avajs.dev). ␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC1271 is Initializable, Account, IERC1271, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC1271 is Account, IERC1271, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8320,15 +7939,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8362,28 +7972,13 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC7739 is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC7739 is Account, EIP712, ERC7739, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeightedERC7739", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8418,28 +8013,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC721Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC721Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeightedERC721Holder", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8474,28 +8054,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC1155Holder {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeightedERC1155Holder", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8531,28 +8096,13 @@ Generated by [AVA](https://avajs.dev). import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract CustomAccountWithSignerMultisigWeightedERC721HolderERC1155Holder is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC721Holder, ERC1155Holder {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("CustomAccount with SignerMultisigWeightedERC721HolderERC1155Holder", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8587,28 +8137,13 @@ Generated by [AVA](https://avajs.dev). import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC7821 {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, MultiSignerERC7913Weighted, ERC7821 {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8653,21 +8188,15 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8680,15 +8209,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8746,29 +8266,14 @@ Generated by [AVA](https://avajs.dev). import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, IERC1271, AccountERC7579, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, IERC1271, AccountERC7579, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ + {}␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8836,21 +8341,15 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8863,15 +8362,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -8931,21 +8421,15 @@ Generated by [AVA](https://avajs.dev). import {AccountERC7579Hooked} from "@openzeppelin/contracts/account/extensions/draft-AccountERC7579Hooked.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {MultiSignerERC7913} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913.sol";␊ import {MultiSignerERC7913Weighted} from "@openzeppelin/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol";␊ import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913Weighted {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + contract MyAccount is Account, EIP712, ERC7739, AccountERC7579Hooked, MultiSignerERC7913Weighted {␊ constructor(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ EIP712("MyAccount", "1")␊ MultiSignerERC7913Weighted(signers, weights, threshold)␊ - {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ + {}␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -8958,15 +8442,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - _addSigners(signers);␊ - _setSignerWeights(signers, weights);␊ - _setThreshold(threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9038,6 +8513,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9086,6 +8562,14 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9095,13 +8579,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9158,6 +8635,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9216,6 +8694,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9274,6 +8753,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9333,6 +8813,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9389,6 +8870,7 @@ Generated by [AVA](https://avajs.dev). initializer␊ {␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9451,6 +8933,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9463,13 +8954,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9549,7 +9033,9 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ @@ -9635,6 +9121,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9647,13 +9142,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9715,8 +9203,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -9730,6 +9218,15 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + __UUPSUpgradeable_init();␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9742,13 +9239,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -9866,6 +9356,13 @@ Generated by [AVA](https://avajs.dev). constructor() {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -9875,13 +9372,6 @@ Generated by [AVA](https://avajs.dev). {␊ return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -10189,6 +9679,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -10201,13 +9699,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -10280,6 +9771,7 @@ Generated by [AVA](https://avajs.dev). public␊ initializer␊ {␊ + __AccountERC7579_init();␊ __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ }␊ ␊ @@ -10359,6 +9851,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -10371,13 +9871,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ @@ -10433,8 +9926,8 @@ Generated by [AVA](https://avajs.dev). ␊ import {AbstractSigner} from "@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol";␊ import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {AccountERC7579Upgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol";␊ + import {AccountERC7579HookedUpgradeable} from "@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579HookedUpgradeable.sol";␊ import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ @@ -10447,6 +9940,14 @@ Generated by [AVA](https://avajs.dev). constructor() EIP712("MyAccount", "1") {␊ _disableInitializers();␊ }␊ + ␊ + function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ + public␊ + initializer␊ + {␊ + __AccountERC7579Hooked_init();␊ + __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ + }␊ ␊ function isValidSignature(bytes32 hash, bytes calldata signature)␊ public␊ @@ -10459,13 +9960,6 @@ Generated by [AVA](https://avajs.dev). bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);␊ return erc7739magic == bytes4(0xffffffff) ? AccountERC7579Upgradeable.isValidSignature(hash, signature) : erc7739magic;␊ }␊ - ␊ - function initialize(bytes[] memory signers, uint64[] memory weights, uint64 threshold)␊ - public␊ - initializer␊ - {␊ - __MultiSignerERC7913Weighted_init(signers, weights, threshold);␊ - }␊ ␊ function setSignerWeights(bytes[] memory signers, uint64[] memory weights)␊ public␊ diff --git a/packages/core/solidity/src/account.test.ts.snap b/packages/core/solidity/src/account.test.ts.snap index 8539b23ac06b570f8ab57d81626c6000c8ca4d5e..8f9f873c2ea1bf88fb2689393ec8b5675bb1da98 100644 GIT binary patch literal 11692 zcmYkBV{|6UwsvFNwylnB+ji1%$MzfBw(X>2+v(Uw$9g-yy}z^XxnIpOsz#0azh!{j%0_)BnTA_FGSFpZBViyAjuq+=qwm z#@~hwzqh+iPFj{zmyn6M)pl9rH@O@1*{9w8njN&qTAHV@%l^Kq&0MAJ)EU{~Y@~Yo z$nmYRP3N=eG8U_FwW=vJ+n?jx>-k*XUKXy0s4>d*wba_WH>=byZ}M%JL0e&4VaE~V zXH_}2XKCtntpprVw<=WstljojYPQHwdaUPa-#2try!lwy|C+P9vOHWl+>uC2(~6sB zzO7sMzKZ|671p|B!^N!QZEI^)2NeBUp3UcVK6)+|)1R#~VndwDtJZn7d=viS{is&@ zS^rDX?b6+4^P}#fZRKkYw-(6FuKSg`(MqeZ)Dm0vy}fo;vg^CT&CS=$W9<=L`>b{Q z>~5z~*YlA&kTRRlrP#nRYoo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3c!gs-Xd@Hn( zmzZw9>Z8N;_%8PPdj>yA%tCc~Fg5D2G`2TVC~M!E@vbnUK)<*<)Spa3D name).join(', ')});`, fn); - break; - } -} - function addMultisigFunctions(c: ContractBuilder, opts: AccountOptions): void { switch (opts.signer) { case 'MultisigWeighted': @@ -296,6 +233,7 @@ function addEIP712(c: ContractBuilder, opts: AccountOptions): void { { name: 'EIP712', path: '@openzeppelin/contracts/utils/cryptography/EIP712.sol', + transpiled: false, // do not use the upgradeable variant for in Accounts }, [opts.name, '1'], ); @@ -309,21 +247,22 @@ function overrideRawSignatureValidation(c: ContractBuilder, opts: AccountOptions // to provide a custom validation logic if (!opts.signer && !opts.ERC7579Modules) { // Custom validation logic - c.addOverride({ name: 'Account' }, signerFunctions._rawSignatureValidation); + c.addOverride({ name: 'Account', transpiled: false }, signerFunctions._rawSignatureValidation); c.setFunctionBody(['// Custom validation logic', 'return false;'], signerFunctions._rawSignatureValidation); } // Disambiguate between Signer and AccountERC7579 if (opts.signer && opts.ERC7579Modules) { - const accountName = makeUpgradeable('AccountERC7579', opts.upgradeable); - const signerName = makeUpgradeable(`Signer${opts.signer}`, opts.upgradeable); + const accountName = opts.upgradeable ? upgradeableName('AccountERC7579') : 'AccountERC7579'; + const signerName = opts.upgradeable ? upgradeableName(`Signer${opts.signer}`) : `Signer${opts.signer}`; c.addImportOnly({ name: 'AbstractSigner', path: '@openzeppelin/contracts/utils/cryptography/signers/AbstractSigner.sol', + transpiled: false, }); - c.addOverride({ name: 'AbstractSigner' }, signerFunctions._rawSignatureValidation); - c.addOverride({ name: accountName }, signerFunctions._rawSignatureValidation); + c.addOverride({ name: 'AbstractSigner', transpiled: false }, signerFunctions._rawSignatureValidation); + c.addOverride({ name: 'AccountERC7579' }, signerFunctions._rawSignatureValidation); c.setFunctionComments( [ `// IMPORTANT: Make sure ${signerName} is most derived than ${accountName}`, @@ -337,8 +276,8 @@ function overrideRawSignatureValidation(c: ContractBuilder, opts: AccountOptions // Base override for `_rawSignatureValidation` given MultiSignerERC7913Weighted is MultiSignerERC7913 if (opts.signer === 'MultisigWeighted') { c.addImportOnly({ - name: makeUpgradeable(signers.Multisig.name, opts.upgradeable), - path: makeUpgradeable(signers.Multisig.path, opts.upgradeable), + name: signers.Multisig.name, + path: signers.Multisig.path, }); } } diff --git a/packages/core/solidity/src/contract.ts b/packages/core/solidity/src/contract.ts index d3a89333c..6ed276124 100644 --- a/packages/core/solidity/src/contract.ts +++ b/packages/core/solidity/src/contract.ts @@ -9,11 +9,8 @@ export interface Contract { functions: ContractFunction[]; constructorCode: string[]; constructorArgs: FunctionArgument[]; - constructorComments: string[]; variables: string[]; - shouldAutoTranspileImports: boolean; - shouldInstallContractsUpgradeable: boolean; - shouldUseUpgradesPluginsForProxyDeployment: boolean; + upgradeable: boolean; } export type Value = string | number | { lit: string } | { note: string; value: Value }; @@ -78,17 +75,13 @@ export interface NatspecTag { export class ContractBuilder implements Contract { readonly name: string; license: string = 'MIT'; - - shouldAutoTranspileImports: boolean = false; - shouldInstallContractsUpgradeable: boolean = false; - shouldUseUpgradesPluginsForProxyDeployment: boolean = false; + upgradeable = false; readonly using: Using[] = []; readonly natspecTags: NatspecTag[] = []; readonly constructorArgs: FunctionArgument[] = []; readonly constructorCode: string[] = []; - readonly constructorComments: string[] = []; readonly variableSet: Set = new Set(); private parentMap: Map = new Map(); @@ -187,15 +180,6 @@ export class ContractBuilder implements Contract { this.constructorCode.push(code); } - addConstructorComment(comment: string) { - if (this.shouldAutoTranspileImports) { - throw new Error( - 'Constructor comments are not supported when `shouldAutoTranspileImports` is true, since constructor will be transformed into an initializer', - ); - } - this.constructorComments.push(comment); - } - addFunctionCode(code: string, baseFn: BaseFunction, mutability?: FunctionMutability) { const fn = this.addFunction(baseFn); if (fn.final) { diff --git a/packages/core/solidity/src/helpers.ts b/packages/core/solidity/src/helpers.ts deleted file mode 100644 index fe1d92bfe..000000000 --- a/packages/core/solidity/src/helpers.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Use posix to ensure forward slashes on all platforms -import { posix as path } from 'path'; -import type { CommonOptions } from './common-options'; - -// If upgradeable is true-ish, translate a contract name or contract path into its corresponding upgradeable variant. -// Otherwise, return the input unmodified. -// -// Example: -// - makeUpgradeable('AccountERC7579', false) == 'AccountERC7579' -// - makeUpgradeable('AccountERC7579', 'uups') == 'AccountERC7579Upgradeable' -// - makeUpgradeable('@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol', false) == '@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol' -// - makeUpgradeable('@openzeppelin/contracts/account/extensions/draft-AccountERC7579.sol', 'uups') == '@openzeppelin/contracts-upgradeable/account/extensions/draft-AccountERC7579Upgradeable.sol' -export function makeUpgradeable(input: string, upgradeable: CommonOptions['upgradeable'] = false): string { - switch (upgradeable) { - case false: - return input; - case 'uups': - case 'transparent': { - const { dir, name, ext } = path.parse(input); - return path.format({ - dir: dir.replace('/contracts/', '/contracts-upgradeable/'), - name: name + 'Upgradeable', - ext, - }); - } - default: { - const _: never = upgradeable; - throw new Error('Unknown upgradeable option'); - } - } -} diff --git a/packages/core/solidity/src/options.ts b/packages/core/solidity/src/options.ts index d2fbeba18..311a0de96 100644 --- a/packages/core/solidity/src/options.ts +++ b/packages/core/solidity/src/options.ts @@ -3,7 +3,7 @@ import path from 'path'; import type { Contract, ReferencedContract, ImportContract } from './contract'; import { inferTranspiled } from './infer-transpiled'; -const upgradeableName = (n: string) => { +export function upgradeableName(n: string) { if (n === 'Initializable') { return n; } else { @@ -11,7 +11,7 @@ const upgradeableName = (n: string) => { } }; -const upgradeableImport = (p: ImportContract): ImportContract => { +export function upgradeableImport(p: ImportContract): ImportContract { const { dir, ext, name } = path.parse(p.path); // Use path.posix to get forward slashes return { @@ -30,19 +30,19 @@ export interface Options { } export interface Helpers extends Required { - shouldUseInitializers: boolean; + upgradeable: boolean; transformName: (name: ReferencedContract) => string; + transformImport: (name: ImportContract) => ImportContract; } export function withHelpers(contract: Contract, opts: Options = {}): Helpers { - const shouldAutoTranspileImports = contract.shouldAutoTranspileImports; - const transformName = (n: ReferencedContract) => - shouldAutoTranspileImports && inferTranspiled(n) ? upgradeableName(n.name) : n.name; + const contractUpgradeable = contract.upgradeable; return { - shouldUseInitializers: shouldAutoTranspileImports, - transformName, - transformImport: p1 => { - const p2 = shouldAutoTranspileImports && inferTranspiled(p1) ? upgradeableImport(p1) : p1; + upgradeable: contractUpgradeable, + transformName: (n: ReferencedContract) => + contractUpgradeable && inferTranspiled(n) ? upgradeableName(n.name) : n.name, + transformImport: (p1: ImportContract) => { + const p2 = contractUpgradeable && inferTranspiled(p1) ? upgradeableImport(p1) : p1; return opts.transformImport?.(p2) ?? p2; }, }; diff --git a/packages/core/solidity/src/print.ts b/packages/core/solidity/src/print.ts index fbf484151..0fa7d56b5 100644 --- a/packages/core/solidity/src/print.ts +++ b/packages/core/solidity/src/print.ts @@ -81,24 +81,48 @@ function printConstructor(contract: Contract, helpers: Helpers): Lines[] { const hasParentParams = contract.parents.some(p => p.params.length > 0); const hasConstructorCode = contract.constructorCode.length > 0; const parentsWithInitializers = contract.parents.filter(hasInitializer); - if (hasParentParams || hasConstructorCode || (helpers.shouldUseInitializers && parentsWithInitializers.length > 0)) { - const parents = parentsWithInitializers.flatMap(p => printParentConstructor(p, helpers)); - const modifiers = helpers.shouldUseInitializers ? ['public initializer'] : parents; - const args = contract.constructorArgs.map(a => printArgument(a, helpers)); - const body = helpers.shouldUseInitializers - ? spaceBetween( - parents.map(p => p + ';'), - contract.constructorCode, - ) - : contract.constructorCode; - const head = helpers.shouldUseInitializers ? 'function initialize' : 'constructor'; - const ctor = printFunction2(contract.constructorComments, head, args, modifiers, body); - if (!helpers.shouldUseInitializers) { - return ctor; + if (hasParentParams || hasConstructorCode || (helpers.upgradeable && parentsWithInitializers.length > 0)) { + if (helpers.upgradeable) { + const upgradeableParents = parentsWithInitializers.filter(p => inferTranspiled(p.contract)); + const nonUpgradeableParents = parentsWithInitializers.filter(p => !inferTranspiled(p.contract)); + + return spaceBetween( + // constructor + printFunction2( + [ + nonUpgradeableParents.length > 0 + ? '/// @custom:oz-upgrades-unsafe-allow-reachable constructor' + : '/// @custom:oz-upgrades-unsafe-allow constructor', + ], + 'constructor', + [], + nonUpgradeableParents.flatMap(p => printParentConstructor(p, helpers)), + ['_disableInitializers();'] + ), + // initializer + upgradeableParents.length > 0 + ? printFunction2( + [], + 'function initialize', + contract.constructorArgs.map(a => printArgument(a, helpers)), + [ 'public', 'initializer' ], + spaceBetween( + upgradeableParents.flatMap(p => printParentConstructor(p, helpers)).map(p => p + ';'), + contract.constructorCode, + ) + ) + : [], + ); } else { - return spaceBetween(DISABLE_INITIALIZERS, ctor); + return printFunction2( + [], + 'constructor', + contract.constructorArgs.map(a => printArgument(a, helpers)), + parentsWithInitializers.flatMap(p => printParentConstructor(p, helpers)), + contract.constructorCode + ); } - } else if (!helpers.shouldUseInitializers) { + } else if (!helpers.upgradeable) { return []; } else { return DISABLE_INITIALIZERS; @@ -139,7 +163,7 @@ function sortedFunctions(contract: Contract): SortedFunctions { } function printParentConstructor({ contract, params }: Parent, helpers: Helpers): [] | [string] { - const useTranspiled = helpers.shouldUseInitializers && inferTranspiled(contract); + const useTranspiled = helpers.upgradeable && inferTranspiled(contract); const fn = useTranspiled ? `__${contract.name}_init` : contract.name; if (useTranspiled || params.length > 0) { return [fn + '(' + params.map(printValue).join(', ') + ')']; diff --git a/packages/core/solidity/src/set-upgradeable.ts b/packages/core/solidity/src/set-upgradeable.ts index 361184145..26a2edef8 100644 --- a/packages/core/solidity/src/set-upgradeable.ts +++ b/packages/core/solidity/src/set-upgradeable.ts @@ -11,19 +11,16 @@ function setUpgradeableBase( c: ContractBuilder, upgradeable: Upgradeable, restrictAuthorizeUpgradeWhenUUPS: () => void, - onlyUseUpgradeableInitializableAndUUPS: boolean = false, ) { if (upgradeable === false) { return; } - c.shouldAutoTranspileImports = !onlyUseUpgradeableInitializableAndUUPS; - c.shouldInstallContractsUpgradeable = true; - c.shouldUseUpgradesPluginsForProxyDeployment = true; + c.upgradeable = true; c.addParent({ name: 'Initializable', - path: `@openzeppelin/${onlyUseUpgradeableInitializableAndUUPS ? 'contracts-upgradeable' : 'contracts'}/proxy/utils/Initializable.sol`, + path: '@openzeppelin/contracts/proxy/utils/Initializable.sol', }); switch (upgradeable) { @@ -34,7 +31,7 @@ function setUpgradeableBase( restrictAuthorizeUpgradeWhenUUPS(); const UUPSUpgradeable = { name: 'UUPSUpgradeable', - path: `@openzeppelin/${onlyUseUpgradeableInitializableAndUUPS ? 'contracts-upgradeable' : 'contracts'}/proxy/utils/UUPSUpgradeable.sol`, + path: '@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol', }; c.addParent(UUPSUpgradeable); c.addOverride(UUPSUpgradeable, functions._authorizeUpgrade); @@ -62,19 +59,9 @@ export function setUpgradeableGovernor(c: ContractBuilder, upgradeable: Upgradea } export function setUpgradeableAccount(c: ContractBuilder, upgradeable: Upgradeable) { - if (upgradeable === false) { - return; - } - setUpgradeableBase( - c, - upgradeable, - () => { + setUpgradeableBase(c, upgradeable, () => { c.addModifier('onlyEntryPointOrSelf', functions._authorizeUpgrade); - }, - true, // account.ts handles usage of transpiled imports (when needed) rather than using helpers. - ); - c.shouldInstallContractsUpgradeable = true; - c.shouldUseUpgradesPluginsForProxyDeployment = false; // this will eventually use a factory to deploy proxies + }); } const functions = defineFunctions({ diff --git a/packages/core/solidity/src/signer.ts b/packages/core/solidity/src/signer.ts index 42e209a35..a9a156930 100644 --- a/packages/core/solidity/src/signer.ts +++ b/packages/core/solidity/src/signer.ts @@ -1,7 +1,6 @@ import type { ContractBuilder } from './contract'; import { OptionsError } from './error'; import type { Upgradeable } from './set-upgradeable'; -import { makeUpgradeable } from './helpers'; import { defineFunctions } from './utils/define-functions'; export const SignerOptions = [false, 'ERC7702', 'ECDSA', 'P256', 'RSA', 'Multisig', 'MultisigWeighted'] as const; @@ -11,7 +10,7 @@ export function addSigner(c: ContractBuilder, signer: SignerOptions, upgradeable if (!signer) return; const signerName = signer === 'MultisigWeighted' ? signers.Multisig.name : signers[signer].name; - c.addOverride({ name: makeUpgradeable(signerName, upgradeable) }, signerFunctions._rawSignatureValidation); + c.addOverride({ name: signerName }, signerFunctions._rawSignatureValidation); switch (signer) { case 'ERC7702': @@ -28,52 +27,16 @@ export function addSigner(c: ContractBuilder, signer: SignerOptions, upgradeable case 'RSA': case 'Multisig': case 'MultisigWeighted': { - if (upgradeable) { - c.addParent({ - name: 'Initializable', - path: '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol', - }); - addLockingConstructorAllowReachable(c); - - const fn = { name: 'initialize', kind: 'public' as const, args: signerArgs[signer] }; - c.addModifier('initializer', fn); - c.addFunctionCode(`__${signers[signer].name}_init(${signerArgs[signer].map(arg => arg.name).join(', ')});`, fn); - c.addParent({ - name: `${signers[signer].name}Upgradeable`, - path: makeUpgradeable(signers[signer].path, upgradeable), - }); - } else { - signerArgs[signer].forEach(arg => c.addConstructorArgument(arg)); - c.addParent( - signers[signer], - signerArgs[signer].map(arg => ({ lit: arg.name })), - ); - } - + signerArgs[signer].forEach(arg => c.addConstructorArgument(arg)); + c.addParent( + signers[signer], + signerArgs[signer].map(arg => ({ lit: arg.name })), + ); break; } } } -/** - * Adds a locking constructor that disables initializers and annotates it to allow reachable constructors during Upgrades Plugins validations, - * which includes constructors in parent contracts. - * - * IMPORTANT: If a locking constructor is already present, it will not be added again, even if the body comments are different. - * - * @param c The contract builder. - * @param bodyComments Optional comments to add to the constructor body, before disabling initializers. - */ -export function addLockingConstructorAllowReachable(c: ContractBuilder, bodyComments?: string[]): void { - const disableInitializers = '_disableInitializers();'; - - if (!c.constructorCode.includes(disableInitializers)) { - c.addConstructorComment('/// @custom:oz-upgrades-unsafe-allow-reachable constructor'); - bodyComments?.forEach(comment => c.addConstructorCode(comment)); - c.addConstructorCode(disableInitializers); - } -} - export const signers = { ERC7702: { name: 'SignerERC7702', diff --git a/packages/core/solidity/src/zip-foundry.test.ts b/packages/core/solidity/src/zip-foundry.test.ts index 527147d2f..cc28602ce 100644 --- a/packages/core/solidity/src/zip-foundry.test.ts +++ b/packages/core/solidity/src/zip-foundry.test.ts @@ -187,9 +187,8 @@ async function extractAndRunPackage(zip: JSZip, c: Contract, t: ExecutionContext const setGitUser = 'git init && git config user.email "test@test.test" && git config user.name "Test"'; const setup = 'bash setup.sh'; - const test = 'forge test' + (c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''); - const script = - `forge script script/${c.name}.s.sol` + (c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''); + const test = 'forge test' + (c.upgradeable ? ' --force' : ''); + const script = `forge script script/${c.name}.s.sol` + (c.upgradeable ? ' --force' : ''); const exec = (cmd: string) => util.promisify(child.exec)(cmd, { env: { ...process.env, NO_COLOR: '' } }); diff --git a/packages/core/solidity/src/zip-foundry.test.ts.md b/packages/core/solidity/src/zip-foundry.test.ts.md index dcccd0261..fedff385e 100644 --- a/packages/core/solidity/src/zip-foundry.test.ts.md +++ b/packages/core/solidity/src/zip-foundry.test.ts.md @@ -38,7 +38,6 @@ Generated by [AVA](https://avajs.dev). ␊ # Install OpenZeppelin Contracts␊ forge install OpenZeppelin/openzeppelin-contracts@vX.Y.Z --quiet␊ - ␊ ␊ # Remove unneeded Foundry template files␊ rm src/Counter.sol␊ @@ -55,7 +54,6 @@ Generated by [AVA](https://avajs.dev). echo "" >> remappings.txt␊ fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - ␊ ␊ # Perform initial git commit␊ git add .␊ @@ -235,9 +233,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -256,6 +253,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -324,7 +322,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (tokenBridge_, recipient, initialOwner))␊ );␊ - MyToken instance = MyToken(proxy);␊ + MyToken instance = MyToken(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -435,7 +433,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (tokenBridge_, recipient, initialOwner))␊ );␊ - instance = MyToken(proxy);␊ + instance = MyToken(payable(proxy));␊ }␊ ␊ function testName() public view {␊ @@ -477,9 +475,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -498,6 +495,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -565,7 +563,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (defaultAdmin, upgrader))␊ );␊ - MyToken instance = MyToken(proxy);␊ + MyToken instance = MyToken(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -626,7 +624,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (defaultAdmin, upgrader))␊ );␊ - instance = MyToken(proxy);␊ + instance = MyToken(payable(proxy));␊ }␊ ␊ function testName() public view {␊ @@ -668,9 +666,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -689,6 +686,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -755,7 +753,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - MyToken instance = MyToken(proxy);␊ + MyToken instance = MyToken(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -806,7 +804,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - instance = MyToken(proxy);␊ + instance = MyToken(payable(proxy));␊ }␊ ␊ function testName() public view {␊ @@ -850,7 +848,6 @@ Generated by [AVA](https://avajs.dev). ␊ # Install OpenZeppelin Contracts␊ forge install OpenZeppelin/openzeppelin-contracts@vX.Y.Z --quiet␊ - ␊ ␊ # Remove unneeded Foundry template files␊ rm src/Counter.sol␊ @@ -867,7 +864,6 @@ Generated by [AVA](https://avajs.dev). echo "" >> remappings.txt␊ fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - ␊ ␊ # Perform initial git commit␊ git add .␊ @@ -1001,9 +997,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -1022,6 +1017,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -1089,7 +1085,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - MyToken instance = MyToken(proxy);␊ + MyToken instance = MyToken(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -1137,7 +1133,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - instance = MyToken(proxy);␊ + instance = MyToken(payable(proxy));␊ }␊ ␊ function testUri() public view {␊ @@ -1181,7 +1177,6 @@ Generated by [AVA](https://avajs.dev). ␊ # Install OpenZeppelin Contracts␊ forge install OpenZeppelin/openzeppelin-contracts@vX.Y.Z --quiet␊ - ␊ ␊ # Remove unneeded Foundry template files␊ rm src/Counter.sol␊ @@ -1198,7 +1193,6 @@ Generated by [AVA](https://avajs.dev). echo "" >> remappings.txt␊ fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - ␊ ␊ # Perform initial git commit␊ git add .␊ @@ -1270,20 +1264,10 @@ Generated by [AVA](https://avajs.dev). import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("My Account", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ + constructor(address signer) EIP712("My Account", "1") SignerECDSA(signer) {}␊ }␊ `, `// SPDX-License-Identifier: MIT␊ @@ -1307,167 +1291,6 @@ Generated by [AVA](https://avajs.dev). `, ] -## account ecdsa uups - -> Snapshot 1 - - [ - `#!/usr/bin/env bash␊ - ␊ - # Check if git is installed␊ - if ! which git &> /dev/null␊ - then␊ - echo "git command not found. Install git and try again."␊ - exit 1␊ - fi␊ - ␊ - # Check if Foundry is installed␊ - if ! which forge &> /dev/null␊ - then␊ - echo "forge command not found. Install Foundry and try again. See https://book.getfoundry.sh/getting-started/installation"␊ - exit 1␊ - fi␊ - ␊ - # Setup Foundry project␊ - if ! [ -f "foundry.toml" ]␊ - then␊ - echo "Initializing Foundry project..."␊ - ␊ - # Backup Wizard template readme to avoid it being overwritten␊ - mv README.md README-oz.md␊ - ␊ - # Initialize sample Foundry project␊ - forge init --force --quiet␊ - ␊ - # Install OpenZeppelin Contracts␊ - forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - ␊ - ␊ - # Remove unneeded Foundry template files␊ - rm src/Counter.sol␊ - rm script/Counter.s.sol␊ - rm test/Counter.t.sol␊ - rm README.md␊ - ␊ - # Restore Wizard template readme␊ - mv README-oz.md README.md␊ - ␊ - # Add remappings␊ - if [ -f "remappings.txt" ]␊ - then␊ - echo "" >> remappings.txt␊ - fi␊ - echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ - ␊ - ␊ - # Perform initial git commit␊ - git add .␊ - git commit -m "openzeppelin: add wizard output" --quiet␊ - ␊ - echo "Done."␊ - else␊ - echo "Foundry project already initialized."␊ - fi␊ - `, - `# Sample Foundry Project␊ - ␊ - This project demonstrates a basic Foundry use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, and a script that deploys that contract.␊ - ␊ - ## Installing Foundry␊ - ␊ - See [Foundry installation guide](https://book.getfoundry.sh/getting-started/installation).␊ - ␊ - ## Initializing the project␊ - ␊ - \`\`\`␊ - bash setup.sh␊ - \`\`\`␊ - ␊ - ## Testing the contract␊ - ␊ - \`\`\`␊ - forge test␊ - \`\`\`␊ - ␊ - ## Deploying the contract␊ - ␊ - You can simulate a deployment by running the script:␊ - ␊ - \`\`\`␊ - forge script script/MyAccount.s.sol␊ - \`\`\`␊ - ␊ - See [Solidity scripting guide](https://book.getfoundry.sh/guides/scripting-with-solidity) for more information.␊ - `, - `// SPDX-License-Identifier: MIT␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Script} from "forge-std/Script.sol";␊ - import {console} from "forge-std/console.sol";␊ - import {MyAccount} from "src/MyAccount.sol";␊ - ␊ - contract MyAccountScript is Script {␊ - function setUp() public {}␊ - ␊ - function run() public {␊ - vm.startBroadcast();␊ - MyAccount instance = new MyAccount();␊ - console.log("Contract deployed to %s", address(instance));␊ - vm.stopBroadcast();␊ - }␊ - }␊ - `, - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("My Account", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ - }␊ - `, - `// SPDX-License-Identifier: MIT␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Test} from "forge-std/Test.sol";␊ - import {MyAccount} from "src/MyAccount.sol";␊ - ␊ - contract MyAccountTest is Test {␊ - MyAccount public instance;␊ - ␊ - function setUp() public {␊ - instance = new MyAccount();␊ - }␊ - ␊ - function testSomething() public {␊ - // Add your test here␊ - }␊ - }␊ - `, - ] - ## custom basic > Snapshot 1 @@ -1502,7 +1325,6 @@ Generated by [AVA](https://avajs.dev). ␊ # Install OpenZeppelin Contracts␊ forge install OpenZeppelin/openzeppelin-contracts@vX.Y.Z --quiet␊ - ␊ ␊ # Remove unneeded Foundry template files␊ rm src/Counter.sol␊ @@ -1519,7 +1341,6 @@ Generated by [AVA](https://avajs.dev). echo "" >> remappings.txt␊ fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ - ␊ ␊ # Perform initial git commit␊ git add .␊ @@ -1637,9 +1458,8 @@ Generated by [AVA](https://avajs.dev). # Initialize sample Foundry project␊ forge init --force --quiet␊ ␊ - # Install OpenZeppelin Contracts␊ + # Install OpenZeppelin Contracts and Upgrades␊ forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ - # Install OpenZeppelin Foundry Upgrades␊ forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ ␊ # Remove unneeded Foundry template files␊ @@ -1658,6 +1478,7 @@ Generated by [AVA](https://avajs.dev). fi␊ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ # Add settings in foundry.toml␊ echo "" >> foundry.toml␊ echo "ffi = true" >> foundry.toml␊ @@ -1726,7 +1547,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyContract.initialize, (initialAuthority))␊ );␊ - MyContract instance = MyContract(proxy);␊ + MyContract instance = MyContract(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -1769,7 +1590,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyContract.initialize, (initialAuthority))␊ );␊ - instance = MyContract(proxy);␊ + instance = MyContract(payable(proxy));␊ }␊ ␊ function testSomething() public {␊ diff --git a/packages/core/solidity/src/zip-foundry.test.ts.snap b/packages/core/solidity/src/zip-foundry.test.ts.snap index 065cc82899c83421ac58813bcf2991b2970fd695..fccd0bc032affd10bb7c392427d6442947479873 100644 GIT binary patch literal 4256 zcmV;R5MS>>RzV_&L?9PyMWX6)|m?G(f zIng3S^3H!lH)ncxJDQnZclVH5>4ZZPj`49o}7(X6x zIP`S)?ELB3UH(~eDUBY)-RbJ;>YD1Bu3uHp{;IR@6Zby*>8}yT+($n^)Lonhoyhkw z3t^x22xmY1mFGbYKls`&p0U1UiGOof=AL`YvaH*dWqs$eWxa64vfg;XvIehM)+=+* zy*zh$g;F?}o710Odg&!=u4c_$w&q^6UYWaOeRb{`Ywq&Pm%e!R+G|e4sI!kl2ZaY< zAF^Jpb`7ldkb58C4(MVIFatPb9Qr=;YPbVl1BX5A_TsjGej7L*I&i|s_iMa|!Wsa` z?GaEHtu6@y7W9w(GST0N226=-!X| z;NS5>NIk$&(DxxnfFkGx2yg=60l^-?9PA^(h#Vk#NHOQ}NWlTPx4yErxo!uZ`qU;5 z?ZA`F6A=(#FzEZJFd3k31P(C=?RJMy7lC&Bvj`)uc}RWV?W6ER)bAr7hhUY2oI;ng z6oVp}L;5IusJ^sa-RGTy_w5ht53|GELjgHJAPPf-Jme*UCK~BrABo{;02pbVeZ!cW~+gX#|QYKy7>0y?z^iV)T#wp~80Vtd$c9Sj<_?4nMEKC<&%bXH&O$3S~a#y0;kymFg8N5Q~>Wm zp0IDl?h7j8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x!`3&1ZWiIb7q@>CWA{3QW}z*dUCMI zgoGc(p}_tM%>-9f9-Ia(bL`80y4fd^0GTjzWSeK+gjedWm*66E0*=g zwQ5^S1;t!1D5ip6s%u@aI1$RBoz`5z9KV=*m_w^A8`BMySqSQM(ZwMh z320G>{dCF2V;z5DT_DzB&^~x+S`K`AvCDx|+m2yHkaX+}mIPU|INLSB^KYm{LFV3x z0EV!Oyy6<+*Z!~U-ihC;S=KLZTh?}U??kmmxMpjF>fVVfzBak6sp0D0iA%9M{FiEV zc)3@HGrM;pyGoq1t0(^EdR#p*FH6qZpQf1R4hluLCeu)SkgGp@ex~WrLwKyJoV(Hv|0((m?HmAD}Latb;Q^xY5()UJi! { function getImports(c: Contract) { const result = ['import {Test} from "forge-std/Test.sol";']; - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { result.push('import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";'); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); @@ -37,20 +37,20 @@ const test = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { if (opts?.upgradeable === 'transparent') { return [ `address proxy = Upgrades.deployTransparentProxy(`, [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], ');', - `instance = ${c.name}(proxy);`, + `instance = ${c.name}(payable(proxy));`, ]; } else { return [ `address proxy = Upgrades.deployUUPSProxy(`, [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], ');', - `instance = ${c.name}(proxy);`, + `instance = ${c.name}(payable(proxy));`, ]; } } else { @@ -61,11 +61,7 @@ const test = (c: Contract, opts?: GenericOptions) => { function getAddressVariables(c: Contract, args: string[]): Lines[] { const vars = []; let i = 1; // private key index starts from 1 since it must be non-zero - if ( - c.shouldUseUpgradesPluginsForProxyDeployment && - opts?.upgradeable === 'transparent' && - !args.includes('initialOwner') - ) { + if (c.upgradeable && opts?.upgradeable === 'transparent' && !args.includes('initialOwner')) { vars.push(`address initialOwner = vm.addr(${i++});`); } for (const arg of args) { @@ -112,7 +108,7 @@ const script = (c: Contract, opts?: GenericOptions) => { function getImports(c: Contract) { const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { result.push('import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";'); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); @@ -125,7 +121,7 @@ const script = (c: Contract, opts?: GenericOptions) => { 'vm.startBroadcast();', ...getAddressVariables(c, args), ...getDeploymentCode(c, args), - `console.log("${c.shouldUseUpgradesPluginsForProxyDeployment ? 'Proxy' : 'Contract'} deployed to %s", address(instance));`, + `console.log("${c.upgradeable ? 'Proxy' : 'Contract'} deployed to %s", address(instance));`, 'vm.stopBroadcast();', ]; return [ @@ -139,20 +135,20 @@ const script = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { if (opts?.upgradeable === 'transparent') { return [ `address proxy = Upgrades.deployTransparentProxy(`, [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], ');', - `${c.name} instance = ${c.name}(proxy);`, + `${c.name} instance = ${c.name}(payable(proxy));`, ]; } else { return [ `address proxy = Upgrades.deployUUPSProxy(`, [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], ');', - `${c.name} instance = ${c.name}(proxy);`, + `${c.name} instance = ${c.name}(payable(proxy));`, ]; } } else { @@ -162,11 +158,7 @@ const script = (c: Contract, opts?: GenericOptions) => { function getAddressVariables(c: Contract, args: string[]): Lines[] { const vars = []; - if ( - c.shouldUseUpgradesPluginsForProxyDeployment && - opts?.upgradeable === 'transparent' && - !args.includes('initialOwner') - ) { + if (c.upgradeable && opts?.upgradeable === 'transparent' && !args.includes('initialOwner')) { vars.push('address initialOwner = ;'); } for (const arg of args) { @@ -214,23 +206,16 @@ then forge init --force --quiet ${ - c.shouldInstallContractsUpgradeable + c.upgradeable ? `\ - # Install OpenZeppelin Contracts - forge install OpenZeppelin/openzeppelin-contracts-upgradeable@v${contracts.version} --quiet\ + # Install OpenZeppelin Contracts and Upgrades + forge install OpenZeppelin/openzeppelin-contracts-upgradeable@v${contracts.version} --quiet + forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet\ ` : `\ # Install OpenZeppelin Contracts forge install OpenZeppelin/openzeppelin-contracts@v${contracts.version} --quiet\ ` -} -${ - c.shouldUseUpgradesPluginsForProxyDeployment - ? `\ - # Install OpenZeppelin Foundry Upgrades - forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet\ -` - : '' } # Remove unneeded Foundry template files @@ -248,18 +233,11 @@ ${ echo "" >> remappings.txt fi ${ - c.shouldInstallContractsUpgradeable + c.upgradeable ? `\ echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt - echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt\ -` - : `\ - echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt\ -` -} -${ - c.shouldUseUpgradesPluginsForProxyDeployment - ? `\ + echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt + # Add settings in foundry.toml echo "" >> foundry.toml echo "ffi = true" >> foundry.toml @@ -267,7 +245,9 @@ ${ echo "build_info = true" >> foundry.toml echo "extra_output = [\\"storageLayout\\"]" >> foundry.toml\ ` - : '' + : `\ + echo "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/" >> remappings.txt\ +` } # Perform initial git commit @@ -298,7 +278,7 @@ bash setup.sh ## Testing the contract \`\`\` -forge test${c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''} +forge test${c.upgradeable ? ' --force' : ''} \`\`\` ## Deploying the contract @@ -306,7 +286,7 @@ forge test${c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''} You can simulate a deployment by running the script: \`\`\` -forge script script/${c.name}.s.sol${c.shouldUseUpgradesPluginsForProxyDeployment ? ' --force' : ''} +forge script script/${c.name}.s.sol${c.upgradeable ? ' --force' : ''} \`\`\` See [Solidity scripting guide](https://book.getfoundry.sh/guides/scripting-with-solidity) for more information. diff --git a/packages/core/solidity/src/zip-hardhat.test.ts.md b/packages/core/solidity/src/zip-hardhat.test.ts.md index c0068444e..3c1f723d0 100644 --- a/packages/core/solidity/src/zip-hardhat.test.ts.md +++ b/packages/core/solidity/src/zip-hardhat.test.ts.md @@ -499,20 +499,10 @@ Generated by [AVA](https://avajs.dev). import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";␊ import {SignerECDSA} from "@openzeppelin/contracts/utils/cryptography/signers/SignerECDSA.sol";␊ ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor(address signer) EIP712("My Account", "1") SignerECDSA(signer) {␊ - // Accounts are typically deployed and initialized as clones during their first user op,␊ - // therefore, initializers are disabled for the implementation contract␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - _setSigner(signer);␊ - }␊ + contract MyAccount is Account, EIP712, ERC7739, SignerECDSA, ERC721Holder, ERC1155Holder {␊ + constructor(address signer) EIP712("My Account", "1") SignerECDSA(signer) {}␊ }␊ `, `import { HardhatUserConfig } from "hardhat/config";␊ @@ -574,100 +564,6 @@ Generated by [AVA](https://avajs.dev). `, ] -## account ecdsa uups - -> Snapshot 1 - - [ - `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Contracts ^5.4.0␊ - pragma solidity ^0.8.27;␊ - ␊ - import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ - import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ - import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ - import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ - import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ - import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ - import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ - import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ - ␊ - contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ - /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ - constructor() EIP712("My Account", "1") {␊ - _disableInitializers();␊ - }␊ - ␊ - function initialize(address signer) public initializer {␊ - __SignerECDSA_init(signer);␊ - }␊ - ␊ - function _authorizeUpgrade(address newImplementation)␊ - internal␊ - override␊ - onlyEntryPointOrSelf␊ - {}␊ - }␊ - `, - `import { HardhatUserConfig } from "hardhat/config";␊ - import "@nomicfoundation/hardhat-toolbox";␊ - ␊ - ␊ - const config: HardhatUserConfig = {␊ - solidity: {␊ - version: "0.8.27",␊ - settings: {␊ - optimizer: {␊ - enabled: true,␊ - },␊ - },␊ - },␊ - };␊ - ␊ - export default config;␊ - `, - `{␊ - "name": "hardhat-sample",␊ - "version": "0.0.1",␊ - "description": "",␊ - "main": "index.js",␊ - "scripts": {␊ - "test": "hardhat test"␊ - },␊ - "author": "",␊ - "license": "MIT",␊ - "devDependencies": {␊ - "@openzeppelin/contracts": "^5.4.0",␊ - "@openzeppelin/contracts-upgradeable": "^5.4.0",␊ - "@openzeppelin/hardhat-upgrades": "^3.0.0",␊ - "@nomicfoundation/hardhat-toolbox": "^6.1.0",␊ - "hardhat": "^2.16.1"␊ - }␊ - }`, - `import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";␊ - ␊ - export default buildModule("MyAccountModule", (m) => {␊ - ␊ - ␊ - const myAccount = m.contract("MyAccount", []);␊ - ␊ - return { myAccount };␊ - });␊ - `, - `import { expect } from "chai";␊ - import { ethers } from "hardhat";␊ - ␊ - describe("MyAccount", function () {␊ - it("Test contract", async function () {␊ - const ContractFactory = await ethers.getContractFactory("MyAccount");␊ - ␊ - const instance = await ContractFactory.deploy();␊ - await instance.waitForDeployment();␊ - });␊ - });␊ - `, - ] - ## custom basic > Snapshot 1 diff --git a/packages/core/solidity/src/zip-hardhat.test.ts.snap b/packages/core/solidity/src/zip-hardhat.test.ts.snap index ed7a6bb80d37ea6aedce470a85865cd2d71a1813..481b2bf3bc12d4ba31c20532af0dc09030a9da24 100644 GIT binary patch literal 3079 zcmV+i4EXawRzVl~u@CMJ zCDPQxfhoWix%zUuDz#C^hk`v=4^_t9sFx}6s6#=ehP=tQhfIQ#Wi zp677qm#=?22d)9}Q@LJw>3sme9RR==*8%v`%K(5^0C@jZ0N$#+^k!v#l~QL=sU)9n z+_(WMRZy7+l~=)Al`G)w${eW7zj>u~z1f6Y57vLN@DX-V$k4)uheD3K7||uTxv^bs zHsKlxB8THWAHf66`|y5*!e5~%LOu@R8VNadT+ZMpx9lI;t!hM_Uf@7ReC%O9fS12q#BO$A6z}=ig)RvhcR~&ytnO^xeYpGZ z{zrG=3VecG*Ll*pb=#`tZq(|_Ct_@Fe7tSM$lVYa5=6G5vC9dy9M7Y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8xBBN@GM&DwkJa=Gl(HLe5cSI~|D`hw+gSdQ@vGYtv+Fpv@H|VWU(|+h|473A(A( zB6)R$gZBa~PT!=uWYM%H^rQ=I1|5(1h(R}$V3Kzbrm%%6<4_*HCqX4Wfylt9MJTGI zX-+ktrc&LwOyUf$7?+W=B3~m945wXLR4pQpO=0g8_Fh5Q`|5?kUY#V)3HV02HxGT2 zRQ6bH#D3Tt4IKo0KRILIo0xP-&^Iz53x1V*&KLG(a^Wa|xBne;2Cd5P7a1VyUrmtp zcQXL|{U!jvm<8Zy?03u`&P*Ze6tbQHWIfdz`V<74=*uT3q1r3(_I^SXoj;*F2vAS* zo_|DyJq%Ny*;##4#t=*8^JrzYI{B>>>R1pv0L1F&>sT-^IpaDlit z1p}f{@Mu~Zrj*H5qD;QLu&f>Jfs@j9yjSvhdnL((hQu8Y87g=1p# diff --git a/packages/core/solidity/src/zip-hardhat.ts b/packages/core/solidity/src/zip-hardhat.ts index 2531d4c57..23ed27a0c 100644 --- a/packages/core/solidity/src/zip-hardhat.ts +++ b/packages/core/solidity/src/zip-hardhat.ts @@ -6,10 +6,10 @@ import SOLIDITY_VERSION from './solidity-version.json'; import type { Lines } from './utils/format-lines'; import { formatLinesWithSpaces, spaceBetween } from './utils/format-lines'; -const hardhatConfig = (useHardhatUpgrades: boolean) => `\ +const hardhatConfig = (upgradeable: boolean) => `\ import { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox"; -${useHardhatUpgrades ? `import "@openzeppelin/hardhat-upgrades";` : ''} +${upgradeable ? `import "@openzeppelin/hardhat-upgrades";` : ''} const config: HardhatUserConfig = { solidity: { @@ -119,7 +119,7 @@ function getAddressArgs(c: Contract): string[] { } function getDeploymentCall(c: Contract, args: string[]): string { - return c.shouldUseUpgradesPluginsForProxyDeployment + return c.upgradeable ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` : `ContractFactory.deploy(${args.join(', ')})`; } @@ -136,7 +136,7 @@ async function main() { const instance = await ${getDeploymentCall(c, args)}; await instance.waitForDeployment(); - console.log(\`${c.shouldUseUpgradesPluginsForProxyDeployment ? 'Proxy' : 'Contract'} deployed to \${await instance.getAddress()}\`); + console.log(\`${c.upgradeable ? 'Proxy' : 'Contract'} deployed to \${await instance.getAddress()}\`); } // We recommend this pattern to be able to use async/await everywhere @@ -169,7 +169,7 @@ export default buildModule("${c.name}Module", (m) => { const readme = (c: Contract) => `\ # Sample Hardhat Project -This project demonstrates a basic Hardhat use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, ${c.shouldUseUpgradesPluginsForProxyDeployment ? 'and a script that deploys that contract' : 'and a Hardhat Ignition module that deploys that contract'}. +This project demonstrates a basic Hardhat use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, ${c.upgradeable ? 'and a script that deploys that contract' : 'and a Hardhat Ignition module that deploys that contract'}. ## Installing dependencies @@ -188,13 +188,13 @@ npm test You can target any network from your Hardhat config using: \`\`\` -${c.shouldUseUpgradesPluginsForProxyDeployment ? 'npx hardhat run --network scripts/deploy.ts' : `npx hardhat ignition deploy ignition/modules/${c.name}.ts --network `} +${c.upgradeable ? 'npx hardhat run --network scripts/deploy.ts' : `npx hardhat ignition deploy ignition/modules/${c.name}.ts --network `} \`\`\` `; function getHardhatPlugins(c: Contract) { const plugins = ['ethers']; - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { plugins.push('upgrades'); } return plugins; @@ -203,29 +203,27 @@ function getHardhatPlugins(c: Contract) { export async function zipHardhat(c: Contract, opts?: GenericOptions) { const zip = new JSZip(); - const { default: packageJson } = - c.shouldInstallContractsUpgradeable || c.shouldUseUpgradesPluginsForProxyDeployment - ? await import('./environments/hardhat/upgradeable/package.json') - : await import('./environments/hardhat/package.json'); + const { default: packageJson } = c.upgradeable + ? await import('./environments/hardhat/upgradeable/package.json') + : await import('./environments/hardhat/package.json'); packageJson.license = c.license; - const { default: packageLock } = - c.shouldInstallContractsUpgradeable || c.shouldUseUpgradesPluginsForProxyDeployment - ? await import('./environments/hardhat/upgradeable/package-lock.json') - : await import('./environments/hardhat/package-lock.json'); + const { default: packageLock } = c.upgradeable + ? await import('./environments/hardhat/upgradeable/package-lock.json') + : await import('./environments/hardhat/package-lock.json'); packageLock.packages[''].license = c.license; zip.file(`contracts/${c.name}.sol`, printContract(c)); zip.file('test/test.ts', test(c, opts)); - if (c.shouldUseUpgradesPluginsForProxyDeployment) { + if (c.upgradeable) { zip.file('scripts/deploy.ts', script(c)); } else { zip.file(`ignition/modules/${c.name}.ts`, ignitionModule(c)); } zip.file('.gitignore', gitIgnore); - zip.file('hardhat.config.ts', hardhatConfig(c.shouldUseUpgradesPluginsForProxyDeployment)); + zip.file('hardhat.config.ts', hardhatConfig(c.upgradeable)); zip.file('package.json', JSON.stringify(packageJson, null, 2)); zip.file(`package-lock.json`, JSON.stringify(packageLock, null, 2)); zip.file('README.md', readme(c)); From d92a0fd8646098079cc2549e8b252ed6c702d338 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 8 Sep 2025 22:22:47 +0200 Subject: [PATCH 02/11] lint and changeset --- .changeset/lovely-groups-run.md | 5 +++ packages/core/solidity/src/account.ts | 7 +-- packages/core/solidity/src/options.ts | 4 +- packages/core/solidity/src/print.ts | 44 ++++++++----------- packages/core/solidity/src/set-upgradeable.ts | 2 +- 5 files changed, 28 insertions(+), 34 deletions(-) create mode 100644 .changeset/lovely-groups-run.md diff --git a/.changeset/lovely-groups-run.md b/.changeset/lovely-groups-run.md new file mode 100644 index 000000000..9bbc9f7ae --- /dev/null +++ b/.changeset/lovely-groups-run.md @@ -0,0 +1,5 @@ +--- +'@openzeppelin/wizard': patch +--- + +Remove all initializers from non-upgradeable accounts. diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index 35e373f71..7ee580150 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -5,12 +5,7 @@ import { printContract } from './print'; import { defaults as commonDefaults, withCommonDefaults, type CommonOptions } from './common-options'; import { upgradeableName } from './options'; import { setInfo } from './set-info'; -import { - addSigner, - signerFunctions, - signers, - type SignerOptions, -} from './signer'; +import { addSigner, signerFunctions, signers, type SignerOptions } from './signer'; import { setUpgradeableAccount } from './set-upgradeable'; export const defaults: Required = { diff --git a/packages/core/solidity/src/options.ts b/packages/core/solidity/src/options.ts index 311a0de96..9a1606490 100644 --- a/packages/core/solidity/src/options.ts +++ b/packages/core/solidity/src/options.ts @@ -9,7 +9,7 @@ export function upgradeableName(n: string) { } else { return n.replace(/(Upgradeable)?(?=\.|$)/, 'Upgradeable'); } -}; +} export function upgradeableImport(p: ImportContract): ImportContract { const { dir, ext, name } = path.parse(p.path); @@ -23,7 +23,7 @@ export function upgradeableImport(p: ImportContract): ImportContract { name: upgradeableName(name), // Solidity file name }), }; -}; +} export interface Options { transformImport?: (parent: ImportContract) => ImportContract; diff --git a/packages/core/solidity/src/print.ts b/packages/core/solidity/src/print.ts index 0fa7d56b5..e10eee6cc 100644 --- a/packages/core/solidity/src/print.ts +++ b/packages/core/solidity/src/print.ts @@ -85,41 +85,35 @@ function printConstructor(contract: Contract, helpers: Helpers): Lines[] { if (helpers.upgradeable) { const upgradeableParents = parentsWithInitializers.filter(p => inferTranspiled(p.contract)); const nonUpgradeableParents = parentsWithInitializers.filter(p => !inferTranspiled(p.contract)); - - return spaceBetween( - // constructor - printFunction2( - [ - nonUpgradeableParents.length > 0 + const constructor = printFunction2( + [ + nonUpgradeableParents.length > 0 ? '/// @custom:oz-upgrades-unsafe-allow-reachable constructor' : '/// @custom:oz-upgrades-unsafe-allow constructor', - ], - 'constructor', - [], - nonUpgradeableParents.flatMap(p => printParentConstructor(p, helpers)), - ['_disableInitializers();'] + ], + 'constructor', + [], + nonUpgradeableParents.flatMap(p => printParentConstructor(p, helpers)), + ['_disableInitializers();'], + ); + const initializer = printFunction2( + [], + 'function initialize', + contract.constructorArgs.map(a => printArgument(a, helpers)), + ['public', 'initializer'], + spaceBetween( + upgradeableParents.flatMap(p => printParentConstructor(p, helpers)).map(p => p + ';'), + contract.constructorCode, ), - // initializer - upgradeableParents.length > 0 - ? printFunction2( - [], - 'function initialize', - contract.constructorArgs.map(a => printArgument(a, helpers)), - [ 'public', 'initializer' ], - spaceBetween( - upgradeableParents.flatMap(p => printParentConstructor(p, helpers)).map(p => p + ';'), - contract.constructorCode, - ) - ) - : [], ); + return spaceBetween(constructor, upgradeableParents.length > 0 ? initializer : []); } else { return printFunction2( [], 'constructor', contract.constructorArgs.map(a => printArgument(a, helpers)), parentsWithInitializers.flatMap(p => printParentConstructor(p, helpers)), - contract.constructorCode + contract.constructorCode, ); } } else if (!helpers.upgradeable) { diff --git a/packages/core/solidity/src/set-upgradeable.ts b/packages/core/solidity/src/set-upgradeable.ts index 26a2edef8..723dbe77f 100644 --- a/packages/core/solidity/src/set-upgradeable.ts +++ b/packages/core/solidity/src/set-upgradeable.ts @@ -60,7 +60,7 @@ export function setUpgradeableGovernor(c: ContractBuilder, upgradeable: Upgradea export function setUpgradeableAccount(c: ContractBuilder, upgradeable: Upgradeable) { setUpgradeableBase(c, upgradeable, () => { - c.addModifier('onlyEntryPointOrSelf', functions._authorizeUpgrade); + c.addModifier('onlyEntryPointOrSelf', functions._authorizeUpgrade); }); } From 36b2d0ccf9ddf727e2ba42e5cca66764bfa62bcf Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 09:54:54 +0200 Subject: [PATCH 03/11] fix foundry zip tests --- .../core/solidity/src/zip-foundry.test.ts | 4 +- .../core/solidity/src/zip-foundry.test.ts.md | 212 ++++++++++++++++-- .../solidity/src/zip-foundry.test.ts.snap | Bin 4256 -> 4529 bytes packages/core/solidity/src/zip-foundry.ts | 162 +++++++++---- 4 files changed, 323 insertions(+), 55 deletions(-) diff --git a/packages/core/solidity/src/zip-foundry.test.ts b/packages/core/solidity/src/zip-foundry.test.ts index cc28602ce..8667b6d36 100644 --- a/packages/core/solidity/src/zip-foundry.test.ts +++ b/packages/core/solidity/src/zip-foundry.test.ts @@ -156,9 +156,7 @@ async function runTest(c: Contract, t: ExecutionContext, opts: GenericO } function assertLayout(zip: JSZip, c: Contract, t: ExecutionContext) { - const sorted = Object.values(zip.files) - .map(f => f.name) - .sort(); + const sorted = Object.keys(zip.files).sort(); t.deepEqual(sorted, [ 'README.md', 'script/', diff --git a/packages/core/solidity/src/zip-foundry.test.ts.md b/packages/core/solidity/src/zip-foundry.test.ts.md index fedff385e..5456c5940 100644 --- a/packages/core/solidity/src/zip-foundry.test.ts.md +++ b/packages/core/solidity/src/zip-foundry.test.ts.md @@ -322,7 +322,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (tokenBridge_, recipient, initialOwner))␊ );␊ - MyToken instance = MyToken(payable(proxy));␊ + MyToken instance = MyToken(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -355,7 +355,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address tokenBridge_, address recipient, address initialOwner)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("My Token", "MTK");␊ __ERC20Bridgeable_init();␊ @@ -433,7 +434,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (tokenBridge_, recipient, initialOwner))␊ );␊ - instance = MyToken(payable(proxy));␊ + instance = MyToken(proxy);␊ }␊ ␊ function testName() public view {␊ @@ -563,7 +564,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (defaultAdmin, upgrader))␊ );␊ - MyToken instance = MyToken(payable(proxy));␊ + MyToken instance = MyToken(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -588,9 +589,7 @@ Generated by [AVA](https://avajs.dev). _disableInitializers();␊ }␊ ␊ - function initialize(address defaultAdmin, address upgrader)␊ - public initializer␊ - {␊ + function initialize(address defaultAdmin, address upgrader) public initializer {␊ __ERC20_init("My Token", "MTK");␊ __ERC20Permit_init("My Token");␊ __AccessControl_init();␊ @@ -624,7 +623,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (defaultAdmin, upgrader))␊ );␊ - instance = MyToken(payable(proxy));␊ + instance = MyToken(proxy);␊ }␊ ␊ function testName() public view {␊ @@ -753,7 +752,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - MyToken instance = MyToken(payable(proxy));␊ + MyToken instance = MyToken(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -804,7 +803,7 @@ Generated by [AVA](https://avajs.dev). "MyToken.sol",␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - instance = MyToken(payable(proxy));␊ + instance = MyToken(proxy);␊ }␊ ␊ function testName() public view {␊ @@ -1085,7 +1084,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - MyToken instance = MyToken(payable(proxy));␊ + MyToken instance = MyToken(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -1133,7 +1132,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyToken.initialize, (initialOwner))␊ );␊ - instance = MyToken(payable(proxy));␊ + instance = MyToken(proxy);␊ }␊ ␊ function testUri() public view {␊ @@ -1291,6 +1290,191 @@ Generated by [AVA](https://avajs.dev). `, ] +## account ecdsa uups + +> Snapshot 1 + + [ + `#!/usr/bin/env bash␊ + ␊ + # Check if git is installed␊ + if ! which git &> /dev/null␊ + then␊ + echo "git command not found. Install git and try again."␊ + exit 1␊ + fi␊ + ␊ + # Check if Foundry is installed␊ + if ! which forge &> /dev/null␊ + then␊ + echo "forge command not found. Install Foundry and try again. See https://book.getfoundry.sh/getting-started/installation"␊ + exit 1␊ + fi␊ + ␊ + # Setup Foundry project␊ + if ! [ -f "foundry.toml" ]␊ + then␊ + echo "Initializing Foundry project..."␊ + ␊ + # Backup Wizard template readme to avoid it being overwritten␊ + mv README.md README-oz.md␊ + ␊ + # Initialize sample Foundry project␊ + forge init --force --quiet␊ + ␊ + # Install OpenZeppelin Contracts and Upgrades␊ + forge install OpenZeppelin/openzeppelin-contracts-upgradeable@vX.Y.Z --quiet␊ + forge install OpenZeppelin/openzeppelin-foundry-upgrades --quiet␊ + ␊ + # Remove unneeded Foundry template files␊ + rm src/Counter.sol␊ + rm script/Counter.s.sol␊ + rm test/Counter.t.sol␊ + rm README.md␊ + ␊ + # Restore Wizard template readme␊ + mv README-oz.md README.md␊ + ␊ + # Add remappings␊ + if [ -f "remappings.txt" ]␊ + then␊ + echo "" >> remappings.txt␊ + fi␊ + echo "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/" >> remappings.txt␊ + echo "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/" >> remappings.txt␊ + ␊ + # Add settings in foundry.toml␊ + echo "" >> foundry.toml␊ + echo "ffi = true" >> foundry.toml␊ + echo "ast = true" >> foundry.toml␊ + echo "build_info = true" >> foundry.toml␊ + echo "extra_output = [\\"storageLayout\\"]" >> foundry.toml␊ + ␊ + # Perform initial git commit␊ + git add .␊ + git commit -m "openzeppelin: add wizard output" --quiet␊ + ␊ + echo "Done."␊ + else␊ + echo "Foundry project already initialized."␊ + fi␊ + `, + `# Sample Foundry Project␊ + ␊ + This project demonstrates a basic Foundry use case. It comes with a contract generated by [OpenZeppelin Wizard](https://wizard.openzeppelin.com/), a test for that contract, and a script that deploys that contract.␊ + ␊ + ## Installing Foundry␊ + ␊ + See [Foundry installation guide](https://book.getfoundry.sh/getting-started/installation).␊ + ␊ + ## Initializing the project␊ + ␊ + \`\`\`␊ + bash setup.sh␊ + \`\`\`␊ + ␊ + ## Testing the contract␊ + ␊ + \`\`\`␊ + forge test --force␊ + \`\`\`␊ + ␊ + ## Deploying the contract␊ + ␊ + You can simulate a deployment by running the script:␊ + ␊ + \`\`\`␊ + forge script script/MyAccount.s.sol --force␊ + \`\`\`␊ + ␊ + See [Solidity scripting guide](https://book.getfoundry.sh/guides/scripting-with-solidity) for more information.␊ + `, + `// SPDX-License-Identifier: MIT␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Script} from "forge-std/Script.sol";␊ + import {console} from "forge-std/console.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + import {MyAccount} from "src/MyAccount.sol";␊ + ␊ + contract MyAccountScript is Script {␊ + function setUp() public {}␊ + ␊ + function run() public {␊ + // TODO: Set addresses for the variables below, then uncomment the following section:␊ + /*␊ + vm.startBroadcast();␊ + address signer = ;␊ + MyAccount implementation = new MyAccount();␊ + address proxy = address(new ERC1967Proxy(␊ + address(implementation),␊ + abi.encodeCall(MyAccount.initialize, (signer))␊ + ));␊ + MyAccount instance = MyAccount(payable(proxy));␊ + console.log("Proxy deployed to %s", address(instance));␊ + vm.stopBroadcast();␊ + */␊ + }␊ + }␊ + `, + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("My Account", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + `, + `// SPDX-License-Identifier: MIT␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Test} from "forge-std/Test.sol";␊ + import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + import {MyAccount} from "src/MyAccount.sol";␊ + ␊ + contract MyAccountTest is Test {␊ + MyAccount public instance;␊ + ␊ + function setUp() public {␊ + address signer = vm.addr(1);␊ + MyAccount implementation = new MyAccount();␊ + address proxy = address(new ERC1967Proxy(␊ + address(implementation),␊ + abi.encodeCall(MyAccount.initialize, (signer))␊ + ));␊ + instance = MyAccount(payable(proxy));␊ + }␊ + ␊ + function testSomething() public {␊ + // Add your test here␊ + }␊ + }␊ + `, + ] + ## custom basic > Snapshot 1 @@ -1547,7 +1731,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyContract.initialize, (initialAuthority))␊ );␊ - MyContract instance = MyContract(payable(proxy));␊ + MyContract instance = MyContract(proxy);␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ */␊ @@ -1590,7 +1774,7 @@ Generated by [AVA](https://avajs.dev). initialOwner,␊ abi.encodeCall(MyContract.initialize, (initialAuthority))␊ );␊ - instance = MyContract(payable(proxy));␊ + instance = MyContract(proxy);␊ }␊ ␊ function testSomething() public {␊ diff --git a/packages/core/solidity/src/zip-foundry.test.ts.snap b/packages/core/solidity/src/zip-foundry.test.ts.snap index fccd0bc032affd10bb7c392427d6442947479873..2d7ea8ddc7bee740c17c0901906c53b7b009e4e0 100644 GIT binary patch literal 4529 zcmV;i5l-$wRzVh!`Ms-#7^ykcw!{N+Gy@wUq_3G8D*RNjJ`@L7ipR|u%Vn1R(`YGa=yXXgq+N;Z; z9k?!LKJ2kB;q1?T;y94QPk;NzuNYr3#DA4*mDfHn4C9_*7~j2W7;juNjQ8F!jQ(}Q zxL$eft;*F6N@2fJ(LcTU=9@;PYE-Tom9HAtD_4wfR9-PESKqqwzpvhS+X@)9j@1o%?E~0>*f(pU>l4huO0|s>LVP5;(te>J zZ9+R}h$ymsh%kD9q(ERFA<*T#$8KBJF(Hr44&rS|YO=1?L7Zd1(_$P_jvPzL2012v zW-|MT2fb*Z9wk3OHkXt59JJa(NXeKJ&#i$kk~7%xF~`uwPqE)gGcirGR;>bX1Kfl5 zqo4==1V4q;0UUWf7jgtBf{up(Cjg!h>;TNcF%pc(38JSIa~_W5oq&hi8(X{Erst@i zTI8weIg)uK0s;(rJr`vr1JsMaKIWj+Y7=TB&}uynFyfkr)c1oP@;^hp9&)h{Hi^$E zv^k40$dXy4hy17NmzJ&je0cJS`KkF?a+rt6BPR$1zK@WDoJi0}BW>&=F&y;(qqen4 z0-qylGUBR-HpM+Ycs^+1hz*|e!ShISS^~xiMFp=Su578|bpH*<0Tg+#*Ta5CNQ&Fa zOa@O){)7ud0YI6GHkKN=dlw|>glchQO&`W}X+^rU)?IvDpywD>9{W(}Jw)4tdg1%W zP%d$?=&%?*TJl&n zY{-xacEZ^q22L^W0tmF~KnM9qbaudTAAFuz1kzBxsB3p4HDJb7W7@>C8chI0BNR&o z@Gj&L`)26ApfXLoe?T4~U%7>F>`-z0#KjKgeMKkujiEL{!K|oD zOBhXyDOQc}HG9I9U|%e*P@QIE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7Q-Y+fHFYSOQg+*)D?q9UAv875K-(r!rtT5YoQhQMv=#(e9SBs%e{>T<5U=L zfC54X!j2+}M<3Hw9Tn+_!<0WCYXnc)n{UTNwUaK`Vo5OEnQj)5aq$(w;(1fa# zWO8(2y(%TCAd2IalI#q_jqz!`^jJ?rmC5^K*VXi}larR2q#>0jw$Nn48jze0Ohq71 zK+T7kr7HR;LmVcp`#5`qYETt#oPF`eIXnO3)^$t=f(xMQif|hs*JH2$0&9XkfS`~OyklV$D+^PbP*@eZPX|C>*qiwh52dy2 zjx|wbVb7{so;VbR;cf~)QQwTk9ZCbmY_V!+$j;|g+EG6bcp_&+BkC~(nUgiI1moD) zT3T3~?5ECMI_PuKrLf-{II?5$Z9^jV{Vwr6M2}W;B8SK@C^BDKTsR_camFWMopd*F zUV8n_V`xE|UFv6c1fLxD?U-hLb!~g)1S6!llzRx_8`Q@ZkatKPy;*ww%@#%vdCPiSt3vH6 z)UHD9D%7q*?W2U+pI4!F6>1+T)YdL*ref_spTZ_?y0NxaTXy3&RAyo4r<+bW+%AoV zha(pEf4ZeH&B)dm(*D>w!;sdXeelQ>GkkcqF~hNK#}GCo6FYj`FvcuSHzIiOstO4* z_3r@;VHbJD2;m>TD64<}zvnIMcULWIxvGD!B7_SZAyoD6PiOQ|)xTHu@6(I`|5QbQ z7drwxxBB;NBsgOw@V|aKO5kTDtUUiL?n!Fl72S$_RT&@T`VX(4YCV1CE*+_=GU;h5 ztW2cMSJs>2`&1A&1NHTXV@oEc_M{m|-D*J!_`%wvbt^fco C3^eNi diff --git a/packages/core/solidity/src/zip-foundry.ts b/packages/core/solidity/src/zip-foundry.ts index d1f247ff8..a7bbf0a98 100644 --- a/packages/core/solidity/src/zip-foundry.ts +++ b/packages/core/solidity/src/zip-foundry.ts @@ -17,7 +17,16 @@ const test = (c: Contract, opts?: GenericOptions) => { function getImports(c: Contract) { const result = ['import {Test} from "forge-std/Test.sol";']; if (c.upgradeable) { - result.push('import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";'); + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + result.push( + useUpgradePlugin + ? 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : opts?.upgradeable == 'transparent' + ? 'import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";' + : 'import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";', + ); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); return result; @@ -37,24 +46,58 @@ const test = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - if (c.upgradeable) { - if (opts?.upgradeable === 'transparent') { - return [ - `address proxy = Upgrades.deployTransparentProxy(`, - [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - `instance = ${c.name}(payable(proxy));`, - ]; - } else { - return [ - `address proxy = Upgrades.deployUUPSProxy(`, - [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - `instance = ${c.name}(payable(proxy));`, - ]; - } - } else { - return [`instance = new ${c.name}(${args.join(', ')});`]; + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + switch (opts?.upgradeable) { + case 'transparent': + return useUpgradePlugin + ? [ + `address proxy = Upgrades.deployTransparentProxy(`, + [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ] + : [ + `${c.name} implementation = new ${c.name}();`, + `address proxy = address(new TransparentUpgradeableProxy(`, + [ + `address(implementation),`, + `initialOwner,`, + `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`, + ], + '));', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ]; + case 'uups': + return useUpgradePlugin + ? [ + `address proxy = Upgrades.deployUUPSProxy(`, + [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ] + : [ + `${c.name} implementation = new ${c.name}();`, + `address proxy = address(new ERC1967Proxy(`, + [`address(implementation),`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + '));', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ]; + default: + return [`instance = new ${c.name}(${args.join(', ')});`]; } } @@ -109,7 +152,16 @@ const script = (c: Contract, opts?: GenericOptions) => { function getImports(c: Contract) { const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; if (c.upgradeable) { - result.push('import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";'); + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + result.push( + useUpgradePlugin + ? 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : opts?.upgradeable == 'transparent' + ? 'import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";' + : 'import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";', + ); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); return result; @@ -135,24 +187,58 @@ const script = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - if (c.upgradeable) { - if (opts?.upgradeable === 'transparent') { - return [ - `address proxy = Upgrades.deployTransparentProxy(`, - [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - `${c.name} instance = ${c.name}(payable(proxy));`, - ]; - } else { - return [ - `address proxy = Upgrades.deployUUPSProxy(`, - [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - `${c.name} instance = ${c.name}(payable(proxy));`, - ]; - } - } else { - return [`${c.name} instance = new ${c.name}(${args.join(', ')});`]; + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + switch (opts?.upgradeable) { + case 'transparent': + return useUpgradePlugin + ? [ + `address proxy = Upgrades.deployTransparentProxy(`, + [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ] + : [ + `${c.name} implementation = new ${c.name}();`, + `address proxy = address(new TransparentUpgradeableProxy(`, + [ + `address(implementation),`, + `initialOwner,`, + `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`, + ], + '));', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ]; + case 'uups': + return useUpgradePlugin + ? [ + `address proxy = Upgrades.deployUUPSProxy(`, + [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ] + : [ + `${c.name} implementation = new ${c.name}();`, + `address proxy = address(new ERC1967Proxy(`, + [`address(implementation),`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + '));', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ]; + default: + return [`${c.name} instance = new ${c.name}(${args.join(', ')});`]; } } From 27d8f1326050f12bbdde73c1aaf3ad11a6c36239 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 10:24:02 +0200 Subject: [PATCH 04/11] fix hardhat zip tests --- .../core/solidity/src/zip-hardhat.test.ts | 10 +- .../core/solidity/src/zip-hardhat.test.ts.md | 109 +++++++++++++++++- .../solidity/src/zip-hardhat.test.ts.snap | Bin 3079 -> 3264 bytes packages/core/solidity/src/zip-hardhat.ts | 9 +- 4 files changed, 118 insertions(+), 10 deletions(-) diff --git a/packages/core/solidity/src/zip-hardhat.test.ts b/packages/core/solidity/src/zip-hardhat.test.ts index 4daa63619..9caab3734 100644 --- a/packages/core/solidity/src/zip-hardhat.test.ts +++ b/packages/core/solidity/src/zip-hardhat.test.ts @@ -102,7 +102,7 @@ test.serial('account ecdsa', async t => { test.serial('account ecdsa uups', async t => { const opts: GenericOptions = { kind: 'Account', name: 'My Account', signer: 'ECDSA', upgradeable: 'uups' }; const c = buildAccount(opts); - await runIgnitionTest(c, t, opts); // Account does not use proxies for deployment, until factories are added + await runDeployScriptTest(c, t, opts); }); test.serial('custom basic', async t => { @@ -138,9 +138,7 @@ async function runIgnitionTest(c: Contract, t: ExecutionContext, opts: } function assertDeployScriptLayout(zip: JSZip, c: Contract, t: ExecutionContext) { - const sorted = Object.values(zip.files) - .map(f => f.name) - .sort(); + const sorted = Object.keys(zip.files).sort(); t.deepEqual(sorted, [ '.gitignore', 'README.md', @@ -158,9 +156,7 @@ function assertDeployScriptLayout(zip: JSZip, c: Contract, t: ExecutionContext) { - const sorted = Object.values(zip.files) - .map(f => f.name) - .sort(); + const sorted = Object.keys(zip.files).sort(); t.deepEqual(sorted, [ '.gitignore', 'README.md', diff --git a/packages/core/solidity/src/zip-hardhat.test.ts.md b/packages/core/solidity/src/zip-hardhat.test.ts.md index 3c1f723d0..745b178b5 100644 --- a/packages/core/solidity/src/zip-hardhat.test.ts.md +++ b/packages/core/solidity/src/zip-hardhat.test.ts.md @@ -162,7 +162,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address tokenBridge_, address recipient, address initialOwner)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("My Token", "MTK");␊ __ERC20Bridgeable_init();␊ @@ -564,6 +565,112 @@ Generated by [AVA](https://avajs.dev). `, ] +## account ecdsa uups + +> Snapshot 1 + + [ + `// SPDX-License-Identifier: MIT␊ + // Compatible with OpenZeppelin Contracts ^5.4.0␊ + pragma solidity ^0.8.27;␊ + ␊ + import {Account} from "@openzeppelin/contracts/account/Account.sol";␊ + import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";␊ + import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";␊ + import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";␊ + import {ERC7739} from "@openzeppelin/contracts/utils/cryptography/signers/draft-ERC7739.sol";␊ + import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊ + import {SignerECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/signers/SignerECDSAUpgradeable.sol";␊ + import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊ + ␊ + contract MyAccount is Initializable, Account, EIP712, ERC7739, SignerECDSAUpgradeable, ERC721Holder, ERC1155Holder, UUPSUpgradeable {␊ + /// @custom:oz-upgrades-unsafe-allow-reachable constructor␊ + constructor() EIP712("My Account", "1") {␊ + _disableInitializers();␊ + }␊ + ␊ + function initialize(address signer) public initializer {␊ + __SignerECDSA_init(signer);␊ + __UUPSUpgradeable_init();␊ + }␊ + ␊ + function _authorizeUpgrade(address newImplementation)␊ + internal␊ + override␊ + onlyEntryPointOrSelf␊ + {}␊ + }␊ + `, + `import { HardhatUserConfig } from "hardhat/config";␊ + import "@nomicfoundation/hardhat-toolbox";␊ + import "@openzeppelin/hardhat-upgrades";␊ + ␊ + const config: HardhatUserConfig = {␊ + solidity: {␊ + version: "0.8.27",␊ + settings: {␊ + optimizer: {␊ + enabled: true,␊ + },␊ + },␊ + },␊ + };␊ + ␊ + export default config;␊ + `, + `{␊ + "name": "hardhat-sample",␊ + "version": "0.0.1",␊ + "description": "",␊ + "main": "index.js",␊ + "scripts": {␊ + "test": "hardhat test"␊ + },␊ + "author": "",␊ + "license": "MIT",␊ + "devDependencies": {␊ + "@openzeppelin/contracts": "^5.4.0",␊ + "@openzeppelin/contracts-upgradeable": "^5.4.0",␊ + "@openzeppelin/hardhat-upgrades": "^3.0.0",␊ + "@nomicfoundation/hardhat-toolbox": "^6.1.0",␊ + "hardhat": "^2.16.1"␊ + }␊ + }`, + `import { ethers, upgrades } from "hardhat";␊ + ␊ + async function main() {␊ + const ContractFactory = await ethers.getContractFactory("MyAccount");␊ + ␊ + // TODO: Set addresses for the contract arguments below␊ + const instance = await upgrades.deployProxy(ContractFactory, [signer], { unsafeAllow: 'constructor' });␊ + await instance.waitForDeployment();␊ + ␊ + console.log(\`Proxy deployed to ${await instance.getAddress()}\`);␊ + }␊ + ␊ + // We recommend this pattern to be able to use async/await everywhere␊ + // and properly handle errors.␊ + main().catch((error) => {␊ + console.error(error);␊ + process.exitCode = 1;␊ + });␊ + `, + `import { expect } from "chai";␊ + import { ethers, upgrades } from "hardhat";␊ + ␊ + describe("MyAccount", function () {␊ + it("Test contract", async function () {␊ + const ContractFactory = await ethers.getContractFactory("MyAccount");␊ + ␊ + const signer = (await ethers.getSigners())[0].address;␊ + ␊ + const instance = await upgrades.deployProxy(ContractFactory, [signer], { unsafeAllow: 'constructor' });␊ + await instance.waitForDeployment();␊ + });␊ + });␊ + `, + ] + ## custom basic > Snapshot 1 diff --git a/packages/core/solidity/src/zip-hardhat.test.ts.snap b/packages/core/solidity/src/zip-hardhat.test.ts.snap index 481b2bf3bc12d4ba31c20532af0dc09030a9da24..29d2250f42da5e5abdc94cc6518077cc54c321ea 100644 GIT binary patch literal 3264 zcmV;x3_tThRzV3SW?yxJ1B#>`%!5d3xX z=1ov2g2F5)ybRtbTm!cXGoUd0`nCF8tp>NZ)_yks0k#nF(EPfM2*)jq*dp9m-znB= zaFuplljD5{!9&bDaMMNP7sz#yg9%)vgfr9P9{lJ|^#|2@(Pd`4YeJ7Y*v7mEKdM)M zSZyvW6^pp*QpVx&ie(|slLe`B0$YrBVd*{UBJxzD)~o=vW=i8)qD;t zSw9Vj())%t_|#WC z1qP37)G~dCuh?BoqNlFudx%A!yO?mq$`V-o$fg^mjUJStEmdG?W9P@Elz|Fb%uKyM z4z2bCt`YO9S+CdO+ptlGZ@&#~WZ|yqct%;rMHXo@lkkVsLB`ts2P?ZD?Che8X5!D?tF1;facH%O@7clqeLV9P}3@PA^?mIo@h*pAY7fQQ^W8 z`G7LUK}T|0fj%a@dFL)PyVNH<`#rd=H<@b6NVms zKbq>%bWRUV&vy~42978PM8&GY{74hI{)ArBLlU1eD$L=>1B?#)xEU-qYCVe(7~(!7 z9yE08(>|;B+I8)Waw72eq^KE0p%74rTZLe$h3}ip?wEYnLu{3j7H-2}-R-D1V#RIY zcC>P-07e5t@CyE7l96h>m1K^tz#) zTnfWnK-m!!w_YC}D>k!LaNa{Wdu_9CdxG#%+S- zgRU&#m9iZf!xI~j+<(-^QUw~_GF<)nhRYhmork&7%IhRy1jIL4qL;vK}i^jsD(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?bX9)ga zC7BSbRd2xBM!4_z*c+P0#3Ju)?mk=@vd(O97h3XZhb`)h5PNWC1-4uH#Ri{E(mOV; z#$C6M+$Y4Wh^3-8&(}sw2vq+Z9tPF202cyis=-+ z62uv*cqQx;mAfqBX)N^0OZyAa!G_Q|M4=!n@i7#)>_Xy^+WX%py>QF~V@w*)pP)G8 zbBTSNv&{JZdCQEc=@4^C?2;_1Ny+zKj{N$Cl_O6lrl&P3tqEa&({5di=6U~0L6~d6 z#1WH3SCHDoOlg95Mq=Bv`e#Y5N=Bn~st2MLo$fb1bC zSw1H)W=IL4O&#%lL=+zZH)VUr zb;Z+Rh+L035?k<}T;&7sWWoNYTQqsm+UTw{1LF zYs&F*m zP~1^(QPOl2KlQ3}TVmnKg04FKSO z6#%y809d&?DW~}jxIj*mOJzwbcr;5Iv!wAnC5>;uMJ0`74;ZsX?)XplO7Z+(%TCfq z<)c4sHtOtOKjX7M=guV^{;3DW3VFN}e44YH>a+XA*GR6fm`?D&RsguJHRyl6H0cSB zE<=Mpx0gGNIimPd#KphdFnd%#dsIJrRBuk0|E*m9qx!F6Sj56l0084W2;l$# diff --git a/packages/core/solidity/src/zip-hardhat.ts b/packages/core/solidity/src/zip-hardhat.ts index 23ed27a0c..8e283cee1 100644 --- a/packages/core/solidity/src/zip-hardhat.ts +++ b/packages/core/solidity/src/zip-hardhat.ts @@ -119,9 +119,14 @@ function getAddressArgs(c: Contract): string[] { } function getDeploymentCall(c: Contract, args: string[]): string { - return c.upgradeable + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + + return !c.upgradeable + ? `ContractFactory.deploy(${args.join(', ')})` + : useUpgradePlugin ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` - : `ContractFactory.deploy(${args.join(', ')})`; + : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })` } const script = (c: Contract) => { From 0d3ae13042a2b9079c55eafc96e5faeac7788f94 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 16:12:30 +0200 Subject: [PATCH 05/11] Update account.ts --- packages/core/solidity/src/account.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index 7ee580150..e41f6c127 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -159,9 +159,6 @@ function addBatchedExecution(c: ContractBuilder, opts: AccountOptions): void { function addERC7579Modules(c: ContractBuilder, opts: AccountOptions): void { if (!opts.ERC7579Modules) return; - // Base AccountERC7579 account (upgradeable or not) - const name = 'AccountERC7579'; - c.addParent({ name: opts.ERC7579Modules, path: `@openzeppelin/contracts/account/extensions/draft-${opts.ERC7579Modules}.sol`, @@ -182,8 +179,9 @@ function addERC7579Modules(c: ContractBuilder, opts: AccountOptions): void { c.addConstructorCode('_installModule(moduleTypeId, module, initData);'); } - // isValidSignature override - c.addOverride({ name }, functions.isValidSignature); + c.addOverride({ name: 'AccountERC7579' }, functions._validateUserOp); + c.addOverride({ name: 'AccountERC7579' }, functions.isValidSignature); + if (opts.signatureValidation === 'ERC7739') { c.addOverride({ name: 'ERC7739', transpiled: false }, functions.isValidSignature); c.setFunctionBody( @@ -191,14 +189,11 @@ function addERC7579Modules(c: ContractBuilder, opts: AccountOptions): void { '// ERC-7739 can return the ERC-1271 magic value, 0xffffffff (invalid) or 0x77390001 (detection).', '// If the returned value is 0xffffffff, fallback to ERC-7579 validation.', 'bytes4 erc7739magic = ERC7739.isValidSignature(hash, signature);', - `return erc7739magic == bytes4(0xffffffff) ? ${opts.upgradeable ? upgradeableName(name) : name}.isValidSignature(hash, signature) : erc7739magic;`, + `return erc7739magic == bytes4(0xffffffff) ? ${opts.upgradeable ? upgradeableName('AccountERC7579') : 'AccountERC7579'}.isValidSignature(hash, signature) : erc7739magic;`, ], functions.isValidSignature, ); } - - // _validateUserOp override - c.addOverride({ name }, functions._validateUserOp); } function addMultisigFunctions(c: ContractBuilder, opts: AccountOptions): void { From 03f895b38e55488b83eaf3773526a00097e52554 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 16:28:43 +0200 Subject: [PATCH 06/11] up --- packages/core/solidity/src/account.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/core/solidity/src/account.ts b/packages/core/solidity/src/account.ts index e41f6c127..919fe86fc 100644 --- a/packages/core/solidity/src/account.ts +++ b/packages/core/solidity/src/account.ts @@ -265,10 +265,7 @@ function overrideRawSignatureValidation(c: ContractBuilder, opts: AccountOptions // Base override for `_rawSignatureValidation` given MultiSignerERC7913Weighted is MultiSignerERC7913 if (opts.signer === 'MultisigWeighted') { - c.addImportOnly({ - name: signers.Multisig.name, - path: signers.Multisig.path, - }); + c.addImportOnly(signers.Multisig); } } } From b3e3dba32a26efa97aa6715a98e0d1d87197d340 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 18:46:42 +0200 Subject: [PATCH 07/11] use unsafeAllow for EIP-712 constructor in foundry zip tests --- packages/core/solidity/src/erc1155.test.ts.md | 6 +- .../core/solidity/src/erc1155.test.ts.snap | Bin 1803 -> 1807 bytes packages/core/solidity/src/erc20.test.ts.md | 12 +- packages/core/solidity/src/erc20.test.ts.snap | Bin 3446 -> 3450 bytes .../core/solidity/src/governor.test.ts.md | 3 +- .../core/solidity/src/governor.test.ts.snap | Bin 2350 -> 2347 bytes .../core/solidity/src/zip-foundry.test.ts.md | 28 +-- .../solidity/src/zip-foundry.test.ts.snap | Bin 4529 -> 4530 bytes packages/core/solidity/src/zip-foundry.ts | 174 ++++++++---------- packages/core/solidity/src/zip-hardhat.ts | 4 +- 10 files changed, 104 insertions(+), 123 deletions(-) diff --git a/packages/core/solidity/src/erc1155.test.ts.md b/packages/core/solidity/src/erc1155.test.ts.md index 5b7de2840..470826aa4 100644 --- a/packages/core/solidity/src/erc1155.test.ts.md +++ b/packages/core/solidity/src/erc1155.test.ts.md @@ -377,7 +377,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address defaultAdmin, address pauser, address minter)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC1155_init("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/");␊ __AccessControl_init();␊ @@ -462,7 +463,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address defaultAdmin, address pauser, address minter, address upgrader)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC1155_init("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/");␊ __AccessControl_init();␊ diff --git a/packages/core/solidity/src/erc1155.test.ts.snap b/packages/core/solidity/src/erc1155.test.ts.snap index 2809eaab0f3d8ab4bf97ae90655b179bb80cf196..a7faff1b154bdeb246bb2cdcf2939104f5cd729c 100644 GIT binary patch delta 1766 zcmVZ*N;sM|VxGGnuFM#?2h+B|-OA;#rc)-s>0WhbZEa)Y473^5 z!15ESBXZ)%lVn$(BU%`!iZfc$b-2%SHcqz)9Q z2m3`G6DVL&R;i&#SZ{ObOHHn9c8?j^S*vf9>J{zvI)_hD>0qs|KYg*eO-j7CqkO)- z`Nht6`z2}FSK@%n$03}a<*e_vL1cj`0UU`&wVdaIVbTE_(kSZ#f_etSD?m3|DwY8y zYTuH7;aF>an$C^R)Gce^EO(Z32*wH2kom+6f@P|p8f>GCZWGW=&geD)-89RefsX;B zD&ldXE&UrJ+Fwg45Upe_yLBT~$K*)po(S8fK-}RzE~MO9j8i$#Ru&T>5ui~m zH*0(K`d+nJJ>1^|pMfJJ%kXG@<6(X|GPt~dvXvXiV+FOLp^B2CVKPG=2dLIzkccW( zQGR#tX{oVaZ6P42%AZLsAH4J{iopf)hjLuq-^|$B9llp}^2h@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$+djM^90}qhILfxuz^9X{))_tNONPKI zmqJ2@`Pa}yZ^s4DMKbfy$Y7gdXIp`>88!$irA94LPGDfFO$JGlz+>6qf@+U{=&8Fr ze9a&nw$U0iJ#sKw#Sf2zK3>7rbM@8;F+S)70DE&rG&igx05-VU;h68si}l@_&eAr` zIad-$1D%a#h<&!o(0GJ{gJ-x*^kz)2=@MX5!Fj+7)tyN=Jc`=2dbzWxq2iLyrLx}9 zwdx(Emq(5nvM!Tf&Z&WV_$rc5N7C!m+|2vTXm*s#zBSQW8EEpmaLyRo= z3z=0HS#>d=)rDUfK>M)m)D1wMO$7DInyw-Z5dqD)V`Tkt$f2zfZo_AB6;4*+Bv&{m ztHTZo?8;=|YXf(_3za?J+)4YjfyCTGSDr10WmA5BGuq%CmCz7Kk3z{s?O_q^ja+|$KG?O$oiZjbxCw}+iKbc=8O(;kJ E0AplQHUIzs diff --git a/packages/core/solidity/src/erc20.test.ts.md b/packages/core/solidity/src/erc20.test.ts.md index 9c9af9619..e422ee059 100644 --- a/packages/core/solidity/src/erc20.test.ts.md +++ b/packages/core/solidity/src/erc20.test.ts.md @@ -1049,7 +1049,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address defaultAdmin, address tokenBridge, address recipient, address pauser, address minter, address upgrader)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("MyToken", "MTK");␊ __ERC20Bridgeable_init();␊ @@ -1152,7 +1153,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address recipient, address defaultAdmin, address pauser, address minter)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("MyToken", "MTK");␊ __ERC20Burnable_init();␊ @@ -1241,7 +1243,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address recipient, address defaultAdmin, address pauser, address minter, address upgrader)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("MyToken", "MTK");␊ __ERC20Burnable_init();␊ @@ -1334,7 +1337,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(address recipient, address initialAuthority)␊ - public initializer␊ + public␊ + initializer␊ {␊ __ERC20_init("MyToken", "MTK");␊ __ERC20Burnable_init();␊ diff --git a/packages/core/solidity/src/erc20.test.ts.snap b/packages/core/solidity/src/erc20.test.ts.snap index fe5aa7f886c5e07b261f689582143ece4a961b75..c78c752bc840a89a9df2bbf0425f5cdc36f6a9f2 100644 GIT binary patch literal 3450 zcmV-=4TbVSRzVX8 z?3(OUGarix00000000B+UCnPJNfn<@Ey}Vh%>`*$p{?-|*U? z66FI}5F1sx%W)~))!ypre9SP1m5>mEKLCl-?h$c-8;HYR5Zn+PIKTyNfRMN#A%TR1 z`n#)LZMPkNw3CXoJF>g_)vK!aepSC$ugV`ck2FI$F@N}_PY}aQLnlYj#0o%EsaCK_ zVB2gN%>3wMRfP<`fAjmdZ@hBD{=0ei#=TqLzF97Vy`7D(m!4t;5fhafDk2OwF`|#a zR%3srTn6ig-i8bxX$YKQ)&kpYM81LAZKPoW)(yfaRG0}qsLd_TRc6{09_tX8hK5zl zF2Dzsxs|!<^5dBqthWuyz>Ce@^=joMXi`H5xhF;&k>{SYvf@iCGvfr2vQyOk|D0)P zxyQVa9Yl4^`VocB86qY&h*^$E@MO>U?|`j~efuSVP2dzOf=FrbVg>*J6oZ(IS_(60 zzTiI3=e!qlMUdOte=k>vz85|%fEO=kUe0(UcK(JlSb#ts*)>`OD~5{pU=s-j@JHML z{y+|3mjP7z9zd_}y^;FWcf|wQQHmc>;*RH$MF~98M1%NWZV>-5-GlhH*Urlfqc0;1 zUheBMQm6N9qzx@oY$JDWaW?X=+f!{LJ6=04HHw~$G1!PNd;2VvWkW?lrdjq%r=Cr` z_7s8lVlRV(s!EY*0!%Q&P}@Euh!&hu_FsZA2G6}p@?GBUFj?pEi(BT zT9hwV%$DpujwGo~3D|aikD|0LHo7=HK@WH}$Zfa=A6yU~hINbR8oeAK^ zn&S`7i-wlcdAN5(E`A+xs1FR``cH%;M;8p43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$cMGnKHhaQRD3lsF5C9zxM+UJ)X

}I`?U;rT?=>|9NM^!%`d=lF{epKyCnLJ9sOiX zE>lb{(^@w@F86b8a`@yr#pUEAapg(E>)8BG5`#zRdaQ)A1n}gVIG-fn+l;U}Clsnk zO!Du)#sS~VBv!?a2_A-8_Hg@3q(MpCipc2>VMC~}7qa!x#r3-3>LC^!t9{FLWBk0| zN;}lJxb)7ia6-D_ELYHj*NAQj1WrCnwCC!{Gu3JpJa!%Aq4C^rq*<|u30tTF?R8cZ zX$7Is$U53P$P%;^Q8O(W1P5irxy62C!g5?X$dS__NA}Yss6UFA3p>?)BU!@j+L%1Q zlfVs5;Ryk@nq_6#9b`Y{K=x-6WF^Q>9mq~-wVMZ^&I>358G)JXTD!^L--u6$L6PY; zYfA;^ZDb#!WP-UOw>K{3^QiU|UF%rSdOf4RknpX?x0-&ACjN=DncvBTj;RVKjWg$e zRQ5ksKHwv`d!c}v<)nhuRWM(RPU{2srR$rykM^IaIs*VA6>k0|pmF`5j$@8TOr^Ll0!c zgo@zs21bqivzsG`8wo^rz3^oODu`rv`>nE3M9-3?pS&YMQj;;Qrd9M3x4~)mKq%QJWl-F_PasC>XBlOGp5N1TvAXV=9oc=u*g_W7mtHT#q>)5 z32~71w-I6mIZrKzhC2-hsPp}M>ErwLiP#tg{pI;cP&Yy6TY5)BIwJ0GVP&`gGyKBW zj5AqAQ8+aEb0)U5IY_ok_3U;t20QKR@X^ldeX1g;yy_;wy=-B)*dP zO5&RY#K{ofob$x=i`a6<{Jar$pC|Ob#!RpWsiMgK<#2@s_x*wXnUq+@km!?G_(VBV YsFI{fll|58aq@@%16opTS!uTb0EmyWy#N3J diff --git a/packages/core/solidity/src/governor.test.ts.md b/packages/core/solidity/src/governor.test.ts.md index e49920a89..8ab51e516 100644 --- a/packages/core/solidity/src/governor.test.ts.md +++ b/packages/core/solidity/src/governor.test.ts.md @@ -1624,7 +1624,8 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ function initialize(IVotes _token, TimelockControllerUpgradeable _timelock)␊ - public initializer␊ + public␊ + initializer␊ {␊ __Governor_init("MyGovernor");␊ __GovernorCountingSimple_init();␊ diff --git a/packages/core/solidity/src/governor.test.ts.snap b/packages/core/solidity/src/governor.test.ts.snap index 63d7cb468e9308c72c3d501ca633eea81519e06c..6eca252ca88728c3009edf80814685eee7ceb940 100644 GIT binary patch literal 2347 zcmV+`3DovMRzVmmVcv=PuG zPGlE7pb=KPBWdd0nf1)9B--#rfWASVAbpFzL0aUxZBXPgKri|b#U6&_?17}Xq_w2} zy0N)C`<-TX_WSKOLw23`r@xtGab-Naw^WL;7SF_`QW_mu3DE|YEA{sDG9ty6d>uE(k+uhvR?5#!8Jq=x=M8JHe z`{c9U=HBM^{r$By7Dhs9^77ZY)vw5j6d}3uzKAG)kqdM@BhbmbbGb(ybIGO>!JYk* zq=zErn(@;^7DfTRf?Rs3DOXHz1SuIf^(S)iPQDmMx-4CqxxSNY;x`kHA@KI|L62vfxTze}n| z&G2|?YvH3El;O#O8RX>}A%u8>D=lMB3)#tBCr4U5qr6MXc9SEWAG@1goctN_ojXG( z?vzibqC1)BnzOdyot<*Cf<>KzIWJ$WrT?D9JQXpRvYwb3t88wml}t48Wt=X@Ay3XIIT1l1E*L)@C|ATCQKN{Y&toR3PmcTKFrSV$3-&7QYHAD_ zbjN`|?ApwQ!N+q(F9sisu1@)eD2#-=1rHVJJkFIJCMM+LqZkJjN6F2Y8aZNIbvK&^ zA5rS7PhuJ~etJEw9Sd`~#-mD8CpviaJf<=IIHJ-``@6!qE^&QdQllz7JeAo{hLtbfG51^pbk9Ua=q#W0?oB?B$%p=p_%k8> z_@4y@-vSD5I27E#%)HIX_w~NezjqVf=MQu}PZ?*BSfuY#K8nL*D(4qNPy#4nbrM(t zN&qFaB~GQm2ui4tQ#d%c*+5a9JYp-zVEv^<1_8D*%tQus<|njQ^%){1qJD)E6`UXUupiECQ?mRsbv4KNtZkHLwyF zU_}e*o>uIAc;gF;RsQk@SY;+w$>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=p#1)`~ZFc zKNf=@sLw`j0$>0z02lxa00ylAgSTxk@I)AinET_P;6D}=`~y(X5DGGn&x;B&X*UN8 zjK#(SlR7-7+!xX@6Wu8ZSO9li7a8RD@ykm&_9Xf+ySgS47#P-`3DU`EG* z4i@BP;K8iZaq0P>*1E=kuwes2`sE`${qm76iKE2!B&r|tGvk*QE--9iLPhp!6UhoC zDptB8`~J2mzV_XIUVGi!%Z_cQF}X^Qq9FT9k0Rs=$`+v@ds*Xaq&Se`XrrI5eCxIz zVHTF+*cwAHT=0!)DCYJ*EsFUDNe}FV0$^Y#)Kc$++RD=p>590>Tt~)LX>U1LEpxU5 zfK#^UhUYp!37~{F`l&P-K?!w~aL=ZMU-8%D%SH$;TOr&A_8TniO`frJMV9^jEB z;gOY2c%+FA)ip6VG8+i|k=a0IqrzKY7BEX|CL@@oj#(Z|!z@#$IR0XB%b$?qK#BuM zffUDbr#MpN8TV^}jguQWP2o$QKsLYw;K8g;1|9$pY~vc^!8@hj)7$QyXHiESol4hF zh@cDtZ~ol^fj_@_jUeze)srTQPKeqz;$hP&J{XZS6)H6Ec_KkfR;e&a7NS#qALDpn zA*vK5PY)!EQ>V6{1tQAbofn#MB`hWWL@!^a;j+$5y zGXc#khYT0u5dn43R@tODS;wMWWxM)2uS*K1%?6u U@^5bP%;␊ - MyAccount implementation = new MyAccount();␊ - address proxy = address(new ERC1967Proxy(␊ - address(implementation),␊ - abi.encodeCall(MyAccount.initialize, (signer))␊ - ));␊ + Options memory opts;␊ + opts.unsafeAllow = "constructor";␊ + address proxy = Upgrades.deployUUPSProxy(␊ + "MyAccount.sol",␊ + abi.encodeCall(MyAccount.initialize, (signer)),␊ + opts␊ + );␊ MyAccount instance = MyAccount(payable(proxy));␊ console.log("Proxy deployed to %s", address(instance));␊ vm.stopBroadcast();␊ @@ -1452,7 +1454,7 @@ Generated by [AVA](https://avajs.dev). pragma solidity ^0.8.27;␊ ␊ import {Test} from "forge-std/Test.sol";␊ - import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";␊ + import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";␊ import {MyAccount} from "src/MyAccount.sol";␊ ␊ contract MyAccountTest is Test {␊ @@ -1460,11 +1462,13 @@ Generated by [AVA](https://avajs.dev). ␊ function setUp() public {␊ address signer = vm.addr(1);␊ - MyAccount implementation = new MyAccount();␊ - address proxy = address(new ERC1967Proxy(␊ - address(implementation),␊ - abi.encodeCall(MyAccount.initialize, (signer))␊ - ));␊ + Options memory opts;␊ + opts.unsafeAllow = "constructor";␊ + address proxy = Upgrades.deployUUPSProxy(␊ + "MyAccount.sol",␊ + abi.encodeCall(MyAccount.initialize, (signer)),␊ + opts␊ + );␊ instance = MyAccount(payable(proxy));␊ }␊ ␊ diff --git a/packages/core/solidity/src/zip-foundry.test.ts.snap b/packages/core/solidity/src/zip-foundry.test.ts.snap index 2d7ea8ddc7bee740c17c0901906c53b7b009e4e0..7debb3adfe7ff4fb7bda4090285ede867da2d7cc 100644 GIT binary patch literal 4530 zcmV;j5l!wvRzV0+TIl z#sLvO3LlFI00000000B+UCnPBNp^2~#mP|WFkOaBRHJ2nt5>h8Uf27*SH+*Uk6mIvVPF3Yam-!xV?^!MWzY^> z7c(FBSeJ12M?ZBO$l+(d@{`w$Zy4fVL^tuN%f&Hw@#0w+y3y(=cvU z-gu{SeS=ciuT=D>x8Hu-s8o&0b))i4<7VZW@ynIhjLP+QuKoAxx8Ah^My+G)TgX2F z$B=ca)mvb*i|i)=w?PMUfEmC(maL^`!@0egmatbSpB2N1Nb|Ci6nyC5=bFflvkC=C`g;o z4jLkgEFU6_ZXhWT*hdI-Iq$K%mUT?X6SISOTaucrYjqIk*zdF$hm<47QnEpgiJ$4r zKH@=EQSr;LBtWc6`h+bn$cSchXEu)2vmi0Ner(p#3E1 zf#1i^A$0&pUeARb0g9mGA;1ZMCj>hHb8w6VBXWZ1DaD+JEqN#4@%F~n?zZVU>Qjq6 zH$6u(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UDy7XRm1qvSIg_#ODJz~p}g|C_W6a|%In%o zsAq1Wp7Of(E1e72l9t!C&mAf=;$rliKp>bGR4gtW`OdJykw08Aj9+}cEF3AL&Bcv2%fgYDGmWhG-)e57=cSMu=! zRCtJ4suGVPpkdr9kIM(9dS$7`<(F#A*yo?Iieox}n+I)M1lIuB4ue^M?aj@ia*m~I zhVjFyVf=ilEaxZzw#5b5%5skR1;JkAa*m&s0L)?oFqaOzY{*abTorU2&3!?K(pqw( z8mTg~RaGr79A?6BCx(`&-*QVilm@c7VbxHVoo7|ZQJV!Skusto)fa-yN}5*$ZS3r= zt*nms=gDo_?{U(hu-ENdvSaqrAQAHZ0dXBf&sJd~he$BUGGAL=IU{dzkSAgtb4K_7K81s2`g^z9D(OX6>E#n;^zQpSqFi zh!7e1>yWA&wagUn@ZgFXPaIuYsWsw*=tWs@6y#4YxA5hBJ~sy-(7HZ9L=gGCk)}`J z!J7v1_Fz9eJ|Z)tGbw}l^BLWBT>?%E060y(f+&XZO!P-^M*&@PaA{2pSW6W#jfJzN zFZeEk+$Oo+rbQ97yJ4r{Wl+VS-GvoMX~b_tX;e%@vfwEJ--CI&&}Q4`w7*BN&mYiz zRD~ z7@RA_&ITi9bNsrcKF#W-Tomaqj7vn3aOX${x?%jol3~1C-e^)r2n!q`l=UAkXY^6lf0Xqf z(~JQBt&9K{I|7_p{YNqqoU;Ouzn${}kPA9ZJ}+VA>}x(Ix!pw3ZO9ZI@2C0?o?qw< zDT%jqrUUa)&%879k+kW%Qu5;aSP(b68&gh4W+kWgXVG_MKsnh>BQh$bRuRj~Dt^cX zFmlTRa>bnA+e`)~Jt}RVm|Nnek^zq)7mEDd0$wOGC+N@_FBi#ixo7-y&~xKiN4e7r P0>*v=jQigk|HA+PFzUqP diff --git a/packages/core/solidity/src/zip-foundry.ts b/packages/core/solidity/src/zip-foundry.ts index a7bbf0a98..44a44bda5 100644 --- a/packages/core/solidity/src/zip-foundry.ts +++ b/packages/core/solidity/src/zip-foundry.ts @@ -18,14 +18,12 @@ const test = (c: Contract, opts?: GenericOptions) => { const result = ['import {Test} from "forge-std/Test.sol";']; if (c.upgradeable) { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; result.push( - useUpgradePlugin - ? 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";' - : opts?.upgradeable == 'transparent' - ? 'import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";' - : 'import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";', + unsafeAllowConstructor + ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', ); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); @@ -47,55 +45,42 @@ const test = (c: Contract, opts?: GenericOptions) => { function getDeploymentCode(c: Contract, args: string[]): Lines[] { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; switch (opts?.upgradeable) { case 'transparent': - return useUpgradePlugin - ? [ - `address proxy = Upgrades.deployTransparentProxy(`, - [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ] - : [ - `${c.name} implementation = new ${c.name}();`, - `address proxy = address(new TransparentUpgradeableProxy(`, - [ - `address(implementation),`, - `initialOwner,`, - `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`, - ], - '));', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ]; + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.deployTransparentProxy(`, + unsafeAllowConstructor + ? [ + `"${c.name}.sol",`, + 'initialOwner,', + `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, + 'opts', + ] + : [`"${c.name}.sol",`, 'initialOwner,', `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ].filter(line => line !== false); case 'uups': - return useUpgradePlugin - ? [ - `address proxy = Upgrades.deployUUPSProxy(`, - [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ] - : [ - `${c.name} implementation = new ${c.name}();`, - `address proxy = address(new ERC1967Proxy(`, - [`address(implementation),`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - '));', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ]; + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.deployUUPSProxy(`, + unsafeAllowConstructor + ? [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, 'opts'] + : [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `instance = ${c.name}(payable(proxy));` + : `instance = ${c.name}(proxy);`, + ].filter(line => line !== false); default: return [`instance = new ${c.name}(${args.join(', ')});`]; } @@ -153,14 +138,12 @@ const script = (c: Contract, opts?: GenericOptions) => { const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; if (c.upgradeable) { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; result.push( - useUpgradePlugin - ? 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";' - : opts?.upgradeable == 'transparent' - ? 'import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";' - : 'import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";', + unsafeAllowConstructor + ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', ); } result.push(`import {${c.name}} from "src/${c.name}.sol";`); @@ -188,55 +171,42 @@ const script = (c: Contract, opts?: GenericOptions) => { function getDeploymentCode(c: Contract, args: string[]): Lines[] { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; switch (opts?.upgradeable) { case 'transparent': - return useUpgradePlugin - ? [ - `address proxy = Upgrades.deployTransparentProxy(`, - [`"${c.name}.sol",`, `initialOwner,`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ] - : [ - `${c.name} implementation = new ${c.name}();`, - `address proxy = address(new TransparentUpgradeableProxy(`, - [ - `address(implementation),`, - `initialOwner,`, - `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`, - ], - '));', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ]; + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.deployTransparentProxy(`, + unsafeAllowConstructor + ? [ + `"${c.name}.sol",`, + 'initialOwner,', + `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, + 'opts', + ] + : [`"${c.name}.sol",`, 'initialOwner,', `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ].filter(line => line !== false); case 'uups': - return useUpgradePlugin - ? [ - `address proxy = Upgrades.deployUUPSProxy(`, - [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ] - : [ - `${c.name} implementation = new ${c.name}();`, - `address proxy = address(new ERC1967Proxy(`, - [`address(implementation),`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - '));', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ]; + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.deployUUPSProxy(`, + unsafeAllowConstructor + ? [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, 'opts'] + : [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${c.name} instance = ${c.name}(payable(proxy));` + : `${c.name} instance = ${c.name}(proxy);`, + ].filter(line => line !== false); default: return [`${c.name} instance = new ${c.name}(${args.join(', ')});`]; } diff --git a/packages/core/solidity/src/zip-hardhat.ts b/packages/core/solidity/src/zip-hardhat.ts index 8e283cee1..a6cdc71fe 100644 --- a/packages/core/solidity/src/zip-hardhat.ts +++ b/packages/core/solidity/src/zip-hardhat.ts @@ -125,8 +125,8 @@ function getDeploymentCall(c: Contract, args: string[]): string { return !c.upgradeable ? `ContractFactory.deploy(${args.join(', ')})` : useUpgradePlugin - ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` - : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })` + ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` + : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })`; } const script = (c: Contract) => { From e3038184cbf5ca9bc7658373846f794491ff6f02 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 9 Sep 2025 18:50:16 +0200 Subject: [PATCH 08/11] address PR comment --- packages/core/solidity/src/zip-hardhat.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/solidity/src/zip-hardhat.ts b/packages/core/solidity/src/zip-hardhat.ts index a6cdc71fe..b85d36663 100644 --- a/packages/core/solidity/src/zip-hardhat.ts +++ b/packages/core/solidity/src/zip-hardhat.ts @@ -120,13 +120,13 @@ function getAddressArgs(c: Contract): string[] { function getDeploymentCall(c: Contract, args: string[]): string { // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const useUpgradePlugin = c.parents.find(p => ['EIP712'].includes(p.contract.name)) == undefined; + const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; return !c.upgradeable ? `ContractFactory.deploy(${args.join(', ')})` - : useUpgradePlugin - ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])` - : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })`; + : unsafeAllowConstructor + ? `upgrades.deployProxy(ContractFactory, [${args.join(', ')}], { unsafeAllow: 'constructor' })` + : `upgrades.deployProxy(ContractFactory, [${args.join(', ')}])`; } const script = (c: Contract) => { From d7e4f7bda62687283068cf8457c300cb8394107f Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Tue, 9 Sep 2025 14:58:14 -0400 Subject: [PATCH 09/11] Use contract.parents for non-upgradeable --- packages/core/solidity/src/print.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/solidity/src/print.ts b/packages/core/solidity/src/print.ts index e10eee6cc..bc6202d7d 100644 --- a/packages/core/solidity/src/print.ts +++ b/packages/core/solidity/src/print.ts @@ -84,7 +84,7 @@ function printConstructor(contract: Contract, helpers: Helpers): Lines[] { if (hasParentParams || hasConstructorCode || (helpers.upgradeable && parentsWithInitializers.length > 0)) { if (helpers.upgradeable) { const upgradeableParents = parentsWithInitializers.filter(p => inferTranspiled(p.contract)); - const nonUpgradeableParents = parentsWithInitializers.filter(p => !inferTranspiled(p.contract)); + const nonUpgradeableParents = contract.parents.filter(p => !inferTranspiled(p.contract)); const constructor = printFunction2( [ nonUpgradeableParents.length > 0 @@ -112,7 +112,7 @@ function printConstructor(contract: Contract, helpers: Helpers): Lines[] { [], 'constructor', contract.constructorArgs.map(a => printArgument(a, helpers)), - parentsWithInitializers.flatMap(p => printParentConstructor(p, helpers)), + contract.parents.flatMap(p => printParentConstructor(p, helpers)), contract.constructorCode, ); } From ba52fb73c0e39e0f40d1998293c05597dae5e1b3 Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Tue, 9 Sep 2025 15:18:57 -0400 Subject: [PATCH 10/11] Extract helper function for shouldUseUnsafeAllowConstructor --- packages/core/solidity/src/zip-foundry.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/core/solidity/src/zip-foundry.ts b/packages/core/solidity/src/zip-foundry.ts index 44a44bda5..05cda2f1a 100644 --- a/packages/core/solidity/src/zip-foundry.ts +++ b/packages/core/solidity/src/zip-foundry.ts @@ -11,14 +11,18 @@ function getHeader(c: Contract) { return [`// SPDX-License-Identifier: ${c.license}`, `pragma solidity ^${SOLIDITY_VERSION};`]; } +function shouldUseUnsafeAllowConstructor(c: Contract): boolean { + // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable + return c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; +} + const test = (c: Contract, opts?: GenericOptions) => { return formatLinesWithSpaces(2, ...spaceBetween(getHeader(c), getImports(c), getTestCase(c))); function getImports(c: Contract) { const result = ['import {Test} from "forge-std/Test.sol";']; if (c.upgradeable) { - // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); result.push( unsafeAllowConstructor @@ -44,8 +48,7 @@ const test = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); switch (opts?.upgradeable) { case 'transparent': @@ -137,8 +140,7 @@ const script = (c: Contract, opts?: GenericOptions) => { function getImports(c: Contract) { const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; if (c.upgradeable) { - // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); result.push( unsafeAllowConstructor @@ -170,8 +172,7 @@ const script = (c: Contract, opts?: GenericOptions) => { } function getDeploymentCode(c: Contract, args: string[]): Lines[] { - // TODO: remove that selector when the upgrades plugin supports @custom:oz-upgrades-unsafe-allow-reachable - const unsafeAllowConstructor = c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); switch (opts?.upgradeable) { case 'transparent': From 9c122f35252189c708132bb87db2f8f8b4e110f7 Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Tue, 9 Sep 2025 16:07:31 -0400 Subject: [PATCH 11/11] Refactor zip-foundry to reduce duplication --- packages/core/solidity/src/zip-foundry.ts | 196 +++++++++------------- 1 file changed, 79 insertions(+), 117 deletions(-) diff --git a/packages/core/solidity/src/zip-foundry.ts b/packages/core/solidity/src/zip-foundry.ts index 05cda2f1a..c6cb7890f 100644 --- a/packages/core/solidity/src/zip-foundry.ts +++ b/packages/core/solidity/src/zip-foundry.ts @@ -6,6 +6,7 @@ import SOLIDITY_VERSION from './solidity-version.json'; import contracts from '../openzeppelin-contracts'; import type { Lines } from './utils/format-lines'; import { formatLinesWithSpaces, spaceBetween } from './utils/format-lines'; +import type { Upgradeable } from './set-upgradeable'; function getHeader(c: Contract) { return [`// SPDX-License-Identifier: ${c.license}`, `pragma solidity ^${SOLIDITY_VERSION};`]; @@ -16,23 +17,71 @@ function shouldUseUnsafeAllowConstructor(c: Contract): boolean { return c.parents.find(p => ['EIP712'].includes(p.contract.name)) !== undefined; } -const test = (c: Contract, opts?: GenericOptions) => { - return formatLinesWithSpaces(2, ...spaceBetween(getHeader(c), getImports(c), getTestCase(c))); - - function getImports(c: Contract) { - const result = ['import {Test} from "forge-std/Test.sol";']; - if (c.upgradeable) { - const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); - - result.push( - unsafeAllowConstructor - ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' - : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', - ); +function getImports(c: Contract, prepopulateImports: string[]): string[] { + const result: string[] = [...prepopulateImports]; + if (c.upgradeable) { + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); + + result.push( + unsafeAllowConstructor + ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' + : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', + ); + } + result.push(`import {${c.name}} from "src/${c.name}.sol";`); + return result; +} + +function getDeploymentCode( + c: Contract, + args: string[], + declareContractVariable: boolean, + upgradeable?: Upgradeable, +): Lines[] { + const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); + const instanceDeclaration = declareContractVariable ? `${c.name} ` : ''; + + switch (upgradeable) { + case 'transparent': + return printDeployProxyAndAssignInstance('deployTransparentProxy', true); + case 'uups': + return printDeployProxyAndAssignInstance('deployUUPSProxy', false); + default: + return [`${instanceDeclaration}instance = new ${c.name}(${args.join(', ')});`]; + } + + function printDeployProxyAndAssignInstance(deployProxyFunctionName: string, includeInitialOwner: boolean) { + const deployProxyArgs = [`"${c.name}.sol"`]; + if (includeInitialOwner) { + deployProxyArgs.push('initialOwner'); + } + deployProxyArgs.push(`abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`); + if (unsafeAllowConstructor) { + deployProxyArgs.push('opts'); } - result.push(`import {${c.name}} from "src/${c.name}.sol";`); - return result; + for (let i = 0; i < deployProxyArgs.length - 1; i++) { + deployProxyArgs[i] += ','; + } + + return [ + unsafeAllowConstructor && 'Options memory opts;', + unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', + `address proxy = Upgrades.${deployProxyFunctionName}(`, + deployProxyArgs, + ');', + // Account has a receive function, this requires a payable address + c.parents.find(p => ['Account'].includes(p.contract.name)) + ? `${instanceDeclaration}instance = ${c.name}(payable(proxy));` + : `${instanceDeclaration}instance = ${c.name}(proxy);`, + ].filter(line => line !== false); } +} + +const test = (c: Contract, opts?: GenericOptions) => { + return formatLinesWithSpaces( + 2, + ...spaceBetween(getHeader(c), getImports(c, ['import {Test} from "forge-std/Test.sol";']), getTestCase(c)), + ); function getTestCase(c: Contract) { const args = getAddressArgs(c); @@ -40,55 +89,18 @@ const test = (c: Contract, opts?: GenericOptions) => { `contract ${c.name}Test is Test {`, spaceBetween( [`${c.name} public instance;`], - ['function setUp() public {', getAddressVariables(c, args), getDeploymentCode(c, args), '}'], + [ + 'function setUp() public {', + getAddressVariables(c, args), + getDeploymentCode(c, args, false, opts?.upgradeable), + '}', + ], getContractSpecificTestFunction(), ), '}', ]; } - function getDeploymentCode(c: Contract, args: string[]): Lines[] { - const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); - - switch (opts?.upgradeable) { - case 'transparent': - return [ - unsafeAllowConstructor && 'Options memory opts;', - unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', - `address proxy = Upgrades.deployTransparentProxy(`, - unsafeAllowConstructor - ? [ - `"${c.name}.sol",`, - 'initialOwner,', - `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, - 'opts', - ] - : [`"${c.name}.sol",`, 'initialOwner,', `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ].filter(line => line !== false); - case 'uups': - return [ - unsafeAllowConstructor && 'Options memory opts;', - unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', - `address proxy = Upgrades.deployUUPSProxy(`, - unsafeAllowConstructor - ? [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, 'opts'] - : [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `instance = ${c.name}(payable(proxy));` - : `instance = ${c.name}(proxy);`, - ].filter(line => line !== false); - default: - return [`instance = new ${c.name}(${args.join(', ')});`]; - } - } - function getAddressVariables(c: Contract, args: string[]): Lines[] { const vars = []; let i = 1; // private key index starts from 1 since it must be non-zero @@ -135,29 +147,21 @@ function getAddressArgs(c: Contract): string[] { } const script = (c: Contract, opts?: GenericOptions) => { - return formatLinesWithSpaces(2, ...spaceBetween(getHeader(c), getImports(c), getScript(c))); - - function getImports(c: Contract) { - const result = ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']; - if (c.upgradeable) { - const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); - - result.push( - unsafeAllowConstructor - ? 'import {Upgrades, Options} from "openzeppelin-foundry-upgrades/Upgrades.sol";' - : 'import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";', - ); - } - result.push(`import {${c.name}} from "src/${c.name}.sol";`); - return result; - } + return formatLinesWithSpaces( + 2, + ...spaceBetween( + getHeader(c), + getImports(c, ['import {Script} from "forge-std/Script.sol";', 'import {console} from "forge-std/console.sol";']), + getScript(c), + ), + ); function getScript(c: Contract) { const args = getAddressArgs(c); const deploymentLines = [ 'vm.startBroadcast();', ...getAddressVariables(c, args), - ...getDeploymentCode(c, args), + ...getDeploymentCode(c, args, true, opts?.upgradeable), `console.log("${c.upgradeable ? 'Proxy' : 'Contract'} deployed to %s", address(instance));`, 'vm.stopBroadcast();', ]; @@ -171,48 +175,6 @@ const script = (c: Contract, opts?: GenericOptions) => { ]; } - function getDeploymentCode(c: Contract, args: string[]): Lines[] { - const unsafeAllowConstructor = shouldUseUnsafeAllowConstructor(c); - - switch (opts?.upgradeable) { - case 'transparent': - return [ - unsafeAllowConstructor && 'Options memory opts;', - unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', - `address proxy = Upgrades.deployTransparentProxy(`, - unsafeAllowConstructor - ? [ - `"${c.name}.sol",`, - 'initialOwner,', - `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, - 'opts', - ] - : [`"${c.name}.sol",`, 'initialOwner,', `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ].filter(line => line !== false); - case 'uups': - return [ - unsafeAllowConstructor && 'Options memory opts;', - unsafeAllowConstructor && 'opts.unsafeAllow = "constructor";', - `address proxy = Upgrades.deployUUPSProxy(`, - unsafeAllowConstructor - ? [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')})),`, 'opts'] - : [`"${c.name}.sol",`, `abi.encodeCall(${c.name}.initialize, (${args.join(', ')}))`], - ');', - // Account has a receive function, this requires a payable address - c.parents.find(p => ['Account'].includes(p.contract.name)) - ? `${c.name} instance = ${c.name}(payable(proxy));` - : `${c.name} instance = ${c.name}(proxy);`, - ].filter(line => line !== false); - default: - return [`${c.name} instance = new ${c.name}(${args.join(', ')});`]; - } - } - function getAddressVariables(c: Contract, args: string[]): Lines[] { const vars = []; if (c.upgradeable && opts?.upgradeable === 'transparent' && !args.includes('initialOwner')) {