Skip to content

feat: add cancel_treasury_rotation admin entrypoint #1790

Open
Johnsource-hub wants to merge 1 commit into
QuickLendX:mainfrom
Johnsource-hub:feat/1536-cancel-treasury-rotation
Open

feat: add cancel_treasury_rotation admin entrypoint #1790
Johnsource-hub wants to merge 1 commit into
QuickLendX:mainfrom
Johnsource-hub:feat/1536-cancel-treasury-rotation

Conversation

@Johnsource-hub

Copy link
Copy Markdown

Description

Closes #1536. Implements an administrative "circuit breaker" to abort a pending treasury rotation before it is executed.

Threat Model

If this check is missing, a compromised admin account or an accidental misconfiguration could initiate a treasury rotation process that locks the protocol into a pending state. Without this entrypoint, there is no way to abort the rotation, potentially leading to forced migration to an unintended treasury address. This change provides a defense-in-depth mechanism to revert the protocol to a safe state.

Implementation Details

  • Added cancel_treasury_rotation to the contract admin interface.
  • Added RotationNotPending to ContractError enum to avoid panics.
  • Included negative tests in the test suite to verify the error is correctly surfaced.

Acceptance Criteria

Performance (Hot Path)

  • Cost estimate (Soroban env.cost_estimate()): [Insert your measured value here]

Checklist

  • cargo build --target wasm32-unknown-unknown --release
  • cargo clippy --workspace --all-targets -- -D warnings

- Implement `cancel_treasury_rotation` to abort pending treasury transitions.
- Surface `RotationNotPending` error when no rotation is in progress.
- Add negative tests to verify error handling when no rotation is active.
- Document threat model: mitigates unauthorized or accidental rotation locks.

Closes QuickLendX#1536
@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@Johnsource-hub 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! 🚀

Learn more about application limits

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.

Add cancel_treasury_rotation admin entrypoint

1 participant