4.3 Deployment
A token is deployed using the following format:
{
"p": "n20",
"op": "deploy",
"tick": "note",
"max": "21000000",
"lim": "1000",
"sch": "9fd761f.... ....0a28"
... ...
}
Key | Required? | Description |
---|---|---|
p | Yes | Protocol name, n20, lowercase |
op | Yes | Operation name, deploy, lowercase |
tick | Yes | Token name, maximum 12 characters, case-insensitive, cannot be deployed if a token with the same name already exists |
max | Yes | Bigint, the maximum supply, unlimited if set to 0, checked by the contract |
lim | Yes | Bigint, the amount per mining, unlimited if set to 0, checked by the contract |
dec | Yes | Int, number of decimal places, default value is 8 |
sch | No | JSON code hash of the smart contract |
code | No | JSON code of the smart contract |
... | No | Other, environment constants required by functions (Mint, Transfer, etc.) during smart contract execution |
The token name rules for tick are as follows: it must be 3 to 12 ASCII characters, allowing two special characters #
and -
, no spaces allowed, no Unicode
, and it cannot match the following reserved word rules (including case sensitivity):
/^long$/,
/^lilong/,
/^n20$/,
/^alias$/,
/^n721$/,
/^aaa$/,
/^ggg$/,
/^wallet$/,
/^wallet3$/,
/^notesv/,
/^note.sv/,
/^cercle$/,
/^css$/,
/^BTC$/,
/^BSV$/,
/^BCH$/,
/^ETH$/,
/^USD$/,
/^JPY$/,
/^EUR$/,
/^CHAINBOW/,
The indexer loads the smart contract using 'sch' or 'code' for operation validation. Only operations that pass validation are recorded by the indexer. If neither 'sch' nor 'code' is provided, no validation is performed.