NativeShieldedToken API
This module provides the full NativeShieldedToken module API: the two token flavors, their shared core, the supply and derived-nonce extensions, and the owner-gated preset.
For an overview of the modules, read the NativeShieldedToken guide.
The page covers the following modules:
- Token modules
- NativeShieldedToken: a single token type issued and burned by the contract.
- NativeShieldedTokenFamily: many token types, keyed by domain, under one contract.
- NativeShieldedTokenCore: the shared core behind the two flavors; not composed directly.
- Extensions
- NativeShieldedTokenPublicSupply: on-chain minted and burned totals for a
NativeShieldedToken. - NativeShieldedTokenFamilyPublicSupply: per-domain on-chain totals for a
NativeShieldedTokenFamily. - NativeShieldedTokenPublicSupplyCore: the shared core behind the two supply extensions; not composed directly.
- NativeShieldedTokenDerivedNonce: mint coin nonces derived from a counter.
- NativeShieldedTokenPublicSupply: on-chain minted and burned totals for a
- Preset
- ZOwnableNativeShieldedToken: a single token whose
ZOwnablePKowner mints and burns, with a public minted total.
- ZOwnableNativeShieldedToken: a single token whose
These modules export no structs or enums of their own. Coins are the standard library's ShieldedCoinInfo
(a nonce, color, and value) and QualifiedShieldedCoinInfo (the same plus the Merkle-tree index mt_index
of a coin the contract holds).
import "./node_modules/@openzeppelin/compact-contracts/token/NativeShieldedToken";Ledger
_domain: Bytes<32>
sealed ledger
#Domain separator fixed at construction; with the contract address it determines this token's color.
_name: Opaque<"string">
sealed ledger
#The immutable token name. Re-exported from NativeShieldedTokenCore.
_symbol: Opaque<"string">
sealed ledger
#The immutable token symbol. Re-exported from NativeShieldedTokenCore.
_decimals: Uint<8>
sealed ledger
#The immutable token decimals. Re-exported from NativeShieldedTokenCore.
_isInitialized: Boolean
ledger
#Initialization flag, tracked per-module to avoid the compiler's shared transitive-dependency state bug (LFDT-Minokawa/compact#270). See the Initializable module for rationale.
Witnesses
None.
Circuits
initialize(
domainSep: Bytes<32>,
name_: Opaque<"string">,
symbol_: Opaque<"string">,
decimals_: Uint<8>
) → []circuit
#Initializes the module's domain and metadata. This MUST be called in the implementing contract's constructor, and it MUST be the only token operation performed there. Failure to call it can lead to an irreparable contract; perform mint, burn, and tokenColor only in post-deployment circuits, never in the constructor.
isInitialized() → Boolean
circuit
#Returns whether the contract has been initialized.
name() → Opaque<"string">
circuit
#Returns the token name.
Requirements:
- Contract is initialized.
symbol() → Opaque<"string">
circuit
#Returns the symbol of the token.
Requirements:
- Contract is initialized.
decimals() → Uint<8>
circuit
#Returns the number of decimals used to get its user representation.
Requirements:
- Contract is initialized.
tokenColor() → Bytes<32>
circuit
#Returns this token's coin color:
tokenType(_domain, kernel.self()), computed at call time.
Requirements:
- Contract is initialized.
_mint(
recipient: ZswapCoinPublicKey,
amount: Uint<64>,
nonce: Bytes<32>
) → ShieldedCoinInfocircuit
#Mints amount of the token to recipient, using a
caller-supplied nonce.
The caller is fully responsible for nonce uniqueness. Reusing a
nonce for the same (value, recipient) produces a duplicate commitment,
which the protocol rejects. With a secret random nonce this is the
recipient-private mint. For mints that require no caller-managed nonce,
compose the NativeShieldedTokenDerivedNonce extension and pass its
_deriveNonce() output.
The returned coin info is the only copy available to the recipient; callers SHOULD deliver it out of band. Wallets cannot detect contract-minted coins by scanning the chain.
Requirements:
- Contract is initialized.
recipientis not zero.
_mintToSelf(amount: Uint<64>, nonce: Bytes<32>) → ShieldedCoinInfo
circuit
#Mints amount to this contract itself, claiming the coin in
the same call. Forwards to NativeShieldedTokenCore._mint with
right(kernel.self()).
Nonce uniqueness is the caller's responsibility, as in _mint. Spend
the coin later with _burnFromSelf, once it carries an mt_index.
The consumer SHOULD persist the returned coin info in its own
ledger state: it is the contract's holding and is not otherwise
recoverable. The coin is already claimed as a receive by the mint, so a
custody module must record it without calling receiveShielded on it
again. ShieldedTreasury._deposit claims on the way in and is not that path;
a record-only circuit is tracked in compact-contracts#1112. Until a
custody module is composed, the only spend of a contract-held coin is
_burnFromSelf.
Requirements:
- Contract is initialized.
_burn(
coin: ShieldedCoinInfo,
amount: Uint<128>,
refundTo: ZswapCoinPublicKey
) → Maybe<ShieldedCoinInfo>circuit
#Burns amount from coin, a coin provided within the
current transaction (e.g. paid in by the caller's wallet), and routes the
remaining change to refundTo.
To destroy coin in full, pass coin.value as amount; the change
branch will not fire and none is returned. The refundTo value is
inert in that case but must still be supplied and non-zero.
The coin is received by the contract and spent in the same
transaction, so the spend goes through sendImmediateShielded (the
transient path). For coins the contract already holds, use
_burnFromSelf instead.
The returned refund coin info is the only copy available to
refundTo; callers SHOULD deliver it out of band. Wallets cannot detect
contract-sent coins by scanning the chain.
Requirements:
- Contract is initialized.
coin.coloris this contract's token color.amountis less than or equal tocoin.value.refundTois not zero (the zero key is the burn address; a zerorefundTowould silently burn the change as well).
_burnFromSelf(coin: QualifiedShieldedCoinInfo, amount: Uint<128>) → Maybe<ShieldedCoinInfo>
circuit
#Burns amount from coin, a coin this contract already
holds (a Merkle-tree entry with a valid mt_index). Any change is
auto-received by the contract and returned.
The consumer SHOULD persist the returned change coin info in its own
ledger state: the change replaces coin as the contract's holding, and
its info is not otherwise recoverable. Like a _mintToSelf coin, the
change is already claimed as a receive, so a custody module must record
it without a second receiveShielded.
Requirements:
- Contract is initialized.
coin.coloris this contract's token color.amountis less than or equal tocoin.value.
import "./node_modules/@openzeppelin/compact-contracts/token/NativeShieldedTokenFamily";Ledger
_name: Opaque<"string">
sealed ledger
#The immutable family name shared by all token types. Re-exported from NativeShieldedTokenCore.
_symbol: Opaque<"string">
sealed ledger
#The immutable family symbol shared by all token types. Re-exported from NativeShieldedTokenCore.
_decimals: Uint<8>
sealed ledger
#The immutable family-wide decimals. Re-exported from NativeShieldedTokenCore.
_isInitialized: Boolean
ledger
#Initialization flag, tracked per-module to avoid the compiler's shared transitive-dependency state bug (LFDT-Minokawa/compact#270). See the Initializable module for rationale.
Witnesses
None.
Circuits
initialize(
name_: Opaque<"string">,
symbol_: Opaque<"string">,
decimals_: Uint<8>
) → []circuit
#Initializes the module's family metadata. This MUST be called in the implementing contract's constructor, and it MUST be the only token operation performed there. Failure to call it can lead to an irreparable contract; perform mint, burn, and tokenColor only in post-deployment circuits, never in the constructor.
isInitialized() → Boolean
circuit
#Returns whether the contract has been initialized.
name() → Opaque<"string">
circuit
#Returns the family name shared by all token types of this contract. Per-type identity belongs in the consumer's own state; see the module notes.
Requirements:
- Contract is initialized.
symbol() → Opaque<"string">
circuit
#Returns the family symbol shared by all token types of this contract.
Requirements:
- Contract is initialized.
decimals() → Uint<8>
circuit
#Returns the family-wide number of decimals used to get the user representation.
Requirements:
- Contract is initialized.
tokenColor(domain: Bytes<32>) → Bytes<32>
circuit
#Returns the coin color (token type) for domain under this
contract's address, so integrators do not have to re-derive it by hand.
Requirements:
- Contract is initialized.
_mint(
domain: Bytes<32>,
recipient: ZswapCoinPublicKey,
amount: Uint<64>,
nonce: Bytes<32>
) → ShieldedCoinInfocircuit
#Mints amount of the token identified by domain to
recipient, using a caller-supplied nonce.
The caller is fully responsible for nonce uniqueness. Reusing a
nonce for the same (domain, value, recipient) produces a duplicate
commitment, which the protocol rejects. With a secret random nonce this
is the recipient-private mint. For mints that require no caller-managed
nonce, compose the NativeShieldedTokenDerivedNonce extension and pass
its _deriveNonce() output.
The returned coin info is the only copy available to the recipient; callers SHOULD deliver it out of band. Wallets cannot detect contract-minted coins by scanning the chain.
Requirements:
- Contract is initialized.
recipientis not zero.
_mintToSelf(
domain: Bytes<32>,
amount: Uint<64>,
nonce: Bytes<32>
) → ShieldedCoinInfocircuit
#Mints amount of the token identified by domain to this
contract itself, claiming the coin in the same call. Forwards to
NativeShieldedTokenCore._mint with right(kernel.self()).
Nonce uniqueness is the caller's responsibility, as in _mint. Spend
the coin later with _burnFromSelf, once it carries an mt_index.
The consumer SHOULD persist the returned coin info in its own ledger state: it is the contract's holding and is not otherwise recoverable.
Requirements:
- Contract is initialized.
_burn(
domain: Bytes<32>,
coin: ShieldedCoinInfo,
amount: Uint<128>,
refundTo: ZswapCoinPublicKey
) → Maybe<ShieldedCoinInfo>circuit
#Burns amount from coin, a coin provided within the
current transaction (e.g. paid in by the caller's wallet), and routes the
remaining change to refundTo.
To destroy coin in full, pass coin.value as amount; the change
branch will not fire and none is returned. The refundTo value is
inert in that case but must still be supplied and non-zero.
The coin is received by the contract and spent in the same
transaction, so the spend goes through sendImmediateShielded (the
transient path). For coins the contract already holds, use
_burnFromSelf instead.
The returned refund coin info is the only copy available to
refundTo; callers SHOULD deliver it out of band. Wallets cannot detect
contract-sent coins by scanning the chain.
Requirements:
- Contract is initialized.
coin.coloris this contract's token type fordomain.amountis less than or equal tocoin.value.refundTois not zero (the zero key is the burn address; a zerorefundTowould silently burn the change as well).
_burnFromSelf(
domain: Bytes<32>,
coin: QualifiedShieldedCoinInfo,
amount: Uint<128>
) → Maybe<ShieldedCoinInfo>circuit
#Burns amount from coin, a coin this contract already
holds (a Merkle-tree entry with a valid mt_index). Any change is
auto-received by the contract and returned.
The consumer SHOULD persist the returned change coin info in its own
ledger state: the change replaces coin as the contract's holding, and
its info is not otherwise recoverable.
Requirements:
- Contract is initialized.
coin.coloris this contract's token type fordomain.amountis less than or equal tocoin.value.
import "./node_modules/@openzeppelin/compact-contracts/token/NativeShieldedTokenCore";Ledger
_isInitialized: Boolean
ledger
#Initialization flag, tracked per-module to avoid the compiler's shared transitive-dependency state bug (LFDT-Minokawa/compact#270). See the Initializable module for rationale.
_name: Opaque<"string">
sealed ledger
#The token's human-readable name, set once at construction.
_symbol: Opaque<"string">
sealed ledger
#The token's ticker symbol, set once at construction.
_decimals: Uint<8>
sealed ledger
#The number of decimals used to display balances, set once at construction. Purely presentational; no circuit scales by it.
Witnesses
None.
Circuits
initialize(
name_: Opaque<"string">,
symbol_: Opaque<"string">,
decimals_: Uint<8>
) → []circuit
#Initializes the contract-wide metadata. This MUST be called in the implementing contract's constructor (via the wrapping flavor's initialize). Failure to do so can lead to an irreparable contract.
assertInitialized() → []
circuit
#Asserts that the contract has been initialized, throwing an error if not.
Requirements:
- Contract must be initialized.
assertNotInitialized() → []
circuit
#Asserts that the contract has not been initialized, throwing an error if it has.
Requirements:
- Contract must not be initialized.
isInitialized() → Boolean
circuit
#Returns whether the contract has been initialized. Does not gate on init (it reports it), so it is safe to call before initialize.
name() → Opaque<"string">
circuit
#Returns the token name.
Requirements:
- Contract is initialized.
symbol() → Opaque<"string">
circuit
#Returns the symbol of the token.
Requirements:
- Contract is initialized.
decimals() → Uint<8>
circuit
#Returns the number of decimals used to get its user representation. This is a display convention only. The protocol stores and operates on integer values without reference to decimals.
Requirements:
- Contract is initialized.
tokenColor(domain: Bytes<32>) → Bytes<32>
circuit
#Returns the coin color for domain under this contract's
address: tokenType(domain, kernel.self()), computed at call time.
Requirements:
- Contract is initialized.
_mint(
domain: Bytes<32>,
recipient: Either<ZswapCoinPublicKey, ContractAddress>,
amount: Uint<64>,
nonce: Bytes<32>
) → ShieldedCoinInfocircuit
#Mints amount of the token identified by domain to
recipient, using a caller-supplied nonce.
The caller is fully responsible for nonce uniqueness. Reusing a
nonce for the same (domain, value, recipient) produces a duplicate
commitment, which the protocol rejects. A right(kernel.self()) recipient
is claimed by mintShieldedToken in this same call, so the consumer SHOULD
persist the returned coin info: it is the contract's holding and is not
otherwise recoverable.
The returned coin info is the only copy available to the recipient; callers SHOULD deliver it out of band. Wallets cannot detect contract-minted coins by scanning the chain.
Requirements:
- Contract is initialized.
recipientis not zero.recipient, if a contract address, is this contract's own address.
_burn(
domain: Bytes<32>,
coin: ShieldedCoinInfo,
amount: Uint<128>,
refundTo: Either<ZswapCoinPublicKey, ContractAddress>
) → Maybe<ShieldedCoinInfo>circuit
#Burns amount from coin, a coin provided within the
current transaction (e.g. paid in by the caller's wallet), and routes the
remaining change to refundTo.
To destroy coin in full, pass coin.value as amount; the change
branch will not fire and none is returned. The refundTo value is
inert in that case but must still be supplied and non-zero.
The coin is received by the contract and spent in the same
transaction, so the spend goes through sendImmediateShielded (the
transient path). For coins the contract already holds, use
_burnFromSelf instead. A right(kernel.self()) refund is claimed by
sendImmediateShielded in this same call.
The returned refund coin info is the only copy available to
refundTo; callers SHOULD deliver it out of band. Wallets cannot detect
contract-sent coins by scanning the chain.
Requirements:
- Contract is initialized.
coin.coloris this contract's token type fordomain.amountis less than or equal tocoin.value.refundTois not zero (the zero key is the burn address; a zerorefundTowould silently burn the change as well).refundTo, if a contract address, is this contract's own address.
_burnFromSelf(
domain: Bytes<32>,
coin: QualifiedShieldedCoinInfo,
amount: Uint<128>
) → Maybe<ShieldedCoinInfo>circuit
#Burns amount from coin, a coin this contract already
holds (a Merkle-tree entry with a valid mt_index). Any change is
auto-received by the contract and returned.
The consumer SHOULD persist the returned change coin info in its own
ledger state: the change replaces coin as the contract's holding, and
its info is not otherwise recoverable.
Requirements:
- Contract is initialized.
coin.coloris this contract's token type fordomain.amountis less than or equal tocoin.value.
import "./node_modules/@openzeppelin/compact-contracts/token/extensions/NativeShieldedTokenPublicSupply";Ledger
_totalMinted: Map<Bytes<32>, Uint<128>>
ledger
#Exact amount minted per domain. See "Accounting guarantees".
_totalBurned: Map<Bytes<32>, Uint<128>>
ledger
#Contract-mediated amount burned per domain (lower bound).
Witnesses
None.
Circuits
_addMinted(amount: Uint<64>) → []
circuit
#Adds amount to the exact minted total. Call once per
successful NativeShieldedToken._mint.
_addBurned(amount: Uint<128>) → []
circuit
#Adds amount to the contract-mediated burned total. Call once
per successful NativeShieldedToken._burn / _burnFromSelf.
Enforces burned <= minted; an unpaired or duplicate burn reverts.
totalMinted() → Uint<128>
circuit
#Returns the exact amount ever minted.
totalBurned() → Uint<128>
circuit
#Returns the contract-mediated amount burned.
This is a lower bound: coins sent directly to the burn address without going through the contract are not counted.
totalSupply() → Uint<128>
circuit
#Returns totalMinted() - totalBurned().
This is an UPPER BOUND on circulating supply, not an exact value: burns that bypass the contract are invisible. See the module notes.
import "./node_modules/@openzeppelin/compact-contracts/token/extensions/NativeShieldedTokenFamilyPublicSupply";Ledger
_totalMinted: Map<Bytes<32>, Uint<128>>
ledger
#Exact amount minted per domain. See "Accounting guarantees".
_totalBurned: Map<Bytes<32>, Uint<128>>
ledger
#Contract-mediated amount burned per domain (lower bound).
Witnesses
None.
Circuits
_addMinted(domain: Bytes<32>, amount: Uint<64>) → []
circuit
#Adds amount to the exact minted total for domain. Call
once per successful NativeShieldedTokenFamily._mint.
_addBurned(domain: Bytes<32>, amount: Uint<128>) → []
circuit
#Adds amount to the contract-mediated burned total for
domain. Call once per successful NativeShieldedTokenFamily._burn /
_burnFromSelf.
Enforces per-domain burned <= minted; an unpaired, duplicate, or
wrong-domain burn reverts.
totalMinted(domain: Bytes<32>) → Uint<128>
circuit
#Returns the exact amount ever minted for domain.
totalBurned(domain: Bytes<32>) → Uint<128>
circuit
#Returns the contract-mediated amount burned for domain.
This is a lower bound: coins sent directly to the burn address without going through the contract are not counted.
totalSupply(domain: Bytes<32>) → Uint<128>
circuit
#Returns totalMinted(domain) - totalBurned(domain).
This is an UPPER BOUND on circulating supply, not an exact value: burns that bypass the contract are invisible. See the module notes.
import "./node_modules/@openzeppelin/compact-contracts/token/extensions/NativeShieldedTokenPublicSupplyCore";Ledger
_totalMinted: Map<Bytes<32>, Uint<128>>
ledger
#Exact amount minted per domain. See "Accounting guarantees".
_totalBurned: Map<Bytes<32>, Uint<128>>
ledger
#Contract-mediated amount burned per domain (lower bound).
Witnesses
None.
Circuits
_addMinted(domain: Bytes<32>, amount: Uint<64>) → []
circuit
#Adds amount to the exact minted total for domain. Call
once per successful token _mint.
Checks for overflow in order to output a readable error message.
_addBurned(domain: Bytes<32>, amount: Uint<128>) → []
circuit
#Adds amount to the contract-mediated burned total for
domain. Call once per successful token _burn / _burnFromSelf.
Enforces the per-domain burned <= minted invariant: a wrong-domain,
duplicate, or unpaired burn reverts rather than corrupting totalSupply.
The guard also keeps the add and the totalSupply subtraction within
bounds, so no separate overflow/underflow check is needed.
totalMinted(domain: Bytes<32>) → Uint<128>
circuit
#Returns the exact amount ever minted for domain.
totalBurned(domain: Bytes<32>) → Uint<128>
circuit
#Returns the contract-mediated amount burned for domain.
This is a lower bound: coins sent directly to the burn address without going through the contract are not counted.
totalSupply(domain: Bytes<32>) → Uint<128>
circuit
#Returns totalMinted(domain) - totalBurned(domain), or 0 if
totalBurned somehow exceeds totalMinted.
This is an UPPER BOUND on circulating supply, not an exact value: burns that bypass the contract are invisible. See the module notes.
The burned <= minted invariant enforced by _addBurned already makes
burned > minted unreachable through the accounting API, so the clamp never
fires in normal operation. It is kept so the getter is a total function that
reads cleanly (returning 0) rather than reverting on an out-of-bound state.
import "./node_modules/@openzeppelin/compact-contracts/token/extensions/NativeShieldedTokenDerivedNonce";Ledger
_counter: Counter
ledger
#Monotonic index feeding the derived-nonce derivation.
Witnesses
None.
Circuits
_deriveNonce() → Bytes<32>
circuit
#Advances the counter and returns the next derived coin nonce,
for use as the nonce argument of a native token mint.
The derivation input is public ledger state, so mints using this nonce are recipient-public; see the module notes.
import "./node_modules/@openzeppelin/compact-contracts/token/presets/ZOwnableNativeShieldedToken";Ledger
_ownerCommitment: Bytes<32>
ledger
#Stores the current hashed commitment representing the owner.
This commitment is derived from the public identifier (e.g., SHA256(pk, nonce)),
the instanceSalt, the transfer counter, and a domain separator.
A commitment of default<Bytes<32>> (i.e., zero) indicates the contract is unowned.
_counter: Counter
ledger
#Internal transfer counter used to prevent commitment reuse.
Increments by 1 on every successful ownership transfer. Combined with id and
instanceSalt to compute unique owner commitments over time.
_instanceSalt: Bytes<32>
sealed ledger
#A per-instance value provided at initialization used to namespace commitments for this contract instance.
This salt prevents commitment collisions across contracts that might otherwise use the same owner identifiers or domain parameters. It is immutable after initialization.
_ownableIsInitialized: Boolean
ledger
#Initialization flag, tracked per-module to avoid the compiler's shared transitive-dependency state bug (LFDT-Minokawa/compact#270). See the Initializable module for rationale.
_domain: Bytes<32>
sealed ledger
#Domain separator fixed at construction; with the contract address it determines this token's color.
_name: Opaque<"string">
sealed ledger
#The immutable token name. Re-exported from NativeShieldedToken.
_symbol: Opaque<"string">
sealed ledger
#The immutable token symbol. Re-exported from NativeShieldedToken.
_decimals: Uint<8>
sealed ledger
#The immutable token decimals. Re-exported from NativeShieldedToken.
_isInitialized: Boolean
ledger
#Initialization flag, tracked per-module to avoid the compiler's shared transitive-dependency state bug (LFDT-Minokawa/compact#270). See the Initializable module for rationale.
_totalMinted: Map<Bytes<32>, Uint<128>>
ledger
#Exact amount minted per domain. See "Accounting guarantees".
_totalBurned: Map<Bytes<32>, Uint<128>>
ledger
#Contract-mediated amount burned per domain (lower bound).
Witnesses
None declared by this module. The composed ZOwnablePK requires
wit_secretNonce, which every owner-gated circuit calls through
assertOnlyOwner. The implementing DApp supplies it; the TypeScript witnesses in the library repository are
test-only and are not published.
Circuits
initialize(
ownerId: Bytes<32>,
instanceSalt: Bytes<32>,
tokenDomain: Bytes<32>,
name_: Opaque<"string">,
symbol_: Opaque<"string">,
decimals_: Uint<8>
) → []circuit
#Sets the owner and the token's domain and metadata.
Call from the implementing contract's constructor only. It writes sealed fields, so implementing contracts MUST NOT expose it as a post-deploy circuit.
ownerId must be _computeOwnerId(pk, secretNonce) for the coin
public key the owner's wallet will supply as ownPublicKey(). The circuit
cannot check this at deploy; any other key leaves the contract with no
usable owner and no recovery.
Requirements:
- Contract is not initialized.
ownerIdis not zero.
mint(
recipient: ZswapCoinPublicKey,
amount: Uint<64>,
nonce: Bytes<32>
) → ShieldedCoinInfocircuit
#Mints amount to recipient and adds it to the minted total.
Owner only.
Requirements:
- Caller is the owner.
recipientis not zero.
burn(
coin: ShieldedCoinInfo,
amount: Uint<64>,
refundTo: ZswapCoinPublicKey
) → Maybe<ShieldedCoinInfo>circuit
#Burns amount of coin, paid into the tx by the caller's
wallet, and refunds the rest to refundTo. Owner only.
Requirements:
- Caller is the owner.
coin.coloris this token's color.amount<=coin.value.refundTois not zero.
transferOwnership(newOwnerId: Bytes<32>) → []
circuit
#Transfers ownership to newOwnerId. Owner only.
newOwnerId must be _computeOwnerId(pk, secretNonce) for the
coin public key the new owner's wallet will supply as ownPublicKey().
The circuit cannot check this; any other key leaves the contract with no
usable owner and no recovery.
Requirements:
- Caller is the owner.
newOwnerIdis not zero.
renounceOwnership() → []
circuit
#Clears the owner. Owner only.
Irreversible: mint and burn stop forever.
Requirements:
- Caller is the owner.
owner() → Bytes<32>
circuit
#Returns the current owner commitment.
Requirements:
- Contract is initialized.
_computeOwnerId(pk: Either<ZswapCoinPublicKey, ContractAddress>, nonce: Bytes<32>) → Bytes<32>
pure
#Returns the owner id H(pk, nonce).
Requirements:
pkis a coin public key.
totalMinted() → Uint<128>
circuit
#Returns the total amount ever minted.
name() → Opaque<"string">
circuit
#Returns the token name.
Requirements:
- Contract is initialized.
symbol() → Opaque<"string">
circuit
#Returns the token symbol.
Requirements:
- Contract is initialized.
decimals() → Uint<8>
circuit
#Returns the token decimals.
Requirements:
- Contract is initialized.
tokenColor() → Bytes<32>
circuit
#Returns this contract's token color,
tokenType(tokenDomain, kernel.self()).
Requirements:
- Contract is initialized.