feat: propose/execute rescue with surplus-only check and timelock - #455
Merged
james2177 merged 2 commits intoSep 30, 2026
Conversation
- Add PendingRescue(Address) and TokenLiabilities(Address) DataKey variants - Add RescueTimelockNotElapsed=36, NoPendingRescue=37, RescueLiabilityConflict=38, RescueAmountExceedsSurplus=39 error variants - Add PendingRescueRecord contracttype struct (token, to, amount, eta, proposed_ledger) - Add RESCUE_TIMELOCK_DELAY constant (48 h, mirrors ADMIN_TIMELOCK_DELAY) - Instrument register_solver_inner to increment TokenLiabilities on bond deposit - Instrument deregister_solver refund loop to decrement TokenLiabilities - Partial: remaining call sites (withdraw_bond, slash_solver, begin_fill, release_fill, resolve_dispute) and propose/execute_rescue entrypoints still to be wired up Relates to: stellar-vortex-protocol#265, stellar-vortex-protocol#35
|
@Keengfk 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! 🚀 |
…timelock-surplus-check # Conflicts: # intent_settlement/src/lib.rs
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.
Branch: feat/rescue-tokens-timelock-surplus-check Fork:
Keengfk/vortex-contracts
What this branch is doing
Hardening rescue_tokens — currently the most direct admin-drain path in the
contract — by replacing its static token-kind allowlist with a surplus-only
check and putting the operation behind a propose/execute timelock.
Changes committed so far (eb596d8)
New storage keys (DataKey enum):
(solver bonds + escrowed fill amounts), maintained incrementally
New error variants:
requested amount
New struct: PendingRescueRecord — holds token, to, amount, eta, and
proposed_ledger (for the same-ledger conflict guard)
New constant: RESCUE_TIMELOCK_DELAY = 48h (mirrors ADMIN_TIMELOCK_DELAY)
Instrumentation started: TokenLiabilities is now incremented when a solver
registers a bond (register_solver_inner) and decremented when a solver
deregisters (deregister_solver).
Still to do on this branch
begin_fill, release_fill, resolve_dispute
closes #412