When using elements that are smaller than 32 bytes, your contract’s gas usage may be higher. This is because the EVM operates on 32 bytes at a time. Therefore, if the element is smaller than that, the EVM must use more operations in order to reduce the size of the element from 32 bytes to the desired size.
More detail see this.
Each operation involving a uint8
costs an extra 22-28 gas (depending on whether the other operand is also a variable of type uint8
) as compared to ones involving uint256
, due to the compiler having to clear the higher bits of the memory word before operating on the uint8
, as well as the associated stack operations of doing so. Use a larger size then downcast where needed
There are 3
instances of this issue:
uint80
OracleLib.staleCheckLatestRoundData(AggregatorV3Interface). should be used uint256/int256
.
uint80
OracleLib.staleCheckLatestRoundData(AggregatorV3Interface).roundId should be used uint256/int256
.
uint80
OracleLib.staleCheckLatestRoundData(AggregatorV3Interface).answeredInRound should be used uint256/int256
.
Using uint256/int256
replace uint128/uint64/uint32/uint16/uint8
or int128/int64/int32/int16/int8
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.