Skip to content

Holyfuchs/emergency recovery - #119

Merged
holyfuchs merged 1 commit into
mainfrom
holyfuchs/emergency-recovery
Aug 19, 2026
Merged

Holyfuchs/emergency recovery#119
holyfuchs merged 1 commit into
mainfrom
holyfuchs/emergency-recovery

Conversation

@holyfuchs

Copy link
Copy Markdown
Member
  • renamed reocovery to explicit emergencyRecovery, much better readability on public explorers
  • emergencyRecoveryActive (bool) gates deposits/harvest/rebalance while a recovery is pending; emergencyRecovered (bool) is the permanent terminal state set on execute. Both are a cheap bool gate and pack into a another storage slot.
  • Tightens storage types: emergencyRecoveryValidAt uint256 -> uint64 (enough for Millions of years) and EMERGENCY_RECOVERY_DELAY uint256 -> uint32 (enough for years).
  • Adds a notInRecovery modifier so the pending-recovery gate is enforced consistently across deposit, harvest, and rebalance instead of inline checks duplicated at each call site.
  • executeEmergencyRecovery no longer pulls loan token and calls repayAll inside execute - the owner must pre-fund the debt beforehand; execute just withdraws collateral and sweeps. This removes the complexity and contract size of the debt repayment, moving that responsibility to the caller.

@holyfuchs
holyfuchs force-pushed the holyfuchs/emergency-recovery branch 2 times, most recently from b9f3314 to 76c42e6 Compare August 16, 2026 22:08
@holyfuchs
holyfuchs force-pushed the holyfuchs/emergency-recovery branch from 76c42e6 to 00637d8 Compare August 17, 2026 15:50
@holyfuchs
holyfuchs marked this pull request as ready for review August 17, 2026 17:31
@holyfuchs
holyfuchs requested a review from tim-barry August 18, 2026 14:29
Base automatically changed from holyfuchs/small-fixes to main August 19, 2026 19:25

@tim-barry tim-barry 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.

LGTM

@holyfuchs
holyfuchs merged commit 026facb into main Aug 19, 2026
4 of 5 checks passed
@holyfuchs
holyfuchs deleted the holyfuchs/emergency-recovery branch August 19, 2026 23:29
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.

2 participants