AccountAccessController
Overview
The Access Controller is used for allowing/blocking access to contract functions.
Functions
setRoot
function setRoot(
bytes32 newRoot
) external
Sets the merkle root used to determine which accounts to allow.
Only callable by owner()
.
Parameters:
Name | Type | Description |
---|---|---|
newRoot | bytes32 | The new merkle root |
clearAllowedAccounts
function clearAllowedAccounts(
) external
Clears the allowlist for all accounts.
This does not actually modify any existing allowlists, the the function will increment an index pointing to a new mapping that will be referenced.
Only callable by owner()
.
setRootAndClearAllowedAccounts
function setRootAndClearAllowedAccounts(
bytes32 newRoot
) external
Sets the merkle root used to determine which accounts to allow and resets the allowlist.
Only callable by owner()
.
Parameters:
Name | Type | Description |
---|---|---|
newRoot | bytes32 | The new merkle root |
clearBlockedAccounts
function clearBlockedAccounts(
) external
Clears the blocklist for all accounts.
This does not actually modify any existing blocklists, the the function will increment an index pointing to a new mapping that will be referenced.
Only callable by owner()
.
allowAccounts
function allowAccounts(
address[] accounts
) external
Allows one or more accounts, regardless of existing access.
Only callable by owner()
.
Parameters:
Name | Type | Description |
---|---|---|
accounts | address[] | Accounts to allow |
blockAccounts
function blockAccounts(
address[] accounts
) external
Blocks one or more accounts, regardless of existing access.
Only callable by owner()
.
Parameters:
Name | Type | Description |
---|---|---|
accounts | address[] | Accounts to block |
allowSelf
function allowSelf(
bytes32[] proof
) external
Allows the caller if the provided signature is valid.
An account cannot call this function if it is already allowed/blocked.
Parameters:
Name | Type | Description |
---|---|---|
proof | bytes32[] | Proof of the caller's inclusion in the merkle root |
getRoot
function getRoot(
) external returns (bytes32)
Returns the merkle root used to determine which accounts to allow.
isAccountAllowed
function isAccountAllowed(
) external returns (bool)
isAccountBlocked
function isAccountBlocked(
) external returns (bool)
Events
RootChanged
event RootChanged(
bytes32 root
)
Emitted via setRoot()
.
Parameters:
Name | Type | Description |
---|---|---|
root | bytes32 | The new merkle root |
AccountAllowed
event AccountAllowed(
address account
)
Emitted via allowAccounts()
and allowSelf
.
Parameters:
Name | Type | Description |
---|---|---|
account | address | The account that was allowed |
AccountBlocked
event AccountBlocked(
address account
)
Emitted via blockAccounts()
.
Parameters:
Name | Type | Description |
---|---|---|
account | address | The account that was blocked |
AllowedAccountsCleared
event AllowedAccountsCleared(
uint32 index
)
Emitted via setRoot()
and clearAllowedAccounts
,
and setRootAndClearAllowedAccounts
.
Parameters:
Name | Type | Description |
---|---|---|
index | uint32 | The index for the new allowlist |
BlockedAccountsCleared
event BlockedAccountsCleared(
uint32 index
)
Emitted via clearBlockedAccounts
.
Parameters:
Name | Type | Description |
---|---|---|
index | uint32 | The index for the new blocklist |