Skip to content

Commit 5dc91c1

Browse files
committed
feat: update to support entrypoint v0.8.0
1 parent 39134f2 commit 5dc91c1

22 files changed

+69
-53
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
[submodule "lib/openzeppelin-contracts"]
66
path = lib/openzeppelin-contracts
77
url = https://github.com/openzeppelin/openzeppelin-contracts
8-
branch = release-v5.0
8+
branch = release-v5.1
99
[submodule "lib/account-abstraction"]
1010
path = lib/account-abstraction
1111
url = https://github.com/eth-infinitism/account-abstraction
12-
branch = releases/v0.7
12+
branch = releases/v0.8
1313
[submodule "lib/modular-account"]
1414
path = lib/modular-account
1515
url = https://github.com/alchemyplatform/modular-account

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"solidity.packageDefaultDependenciesContractsDirectory": "src",
33
"solidity.packageDefaultDependenciesDirectory": "lib",
4-
"solidity.compileUsingRemoteVersion": "v0.8.23",
4+
"solidity.compileUsingRemoteVersion": "v0.8.28",
55
"editor.formatOnSave": true,
66
"[solidity]": {
77
"editor.defaultFormatter": "JuanBlanco.solidity"

foundry.lock

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"lib/account-abstraction": {
3+
"branch": {
4+
"name": "releases/v0.8",
5+
"rev": "4cbc06072cdc19fd60f285c5997f4f7f57a588de"
6+
}
7+
},
8+
"lib/forge-std": {
9+
"branch": {
10+
"name": "v1",
11+
"rev": "ae570fec082bfe1c1f45b0acca4a2b4f84d345ce"
12+
}
13+
},
14+
"lib/modular-account": {
15+
"branch": {
16+
"name": "v1.0.x",
17+
"rev": "1ceb7935b3d8642283f0dc8fd0a7a7f00132be9d"
18+
}
19+
},
20+
"lib/openzeppelin-contracts": {
21+
"branch": {
22+
"name": "release-v5.1",
23+
"rev": "69c8def5f222ff96f2b5beff05dfba996368aa79"
24+
}
25+
}
26+
}

foundry.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[profile.default]
2-
solc = '0.8.23'
3-
evm_version = 'paris'
2+
solc = '0.8.28'
3+
evm_version = 'cancun'
44
via_ir = true
55
src = 'src'
66
out = 'out'

lib/account-abstraction

Submodule account-abstraction updated 152 files

lib/openzeppelin-contracts

script/Deploy_LightAccountFactory.s.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ contract Deploy_LightAccountFactory is Script {
4141

4242
LightAccountFactory factory = new LightAccountFactory{
4343
salt: 0x00000000000000000000000000000000000000005f1ffd9d31306e056bcc959b
44-
}(owner, entryPoint);
44+
}(
45+
owner, entryPoint
46+
);
4547

4648
// Deployed address check
4749
if (address(factory) != 0x0000000000400CdFef5E2714E63d8040b700BC24) {

script/Deploy_MultiOwnerLightAccountFactory.s.sol

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ contract Deploy_MultiOwnerLightAccountFactory is Script {
2222
vm.startBroadcast();
2323

2424
// Init code hash check
25-
bytes32 initCodeHash =
26-
keccak256(abi.encodePacked(type(MultiOwnerLightAccountFactory).creationCode, abi.encode(owner, entryPoint)));
25+
bytes32 initCodeHash = keccak256(
26+
abi.encodePacked(type(MultiOwnerLightAccountFactory).creationCode, abi.encode(owner, entryPoint))
27+
);
2728

2829
if (initCodeHash != 0x69e0f4a2942425638860e9982bd32f08941a082681e53208de970099f18252cc) {
2930
revert InitCodeHashMismatch(initCodeHash);
@@ -41,7 +42,9 @@ contract Deploy_MultiOwnerLightAccountFactory is Script {
4142

4243
MultiOwnerLightAccountFactory factory = new MultiOwnerLightAccountFactory{
4344
salt: 0x0000000000000000000000000000000000000000bb3ab048b3f4ef2620ea0163
44-
}(owner, entryPoint);
45+
}(
46+
owner, entryPoint
47+
);
4548

4649
// Deployed address check
4750
if (address(factory) != 0x000000000019d2Ee9F2729A65AfE20bb0020AefC) {

script/GetInitCodeHash.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity ^0.8.23;
2+
pragma solidity ^0.8.28;
33

44
import {Script} from "forge-std/Script.sol";
55
import {console} from "forge-std/Test.sol";

src/LightAccount.sol

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// SPDX-License-Identifier: GPL-3.0
2-
pragma solidity ^0.8.23;
2+
pragma solidity ^0.8.28;
33

44
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
5-
import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
65
import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
76
import {SIG_VALIDATION_FAILED} from "account-abstraction/core/Helpers.sol";
87
import {IEntryPoint} from "account-abstraction/interfaces/IEntryPoint.sol";
@@ -35,7 +34,6 @@ import {CustomSlotInitializable} from "./common/CustomSlotInitializable.sol";
3534
/// 5. Uses custom errors.
3635
contract LightAccount is BaseLightAccount, CustomSlotInitializable {
3736
using ECDSA for bytes32;
38-
using MessageHashUtils for bytes32;
3937

4038
/// @dev The version used for namespaced storage is not linked to the release version of the contract. Storage
4139
/// versions will be updated only when storage layout changes are made.
@@ -127,10 +125,7 @@ contract LightAccount is BaseLightAccount, CustomSlotInitializable {
127125
}
128126
uint8 signatureType = uint8(userOp.signature[0]);
129127
if (signatureType == uint8(SignatureType.EOA)) {
130-
// EOA signature
131-
bytes32 signedHash = userOpHash.toEthSignedMessageHash();
132-
bytes memory signature = userOp.signature[1:];
133-
return _successToValidationData(_isValidEOAOwnerSignature(signedHash, signature));
128+
return _successToValidationData(_isValidEOAOwnerSignature(userOpHash, userOp.signature[1:]));
134129
} else if (signatureType == uint8(SignatureType.CONTRACT)) {
135130
// Contract signature without address
136131
bytes memory signature = userOp.signature[1:];

0 commit comments

Comments
 (0)