Skip to main content

GACManaged

Git Source

Inherits: Pausable

Allows inheriting contracts to leverage global access control permissions conveniently, as well as granting contract-specific pausing functionality

Inspired from https://github.com/Citadel-DAO/citadel-contracts

State Variables

gac

IGAC public gac;

PAUSER

bytes32 internal constant PAUSER = keccak256("PAUSER");

WHITELISTED

bytes32 internal constant WHITELISTED = keccak256("WHITELISTED");

KEEPER

bytes32 internal constant KEEPER = keccak256("KEEPER");

GOVERNANCE

bytes32 internal constant GOVERNANCE = keccak256("GOVERNANCE");

MINTER

bytes32 internal constant MINTER = keccak256("MINTER");

PRODUCT

bytes32 internal constant PRODUCT = keccak256("PRODUCT");

DISTRIBUTION_MANAGER

bytes32 internal constant DISTRIBUTION_MANAGER = keccak256("DISTRIBUTION_MANAGER");

FACTORY

bytes32 internal constant FACTORY = keccak256("FACTORY");

isInitialized

Initializer

uint8 private isInitialized;

Functions

onlyRole

only holders of the given role on the GAC can access the methods with this modifier

modifier onlyRole(bytes32 role);

Parameters

NameTypeDescription
rolebytes32The role that msgSender will be checked against

_gacPausable

function _gacPausable() private view;

gacPausable

can be pausable by GAC or local flag

modifier gacPausable();

__GACManaged_init

Initializer

function __GACManaged_init(IGAC _globalAccessControl) public;

Parameters

NameTypeDescription
_globalAccessControlIGACglobal access control which is pinged to allow / deny access to permissioned calls by role

pause

Used to pause certain actions in the contract

function pause() public onlyRole(PAUSER);

unpause

Used to unpause if paused

function unpause() public onlyRole(PAUSER);