StrategyRegistry
Inherits: AccessControlEnumerable
A registry for weight strategies that allows checking if a strategy supports a specific bit flag.
*Inherits from AccessControlEnumerable for role-based access control. Roles:
- DEFAULT_ADMIN_ROLE: The default role given to an address at creation. Can grant and revoke roles.
- WEIGHT_STRATEGY_ROLE: Role given to approved weight strategys.*
State Variables
_WEIGHT_STRATEGY_ROLE
Role identifier for weight strategys
bytes32 private constant _WEIGHT_STRATEGY_ROLE = keccak256("WEIGHT_STRATEGY_ROLE");
Functions
constructor
Constructs the StrategyRegistry contract
constructor(address admin) payable;
Parameters
Name | Type | Description |
---|---|---|
admin | address | The address that will be granted the DEFAULT_ADMIN_ROLE |
supportsBitFlag
Checks if a given weight strategy supports a specific bit flag
function supportsBitFlag(uint256 bitFlag, address weightStrategy) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
bitFlag | uint256 | The bit flag to check support for |
weightStrategy | address | The address of the weight strategy to check |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | bool True if the strategy supports the bit flag, false otherwise |
Errors
StrategyNotSupported
Error thrown when an unsupported strategy is used
error StrategyNotSupported();