/ abzu-token / src / lib.rs
lib.rs
 1  //! # ABZU Token
 2  //!
 3  //! Mesh service credits — utility token for compute, storage, and privacy.
 4  //!
 5  //! ## Philosophy
 6  //!
 7  //! ABZU is **not** an investment. It is a service credit.
 8  //! Like cloud computing credits, transit passes, or prepaid phone minutes —
 9  //! you acquire ABZU to **use mesh services**, not to hold and hope for appreciation.
10  //!
11  //! ## Core Types
12  //!
13  //! - [`Balance`] — Token amount with 18 decimal precision
14  //! - [`Ledger`] — Trait for balance storage backends
15  //! - [`ReputationBond`] — Locked capital for provider trust
16  //! - [`ServiceOffer`] — Advertised service with price
17  //! - [`BondingCurve`] — Year 1 price discovery (sunsets after bootstrap)
18  //!
19  //! ## Anti-Ponzi Design
20  //!
21  //! - Fixed supply (1 trillion ABZU)
22  //! - No staking yields (bonds are lock-only, no rewards)
23  //! - No emissions (no inflation)
24  //! - Utility-first (consumed, not held)
25  
26  pub mod balance;
27  pub mod bond;
28  pub mod curve;
29  pub mod error;
30  pub mod ledger;
31  pub mod marketplace;
32  
33  // Re-exports
34  pub mod sled_ledger;
35  
36  // Re-exports
37  pub use balance::Balance;
38  pub use bond::{BondState, ReputationBond};
39  pub use curve::{BondingCurve, CurveConfig, CurveShape, CurveState};
40  pub use error::TokenError;
41  pub use ledger::{Ledger, MemoryLedger};
42  pub use marketplace::{OfferQuery, OfferRegistry, PricingUnit, ServiceCategory, ServiceOffer};
43  pub use sled_ledger::SledLedger;
44  
45  /// Convenient type alias
46  pub type Error = TokenError;
47  
48  /// Result type for token operations
49  pub type Result<T> = std::result::Result<T, Error>;
50  
51  /// Total supply: 1 trillion ABZU (fixed forever)
52  pub const TOTAL_SUPPLY: u128 = 1_000_000_000_000_000_000_000_000_000_000; // 1T with 18 decimals
53  
54  /// Decimals: 18 (like ETH)
55  pub const DECIMALS: u8 = 18;
56  
57  /// Smallest unit name
58  pub const SMALLEST_UNIT: &str = "drop";