File tree Expand file tree Collapse file tree 6 files changed +27
-48
lines changed Expand file tree Collapse file tree 6 files changed +27
-48
lines changed Original file line number Diff line number Diff line change 2
2
3
3
pragma solidity ^ 0.8.20 ;
4
4
5
- import {IEntryPoint} from "../interfaces/IERC4337.sol " ;
6
- import {Account } from "./Account .sol " ;
7
- import {ECDSA } from "../utils/cryptography/ECDSA .sol " ;
8
- import {Clones } from "../proxy/Clones .sol " ;
9
- import {EIP712 } from "../utils/cryptography/EIP712 .sol " ;
5
+ import {IEntryPoint} from "../../ interfaces/IERC4337.sol " ;
6
+ import {ECDSA } from "../../utils/cryptography/ECDSA .sol " ;
7
+ import {Clones } from "../../proxy/Clones .sol " ;
8
+ import {EIP712 } from "../../utils/cryptography/EIP712 .sol " ;
9
+ import {Account } from "./../Account .sol " ;
10
10
11
11
abstract contract AccountECDSA is Account {
12
12
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
@@ -22,13 +22,7 @@ abstract contract AccountECDSA is Account {
22
22
}
23
23
}
24
24
25
- contract AccountECDSAClonable is AccountECDSA {
26
- constructor (
27
- IEntryPoint entryPoint_ ,
28
- string memory name ,
29
- string memory version
30
- ) Account (entryPoint_) EIP712 (name, version) {}
31
-
25
+ abstract contract AccountECDSAClonable is AccountECDSA {
32
26
function signer () public view override returns (address ) {
33
27
return abi.decode (Clones.fetchCloneArgs (address (this )), (address ));
34
28
}
Original file line number Diff line number Diff line change 2
2
3
3
pragma solidity ^ 0.8.20 ;
4
4
5
- import {IEntryPoint} from "../interfaces/IERC4337.sol " ;
5
+ import {IEntryPoint} from "../../interfaces/IERC4337.sol " ;
6
+ import {AccountFactory} from "./../AccountFactory.sol " ;
6
7
import {AccountECDSAClonable} from "./AccountECDSA.sol " ;
7
- import {AccountFactory} from "./AccountFactory.sol " ;
8
8
9
9
abstract contract AccountECDSAFactory is AccountFactory {
10
10
constructor (IEntryPoint entryPoint_ , string memory name , string memory version ) {
11
11
_accountImplementation = address (new AccountECDSAClonable (entryPoint_, name, version));
12
12
}
13
13
14
14
function clone (address signer , bytes32 salt ) external returns (address ) {
15
- bytes memory encodedSigner = abi.encode (signer);
16
- return _clone (encodedSigner, salt);
15
+ return _clone (abi.encode (signer), salt);
17
16
}
18
17
}
Original file line number Diff line number Diff line change 2
2
3
3
pragma solidity ^ 0.8.20 ;
4
4
5
- import {IEntryPoint} from "../interfaces/IERC4337.sol " ;
6
- import {Account } from "./Account .sol " ;
7
- import {P256 } from "../utils/cryptography/P256 .sol " ;
8
- import {Clones } from "../proxy/Clones .sol " ;
9
- import {EIP712 } from "../utils/cryptography/EIP712 .sol " ;
5
+ import {IEntryPoint} from "../../ interfaces/IERC4337.sol " ;
6
+ import {P256 } from "../../utils/cryptography/P256 .sol " ;
7
+ import {Clones } from "../../proxy/Clones .sol " ;
8
+ import {EIP712 } from "../../utils/cryptography/EIP712 .sol " ;
9
+ import {Account } from "./../Account .sol " ;
10
10
11
11
abstract contract AccountP256 is Account {
12
12
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
@@ -31,13 +31,7 @@ abstract contract AccountP256 is Account {
31
31
}
32
32
}
33
33
34
- contract AccountP256Clonable is AccountP256 {
35
- constructor (
36
- IEntryPoint entryPoint_ ,
37
- string memory name ,
38
- string memory version
39
- ) Account (entryPoint_) EIP712 (name, version) {}
40
-
34
+ abstract contract AccountP256Clonable is AccountP256 {
41
35
function signer () public view override returns (bytes32 qx , bytes32 qy ) {
42
36
return abi.decode (Clones.fetchCloneArgs (address (this )), (bytes32 , bytes32 ));
43
37
}
Original file line number Diff line number Diff line change 2
2
3
3
pragma solidity ^ 0.8.20 ;
4
4
5
- import {IEntryPoint} from "../interfaces/IERC4337.sol " ;
5
+ import {IEntryPoint} from "../../interfaces/IERC4337.sol " ;
6
+ import {AccountFactory} from "./../AccountFactory.sol " ;
6
7
import {AccountP256Clonable} from "./AccountP256.sol " ;
7
- import {AccountFactory} from "./AccountFactory.sol " ;
8
8
9
9
abstract contract AccountP256Factory is AccountFactory {
10
10
constructor (IEntryPoint entryPoint_ , string memory name , string memory version ) {
11
11
_accountImplementation = address (new AccountP256Clonable (entryPoint_, name, version));
12
12
}
13
13
14
14
function clone (bytes32 qx , bytes32 qy , bytes32 salt ) external returns (address ) {
15
- bytes memory encodedSigner = abi.encode (qx, qy);
16
- return _clone (encodedSigner, salt);
15
+ return _clone (abi.encode (qx, qy), salt);
17
16
}
18
17
}
Original file line number Diff line number Diff line change 2
2
3
3
pragma solidity ^ 0.8.20 ;
4
4
5
- import {IEntryPoint} from "../interfaces/IERC4337.sol " ;
6
- import {Account } from "./Account .sol " ;
7
- import {RSA } from "../utils/cryptography/RSA .sol " ;
8
- import {Clones } from "../proxy/Clones .sol " ;
9
- import {EIP712 } from "../utils/cryptography/EIP712 .sol " ;
5
+ import {IEntryPoint} from "../../ interfaces/IERC4337.sol " ;
6
+ import {RSA } from "../../utils/cryptography/RSA .sol " ;
7
+ import {Clones } from "../../proxy/Clones .sol " ;
8
+ import {EIP712 } from "../../utils/cryptography/EIP712 .sol " ;
9
+ import {Account } from "./../Account .sol " ;
10
10
11
11
abstract contract AccountRSA is Account {
12
12
// NOTE: There is no way to store immutable byte arrays in a contract, so we use private instead
@@ -26,13 +26,7 @@ abstract contract AccountRSA is Account {
26
26
}
27
27
}
28
28
29
- contract AccountRSAClonable is AccountRSA {
30
- constructor (
31
- IEntryPoint entryPoint_ ,
32
- string memory name ,
33
- string memory version
34
- ) Account (entryPoint_) EIP712 (name, version) {}
35
-
29
+ abstract contract AccountRSAClonable is AccountRSA {
36
30
function signer () public view override returns (bytes memory e , bytes memory m ) {
37
31
return abi.decode (Clones.fetchCloneArgs (address (this )), (bytes , bytes ));
38
32
}
Original file line number Diff line number Diff line change 2
2
3
3
pragma solidity ^ 0.8.20 ;
4
4
5
- import {IEntryPoint} from "../interfaces/IERC4337.sol " ;
5
+ import {IEntryPoint} from "../../interfaces/IERC4337.sol " ;
6
+ import {AccountFactory} from "./../AccountFactory.sol " ;
6
7
import {AccountRSAClonable} from "./AccountRSA.sol " ;
7
- import {AccountFactory} from "./AccountFactory.sol " ;
8
8
9
9
abstract contract AccountRSAFactory is AccountFactory {
10
10
constructor (IEntryPoint entryPoint_ , string memory name , string memory version ) {
11
11
_accountImplementation = address (new AccountRSAClonable (entryPoint_, name, version));
12
12
}
13
13
14
14
function clone (bytes memory e , bytes memory m , bytes32 salt ) external returns (address ) {
15
- bytes memory encodedSigner = abi.encode (e, m);
16
- return _clone (encodedSigner, salt);
15
+ return _clone (abi.encode (e, m), salt);
17
16
}
18
17
}
You can’t perform that action at this time.
0 commit comments