Skip to main content

ControlListFacet

Asset Tokenization Studio Team

ControlListFacet

Diamond facet that exposes control list management operations — initialisation, member add/remove, membership and type queries, and pagination — as selectable proxy functions.

Inherits ControlList for the business logic and implements IStaticFunctionSelectors for the Diamond resolver pattern. The resolver key RESOLVER_KEY_CONTROL_LIST identifies this facet within the diamond proxy.

Methods​

addToControlList​

function addToControlList(address _account) external nonpayable returns (bool success_)

Adds an address to the control list.

Requires ROLE_CONTROL_LIST and the token to be unpaused. Reverts with ListedAccount if the address is already present. Emits AddedToControlList.

Parameters​

NameTypeDescription
_accountaddressThe address to add.

Returns​

NameTypeDescription
success_boolTrue if the address was successfully added.

getControlListCount​

function getControlListCount() external view returns (uint256 controlListCount_)

Returns the total number of addresses currently in the control list.

Returns​

NameTypeDescription
controlListCount_uint256The number of entries in the control list.

getControlListMembers​

function getControlListMembers(uint256 _pageIndex, uint256 _pageLength) external view returns (address[] members_)

Returns a paginated slice of the addresses in the control list.

_The list offset is computed as \_pageIndex _ \_pageLength. Returns an empty array when the offset meets or exceeds the list length.*

Parameters​

NameTypeDescription
_pageIndexuint256Zero-based page index.
_pageLengthuint256Maximum number of addresses to return per page.

Returns​

NameTypeDescription
members_address[]Array of control list member addresses for the requested page.

getControlListType​

function getControlListType() external view returns (bool)

Returns the operating mode of the control list.

Returns​

NameTypeDescription
_0boolTrue if the control list is a whitelist, false if it is a blacklist.

getStaticFunctionSelectors​

function getStaticFunctionSelectors() external pure returns (bytes4[])

Gets all function selectors of a facet

Returns​

NameTypeDescription
_0bytes4[]Face functions selectors

getStaticInterfaceIds​

function getStaticInterfaceIds() external pure returns (bytes4[])

Gets all interfaces ids of a facet.

Returns​

NameTypeDescription
_0bytes4[]Face interface ids

getStaticResolverKey​

function getStaticResolverKey() external pure returns (bytes32 staticResolverKey_)

Gets the static resolver key

Returns​

NameTypeDescription
staticResolverKey_bytes32Static resolver key

initializeControlList​

function initializeControlList(bool _isWhiteList) external nonpayable

One-time initialiser that sets the control list operating mode.

Can only be called once; subsequent calls revert via onlyFacetNotRegistered. The leading-underscore naming convention signals this is an initialiser function.

Parameters​

NameTypeDescription
_isWhiteListbooltrue to operate as a whitelist (only listed addresses allowed), false to operate as a blacklist (listed addresses blocked).

isInControlList​

function isInControlList(address _account) external view returns (bool)

Checks whether an address is present in the control list set.

Returns raw set membership regardless of the whitelist/blacklist mode. An address in the set is allowed in whitelist mode and blocked in blacklist mode.

Parameters​

NameTypeDescription
_accountaddressThe address to query.

Returns​

NameTypeDescription
_0boolTrue if _account is in the control list set, false otherwise.

removeFromControlList​

function removeFromControlList(address _account) external nonpayable returns (bool success_)

Removes an address from the control list.

Requires ROLE_CONTROL_LIST and the token to be unpaused. Reverts with UnlistedAccount if the address is not present. Emits RemovedFromControlList.

Parameters​

NameTypeDescription
_accountaddressThe address to remove.

Returns​

NameTypeDescription
success_boolTrue if the address was successfully removed.

Events​

AddedToControlList​

event AddedToControlList(address indexed operator, address indexed account)

Emitted when an account is added to the control list.

Parameters​

NameTypeDescription
operator indexedaddressAddress of the caller who performed the addition.
account indexedaddressAddress of the account that was added.

ControlListInitialized​

event ControlListInitialized(bool isWhiteList)

Emitted once when the control list capability is initialised on a token.

Fires exclusively from initializeControlList after the storage write succeeds.

Parameters​

NameTypeDescription
isWhiteListboolWhether the control list operates in whitelist mode.

RemovedFromControlList​

event RemovedFromControlList(address indexed operator, address indexed account)

Emitted when an account is removed from the control list.

Parameters​

NameTypeDescription
operator indexedaddressAddress of the caller who performed the removal.
account indexedaddressAddress of the account that was removed.

Errors​

AccountHasNoRole​

error AccountHasNoRole(address account, bytes32 role)

Thrown when an account does not hold a required role.

Parameters​

NameTypeDescription
accountaddressThe account that lacks the role.
rolebytes32The role that is not held.

AssetNotOperational​

error AssetNotOperational(bytes32 configId, uint256 versionId)

Raised by InitializerStorageWrapper.checkOperational (and the related isConfigVersionOperational helper) when an operation is attempted on a configuration version that has not yet been marked operational.

Parameters​

NameTypeDescription
configIdbytes32Resolver-proxy configuration whose operational status was checked.
versionIduint256Configuration version whose operational status was checked.

Deactivated​

error Deactivated()

Thrown when an operation guarded by onlyActivated is attempted on a token whose deactivation flag has already been set.

FacetAlreadyRegistered​

error FacetAlreadyRegistered(bytes32 facetId, uint256 lastVersion)

Raised when an initialiser tries to register a facet that already has a non-zero last registered version (i.e. the facet is being re-initialised on a fresh install).

Parameters​

NameTypeDescription
facetIdbytes32Identifier of the offending facet.
lastVersionuint256Last version recorded for that facet at the time of the check.

IsPaused​

error IsPaused()

Thrown when an operation that requires the token to be unpaused is attempted while the token is paused (own flag or any external pause contract).

ListedAccount​

error ListedAccount(address account)

Thrown when attempting to add an address that is already present in the control list.

Parameters​

NameTypeDescription
accountaddressThe duplicate address.

UnlistedAccount​

error UnlistedAccount(address account)

Thrown when attempting to remove an address that is not present in the control list.

Parameters​

NameTypeDescription
accountaddressThe address that was not found.

UnrecognizedResolverProxyVersion​

error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)

Thrown when the provided proxy version does not match any BLR compatible standard.

Parameters​

NameTypeDescription
_resolverProxyVersionbytes8proxy version that is not compatible with the BLR.

WalletRecovered​

error WalletRecovered()

Thrown when attempting to recover a wallet that has already been recovered.