DeFiLayer 1Layer 2
14,723 OP
View results
Submission Details
Severity: low
Invalid

Inaccurate Price Calculation Due to Unupdated Parameters After Deployment

Summary

After deployment, the initial parameters are used to calculate the price. However, if the price is not updated after deployment, the initial parameters will be used indefinitely, leading to potentially incorrect price calculations.

Vulnerability Details

At deployment, the initial parameters are set:

self.price_params = PriceParams(
total_debt=0,
total_idle=1,
total_supply=1,
full_profit_unlock_date=0,
profit_unlocking_rate=0,
last_profit_update=0,
balance_of_self=0,
)

This means the price calculations, such as in _price_v1() , _price_v2(): will use deployment paramters.

return self._smoothed_price(
self.last_prices[1], self._raw_price(block.timestamp, self.price_params_ts)
)

This happens because the price parameters are not updated prior to the first price calculation after deployment.

Impact

Incorrect Price Calculation

Tools Used

Manual Code Review

Recommendations

update paramter before price calculations.

Updates

Lead Judging Commences

0xnevi Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

finding-hardcoded-initial-price

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.