Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #39
Changes in PR:
check(...)
function as follows:moduleTypes
would be zero if input address is not listed.Why is this change needed is explained in #39.
TLDR; Need information from registry on the type of module.
Considerations while accepting this change as a solution:
If a contract is flagged in registry, it will be considered as malicious for all the types it is registered for. e.g., Suppose a contract is added in Registry as a Plugin and Function Handler and later gets flagged because of an issue in its behaviour as a plugin. Now, the
check(address)
would returnflaggedAt > 0
meaning it is flagged a malicious as a whole and not just for its plugin implementation.Why this approach?
This approach is a simplified model that is easy to follow and implement with low cognitive complexity to understand how
flaggedAt
works.listedAt
would be the timestamp when module is first added in the registry.Proposed implementation: 5afe/safe-core-protocol#106
Other alternatives:
a. Allow checking a module per type
In this case interface would look like as follows:
Here
moduleType
must be a power of 2 and function should revert for other values.In this approach the contract returns values depending on both address of
module
andmoduleType
.Protocol
.b. Return values indicate individual module type, listedAt and flagged Info.
In this case interface would look like as follows: