Overview
Add a Dutch-auction mechanism for token burns, used as an on-chain, transparent price-discovery method:
- Admin creates an auction specifying the token, burn amount, start price, reserve price, and duration.
- The current price decreases linearly from
start_price to reserve_price over the auction duration.
- Any bidder who pays the current price wins the auction immediately.
- The winning bid amount is burned from the token supply.
Scope: contract only. No backend or frontend integration is required for this feature.
This feature is conceptually related to the Commit-Reveal Auction Tie-Breaking issue — that module is designed to resolve simultaneous-bid ties for auction-style mechanisms like this one. Check whether it's a hard dependency before deciding whether to pick up both together.
Integration points
- New module file
contracts/token-factory/src/burn_auction.rs, declared via mod burn_auction; in lib.rs
- Public
#[contractimpl] entry points added to the TokenFactory impl block in lib.rs (create auction, bid/win, price query, cancel/expire)
- New
DataKey variants added to types.rs for auction state — do not reuse existing discriminants
- New
Error variants added to types.rs starting at 133 (current highest in-use code is 132), with matching entries added to Error::name()
- Storage getters/setters added in
storage.rs following the existing pattern
- Events emitted via
events.rs using short symbol_short! topic names (Soroban's 9-character limit)
- Winning bid should burn from supply via the existing
burn.rs module rather than a parallel burn implementation
Acceptance criteria
Notes for implementers
- Good edge cases to seed fuzzing/property tests with: a bid placed below the current reserve-decayed price, arithmetic overflow on a very large bid amount, the price decay curve hitting its reserve floor exactly, and a zero-duration auction. Make sure the implementation handles all four correctly before considering this done.
Overview
Add a Dutch-auction mechanism for token burns, used as an on-chain, transparent price-discovery method:
start_pricetoreserve_priceover the auction duration.Scope: contract only. No backend or frontend integration is required for this feature.
This feature is conceptually related to the Commit-Reveal Auction Tie-Breaking issue — that module is designed to resolve simultaneous-bid ties for auction-style mechanisms like this one. Check whether it's a hard dependency before deciding whether to pick up both together.
Integration points
contracts/token-factory/src/burn_auction.rs, declared viamod burn_auction;inlib.rs#[contractimpl]entry points added to theTokenFactoryimpl block inlib.rs(create auction, bid/win, price query, cancel/expire)DataKeyvariants added totypes.rsfor auction state — do not reuse existing discriminantsErrorvariants added totypes.rsstarting at 133 (current highest in-use code is132), with matching entries added toError::name()storage.rsfollowing the existing patternevents.rsusing shortsymbol_short!topic names (Soroban's 9-character limit)burn.rsmodule rather than a parallel burn implementationAcceptance criteria
burn_auction.rsimplemented undercontracts/token-factory/src/, wired intolib.rsDataKey/Erroradditions follow the checklist aboveburn.rsburn_auction_test.rscovering: linear price decay over time, winning bid at/above current price, bid-below-current-price rejection, expiry with no winner, reserve-price floorfuzz_burn_auction.rs) with a seed corpus covering at least: a bid below reserve price, bid-amount overflow, decay reaching the reserve floor, and a zero-duration auction — wired into.github/workflows/fuzz-testing.ymlif addedcargo check --libandcargo test --libclean incontracts/token-factorycargo build --target wasm32v1-none --release --libsucceedsNotes for implementers