Repository navigation
feat(campaign): Add multi-sig support for all admin operations - #1511
Open
okanichibueze7 wants to merge 1 commit into
Open
okanichibueze7 wants to merge 1 commit into
okanichibueze7 wants to merge 1 commit into
Conversation
Extend the campaign contract's co-admin multisig infrastructure to protect all critical admin operations, not just set_merkle_root. This ensures that high-value campaign configurations require multiple operator signatures before being applied. ## Changes ### New Operation Discriminants Added 30 operation discriminants (OP_SET_MERKLE_ROOT through OP_MIGRATE) for comprehensive multi-sig authorization tracking. ### Helper Function Added `require_admin_with_multisig()` that: - Checks if multisig threshold > 0 - If enabled: verifies co-admin signatures via `verify_multisig()` - If disabled: falls back to legacy single-admin auth with nonce ### Protected Operations (now require multi-sig when threshold > 0) - set_active - Toggling campaign active state - set_window - Setting registration time window - set_max_cap - Setting participant cap - set_invite_only - Toggling invite-only mode - issue_invite/revoke_invite - Managing invite codes - set_participation_fee - Setting participation fees - add_to_allowlist/remove_from_allowlist - Managing allowlists - add_to_blocklist/remove_from_blocklist - Managing blocklists - set_allowlist_enabled/set_blocklist_enabled - Toggling list enforcement - add_co_admin/remove_co_admin - Managing co-admins (self-protected) - set_multisig_threshold - Setting threshold (self-protected) - propose_admin/accept_admin/cancel_admin_transfer - Admin rotation - set_privacy_mode - Setting privacy mode - set_uniqueness_mode - Setting uniqueness mode - set_activity_log_size - Setting log size - set_ledger_window - Setting ledger window - set_schedule_mode - Setting schedule mode - clear_participation - Clearing participation history - upgrade - Upgrading contract WASM - import_state - Importing state configuration - admin_deregister - Admin-initiated deregistration - migrate - Schema migration ### Security Properties - All signature verification uses deterministic operation-specific hashes - Nonce-based replay protection per operation - Self-protecting: co-admin/threshold changes require existing multisig - Backward compatible: threshold=0 uses legacy single-admin path ## Testing Updated all existing tests to pass empty signature vectors when multisig is disabled (threshold=0), maintaining full backward compatibility. Closes FinesseStudioLab#1354 Co-authored-by: Codebuff <noreply@codebuff.com>
This branch has not been deployed
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
Implements comprehensive multi-signature (multi-sig) protection for all critical campaign admin operations in the Trivela campaign contract.
Previously, only
set_merkle_roothad multi-sig protection. This change extends the same co-admin multisig infrastructure to all 22+ admin operations.Problem Statement & Impact
Technical Architecture
Implementation Approach
require_admin_with_multisig()that checks threshold and verifies signaturesProtected Operations
All admin operations now require multi-sig when threshold > 0:
Security Properties
Test Strategy
All existing tests updated to pass empty signature vectors for backward compatibility.
Checklist
Stellar Wave Program: This contribution is submitted for the 10th wave as assigned to @okanichibueze7.