feat: add per-wallet buy cooldown (#issue) - #852
Merged
Chucks1093 merged 5 commits intoSep 5, 2026
Conversation
- Add CooldownError enum (CooldownActive, CooldownTooLong, NotRegistered) - Add MAX_BUY_COOLDOWN_LEDGERS constant (720 ledgers ≈ 1 hour) - Add LastBuyLedger(Address, Address) and BuyCooldown(Address) DataKey variants - Add constants::storage::last_buy_ledger() and buy_cooldown() accessors - Enforce cooldown in buy_key: rejects with CooldownActive and emits cooldown_blocked event (wallet, creator_id, ledgers_remaining) - Write last_buy_ledger on every successful buy - Add set_buy_cooldown entrypoint (creator-only, 0–720 range) - Add get_buy_cooldown read-only view - Add CooldownBlockedEvent and cooldown_blocked_topics to events.rs - Add full integration test suite in tests/buy_cooldown.rs covering all ACs
- Add CooldownActive = 36 to ContractError enum (was missing, gap between 35 and 37) - Remove duplicate RoyaltyConfig and CurveExponent from DataKey enum - Add missing DataKey variants: StakePosition, StakingRewardsPool, CreatedAtLedger, LaunchPenaltyBps, StakeUnlockLedger, TotalStaked, AuctionConfig - Remove duplicate holder_cap_bps and last_buy_timestamp storage fns - Add missing storage fns: total_staked, stake_unlock_ledger, auction_config - Add AuctionPurchaseEvent and auction_purchase_topics to events.rs
…in buy_cooldown tests
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was added in this single commit:
closes #830