Kuma Protocol
WebsiteTwitterGovernance Forum
  • Introduction
  • KUMA Protocol
    • How does it work ?
    • Regulated NFTs
      • Real World Assets, onchain
      • Mimo Capital AG, a regulated entity
      • KUMA NFTs
    • Composable Interest-bearing tokens
      • KUMA Swap
        • User Scenario 1: Kuma Bond Token With Swap
      • KUMA Interest-bearing tokens
        • USK
        • FRK
        • EGK
      • Interest accrual
    • DeFi Integrations
      • DEXes Protocols
      • CDP Protocols
      • Lending Protocols
      • Yield Aggregators Protocols
      • Fixed Yield Protocols
      • Bridges
  • DAO & Governance
    • What is MIMO (Governance Token) ?
      • Where can i get MIMO ?
    • vMIMO and Voting Power
    • Governance process
      • Govern with MIMO tokens
    • Proposal Framework
      • KUMA Integration Request (KIR)
      • KUMA Governance Proposal (KGP)
      • KUMA Improvement Protocol (KIP)
    • Multisig
    • KUMA Emergency Guardians
  • developers
    • Developer Guide
    • Smart Contract Architecture
      • KUMA Interest Bearing Token (KIBT)
        • Interest Bearing Logic
        • ERC-20 Compliance and Updates
        • Balance Accounting
      • Decentralized Access Control
        • Pause/Unpause Access Control
      • KUMASwap
        • sellBond
        • buyBond
      • KUMA Bond Clone Tokens (KBCT)
      • Keepers
      • Deprecation Mode
      • Rate Feed
        • Central Bank Rate Validation
        • MCAGAggregator Volatility Check
    • Code Repositories
    • Contract Addresses
      • Ethereum
      • Polygon PoS
      • Linea
      • Mantle
      • Telos EVM
      • Neon EVM
  • Ressources
    • User Guides
      • Setting up
      • Managing transactions on EVM chains
      • Troubleshooting
      • Lock MIMO for vMIMO
    • Links
    • Security & Audits
    • Glossary
    • Press Kit
Powered by GitBook
On this page
  1. developers
  2. Smart Contract Architecture
  3. KUMA Interest Bearing Token (KIBT)

Balance Accounting

Balance Accounting

A baseBalances mapping stores the time-discounted cumulative yield earned at the latest transfer, mint or burn for an address. When multiplied by the cumulative yield, this baseBalances mapping returns the accrued rewards. To avoid any rounding errors caused by storing this intermediate state between balanceOf reads, baseBalances is stored in 27 decimals. This gives high enough accuracy so that the 18 decimal values returned by balanceOf are always accurate when formatted to 18 decimals. WadRayMath is used to convert and operate on and 27 and 18 decimal values.

PreviousERC-20 Compliance and UpdatesNextDecentralized Access Control

Last updated 1 year ago