API Reference

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:

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.

k=6, rows=24

name() → Opaque<"string">

circuit

#

Returns the token name.

Requirements:

  • Contract is initialized.
k=6, rows=26

symbol() → Opaque<"string">

circuit

#

Returns the symbol of the token.

Requirements:

  • Contract is initialized.
k=6, rows=26

decimals() → Uint<8>

circuit

#

Returns the number of decimals used to get its user representation.

Requirements:

  • Contract is initialized.
k=6, rows=26

tokenColor() → Bytes<32>

circuit

#

Returns this token's coin color: tokenType(_domain, kernel.self()), computed at call time.

Requirements:

  • Contract is initialized.
k=13, rows=3962

_mint(
  recipient: ZswapCoinPublicKey,
  amount: Uint<64>,
  nonce: Bytes<32>
) → ShieldedCoinInfo

circuit

#

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.
  • recipient is not zero.
k=14, rows=10450

_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.
k=14, rows=10221

_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.color is this contract's token color.
  • amount is less than or equal to coin.value.
  • refundTo is not zero (the zero key is the burn address; a zero refundTo would silently burn the change as well).
k=16, rows=41327

_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.color is this contract's token color.
  • amount is less than or equal to coin.value.
k=15, rows=23208

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.

k=6, rows=24

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.
k=6, rows=26

symbol() → Opaque<"string">

circuit

#

Returns the family symbol shared by all token types of this contract.

Requirements:

  • Contract is initialized.
k=6, rows=26

decimals() → Uint<8>

circuit

#

Returns the family-wide number of decimals used to get the user representation.

Requirements:

  • Contract is initialized.
k=6, rows=26

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.
k=13, rows=4239

_mint(
  domain: Bytes<32>,
  recipient: ZswapCoinPublicKey,
  amount: Uint<64>,
  nonce: Bytes<32>
) → ShieldedCoinInfo

circuit

#

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.
  • recipient is not zero.
k=14, rows=10727

_mintToSelf(
  domain: Bytes<32>,
  amount: Uint<64>,
  nonce: Bytes<32>
) → ShieldedCoinInfo

circuit

#

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.
k=14, rows=10497

_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.color is this contract's token type for domain.
  • amount is less than or equal to coin.value.
  • refundTo is not zero (the zero key is the burn address; a zero refundTo would silently burn the change as well).
k=16, rows=41603

_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.color is this contract's token type for domain.
  • amount is less than or equal to coin.value.
k=15, rows=23484

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.

k=6, rows=24

name() → Opaque<"string">

circuit

#

Returns the token name.

Requirements:

  • Contract is initialized.
k=6, rows=26

symbol() → Opaque<"string">

circuit

#

Returns the symbol of the token.

Requirements:

  • Contract is initialized.
k=6, rows=26

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.
k=6, rows=26

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.
k=13, rows=4239

_mint(
  domain: Bytes<32>,
  recipient: Either<ZswapCoinPublicKey, ContractAddress>,
  amount: Uint<64>,
  nonce: Bytes<32>
) → ShieldedCoinInfo

circuit

#

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.
  • recipient is not zero.
  • recipient, if a contract address, is this contract's own address.
k=14, rows=11109

_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.color is this contract's token type for domain.
  • amount is less than or equal to coin.value.
  • refundTo is not zero (the zero key is the burn address; a zero refundTo would silently burn the change as well).
  • refundTo, if a contract address, is this contract's own address.
k=16, rows=47764

_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.color is this contract's token type for domain.
  • amount is less than or equal to coin.value.
k=15, rows=23484

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.

k=9, rows=373

_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.

k=9, rows=475

totalMinted() → Uint<128>

circuit

#

Returns the exact amount ever minted.

k=7, rows=63

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.

k=7, rows=60

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.

k=9, rows=158

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.

k=10, rows=645

_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.

k=10, rows=747

totalMinted(domain: Bytes<32>) → Uint<128>

circuit

#

Returns the exact amount ever minted for domain.

k=9, rows=342

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.

k=9, rows=339

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.

k=9, rows=437

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.

k=10, rows=645

_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.

k=10, rows=747

totalMinted(domain: Bytes<32>) → Uint<128>

circuit

#

Returns the exact amount ever minted for domain.

k=9, rows=342

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.

k=9, rows=339

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.

k=9, rows=437

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.

k=9, rows=447

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.
  • ownerId is not zero.

mint(
  recipient: ZswapCoinPublicKey,
  amount: Uint<64>,
  nonce: Bytes<32>
) → ShieldedCoinInfo

circuit

#

Mints amount to recipient and adds it to the minted total. Owner only.

Requirements:

  • Caller is the owner.
  • recipient is not zero.
k=15, rows=21252

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.color is this token's color.
  • amount <= coin.value.
  • refundTo is not zero.
k=16, rows=51814

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.
  • newOwnerId is not zero.
k=15, rows=17023

renounceOwnership() → []

circuit

#

Clears the owner. Owner only.

Irreversible: mint and burn stop forever.

Requirements:

  • Caller is the owner.
k=14, rows=10579

owner() → Bytes<32>

circuit

#

Returns the current owner commitment.

Requirements:

  • Contract is initialized.
k=6, rows=48

_computeOwnerId(pk: Either<ZswapCoinPublicKey, ContractAddress>, nonce: Bytes<32>) → Bytes<32>

pure

#

Returns the owner id H(pk, nonce).

Requirements:

  • pk is a coin public key.

totalMinted() → Uint<128>

circuit

#

Returns the total amount ever minted.

k=7, rows=63

name() → Opaque<"string">

circuit

#

Returns the token name.

Requirements:

  • Contract is initialized.
k=6, rows=26

symbol() → Opaque<"string">

circuit

#

Returns the token symbol.

Requirements:

  • Contract is initialized.
k=6, rows=26

decimals() → Uint<8>

circuit

#

Returns the token decimals.

Requirements:

  • Contract is initialized.
k=6, rows=26

tokenColor() → Bytes<32>

circuit

#

Returns this contract's token color, tokenType(tokenDomain, kernel.self()).

Requirements:

  • Contract is initialized.
k=13, rows=3962