In ScrvUsdOracleV2.vy
, v1
and v2
are projected prices. However, due to the logic in _obtain_price_params
_ _whereby:
if params.last_profit_update + period >= parameters_ts:````return params
This would lead to the function always retrieving the current price params, hence resulting in no price projection even for v1
and v2
prices.
Looking at the flow, beginning at update_price
:
self.last_prices = [self._price_v0(), self._price_v1(), self._price_v2()]
Looking at _price_v1
first:
it will calculate the smoothed price of the last stored v1 price and _raw_price(block.timestamp, self.price_params_ts
In _raw_price
, it will now pass self.price_params_ts
in obtain_price_params
The below check in obtain_price_params
will now return the current stored params
Since profit_max_unlock_time == 7 * 86400, the last profit update + 1 week will be certain to be more than the last stored price_params_ts
.
Now for _price_v2
:
it will calculate the smoothed price of the last stored v2 price and _raw_price(block.timestamp, block.timestamp)
n _raw_price
, it will now pass block.timestamp
in obtain_price_params
If the last profit update + 1 week >= block.timestamp, it will return last stored params
. This means that if price is updated via update_price
, it will only calculate price projections for v2 if the function is called more than 1 week from last profit update, which would result in stale price updates.
When updating self.last_prices
, the V1 and v2 price will always be based on last stored params, instead of projecting price based on periods. Due to this, the core logic of the function is broken as the price update does not consider correct price projections to ensure safe and precise approximation.
Manual
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.