DeFiHardhat
12,000 USDC
View results
Submission Details
Severity: low
Invalid

Unused parameter in ProportionalLPToken2::calcLPTokenUnderlying function

Summary

Unused parameter in ProportionalLPToken2::calcLPTokenUnderlying function

Vulnerability Details

Unused parameter bytes calldata in ProportionalLPToken2::calcLPTokenUnderlying function. This is the last parameter in this function which is not used or even named.

Impact

There is low impact:

  1. You must remember to add bytes type parameter as the last parameter to call calcLPTokenUnderlying function (even "" will do)

  2. There is an impact on gas usage when calling function with and without the parameter

Bear in mind that removing the parameter will result in a different function signature.

Tools Used

Reading the code

Recommendations

Delete unused parameter:

function calcLPTokenUnderlying(
uint256 lpTokenAmount,
uint256[] calldata reserves,
+ uint256 lpTokenSupply
- uint256 lpTokenSupply,
- bytes calldata
) external pure returns (uint256[] memory underlyingAmounts) {
underlyingAmounts = new uint256[](2);
underlyingAmounts[0] = lpTokenAmount * reserves[0] / lpTokenSupply;
underlyingAmounts[1] = lpTokenAmount * reserves[1] / lpTokenSupply;
}
Updates

Lead Judging Commences

giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational/Invalid

Support

FAQs

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