wrong implement of getTokenPrice.We are not implemented the loopback in correct way.
getTwap should be used when there is a loopback and getprice should be used when there is no loopback.
function getTokenPrice(
address priceAggregatorAddress,
uint256 maxTimeout,
uint256 lookback
) internal view returns (uint256 price) {
return
@ >lookback > 0
? getPrice(priceAggregatorAddress, maxTimeout)
: getTwap(priceAggregatorAddress, maxTimeout, lookback);
}
wrong implement of getTokenPrice will get the wrong price.
function getTokenPrice(
address priceAggregatorAddress,
uint256 maxTimeout,
uint256 lookback
) internal view returns (uint256 price) {
return
@> lookback > 0
?getTwap(priceAggregatorAddress, maxTimeout, lookback)
: getPrice(priceAggregatorAddress, maxTimeout);
}
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.