Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: high
Valid

The number of withdrawals was incorrectly calculated at the time of withdraw.

Summary

In the withdraw function, the mintFee update cost is not performed before the shareRatio is calculated in L67-L69. This causes the shareRatio to be calculated incorrectly and the withdrawing user will not be liable for the fee for a period of time.

Vulnerability Details

In the withdraw function, the mintFee update cost is not performed before the shareRatio is calculated in L67-L69. This causes the totalSupply to be small at this point and the calculated shareRatio to be large. That is, it makes the user who has not yet withdrawn fully bear the fee that the withdrawing user should bear.

Impact

This causes the shareRatio to be calculated incorrectly and the withdrawing user will not be liable for the fee for a period of time. More tokens will be withdrawn.

Tools Used

manual

Recommendations

It is recommended to mintFee at the beginning of withdraw.

Updates

Lead Judging Commences

hans Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

Fee not accounted during withdrawal

Impact: High Likelihood: High User share amount is calculated before minting fee and the remaining users will need to more fee than reasonable.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.