code-423n4 / 2022-02-aave-lens-findings

0 stars 0 forks source link

Gas Optimizations #77

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago
  1. avoid unnecessary 0 value set because the default value of uint is 0 https://github.com/code-423n4/2022-02-aave-lens/blob/main/contracts/upgradeability/VersionedInitializable.sol#L29 https://github.com/code-423n4/2022-02-aave-lens/blob/main/contracts/core/FollowNFT.sol#L120

remove 0 value can save gas

========================================================================

  1. gas opt to use SafeERC20 https://github.com/code-423n4/2022-02-aave-lens/blob/main/contracts/core/modules/collect/FeeCollectModule.sol#L39

by not declaring:

using SafeERC20 for IERC20;

and for example use:

SafeERC20.safeTransferFrom(IERC20(currency),collector, recipient, adjustedAmount);

can safe gas usage

========================================================================

0xleastwood commented 2 years ago

ye not sure if this is a gas optimisation.