Skip to content

Commit 074423d

Browse files
committed
Reorder
1 parent aa4a7f7 commit 074423d

File tree

6 files changed

+27
-48
lines changed

6 files changed

+27
-48
lines changed

contracts/account/AccountECDSA.sol renamed to contracts/account/ECDSA/AccountECDSA.sol

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
pragma solidity ^0.8.20;
44

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";
1010

1111
abstract contract AccountECDSA is Account {
1212
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
@@ -22,13 +22,7 @@ abstract contract AccountECDSA is Account {
2222
}
2323
}
2424

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 {
3226
function signer() public view override returns (address) {
3327
return abi.decode(Clones.fetchCloneArgs(address(this)), (address));
3428
}

contracts/account/AccountECDSAFactory.sol renamed to contracts/account/ECDSA/AccountECDSAFactory.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
pragma solidity ^0.8.20;
44

5-
import {IEntryPoint} from "../interfaces/IERC4337.sol";
5+
import {IEntryPoint} from "../../interfaces/IERC4337.sol";
6+
import {AccountFactory} from "./../AccountFactory.sol";
67
import {AccountECDSAClonable} from "./AccountECDSA.sol";
7-
import {AccountFactory} from "./AccountFactory.sol";
88

99
abstract contract AccountECDSAFactory is AccountFactory {
1010
constructor(IEntryPoint entryPoint_, string memory name, string memory version) {
1111
_accountImplementation = address(new AccountECDSAClonable(entryPoint_, name, version));
1212
}
1313

1414
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);
1716
}
1817
}

contracts/account/AccountP256.sol renamed to contracts/account/P256/AccountP256.sol

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
pragma solidity ^0.8.20;
44

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";
1010

1111
abstract contract AccountP256 is Account {
1212
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
@@ -31,13 +31,7 @@ abstract contract AccountP256 is Account {
3131
}
3232
}
3333

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 {
4135
function signer() public view override returns (bytes32 qx, bytes32 qy) {
4236
return abi.decode(Clones.fetchCloneArgs(address(this)), (bytes32, bytes32));
4337
}

contracts/account/AccountP256Factory.sol renamed to contracts/account/P256/AccountP256Factory.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
pragma solidity ^0.8.20;
44

5-
import {IEntryPoint} from "../interfaces/IERC4337.sol";
5+
import {IEntryPoint} from "../../interfaces/IERC4337.sol";
6+
import {AccountFactory} from "./../AccountFactory.sol";
67
import {AccountP256Clonable} from "./AccountP256.sol";
7-
import {AccountFactory} from "./AccountFactory.sol";
88

99
abstract contract AccountP256Factory is AccountFactory {
1010
constructor(IEntryPoint entryPoint_, string memory name, string memory version) {
1111
_accountImplementation = address(new AccountP256Clonable(entryPoint_, name, version));
1212
}
1313

1414
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);
1716
}
1817
}

contracts/account/AccountRSA.sol renamed to contracts/account/RSA/AccountRSA.sol

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
pragma solidity ^0.8.20;
44

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";
1010

1111
abstract contract AccountRSA is Account {
1212
// 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 {
2626
}
2727
}
2828

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 {
3630
function signer() public view override returns (bytes memory e, bytes memory m) {
3731
return abi.decode(Clones.fetchCloneArgs(address(this)), (bytes, bytes));
3832
}

contracts/account/AccountRSAFactory.sol renamed to contracts/account/RSA/AccountRSAFactory.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
pragma solidity ^0.8.20;
44

5-
import {IEntryPoint} from "../interfaces/IERC4337.sol";
5+
import {IEntryPoint} from "../../interfaces/IERC4337.sol";
6+
import {AccountFactory} from "./../AccountFactory.sol";
67
import {AccountRSAClonable} from "./AccountRSA.sol";
7-
import {AccountFactory} from "./AccountFactory.sol";
88

99
abstract contract AccountRSAFactory is AccountFactory {
1010
constructor(IEntryPoint entryPoint_, string memory name, string memory version) {
1111
_accountImplementation = address(new AccountRSAClonable(entryPoint_, name, version));
1212
}
1313

1414
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);
1716
}
1817
}

0 commit comments

Comments
 (0)