Closed 0xfornax closed 1 year ago
The timeoutMinutes data entry of an oracle is always converted to seconds within the PriceFeed contract.
timeoutMinutes
PriceFeed
return block.timestamp - _priceTimestamp > _oracleTimeoutMinutes * 60; }
We advise it to be stored as seconds instead, eliminating the need for a multiplication in PriceFeed::_isStalePrice and thus optimizing its gas cost.
PriceFeed::_isStalePrice
Fixed.
PFD-02C: Inefficient Data Transformation
Description:
The
timeoutMinutes
data entry of an oracle is always converted to seconds within thePriceFeed
contract.Example:
Recommendation:
We advise it to be stored as seconds instead, eliminating the need for a multiplication in
PriceFeed::_isStalePrice
and thus optimizing its gas cost.