Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: medium
Valid

Deposit function, call to getLpTokenValue function passes wrong parameter

Summary

In the deposit function, the call to the getLpTokenValue function passed the wrong parameter, resulting in an error in getting the price.

Vulnerability Details

The fifth parameter passed in the deposit function when calling the getLpTokenValue function indicates whether to add mobility or remove mobility. In the deposit function this parameter should be passed true, but in the repository it is passed false.

if (dp.token == address(self.lpToken)) {
// If LP token deposited
_dc.depositValue = self.gmxOracle.getLpTokenValue(
address(self.lpToken),
address(self.tokenA),
address(self.tokenA),
address(self.tokenB),
false, //@audit
false
)

Impact

Getting the wrong lptoken price.

Tools Used

manual

Recommendations

It is recommended to change the incoming parameter from false to true.

Updates

Lead Judging Commences

hans Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Wrong PNL Factor in GMXDeposit for for lpToken

Impact: Medium Likelihood: High The impact of using a wrong price (conservative vs optimistic) is limited, especially given the users specify the slippage.

Support

FAQs

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