feat: add auction phase configuration - #825
Merged
Chucks1093 merged 4 commits intoSep 8, 2026
Merged
Conversation
|
@somotochukwu-dev 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! 🚀 |
Member
❌ CI Failed —
|
…r-contracts into add-auction-phase-configuration-793
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 pre-launch auction configuration feature (#793) by restoring the two core type definitions that were dropped during the merge of PR #796: the
AuctionConfigstruct and theDataKey::AuctionConfig(Address)storage variant. With these in place,configure_auction(and the buy/quote/cancel/get paths built on it) can compile and satisfy the issue's acceptance criteria.Closes #793
Problem
The
configure_auctionentrypoint, itsbuy_keyintegration, the auction events, and the integration tests were all present in the tree, but they referenced theAuctionConfigtype and theDataKey::AuctionConfigstorage key — neither of which existed. A botched merge conflict resolution dropped both definitions while keeping every call site, leaving the auction feature un-compilable:creator-keys/src/lib.rs:487—constants::storage::auction_configreturned aDataKey::AuctionConfigvariant that theDataKeyenum did not definecreator-keys/src/lib.rs:1823/2433/5784— code read and wrote anAuctionConfigstruct that was never declaredcreator-keys/tests/prelaunch_auction.rs— importedcreator_keys::AuctionConfig, which did not existChanges
creator-keys/src/lib.rsAdded
DataKey::AuctionConfig(Address)variant to theDataKeyenum, documented as the pre-launch auction configuration for a creator's keys.Added
pub struct AuctionConfigas a#[contracttype]with the fields used across the feature:AuctionConfigis the value stored byconfigure_auction, read/written bybuy_keyduring the auction phase, returned byget_auction_config, and asserted in the integration tests.No other behavioral changes were made. The
configure_auction,cancel_auction,get_auction_config,buy_keyauction-phase logic,resolve_buy_quote_priceauction-aware quoting, and the auction events were already in place and are exercised by the existing tests.Acceptance Criteria
configure_auctionvalidates and persistsAuctionConfig { auction_price, auction_supply, auction_sold: 0 }underDataKey::AuctionConfig(creator)auction_supplyusesauction_priceinstead of bonding curve pricebuy_keysettles at the fixed price whileprofile.supply < auction_supply;get_buy_quotemirrors itauction_supplyuses bonding curve priceAuctionAlreadyStartedpanics if keys already soldFeatureError::AuctionAlreadyStartedwhenprofile.supply > 0Unauthorizedcaller.require_auth()+caller != creatorauction_configuredevent emitted with key id, price, and supplyAuctionConfiguredEvent { creator_id, auction_price, auction_supply }auction_soldstored and initialised to0AuctionConfig, incremented per auction buyExisting integration tests in
creator-keys/tests/prelaunch_auction.rsandcreator-keys/tests/auction_bonding_curve_transition.rscover all of the above.Testing
cargo check --workspace— no remaining errors reference any auction symbol (AuctionConfig,DataKey::AuctionConfig,configure_auction,cancel_auction,get_auction_config)cargo fmt --all -- --check— passes for the added code; the workspace has pre-existing formatting diffs inevents.rsand unrelated lines oflib.rscargo test --workspace— blocked by pre-existing, unrelated compile breaks in the tree (see note below)Note on pre-existing breakage (not part of this PR): the workspace does not currently compile due to issues introduced by other merges and unrelated to #793.
ContractErrorexceeds the 50-case#[contracterror]spec cap (51 variants incl.GlobalTradingHaltedfrom the global-emergency-pause work), and several other features' storage/event definitions were dropped in similar bad merges (RoyaltyConfig,CurveExponent,ProtocolFeeBps,LockupDurationSecs, stakingDataKeyvariants,FeeCollectedEvent/LockupBlockedEvent,last_buy_timestamp/holder_cap_bpsstorage helpers). Because these do not concern the auction implementation, they are intentionally left out of this change; the full test suite will run once those are resolved separately.Checklist
docs/contract-event-conventions.mdanddocs/storage-key-invariants.mdcargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings, andcargo test --workspace, or explained exactly why a command was not run (see Testing)