DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Unnecessary data sent

https://github.com/Cyfrin/2024-07-zaros/blob/main/src/external/chainlink/keepers/liquidation/LiquidationKeeper.sol#L85

Summary

An issue has been identified in the LiquidationKeeper.sol contract where checkUpkeep returns uint128[] of account IDs along with address(this), which is not used. While this does not cause immediate functional or security problems, it introduces unnecessary complexity and minor gas inefficiency.

Description

The checkUpkeep function in the LiquidationKeeper.sol contract identifies accounts that need liquidation and prepares the data for the performUpkeep function. It returns upkeepNeeded and performData, where performData includes a uint128[] array of account IDs and address(this):

While address(this) is included in performData, it is not used in the performUpkeep function, leading to potential confusion and unnecessary data handling.

Impact

Including address(this) in the performData can lead to:

  1. Code Complexity: Unnecessary inclusion of address(this) increases code complexity, making it harder to maintain and understand.

  2. Potential for Future Errors: If future changes assume that address(this) is used, it might introduce errors or unexpected behavior.

  3. Gas Inefficiency: Encoding and decoding unnecessary data increases gas consumption, reducing the efficiency of the contract.

Recommended Mitigations

  1. Remove Unnecessary Data: Remove address(this) from the performData to simplify the code and reduce gas consumption.

  2. Simplify performUpkeep Decoding: Update the performUpkeep function to decode only the necessary data.

Updates

Lead Judging Commences

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

Error is in decoding of `peformData`

Support

FAQs

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