Document doubOwedForBuy mutability and TWAP usage #315
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#315
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
doubOwedForBuy(uint256 charmWad) external returns (uint256)— notviewbecause_sampleCharmAnchor()may call Kumbaya/TWAP externals (TimeArena.solL311–318).TimeArenaBuyRouter.buyViaKumbayauses this for pricing (TimeArenaBuyRouter.solL101).eth_callstaticcall compatibility.Why needed
Approved: Check when TWAP is needed and document mutability/view semantics for integrators and indexers.
Constraints / guardrails
viewif no state mutation occurs (current code does not write state in preview path).effectiveCharmPriceWad().docs/integrations/kumbaya.mdand router ABI notes.Relevant files
contracts/src/arena/TimeArena.sol—doubOwedForBuy,_sampleCharmAnchor,_willLastBuyHardResetcontracts/src/arena/TimeArenaBuyRouter.solcontracts/test/TimeArenaEpochCharmPrice.t.solindexer/decoder if ABI changesfrontend/buy preview callersRecommended direction
view(or adddoubOwedForBuyViewpure preview).PARAMETERS.mdand integration docs.doubOwedForBuyoutput to actualbuycost at boundary epochs.Acceptance criteria
Test plan
cd contracts && forge test --match-contract TimeArenaEpochCharmPrice.bash scripts/verify-time-arena-buy-router-anvil.shif router ABI changes.Attack / abuse test plan
Verification criteria
PARAMETERS.mdexplain non-view vs view decision.doubOwedForBuy(charm) ==actual DOUB pulled on immediatebuy.mentioned in issue #309
mentioned in commit
1e966591d1mentioned in merge request !459
mentioned in commit
97d56f93ffmentioned in merge request !474
mentioned in commit
bc74435db9mentioned in merge request !466
mentioned in commit
1a4c39440bmentioned in commit
2f53f814dfmentioned in issue #325
mentioned in issue #341
mentioned in merge request !523