Operations
Designed to be flexible and adaptable to various use cases
Operations of ORC-20 comprise the basic operations including deploy, mint, transfer, burn, upgrade, and custom operations. You can add new keys to the standard operations to introduce constraints, various behaviours, or new operations.
Each operation is inscription data with key-value pair, by default in JSON format. Operation keys must be lowercase and values data are case-insensitive.
Operations definition
Deploy
p
Yes
“orc-20”
Protocol: help other systems identify and process ORC-20 operations.
op
Yes
“deploy”
Operation: type of operation
params
tick
Yes
Ticker: the symbol for the ORC-20, with a character length not restricted but not exceeding 255 characters. The TID (Token ID) serves as the unique identifier differentiating between tokens.
params
max
Yes
Max supply: set max supply of the orc-20, max value of the numeric field is unit64_max.
params
lim
No
Mint limit: max amount can be minted per inscription, the value cannot exceed the specified maximum limit.
params
dec
No
Decimals: set decimal precision, default to 18, an integer within the range of 0 to 18.
params
ug
No
[“true”, ”false”]
Upgradable: whether deployer is allowed to upgrade token information, true or false, default as false.
params
mp
No
[“true”, ”false”]
Mint Protected: whether only deployer is allowed to mint, true or false, default as false.
params
tid
No
inscription ID
Token ID: identifier of the ORC-20, the inscription ID where the token was deployed. This field is unnecessary during deployment and, if provided, will be considered invalid. It should be determined by the actual inscription number.
Example:
The tick of ORC-20 is not restricted in character length (with a maximum of 255 characters). Additionally, ticks between tokens are allowed to be duplicated, with the tick serving as the unique identifier for tokens through the TID field.
The inscription ID, deployed during the inscription of the token, functions as the unique identifier for each token. It is imperative to include this ID in subsequent operations related to the token. Please refrain from including this field during deployment, and even if included, it will be deemed invalid. The actual inscription ID should be the primary reference.
The ug field defaults as false, it is not upgradeable by default. If you need to upgrade, proactively set this field to true during deployment.
The mp field defaults as false, indicating that anyone can mint. If set to true, only the deployer of the token has the authority to mint. (This is a crucial feature, especially for issuers of stablecoins.)
Upgrade
p
Yes
“orc-20”
Protocol: help other systems identify and process ORC-20 operations.
op
Yes
“upgrade”
Operation: type of operation
params
tick
Yes
Ticker: symbol of the ORC-20
params
tid
Yes
Token ID: identifier of the ORC-20, the inscription ID where the token is deployed.
params
max
No
Max supply: increase max supply of the ORC-20.
params
lim
No
Limit: max amount can be minted per inscription, the value cannot exceed the specified maximum limit.
params
ug
No
[“true”, ”false”]
Upgradable: whether deployer is allowed to upgrade token information, true or false, default as true.
params
mp
No
[“true”, ”false”]
Mint Protected: whether only deployer is allowed to mint, true or false, default as false
Example:
The 'tick' and 'tid' fields are mandatory which are used to specify the token you intend to upgrade.
The 'max', 'lim', 'ug' and 'mp' fields are upgradeable, while other fields are not allowed to be upgraded. Although not mandatory, at least one of these four fields must be included in each upgrade.
The 'max' field can only increase or remain unchanged; it cannot decrease.
After the inscription is minted, it does not take effect immediately. It requires a transfer of the inscription to become effective, and concurrently, the inscription itself becomes inactive.
Transferring the inscription is a necessary step for asserting ownership, confirming that the upgrade event is initiated by the wallet owner. This is because anyone can mint the inscription on your behalf, but only you have the authority to transfer it.
Mint
p
Yes
“orc-20”
Protocol: help other systems identify and process ORC-20 operations.
op
Yes
“mint”
Operation: type of operation
params
tick
Yes
Ticker: symbol of the ORC-20
params
tid
Yes
Token ID: identifier of the ORC-20, the inscription ID where the token is deployed.
params
amt
Yes
Amount to mint: it states the amount of the ORC-20 to mint. It needs to be less than or equal to "lim".
Example:
If the user's minted amount exceeds the remaining mintable quantity of the token, the inscription becomes invalid.
Burn
p
Yes
“orc-20”
Protocol: help other systems identify and process ORC-20 operations.
op
Yes
“burn”
Operation: type of operation
params
tick
Yes
Ticker: symbol of the ORC-20
params
tid
Yes
Token ID: identifier of the ORC-20, the inscription ID where the token is deployed.
params
amt
Yes
Amount to burn: it states the amount of the ORC-20 to burn.
Example:
After the inscription is minted, it does not take effect immediately. It requires a single transfer of the inscription to become effective, and simultaneously, the inscription itself becomes inactive.
During the transfer of the inscription, the 'amt' value should be less than or equal to the user's
available balance
. If the 'amt' value exceeds the user's balance, the operation becomes invalid, and the inscription becomes inactive.
Transfer
p
Yes
“orc-20”
Protocol: help other systems identify and process ORC-20 operations.
op
Yes
“transfer”
Operation: type of operation
params
tick
Yes
Ticker: symbol of the ORC-20
params
tid
Yes
Token ID: identifier of the ORC-20, the inscription ID where the token is deployed.
params
amt
Yes
Amount to transfer: it states the amount of the ORC-20 to transfer.
Example:
The 'amt' value should be less than or equal to the user's
available balance
. If the 'amt' value exceeds the user's balance, the inscription becomes invalid.After the inscription is minted through a transfer, the corresponding balance of the user transitions from
available balance
totransferable balance
.If the user transfers the inscription, the user's ORC-20 tokens will also be transferred. The sender's transferable balance decreases, total balance decreases, the receiver's available balance increases, and total balance increases. Simultaneously, the inscription becomes inactive.
If a transfer is sent as fee in its first transfer, its amount must be returned to the sender immediately (instead of after all events in the block).
Last updated