Document doubOwedForBuy view semantics and hard-reset preview parity #474
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!474
Loading…
Reference in a new issue
No description provided.
Delete branch "verify/issue-315-doub-owed-preview"
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
TimeArena.doubOwedForBuyview(staticcall-safe) — external TWAP/spot reads in_sampleCharmAnchordo not mutate state.effectiveCharmPriceWad()in NatSpec,PARAMETERS.md,kumbaya.md, and invariants (INV-TIME-ARENA-DOUB-OWED-PREVIEW).doubOwedForBuy(charm)equals immediatebuyDOUB pull within epoch and at hard-reset boundary.TimeArenaABI JSON (doubOwedForBuy→stateMutability: view).Verification checklist (issue #315)
doubOwedForBuy/_sampleCharmAnchor;PARAMETERS.md;kumbaya.md§ doubOwedForBuy; invariants §315doubOwedForBuyisview; ABIstateMutability: viewcd contracts && forge test --match-contract TimeArenaEpochCharmPrice—test_doubOwedForBuy_matches_buy_at_hard_reset_boundary,test_doubOwedForBuy_matches_buy_within_epochPARAMETERS.mdrowdoubOwedForBuy(charm) ==actual DOUB on immediatebuytest_doubOwedForBuy_matches_buy_*bash scripts/verify-time-arena-buy-router-anvil.shkumbaya.md+ invariants §315 manipulation notechanged the description
changed the description
Security review — MR !474
Commit reviewed:
0722599ccd5598148b1ec4fa2f33ca5b6b888692Scope:
TimeArena.doubOwedForBuy/_sampleCharmAnchorviewmutability; NatSpec + docs (PARAMETERS.md,kumbaya.md, invariants); parity Forge tests; ABI JSON sync; router comment only.Outcome:
FINDINGS: 0medium+Summary
Reviewed attacker-controlled inputs through pricing sinks (
doubOwedForBuy→_sampleCharmAnchor/effectiveCharmPriceWad;TimeArenaBuyRouter.buyViaKumbaya→buyFor→_buyDoub→_pullDoubExact). This MR does not alter buy routing, DOUB pull math, re-anchor logic, or oracle libraries — it correctly marks already read-only preview paths asviewand documents hard-reset preview parity.Checked (no exploitable path on this diff):
_sampleCharmAnchor()before state writes;_buyDoubcalls_prepareBuyBeforeTimer()→_reanchorEpochCharmPrice()(same anchor) theneffectiveCharmPriceWad()atepochAnchorTimestamp == block.timestamp. Parity tests pass (TimeArenaEpochCharmPrice.t.sol::test_doubOwedForBuy_matches_buy_*).buyViaKumbayareadsdoubOwedForBuyand callsbuyForin onenonReentranttx — no cross-tx preview/execution gap for router sizing.ArenaCharmPriceTwap); documented same-block preview assumption is consistent with in-tx reads. Not introduced by this MR.buyForremains router-gated;viewdoes not weakennonReentrantonbuypaths.Prior security threads: None on this MR.
Inline findings: None (no medium+ issues to thread).
Resolved merge conflicts with
main(4 files):contracts/PARAMETERS.md— kept main's expandeddoubOwedForBuyrow (780s band + router sizing note).contracts/src/arena/TimeArena.sol— merged NatSpec from both sides; retained_sampleCharmAnchorpreview comment.docs/testing/invariants-and-business-logic.md— kept main's §315 section (timearena-doub-owed-preview-gitlab-315).frontend/public/abis/TimeArena.json— rebased on main ABI (drops staleadminSellVault/initializeargs) withdoubOwedForBuy→view.Also deduped auto-merged
TimeArenaEpochCharmPrice.t.soltests and duplicatekumbaya.md§315 paragraph.Sanity:
forge test --match-contract TimeArenaEpochCharmPrice— 9/9 PASS.added 31 commits
main1a4c3944- Merge branch 'main' into verify/issue-315-doub-owed-previewCompare with previous version
changed the description
Security review — MR !474
Commit reviewed:
1a4c39440bea263030dec905967bbabf7b5c2e0fDiff base:
8dd5705214196809a61134461e8b737f83eae5b7(post-merge withmain)Scope: NatSpec on
TimeArena.doubOwedForBuy/_sampleCharmAnchor; router comment;kumbaya.mdwhitespace;TimeArenaABI JSON sync (doubOwedForBuy→stateMutability: view). No Solidity logic changes vs base.Outcome:
FINDINGS: 0medium+Summary
Re-reviewed attacker-controlled inputs through pricing sinks (
doubOwedForBuy→_sampleCharmAnchor/effectiveCharmPriceWad;TimeArenaBuyRouter.buyViaKumbaya→buyFor→_buyDoub→_pullDoubExact). This MR delta is documentation and ABI metadata only — buy routing, DOUB pull math, re-anchor logic, and oracle libraries are unchanged from base.Checked (no exploitable path on this diff):
_sampleCharmAnchor()before state writes;_buyDoubcalls_prepareBuyBeforeTimer()→_reanchorEpochCharmPrice()(same anchor) theneffectiveCharmPriceWad()atepochAnchorTimestamp == block.timestamp. Covered byTimeArenaEpochCharmPrice.t.sol::test_doubOwedForBuy_matches_buy_*(on branch; not in this delta).buyViaKumbayareadsdoubOwedForBuyand callsbuyForin onenonReentranttx — no cross-tx preview/execution gap for router sizing.ArenaCharmPriceTwap); documented same-block preview assumption is consistent with in-tx reads. Not introduced by this MR.buyForremains router-gated;viewmutability unchanged from base.Prior security threads: Top-level review at
0722599c(pre-merge) — same outcome; no inline findings. Re-validated after merge commit1a4c3944.Inline findings: None (no medium+ issues to thread).
mentioned in commit
2f53f814df