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

Atomically set ERC-1967 and enforce implementation invariants #39

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

amiecorso
Copy link
Collaborator

@amiecorso amiecorso commented Feb 19, 2025

A simpler approach to the EIP7702Proxy. Protects vulnerable implementations by enforcing that setting an implementation on the proxy can also be validated to have achieved a desired initialization state or any other specific invariant important to that account, reverting if validation conditions aren't met. This allows us to enforce that a vulnerable implementation is never pointed to in a vulnerable state.

Other benefits:

  • allows us to remove the GUARDED_INITIALIZER
  • allows us to remove the explicit initialize function and streamline with setImplementation
  • allows us to stop overriding the fallback function on the parent Proxy
  • simplifies pre-initialization receive behavior

We have 100% test coverage 🎉

Screenshot 2025-02-20 at 5 00 04 PM

Copy link
Collaborator

@ilikesymmetry ilikesymmetry left a comment

Choose a reason for hiding this comment

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

Need to let this sit a bit, but this kind of mechanism feels helpful. Main downside I see is just proliferating the number of deployed contracts for this system although their implementations and connections are super simple

@amiecorso amiecorso changed the title Atomically set ERC-1967 and enforce nonzero wallet ownership state Atomically set ERC-1967 and enforce implementation invariants Feb 20, 2025
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will replace these later when development stops

@amiecorso amiecorso marked this pull request as ready for review February 21, 2025 00: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.

2 participants