Skip to content

Latest commit

 

History

History
308 lines (266 loc) · 9.02 KB

ProtoBase.md

File metadata and controls

308 lines (266 loc) · 9.02 KB

ProtoBase.sol

View Source: contracts/core/ProtoBase.sol

↗ Extends: AccessControl, Pausable, Recoverable ↘ Derived Contracts: Protocol

ProtoBase

Functions

function (IStore store) internal nonpayable Recoverable 

Arguments

Name Type Description
store IStore
Source Code
constructor(IStore store) Recoverable(store) {
    _setAccessPolicy();
  }

_setAccessPolicy

function _setAccessPolicy() private nonpayable

Arguments

Name Type Description
Source Code
function _setAccessPolicy() private {
    _setRoleAdmin(AccessControlLibV1.NS_ROLES_ADMIN, AccessControlLibV1.NS_ROLES_ADMIN);
    _setRoleAdmin(AccessControlLibV1.NS_ROLES_COVER_MANAGER, AccessControlLibV1.NS_ROLES_ADMIN);
    _setRoleAdmin(AccessControlLibV1.NS_ROLES_LIQUIDITY_MANAGER, AccessControlLibV1.NS_ROLES_ADMIN);
    _setRoleAdmin(AccessControlLibV1.NS_ROLES_GOVERNANCE_ADMIN, AccessControlLibV1.NS_ROLES_ADMIN);
    _setRoleAdmin(AccessControlLibV1.NS_ROLES_GOVERNANCE_AGENT, AccessControlLibV1.NS_ROLES_GOVERNANCE_ADMIN);
    _setRoleAdmin(AccessControlLibV1.NS_ROLES_UPGRADE_AGENT, AccessControlLibV1.NS_ROLES_ADMIN);
    _setRoleAdmin(AccessControlLibV1.NS_ROLES_RECOVERY_AGENT, AccessControlLibV1.NS_ROLES_ADMIN);
    _setRoleAdmin(AccessControlLibV1.NS_ROLES_PAUSE_AGENT, AccessControlLibV1.NS_ROLES_ADMIN);
    _setRoleAdmin(AccessControlLibV1.NS_ROLES_UNPAUSE_AGENT, AccessControlLibV1.NS_ROLES_ADMIN);

    _setupRole(AccessControlLibV1.NS_ROLES_ADMIN, msg.sender);
  }

setupRole

function setupRole(bytes32 role, bytes32 adminRole, address account) external nonpayable nonReentrant 

Arguments

Name Type Description
role bytes32
adminRole bytes32
account address
Source Code
function setupRole(
    bytes32 role,
    bytes32 adminRole,
    address account
  ) external nonReentrant {
    s.mustNotBePaused();
    AccessControlLibV1.mustBeAdmin(s);

    _setRoleAdmin(role, adminRole);

    if (account != address(0)) {
      _setupRole(role, account);
    }
  }

pause

Pauses this contract. Can only be called by "Pause Agents".

function pause() external nonpayable nonReentrant 

Arguments

Name Type Description
Source Code
function pause() external nonReentrant {
    AccessControlLibV1.mustBePauseAgent(s);
    super._pause();
  }

unpause

Unpauses this contract. Can only be called by "Unpause Agents".

function unpause() external nonpayable whenPaused nonReentrant 

Arguments

Name Type Description
Source Code
function unpause() external whenPaused nonReentrant {
    AccessControlLibV1.mustBeUnpauseAgent(s);
    super._unpause();
  }

Contracts