Skip to content

Conversation

@dglowinski
Copy link
Contributor

The PR introduces a RescueStrategy. It allows curators to withdraw funds from strategies to distribute fairly to users when vault faces large debt socializations.

Rescue procedure:
- Euler installs a perspective in the earn factory which allows adding custom strategies
- RescueStrategy contracts are deployed for each earn vault to rescue.
Immutable params:
o Rescue account: is allowed to call the rescue functions and receives rescued assets and shares
o Earn vault: the strategy can only work with the specified vault. If another vault tries to enable it, it will revert on acceptCap
- Euler registers the strategies in the perspective
- Curator installs the strategy with unlimited cap (submit/acceptCap)
- Curator sets the new strategy as the only one in supply queue and moves it to the front of withdraw queue
o at this stage the regular users can't deposit or withdraw from earn
- Rescue account calls one of the rescueX functions (for Euler, Morpho or Aave flash loan sources), specifying the asset amount to flashloan
o flash loan is used to create earn vault shares, it just passes through earn vault back to the rescue strategy where it is repaid
o the shares are used to withdraw as much as possible from the underlying strategies to the rescue account

Copy link

@certora-run certora-run bot left a comment

Choose a reason for hiding this comment

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

Verification Results

  • Group ID: 17986bd1-3a60-42a2-9c10-edcfb764b6b0
Job Result VERIFIED Link
TimelockRemovableTime.conf 2 Link
Timelock.conf 9 Link
SolvencyInternal.conf 4 Link
Solvency.conf 2 Link
Roles.conf 4 Link
Reverts.conf 19 Link
Reentrancy.conf 1 Link
Range.conf 6 Link
PendingValues.conf 7 Link
LostAssets.conf 8 Link
Liveness.conf 2 Link
Immutability.conf 1 Link
ERC4626.conf 9 Link
Enabled.conf 10 Link
Conversions.conf 6 Link
ConsistentStateExtras.conf 2 Link
ConsistentStateExtras3Sanity.conf 2 Link
ConsistentStateExtras2.conf 2 Link
ConsistentState.conf 10 Link
Balances.conf 6 Link

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