Skip to main content

IKyc

Hashgraph

IKyc Interface

Interface for KYC (Know Your Customer) management operations

Defines standard functions for granting, revoking, and checking KYC status

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 _activateInternalKyc) external nonpayable

Initialises the internal KYC capability on the token.

Parameters​

NameTypeDescription
_activateInternalKycboolWhether to enable internal KYC enforcement immediately.

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​

InvalidKycStatus​

error InvalidKycStatus()

InvalidZeroAddress​

error InvalidZeroAddress()

KycIsNotGranted​

error KycIsNotGranted()