feat(contracts): storage pruning, invite-only campaigns, and scoped M-of-N multisig#713
Merged
joelpeace48-cell merged 2 commits intoJun 28, 2026
Conversation
…-of-N multisig Adds prune_expired_participants/prune_used_nonces + storage_stats to both contracts for Soroban storage hygiene (FinesseStudioLab#451); invite-only registration via hashed single-use invite codes on the campaign contract (FinesseStudioLab#452); and co-admin M-of-N multisig (threshold + ed25519 signature verification with nonce replay protection) gating set_merkle_root and set_paused as critical operations (FinesseStudioLab#454, scoped to existing operations since co-admin governance from FinesseStudioLab#281 and propose_admin do not yet exist in this codebase). Closes FinesseStudioLab#451 Closes FinesseStudioLab#452 Closes FinesseStudioLab#454 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@devsimze is attempting to deploy a commit to the joelpeace48-cell's projects Team on Vercel. A member of the Team first needs to authorize it. |
…ites-multisig Resolves conflicts from 282 upstream commits, most notably the campaign participant-storage migration to persistent storage (FinesseStudioLab#280), 2-step admin rotation (FinesseStudioLab#281), referral tracking (FinesseStudioLab#455), activity log (FinesseStudioLab#453), and the rewards contract's rate limiting/vesting/snapshot/redemption/SEP-41/referral additions. Adapts FinesseStudioLab#451's pruning to the new persistent-storage-with-real-TTL model: prune_expired_participants now garbage-collects PARTICIPANT_REGISTRY entries whose persistent record is already gone (deregistered or TTL-archived) using swap-remove, instead of the superseded application-level timestamp aging. FinesseStudioLab#452 (invite-only) and FinesseStudioLab#454 (scoped multisig) carry forward unchanged, re-applied on top of the upstream register()/set_paused() signatures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Abidoyesimze 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! 🚀 |
950ab59
into
FinesseStudioLab:main
2 of 15 checks passed
7 tasks
joelpeace48-cell
added a commit
that referenced
this pull request
Jun 30, 2026
…tract-pruning-invites-multisig feat(contracts): storage pruning, invite-only campaigns, and scoped M-of-N multisig
joelpeace48-cell
added a commit
that referenced
this pull request
Jun 30, 2026
…tract-pruning-invites-multisig feat(contracts): storage pruning, invite-only campaigns, and scoped M-of-N multisig
joelpeace48-cell
added a commit
that referenced
this pull request
Jun 30, 2026
…tract-pruning-invites-multisig feat(contracts): storage pruning, invite-only campaigns, and scoped M-of-N multisig
joelpeace48-cell
added a commit
that referenced
this pull request
Jun 30, 2026
…tract-pruning-invites-multisig feat(contracts): storage pruning, invite-only campaigns, and scoped M-of-N multisig
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
Contracts: Add storage pruning function to reclaim rent fees from expired data #451 (storage pruning): adds
prune_expired_participants/prune_used_nonces(capped, cursor-based batches, callable by anyone) andstorage_stats()for monitoring to both the campaign and rewards contracts. Both emit aprunedevent with the count.Contracts: Add invite-only campaign mode with admin-issued invite codes #452 (invite-only campaigns): adds
set_invite_only,issue_invite/revoke_invite(hash-based, single-use), andis_invite_only/invite_usedviews to the campaign contract.registernow takes an optionalinvite_code: Bytesand enforces it (sha256-hash match, single redemption) when invite-only mode is enabled.Contracts: Add multi-sig admin — require M-of-N signatures for critical operations #454 (M-of-N multisig, scoped): adds
add_co_admin/remove_co_admin,set_multisig_threshold, andmultisig_threshold()to both contracts. Critical operations that already exist (set_merkle_rooton campaign,set_pausedon rewards) now accept asignatures: Vec<(Address, BytesN<64>)>param; once a threshold is configured, the contract verifies ed25519 signatures from registered co-admins over(op, nonce, args_hash)and requires at least the configured number of valid, distinct signers. The nonce is consumed on use regardless of how many signers participated, preventing replay.Scope note: Contracts: Add multi-sig admin — require M-of-N signatures for critical operations #454 depends on co-admin governance (Contracts: Add governance multi-admin pattern to replace single admin key #281) and a
propose_adminflow, neither of which exist yet in this codebase (no co-admin list, no admin-transfer function of any kind). Per discussion, this PR scopes Contracts: Add multi-sig admin — require M-of-N signatures for critical operations #454 down to gating the critical operations that already exist (set_paused,set_merkle_root) behind the new M-of-N threshold, and does not addpropose_adminor general co-admin governance — that remains for Contracts: Add governance multi-admin pattern to replace single admin key #281 separately.set_active/set_max_capremain single-admin-sig only, as specified.Test plan
cargo test -p trivela-campaign-contract— 10 new tests covering pruning (empty/expired/max-entries-cap), invite-only registration (missing code, invalid code, valid code + single-use, revoke), and 2-of-3 multisig (insufficient sigs, success + nonce replay rejection)cargo test -p trivela-rewards-contract— 6 new tests covering nonce pruning (empty/stale/max-entries-cap) and 2-of-3 multisig (insufficient sigs, success + nonce replay rejection)cargo test --workspace --no-fail-fast— only 3 pre-existing failures remain (test_admin_deregister,test_deregister_success_and_re_register,test_tiered_rewards_sorting_and_credit), verified present onmainbefore this change and unrelated to itCloses #451
Closes #452
Closes #454
🤖 Generated with Claude Code