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

A module can only be registered once with a single type #103

Closed
mmv08 opened this issue Sep 15, 2023 · 1 comment · Fixed by #106
Closed

A module can only be registered once with a single type #103

mmv08 opened this issue Sep 15, 2023 · 1 comment · Fixed by #106
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mmv08
Copy link
Member

mmv08 commented Sep 15, 2023

I was working on an erc4337 integration and realised that a module could only be added to a registry with a single type. For example, the erc4337 integration requires a module to be a plugin and a function handler, so I need to add twice to the registry with different types. However, the current implementation doesn't allow this because of the following check:
https://github.com/safe-global/safe-core-protocol/blob/8e86b6ff696e4240b72dd3f663ff7d8ab8d6c7a7/contracts/SafeProtocolRegistry.sol#L47-L52

@mmv08 mmv08 added the enhancement New feature or request label Sep 15, 2023
@mmv08 mmv08 changed the title A module can only be registered with a single type A module can only be registered once with a single type Sep 15, 2023
@mmv08
Copy link
Member Author

mmv08 commented Sep 15, 2023

Perhaps we can do something similar to permissions here:
https://github.com/safe-global/safe-core-protocol/blob/8e86b6ff696e4240b72dd3f663ff7d8ab8d6c7a7/contracts/SafeProtocolRegistry.sol#L15

So, a plugin would be 1, a function handler would be 2, a hook is 4 and so on

@akshay-ap akshay-ap self-assigned this Sep 18, 2023
@akshay-ap akshay-ap added this to the v0.3.0 milestone Sep 18, 2023
akshay-ap added a commit that referenced this issue Sep 20, 2023
akshay-ap added a commit that referenced this issue Sep 20, 2023
akshay-ap added a commit that referenced this issue Sep 20, 2023
akshay-ap added a commit that referenced this issue Sep 20, 2023
github-merge-queue bot pushed a commit that referenced this issue Sep 27, 2023
* Feat: remove references to a Safe{Core} Protocol account as Safe

* [#105] Feat: remove references to a Safe{Core} Protocol account as Safe

* [#105] Fix diagram in docs

* [#105] Feat: remove references to a Safe{Core} Protocol account as Safe

* [#103] Allow adding module as multiple types

* [#103] Update check function signature in Registry

* [#103] Module type function handler = 2, Module type Hooks = 4

* [#103] Add test, update error

* [#103] Update natspec doc

* [#103] Allow setting multiple moduleTypes in single call in registry, add tests

* [#103] Allow multiple moduleTypes

* [#103] Validate moduleTypes value in Registry before adding

* [#103] Use updated registry interface

---------

Co-authored-by: Mikhail <mveehkim@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants