code-423n4 / 2022-02-tribe-turbo-findings

1 stars 0 forks source link

Gas Optimizations #8

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago
  1. In canSafeBoostVault function at TurboBooster.sol#L100, both arguments safe and feiAmount are never considered in the function and hence could be removed

  2. In boost function at TurboSafe.sol#L171 is not checking zero value check for feiAmount. Add a condition

require(feiAmount>0,"Invalid value");
  1. In less function at TurboSafe.sol#L226, it is not verified if feiDebt is not zero. Add a check
require(feiDebt>0,"No Debt")
  1. In slurp function at TurboSafe.sol#L272, add a check to verify that safeInterestAmount >0. Add below condition:
if(interestEarned>0){return;}  // returing since this is valid scenario if getFeePercentageForSafe is 100%
  1. In impound function at TurboGibber.sol#L74, add below missing checks:
require(to!=address(0),"Invalid address");
require(assetAmount>0,"Invalid amount");
require(feiAmount>0,"Invalid amount");
  1. In impoundAll function at TurboGibber.sol#L98, add below missing checks:
require(to!=address(0),"Invalid address");
GalloDaSballo commented 2 years ago

I don't believe the sponsor will apply any of this advice

3/10