Route buy prize remainder to Last Buy category #473
No reviewers
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!473
Loading…
Reference in a new issue
No description provided.
Delete branch "verify/issue-313-last-buy-remainder"
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?
Summary
ArenaBuyRouting.splitBuyAmountassigns cross-category remainder (amount % 4) to Last Buy (cat 0) instead of WarBow (cat 3).testFuzz_split_remainder_on_cat0.PARAMETERS.md, product docs, invariants, and onchain fee/security docs with approved #313 economics.Verification checklist
amount % 4wei routes to Last Buy vault/trancheArenaBuyRouting.solL31:i == 0 ? catRem : 0;test_split_remainder_to_last_buy_and_t10_tranche(1003 → cat0=253)cd contracts && forge test --match-contract ArenaPrizeRoutingbuy_routesintegration tests passcd contracts && forge test --match-test buy_routesamountexactlytestFuzz_splitBuy_no_dusttestFuzz_split_remainder_on_cat0PARAMETERS.mdmatches codedocs/product/time-arena.md,docs/product/arena-v2.mdtestFuzz_splitBuy_no_dust,test_buy_routes_doub_split(0% admin, full sum)Follow-ups
None — remainder target is now consistent across code, fuzz tests, and product docs.
changed the description
changed the description
Security review — MR !473
Commit reviewed:
6ac39067246979ae786013eb0cc1c7f081f7d30aScope:
ArenaBuyRouting.splitBuyAmountremainder target (amount % 4wei → category 0 instead of category 3), associated Forge fuzz/unit tests, and documentation alignment for #313.Method: Traced attacker-controlled buy
amountthroughTimeArena._buyDoub→_routeDoubPrizeSplit→ArenaBuyRouting.splitBuyAmount→PodiumVaultstransfers/events. Checked conservation (no stranded DOUB), access control, reentrancy/CEI, fee-on-transfer parity, indexer ingest (event-sourcedPodiumEpochFunded), and offchain recompute surfaces.Outcome: FINDINGS: 0 medium+
Inline threads: None (no medium+ issues on this diff).
Summary
This MR is an intentional rounding-direction change only: cross-category remainder (0–3 wei per buy) moves from WarBow (cat 3) to Last Buy (cat 0).
testFuzz_splitBuy_no_dustandtestFuzz_split_remainder_on_cat0preserve exact 100% routing;_pullDoubExact+safeTransfersemantics are unchanged. No new external call surfaces, auth gaps, injection paths, or exploitable economic leverage—the remainder is negligible and still fully paid by the buyer into podium vaults. Indexer vault-funding rows derive from on-chain events, not a hardcoded split mirror.Prior MR security-review threads: none to re-report.
added 31 commits
main15e2998f- Merge main into verify/issue-313-last-buy-remainderCompare with previous version
Resolved merge conflicts with
main(6 doc files).#314AdminSellVault-not-deployed invariant, combinedtime-arenabuy table row, andtestFuzz_epoch_split_per_category_bps/testFuzz_split_remainder_on_cat0in invariant evidence.forge test --match-contract ArenaPrizeRouting: 7/7 PASSSecurity review — MR !473
Commit reviewed:
15e2998f9bfa213471e487979c64e3cd99856499Scope: Full MR intent (#313):
ArenaBuyRouting.splitBuyAmountcross-category remainder (amount % 4, 0–3 wei) routed to Last Buy (cat 0) instead of WarBow (cat 3); Forge fuzz/unit coverage; documentation and invariant alignment. Post-merge diff vsmainis docs +testFuzz_split_remainder_on_cat0; on-chain routing change is in branch commit6ac39067(already present on target).Method: Traced attacker-controlled buy
amount(charmWad→_pullDoubExact→_routeDoubPrizeSplit→ArenaBuyRouting.splitBuyAmount→PodiumVaultstransfers/PodiumEpochFunded). Verified 100% conservation (testFuzz_splitBuy_no_dust,testFuzz_split_remainder_on_cat0), ERC-20 parity gate on pulls, unchanged access control/reentrancy surfaces, and indexer ingest (event-sourced vault funding, no offchain split mirror). Checked WarBow spend paths and integration tests (test_buy_routes_*).Outcome: FINDINGS: 0 medium+
Inline threads: None (no medium+ issues on this diff).
Summary
Intentional rounding-direction change only: negligible remainder wei (max 3 per buy) shifts from WarBow to Last Buy while total routed DOUB still equals gross paid amount. Buyer cannot recover remainder; choosing
amount % 4offers no exploitable economic leverage at this scale. No new external-call/auth/injection paths;_pullDoubExactfee-on-transfer rejection unchanged. Indexer/UI derive funding from on-chain events, not a hardcoded WarBow-remainder assumption.Prior MR security-review thread (
6ac39067): no findings to re-report; merge-conflict resolution added docs/invariant evidence only.added 23 commits
mainfdcb5589- Merge main into verify/issue-313-last-buy-remainderCompare with previous version
Resolved merge conflicts with
main.Conflict:
docs/product/arena-v2.md— both branches documented remainder → Last Buy (#313); kept that wording and retainedmain'sArenaBuyRouting.splitBuyAmountcross-reference.Verification:
forge test --match-contract ArenaPrizeRouting— 7/7 PASS.changed the description
Security review — MR !473
Commit reviewed:
fdcb5589917894976be9e637eec5a8ece7bdcb55Scope: GitLab #313 buy prize routing — cross-category remainder (
amount % 4, 0–3 wei) assigned to Last Buy (cat 0) instead of WarBow (cat 3). Current diff vsmain: docs/invariant alignment +testFuzz_split_remainder_on_cat0; on-chain change in branch commit6ac39067(ArenaBuyRouting.splitBuyAmountL31:i == 0 ? catRem : 0).Method: Traced attacker-controlled buy/spend
amountthrough_pullDoubExact→_routeDoubPrizeSplit/_routeWarbowDoubSpend→ArenaBuyRouting.splitBuyAmount→PodiumVaultstransfers andPodiumEpochFundedevents. Verified 100% conservation (testFuzz_splitBuy_no_dust,testFuzz_split_remainder_on_cat0,testFuzz_epoch_split_per_category_bps), ERC-20 parity gate on pulls, unchangednonReentrant/access-control surfaces, batch-vault fast path, and indexer ingest (event-sourcedidx_arena_vault_funding, no offchain split mirror). Ranforge test --match-contract ArenaPrizeRoutingand--match-test buy_routes— PASS.Outcome: FINDINGS: 0 medium+
Inline threads: None (no medium+ issues on this diff).
Summary
Intentional rounding-direction change only: negligible remainder wei (max 3 per buy) shifts from WarBow to Last Buy while gross routed DOUB still equals paid amount. Buyer cannot recover remainder; choosing
amount % 4offers no exploitable economic leverage at this scale. No new external-call, auth, reentrancy, or injection paths introduced. Indexer/UI derive vault funding from on-chain events, not a hardcoded WarBow-remainder assumption.Prior MR security-review threads (
6ac39067,15e2998f): no findings to re-report.mentioned in commit
9d1e43cac9