Skip to content

Commit ff23994

Browse files
committed
Bump ERC-4337 entrypoint to version 0.9
1 parent 0de8004 commit ff23994

23 files changed

+58
-36
lines changed

.changeset/full-emus-hear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openzeppelin-solidity': minor
3+
---
4+
5+
ERC4337: Add entrypoint v0.9's address and use it by default.

contracts/account/Account.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract contract Account is AbstractSigner, IAccount {
5050
* @dev Canonical entry point for the account that forwards and validates user operations.
5151
*/
5252
function entryPoint() public view virtual returns (IEntryPoint) {
53-
return ERC4337Utils.ENTRYPOINT_V08;
53+
return ERC4337Utils.ENTRYPOINT_V09;
5454
}
5555

5656
/**

contracts/account/utils/draft-ERC4337Utils.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ library ERC4337Utils {
2727
/// @dev Address of the entrypoint v0.8.0
2828
IEntryPoint internal constant ENTRYPOINT_V08 = IEntryPoint(0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108);
2929

30+
/// @dev Address of the entrypoint v0.9.0
31+
IEntryPoint internal constant ENTRYPOINT_V09 = IEntryPoint(0x433709009B8330FDa32311DF1C2AFA402eD8D009);
32+
3033
/// @dev For simulation purposes, validateUserOp (and validatePaymasterUserOp) return this value on success.
3134
uint256 internal constant SIG_VALIDATION_SUCCESS = 0;
3235

package-lock.json

Lines changed: 14 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"hardhat-exposed": "^0.3.15",
7676
"hardhat-gas-reporter": "^2.1.0",
7777
"hardhat-ignore-warnings": "^0.2.11",
78-
"hardhat-predeploy": "^0.3.0",
78+
"hardhat-predeploy": "^0.4.1",
7979
"husky": "^9.1.7",
8080
"interoperable-addresses": "^0.1.3",
8181
"lint-staged": "^16.0.0",

test/account/Account.behavior.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function shouldBehaveLikeAccountCore() {
88
describe('entryPoint', function () {
99
it('should return the canonical entrypoint', async function () {
1010
await this.mock.deploy();
11-
await expect(this.mock.entryPoint()).to.eventually.equal(predeploy.entrypoint.v08);
11+
await expect(this.mock.entryPoint()).to.eventually.equal(predeploy.entrypoint.v09);
1212
});
1313
});
1414

@@ -30,7 +30,7 @@ function shouldBehaveLikeAccountCore() {
3030

3131
describe('when the caller is the canonical entrypoint', function () {
3232
beforeEach(async function () {
33-
this.mockFromEntrypoint = this.mock.connect(await impersonate(predeploy.entrypoint.v08.target));
33+
this.mockFromEntrypoint = this.mock.connect(await impersonate(predeploy.entrypoint.v09.target));
3434
});
3535

3636
it('should return SIG_VALIDATION_SUCCESS if the signature is valid', async function () {
@@ -59,7 +59,7 @@ function shouldBehaveLikeAccountCore() {
5959

6060
await expect(
6161
this.mockFromEntrypoint.validateUserOp(operation.packed, operation.hash(), value),
62-
).to.changeEtherBalances([this.mock, predeploy.entrypoint.v08], [-value, value]);
62+
).to.changeEtherBalances([this.mock, predeploy.entrypoint.v09], [-value, value]);
6363
});
6464
});
6565
});

test/account/Account.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async function fixture() {
2323
const mock = await helper.newAccount('$AccountMock', ['Account', '1']);
2424

2525
// ERC-4337 Entrypoint domain
26-
const entrypointDomain = await getDomain(predeploy.entrypoint.v08);
26+
const entrypointDomain = await getDomain(predeploy.entrypoint.v09);
2727

2828
// domain cannot be fetched using getDomain(mock) before the mock is deployed
2929
const domain = { name: 'Account', version: '1', chainId: entrypointDomain.chainId, verifyingContract: mock.address };

test/account/AccountECDSA.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function fixture() {
2222
const mock = await helper.newAccount('$AccountECDSAMock', [signer, 'AccountECDSA', '1']);
2323

2424
// ERC-4337 Entrypoint domain
25-
const entrypointDomain = await getDomain(predeploy.entrypoint.v08);
25+
const entrypointDomain = await getDomain(predeploy.entrypoint.v09);
2626

2727
// domain cannot be fetched using getDomain(mock) before the mock is deployed
2828
const domain = {

test/account/AccountERC7702.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ contract AccountERC7702Test is Test {
4848
vm.signAndAttachDelegation(address(new AccountERC7702MockConstructor()), _signerPrivateKey);
4949

5050
// Setup entrypoint
51-
address entrypoint = address(ERC4337Utils.ENTRYPOINT_V08);
51+
address entrypoint = address(ERC4337Utils.ENTRYPOINT_V09);
5252
vm.deal(entrypoint, MAX_ETH);
5353
vm.etch(
5454
entrypoint,
@@ -97,7 +97,7 @@ contract AccountERC7702Test is Test {
9797
});
9898
(uint8 v, bytes32 r, bytes32 s) = vm.sign(
9999
_signerPrivateKey,
100-
IEntryPointExtra(address(ERC4337Utils.ENTRYPOINT_V08)).getUserOpHash(ops[0])
100+
IEntryPointExtra(address(ERC4337Utils.ENTRYPOINT_V09)).getUserOpHash(ops[0])
101101
);
102102
ops[0].signature = abi.encodePacked(r, s, v);
103103

test/account/AccountERC7702.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function fixture() {
2222
const mock = await helper.newAccount('$AccountERC7702Mock', ['AccountERC7702Mock', '1'], { erc7702signer: signer });
2323

2424
// ERC-4337 Entrypoint domain
25-
const entrypointDomain = await getDomain(predeploy.entrypoint.v08);
25+
const entrypointDomain = await getDomain(predeploy.entrypoint.v09);
2626

2727
// domain cannot be fetched using getDomain(mock) before the mock is deployed
2828
const domain = {

0 commit comments

Comments
 (0)