Wallet cooldown: one buy per wallet every 5 minutes #33
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#33
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?
Summary
Enforce a per-wallet cooldown so each wallet can only execute a buy once every 5 minutes (rolling window or fixed interval—TBD during implementation).
Motivation
Reduce rapid repeat buys from the same address (abuse, MEV-adjacent behavior, or unfair pacing) and align sale UX with intended pacing.
Scope (likely touch points)
Acceptance criteria (draft)
Notes
Issue #33 — per-wallet buy cooldown (status)
Implemented and on
main(contracts were already merged; latest commit adds frontend UX, bots, docs).Onchain (already deployed in repo)
buyCooldownSec(immutable, dev default 300),nextBuyAllowedAt(address), revertTimeCurve: buy cooldown.Frontend
useTimecurveHeroTimerexposeschainNowSec(same skew as hero countdown); wallet cooldown row under primary timer when connected + sale live.finalizeCharmSpendForBuy; buy disabled during cooldown; ABIs + reads for cooldown fields.Bots
timecurve.json+actions.buywaits untilblock.timestamp >= nextBuyAllowedAt.Docs / skills
primitives.md,PARAMETERS.md,invariants-and-business-logic.md,play-timecurve-doubloonskill, security model one-liner.@brouie please verify behavior on your side; leaving this issue open per request.
Refs:
TimeCurve.sol,TimeCurvePage.tsx,useTimecurveHeroTimer.ts,timeCurveBuyAmount.ts,bots/timecurve/....@PlasticDigits verified cooldown implementation on
66c264d.Contract (
TimeCurve.sol):uint256 public immutable buyCooldownSec— constructor parammapping(address => uint256) public nextBuyAllowedAt— per-wallet watermarkrequire(block.timestamp >= nextBuyAllowedAt[msg.sender], "TimeCurve: buy cooldown")at start ofbuy()nextBuyAllowedAt[msg.sender] = block.timestamp + buyCooldownSecat end ofbuy()require(_buyCooldownSec > 0)prevents zero-cooldown deploys0for new wallets correctly means "never bought = always eligible"Tests (
TimeCurve.t.sol):test_constructor_zero_buy_cooldown_reverts✅test_buy_cooldown_same_wallet_blocks_rapid_repeat✅test_buy_cooldown_boundary_elapses(tests the>=condition at exact boundary) ✅test_buy_cooldown_independent_wallets(per-wallet, not global) ✅test_timer_cap_fuzzupdated to use monotonic clock for fuzz+cooldown compat ✅Full test run:
Implementation matches the issue spec exactly. Closing.
@PlasticDigits ready for you to close this one — 403 on my end per usual for reporter perms on YO.
mentioned in commit
39dd51b9a1mentioned in issue #99