Open code423n4 opened 2 years ago
x = x + y
x += y
There are multiple instances in the code VaultTracker.sol
vlt.redeemable += interest; vlt.notional += a;
vlt.redeemable += interest;
from.redeemable += interest;
to.redeemable += newVaultInterest; to.notional += a;
sVault.redeemable += interest;
sVault.notional += a;
Swivel.sol
filled[hash] += a;
!= len
< len
#L85 #L247 #L409 #L552
type(uint256).max
2**x
#L549
++i
i++
#L100 #L269 #L418 #L564
some changes done elsewhere
!= vs < implemented : https://github.com/Swivel-Finance/gost/pull/430
x = x + y
is a cheaper operation thanx += y
There are multiple instances in the code VaultTracker.sol
Swivel.sol
for loops length comparison can use
!= len
instead of< len
for cheaper gas#L85 #L247 #L409 #L552
use constant/literals (e.g.
type(uint256).max
) instead of2**x
#L549
++i
will consume less gas thani++
if the optimizer isn't enabled#L100 #L269 #L418 #L564