StrategyRegistry

Git Source

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

NameTypeDescription
adminaddressThe 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

NameTypeDescription
bitFlaguint256The bit flag to check support for
weightStrategyaddressThe address of the weight strategy to check

Returns

NameTypeDescription
<none>boolbool True if the strategy supports the bit flag, false otherwise

Errors

StrategyNotSupported

Error thrown when an unsupported strategy is used

error StrategyNotSupported();