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 ERC-4337 and ERC-7702 account implementations #25

Merged
merged 58 commits into from
Dec 17, 2024
Merged

Conversation

ernestognw
Copy link
Member

@ernestognw ernestognw commented Nov 26, 2024

Description

After multiple rounds of iterations, the Account Implementations were reduced to an AccountCore, a opinionated Account contract and a couple of AbtractSigners that implement signature validation logic.

The documentation will later include how to compose these contracts and they should be also customizable in Wizard

Copy link

netlify bot commented Nov 29, 2024

Deploy Preview for community-contracts ready!

Name Link
🔨 Latest commit dcdae8d
🔍 Latest deploy log https://app.netlify.com/sites/community-contracts/deploys/67576a213ab09d000803210d
😎 Deploy Preview https://deploy-preview-25--community-contracts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ernestognw ernestognw changed the title WIP: Migrate Account code Add ERC-4337 account implementations Dec 7, 2024
@ernestognw ernestognw marked this pull request as ready for review December 7, 2024 20:15
@ernestognw ernestognw requested a review from a team as a code owner December 7, 2024 20:15
Copy link
Collaborator

@Amxx Amxx left a comment

Choose a reason for hiding this comment

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

There is a lot of duplicated code between AccountECDSA, AccountP256 and AccountRSA:

  • ERC7739Signer
  • ERC721Holder
  • ERC1155HolderLean

maybe we should bundle all that in some way that all variants can get easily.

@ernestognw
Copy link
Member Author

@frangio and I consider that the Base Account should not inherit from ERC7339Signer since ERC-7339 is a workaround with important limitations.

@frangio
Copy link
Contributor

frangio commented Dec 14, 2024

important limitations

I was thinking of composability. This made me think it's not good enough to be a default.

On the other hand, 1271 without 7739 is unsafe... possibly with bigger impact than the lack of composability.

So let's discuss it a bit more.

@ernestognw
Copy link
Member Author

I updated moving the EIP 712 user op typed hash logic to AccountBase.

One thing is that AccountBase will need EIP-712 to sign the typed user op hash, anyway. In that case, I'm reconsidering having ERC-7739 by default.

On the other hand, 1271 without 7739 is unsafe... possibly with bigger impact than the lack of composability.

Right. I agree we should be opinionated on the ERC-1271 implementation. iiuc, implementing ERC-7803 would allow for better composability and works better as a default, is that correct?

@frangio
Copy link
Contributor

frangio commented Dec 14, 2024

ERC-7803 solves composability but it's not usable today, it needs to be accepted and deployed across wallets, there is no guarantee that will happen at this point.

Amxx
Amxx previously approved these changes Dec 16, 2024
Copy link
Collaborator

@Amxx Amxx left a comment

Choose a reason for hiding this comment

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

IMO this is good to merge.

There is still work to do, but that can be done in parallele in separate PR, such that the review works remains acceptable (many small PR are easier to process)

Upcomming work (some of which as aready started)

  • Documentation
  • Testing (particularly EIP7702)
  • Extensions (7579, ...)
  • Signer constructor/initialization
  • UserOperation -> hash for signature.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
@ernestognw
Copy link
Member Author

I reviewed the changes and saw they required a couple of documentation (NatSpec) updates so I committed them myself. Basically, I fixed multiple broken links in the documentation (due to #30). I think it's fine to hardcode the OpenZeppelin docs for now so that the correct source is linked.

I'm merging this since there are no controversial changes, so I can focus on ERC7702 testing, documentation, an ERC7579 implementation.

Signer constructor/initialization

What are your thoughts here?

@ernestognw ernestognw changed the title Add ERC-4337 account implementations Add ERC-4337 and ERC-7702 account implementations Dec 17, 2024
@ernestognw ernestognw merged commit c205b41 into master Dec 17, 2024
10 checks passed
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.

3 participants