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

Gas Optimizations #16

Open
code423n4 opened this issue May 12, 2022 · 1 comment
Open

Gas Optimizations #16

code423n4 opened this issue May 12, 2022 · 1 comment
Labels
bug Something isn't working G (Gas Optimization) sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Impact

[1] Consider using optimized for-loop and apply the following optimizations:

  1. cache .length into local variable to avoid looking up every for-loop iteration.
  2. using ++i consumes 5 less gas than i++ (same applies to --i)
  3. using unchecked keyword for counter i unchecked{ ++i; } consumes 49 less gas each iteration (same applies to --i)
  4. don't initialize uint256 i = 0; instead use the default value uint256 i;
  5. make sure to specify uint256 type instead of uint type for readability

Affected code:

  1. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L143
  2. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L147
  3. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L151
  4. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L174
  5. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L306
  6. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L410
  7. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L664
  8. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L696
  9. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L726
  10. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L773
  11. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L100
  12. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L51
  13. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/ExtraRewardsDistributor.sol#L233
  14. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ArbitartorVault.sol#L49
  15. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L214
  16. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L230
  17. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L262
  18. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L296
  19. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L379
  20. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L538
  21. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L144
  22. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L163
  23. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ConvexMasterChef.sol#L180
  24. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ExtraRewardStashV3.sol#L125
  25. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ExtraRewardStashV3.sol#L199
  26. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerSecondaryProxy.sol#L69

Proof of Concept

Tools Used

Recommended Mitigation Steps


Impact

[2] Splitting && conditions into several require statements saves gas.

Affected code:

  1. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L90
  2. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L159
  3. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L203
  4. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L48
  5. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L57
  6. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/ExtraRewardsDistributor.sol#L171
  7. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L220
  8. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L222
  9. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L278
  10. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L279
  11. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L280
  12. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L313
  13. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L314
  14. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerSecondaryProxy.sol#L111
  15. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/StashFactoryV2.sol#L83

Proof of Concept

Tools Used

Recommended Mitigation Steps


Impact

[3] Using x != 0 uses 6 less gas than x > 0.
Consider changing all "greater than zero" comparisons to "not equal to zero".

Affected code:

  1. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L178
  2. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L196
  3. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L200
  4. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L218
  5. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L221
  6. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L309
  7. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L400
  8. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L419
  9. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L443
  10. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L496
  11. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L520
  12. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L664
  13. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L726
  14. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L177
  15. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L185
  16. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L207
  17. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/ExtraRewardsDistributor.sol#L149
  18. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L287
  19. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L593
  20. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L602
  21. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ConvexMasterChef.sol#L213
  22. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L113
  23. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L145
  24. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L175
  25. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ExtraRewardStashV3.sol#L205
  26. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VirtualBalanceRewardPool.sol#L196
  27. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L175

Proof of Concept

Tools Used

Recommended Mitigation Steps


Impact

[4] Using ++x uses 5 less gas than x++ (same applies to --x).
Consider changing all "x++" operators to "++x" (same applies to --x).

Affected code:

  1. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L426
  2. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L702

Proof of Concept

Tools Used

Recommended Mitigation Steps


Impact

[5] As per 0.8.4 solidity version it supports new custom errors.
Custom errors are reducing 38 gas if condition is met and 22 gas otherwise.
Also reduces contract size and deployment costs.

Affected code:

  1. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L66
  2. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L67
  3. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L68
  4. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L69
  5. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L92
  6. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L129
  7. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L77
  8. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L121
  9. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L139
  10. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L157
  11. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L206
  12. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L207
  13. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L210
  14. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L96
  15. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L137
  16. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L196
  17. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L197
  18. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L210
  19. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L216
  20. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L217
  21. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L232
  22. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L233
  23. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L259
  24. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L260
  25. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L353
  26. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L359
  27. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L385
  28. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L431
  29. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L471
  30. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L472
  31. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L476
  32. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L598
  33. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L616
  34. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L655
  35. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L719
  36. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L821
  37. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L822
  38. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L849
  39. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L850
  40. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L851
  41. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMath.sol#L40
  42. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMath.sol#L45
  43. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMath.sol#L50
  44. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMath.sol#L55
  45. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMath.sol#L60
  46. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L69
  47. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L78
  48. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L84
  49. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L85
  50. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L91
  51. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L97
  52. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L98
  53. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L105
  54. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L119
  55. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L120
  56. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L121
  57. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L122
  58. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L123
  59. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L126
  60. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L152
  61. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMinter.sol#L32
  62. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraPenaltyForwarder.sol#L48
  63. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraPenaltyForwarder.sol#L52
  64. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L89
  65. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L90
  66. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L100
  67. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L108
  68. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L116
  69. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L117
  70. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L128
  71. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L129
  72. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L138
  73. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L158
  74. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L159
  75. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L172
  76. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L203
  77. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L56
  78. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L57
  79. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L66
  80. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L78
  81. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L87
  82. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L97
  83. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L117
  84. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L118
  85. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L185
  86. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L47
  87. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L48
  88. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L49
  89. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L53
  90. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L57
  91. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L65
  92. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L70
  93. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L79
  94. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/BalLiquidityProvider.sol#L89
  95. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/ClaimFeesHelper.sol#L45
  96. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/CrvDepositorWrapper.sol#L43
  97. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/CrvDepositorWrapper.sol#L120
  98. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/ExtraRewardsDistributor.sol#L68
  99. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/ExtraRewardsDistributor.sol#L74
  100. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/ExtraRewardsDistributor.sol#L171
  101. https://github.com/code-423n4/2022-05-aura/blob/main/contracts/ExtraRewardsDistributor.sol#L172
  102. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ArbitartorVault.sol#L38
  103. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ArbitartorVault.sol#L47
  104. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ArbitartorVault.sol#L54
  105. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L126
  106. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L127
  107. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L133
  108. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L211
  109. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L227
  110. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool.sol#L325
  111. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool4626.sol#L63
  112. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BaseRewardPool4626.sol#L90
  113. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L129
  114. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L139
  115. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L149
  116. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L159
  117. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L182
  118. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L192
  119. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L202
  120. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L218
  121. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L219
  122. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L220
  123. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L222
  124. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L223
  125. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L226
  126. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L256
  127. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L258
  128. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L273
  129. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L276
  130. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L278
  131. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L279
  132. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L280
  133. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L281
  134. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L295
  135. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L313
  136. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L314
  137. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L315
  138. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L357
  139. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L376
  140. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L398
  141. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L400
  142. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L408
  143. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L505
  144. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L515
  145. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L525
  146. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L526
  147. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L536
  148. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L549
  149. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L560
  150. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L574
  151. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L635
  152. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L645
  153. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L648
  154. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L649
  155. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/Booster.sol#L670
  156. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L86
  157. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L96
  158. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L109
  159. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L140
  160. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L146
  161. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L159
  162. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L160
  163. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L170
  164. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L171
  165. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/BoosterOwner.sol#L185
  166. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ConvexMasterChef.sol#L242
  167. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L63
  168. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L68
  169. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L73
  170. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L81
  171. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L89
  172. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L90
  173. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L141
  174. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/CrvDepositor.sol#L169
  175. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/DepositToken.sol#L48
  176. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/DepositToken.sol#L54
  177. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ExtraRewardStashV3.sol#L70
  178. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ExtraRewardStashV3.sol#L97
  179. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ExtraRewardStashV3.sol#L141
  180. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ExtraRewardStashV3.sol#L147
  181. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/ExtraRewardStashV3.sol#L196
  182. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerProxy.sol#L33
  183. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerProxy.sol#L38
  184. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerProxy.sol#L68
  185. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerProxy.sol#L69
  186. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerProxy.sol#L73
  187. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerProxy.sol#L78
  188. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerSecondaryProxy.sol#L48
  189. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerSecondaryProxy.sol#L53
  190. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerSecondaryProxy.sol#L87
  191. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerSecondaryProxy.sol#L95
  192. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerSecondaryProxy.sol#L104
  193. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerSecondaryProxy.sol#L111
  194. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerSecondaryProxy.sol#L118
  195. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerV3.sol#L41
  196. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerV3.sol#L49
  197. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerV3.sol#L71
  198. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerV3.sol#L81
  199. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/PoolManagerV3.sol#L88
  200. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/RewardFactory.sol#L47
  201. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/RewardFactory.sol#L57
  202. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/RewardFactory.sol#L72
  203. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/StashFactoryV2.sol#L46
  204. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/StashFactoryV2.sol#L56
  205. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/StashFactoryV2.sol#L60
  206. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/StashFactoryV2.sol#L67
  207. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/StashFactoryV2.sol#L74
  208. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/StashFactoryV2.sol#L83
  209. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/TokenFactory.sol#L42
  210. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VirtualBalanceRewardPool.sol#L169
  211. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VirtualBalanceRewardPool.sol#L182
  212. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VirtualBalanceRewardPool.sol#L213
  213. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L74
  214. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L84
  215. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L95
  216. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L106
  217. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L107
  218. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L117
  219. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L123
  220. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L138
  221. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L167
  222. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L189
  223. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L190
  224. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L207
  225. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L224
  226. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L243
  227. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L254
  228. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L266
  229. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L276
  230. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L285
  231. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L294
  232. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L306
  233. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L322
  234. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L334
  235. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L350
  236. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/VoterProxy.sol#L353
  237. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/cCrv.sol#L39
  238. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/cCrv.sol#L47
  239. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/cCrv.sol#L56
  240. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L8
  241. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L12
  242. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L16
  243. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L20
  244. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L25
  245. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L30
  246. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L35
  247. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L40
  248. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L45
  249. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L50
  250. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L55
  251. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L60
  252. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L68
  253. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L72
  254. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L79
  255. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L83
  256. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L90
  257. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L94
  258. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L98
  259. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L102
  260. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L111
  261. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L115
  262. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L119
  263. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L123
  264. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L131
  265. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L135
  266. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L139
  267. https://github.com/code-423n4/2022-05-aura/blob/main/convex-platform/contracts/contracts/interfaces/BoringMath.sol#L143

Proof of Concept

Tools Used

Recommended Mitigation Steps


Impact

[6] No overflow possible here because total supply will overflow earlier.
You can use unchecked keyword here:
unchecked{ _balances[_for] = _balances[_for] + _amount; }

Affected code:

  1. https://github.com/code-423n4/2022-05-aura/blob/085f573756b132b2a5992c5aa5d7b907cd11c289/contracts/AuraBalRewardPool.sol#L143

Proof of Concept

Tools Used

Recommended Mitigation Steps


Impact

[7] No overflow possible here because _balance will overflow earlier.
You can use unchecked keyword here:
unchecked{ _totalSupply = _totalSupply - amount; }

Affected code:

  1. https://github.com/code-423n4/2022-05-aura/blob/085f573756b132b2a5992c5aa5d7b907cd11c289/contracts/AuraBalRewardPool.sol#L143
  2. https://github.com/code-423n4/2022-05-aura/blob/085f573756b132b2a5992c5aa5d7b907cd11c289/contracts/AuraLocker.sol#L435

Proof of Concept

Tools Used

Recommended Mitigation Steps


Impact

[8] Storage keyword is recommended to be used whenever possible. It can save up-to 2k gas per each variable with memory keyword (if updating storage up-to 5-10k).
Memory keyword is supposed to be used when temporary data is being updated and calculated regularly.
Affected code:

  1. https://github.com/code-423n4/2022-05-aura/blob/085f573756b132b2a5992c5aa5d7b907cd11c289/contracts/AuraLocker.sol#L355
  2. https://github.com/code-423n4/2022-05-aura/blob/085f573756b132b2a5992c5aa5d7b907cd11c289/contracts/AuraLocker.sol#L521
  3. https://github.com/code-423n4/2022-05-aura/blob/085f573756b132b2a5992c5aa5d7b907cd11c289/contracts/AuraLocker.sol#L794
  4. https://github.com/code-423n4/2022-05-aura/blob/085f573756b132b2a5992c5aa5d7b907cd11c289/convex-platform/contracts/contracts/Booster.sol#L646
  5. https://github.com/code-423n4/2022-05-aura/blob/085f573756b132b2a5992c5aa5d7b907cd11c289/contracts/AuraLocker.sol#L486
  6. https://github.com/code-423n4/2022-05-aura/blob/085f573756b132b2a5992c5aa5d7b907cd11c289/contracts/AuraLocker.sol#L727

Proof of Concept

https://geeksforgeeks.org/storage-vs-memory-in-solidity

Tools Used

Recommended Mitigation Steps


@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels May 12, 2022
code423n4 added a commit that referenced this issue May 12, 2022
@0xMaharishi 0xMaharishi added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label May 25, 2022
@0xMaharishi
Copy link

This is a comprehensive gas optimisation report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working G (Gas Optimization) sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

2 participants