diff --git a/ICRC-1.did b/ICRC-1.did index 801fa4ea..dfed4569 100644 --- a/ICRC-1.did +++ b/ICRC-1.did @@ -1,7 +1,7 @@ // Number of nanoseconds since the UNIX epoch in UTC timezone. type Timestamp = nat64; -// Number of nanoseconds between two [Timestamp]service +// Number of nanoseconds between two [Timestamp]s. type Duration = nat64; type Subaccount = blob; @@ -44,6 +44,7 @@ service : { icrc1_decimals : () -> (nat8) query; icrc1_fee : () -> (nat) query; icrc1_total_supply : () -> (nat) query; + icrc1_minting_account : () -> (opt Account) query; icrc1_balance_of : (Account) -> (nat) query; icrc1_transfer : (TransferArgs) -> (variant { Ok: nat; Err: TransferError; }); icrc1_supported_standards : () -> (vec record { name : text; url : text }) query; diff --git a/README.md b/README.md index ff749db2..26e2042b 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,20 @@ icrc1_metadata : () -> (vec record { text; Value }) query; ### icrc1_total_supply -Returns the total token supply. +Returns the total number of tokens on all accounts except for the [minting account](#minting_account). ```candid "Methods" += icrc1_total_supply : () -> (nat) query; ``` +### icrc1_minting_account + +Returns the [minting account](#minting_account) if this ledger supports minting and burning tokens. + +```candid "Methods" += +icrc1_minting_account : () -> (opt Account) query; +``` + ### icrc1_balance_of Returns the balance of the account given as argument. @@ -166,6 +174,23 @@ Namespace `icrc1` is reserved for keys defined in this standard. | `icrc1:decimals` | `variant { Nat = 8 }` | The number of decimals the token uses. For example, 8 means to divide the token amount by 108 to get its user representation. When present, should be the same as the result of the [`icrc1_decimals`](#decimals_method) query call. | | `icrc1:fee` | `variant { Nat = 10_000 }` | The default transfer fee. When present, should be the same as the result of the [`icrc1_fee`](#fee_method) query call. | +## Minting account + +The minting account is a unique account that can create new tokens and acts as the receiver of burnt tokens. + +Transfers _from_ the minting account act as _mint_ transactions depositing fresh tokens on the destination account. +Mint transactions have no fee. + +Transfers _to_ the minting account act as _burn_ transactions, removing tokens from the token supply. +Burn transactions have no fee but might have minimal burn amount requirements. +If the client tries to burn an amount that is too small, the ledger SHOULD reply with + +``` +variant { Err = variant { BadBurn = record { min_burn_amount = ... } } } +``` + +The minting account is also the receiver of the fees burnt in regular transfers. +