Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 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
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
188e71d
Remove docs mocks
ernestognw Dec 13, 2024
6ace1a7
Remove ERC7739 from AccountBase
ernestognw Dec 14, 2024
9793e49
Make ERC7739Signer validations private
ernestognw Dec 14, 2024
9e34432
Move EIP712 userop signing to Accountbase
ernestognw Dec 14, 2024
ae6a665
Split AccountCore / Account
Amxx Dec 16, 2024
07ca067
remove intermediary variable
Amxx Dec 16, 2024
6aa5597
doc
Amxx Dec 16, 2024
0513f3a
spelling
Amxx Dec 16, 2024
e3ce6b5
abstract signer
Amxx Dec 16, 2024
69cc3da
docs
Amxx Dec 16, 2024
d0bd34f
ERC7702 signer
Amxx Dec 16, 2024
3b1c1f4
fix
Amxx Dec 16, 2024
190b5a5
doc example for ERC7739 use signers
Amxx Dec 16, 2024
a6ab43b
Complete minimal documentation
ernestognw Dec 17, 2024
5c210cf
Update CHANGELOG.md
ernestognw Dec 17, 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
Checkpoint
  • Loading branch information
ernestognw committed Dec 5, 2024
commit f8657e72549cdb63b68a9f9ede2b2cdfd19037c4
13 changes: 13 additions & 0 deletions contracts/mocks/ERC1155Mock.sol
Copy link
Collaborator

@Amxx Amxx Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we would just import what we need, and the exposed plugin would take care of creating the mock.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we could whitelist some contracts we want to expose directly in the hardhat-exposed configuration. Something like

  exposed: {
    include: [
      'contracts/**/*',
      '@openzeppelin/contracts/token/ERC721/ERC721.sol',
      '@openzeppelin/contracts/token/ERC1155/ERC1155.sol'
    ],
  },

but the plugin don't support that unless we change the config.path.sources to include "@openzeppelin/contracts/".

@frangio do you have any idea what we could do ?

Copy link
Contributor

@frangio frangio Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplest reason why the plugin doesn't support this is that it creates contracts-exposed/**/* files for matching contracts/**/* files.

What would be the location of the exposed files created for something under @openzeppelin/?

I'm not opposed to something like this but it requires some design.

Copy link
Collaborator

@Amxx Amxx Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plugin already deals with that: https://github.com/frangio/hardhat-exposed/blob/master/src/core.ts#L96

From the core tests:

/home/amxx/Work/Repos/hardhat-exposed/contracts-exposed/Imported.sol
/home/amxx/Work/Repos/hardhat-exposed/contracts-exposed/$_/@openzeppelin/contracts/proxy/Clones.sol

Copy link
Collaborator

@Amxx Amxx Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels to me like this PR would mostly take care of that frangio/hardhat-exposed#32 if this change is applied frangio/hardhat-exposed#32 (comment)

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";

contract ERC1155Mock is ERC1155 {
constructor(string memory _uri) ERC1155(_uri) {}

function $mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) external virtual {
_mintBatch(to, ids, values, data);
}
}
4 changes: 2 additions & 2 deletions test/account/Account.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ function shouldBehaveLikeAccountHolder() {

beforeEach(async function () {
[this.owner] = await ethers.getSigners();
this.token = await ethers.deployContract('$ERC1155', ['https://somedomain.com/{id}.json']);
await this.token.$_mintBatch(this.owner, ids, values, '0x');
this.token = await ethers.deployContract('ERC1155Mock', ['https://somedomain.com/{id}.json']);
await this.token.$mintBatch(this.owner, ids, values, '0x');
});

it('receives ERC1155 tokens from a single ID', async function () {
Expand Down
15 changes: 8 additions & 7 deletions test/account/draft-AccountECDSA.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ describe('AccountECDSA', function () {

shouldBehaveLikeAnAccountBase();
shouldBehaveLikeAnAccountBaseExecutor();
// shouldBehaveLikeAccountHolder();
shouldBehaveLikeAccountHolder();

// describe('ERC7739Signer', function () {
// beforeEach(async function () {
// this.mock = await this.smartAccount.deploy();
// });
describe('ERC7739Signer', function () {
beforeEach(async function () {
this.mock = await this.smartAccount.deploy();
this.signTypedData = this.signer.signTypedData.bind(this.signer);
});

// shouldBehaveLikeERC7739Signer();
// });
shouldBehaveLikeERC7739Signer();
});
});
1 change: 1 addition & 0 deletions test/account/draft-AccountP256.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('AccountP256', function () {
describe('ERC7739Signer', function () {
beforeEach(async function () {
this.mock = await this.smartAccount.deploy();
this.signTypedData = this.signer.signTypedData.bind(this.signer);
});

shouldBehaveLikeERC7739Signer();
Expand Down
1 change: 1 addition & 0 deletions test/account/draft-AccountRSA.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('AccountRSA', function () {
describe('ERC7739Signer', function () {
beforeEach(async function () {
this.mock = await this.smartAccount.deploy();
this.signTypedData = this.signer.signTypedData.bind(this.signer);
});

shouldBehaveLikeERC7739Signer();
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/erc4337.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class UserOperation extends UserOperationVanilla {

async sign(domain, signer) {
this.signature = await PersonalSignHelper.sign(
signer.signTypedData,
signer.signTypedData.bind(signer),
this.hash(this.context.entrypoint.target, this.context.chainId),
domain,
);
Expand Down
1 change: 0 additions & 1 deletion test/helpers/signers.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class BooleanSigner {
class ERC7739Signer {
signTypedData(domain, types, contents) {
const encoder = ethers.TypedDataEncoder.from(types);
console.log(this);
return this._signRaw(hashTypedData(domain, encoder.hash(contents)));
}
}
Expand Down
Loading