feat: co-creator removal, auction cancellation, and staking reward claim - #796
Merged
Chucks1093 merged 2 commits intoAug 28, 2026
Conversation
Resolves the four issues assigned to codeX-james, backed by a new FeatureError type (ContractError is already at the Soroban 50-variant contracterror cap): - remove_co_creator: lets a creator clear a previously configured co-creator split, restoring 100% of future royalties to the creator. Panics-equivalent (returns Err) with NoCoCreatorSet when none is configured, Unauthorized for a non-creator caller, and emits co_creator_removed. - cancel_auction: lets a creator withdraw an auction configuration before any auction keys have sold, restoring the normal bonding curve buy path. Returns AuctionAlreadyStarted once auction_sold > 0, NoAuctionConfigured when none exists, Unauthorized for a non-creator caller, and emits auction_cancelled. Depends on configure_auction, added alongside it to make the auction phase itself testable/usable (buy_key settles at the fixed auction price while supply is below auction_supply, then transitions back to the curve automatically; get_buy_quote mirrors the same resolution so price previews stay correct during the auction phase). - claim_stake_reward: unlocks a holder's stake once the 30-day lock has elapsed and pays out a pro-rata share of a per-creator staking rewards pool, funded by routing 10% of each protocol fee collection into that pool alongside the existing treasury/recipient split. Returns StakeLockActive before unlock, NoStakeFound with no active stake, and emits stake_reward_claimed. - Integration tests covering the full auction-to-bonding-curve transition: configuring a 5-key fixed-price auction, buying all 5 at the auction price with auction_purchase events and a running auction_sold count, then a 6th buy priced at the bonding curve formula for supply 5 with a standard buy event. Also fixes creator-keys/src/test_new_features.rs, which was broken at compile time on main independent of this change (called a removed initialize() entrypoint, wrong register_creator arity, .unwrap() on a plain u32) — fixed so the crate's test suite can build and run at all. Closes accesslayerorg#791 Closes accesslayerorg#790 Closes accesslayerorg#789 Closes accesslayerorg#788
|
@codeX-james 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! 🚀 |
8 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
Resolves the four issues assigned to codeX-james, backed by a new
FeatureErrortype (ContractErroris already at the Soroban 50-variantcontracterrorcap):remove_co_creator— lets a creator clear a previously configured co-creator split, restoring 100% of future royalties to the creator. ReturnsNoCoCreatorSetwhen none is configured,Unauthorizedfor a non-creator caller, and emitsco_creator_removed.cancel_auction— lets a creator withdraw an auction configuration before any auction keys have sold, restoring the normal bonding curve buy path. ReturnsAuctionAlreadyStartedonceauction_sold > 0,NoAuctionConfiguredwhen none exists,Unauthorizedfor a non-creator caller, and emitsauction_cancelled. Ships alongsideconfigure_auction(needed to make the auction phase itself testable/usable —buy_keysettles at the fixed auction price while supply is belowauction_supply, then transitions back to the curve automatically;get_buy_quotemirrors the same resolution so price previews stay correct during the auction phase).claim_stake_reward— unlocks a holder's stake once the 30-day lock has elapsed and pays out a pro-rata share of a per-creator staking rewards pool, funded by routing 10% of each protocol fee collection into that pool alongside the existing treasury/recipient split. ReturnsStakeLockActivebefore unlock,NoStakeFoundwith no active stake, and emitsstake_reward_claimed.auction_purchaseevents and a runningauction_soldcount, then a 6th buy priced at the bonding curve formula for supply 5 with a standard buy event.Also fixes
creator-keys/src/test_new_features.rs, found broken at compile time independent of this change (called a removedinitialize()entrypoint, wrongregister_creatorarity,.unwrap()on a plainu32) — fixed so the crate's test suite builds and runs at all.mainmaincurrently fails to compile independent of this PR. Root cause: the merge commit for PR #774 (aa46355) dropped severalDataKey/ContractError/eventsadditions that its own already-merged code depends on (DataKey::ProtocolFeeBps,LockupDurationSecs,RoyaltyConfig,CurveExponent;constants::storage::holder_cap_bps/last_buy_timestamp;events::LockupBlockedEvent/FeeCollectedEventand their topic helpers). Confirmed viagit worktree: the original feature commit (49a7900) builds cleanly standalone — only the merge intomainis broken.Three of the missing pieces (
ContractError::MaxHoldingExceeded,LockupPeriodActive,InvalidHolderCap) can't simply be restored:ContractErroris already at Soroban's 50-variantcontracterrorcap (the same constraint that led toFeatureErrorin this PR). Restoring them needs a follow-up design decision (split the enum further, consolidate an existing variant, etc.) on code this PR doesn't own — flagging for maintainers rather than taking that on unilaterally here.Because of this,
cargo build/CI will currently fail on this PR too, through no fault of the changes here. All new code and tests were fully verified (cargo build+ fullcargo test --tests, ~180 binaries, 24 new passing tests, no regressions in the 5 known-unrelated pre-existing failures) on top ofmainbefore this pre-existing break was discovered further back in history; the branch was then rebased onto currentmainand the rebase resolution reviewed by hand line-by-line, with no changes to this PR's own logic.Test plan
cargo build/cargo test --tests— clean, before the base-breaking history was in the branch's ancestryco_creator_removal.rs,prelaunch_auction.rs,staking_reward_claim.rs,auction_bonding_curve_transition.rs— all passingcreator-keys/src/lib.rs) — confirmed no unintended drops or duplicationscargo testonce the pre-existing build break above is fixed onmainCloses #791
Closes #790
Closes #789
Closes #788