code-423n4 / 2022-06-badger-findings

0 stars 0 forks source link

Gas Optimizations #133

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Require statement &&

considered using require instead of && can save gas

require(
      balanceOfPool() == 0 && LOCKER.balanceOf(address(this)) == 0,
      "You have to wait for unlock or have to manually rebalance out of it"
);

change to

require(balanceOfPool() == 0);
require(LOCKER.balanceOf(address(this))==0, "You have to wait for unlock or have to manually rebalance out of it")

and i suggest to short message for error in revert statement

change the code below: https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L184-L187

GalloDaSballo commented 2 years ago

8 gas or somethign

JeeberC4 commented 2 years ago

Warden submitted multiple Gas Optimizations. Will not be judged.