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
Simplify CallReceiverMock
  • Loading branch information
ernestognw committed Dec 6, 2024
commit 549ab8eadff85f346ae252717ea4775818e1de94
71 changes: 3 additions & 68 deletions contracts/mocks/CallReceiverMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,12 @@

pragma solidity ^0.8.20;

contract CallReceiverMock {
event MockFunctionCalled();
event MockFunctionCalledWithArgs(uint256 a, uint256 b);
event MockFunctionCalledExtra(address caller, uint256 value);

uint256[] private _array;
import {CallReceiverMock} from "@openzeppelin/contracts/mocks/CallReceiverMock.sol";

function mockFunction() public payable returns (string memory) {
emit MockFunctionCalled();

return "0x1234";
}
contract CallReceiverMockExtended is CallReceiverMock {
event MockFunctionCalledExtra(address caller, uint256 value);

function mockFunctionExtra() public payable {
emit MockFunctionCalledExtra(msg.sender, msg.value);
}

function mockFunctionEmptyReturn() public payable {
emit MockFunctionCalled();
}

function mockFunctionWithArgs(uint256 a, uint256 b) public payable returns (string memory) {
emit MockFunctionCalledWithArgs(a, b);

return "0x1234";
}

function mockFunctionNonPayable() public returns (string memory) {
emit MockFunctionCalled();

return "0x1234";
}

function mockStaticFunction() public pure returns (string memory) {
return "0x1234";
}

function mockFunctionRevertsNoReason() public payable {
revert();
}

function mockFunctionRevertsReason() public payable {
revert("CallReceiverMock: reverting");
}

function mockFunctionThrows() public payable {
assert(false);
}

function mockFunctionOutOfGas() public payable {
for (uint256 i = 0; ; ++i) {
_array.push(i);
}
}

function mockFunctionWritesStorage(bytes32 slot, bytes32 value) public returns (string memory) {
assembly {
sstore(slot, value)
}
return "0x1234";
}
}

contract CallReceiverMockTrustingForwarder is CallReceiverMock {
address private _trustedForwarder;

constructor(address trustedForwarder_) {
_trustedForwarder = trustedForwarder_;
}

function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
return forwarder == _trustedForwarder;
}
}
2 changes: 1 addition & 1 deletion test/account/draft-AccountBase.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { BooleanSigner } = require('../helpers/signers');

async function fixture() {
const [beneficiary, other] = await ethers.getSigners();
const target = await ethers.deployContract('CallReceiverMock');
const target = await ethers.deployContract('CallReceiverMockExtended');
const signer = new BooleanSigner();
const helper = new ERC4337Helper('$AccountBaseMock');
const smartAccount = await helper.newAccount();
Expand Down
2 changes: 1 addition & 1 deletion test/account/draft-AccountECDSA.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { shouldBehaveLikeERC7739Signer } = require('../utils/cryptography/ERC7739

async function fixture() {
const [beneficiary, other] = await ethers.getSigners();
const target = await ethers.deployContract('CallReceiverMock');
const target = await ethers.deployContract('CallReceiverMockExtended');
const signer = new ECDSASigner();
const helper = new ERC4337Helper('$AccountECDSA');
const smartAccount = await helper.newAccount(['AccountECDSA', '1', signer.EOA.address]);
Expand Down
2 changes: 1 addition & 1 deletion test/account/draft-AccountP256.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { shouldBehaveLikeERC7739Signer } = require('../utils/cryptography/ERC7739

async function fixture() {
const [beneficiary, other] = await ethers.getSigners();
const target = await ethers.deployContract('CallReceiverMock');
const target = await ethers.deployContract('CallReceiverMockExtended');
const signer = new P256Signer();
const helper = new ERC4337Helper('$AccountP256');
const smartAccount = await helper.newAccount(['AccountP256', '1', signer.publicKey.qx, signer.publicKey.qy]);
Expand Down
2 changes: 1 addition & 1 deletion test/account/draft-AccountRSA.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { shouldBehaveLikeERC7739Signer } = require('../utils/cryptography/ERC7739

async function fixture() {
const [beneficiary, other] = await ethers.getSigners();
const target = await ethers.deployContract('CallReceiverMock');
const target = await ethers.deployContract('CallReceiverMockExtended');
const signer = new RSASigner();
const helper = new ERC4337Helper('$AccountRSA');
const smartAccount = await helper.newAccount(['AccountRSA', '1', signer.publicKey.e, signer.publicKey.n]);
Expand Down
Loading