Skip to main content

Kyc

Asset Tokenization Studio Team

Kyc

Manages internal KYC records and exposes paginated KYC status queries.

Implements IKyc and delegates persistent state to KycStorageWrapper. Mutating operations require the token to be operational, activated and unpaused, except initialisation, which is restricted to an unregistered facet. Time-dependent status checks use TimeTravelStorageWrapper as the canonical timestamp source.

Methods​

activateInternalKyc​

function activateInternalKyc() external nonpayable returns (bool success_)

Activates internal KYC enforcement for the token.

Returns​

NameTypeDescription
success_boolTrue when the call succeeds without reverting.

deactivateInternalKyc​

function deactivateInternalKyc() external nonpayable returns (bool success_)

Deactivates internal KYC enforcement for the token.

Returns​

NameTypeDescription
success_boolTrue when the call succeeds without reverting.

getKycAccountsCount​

function getKycAccountsCount(enum IKyc.KycStatus _kycStatus) external view returns (uint256 kycAccountsCount_)

Returns the number of accounts with a given KYC status.

Parameters​

NameTypeDescription
_kycStatusenum IKyc.KycStatusThe status to filter by: GRANTED or NOT_GRANTED.

Returns​

NameTypeDescription
kycAccountsCount_uint256The count of accounts matching the given status.

getKycAccountsData​

function getKycAccountsData(enum IKyc.KycStatus _kycStatus, uint256 _pageIndex, uint256 _pageLength) external view returns (address[] accounts_, struct IKyc.KycData[] kycData_)

Returns a paginated list of accounts and their KYC data for a given KYC status.

Parameters​

NameTypeDescription
_kycStatusenum IKyc.KycStatusThe status to filter by: GRANTED or NOT_GRANTED.
_pageIndexuint256Zero-based page index; skips _pageIndex * _pageLength entries.
_pageLengthuint256Maximum number of entries to return per page.

Returns​

NameTypeDescription
accounts_address[]The accounts matching the given KYC status in the requested page.
kycData_IKyc.KycData[]The KYC data records corresponding to each account in accounts_.

getKycFor​

function getKycFor(address _account) external view returns (struct IKyc.KycData kyc_)

Returns all KYC metadata recorded for an account.

Parameters​

NameTypeDescription
_accountaddressThe account to query.

Returns​

NameTypeDescription
kyc_IKyc.KycDataThe full KycData struct for that account.

getKycStatusFor​

function getKycStatusFor(address _account) external view returns (enum IKyc.KycStatus kycStatus_)

Returns the current KYC status for an account.

Parameters​

NameTypeDescription
_accountaddressThe account to check.

Returns​

NameTypeDescription
kycStatus_enum IKyc.KycStatusGRANTED or NOT_GRANTED.

grantKyc​

function grantKyc(address _account, string _vcId, uint256 _validFrom, uint256 _validTo, address _issuer) external nonpayable returns (bool success_)

Grants KYC to an account with the supplied verifiable-credential metadata.

Parameters​

NameTypeDescription
_accountaddressUser whose KYC is being granted.
_vcIdstringVerifiable-credential identifier issued by the issuer.
_validFromuint256Start timestamp of the KYC validity period.
_validTouint256End timestamp of the KYC validity period.
_issueraddressAddress of the entity issuing the KYC.

Returns​

NameTypeDescription
success_boolTrue when the grant succeeds without reverting.

initializeInternalKyc​

function initializeInternalKyc(bool _internalKycActivated) external nonpayable

Initialises the internal KYC capability on the token.

Parameters​

NameTypeDescription
_internalKycActivatedboolundefined

isInternalKycActivated​

function isInternalKycActivated() external view returns (bool)

Returns whether internal KYC enforcement is currently active.

Returns​

NameTypeDescription
_0boolTrue if internal KYC is activated, false otherwise.

revokeKyc​

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

Revokes the KYC previously granted to an account.

Parameters​

NameTypeDescription
_accountaddressUser whose KYC is being revoked.

Returns​

NameTypeDescription
success_boolTrue when the revocation succeeds without reverting.

Events​

InternalKycStatusUpdated​

event InternalKycStatusUpdated(address indexed operator, bool activated)

Emitted when the internal KYC enforcement status is toggled.

Parameters​

NameTypeDescription
operator indexedaddressThe address that triggered the status update.
activatedboolThe new activation state of the internal KYC.

KycGranted​

event KycGranted(address indexed account, address indexed issuer)

Emitted when KYC is granted to an account.

Parameters​

NameTypeDescription
account indexedaddressThe address for which the KYC is granted.
issuer indexedaddressThe address of the issuer of the KYC.

KycInitialized​

event KycInitialized(bool internalKycActivated)

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

Fires exclusively from initializeInternalKyc after the storage write succeeds.

Parameters​

NameTypeDescription
internalKycActivatedboolWhether internal KYC enforcement was enabled at initialisation.

KycRevoked​

event KycRevoked(address indexed account, address indexed issuer)

Emitted when KYC is revoked from an account.

Parameters​

NameTypeDescription
account indexedaddressThe address for which the KYC is revoked.
issuer indexedaddressThe address of the issuer revoking the KYC.

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.

AccountIsNotIssuer​

error AccountIsNotIssuer(address issuer)

Thrown when an address is required to be a listed issuer but is not.

Parameters​

NameTypeDescription
issueraddressThe address that failed the issuer membership check.

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.

InvalidDates​

error InvalidDates()

Reverts when a date set is invalid.

Used when the failing date constraint does not require exposing values.

InvalidKycStatus​

error InvalidKycStatus()

InvalidZeroAddress​

error InvalidZeroAddress()

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

KycIsNotGranted​

error KycIsNotGranted()

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.