The four testnet faucet flows.
Testnet-only, for Sepolia + Anvil: mint plaintext TTT, mint backed CTTT, read both balances, inspect rate + supply.
- 1
Mint TTT underlying
TokenopsTestToken (TTT) is a plain 18-decimal ERC-20 with an open mint(to, amount). Anyone on Sepolia (11155111) or local Anvil (31337) can mint plaintext test tokens — no encryptor, no RBAC, no pause.
- useMintUnderlying().mutate({ amount, to? }) — submits mint(to, amount) on TTT; amount is a plaintext bigint in 18-decimal units
- MintUnderlyingResult returns { amount, hash, to } — the values you passed, after the receipt's success guard
- Read it back with useUnderlyingBalance({ account }) — a plaintext bigint
- 2
Mint CTTT backed-confidential
ConfidentialTokenopsTestToken (CTTT) is a 6-decimal ERC-7984 confidential wrapper (UUPS proxy) with an open backed faucet mint. The mint takes a public uint64 amount (no @zama-fhe encryptor): the faucet mints the underlying behind it 1:1, then issues the confidential balance.
- useMintConfidential().mutate({ amount, to? }) — submits mint(to, amount) on CTTT; amount is a plaintext bigint in 6-decimal units
- MintConfidentialResult returns { amount, handle, hash, to, underlyingMinted } — parsed from the ConfidentialMint event
- FaucetSupplyExhaustedError (TOKENOPS_FAUCET_SUPPLY_EXHAUSTED) maps from the ERC7984TotalSupplyOverflow revert if maxTotalSupply is reached
- 3
Read public + encrypted balances
TTT exposes a plaintext balance; CTTT exposes an encrypted euint64 handle (Hex). useConfidentialBalance returns the ciphertext handle as-is — there is no encryptor in this surface, so decryption is out of band. Pair the two to inspect both sides of a backed mint.
- useUnderlyingBalance({ account }) — TTT plaintext balance as a bigint
- useConfidentialBalance({ account }) — CTTT encrypted balance, returned as an euint64 handle (Hex)
- Headless equivalents: client.underlyingBalanceOf(account) and client.confidentialBalanceOf(account)
- 4
Read faucet metadata, rate + supply
Inspect the faucet's static and dynamic state with read-only calls: token metadata for both sides, the backing rate, and supply headroom against the CTTT cap. getMetadata bundles confidential + underlying FaucetTokenMetadata with maxTotalSupply and rate.
- useFaucetMetadata() — FaucetMetadata { confidential, underlying, maxTotalSupply, rate }
- useFaucetRate() / useMaxTotalSupply() / useInferredTotalSupply() — the rate and supply headroom as bigints
- useUnderlyingTokenAddress() — the TTT address backing CTTT; addresses also via getTestTokenAddress / getConfidentialTestTokenAddress