Skip to content

Commit bda4fd4

Browse files
authored
Merge pull request #7 from KiiChain/docs/improve-readme
Document usage flow
2 parents 8e6b2ae + 4951a05 commit bda4fd4

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,50 @@
66

77
This document outlines the detailed implementation plan for the T-REX (Token for Regulated EXchanges) protocol using CosmWasm smart contracts on Kii-Chain. The T-REX protocol is designed for compliant issuance and management of security tokens on blockchain networks.
88

9-
## Contracts and Their Methods
9+
## Contracts overview
10+
| Contract | Purpose | Connected with |
11+
| ------------------------------ | --------------------------------------------------------------------------------------------------- | ------------------------------------- |
12+
| CW_20 Base | Holds an asset as a CW_20 | Owner Roles, Compliance Registry |
13+
| Owner Roles | Registers owner and special permissions to addresses | - |
14+
| Compliance Registry | Stores compliance modules and verifies compliance on each of them | Compliance whitelist wrapper |
15+
| Compliance whitelist Wrapper | A wrapper for compliance modules that whitelists some addresses, ignoring them | Compliance country, Compliance Claims |
16+
| Compliance Country Restriction | A sample compliance contract that denies identities from specific countries | On Chain ID |
17+
| Compliance Claims | Compliance that denies usage of tokens from users that do not have claims for it | Claim topics, On Chain ID |
18+
| On Chain ID | Registers identities for users and allows granting management of certain aspects in their behalf | - |
19+
| Claim Topics | Stores address<>trust level used to block access to tokens, can only be changed by a trusted issuer | Trusted Issuers |
20+
| Trusted Issuer | Maps special addresses that can change claims | - |
21+
| Agent Roles | -- In the works -- | - |
22+
23+
## Action flows
24+
The relation between contracts is not super clear on the first moment, but they create a system where asset usage is limited to only those that were accepted by a trusted issuer. That trusted issuer can only accept users that decided to trust it in the first place.
25+
26+
### New asset
27+
With this flow we create a new asset. The asset will be limited to those that have the required claim trust level, which can only be added by the trusted issuer. The transfer of the asset will have the token pair as intermediate, which will be trusted for compliance on this specific token.
28+
29+
- Create a new `CW20 base`
30+
- Set up a token pair with liquidity of that Asset <> Kii
31+
- Add a link between this token and the wrapped compliance modules into the `compliance registry` (any number of them)
32+
- The wrap on a compliance module allows us to whitelist the token pair so it can do transfers without having an identity
33+
- This needs to be done by someone with compliance manager role
34+
- Add a claim need between this token and a level of trust on the `claim topics`.
35+
- This needs to be done by someone with claim manager role
36+
- Whitelist the token pair address on the `compliance whitelist wrappers` (one for each compliance module)
37+
- This needs to be done by someone with compliance manager role
38+
39+
### User registering
40+
For the user to be able to interact with assets, it needs to register an identity, state it trusts a common issuer and receive a specific trust level from the trusted issuer.
41+
42+
- User creates it's own identity on `On Chain ID` contract
43+
- User allows the trusted issuer to manage its claims, on `On chaind ID` contract
44+
- Trusted issuer emits a specific trust level for the user, on the `claim topics`
45+
46+
### First buy
47+
The buy will be done with a liquidity pool as a middleman, handling prices. The user needs to be registered beforehand and have a proper trust level issued so they can receive the asset.
48+
49+
- Buy token from liquidity pool
50+
- Do a transfer from the pool to the buyer, directly on the `cw20 base` of the T-REX
51+
52+
# Contracts and Their Methods
1053

1154
### 1. CW20 T-REX Token
1255

0 commit comments

Comments
 (0)