Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Valid

Incorrect parameters for the `ArrayLengthMismatch` error message

Summary

The MarketMakingEngineConfigurationBranch.configureDepositAndRedeemFees function verifies the array lengths and throws an error in case of mismatch. The problem is that the massage will contain accepted lengths instead of incorrect.

Vulnerability Details

function configureDepositAndRedeemFees(
uint128[] calldata vaultsIds,
uint128[] calldata depositFees,
uint128[] calldata redeemFees
)
external
onlyOwner
{
// verify the array length
>> if (vaultsIds.length != depositFees.length) {
revert Errors.ArrayLengthMismatch(vaultsIds.length, depositFees.length);
}
// verify the array length
if (depositFees.length != redeemFees.length) {
>> revert Errors.ArrayLengthMismatch(vaultsIds.length, depositFees.length);
}

Impact

Unintended behavior

Tools used

Manual Review

Recommendations

Consider including relevant lengths in the error message:

// verify the array length
if (depositFees.length != redeemFees.length) {
- revert Errors.ArrayLengthMismatch(vaultsIds.length, depositFees.length);
+ revert Errors.ArrayLengthMismatch(redeemFees.length, depositFees.length);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

configureDepositAndRedeemFees function emits the wrong parameters inside the `(depositFees.length != redeemFees.length)` check

Support

FAQs

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