Skip to content

feat/multisig-admin-controls#198

Open
Wetshakat wants to merge 1 commit into
JointSave-org:mainfrom
Wetshakat:feat/multisig-admin-controls
Open

feat/multisig-admin-controls#198
Wetshakat wants to merge 1 commit into
JointSave-org:mainfrom
Wetshakat:feat/multisig-admin-controls

Conversation

@Wetshakat

Copy link
Copy Markdown
Contributor

closed #181

feat: Add multi-sig for critical admin actions

This pull request introduces a threshold-based multi-sig approval mechanism for critical administrative actions across all three pool
contracts (Rotational, Target, and Flexible). It also includes the corresponding frontend UI for managing multi-sig admins and
approving pending actions.

Smart Contract Changes

  • Added a new Action enum to all three pool contracts to represent the different types of actions that can be approved.
  • Added a new execute_approved function to all three pool contracts to execute actions approved by a multi-sig quorum.
  • Modified the emergency_withdraw, pause, unpause, and remove_member functions to be callable only via execute_approved when a
    quorum is configured.
  • Added view functions get_admin_quorum, get_pending_action, and get_approval_count to all three pool contracts.
  • Added unit tests for the new multi-sig functionality.

Frontend Changes

  • Created a new AdminQuorumManager component to manage the multi-sig quorum.
  • Created a new PendingActionCard component to display pending actions.
  • Added the AdminQuorumManager to the group detail page.
  • Updated the existing admin action buttons to integrate with the new multi-sig flow.

Testing

  • Unit tests were added for the new smart contract functionality.
  • All tests for all three contracts are passing.

@Sendi0011
Sendi0011 self-requested a review July 25, 2026 17:22

@Sendi0011 Sendi0011 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid work on the multisig feature! The smart contract changes look well-structured. However, the frontend has several incomplete pieces that need to be addressed:

Critical:

  1. pendingActions is always emptyfetchPendingActions is a stub that just does setPendingActions([]). The "Pending Actions" section will always show "No pending actions." Either implement the fetching or remove the section.

  2. handleExecute is a no-op — In pending-action-card.tsx, the Execute button does nothing on click. Users can click it with zero feedback. Implement it or remove the button.

  3. isApprovedByCurrentUser is never set to true — It's always false, so the Approve button always shows even if the user already approved.

Improvements:

  1. action prop is typed as any — Define a proper interface: interface PendingAction { hash: string; type: string; requestedBy?: string; ... }.

  2. Quorum threshold is derived as Math.ceil(quorumSize / 2) — This is a simple majority. Multisig systems should accept an explicit threshold parameter during set_admin_quorum. What happens with a 3-member quorum — is it 2-of-3 or 3-of-3?

  3. No Stellar address validationhandleAddAdmin accepts any string. Validate the input is a valid Stellar public key before submitting to the contract.

  4. group-actions.tsx calls getAdminQuorum directly — But you defined useGetAdminQuorum hook in the same PR. Use the hook for consistency.

  5. 6 new test_snapshots/*.json files — If these are auto-generated snapshots, confirm they're intentional. Auto-generated snapshot files should be in .gitignore or generated in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Implement multi-sig admin approval for high-risk pool actions (emergency_withdraw, pause, remove_member)

2 participants