Privileged
Title: Privileged
Author: Golem Foundation
Mixin providing privileged address storage and management functions.
Uses ERC-7201 namespaced storage to avoid collisions. Inheriting contracts must implement access control for setPrivileged/setPrivilegedBatch.
Note: security-contact: [email protected]
Quick Start - What Matters Most
This base stores and checks a privileged caller set. In .6, privilege updates skip storage writes and events when the requested value is already current.
State Variables
PRIVILEGED_STORAGE
bytes32 internal constant PRIVILEGED_STORAGE =
keccak256(abi.encode(uint256(keccak256("octant.privileged.strategy.storage")) - 1)) & ~bytes32(uint256(0xff))
Functions
_privilegedStorage
function _privilegedStorage() internal pure returns (PrivilegedData storage P);
_setPrivileged
function _setPrivileged(address _account, bool _status) internal;
_setPrivilegedBatch
function _setPrivilegedBatch(address[] calldata _accounts, bool _status) internal;
isPrivileged
Checks if an account has privileged status.
function isPrivileged(address _account) public view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
_account | address | The address to check. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | True if the account is privileged, false otherwise. |
Events
PrivilegedUpdated
event PrivilegedUpdated(address indexed account, bool status);
Structs
PrivilegedData
struct PrivilegedData {
mapping(address => bool) privileged;
}