Closed code423n4 closed 2 years ago
Unfortunately, at times, types that aren't 256-bits use more gas. Further, function arguments aren't compacted, so there is no benefit to unising types smaller than 256 bits as function arguments.
yep, unless it's storage non-words use more gas
Handle
sirhashalot
Vulnerability details
Impact
The amount and amountUnlocked variables can be uint88 instead of uint256 because the maximum value of these variables is a uint88 (the MAX_TOTAL_XDEFISUPPLY constant). As further evidence, the amount variable is cast to uint88 in the
_lock()
function and the position.depositedXDEFI value is uint88.Proof of Concept
The
amount
andamountUnlocked_
variables are found throughoutRecommended Mitigation Steps
Use a smaller uint size to reduce storage and gas costs