Skip to main content

OlympusRoles

Git Source

Inherits: ROLESv1

Module that holds multisig roles needed by various policies.

Functions

constructor

constructor(Kernel kernel_) Module(kernel_);

KEYCODE

5 byte identifier for a module.

function KEYCODE() public pure override returns (Keycode);

VERSION

Returns which semantic version of a module is being implemented.

function VERSION() external pure override returns (uint8 major, uint8 minor);

Returns

NameTypeDescription
majoruint8- Major version upgrade indicates breaking change to the interface.
minoruint8- Minor version change retains backward-compatible interface.

saveRole

Function to grant policy-defined roles to some address. Can only be called by admin.

function saveRole(bytes32 role_, address addr_) external override permissioned;

removeRole

Function to revoke policy-defined roles from some address. Can only be called by admin.

function removeRole(bytes32 role_, address addr_) external override permissioned;

requireRole

"Modifier" to restrict policy function access to certain addresses with a role.

Roles are defined in the policy and granted by the ROLES admin.

function requireRole(bytes32 role_, address caller_) external view override;

ensureValidRole

Function that checks if role is valid (all lower case)

function ensureValidRole(bytes32 role_) public pure override;