In the deposit function, a MarketPrices
variable is declared and passed to the _mint
function without being assigned any actual price data. Since MarketPrices is later used in functions like _totalAmount
, this uninitialized variable could lead to incorrect computations or unintended behavior when price-dependent logic is executed.
Issue Explanation:
The MarketPrices
variable (prices) is declared as a memory variable but is never assigned any concrete price values.
This uninitialized prices
is passed to the _mint
function, which may in turn use it for computations involving current token prices.
The _totalAmount
function uses the prices parameter to calculate values based on market prices:
If prices
remains uninitialized (i.e., contains default zero values), any calculations based on its fields (e.g., prices.indexTokenPrice.min
or prices.shortTokenPrice.min
) may result in division by zero errors, invalid totals, or other unintended behavior.
Incorrect Calculations:
The reliance on an uninitialized MarketPrices
variable can result in erroneous minting amounts or inaccurate valuation of the protocol’s total assets. This may adversely affect share token issuance and overall system accounting.
manual review
Initialize MarketPrices Properly:
Modify the deposit function to retrieve and assign correct market price data to the MarketPrices variable before passing it to _mint. For example:
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.