Skip to content
Lattice

AccessManagedLib

Git Source

Title: AccessManagedLib

Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/manager/AccessManaged.sol)

Companion library for contracts gated by an external AccessManager.

Constants

IS_CONSUMING_SCHEDULED_OP_SELECTOR

bytes4(keccak256("isConsumingScheduledOp()")).

bytes4 internal constant IS_CONSUMING_SCHEDULED_OP_SELECTOR = 0x8fb36037;

Functions

accessManagedStorage

function accessManagedStorage() internal pure returns (AccessManagedStorage storage $);

Returns

NameTypeDescription
$AccessManagedStorage

__AccessManaged_init

function __AccessManaged_init(address initialAuthority) internal;

Parameters

NameTypeDescription
initialAuthorityaddress

registerInterface

function registerInterface() internal;

authority

function authority() internal view returns (address);

Returns

NameTypeDescription
<none>address

setAuthority

function setAuthority(address newAuthority) internal;

Parameters

NameTypeDescription
newAuthorityaddress

isConsumingScheduledOp

Returns IS_CONSUMING_SCHEDULED_OP_SELECTOR while _consumingScheduledOp is set, else 0.

OZ semantics: restrictedCheck sets the flag only around its consumeScheduledOp call on the authority, so the authority can confirm the request came from this target. It never bypasses the gate.

function isConsumingScheduledOp() internal view returns (bytes4);

Returns

NameTypeDescription
<none>bytes4

restrictedCheck

Library-call gate (OZ _checkCanCall). Passes when the authority lets msg.sender call msg.sig on this contract immediately. Calls the manager makes from execute pass because the authority accepts itself as caller for the (target, selector) it is executing. A caller with an execution delay passes only by consuming its matured schedule of this exact call (msg.data) on the authority; otherwise the authority's revert (IAccessManager.AccessManagerNotScheduled, NotReady or Expired) bubbles up. A caller with no access reverts IAccessManaged.AccessManagedUnauthorized.

function restrictedCheck() internal;