Repository navigation
feat: add timestamp-based trade cooldown enforcement (issue #974) - #991
Merged
Chucks1093 merged 5 commits intoOct 2, 2026
Merged
Chucks1093 merged 5 commits into
Chucks1093 merged 5 commits into
Conversation
|
@funds0033-cmyk Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Resolved merge conflicts in: - creator-keys/src/events.rs: Combined cooldown enforcement events with main branch events (graduated curve, leaderboard, platform pause, vault rebalancing, dynamic fee tiers, staking NFT, curve reset, key rating) - creator-keys/src/lib.rs: Combined cooldown duration/trade timestamp DataKey variants with main branch variants (staking, vault, fee tiers, curve reset, etc.) and merged buy logic to include both cooldown timestamp update and supply cap reached event Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
@Chucks1093 pls kindly merge |
- Removed extra closing brace in events.rs (line 3756) - Ran cargo fmt to fix formatting issues in lib.rs and trade_cooldown.rs Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…contracts into feat/cooldown-enforcement-974
…oan guard The flash loan guard checks ledger sequence numbers (not timestamps) and runs before the cooldown check in sell_key. Tests only advanced the timestamp, causing the flash loan guard to trigger first. Now tests advance both timestamp and ledger sequence to properly test cooldown behavior. Fixes failing tests: - test_sell_blocked_within_cooldown_window - test_sell_succeeds_after_cooldown_expires Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Summary
Completes the trade cooldown implementation by enforcing cooldown checks prior to trade execution and recording
last_trade_timestampstate on both buy and sell completion paths.What Was Done
1. Cooldown Enforcement (Task #4)
Buy Operations (
buy_keys_with_referrer&buy_key_with_referrer):Added the trade cooldown guard immediately following the whitelist verification.
Ensures buyers respect the configured cooldown window before executing key purchases.
Sell Operations (
sell_key):Inserted the trade cooldown check after the anti-flash-loan lockup validation and before reading
base_price.2. State Timestamp Updates (Task #5)
Buy Path:
Updated
last_trade_timestampalongsidelast_buy_timestampstate writes upon key acquisition in both single-key and batch purchase workflows.Sell Path:
Stamp
last_trade_timestampprior to publishingKeysSoldEventonce fee and penalty accounting completes.3. Unit Test Suite
TradeCooldownActive).Acceptance Criteria Checklist
buy_keys_with_referrer,buy_key_with_referrer, andsell_key.last_trade_timestampupdated on all successful buy and sell execution paths.Closes #974