Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OETH withdrawal queue #2062

Draft
wants to merge 27 commits into
base: sparrowDom/nativeStaking
Choose a base branch
from
Draft

Conversation

naddison36
Copy link
Collaborator

@naddison36 naddison36 commented May 16, 2024

Contract Changes

  • Added a withdrawal queue to the OETH Vault which includes requestWithdrawal, claimWithdrawal and addWithdrawalQueueLiquidity.
  • Any function that transfers WETH to the vault modified so the withdrawal queue is prioritised

Dependencies

Security

If you made a contract change, make sure to complete the checklist below before merging it in master.

Refer to our documentation for more details about contract security best practices.

Contract change checklist:

  • Code reviewed by 2 reviewers.
  • Copy & paste code review security checklist below this checklist.
  • Unit tests pass
  • Slither tests pass with no warning
  • Echidna tests pass if PR includes changes to OUSD contract (not automated, run manually on local)

Copy link

github-actions bot commented May 16, 2024

Warnings
⚠️ 👀 This PR needs at least 2 reviewers

Generated by 🚫 dangerJS against 5632653

Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.68%. Comparing base (12bba64) to head (5632653).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           sparrowDom/nativeStaking    #2062      +/-   ##
============================================================
+ Coverage                     62.99%   64.68%   +1.68%     
============================================================
  Files                            65       66       +1     
  Lines                          3243     3358     +115     
  Branches                        839      651     -188     
============================================================
+ Hits                           2043     2172     +129     
+ Misses                         1197     1183      -14     
  Partials                          3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// For future use
uint256[50] private __gap;
uint256[46] private __gap;
Copy link
Member

Choose a reason for hiding this comment

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

I see three slots added? dripper, withdrawalQueueMetadata, and withdrawalRequests. Shouldn't the gap change by 3, not four?

This particular gap is one that keeps me up at night. We should make sure our fork tests will catch an incorrect number here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's three storage variables added but withdrawalQueueMetadata is a struct that takes up 2 slots hence the gap was reduced by 4 slots.

claimWithdrawal collects from Dripper and adds any unallocated WETH to the withdrawal queue if not enough liquidity available
depositToStrategy only deposits WETH not allocated to the withdrawal queue
swapCollateral restricted to only swap to WETH
swapCollateral adds to withdrawal queue after swap
…-scanner

Moved duplicate getClusterInfo in tasks to utils
WIP withdrawal queue unit tests
Added more withdrawal queue coverage
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.

None yet

2 participants