docs.rs failed to build tenzro-token-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
tenzro-token-0.1.0
tenzro-token
TNZO token economics for the Tenzro Network, including staking, governance, treasury, rewards, and liquid staking.
Overview
tenzro-token implements the economic layer of the Tenzro Network. The crate provides the TNZO native token (18-decimal precision), staking mechanisms for validators and providers, on-chain governance, treasury management, reward distribution, and liquid staking (stTNZO) for capital efficiency.
Modules
tnzo- TNZO token implementation with 18-decimal precisionstaking- Validator and provider staking with slashinggovernance- On-chain proposal creation and votingtreasury- Multi-asset treasury with multisig withdrawalsrewards- Epoch-based reward distributionfee_distribution- Fee routing and distribution logicliquid_staking- stTNZO liquid staking pool with rebasing exchange ratecross_vm- Cross-VM token operations (wTNZO pointer model)registry- Unified token registry across VMserc7802- Cross-chain token manager (ERC-7802)erc3643- Compliance registry (ERC-3643)adaptive_burn- Governance dial over EIP-1559 burn fractions and supply targetsseed_agent- SeedAgent treasury earmark, charter registry, monthly decay schedulebond- AgentBond stake registry and insurance claim poolburn_quota- Per-epoch burn quota accountingerror- Error types
Key Features
- TNZO Token: 18-decimal native token for gas, settlement, staking, and governance
- Staking: Validator and provider staking with minimum stake requirements, unbonding periods, and slashing (10% penalty on equivocation)
- Governance: On-chain proposals with weighted voting based on staked tokens
- Treasury: Multi-asset fee accumulation with multisig withdrawal controls
- Rewards: Epoch-based reward distribution to validators, providers, and stakers
- Liquid Staking (stTNZO):
- Rebasing exchange rate tracking staking rewards
- Multi-validator delegation for diversification
- Protocol fee (default 10%, configurable via DEFAULT_PROTOCOL_FEE_BPS = 1000 basis points)
- 7-day unbonding period (604,800 seconds)
- Overflow-safe u128 arithmetic with quotient/remainder decomposition
- Cross-VM Token Architecture: Sei V2 pointer model with wTNZO ERC-20, SPL adapter, CIP-56 DAML template
- Adaptive burn governance dial:
BurnRateConfig(base/local/paymaster bps with paymaster locked at 100%),SupplyTargets(rolling-window epochs, neutral band, alarms, magnitude caps, fast-track timelock),SupplyMetricsSnapshot, andBurnRateConfigManagerwrite-through toCF_TOKENSunderburn_rate:current/burn_targets:current/burn_metrics:latest. Pure transfer functioncompute_recommendation(metrics, targets) -> BurnRateRecommendationreturnsRecommendationAction::{Disabled, NoChange, IncreaseBurnPct, DecreaseBurnPct, AlarmHighInflation, AlarmHighDeflation}with magnitude bps capped atmagnitude_cap_normal_bps(default 200) ormagnitude_cap_alarm_bps(default 100). Surfaced viatenzro_getBurnRateConfig,tenzro_getSupplyMetrics,tenzro_getBurnRateRecommendation,tenzro_listAdaptiveBurnProposals. - SeedAgent treasury earmark:
TreasuryEarmarksingleton (genesis-funded TNZO allocation, decay schedule,enabledmaster switch,surplus_burn_bpssunset disposition),Charter(governance-signed mandate enumeratingOperationKind::{InferenceConsumer, TaskMarketplaceConsumer, TemplateInstantiator, BridgeUser, SettlementProbe, Settler7683Probe, DisputeFiler},SpendCaps,TargetThroughput,CounterpartyFilter, sunset, enabled flag),DecaySchedule(default 100/100/100 months 0-2 → 75 months 3-5 → 50 months 6-8 → 25 months 9-11 → 0 from month 12),SeedAgentRecord(per-DID provisioning state withSeedAgentStatus::{Active, Paused, Quarantined, Terminated}), andSeedAgentEarmarkManagerwrite-through toCF_TOKENSunderseed_earmark:singleton/seed_charter:<id>/seed_agent:<did>. Surfaced viatenzro_getTreasuryEarmark,tenzro_getSeedAgentCharter,tenzro_listSeedAgentCharters,tenzro_listSeedAgents,tenzro_getNetworkActivity. - RocksDB Persistence: Token supply, staking state, balances, adaptive-burn dial, SeedAgent registry, and AgentBond stakes backed by CF_ACCOUNTS / CF_TOKENS
Constants
| Constant | Value | Description |
|---|---|---|
| Default network fee | 0.5% | Network commission on AI/TEE payments |
| Community allocation | 35-40% | Community token allocation |
| stTNZO decimals | 18 | Liquid staking token decimals |
| Liquid staking protocol fee | 10% (1000 bps) | Protocol fee on staking rewards |
| Unbonding period | 7 days (604,800 sec) | Time to wait before withdrawal |
Usage
Token Operations
use TnzoToken;
let token = new?;
// Check balance
let balance = token.balance_of?;
// Transfer tokens
token.transfer?;
Staking
use StakingManager;
let min_stake = 1_000_000_000_000_000_000_000; // 1000 TNZO
let staking = new;
// Stake tokens
staking.stake?;
// Unstake (initiates unbonding period)
staking.unstake?;
// Withdraw after unbonding period
staking.withdraw?;
// Slash misbehaving validator (10% penalty)
staking.slash?;
Governance
use ;
let governance = new;
// Create proposal
let proposal = Proposal ;
let proposal_id = governance.create_proposal?;
// Vote (voting power = staked tokens)
governance.vote?;
// Execute if passed
if governance.has_passed?
Liquid Staking
use LiquidStakingPool;
let pool = new?;
// Deposit TNZO, receive stTNZO
let st_tnzo_minted = pool.deposit?;
// Request withdrawal (initiates unbonding)
let withdrawal_id = pool.request_withdrawal?;
// Complete withdrawal after unbonding period
let tnzo_returned = pool.complete_withdrawal?;
// Check exchange rate (stTNZO:TNZO)
let rate = pool.exchange_rate?;
Treasury
use NetworkTreasury;
let required_approvals = 3;
let treasury = new;
// Propose withdrawal
let withdrawal_id = treasury.propose_withdrawal?;
// Approvers vote
treasury.approve_withdrawal?;
treasury.approve_withdrawal?;
treasury.approve_withdrawal?;
// Execute when threshold reached
treasury.execute_withdrawal?;
Testing
Run tests with:
Unit tests cover the treasury, staking, governance, rewards, vesting, and liquid-staking paths.
Production Status
Components:
- RocksDB-persisted token supply and balances via CF_ACCOUNTS
- Stake-weighted governance with real voting power tracking
- Multisig treasury with approval threshold enforcement
- Liquid staking with overflow-safe u128 arithmetic
- Adaptive burn dial with read-only RPC surface, write-through persistence, EIP-1559 fee-market consumer,
AutoProposalGenerator, andSupplyMetricsSnapshotaggregator (base-fee burn + slash inflow) wired through the governance executor - SeedAgent treasury earmark with read-only RPC surface, write-through persistence, off-chain
SeedAgentDaemon(6h poll + monthly refill + charter-sunset pause + leader-gate), governance-executor mutation paths, monthly decay enforcement at refill, sunset wind-down sweep (Paused → Quarantined → Terminated → surplus disposal), and thetenzro/seed-agentsgossipsub topic
Dependencies
tenzro-types- Core typestenzro-storage- RocksDB persistencetokio- Async runtimedashmap- Concurrent hash mapsparking_lot- High-performance locks
License
Apache-2.0.