Skip to main content

IControlList

Asset Tokenization Studio Team

IControlList

Interface for managing the on-chain control list of a security token. The control list operates in one of two modes set at initialisation: whitelist (only listed addresses may transfer) or blacklist (listed addresses are blocked from transferring).

Part of the Diamond facet system. Control list state is stored at STORAGE_LOCATION_CONTROL_LIST via ControlListStorageWrapper. ROLE_CONTROL_LIST is required for all state-mutating functions after initialisation. Note that isInControlList reflects raw set membership only; effective access is determined by ControlListStorageWrapper.canAccess, which combines the membership result with the isWhiteList flag and external control list authorisation.

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.

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​

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.