Roles

Git Source

Inherits: Ownable, IRoles

State Variables

_roles

mapping(address => mapping(bytes32 => bool)) private _roles;

REBALANCER

bytes32 public constant REBALANCER = keccak256("REBALANCER");

PAUSE_MANAGER

bytes32 public constant PAUSE_MANAGER = keccak256("PAUSE_MANAGER");

REBALANCER_EOA

bytes32 public constant REBALANCER_EOA = keccak256("REBALANCER_EOA");

GUARDIAN_PAUSE

bytes32 public constant GUARDIAN_PAUSE = keccak256("GUARDIAN_PAUSE");

CHAINS_MANAGER

bytes32 public constant CHAINS_MANAGER = keccak256("CHAINS_MANAGER");

PROOF_FORWARDER

bytes32 public constant PROOF_FORWARDER = keccak256("PROOF_FORWARDER");

PROOF_BATCH_FORWARDER

bytes32 public constant PROOF_BATCH_FORWARDER = keccak256("PROOF_BATCH_FORWARDER");

SEQUENCER

bytes32 public constant SEQUENCER = keccak256("SEQUENCER");

GUARDIAN_BRIDGE

bytes32 public constant GUARDIAN_BRIDGE = keccak256("GUARDIAN_BRIDGE");

GUARDIAN_ORACLE

bytes32 public constant GUARDIAN_ORACLE = keccak256("GUARDIAN_ORACLE");

GUARDIAN_RESERVE

bytes32 public constant GUARDIAN_RESERVE = keccak256("GUARDIAN_RESERVE");

GUARDIAN_BORROW_CAP

bytes32 public constant GUARDIAN_BORROW_CAP = keccak256("GUARDIAN_BORROW_CAP");

GUARDIAN_SUPPLY_CAP

bytes32 public constant GUARDIAN_SUPPLY_CAP = keccak256("GUARDIAN_SUPPLY_CAP");

Functions

constructor

constructor(address _owner) Ownable(_owner);

isAllowedFor

function isAllowedFor(address _contract, bytes32 _role) external view override returns (bool);

allowFor

Abiltity to allow a contract for a role or not

function allowFor(address _contract, bytes32 _role, bool _allowed) external onlyOwner;

Parameters

NameTypeDescription
_contractaddressthe contract's address.
_rolebytes32the bytes32 role.
_allowedboolthe new status.

Events

Allowed

emitted when role is set

event Allowed(address indexed _contract, bytes32 indexed _role, bool _allowed);