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

feat: add prevalidation hook support #232

Merged
merged 7 commits into from
Jan 14, 2025

Conversation

highskore
Copy link

@highskore highskore commented Jan 7, 2025

PR-Codex overview

This PR introduces new pre-validation hooks for ERC-1271 and ERC-4337, enhances error handling, and implements an emergency uninstall feature. It also adds related mock contracts for testing and updates the module management system to support these hooks.

Detailed summary

  • Added EmergencyUninstall struct for emergency uninstall data.
  • Introduced new errors: EmergencyUninstallSigError, InvalidNonce, and PrevalidationHookAlreadyInstalled.
  • Implemented pre-validation hooks for ERC-1271 and ERC-4337.
  • Enhanced ModuleManager to manage pre-validation hooks.
  • Updated Nexus contract to support emergency uninstall operations.
  • Added MockAccountLocker, MockPreValidationHook, and other mock contracts for testing.
  • Updated tests to cover new functionalities and error scenarios.

The following files were skipped due to too many changes: contracts/base/ModuleManager.sol, test/foundry/unit/concrete/hook/TestNexus_Hook_Emergency_Uninstall.sol

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

openzeppelin-code bot commented Jan 7, 2025

feat: add prevalidation hook support

Generated at commit: 84f9aa08866ca457af6325db8ad1e0e3e667aea4

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
1
0
6
29
37

For more details view the full report in OpenZeppelin Code Inspector

@filmakarov filmakarov self-requested a review January 9, 2025 10:47
Copy link
Collaborator

@filmakarov filmakarov left a comment

Choose a reason for hiding this comment

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

Thanks for submitting the PR, left some notes

contracts/base/ModuleManager.sol Outdated Show resolved Hide resolved
contracts/Nexus.sol Show resolved Hide resolved
contracts/interfaces/modules/IPreValidationHook.sol Outdated Show resolved Hide resolved
contracts/mocks/Mock7739PreValidationHook.sol Show resolved Hide resolved
contracts/mocks/MockPreValidationHookMultiplexer.sol Outdated Show resolved Hide resolved
contracts/mocks/MockPreValidationHookMultiplexer.sol Outdated Show resolved Hide resolved
@highskore highskore requested a review from filmakarov January 11, 2025 01:39
@filmakarov filmakarov merged commit a078cd7 into bcnmy:dev Jan 14, 2025
4 of 8 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.

2 participants