Skip to content

Commit 41d5c74

Browse files
ernestognwericglauAmxx
authored
Update migrated imports from community to vanilla contracts (#609)
Co-authored-by: Eric Lau <[email protected]> Co-authored-by: Hadrien Croubois <[email protected]>
1 parent 854f44d commit 41d5c74

37 files changed

+9232
-1379
lines changed

.changeset/kind-poems-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openzeppelin/wizard-common': patch
3+
---
4+
5+
Update Solidity Account prompt

.changeset/odd-ants-hunt.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@openzeppelin/wizard': minor
3+
'@openzeppelin/contracts-mcp': minor
4+
---
5+
6+
Add constructors for `SignerECDSA`, `SignerP256`, `SignerRSA`, `SignerERC7702`, `SignerERC7913`, `MultiSignerERC7913` and `MultiSignerERC7913Weighted`

.changeset/sad-nails-smash.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@openzeppelin/wizard': minor
3+
'@openzeppelin/contracts-mcp': minor
4+
---
5+
6+
Enable upgradeability for `AccountERC7579`, `AccountERC7579Hooked`, `SignerECDSA`, `SignerP256`, `SignerRSA`, `SignerERC7702`, `SignerERC7913` and `MultiSignerERC7913`

.changeset/sour-hats-grow.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@openzeppelin/wizard': minor
3+
'@openzeppelin/contracts-mcp': minor
4+
---
5+
6+
**Breaking change**: Use `Account`, `AccountERC7579`, `AccountERC7579Hooked`, `ERC7812`, `ERC7739Utils`, `ERC7913Utils`, `AbstractSigner`, `SignerECDSA`, `SignerP256`, `SignerRSA`, `SignerERC7702`, `SignerERC7913`, `MultiSignerERC7913`, and `MultiSignerERC7913Weighted` from OpenZeppelin Contracts 5.4.0 instead of Community Contracts

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
working-directory: packages/ui
112112
- name: Run tests
113113
if: matrix.variant == 'default'
114-
run: yarn test '**/*.test.ts' '!**/*.compile.test.ts'
114+
run: yarn test '**/*.test.ts' '**/test.ts' '!**/*.compile.test.ts'
115115
working-directory: packages/core/${{matrix.package}}
116116

117117
- name: Get list of changed files

packages/common/src/ai/descriptions/solidity.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ export const solidityPrompts = {
88
Stablecoin:
99
'Make a stablecoin token that uses the ERC-20 standard. Experimental, some features are not audited and are subject to change.',
1010
RWA: 'Make a real-world asset token that uses the ERC-20 standard. Experimental, some features are not audited and are subject to change.',
11-
Account:
12-
'Make an account contract that follows the ERC-4337 standard. Experimental, some features are not audited and are subject to change.',
11+
Account: 'Make an account contract that follows the ERC-4337 standard.',
1312
Governor: 'Make a contract to implement governance, such as for a DAO.',
1413
Custom: 'Make a custom smart contract.',
1514
};

packages/core/solidity/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The following contract types are supported:
2222
- `governor`
2323
- `custom`
2424

25-
Note that `stablecoin`, `realWorldAsset`, and `account` are experimental and may be subject to change.
25+
Note that `stablecoin`, and `realWorldAsset` are experimental and may be subject to change.
2626

2727
Each contract type has functions/constants as defined below.
2828

packages/core/solidity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"update-env": "rm ./src/environments/hardhat/package-lock.json && npm install --package-lock-only --prefix ./src/environments/hardhat && rm ./src/environments/hardhat/upgradeable/package-lock.json && npm install --package-lock-only --prefix ./src/environments/hardhat/upgradeable"
2323
},
2424
"devDependencies": {
25-
"@openzeppelin/community-contracts": "git+https://github.com/OpenZeppelin/openzeppelin-community-contracts.git#de17c8e",
25+
"@openzeppelin/community-contracts": "git+https://github.com/OpenZeppelin/openzeppelin-community-contracts.git#2d607bd",
2626
"@openzeppelin/contracts": "^5.4.0",
2727
"@openzeppelin/contracts-upgradeable": "^5.4.0",
2828
"@types/node": "^20.0.0",

packages/core/solidity/src/account.test.ts

Lines changed: 92 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -50,72 +50,98 @@ test('account API assert defaults', async t => {
5050
t.is(account.print(account.defaults), account.print());
5151
});
5252

53-
for (const signer of [false, 'ERC7702', 'ECDSA', 'P256', 'RSA', 'Multisig', 'MultisigWeighted'] as const) {
54-
let title = 'Account';
55-
if (signer) {
56-
title += ` with Signer${signer}`;
53+
function format(upgradeable: false | 'uups' | 'transparent') {
54+
switch (upgradeable) {
55+
case false:
56+
return 'non-upgradeable';
57+
case 'uups':
58+
return 'upgradeable uups';
59+
case 'transparent':
60+
return 'upgradeable transparent';
5761
}
62+
}
5863

59-
testAccount(`${title} named`, {
60-
name: `Custom${title}`,
61-
signer,
62-
});
63-
64-
testAccount(`${title} with ERC1271`, {
65-
name: `Custom${title}ERC1271`,
66-
signatureValidation: 'ERC1271',
67-
signer,
68-
});
69-
70-
testAccount(`${title} with ERC7739`, {
71-
name: `Custom${title}ERC7739`,
72-
signatureValidation: 'ERC7739',
73-
signer,
74-
});
75-
76-
testAccount(`${title} with ERC721Holder`, {
77-
name: `Custom${title}ERC721Holder`,
78-
ERC721Holder: true,
79-
signer,
80-
});
81-
82-
testAccount(`${title} with ERC1155Holder`, {
83-
name: `Custom${title}ERC1155Holder`,
84-
ERC1155Holder: true,
85-
signer,
86-
});
87-
88-
testAccount(`${title} with ERC721Holder and ERC1155Holder`, {
89-
name: `Custom${title}ERC721HolderERC1155Holder`,
90-
ERC721Holder: true,
91-
ERC1155Holder: true,
92-
signer,
93-
});
94-
95-
testAccount(`${title} with ERC7821 Execution`, {
96-
signer,
97-
batchedExecution: true,
98-
});
99-
100-
testAccount(`${title} with ERC7579`, {
101-
signer,
102-
ERC7579Modules: 'AccountERC7579',
103-
});
104-
105-
testAccount(`${title} with ERC7579 with ERC1271`, {
106-
signer,
107-
ERC7579Modules: 'AccountERC7579',
108-
signatureValidation: 'ERC1271',
109-
});
110-
111-
testAccount(`${title} with ERC7579 with ERC7739`, {
112-
signer,
113-
ERC7579Modules: 'AccountERC7579',
114-
signatureValidation: 'ERC7739',
115-
});
116-
117-
testAccount(`${title} with ERC7579 hooks`, {
118-
signer,
119-
ERC7579Modules: 'AccountERC7579Hooked',
120-
});
64+
for (const signer of [false, 'ERC7702', 'ECDSA', 'P256', 'RSA', 'Multisig', 'MultisigWeighted'] as const) {
65+
for (const upgradeable of [false, 'uups', 'transparent'] as const) {
66+
if (signer === 'ERC7702' && !!upgradeable) continue;
67+
68+
let title = 'Account';
69+
if (signer) {
70+
title += ` with Signer${signer}`;
71+
}
72+
73+
testAccount(`${title} named ${format(upgradeable)}`, {
74+
name: `Custom${title}`,
75+
signer,
76+
upgradeable,
77+
});
78+
79+
testAccount(`${title} with ERC1271 ${format(upgradeable)}`, {
80+
name: `Custom${title}ERC1271`,
81+
signatureValidation: 'ERC1271',
82+
signer,
83+
upgradeable,
84+
});
85+
86+
testAccount(`${title} with ERC7739 ${format(upgradeable)}`, {
87+
name: `Custom${title}ERC7739`,
88+
signatureValidation: 'ERC7739',
89+
signer,
90+
upgradeable,
91+
});
92+
93+
testAccount(`${title} with ERC721Holder ${format(upgradeable)}`, {
94+
name: `Custom${title}ERC721Holder`,
95+
ERC721Holder: true,
96+
signer,
97+
upgradeable,
98+
});
99+
100+
testAccount(`${title} with ERC1155Holder ${format(upgradeable)}`, {
101+
name: `Custom${title}ERC1155Holder`,
102+
ERC1155Holder: true,
103+
signer,
104+
upgradeable,
105+
});
106+
107+
testAccount(`${title} with ERC721Holder and ERC1155Holder ${format(upgradeable)}`, {
108+
name: `Custom${title}ERC721HolderERC1155Holder`,
109+
ERC721Holder: true,
110+
ERC1155Holder: true,
111+
signer,
112+
upgradeable,
113+
});
114+
115+
testAccount(`${title} with ERC7821 Execution ${format(upgradeable)}`, {
116+
signer,
117+
upgradeable,
118+
batchedExecution: true,
119+
});
120+
121+
testAccount(`${title} with ERC7579 ${format(upgradeable)}`, {
122+
signer,
123+
upgradeable,
124+
ERC7579Modules: 'AccountERC7579',
125+
});
126+
127+
testAccount(`${title} with ERC7579 with ERC1271 ${format(upgradeable)}`, {
128+
signer,
129+
upgradeable,
130+
ERC7579Modules: 'AccountERC7579',
131+
signatureValidation: 'ERC1271',
132+
});
133+
134+
testAccount(`${title} with ERC7579 with ERC7739 ${format(upgradeable)}`, {
135+
signer,
136+
upgradeable,
137+
ERC7579Modules: 'AccountERC7579',
138+
signatureValidation: 'ERC7739',
139+
});
140+
141+
testAccount(`${title} with ERC7579 hooks ${format(upgradeable)}`, {
142+
signer,
143+
upgradeable,
144+
ERC7579Modules: 'AccountERC7579Hooked',
145+
});
146+
}
121147
}

0 commit comments

Comments
 (0)