Skip to content

feat: add AuctionStorage and remove ValueX7Lib#328

Open
zhongeric wants to merge 3 commits intofeat/rolloverfrom
feat/rm-x7-lib
Open

feat: add AuctionStorage and remove ValueX7Lib#328
zhongeric wants to merge 3 commits intofeat/rolloverfrom
feat/rm-x7-lib

Conversation

@zhongeric
Copy link
Contributor

@zhongeric zhongeric commented Mar 19, 2026

Summary

  • Extract auction state variables ($currencyRaisedQ96X7, $totalClearedQ96X7, $sumCurrencyDemandAboveClearingQ96, $clearingPrice, $_tokensReceived) and their public view getters into a new AuctionStorage abstract contract with a corresponding IAuctionStorage interface
  • Remove ValueX7Lib library entirely — inline the / Q96 / MPS math directly in view functions (currencyRaised(), totalCleared(), remainingSupply()) instead of chaining divUint256() and scaleDownToUint256()
  • Remove the divUint256 free function from ValueX7Lib.sol, keeping only add and saturatingSub
  • Rename Q96_X7Q96X7 across storage variables, struct fields, and interfaces

Test plan

  • All existing tests pass
  • Verify view functions (currencyRaised, totalCleared, remainingSupply) return identical values to before

@zhongeric zhongeric changed the base branch from fix/rollover-demand to feat/rollover March 19, 2026 02:00
@zhongeric zhongeric marked this pull request as ready for review March 19, 2026 02:21
@zhongeric zhongeric requested a review from a team as a code owner March 19, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant