Skip to main content

4.3 Deployment

A token is deployed using the following format:

{ 
"p": "n20",
"op": "deploy",
"tick": "note",
"max": "21000000",
"lim": "1000",
"sch": "9fd761f.... ....0a28"
... ...
}
KeyRequired?Description
pYesProtocol name, n20, lowercase
opYesOperation name, deploy, lowercase
tickYesToken name, maximum 12 characters, case-insensitive, cannot be deployed if a token with the same name already exists
maxYesBigint, the maximum supply, unlimited if set to 0, checked by the contract
limYesBigint, the amount per mining, unlimited if set to 0, checked by the contract
decYesInt, number of decimal places, default value is 8
schNoJSON code hash of the smart contract
codeNoJSON code of the smart contract
...NoOther, 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.