Storm-Labs-Inc / cove-contracts-boosties

Core smart contracts of the Cove Protocol
Other
18 stars 6 forks source link

fix(YSDRewardsGauge): use convertToShares for correct maxMint return #309

Closed penandlim closed 7 months ago

penandlim commented 7 months ago

Describe your changes

Related: https://github.com/yAudit/cove-report/issues/9#issuecomment-2027524412

Checklist before requesting a review

github-actions[bot] commented 7 months ago

Slither report

THIS CHECKLIST IS NOT COMPLETE. Use --show-ignored-findings to show all the results. Summary

github-actions[bot] commented 7 months ago

Changes to gas cost

Generated at commit: 595daf8c924aca2819f6ebf611916134b76e2de7, compared to commit: 5ff08e02372fd327ac7620844f752b8735a72039

๐Ÿงพ Summary (10% most significant diffs)

Contract Method Avg (+/-) %
YSDRewardsGauge maxMint +1,470 โŒ +37.46%

Full diff report ๐Ÿ‘‡
| Contract | Deployment Cost (+/-) | Method | Min (+/-) | % | Avg (+/-) | % | Median (+/-) | % | Max (+/-) | % | # Calls (+/-) | |:-|-:|:-|-:|-:|-:|-:|-:|-:|-:|-:|-:| | **YSDRewardsGauge** | 3,896,759 (+12,549) | _deposit_
_maxMint_
_redeem_ | 2,732 (0)
588 (0)
8,327 (0) | **0.00%**
**0.00%**
**0.00%** | 193,036 (+28)
5,394 (+1,470)
134,055 (+39) | **+0.01%**
**+37.46%**
**+0.03%** | 178,853 (0)
5,394 (+1,470)
126,910 (0) | **0.00%**
**+37.46%**
**0.00%** | 450,543 (0)
10,200 (+2,939)
242,620 (0) | **0.00%**
**+40.48%**
**0.00%** | 2,048 (0)
2 (0)
1,024 (0) | | **RewardForwarder** | 936,966 (0) | _forwardRewardToken_ | 8,239 (0) | **0.00%** | 111,772 (+16) | **+0.01%** | 158,199 (0) | **0.00%** | 165,062 (0) | **0.00%** | 1,280 (0) | | **ERC20RewardsGauge** | 3,604,944 (0) | _depositRewardToken_ | 7,707 (0) | **0.00%** | 148,111 (+5) | **+0.00%** | 147,383 (0) | **0.00%** | 195,467 (0) | **0.00%** | 4,610 (0) | | **DYFIRedeemer** | 2,139,607 (0) | _massRedeem_ | 30,408 (0) | **0.00%** | 441,245 (+13) | **+0.00%** | 440,099 (0) | **0.00%** | 689,094 (0) | **0.00%** | 1,545 (0) | | **YearnStakingDelegate** | 3,639,792 (0) | _harvest_ | 24,054 (0) | **0.00%** | 311,379 (+8) | **+0.00%** | 352,133 (0) | **0.00%** | 431,958 (0) | **0.00%** | 1,803 (0) | | **GaugeRewardReceiver** | 1,428,645 (0) | _harvest_ | 5,864 (0) | **0.00%** | 293,144 (+7) | **+0.00%** | 350,867 (0) | **0.00%** | 455,946 (0) | **0.00%** | 2,058 (0) | | **YearnGaugeStrategy** | 1,817,865 (0) | _approve_
_deposit_
_redeem_
_report_
_withdraw_ | 49,303 (0)
30,717 (0)
293,599 (0)
58,515 (0)
74,620 (0) | **0.00%**
**0.00%**
**0.00%**
**0.00%**
**0.00%** | 49,382 (-1)
291,891 (+2)
300,265 (-1)
302,964 (-2)
176,091 (+1) | **-0.00%**
**+0.00%**
**-0.00%**
**-0.00%**
**+0.00%** | 49,399 (0)
308,482 (0)
298,435 (0)
69,644 (0)
201,040 (0) | **0.00%**
**0.00%**
**0.00%**
**0.00%**
**0.00%** | 49,411 (0)
447,268 (0)
308,756 (0)
914,862 (0)
256,348 (0) | **0.00%**
**0.00%**
**0.00%**
**0.00%**
**0.00%** | 512 (0)
7,938 (0)
769 (0)
5,890 (0)
1,792 (0) |
codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.56%. Comparing base (5ff08e0) to head (e5896e1).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #309 +/- ## ======================================= Coverage 97.56% 97.56% ======================================= Files 19 19 Lines 987 987 Branches 202 202 ======================================= Hits 963 963 Misses 1 1 Partials 23 23 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.