Authorizable
Inherits: IAuthorizable
Implements authorization control for contracts
Authorization control is boolean and handled by isAuthorized
modifier
State Variables
_authorizedAccounts
EnumerableSet of authorized accounts
EnumerableSet.AddressSet internal _authorizedAccounts;
Functions
constructor
constructor(address _account);
Parameters
Name | Type | Description |
---|---|---|
_account | address | Initial account to add authorization to |
authorizedAccounts
Checks whether an account is authorized
function authorizedAccounts(address _account) external view returns (bool _authorized);
Returns
Name | Type | Description |
---|---|---|
_authorized | bool | Whether the account is authorized or not |
authorizedAccounts
Getter for the authorized accounts
function authorizedAccounts() external view returns (address[] memory _accounts);
Returns
Name | Type | Description |
---|---|---|
_accounts | address[] | Array of authorized accounts |
addAuthorization
Add auth to an account
function addAuthorization(address _account) external virtual isAuthorized;
Parameters
Name | Type | Description |
---|---|---|
_account | address | Account to add auth to |
removeAuthorization
Remove auth from an account
function removeAuthorization(address _account) external virtual isAuthorized;
Parameters
Name | Type | Description |
---|---|---|
_account | address | Account to remove auth from |
_addAuthorization
function _addAuthorization(address _account) internal;
_removeAuthorization
function _removeAuthorization(address _account) internal;
_isAuthorized
function _isAuthorized(address _account) internal view virtual returns (bool _authorized);
isAuthorized
Checks whether msg.sender can call an authed function
Will revert with Unauthorized
if the sender is not authorized
modifier isAuthorized();