Omniscia Tren Finance Audit

FixedPriceAggregator Manual Review Findings

FixedPriceAggregator Manual Review Findings

FPA-01M: Improper Round Start Time

Description:

THe FixedPriceAggregator::getRoundData and FixedPriceAggregator::latestRoundData functions will yield a started-at timestamp of 0 which is invalid.

Example:

contracts/Pricing/FixedPriceAggregator.sol
29function getRoundData(uint80 _roundId)
30 external
31 view
32 override
33 returns (
34 uint80 roundId,
35 int256 answer,
36 uint256 startedAt,
37 uint256 updatedAt,
38 uint80 answeredInRound
39 )
40{
41 uint256 timestamp = block.timestamp - 5 minutes;
42 return (_roundId, PRICE, 0, timestamp, uint80(timestamp));
43}
44
45function latestRoundData()
46 external
47 view
48 override
49 returns (
50 uint80 roundId,
51 int256 answer,
52 uint256 startedAt,
53 uint256 updatedAt,
54 uint80 answeredInRound
55 )
56{
57 uint256 timestamp = block.timestamp - 2 minutes;
58 return (uint80(timestamp), PRICE, 0, timestamp, uint80(timestamp));
59}

Recommendation:

We advise both to yield the same timestamp as the updatedAt value, mimicking the behaviour of typical Chainlink nodes.

Alleviation (f6f1ad0b8f24a96ade345db1dd05a1878eb0f761):

Both functions have been updated to yield the same non-zero timestamp as advised, addressing this exhibit.