Expand description
TNZO token, treasury management, staking, and governance for Tenzro Network
This crate provides the core token economics functionality for Tenzro Network:
- TNZO Token: Governance/utility token management with 18-decimal precision
- Treasury: Multi-asset treasury accumulating network fees
- Staking: Staking system for validators and service providers
- Governance: On-chain governance with proposals and voting
- Rewards: Reward distribution engine for stakers
- Fee Distribution: Network fee processing and distribution
§Architecture
The token economics system uses u128 for all token amounts to handle 18-decimal
precision properly, and leverages DashMap for concurrent access patterns.
§Example
use tenzro_token::{
tnzo::TnzoToken,
staking::StakingManager,
governance::GovernanceEngine,
};
use tenzro_types::primitives::Address;
// Create a TNZO token instance
let token = TnzoToken::new();
// Create staking and governance managers
let staking = StakingManager::new();
let governance = GovernanceEngine::new();
// Use the token economics system...Re-exports§
pub use error::TokenError;pub use error::Result;pub use tnzo::TnzoToken;pub use tnzo::TokenStats;pub use tnzo::CircuitBreaker;pub use treasury::NetworkTreasury;pub use treasury::FeeDistributionConfig;pub use treasury::TreasuryStats;pub use treasury::TreasuryStorageBackend;pub use staking::StakingManager;pub use staking::StakeInfo;pub use staking::SlashEvent;pub use staking::RestoreEvent;pub use staking::StakeStatus;pub use staking::DEFAULT_MIN_STAKE;pub use staking::DEFAULT_UNBONDING_PERIOD_MS;pub use governance::GovernanceEngine;pub use governance::VotingRecord;pub use rewards::RewardDistributor;pub use rewards::EpochRewards;pub use rewards::RewardClaim;pub use fee_distribution::FeeProcessor;pub use fee_distribution::FeeStats;pub use fee_distribution::DistributionHistory;pub use liquid_staking::LiquidStakingPool;pub use liquid_staking::LiquidStakingConfig;pub use liquid_staking::LiquidStakingStats;pub use cross_vm::TokenVmType;pub use cross_vm::VmAddresses;pub use cross_vm::TokenPermissions;pub use cross_vm::TokenMetadata;pub use cross_vm::TokenId;pub use cross_vm::TokenType;pub use cross_vm::TokenDefinition;pub use cross_vm::CrossVmTransfer;pub use cross_vm::NATIVE_DECIMALS;pub use cross_vm::SPL_DECIMALS;pub use cross_vm::NATIVE_UNIT;pub use cross_vm::SPL_UNIT;pub use cross_vm::DECIMAL_SHIFT;pub use cross_vm::native_to_spl;pub use cross_vm::spl_to_native;pub use cross_vm::truncation_dust;pub use registry::TokenRegistry;pub use erc7802::CrosschainTokenManager;pub use erc7802::CrosschainMintEvent;pub use erc7802::CrosschainBurnEvent;pub use erc7802::BridgeAuthorization;pub use erc7802::BridgeInfo;pub use erc3643::ComplianceRegistry;pub use erc3643::ComplianceRules;pub use erc3643::ComplianceCheckResult;pub use erc3643::ComplianceViolation;pub use erc3643::IdentityClaim;pub use erc3643::TrustedIssuer;pub use erc3643::FreezeInfo;pub use erc3643::RecoveryEvent;pub use erc3643::TransferRestrictions;pub use erc3643::SupplyLimits;pub use erc3643::CLAIM_TOPIC_KYC;pub use erc3643::CLAIM_TOPIC_ACCREDITED_INVESTOR;pub use erc3643::CLAIM_TOPIC_COUNTRY;pub use erc3643::CLAIM_TOPIC_QUALIFIED_PURCHASER;pub use bond::BondManager;pub use bond::AgentBondState;pub use bond::BondLifecycle;pub use bond::BondEvent;pub use bond::ClaimRecord;pub use bond::ClaimStatus;pub use bond::InsurancePoolState;pub use bond::derive_bond_vault_address;pub use bond::derive_insurance_pool_address;pub use bond::derive_claim_id;pub use bond::DEFAULT_COOLDOWN_MS;pub use bond::DEFAULT_MIN_RESIDUAL;pub use bond::DEFAULT_MAX_SINGLE_SLASH_BPS;pub use compute_bond::ComputeBondManager;pub use compute_bond::ComputeBondState;pub use compute_bond::ComputeBondStatus;pub use compute_bond::ComputeBondEvent;pub use compute_bond::derive_compute_bond_vault_address;pub use compute_bond::DEFAULT_COMPUTE_BOND_COOLDOWN_MS;pub use compute_bond::DEFAULT_COMPUTE_BOND_MIN;pub use burn_quota::BurnQuota;pub use burn_quota::BurnQuotaManager;pub use burn_quota::RefillReceipt;pub use burn_quota::BURN_QUOTA_KEY;pub use burn_quota::DEFAULT_DAILY_REFILL_TARGET;pub use burn_quota::DEFAULT_CAP;pub use burn_quota::DEFAULT_MIN_RESERVE_BPS;pub use adaptive_burn::compute_recommendation;pub use adaptive_burn::AutoProposalGenerator;pub use adaptive_burn::AutoProposalGeneratorConfig;pub use adaptive_burn::BurnBreakdown;pub use adaptive_burn::BurnRateConfig;pub use adaptive_burn::BurnRateConfigManager;pub use adaptive_burn::BurnRateRecommendation;pub use adaptive_burn::EmissionBreakdown;pub use adaptive_burn::RecommendationAction;pub use adaptive_burn::SupplyMetricsSnapshot;pub use adaptive_burn::SupplyTargets;pub use adaptive_burn::BURN_RATE_CONFIG_KEY;pub use adaptive_burn::DEFAULT_ALARM_FAST_TRACK_ENABLED;pub use adaptive_burn::DEFAULT_ALARM_TIMELOCK_HOURS;pub use adaptive_burn::DEFAULT_AUTO_PROPOSAL_DEBOUNCE_SECS;pub use adaptive_burn::DEFAULT_AUTO_PROPOSAL_MIN_MAGNITUDE_BPS;pub use adaptive_burn::DEFAULT_AUTO_PROPOSAL_NORMAL_VOTING_HOURS;pub use adaptive_burn::DEFAULT_AUTO_PROPOSAL_POLL_INTERVAL_SECS;pub use adaptive_burn::DEFAULT_BASE_FEE_BURN_BPS;pub use adaptive_burn::DEFAULT_DEFLATION_ALARM_BPS;pub use adaptive_burn::DEFAULT_GAIN_BPS_PER_PCT;pub use adaptive_burn::DEFAULT_INFLATION_ALARM_BPS;pub use adaptive_burn::DEFAULT_LOCAL_FEE_BURN_BPS;pub use adaptive_burn::DEFAULT_MAGNITUDE_CAP_ALARM_BPS;pub use adaptive_burn::DEFAULT_MAGNITUDE_CAP_NORMAL_BPS;pub use adaptive_burn::DEFAULT_NEUTRAL_BAND_BPS;pub use adaptive_burn::DEFAULT_PAYMASTER_BURN_BPS;pub use adaptive_burn::DEFAULT_ROLLING_WINDOW_EPOCHS;pub use adaptive_burn::DEFAULT_TARGET_ANNUAL_SUPPLY_BPS;pub use adaptive_burn::SUPPLY_METRICS_KEY;pub use adaptive_burn::SUPPLY_TARGETS_KEY;pub use seed_agent::Charter;pub use seed_agent::CounterpartyFilter;pub use seed_agent::DecayPoint;pub use seed_agent::DecaySchedule;pub use seed_agent::OperationKind;pub use seed_agent::RefillResult;pub use seed_agent::SeedAgentEarmarkManager;pub use seed_agent::SeedAgentRecord;pub use seed_agent::SeedAgentStatus;pub use seed_agent::SpendCaps;pub use seed_agent::SurplusDisposition;pub use seed_agent::TargetThroughput;pub use seed_agent::TreasuryEarmark;pub use seed_agent::WindDownReport;pub use seed_agent::DEFAULT_BOOTSTRAP_MONTHS;pub use seed_agent::DEFAULT_QUARANTINE_GRACE_MS;pub use seed_agent::DEFAULT_SURPLUS_BURN_BPS;pub use seed_agent::MONTH_MILLIS;pub use seed_agent::SEED_AGENT_PREFIX;pub use seed_agent::SEED_CHARTER_PREFIX;pub use seed_agent::SEED_EARMARK_KEY;pub use seed_agent_daemon::SeedAgentDaemon;pub use seed_agent_daemon::SeedAgentDaemonConfig;pub use seed_agent_daemon::SurplusDispositionFn;pub use seed_agent_daemon::TickAuthorityFn;pub use seed_agent_daemon::TickOutcome;pub use seed_agent_daemon::DEFAULT_DAEMON_POLL_INTERVAL_SECS;pub use seed_agent_daemon::DEFAULT_DAEMON_QUARANTINE_GRACE_MS;pub use seed_agent_daemon::DEFAULT_MIN_REFILL_INTERVAL_MS;pub use seed_agent_gossip::decode_for_topic as decode_seed_agent_for_topic;pub use seed_agent_gossip::encode_agent_registered;pub use seed_agent_gossip::encode_agent_status_changed;pub use seed_agent_gossip::encode_charter_upserted;pub use seed_agent_gossip::encode_earmark_updated;pub use seed_agent_gossip::encode_monthly_refill_completed;pub use seed_agent_gossip::SeedAgentGossipMessage;pub use seed_agent_gossip::SEED_AGENTS_TOPIC;pub use validator_registry::EpochTransitionPlan;pub use validator_registry::ValidatorRegistry;pub use validator_registry::ValidatorRegistryConfig;pub use validator_registry::ValidatorRegistryEntry;pub use validator_registry::ValidatorRegistryStatus;pub use validator_registry::ACTIVATION_EFFECTIVE_DELAY_BLOCKS;pub use validator_registry::DEFAULT_ACTIVATION_CHURN_BPS;pub use validator_registry::DEFAULT_EXIT_CHURN_BPS;pub use validator_registry::DEFAULT_MIN_VALIDATOR_SELF_STAKE;pub use validator_registry::DEFAULT_REENTRY_COOLDOWN_EPOCHS;pub use validator_registry::MIN_CHURN_PER_EPOCH;pub use validator_registry::VALIDATOR_CONFIG_KEY;pub use validator_registry::VALIDATOR_INDEX_KEY;pub use validator_registry::VALIDATOR_PREFIX;
Modules§
- adaptive_
burn - Adaptive burn governance dial (Agent-Swarm Spec 8).
- bond
- AgentBond surety primitive (Agent-Swarm Spec 9)
- burn_
quota - BurnQuota primitive (Agent-Swarm Spec 3 — wave 1).
- compute_
bond - ComputeBond surety primitive (Phase A #153)
- cross_
vm - Cross-VM token types and decimal conversion utilities
- erc3643
- ERC-3643 T-REX Compliance Module
- erc7802
- ERC-7802 Cross-Chain Token Standard
- error
- Error types for the token module
- fee_
distribution - Fee processing and distribution
- governance
- On-chain governance system
- liquid_
staking - Liquid staking (stTNZO) implementation
- registry
- Unified Token Registry for cross-VM token management
- rewards
- Reward distribution engine
- seed_
agent - SeedAgent treasury allocation primitive (Agent-Swarm Spec 10 — wave 1).
- seed_
agent_ daemon - SeedAgent provisioning daemon (Agent-Swarm Spec 10 — wave 2, Task #42).
- seed_
agent_ gossip - Gossip wire format for cross-node SeedAgent (Spec 10) propagation.
- staking
- Staking system for validators and service providers
- tnzo
- TNZO token management
- treasury
- Network treasury management
- validator_
registry - Permissionless validator registry — dynamic active-set membership.