Skip to main content

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:​

NameTypeDescription
newRootbytes32The 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:​

NameTypeDescription
newRootbytes32The 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:​

NameTypeDescription
accountsaddress[]Accounts to allow

blockAccounts​

  function blockAccounts(
address[] accounts
) external

Blocks one or more accounts, regardless of existing access.

Only callable by owner().

Parameters:​

NameTypeDescription
accountsaddress[]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:​

NameTypeDescription
proofbytes32[]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:​

NameTypeDescription
rootbytes32The new merkle root

AccountAllowed​

  event AccountAllowed(
address account
)

Emitted via allowAccounts() and allowSelf.

Parameters:​

NameTypeDescription
accountaddressThe account that was allowed

AccountBlocked​

  event AccountBlocked(
address account
)

Emitted via blockAccounts().

Parameters:​

NameTypeDescription
accountaddressThe account that was blocked

AllowedAccountsCleared​

  event AllowedAccountsCleared(
uint32 index
)

Emitted via setRoot() and clearAllowedAccounts, and setRootAndClearAllowedAccounts.

Parameters:​

NameTypeDescription
indexuint32The index for the new allowlist

BlockedAccountsCleared​

  event BlockedAccountsCleared(
uint32 index
)

Emitted via clearBlockedAccounts.

Parameters:​

NameTypeDescription
indexuint32The index for the new blocklist