You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, module registration in the SafeProtocolRegistry and plugin permissions in the SafeProtocolManageruse uint8 constants for specifying bitflags.
This issue captures some of the work to both document and re-evaluate the APIs to ensure that they are optimised for their uses:
The assumption is that module registration will mostly be initiated off-chain, which means that it might make sense to consider using Solidity enums as they have better integration with things like Ethers, TypeChain, etc.
The assumption is that check calls on modules would be called on-chain, where bitflags are more natural to use with constants instead of enums. In that case, the API should probably be implemented as it currently is in function of uint8 constants.
We should also consider whether it is worth having a higher API surface (i.e. support both enums and bitflags simultaneously) which increases cognitive load when trying to understand the interface.
Currently, module registration in the
SafeProtocolRegistry
and plugin permissions in theSafeProtocolManager
useuint8
constants for specifying bitflags.This issue captures some of the work to both document and re-evaluate the APIs to ensure that they are optimised for their uses:
enum
s as they have better integration with things like Ethers, TypeChain, etc.check
calls on modules would be called on-chain, where bitflags are more natural to use with constants instead of enums. In that case, the API should probably be implemented as it currently is in function ofuint8
constants.We should also consider whether it is worth having a higher API surface (i.e. support both enums and bitflags simultaneously) which increases cognitive load when trying to understand the interface.
On-Chain Usage of Enums vs Constants:
The text was updated successfully, but these errors were encountered: