Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ account: add 4337 utils functions #26

Merged
merged 3 commits into from
Feb 5, 2024
Merged

Conversation

qd-qd
Copy link
Member

@qd-qd qd-qd commented Jan 29, 2024

Account now inherit from the BaseAccount contract. The entryPoint address is now exposed as recommend by the 4337 specification

Account now inherit from the BaseAccount contract. The entryPoint address
is now exposed as recommend by the 4337 specification
Copy link

github-actions bot commented Jan 29, 2024

Changes to gas cost

Generated at commit: 718e6c52d6e75669d987beb0e1d8d9f5ec674025, compared to commit: 2390abd72222f738fe0906af94929431768e1910

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
Account getSigner(bytes32) +33 ❌ +2.40%
SignerVaultWebAuthnP256R1TestWrapper tryGet +162 ❌ +1.99%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
Account 562,045 (+156,181) addFirstSigner
entryPoint
getSigner(bytes)
getSigner(bytes32)
webAuthnVerifier
397 (+22)
223 (-3)
1,882 (+33)
1,406 (+33)
249 (+22)
+5.87%
-1.33%
+1.78%
+2.40%
+9.69%
20,658 (+22)
223 (-3)
4,882 (+33)
1,406 (+33)
249 (+22)
+0.11%
-1.33%
+0.68%
+2.40%
+9.69%
10,070 (+22)
223 (-3)
4,882 (+33)
1,406 (+33)
249 (+22)
+0.22%
-1.33%
+0.68%
+2.40%
+9.69%
69,770 (+22)
223 (-3)
7,882 (+33)
1,406 (+33)
249 (+22)
+0.03%
-1.33%
+0.42%
+2.40%
+9.69%
60 (0)
2 (+1)
2 (0)
2 (0)
1 (0)
SignerVaultWebAuthnP256R1TestWrapper 1,461,927 (0) get
has(bytes)
tryGet
1,887 (0)
1,691 (0)
8,318 (+162)
0.00%
0.00%
+1.99%
4,899 (+12)
3,702 (+12)
8,318 (+162)
+0.25%
+0.33%
+1.99%
4,899 (+12)
3,702 (+12)
8,318 (+162)
+0.25%
+0.33%
+1.99%
7,911 (+24)
5,713 (+24)
8,318 (+162)
+0.30%
+0.42%
+1.99%
2 (0)
2 (0)
1 (0)
AccountFactory 1,397,025 (+160,484) createAndInitAccount
getAddress
5,272 (+45)
4,410 (+45)
+0.86%
+1.03%
151,358 (+99)
4,410 (+45)
+0.07%
+1.03%
177,704 (+112)
4,410 (+45)
+0.06%
+1.03%
217,522 (+112)
4,410 (+45)
+0.05%
+1.03%
10 (0)
12 (0)
AccountFactoryMultiSteps 1,476,133 (+160,484) createAccount
createAndInitAccount
getAddress
4,710 (+45)
177,682 (+112)
4,433 (+45)
+0.96%
+0.06%
+1.03%
127,921 (+86)
177,682 (+112)
4,433 (+45)
+0.07%
+0.06%
+1.03%
142,167 (+90)
177,682 (+112)
4,433 (+45)
+0.06%
+0.06%
+1.03%
142,167 (+90)
177,682 (+112)
4,433 (+45)
+0.06%
+0.06%
+1.03%
10 (0)
1 (0)
3 (0)
AccountFactoryTestWrapper 1,440,886 (+158,885) checkAccountExistence
getAddress
4,679 (+45)
4,434 (+45)
+0.97%
+1.03%
6,352 (+45)
4,434 (+45)
+0.71%
+1.03%
7,189 (+45)
4,434 (+45)
+0.63%
+1.03%
7,189 (+45)
4,434 (+45)
+0.63%
+1.03%
3 (0)
1 (0)
ERC1967Proxy 99,705 (0) addFirstSigner 30,357 (+22) +0.07% 39,201 (+22) +0.06% 30,357 (+22) +0.07% 70,157 (+22) +0.03% 9 (0)

Copy link

github-actions bot commented Jan 29, 2024

LCOV of commit 3051de6 during Tests #59

Summary coverage rate:
  lines......: 81.0% (51 of 63 lines)
  functions..: 95.5% (21 of 22 functions)
  branches...: no data found

Files changed coverage rate:
                                   |Lines       |Functions  |Branches    
  Filename                         |Rate     Num|Rate    Num|Rate     Num
  =======================================================================
  src/Account.sol                  | 100%      6|80.0%     5|    -      0
  src/AccountFactory.sol           |93.8%     16| 100%     4|    -      0

@qd-qd qd-qd force-pushed the feature/account-4337-utils branch from beb8827 to cf49b6d Compare January 29, 2024 15:33
@qd-qd qd-qd self-assigned this Feb 5, 2024
@qd-qd qd-qd changed the title ✨ account: inherit BaseAccount, expose entryPoint ✨ account: add 4337 utils functions Feb 5, 2024
@qd-qd qd-qd marked this pull request as ready for review February 5, 2024 20:30
qd-qd added 2 commits February 5, 2024 21:33
The account can now receive native tokens. Make the address of the account
payable in the factory.
This commit tests the `getNonce` function that call the method of the same
name on the `EntryPoint` contract. For the moment the implementation is
simple and doesn't deal with the key (check 4337)
@qd-qd qd-qd force-pushed the feature/account-4337-utils branch from cf49b6d to 3051de6 Compare February 5, 2024 20:33
@qd-qd qd-qd merged commit 3051de6 into main Feb 5, 2024
5 checks passed
@qd-qd qd-qd deleted the feature/account-4337-utils branch February 5, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant