The BurnManager is the canonical accounting contract for all token burns in the YouthChain ecosystem. Every burn — AMM swap fees, slashing, governance proposal stakes — flows through here so you can read total network deflation from one place.

Why use this

You can always track burns by reading totalBurned() on each token. But the BurnManager adds:
  • Source attribution: was this burn from the AMM, slashing, or governance?
  • Single read: one event log to subscribe to instead of N
  • Display-friendly: dashboards aggregate burn velocity across all sources

Read methods

totalBurned() view returns (uint256)

All-time burned tokens, summed across all sources, in wei.

burnsBySource(uint8 source) view returns (uint256)

Burned amount filtered by source enum:
  • 0 = AMM_SWAP
  • 1 = SLASHING
  • 2 = GOVERNANCE
  • 3 = OTHER

Write methods (authorized contracts only)

recordBurn(address token, uint256 amount, Source source) external

Called by registered source contracts (AMM pool, ValidatorRegistry, etc.) after they execute the burn on the underlying token. Just records — does not call burn() itself.

recordBurnFrom(address token, address from, uint256 amount, Source source) external

Same as above but tracks the original holder.

Events

Mobile apps can subscribe to this for a real-time “tokens burned” counter.

Admin methods