You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require(pool.shutdown ==false, "pool is closed");
//send to proxy to stakeaddress lptoken = pool.lptoken;
IERC20(lptoken).safeTransferFrom(msg.sender, staker, _amount);
//stakeaddress gauge = pool.gauge;
require(gauge !=address(0), "!gauge setting");
require(gauge != address(0), "!gauge setting"); could be set prior to //send to proxy to stake to save the gas used in safeTransferFrom in case gauge == address(0).
Gas Report
[G-01] Unnecessary use of
SafeMath
Underflows/overflows cannot happen in solidity
>=0.8.0
, thereforeSafeMath
is redundant.[G-02]
for
loop gas optimisationBaseRewardPool.sol#L199-L201
Gas could be saved by:
Example:
[G-03] Unnecessary boolean declaration
Booster.sol#L352
pool.shutdown == false
can be changed to!pool.shutdown
.[G-04] Zero address check location could be more gas efficient
Booster.sol#L352-L360
require(gauge != address(0), "!gauge setting");
could be set prior to//send to proxy to stake
to save the gas used insafeTransferFrom
in casegauge == address(0)
.[G-05] Parameters could be immutable
VeTokenMinter.sol#L18
Parameters such as
totalCliffs
,reductionCliff
,veToken
andmaxTime
could be made immutable to save gas.The text was updated successfully, but these errors were encountered: