Title
[BFT-A][R9] Implement canonical BUY_CBE issuance per mint-on-buy spec
Category
- R9 Negative Spec Enforcement
Authoritative Inputs
CBE Bonding Curve — Complete Formula Reference section 5
CBE Bonding Curve — Rust Implementation Specification section 5
- Team decision:
GRAD_THRESHOLD = 2_745_966 * SCALE
Problem
The current issue incorrectly framed SELL_CBE as something to remove. The new docs clearly define BUY_CBE first, with exact reserve/treasury split, buyer/SOV token split, state checkpointing, and post-commit graduation.
Current Behavior
There is no working canonical BUY_CBE path that matches the documented fixed-width transaction, fee model, split rules, slippage behavior, and state transition ordering.
Required Behavior
Implement BUY_CBE exactly as specified:
- fee deduction from buyer
balance_sov into dao_treasury_sov
- reserve/treasury split using
RHO
- multi-band mint computation using reserve credit only
expected_s_c stale-state check
- buyer/SOV token split using
ALPHA
- compute
buyer_tokens via ratio and sov_tokens by subtraction to preserve exact sum
- buyer slippage check using the documented formula:
buyer_effective = amount_in * SCALE / buyer_tokens
- reject if
buyer_effective > max_price
- atomic state commit
- graduation check on
reserve_balance >= 2_745_966 * SCALE
Safety Impact
Without the documented BUY_CBE path, supply, reserve, treasury, and graduation semantics remain undefined.
Proposed Fix
Implement BUY_CBE in the dedicated curve executor lane and remove old shortcut/approximation behavior.
Dependencies
Acceptance Criteria
Test Plan
- Zero-input rejection
- Stale-state rejection
- Slippage rejection using the documented effective-price formula
- Exact mint vectors
- Max-supply rejection
- Graduation threshold transition tests using
2_745_966 * SCALE
Cleanup After
- Remove old buy-path semantics that bypass reserve split, checkpointing, buyer/SOV token distribution, or the documented slippage formula
Title
[BFT-A][R9] Implement canonical BUY_CBE issuance per mint-on-buy spec
Category
Authoritative Inputs
CBE Bonding Curve — Complete Formula Referencesection 5CBE Bonding Curve — Rust Implementation Specificationsection 5GRAD_THRESHOLD = 2_745_966 * SCALEProblem
The current issue incorrectly framed
SELL_CBEas something to remove. The new docs clearly defineBUY_CBEfirst, with exact reserve/treasury split, buyer/SOV token split, state checkpointing, and post-commit graduation.Current Behavior
There is no working canonical
BUY_CBEpath that matches the documented fixed-width transaction, fee model, split rules, slippage behavior, and state transition ordering.Required Behavior
Implement
BUY_CBEexactly as specified:balance_sovintodao_treasury_sovRHOexpected_s_cstale-state checkALPHAbuyer_tokensvia ratio andsov_tokensby subtraction to preserve exact sumbuyer_effective = amount_in * SCALE / buyer_tokensbuyer_effective > max_pricereserve_balance >= 2_745_966 * SCALESafety Impact
Without the documented
BUY_CBEpath, supply, reserve, treasury, and graduation semantics remain undefined.Proposed Fix
Implement
BUY_CBEin the dedicated curve executor lane and remove old shortcut/approximation behavior.Dependencies
Acceptance Criteria
BUY_CBEworks end to end from fixed-width bytes to atomic state commitamount_intotal_delta_sexpected_s_c, max-price slippage, supply limit, and zero-mint checks are enforcedreserve_balance >= 2_745_966 * SCALETest Plan
2_745_966 * SCALECleanup After