https://github.com/Cyfrin/2024-07-zaros/blob/main/src/external/chainlink/keepers/liquidation/LiquidationKeeper.sol#L85
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.
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.
Including address(this)
in the performData
can lead to:
Code Complexity: Unnecessary inclusion of address(this)
increases code complexity, making it harder to maintain and understand.
Potential for Future Errors: If future changes assume that address(this)
is used, it might introduce errors or unexpected behavior.
Gas Inefficiency: Encoding and decoding unnecessary data increases gas consumption, reducing the efficiency of the contract.
Remove Unnecessary Data: Remove address(this)
from the performData
to simplify the code and reduce gas consumption.
Simplify performUpkeep Decoding: Update the performUpkeep
function to decode only the necessary data.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.