Skip to main content

ExternalKycListManagement

Asset Tokenization Studio Team

ExternalKycListManagement

Abstract contract implementing external onlyOperational KYC list management logic for a security token. Maintains a list of trusted third-party KYC provider contracts whose combined KYC evaluation must be satisfied for an account to be considered externally KYC-granted.

Implements IExternalKycListManagement. The external onlyOperational KYC list is stored in diamond storage at STORAGE_LOCATION_KYC_MANAGEMENT via ExternalListManagementStorageWrapper. All mutating functions after initialisation are gated by ROLE_KYC_MANAGER and the onlyUnpaused modifier inherited from Modifiers. Intended to be inherited exclusively by ExternalKycListManagementFacet.

Methods​

addExternalKycList​

function addExternalKycList(address _kycLists) external nonpayable returns (bool success_)

Adds an external KYC list contract to the list.

Requires ROLE_KYC_MANAGER, the token to be unpaused, and a non-zero address. Reverts with ListedKycList if the address is already listed. Emits AddedToExternalKycLists.

Parameters​

NameTypeDescription
_kycListsaddressundefined

Returns​

NameTypeDescription
success_boolTrue if the contract was added successfully.

getExternalKycListsCount​

function getExternalKycListsCount() external view returns (uint256 externalKycListsCount_)

Returns the total number of external KYC list contracts in the list.

Returns​

NameTypeDescription
externalKycListsCount_uint256The current number of listed external KYC list contracts.

getExternalKycListsMembers​

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

Returns a paginated slice of the external KYC list contract 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 external KYC list contract addresses for the requested page.

initializeExternalKycLists​

function initializeExternalKycLists(address[] _kycLists) external nonpayable

One-time initialiser that populates the external KYC list at token deployment.

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

Parameters​

NameTypeDescription
_kycListsaddress[]Initial array of external KYC list contract addresses to register.

isExternalKycList​

function isExternalKycList(address _kycList) external view returns (bool)

Checks whether an address is present in the external KYC list.

Parameters​

NameTypeDescription
_kycListaddressAddress to check.

Returns​

NameTypeDescription
_0boolTrue if the address is a listed external KYC list contract, false otherwise.

isExternallyGranted​

function isExternallyGranted(address _account, enum IKyc.KycStatus _kycStatus) external view returns (bool)

Checks whether an account holds the requested KYC status across all listed external KYC list contracts.

Iterates every listed external KYC provider and calls getKycStatus. Returns true only when all providers confirm the exact _kycStatus for _account (AND semantics across providers). Returns true when no providers are listed.

Parameters​

NameTypeDescription
_accountaddressAddress of the account whose KYC status is being evaluated.
_kycStatusenum IKyc.KycStatusThe IKyc.KycStatus value that every provider must confirm.

Returns​

NameTypeDescription
_0boolTrue if all listed providers confirm _kycStatus for _account, false otherwise.

removeExternalKycList​

function removeExternalKycList(address _kycLists) external nonpayable returns (bool success_)

Removes an external KYC list contract from the list.

Requires ROLE_KYC_MANAGER and the token to be unpaused. Reverts with UnlistedKycList if the address is not listed. Emits RemovedFromExternalKycLists.

Parameters​

NameTypeDescription
_kycListsaddressundefined

Returns​

NameTypeDescription
success_boolTrue if the contract was removed successfully.

updateExternalKycLists​

function updateExternalKycLists(address[] _kycLists, bool[] _actives) external nonpayable returns (bool success_)

Adds or removes multiple external KYC list contracts in a single transaction.

Requires ROLE_KYC_MANAGER and the token to be unpaused. Both arrays must have the same length and contain no duplicate addresses, validated by ArrayValidation.checkUniqueValues. Emits ExternalKycListsUpdated.

Parameters​

NameTypeDescription
_kycListsaddress[]Array of external KYC list contract addresses to process.
_activesbool[]Corresponding flags; true adds the address to the list, false removes it.

Returns​

NameTypeDescription
success_boolTrue if the batch update completed successfully.

Events​

AddedToExternalKycLists​

event AddedToExternalKycLists(address indexed operator, address kycList)

Emitted when an external KYC list contract is added to the list.

Parameters​

NameTypeDescription
operator indexedaddressAddress of the caller who performed the addition.
kycListaddressAddress of the external KYC list contract that was added.

ExternalKycListInitialized​

event ExternalKycListInitialized(address[] kycLists)

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

Fires exclusively from initializeExternalKycLists after the storage write succeeds.

Parameters​

NameTypeDescription
kycListsaddress[]Initial array of external KYC list contract addresses registered.

ExternalKycListsUpdated​

event ExternalKycListsUpdated(address indexed operator, address[] kycLists, bool[] actives)

Emitted when multiple external KYC list addresses are added or removed in a single batch.

Parameters​

NameTypeDescription
operator indexedaddressAddress of the caller who performed the update.
kycListsaddress[]Array of external KYC list contract addresses that were processed.
activesbool[]Corresponding activation flags; true means added, false means removed.

RemovedFromExternalKycLists​

event RemovedFromExternalKycLists(address indexed operator, address kycList)

Emitted when an external KYC list contract is removed from the list.

Parameters​

NameTypeDescription
operator indexedaddressAddress of the caller who performed the removal.
kycListaddressAddress of the external KYC list contract 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.

ContradictoryValuesInArray​

error ContradictoryValuesInArray(uint256 lowerIndex, uint256 upperIndex)

Reverts when ordered array values contradict expected ordering.

Indicates that two indexed values cannot both satisfy the required monotonic or range invariant.

Parameters​

NameTypeDescription
lowerIndexuint256Lower array index involved in the contradiction.
upperIndexuint256Upper array index involved in the contradiction.

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).

ListedKycList​

error ListedKycList(address kycList)

Thrown when attempting to add an address already present in the external KYC list.

Parameters​

NameTypeDescription
kycListaddressThe duplicate external KYC list contract address.

MaxExternalListSizeReached​

error MaxExternalListSizeReached(uint256 max)

Reverts when adding an entry would grow an external list beyond its maximum size.

Enforced by ExternalListManagementStorageWrapper.addExternalList for the external pause, control and KYC lists. The bound exists because each list is iterated in full on the hot path of token operations, so an unbounded list could exceed the gas limit and brick the token.

Parameters​

NameTypeDescription
maxuint256Maximum number of entries permitted in the external list.

UnexpectedError​

error UnexpectedError(bytes4 _errorId)

Reverts when an unreachable validation state is detected.

Replaces assertions for defensive handling of logically impossible states.

Parameters​

NameTypeDescription
_errorIdbytes4Identifier of the unexpected validation condition.

UnlistedKycList​

error UnlistedKycList(address kycList)

Thrown when attempting to remove an address not present in the external KYC list.

Parameters​

NameTypeDescription
kycListaddressThe unlisted external KYC list contract address.

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.

ZeroAddressNotAllowed​

error ZeroAddressNotAllowed()

Reverts when the zero address is supplied where it is not permitted.

Prevents invalid account, contract, or recipient references.