Skip to content

feat(contract): introduce multi-sig and timelock support for critical admin actions (#932) - #1

Open
anthonia01-dev wants to merge 2 commits into
mainfrom
feat/multi-sig-timelock-admin-actions-932
Open

feat(contract): introduce multi-sig and timelock support for critical admin actions (#932)#1
anthonia01-dev wants to merge 2 commits into
mainfrom
feat/multi-sig-timelock-admin-actions-932

Conversation

@anthonia01-dev

Copy link
Copy Markdown
Owner

Summary

Introduces a Multi-Signature and Timelock workflow for all critical admin actions on the CraftNexus contract. High-risk operations (pausing, sweeping, upgrades, and governance parameter changes) can no longer execute with a single admin signature; they now require configured signer approvals and must survive a timelock before execution.

Acceptance Criteria

  • High-risk actions cannot execute without the required approvals.
  • Timelocks prevent immediate execution of sensitive changes.
  • Pending operations remain visible and cancelable.

Key Changes

New Types

  • AdminActionKind — enum covering all critical actions
  • AdminActionProposal — persistent proposal record
  • AdminActionDataKey — storage keys for the proposal system

New Errors

  • AdminActionTerminal
  • AdminActionNeedsApprovals
  • AdminActionTimelockActive
  • NotAnAdminActionSigner

New Public API

  • set_admin_action_signers, set_admin_action_threshold, set_admin_action_timelock_delay
  • propose_admin_action, approve_admin_action, cancel_admin_action, execute_admin_action, get_pending_admin_actions

Security Properties

  • Signer set is snapshotted on first approval
  • Threshold is snapshotted on first approval
  • Duplicate approvals rejected
  • Timelock enforced before state mutation
  • Pending actions queryable and cancellable

Closes Hub-of-Evolution#932

… admin actions

Adds a new AdminActionProposal flow so that sensitive platform operations
require multi-sig approval and a timelock before execution.

Changes:
- Add AdminActionKind, AdminActionProposal, AdminActionDataKey types
- Add error variants: AdminActionTerminal, AdminActionNeedsApprovals,
  AdminActionTimelockActive, NotAnAdminActionSigner
- Add configuration: set_admin_action_signers, set_admin_action_threshold,
  set_admin_action_timelock_delay
- Add core flow: propose_admin_action, approve_admin_action,
  cancel_admin_action, execute_admin_action, get_pending_admin_actions
- Add apply_admin_action handler covering: PausePlatform, SetPlatformFee,
  SetPlatformWallet, SetWasmUpgradeCooldown, SetMinStakeRequired,
  SweepUnallocatedFunds, ExecuteUpgrade, SetMaxDisputeDuration,
  SetStakeCooldown, SetArtisanFeeTier, SetModerator, SetMinEscrowAmount,
  SetMaxReleaseWindow, SetMinReleaseWindow, SetOnboardingContract,
  SetExpiredDisputePolicy
- Add set_paused_internal helper for timelock-compatible pause toggling
- Add comprehensive tests covering signer auth, threshold enforcement,
  timelock blocking, execution after delay, cancellation, double approval,
  pending action enumeration, and new governance action variants

Closes Hub-of-Evolution#932
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.

.Introduce Multi-Signature and Timelock Support for Critical Admin Actions

1 participant