Closed code423n4 closed 3 years ago
I disagree with the finding as the second parameter is a 256bit parameter, hence the boolean will be padded to 256bits (a bunch of zeroes) anyway
Up to the sponsor to implement the change for readability / simplicity
Handle
cmichel
Vulnerability details
The
LeveragedPool
often decides whether to use long or short tokens based on auint256 token
parameter taking the values0
(long) or1
(short), seemintTokens
. Using 256 bit for boolean value is too much and gas can be saved by using a boolean parameterbool isToken0
orbool isShortToken
instead. It's also more expressive