When the position is 1x long, the shares calculation of the mint
function is incorrect.
In the mint
function of PerpetulVault.sol
, the user's shares are calculated by calculating the proportion of the amount of collateral deposited to the total amount (totalAmountBefore
).
But in the case of a 1x long position, the totalAmountBefore
is the balance of the indexToken, not the **collateralToken. **This will result in incorrect calculation of _shares
.
The protocol function cannot run correctly.
vs code
After obtaining the balance of IndexToken, it needs to be multiplied by the exchange rate between indexToken and collateralToken.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
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.