> For the complete documentation index, see [llms.txt](https://docs.kinto.xyz/kinto-the-modular-exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kinto.xyz/kinto-the-modular-exchange/building-on-kinto/smart-contract-reference/kintoid.md).

# KintoID

**Deployment Address:**

Mainnet: [<mark style="color:purple;">0xf369f78E3A0492CC4e96a90dae0728A38498e9c7</mark>](https://explorer.kinto.xyz/address/0xf369f78E3A0492CC4e96a90dae0728A38498e9c7)

Interface: [<mark style="color:purple;">IKintoId.sol</mark>](https://github.com/KintoXYZ/kinto-id/tree/main/src/interfaces)

***

## Basics

The easiest way to check an account is to use the `isKYC` method. It checks a given address, making sure it has a valid KYC. It has been audited recently for AML sanctions, and it has none.

For example, if you want to check whether a specific address verifies all these properties, you can call:

```
isKYC(<ADDRESS>)
```

### Trait IDs

Every user has a trait that identifies its country of origin using the ISO-32166. For example, if an individual is a citizen of the USA, the trait with ID 840 will be set.\
\
The following traits will be used to verify additional flags on a user identity.

| Name                 | Number |
| -------------------- | ------ |
| KINTO\_ADMIN\_WALLET | 0      |
| US\_ACCREDITATION    | 1      |
| USA                  | 840    |
| ...                  | ...    |

Using the following call method, you can quickly check if a user has any trait. For example, if you want to check whether a specific address is an accredited investor in the US, you can use:

```
hasTrait(<ADDRESS>, 1)
```

### Sanction IDs

The numerical country code will key the sanction IDs according to [<mark style="color:purple;">https://en.wikipedia.org/wiki/ISO\_3166-1\_numeric</mark>](https://en.wikipedia.org/wiki/ISO_3166-1_numeric).

{% hint style="info" %}
Kinto will use the country code 1 for network related incidents including hacks, stolen and duplicate identity.
{% endhint %}

For example, to check whether a user has any sanctions in the US:

```
isSanctionsSafeIn(<ADDRESS>, 840);
```

### State Functions

Privileged roles can call the following functions.

```

function mintIndividualKyc(SignatureData calldata _signatureData, uint16[] memory _traits) external;

function mintCompanyKyc(SignatureData calldata _signatureData, uint16[] memory _traits) external;

function burnKYC(SignatureData calldata _signatureData) external;

function addTrait(address _account, uint16 _traitId) external;

function removeTrait(address _account, uint16 _traitId) external;

function addSanction(address _account, uint16 _countryId) external;

function removeSanction(address _account, uint16 _countryId) external;

function monitor(address[] memory _accounts, MonitorUpdateData[][] memory _traitsAndSanctions) external;

```

**1. mintIndividualKyc**

This function mints a KYC token for an individual with specific traits. Only KYC providers are allowed to call this function.

```solidity
function mintIndividualKyc(SignatureData calldata _signatureData, uint8[] memory _traits) external;
```

| Parameter       | Type                   | Explanation                                           |
| --------------- | ---------------------- | ----------------------------------------------------- |
| \_signatureData | SignatureData calldata | Contains the signature data for minting the KYC token |
| \_traits        | uint16\[] memory       | The array of trait IDs for the individual             |

***

**2. mintCompanyKyc**

This function mints a KYC token for a company with specific traits. Only KYC providers are allowed to call this function.

```solidity
function mintCompanyKyc(SignatureData calldata _signatureData, uint16[] memory _traits) external;
```

| Parameter       | Type                   | Explanation                                           |
| --------------- | ---------------------- | ----------------------------------------------------- |
| \_signatureData | SignatureData calldata | Contains the signature data for minting the KYC token |
| \_traits        | uint16\[] memory       | The array of trait IDs for the company                |

***

**3. burnKYC**

This function burns a KYC token. Only KYC providers are allowed to call this function.

```solidity
function burnKYC(SignatureData calldata _signatureData) external;
```

| Parameter       | Type                   | Explanation                             |
| --------------- | ---------------------- | --------------------------------------- |
| \_signatureData | SignatureData calldata | Contains the signature data for burning |

***

***

**4. addTrait**

This function adds a trait to a given account. Only KYC providers are allowed to call this function.

```solidity
function addTrait(address _account, uint16 _traitId) external;
```

| Parameter | Type    | Explanation            |
| --------- | ------- | ---------------------- |
| \_account | address | The account address    |
| \_traitId | uint16  | ID of the trait to add |

***

**5. removeTrait**

This function removes a trait from a given account. Only KYC providers are allowed to call this function.

```solidity
function removeTrait(address _account, uint16 _traitId) external;
```

| Parameter | Type    | Explanation               |
| --------- | ------- | ------------------------- |
| \_account | address | The account address       |
| \_traitId | uint16  | ID of the trait to remove |

***

**6. addSanction**

This function adds a sanction to a given account. Only KYC providers are allowed to call this function.

```solidity
function addSanction(address _account, uint16 _countryId) external;
```

| Parameter   | Type    | Explanation                   |
| ----------- | ------- | ----------------------------- |
| \_account   | address | The account address           |
| \_countryId | uint16  | ID of the country to sanction |

***

**7. removeSanction**

This function removes a sanction from a given account.

Only KYC providers are allowed to call this function.

```solidity
function removeSanction(address _account, uint16 _countryId) external;
```

| Parameter   | Type    | Explanation                          |
| ----------- | ------- | ------------------------------------ |
| \_account   | address | The account address                  |
| \_countryId | uint8   | ID of the country to remove sanction |

***

**8. monitor**

This function monitors an array of accounts and updates their traits and sanctions. Only KYC providers are allowed to call this function.

```solidity
function monitor(address[] memory _accounts, MonitorUpdateData[][] memory _traitsAndSanctions) external;
```

| Parameter            | Type                           | Explanation                           |
| -------------------- | ------------------------------ | ------------------------------------- |
| \_accounts           | address\[] memory              | Array of account addresses            |
| \_traitsAndSanctions | MonitorUpdateData\[]\[] memory | Array of traits and sanctions updates |

***

### **View Functions**

Anyone can call the following functions without a transaction to retrieve information from the contract.

```
function name() external pure returns (string memory);

function symbol() external pure returns (string memory);

function isKYC(address _account) external view returns (bool);

function isSanctionsMonitored(uint32 _days) external view returns (bool);

function isSanctionsSafe(address _account) external view returns (bool);

function isSanctionsSafeIn(address _account, uint16 _countryId) external view returns (bool);

function isCompany(address _account) external view returns (bool);

function isIndividual(address _account) external view returns (bool);

function mintedAt(address _account) external view returns (uint256);

function hasTrait(address _account, uint16 index) external view returns (bool);

function traits(address _account) external view returns (bool[] memory);

function supportsInterface(bytes4 interfaceId);
```

**1. isKYC**

This function checks whether a given account is KYC'd by checking the balance of KYC tokens.

```solidity
function isKYC(address _account) external view override returns (bool);
```

| Parameter | Type    | Explanation          |
| --------- | ------- | -------------------- |
| \_account | address | The address to check |

**2. isSanctionsMonitored**

This function checks whether the account has been monitored for sanctions in the last X days.

```solidity
function isSanctionsMonitored(uint32 _days) public view override returns(bool);
```

| Parameter | Type   | Explanation             |
| --------- | ------ | ----------------------- |
| \_days    | uint32 | Number of days to check |

***

**3. isSanctionsSafe**

This function checks whether a given account is safe from sanctions.

```solidity
function isSanctionsSafe(address _account) public view override returns (bool);
```

| Parameter | Type    | Explanation         |
| --------- | ------- | ------------------- |
| \_account | address | The account address |

***

**4. isSanctionsSafeIn**

This function checks whether a given account is safe from sanctions in a specific country.

```solidity
function isSanctionsSafeIn(address _account, uint16 _countryId) external view override returns (bool);
```

| Parameter   | Type    | Explanation         |
| ----------- | ------- | ------------------- |
| \_account   | address | The account address |
| \_countryId | uint16  | The country ID      |

***

**5. isCompany**

This function checks whether a given account is a company.

```solidity
function isCompany(address _account) external view override returns (bool);
```

| Parameter | Type    | Explanation         |
| --------- | ------- | ------------------- |
| \_account | address | The account address |

***

**6. isIndividual**

This function checks whether a given account is an individual.

```solidity
function isIndividual(address _account) external view override returns (bool);
```

| Parameter | Type    | Explanation         |
| --------- | ------- | ------------------- |
| \_account | address | The account address |

***

**7. mintedAt**

This function returns the timestamp when the KYC token was minted for a given account.

```solidity
function mintedAt(address _account) external view override returns (uint256);
```

| Parameter | Type    | Explanation         |
| --------- | ------- | ------------------- |
| \_account | address | The account address |

***

**8. hasTrait**

This function checks whether a given account has a specific trait.

```solidity
function hasTrait(address _account, uint16 index) external view override returns (bool);
```

| Parameter | Type    | Explanation                 |
| --------- | ------- | --------------------------- |
| \_account | address | The account address         |
| index     | uint16  | Index of the trait to check |

***

**9. traits**

This function returns an array of booleans representing the traits of the account.

```solidity
function traits(address _account) external view override returns (bool[] memory);
```

| Parameter | Type    | Explanation         |
| --------- | ------- | ------------------- |
| \_account | address | The account address |

**10. supportsInterface**

Returns whether the contract implements the interface defined by the id

```solidity
function supportsInterface(bytes4 interfaceId);
```

| Parameter   | Type   | Explanation                       |
| ----------- | ------ | --------------------------------- |
| interfaceId | bytes4 | id of the interface to be checked |
