Make WarBow flag planting an explicit buy option #63
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#63
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?
Problem
Flag planting is currently treated as automatic on successful TimeCurve buys: every buy updates the pending WarBow flag owner/plant timestamp, and the indexed
Buy.flagPlantedfield is true for every buy.That is not the intended UX/risk model. Planting a flag should be an explicit option attached to a CHARM buy, because if the flag is not defended/claimed correctly the buyer can lose WarBow points. A user placing a normal CHARM buy should not accidentally opt into that WarBow risk.
Desired behavior
Plant WarBow flagoption when the sale is live.Notes
Current docs describe pending holder state from
warbowPendingFlagOwner/warbowPendingFlagPlantAt, and warn thatBuy.flagPlantedis currently true on every successful buy. This issue asks to change the product/contract/UI behavior so planting is opt-in rather than automatic.Acceptance criteria
mentioned in commit
6d52ce6dffImplemented (merged to
main@d2f6675)Summary: WarBow pending-flag planting is now opt-in per buy. Default
buy(charmWad)does not touchwarbowPendingFlag*.Buy.flagPlanted/ indexerflag_plantedmirror the opt-in for that tx.@brouie — please verify on your side (issue stays open).
Checklist for verification
buy(1e18)(or min CHARM) →warbowPendingFlagOwnerstaysaddress(0)unless a prior plant left a holder;Buy.flagPlantedisfalsein the receipt/event.buy(1e18, true)→ pending owner is buyer;Buy.flagPlantedistrue.buy(charmWad, codeHash, false)and(..., true)both succeed when referral valid; flag only sets ontrue.warbowPendingFlagPlantAtunchanged (silence not reset).TimeCurveBuyRouter.buyViaKumbaya(..., plantWarBowFlag, ...)— third arg aftercodeHash;falseleaves flag slot as expected.docs/product/primitives.md,docs/frontend/timecurve-views.md,docs/testing/invariants-and-business-logic.md(#63 section),skills/play-timecurve-warbow/SKILL.md, guardrails item 16.Tests run (agent)
forge testTimeCurve + referral + buy router suites on feature branch (all pass). Localout/permission error on merge machine smoke — CI should run full suite.mentioned in commit
54ba8cd736mentioned in issue #66
@PlasticDigits source-level verification of
d2f6675.Contracts (TimeCurve.sol)
Opt-in plumbing:
Tests
contracts/test/TimeCurve.t.sol covers checklist items 1, 2, 4:
forge: 191/191 passing on FOUNDRY_PROFILE=ci.
Gap noticed: no direct unit test asserts the opt-in semantics on the referral or buyFor router paths (items 3 and 6). Function entry points exist and forge passes the existing referral + router suites, but those tests dont assert flagPlanted=false on plain buys through those entry points specifically. Worth a follow-up unit test like:
Not blocking — the contract logic is shared via _buy, so the L250/L259 tests indirectly cover via the parameter wiring. But explicit assertions would close the gap for future regressions.
Frontend
Simple page (frontend/src/pages/TimeCurveSimplePage.tsx + useTimeCurveSaleSession.ts):
Arena (frontend/src/pages/timeCurveArena/):
Both surfaces match dev's 'checkbox default off, CTA builds correct calldata' AC.
Docs (item 8)
#63 referenced in:
Deferred until #72 lands
Items requiring on-chain tx evidence (live receipts, indexer flag_planted column with real txs, frontend wallet simulation):
These deferred items are fully blocked by #72 EIP-170 contract size launch-blocker - DeployDev fails before any of this can be reached on a live stack. Will close once #72 unblocks the deploy.
Issue stays open.
mentioned in issue #76
mentioned in issue #77
@PlasticDigits per today's process update (file follow-ups, close originals): browser walkthrough items moved to #76, test-coverage gap moved to #77. Source verification (see prior note on this issue) stands.
Closing #63. Live walkthrough proceeds via #76 once a frontend session captures tx receipts; test gap fixes via #77.
mentioned in issue #65
mentioned in issue #218
mentioned in issue #370