opynfinance / squeeth-monorepo

Squeeth is a new financial primitive in DeFi that gives traders exposure to ETH²
https://squeeth.com/
201 stars 70 forks source link

Add Emergency withdraw contract #990

Closed KMKoushik closed 1 year ago

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
continuouscall ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 30, 2023 at 11:29PM (UTC)
haythemsellami commented 1 year ago

Generally lgtm, few small comments. I want to improve testing though. Some things to add:

  • test to ensure that things that we want to fail will fail currently:

    • set strategy cap to 0
    • users can not deposit/withdraw in normal ZB
  • test expected behavior if euler unbricks - we can test this by running this fork on a pre-exploit block and withdrawing some users, but not everyone via emergency contract

    • test that if strategyCap = 0, users can not deposit() in normal ZB
    • test that normal ZB withdraw() after others have done emergency shutdown withdraw() will give you less ETH than you should get (this is expected behavior - no one should use ZB withdraw() after this ES contract has been deployed and used, even if euler unpauses.

Maybe others, anyone have other tests we should add?

Added those tests other than the deposit() when cap is 0, as this is already tested in Deposit tests