Skip to main content

RolesAdmin

Git Source

Inherits: Policy

The RolesAdmin Policy grants and revokes Roles in the ROLES module.

State Variables

admin

Special role that is responsible for assigning policy-defined roles to addresses.

address public admin

newAdmin

Proposed new admin. Address must call pullRolesAdmin to become the new roles admin.

address public newAdmin

ROLES

ROLESv1 public ROLES

Functions

constructor

constructor(Kernel _kernel) Policy(_kernel);

configureDependencies

function configureDependencies() external override returns (Keycode[] memory dependencies);

requestPermissions

function requestPermissions() external view override returns (Permissions[] memory requests);

onlyAdmin

modifier onlyAdmin() ;

grantRole

function grantRole(bytes32 role_, address wallet_) external onlyAdmin;

revokeRole

function revokeRole(bytes32 role_, address wallet_) external onlyAdmin;

pushNewAdmin

function pushNewAdmin(address newAdmin_) external onlyAdmin;

pullNewAdmin

function pullNewAdmin() external;

Events

NewAdminPushed

event NewAdminPushed(address indexed newAdmin_);

NewAdminPulled

event NewAdminPulled(address indexed newAdmin_);

Errors

Roles_OnlyAdmin

error Roles_OnlyAdmin();

Roles_OnlyNewAdmin

error Roles_OnlyNewAdmin();