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
for (uint i = 0; i < pools.length; i++) {
Pool memory pool = pools[i];
pool.lpToken.safeApprove(address(pool.sett), uint(-1));
if (i < 3) {
ren.safeApprove(address(pool.deposit), uint(-1));
wbtc.safeApprove(address(pool.deposit), uint(-1));
IERC20(address(pool.sett)).safeApprove(address(settPeak), uint(-1));
} else {
IERC20(address(pool.sett)).safeApprove(address(byvWbtcPeak), uint(-1));
}
}
As pools.length must be 4, it can be replaced with a literal 4.
The text was updated successfully, but these errors were encountered:
Handle
WatchPug
Vulnerability details
Reading array length at each iteration of the loop takes 6 gas (3 for mload and 3 to place memory_offset) in the stack.
https://github.com/Badger-Finance/ibbtc/blob/d8b95e8d145eb196ba20033267a9ba43a17be02c/contracts/Zap.sol#L70-L80
As
pools.length
must be4
, it can be replaced with a literal4
.The text was updated successfully, but these errors were encountered: