JSON Configuration¶
Configuration Properties¶
The TREX Token configuration JSON is composed by the following properties:
Info
?
marks an optional property.
General Properties¶
Property Key | Description and Usage | type | Example |
---|---|---|---|
name |
Name of the Token, (usually short, around 20 char max) to be displayed in various UIs. | string | "Super TREX Token" |
symbol |
Symbol of the Token, (usually 3 capital letters) to be displayed in various UIs. | string | "SPR" |
decimals |
Number of decimals for the token. | integer | 3 |
onchainID |
Address of the OnchainID smart contract for the security represented by the Token, optional. | address? | "0x0f73d7c42ee856854ac7373c9dbd12bcc7ae2b409cf6cfe382d2c16c89263983" |
rules |
Rules definition for this token, as defined below. | object | { "holderRules": {}, "complianceRules": {} } |
Rules Definition¶
The rules property is composed of two root properties: holderRules
to defined rules used to compute compliance of holder Identities (like required claims), and complianceRules
that applies to transfers of token (like maximal total supply).
Holder Rules¶
Holder Rules applies to holder Identities. They defined the requirements for an Identity to be declared as valid and eligible to receive tokens.
Property Key | Description and Usage | type | Example |
---|---|---|---|
requiredClaims |
A list of claim topics required for an Identity to be considered valid. Note that all topics declared here must be found in at least on trusted claim issuer. | Array |
[1010100300012, 1010100300012] |
trustedIssuers |
A set of trusted claim issuer contract addresses and the claims they are trusted for. | object | { "0x13f...": { "trustedTopics": [1010100300012] } } |
Instead of specifying a set of Holder Rules, you can explicitly specify the address of an already deployed
Identity Registry Contract with { "rules": { "identityRegistry": "0x61B87D9344b3597c2bDF5770A08d856B5C34e43c" } }
.
Or if you want to reuse only a Trusted Issuers Registry or a Claim Topics Registry:
{
"rules": {
"holderRules": {
"trustedIssuersRegistry": "0x61B87D9344b3597c2bDF5770A08d856B5C34e43c",
"claimTopicsRegistry": "0x61B87D9344b3597c2bDF5770A08d856B5C34e43c"
}
}
}
Compliance Rules¶
As in the latest version, the TREX configuration and management library doesn't support methods to manipulate Compliance contracts.
Instead of specifying a set of Compliance Rules, you can explicitly specify the address of an already deployed
Compliance Contract with { "rules": { "complianceContract": "0x61B87D9344b3597c2bDF5770A08d856B5C34e43c" } }
.
Example¶
Example JSON configuration
{
"name": "Super TREX Token",
"symbol": "SPR",
"decimals": 0,
"onchainID": "0x0f73d7c42ee856854ac7373c9dbd12bcc7ae2b409cf6cfe382d2c16c89263983",
"rules": {
"complianceRules": {},
"holderRules": {
"requiredClaims": [1010100300012, 1010100300034],
"trustedIssuers": {
"0xFCe50a6e140947961BCb8060b031453Eb3513D54": {
"trustedTopics": [1010100300012],
},
"0x40fA61cE2a4d593ca84B61874F9717E5335d48Da": {
"trustedTopics": [1010100300034],
}
}
}
}
}