Skip to content

Conversation

ernestognw
Copy link
Member

@ernestognw ernestognw commented Aug 26, 2025

Follow up to #5890 and #5891

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

Summary by Sourcery

Add a suite of ERC-7579 modules including basic and delayed executors, a validator abstraction with signature and multisig implementations (including weighted variants), along with mocks, tests, documentation updates, enum extensions, and changeset entries

New Features:

  • Add ERC7579Executor module for basic on-chain operation execution
  • Add ERC7579DelayedExecutor extension with scheduling, delay, expiration, and cancellation support
  • Add ERC7579Validator abstract base and ERC7579Signature concrete module for ERC-7913 signature validation
  • Add ERC7579Multisig multisig validator module and ERC7579MultisigWeighted extension for weighted multisignatures

Enhancements:

  • Provide mock contracts, extensive test coverage, and account module behavior fixtures for all new modules
  • Update enums helper and documentation navigation to include new ERC-7579 modules

Documentation:

  • Add AsciiDoc entries and navigation links for the new modules under docs/modules

Tests:

  • Add comprehensive test suites for executor, delayed executor, signature validator, multisig, and weighted multisig modules

Chores:

  • Include changeset entries for versioning each newly added module

Copy link

changeset-bot bot commented Aug 26, 2025

🦋 Changeset detected

Latest commit: 16e9e2c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

sourcery-ai bot commented Aug 26, 2025

Reviewer's Guide

This PR introduces the ERC-7579 framework by adding a core executor module with execute support, a delayed executor extension with scheduling/expiration, an abstract validator base plus a concrete ERC-7913 signature validator, and both basic and weighted multisig modules, together with mocks, comprehensive tests, updated enums, documentation entries, and changeset metadata.

Sequence diagram for delayed operation scheduling and execution (ERC7579DelayedExecutor)

sequenceDiagram
    actor User
    participant Account
    participant ERC7579DelayedExecutor
    User->>ERC7579DelayedExecutor: schedule(account, salt, mode, data)
    ERC7579DelayedExecutor->>Account: validate schedule (custom logic)
    ERC7579DelayedExecutor->>ERC7579DelayedExecutor: store Schedule
    Note over ERC7579DelayedExecutor: Wait for delay period
    User->>ERC7579DelayedExecutor: execute(account, salt, mode, executionCalldata)
    ERC7579DelayedExecutor->>ERC7579DelayedExecutor: check operation state (Ready)
    ERC7579DelayedExecutor->>Account: executeFromExecutor(mode, executionCalldata)
Loading

Sequence diagram for multisig validation during operation (ERC7579Multisig)

sequenceDiagram
    actor User
    participant Account
    participant ERC7579Multisig
    User->>ERC7579Multisig: execute(account, salt, mode, data)
    ERC7579Multisig->>ERC7579Multisig: decode signers and signatures
    ERC7579Multisig->>ERC7579Multisig: validate threshold
    ERC7579Multisig->>ERC7579Multisig: validate signatures
    ERC7579Multisig->>Account: executeFromExecutor(mode, executionCalldata)
Loading

Class diagram for new and updated ERC7579 modules

classDiagram
    class ERC7579Executor {
        +execute(account, salt, mode, data)
        +isModuleType(moduleTypeId)
        #_validateExecution(account, salt, mode, data)
        #_execute(account, mode, salt, executionCalldata)
    }
    class ERC7579DelayedExecutor {
        +schedule(account, salt, mode, data)
        +cancel(account, salt, mode, data)
        +setDelay(newDelay)
        +setExpiration(newExpiration)
        +onInstall(initData)
        +onUninstall(data)
        #_validateSchedule(account, salt, mode, data)
        #_validateCancel(account, salt, mode, data)
        #_setDelay(account, newDelay, minimumSetback)
        #_setExpiration(account, newExpiration)
        #_scheduleAt(account, salt, mode, executionCalldata, timepoint, delay)
        #_execute(account, salt, mode, executionCalldata)
        #_cancel(account, mode, executionCalldata, salt)
        #_validateStateBitmap(operationId, allowedStates)
        #_encodeStateBitmap(operationState)
        +state(account, salt, mode, executionCalldata)
        +getDelay(account)
        +getExpiration(account)
        +getSchedule(account, salt, mode, executionCalldata)
        +hashOperation(account, salt, mode, executionCalldata)
    }
    class ERC7579Validator {
        +isModuleType(moduleTypeId)
        +validateUserOp(userOp, userOpHash)
        +isValidSignatureWithSender(sender, hash, signature)
        #_rawERC7579Validation(account, hash, signature)
    }
    class ERC7579Signature {
        +signer(account)
        +onInstall(data)
        +onUninstall(data)
        +setSigner(signer_)
        #_setSigner(account, signer_)
        #_rawERC7579Validation(account, hash, signature)
    }
    class ERC7579Multisig {
        +onInstall(initData)
        +onUninstall(data)
        +getSigners(account, start, end)
        +getSignerCount(account)
        +isSigner(account, signer)
        +threshold(account)
        +addSigners(newSigners)
        +removeSigners(oldSigners)
        +setThreshold(newThreshold)
        #_addSigners(account, newSigners)
        #_removeSigners(account, oldSigners)
        #_setThreshold(account, newThreshold)
        #_validateReachableThreshold(account)
        #_validateSignatures(account, hash, signingSigners, signatures)
        #_validateThreshold(account, validatingSigners)
        #_rawERC7579Validation(account, hash, signature)
    }
    class ERC7579MultisigWeighted {
        +signerWeight(account, signer)
        +totalWeight(account)
        +setSignerWeights(signers, weights)
        #_setSignerWeights(account, signers, weights)
        #_addSigners(account, newSigners)
        #_removeSigners(account, oldSigners)
        #_validateReachableThreshold(account)
        #_validateThreshold(account, validatingSigners)
    }
    ERC7579DelayedExecutor --|> ERC7579Executor
    ERC7579Signature --|> ERC7579Validator
    ERC7579Multisig --|> ERC7579Validator
    ERC7579MultisigWeighted --|> ERC7579Multisig
Loading

File-Level Changes

Change Details Files
Implement core executor functionality
  • Add ERC7579Executor contract with execute and event emission
  • Provide _validateExecution hook for authorization
  • Create executor mock and write basic execution tests
contracts/account/modules/ERC7579Executor.sol
contracts/mocks/account/modules/ERC7579ExecutorMocks.sol
test/account/modules/ERC7579Executor.test.js
Add delayed executor extension
  • Define ERC7579DelayedExecutor with scheduling, delay, expiration, cancel logic
  • Manage operation state via enum and bitmap validation
  • Update enums, add README section and nav entry, and write delayed executor tests
contracts/account/modules/ERC7579DelayedExecutor.sol
contracts/mocks/account/modules/ERC7579DelayedExecutorMock.sol
test/account/modules/ERC7579DelayedExecutor.test.js
test/helpers/enums.js
contracts/account/README.adoc
docs/modules/ROOT/nav.adoc
Introduce abstract validator and signature module
  • Add ERC7579Validator base implementing validateUserOp and isValidSignatureWithSender
  • Implement ERC7579Signature for ERC-7913 signer storage and signature checking
  • Write validator and signature module tests
contracts/account/modules/ERC7579Validator.sol
contracts/account/modules/ERC7579Signature.sol
test/account/modules/ERC7579Validator.test.js
test/account/modules/ERC7579SignatureValidator.test.js
Implement multisig modules
  • Add ERC7579Multisig supporting signer set and threshold enforcement
  • Extend to ERC7579MultisigWeighted with per-signer weights and total weight tracking
  • Provide mocks and write multisig and weighted-multisig tests
contracts/account/modules/ERC7579Multisig.sol
contracts/account/modules/ERC7579MultisigWeighted.sol
contracts/mocks/account/modules/ERC7579MultisigMocks.sol
test/account/modules/ERC7579Multisig.test.js
test/account/modules/ERC7579MultisigWeighted.test.js
Update enums, docs and changesets
  • Register new ERC7579OperationState in test enums
  • Add changeset entries for each module
  • Expand documentation nav and account README
test/helpers/enums.js
.changeset/free-waves-draw.md
.changeset/pink-loops-jump.md
.changeset/solid-squids-cough.md
.changeset/weak-chefs-open.md
.changeset/wild-masks-worry.md
.changeset/yummy-ideas-stay.md
docs/modules/ROOT/nav.adoc

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Amxx
Copy link
Collaborator

Amxx commented Aug 27, 2025

We should create an issue that is tracking the progress of this migration, with subtasks for each module. Then we do multiple smaller PRs with 1 (or 2 in the case of ERC7579Multisig / ERC7579MultisigWeighted) module per PR.

Big PRs like this are hard to review, and will last forever it we don't split them into small easily attainable tasks

@ernestognw
Copy link
Member Author

Yes that makes sense. I still think it helps opening the full PR to check the CI and plan how to tackle the migration while this PR gets progressively smaller

Copy link

coderabbitai bot commented Aug 27, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

This was referenced Aug 27, 2025
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