An immutable TIMEOUT
might cause an incorrect staleness check leading to revert.
Line 30 in the above code checks if the value of answer returned from the Chainlink feed is stale. If the time last update(secondsSince
) is larger than TIMEOUT
(10800seconds/ 3 hours), then the value is considered stale,
However, the TIMEOUT
is hardcoded and immutable. This might be an issue because Chainlink's heartbeat value might be changed in the future. For instance, it might reduce the heartbeat to 3600 seconds (1 hour). If this happen, the existing code will fail to detect the stale value returned from the price feed.
As mentioned by [Chainlink documentation](https://docs.chain.link/data-feeds):
Heartbeat and deviation thresholds can also differ for the same asset across different blockchains.
and existing observation that the heartbeat of price feed across different blockchains are often different (e.g. AAVE/USD on Ethereum - 1 hour heartbeat, AAVE/USD on Arbitrum - 24 hours heartbeat).
Risk of incorrect staleness check leading to the wrong price being computed.
Manual Review
Consider allowing the owner to update the heartbeat variable in the contract.
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.