Route buy prize remainder to Last Buy category #313
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#313
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Gap analysis follow-up from #309.
Current codebase
ArenaBuyRouting.splitBuyAmountassigns cross-category remainderamount % 4to category 3 (WarBow) (contracts/src/arena/libraries/ArenaBuyRouting.solL23–35).ArenaPrizeRouting.t.solandTimeArena.t.solassert current WarBow remainder behavior.Why needed
Approved: Prize-routing remainder target should go to Last Buy (category 0), not WarBow. Spec was wrong; code must align with approved economics.
Constraints / guardrails
contracts/PARAMETERS.md,docs/product/time-arena.md, andarena-v2.mdconsistently.Relevant files
contracts/src/arena/libraries/ArenaBuyRouting.solcontracts/src/arena/libraries/ArenaPodiumSettlement.solcontracts/test/ArenaPrizeRouting.t.solcontracts/test/TimeArena.t.solcontracts/PARAMETERS.mdRecommended direction
splitBuyAmountremainder assignment from cat 3 to cat 0 (Last Buy).Acceptance criteria
amount % 4wei routes to Last Buy vault/tranche.Test plan
cd contracts && forge test --match-contract ArenaPrizeRouting.cd contracts && forge test --match-test buy_routes.Attack / abuse test plan
amountvalues; sum of four category shares equalsamountexactly.TimeArena.Verification criteria
PARAMETERS.mdmatches code.mentioned in issue #309
mentioned in merge request !458
mentioned in commit
729570edf4mentioned in commit
868a79120cmentioned in merge request !464
mentioned in commit
6ac3906724mentioned in merge request !473
mentioned in commit
bc74435db9mentioned in merge request !466
mentioned in commit
15e2998f9bmentioned in commit
fdcb558991mentioned in commit
ac639db066mentioned in merge request !476
mentioned in merge request !485
mentioned in commit
24dca3ef0bmentioned in commit
8ee5e455acmentioned in merge request !486
Verification complete — GitLab #313
Verified on
main(clean working tree, no MR required).Acceptance criteria
amount % 4wei routes to Last Buy vault/trancheArenaBuyRouting.splitBuyAmountassignscatRem = amount % 4to category 0 (i == 0 ? catRem : 0). Unit testtest_split_remainder_to_last_buy_and_t10_tranche(1003 → cat 0 share 253, cat 3 share 250).cd contracts && forge test --match-contract ArenaPrizeRouting— 7/7 passed.cd contracts && forge test --match-test buy_routes— 2/2 passed (test_buy_routes_doub_split,test_buy_routes_epoch_tranches_worked_example).contracts/PARAMETERS.mdL19;docs/product/time-arena.mdL51;docs/product/arena-v2.mdL48;docs/testing/invariants-and-business-logic.mdINV-ARENA-PRIZE-ROUTING-300-25PCTall state remainder → Last Buy (cat 0).Verification criteria (attack / fuzz)
amountexactlytestFuzz_splitBuy_no_dust(256 runs)testFuzz_split_remainder_on_cat0(256 runs) +testFuzz_epoch_split_per_category_bpsasserts cat 0 getsbaseShare + catRemwhencatRem > 0PARAMETERS.mdmatches codeArenaBuyRouting.solL10–34test_buy_routes_doub_split— 0% admin, 100% to vaults, 12PodiumEpochFundedeventsManual / infra
Commands run
Closing — implementation already on
main.