20,000 USDC
View results
Submission Details
Severity: gas
Valid

Incorrect comments

Summary

Confusing comments

Vulnerability Details

Lender.sol lines 167-175
if (pools[poolId].lender == address(0)) {
// if the pool doesn't exist then create it
emit PoolCreated(poolId, p);
} else {
// if the pool does exist then update it
emit PoolUpdated(poolId, p);
}

    pools[poolId] = p;

The pool is updated outside of the blocks--> pools[poolId] = p;
However the comments -> // if the pool doesn't exist then create it ---makes it seem as if in this if block a pool must be created when in actual fact its an event emitted
However the comments -> // if the pool does exist then update it ----it makes it seem as if in this if block a pool must be created when in actual fact its an event emitted

The comments make it seem as if some creation code or update code is missing in the if,else blocks

Impact

Informational: This affects code readability, interpretability, maintenance, auditability and can even introduce errors as dev working on project may think there needs to be some creation functions in the if, else blocks

Tools Used

Manual Analysis

Recommendations

It is recommended to remove the confusing comments or reword them to be appropriate

Support

FAQs

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