Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: medium
Invalid

Missing `baseFeeUsd` Field in DexSwapStrategy.Data Struct

Summary

The DexSwapStrategy.Data struct is missing the baseFeeUsd field, which is explicitly documented in the NatSpec comment. This discrepancy can lead to:

  1. Incorrect Functionality: If the protocol relies on baseFeeUsd for fee calculations or keeper cost coverage, the absence of this field will cause unexpected behavior.

  2. Documentation Mismatch: The NatSpec comment explicitly mentions baseFeeUsd, but the struct does not include it, leading to confusion for developers and auditors.

  3. Potential Runtime Errors: If external contracts or functions attempt to access or modify baseFeeUsd, the code will fail to compile or behave incorrectly.

Vulnerability Details

Impact

  • Functional Impact: The protocol may fail to calculate or distribute fees correctly, leading to financial discrepancies or keeper cost coverage issues.

  • Developer Impact: Developers relying on the NatSpec documentation may write code assuming the presence of baseFeeUsd, leading to compilation errors or runtime issues.

  • Auditor Impact: Auditors may flag this as a critical inconsistency, delaying the review process.

Tools Used

Manual Review

Recommendations

Add the missing baseFeeUsd field to the Data struct to align with the NatSpec documentation. The corrected struct should look like this:

struct Data {
uint128 id;
uint128 baseFeeUsd; // Added missing field
address dexAdapter;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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