Storm-Labs-Inc / cove-contracts-boosties

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

feat: use erc20votes for checkpointing #312

Closed penandlim closed 7 months ago

penandlim commented 7 months ago

Describe your changes

Checklist before requesting a review

github-actions[bot] commented 7 months ago

Changes to gas cost

Generated at commit: c3f1fb58ec743792c923fb2017557a9700b72256, compared to commit: db0bbfa0c16fa4bf9202ed2d71240d8bd0039721

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

Contract Method Avg (+/-) %
CoveToken allowedReceiver
mint
transfer
-88 โœ…
+17,433 โŒ
+3,284 โŒ
-7.63%
+35.08%
+7.06%

Full diff report ๐Ÿ‘‡
| Contract | Deployment Cost (+/-) | Method | Min (+/-) | % | Avg (+/-) | % | Median (+/-) | % | Max (+/-) | % | # Calls (+/-) | |:-|-:|:-|-:|-:|-:|-:|-:|-:|-:|-:|-:| | **CoveToken** | 3,495,457 (+794,778) | _ANYONE_CAN_UNPAUSE_AFTER_
_addAllowedReceiver_
_addAllowedSender_
_allowedReceiver_
_availableSupplyToMint_
_grantRole_
_hasRole_
_mint_
_mintingAllowedAfter_
_paused_
_removeAllowedReceiver_
_removeAllowedSender_
_transfer_
_unpause_ | 263 (+1)
26,282 (0)
26,283 (+44)
565 (-88)
403 (-67)
31,667 (-22)
2,766 (+22)
26,613 (-22)
385 (-22)
360 (-22)
31,007 (0)
31,020 (+89)
28,520 (+44)
25,249 (-22) | **+0.38%**
**0.00%**
**+0.17%**
**-13.48%**
**-14.26%**
**-0.07%**
**+0.80%**
**-0.08%**
**-5.41%**
**-5.76%**
**0.00%**
**+0.29%**
**+0.15%**
**-0.09%** | 263 (+1)
50,936 (+3)
50,384 (+47)
1,065 (-88)
2,674 (-67)
114,688 (+62)
2,766 (+22)
67,127 (+17,433)
2,383 (-22)
1,690 (-22)
42,424 (+2)
42,443 (+92)
49,807 (+3,284)
25,265 (-22) | **+0.38%**
**+0.01%**
**+0.09%**
**-7.63%**
**-2.44%**
**+0.05%**
**+0.80%**
**+35.08%**
**-0.91%**
**-1.29%**
**+0.00%**
**+0.22%**
**+7.06%**
**-0.09%** | 263 (+1)
55,323 (0)
55,120 (+44)
565 (-88)
2,679 (-67)
118,380 (-22)
2,766 (+22)
75,549 (+21,472)
2,385 (-22)
2,360 (-22)
31,235 (0)
31,248 (+89)
57,862 (+4,563)
25,259 (-22) | **+0.38%**
**0.00%**
**+0.08%**
**-13.48%**
**-2.44%**
**-0.02%**
**+0.80%**
**+39.71%**
**-0.91%**
**-0.92%**
**0.00%**
**+0.29%**
**+8.56%**
**-0.09%** | 263 (+1)
55,335 (0)
55,336 (+44)
2,565 (-88)
2,679 (-67)
118,380 (-22)
2,766 (+22)
98,393 (+34,868)
2,385 (-22)
2,360 (-22)
53,805 (0)
53,829 (+89)
92,556 (+36,654)
25,850 (-22) | **+0.38%**
**0.00%**
**+0.08%**
**-3.32%**
**-2.44%**
**-0.02%**
**+0.80%**
**+54.89%**
**-0.91%**
**-0.92%**
**0.00%**
**+0.17%**
**+65.57%**
**-0.09%** | 258 (0)
1,793 (0)
1,593 (0)
1,024 (0)
1,797 (0)
45 (+1)
2 (0)
1,537 (0)
2,051 (0)
771 (0)
513 (0)
513 (0)
3,585 (+1)
261 (0) | | **RewardForwarder** | 936,966 (0) | _forwardRewardToken_ | 8,239 (0) | **0.00%** | 113,624 (+1,852) | **+1.66%** | 160,655 (+2,456) | **+1.55%** | 169,692 (+4,630) | **+2.81%** | 1,280 (0) | | **YSDRewardsGauge** | 3,896,771 (0) | _claimRewards_
_deposit_
_depositRewardToken_ | 140,250 (0)
2,732 (0)
124,845 (0) | **0.00%**
**0.00%**
**0.00%** | 144,724 (+2,281)
193,186 (-3)
148,908 (+2,315) | **+1.60%**
**-0.00%**
**+1.58%** | 144,724 (+2,281)
178,853 (0)
149,219 (+2,315) | **+1.60%**
**0.00%**
**+1.58%** | 149,199 (+4,563)
451,162 (0)
153,694 (+4,630) | **+3.15%**
**0.00%**
**+3.11%** | 512 (0)
2,048 (0)
512 (0) | | **ERC20RewardsGauge** | 3,604,944 (0) | _claimRewards_
_depositRewardToken_ | 5,685 (0)
7,707 (0) | **0.00%**
**0.00%** | 154,486 (+304)
148,468 (+257) | **+0.20%**
**+0.17%** | 100,941 (0)
147,383 (0) | **0.00%**
**0.00%** | 923,524 (0)
195,467 (0) | **0.00%**
**0.00%** | 3,841 (0)
4,610 (0) | | **GaugeRewardReceiver** | 1,428,645 (0) | _harvest_ | 5,864 (0) | **0.00%** | 292,515 (-235) | **-0.08%** | 350,867 (0) | **0.00%** | 455,946 (0) | **0.00%** | 2,058 (0) | | **YearnStakingDelegate** | 3,689,914 (0) | _harvest_ | 24,054 (0) | **0.00%** | 311,307 (-157) | **-0.05%** | 352,133 (0) | **0.00%** | 431,958 (0) | **0.00%** | 1,803 (0) | | **YearnGaugeStrategy** | 1,817,865 (0) | _deposit_
_redeem_
_report_ | 30,717 (0)
294,218 (0)
58,515 (0) | **0.00%**
**0.00%**
**0.00%** | 292,097 (-12)
300,891 (+1)
303,085 (-2) | **-0.00%**
**+0.00%**
**-0.00%** | 309,101 (0)
299,066 (0)
69,644 (0) | **0.00%**
**0.00%**
**0.00%** | 447,887 (0)
309,375 (0)
914,862 (0) | **0.00%**
**0.00%**
**0.00%** | 7,938 (0)
769 (0)
5,890 (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.59%. Comparing base (db0bbfa) to head (21866bf).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #312 +/- ## ======================================= Coverage 97.58% 97.59% ======================================= Files 19 19 Lines 994 996 +2 Branches 204 204 ======================================= + Hits 970 972 +2 Misses 1 1 Partials 23 23 ```

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

github-actions[bot] commented 7 months ago

Slither report

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

ElliotFriedman commented 7 months ago

Would be good to see tests of votes registering post delegation even though this is assumed to be trusted code.