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

Add ERC4337 Accounts docs #40

Merged
merged 57 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
a7b170a
WIP: Migrate Account code
ernestognw Nov 26, 2024
1859385
Merge branch 'master' into aa/accounts
ernestognw Nov 29, 2024
7847e80
Merge branch 'master' into aa/accounts
ernestognw Dec 3, 2024
25de3ac
Checkpoint
ernestognw Dec 5, 2024
292dae1
Fix lint
ernestognw Dec 5, 2024
f8657e7
Checkpoint
ernestognw Dec 5, 2024
8699232
up
ernestognw Dec 6, 2024
7bdf69e
up
ernestognw Dec 6, 2024
efd52cd
Adjust
ernestognw Dec 6, 2024
87fcd0e
up
ernestognw Dec 6, 2024
549ab8e
Simplify CallReceiverMock
ernestognw Dec 6, 2024
90c7f5e
Fix slither + Codespell
ernestognw Dec 6, 2024
2e345c3
Fix coverage
ernestognw Dec 6, 2024
af200e4
Merge branch 'master' into aa/accounts
ernestognw Dec 6, 2024
4d03f45
Remove entrypoint
ernestognw Dec 6, 2024
9caded9
Readd entrypoint
ernestognw Dec 6, 2024
f6b4454
Run --ir-minimum in forge coverage
ernestognw Dec 6, 2024
2d2300f
up
ernestognw Dec 7, 2024
d6ba190
Make Accounts initializable
ernestognw Dec 7, 2024
208386f
Finish docs
ernestognw Dec 7, 2024
49fc47d
Merge branch 'master' into aa/accounts
ernestognw Dec 7, 2024
d715e4c
rewrite helpers/signers as alternative to ethers.SigningKey and
Amxx Dec 9, 2024
8ad95a1
Rename _validateNestedEIP712Signature -> _validateSignature
ernestognw Dec 9, 2024
885efdd
Read virtual to ERC7739Signer functions
ernestognw Dec 9, 2024
d5f0dac
lint
ernestognw Dec 9, 2024
130ce04
Implement review recommendations
ernestognw Dec 9, 2024
dcdae8d
Include signer into account factory hash
ernestognw Dec 9, 2024
03d935d
Update Account inheritance order
ernestognw Dec 10, 2024
5456f26
up
ernestognw Dec 10, 2024
9412b65
Merge branch 'master' into aa/accounts
ernestognw Dec 10, 2024
524bf15
Remove ERC1155HolderLean
ernestognw Dec 10, 2024
4718b87
Abstract AccountSignerDomain
ernestognw Dec 10, 2024
c8ad19d
up
ernestognw Dec 10, 2024
ed66cca
Merge branch 'master' into aa/accounts
ernestognw Dec 10, 2024
c41956c
Remove signed hash fn
ernestognw Dec 11, 2024
7e51cd2
Add standalone example of usage
ernestognw Dec 13, 2024
459d594
Merge branch 'master' into aa/accounts
ernestognw Dec 13, 2024
f497fd1
Remove docs
ernestognw Dec 13, 2024
af140c1
Add ERC4337 Accounts docs
ernestognw Dec 13, 2024
6409cb3
ERC4337 userOp validation should not be 7739 wrapped
Amxx Dec 13, 2024
97b33df
documentation
Amxx Dec 13, 2024
ddd17e9
Rename `_validateSignature` to `_rawSignatureValidation` and remove _…
ernestognw Dec 13, 2024
e8ef6d1
errata
ernestognw Dec 13, 2024
d706876
Default _signableUserOpHash to a typed userop signature
ernestognw Dec 13, 2024
62ec7b4
Merge branch 'aa/accounts' into aa/docs
ernestognw Dec 13, 2024
188e71d
Remove docs mocks
ernestognw Dec 13, 2024
5433016
Merge branch 'aa/accounts' into aa/docs
ernestognw Dec 13, 2024
367f6cb
Recover mock docs
ernestognw Dec 13, 2024
afcea37
Merge branch 'master' into aa/docs
ernestognw Dec 17, 2024
afb2ebc
up
ernestognw Dec 17, 2024
94a8481
Merge branch 'master' into aa/docs
ernestognw Dec 17, 2024
21bc637
Merge branch 'master' into aa/docs
ernestognw Dec 24, 2024
af1a6f4
up
ernestognw Dec 24, 2024
336f6bc
Update docs/modules/ROOT/pages/account-abstraction.adoc
ernestognw Dec 25, 2024
51bf8ad
Update docs/modules/ROOT/pages/account-abstraction.adoc
ernestognw Dec 25, 2024
d225734
Apply suggestions from code review
ernestognw Dec 26, 2024
c09b264
Update docs/modules/ROOT/pages/account-abstraction.adoc
ernestognw Dec 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add standalone example of usage
  • Loading branch information
ernestognw committed Dec 13, 2024
commit 7e51cd2c1e7f4f3334a52d6d607471f4a3953571
17 changes: 15 additions & 2 deletions contracts/account/draft-AccountECDSA.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@ import {AccountERC7739} from "./extensions/draft-AccountERC7739.sol";
* An {_initializeSigner} function is provided to set the account's signer address. Doing so it's
* easier for a factory, whose likely to use initializable clones of this contract.
*
* Example of usage:
*
* ```solidity
* contract MyAccountECDSA is AccountECDSA {
* constructor() EIP712("MyAccountECDSA", "1") {}
*
* function initializeSigner(address signerAddr) public virtual initializer {
* // Will revert if the signer is already initialized
* _initializeSigner(signerAddr);
* }
* }
* ```
*
* IMPORTANT: Avoiding to call {_initializeSigner} either during construction (if used standalone)
* or during initialization (if used as a clone) may leave the account unusable.
* or during initialization (if used as a clone) may leave the account either front-runnable or unusable.
*/
abstract contract AccountECDSA is AccountERC7739, ERC721Holder, ERC1155Holder {
using MessageHashUtils for bytes32;
Expand All @@ -30,7 +43,7 @@ abstract contract AccountECDSA is AccountERC7739, ERC721Holder, ERC1155Holder {
address private _signer;

/**
* @dev Initializes the account with the address of the native signer. This function is called only once.
* @dev Initializes the account with the address of the native signer. This function can be called only once.
*/
function _initializeSigner(address signerAddr) internal {
if (_signer != address(0)) revert AccountECDSAUninitializedSigner(signerAddr);
Expand Down
17 changes: 15 additions & 2 deletions contracts/account/draft-AccountP256.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@ import {AccountERC7739} from "./extensions/draft-AccountERC7739.sol";
* An {_initializeSigner} function is provided to set the account's signer address. Doing so it's
* easier for a factory, whose likely to use initializable clones of this contract.
*
* Example of usage:
*
* ```solidity
* contract MyAccountP256 is AccountP256 {
* constructor() EIP712("MyAccountP256", "1") {}
*
* function initializeSigner(bytes32 qx, bytes32 qy) public virtual initializer {
* // Will revert if the signer is already initialized
* _initializeSigner(qx, qy);
* }
* }
* ```
*
* IMPORTANT: Avoiding to call {_initializeSigner} either during construction (if used standalone)
* or during initialization (if used as a clone) may leave the account unusable.
* or during initialization (if used as a clone) may leave the account either front-runnable or unusable.
*/
abstract contract AccountP256 is AccountERC7739, ERC721Holder, ERC1155Holder {
using MessageHashUtils for bytes32;
Expand All @@ -31,7 +44,7 @@ abstract contract AccountP256 is AccountERC7739, ERC721Holder, ERC1155Holder {
bytes32 private _qy;

/**
* @dev Initializes the account with the P256 public key.
* @dev Initializes the account with the P256 public key. This function can be called only once.
*/
function _initializeSigner(bytes32 qx, bytes32 qy) internal {
if (_qx != 0 || _qy != 0) revert AccountP256UninitializedSigner(qx, qy);
Expand Down
17 changes: 15 additions & 2 deletions contracts/account/draft-AccountRSA.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@ import {AccountERC7739} from "./extensions/draft-AccountERC7739.sol";
* An {_initializeSigner} function is provided to set the account's signer address. Doing so it's
* easier for a factory, whose likely to use initializable clones of this contract.
*
* Example of usage:
*
* ```solidity
* contract MyAccountRSA is AccountRSA {
* constructor() EIP712("MyAccountRSA", "1") {}
*
* function initializeSigner(bytes memory e, bytes memory n) external {
* // Will revert if the signer is already initialized
* _initializeSigner(e, n);
* }
* }
* ```
*
* IMPORTANT: Avoiding to call {_initializeSigner} either during construction (if used standalone)
* or during initialization (if used as a clone) may leave the account unusable.
* or during initialization (if used as a clone) may leave the account either front-runnable or unusable.
*/
abstract contract AccountRSA is AccountERC7739, ERC721Holder, ERC1155Holder {
using MessageHashUtils for bytes32;
Expand All @@ -31,7 +44,7 @@ abstract contract AccountRSA is AccountERC7739, ERC721Holder, ERC1155Holder {
bytes private _n;

/**
* @dev Initializes the account with the RSA public key.
* @dev Initializes the account with the RSA public key. This function can be called only once.
*/
function _initializeSigner(bytes memory e, bytes memory n) internal {
if (_e.length != 0 || _n.length != 0) revert AccountP256UninitializedSigner(e, n);
Expand Down