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

Lack of check can lead to emission of wrong events

Summary

Lack of check for address(0) can lead to wrong emission of events.

Vulnerability Details

setPool emits an event based on whether a new pool was created or an existing one was updated. The way the function distinguishes these two scenarios is by checking if the lender of the existing pool is address(0). However, a check that ensures that lender != address(0) does not exist. A pool with lender = address(0) will always emit PoolCreated event.

Impact

Emission of wrong events. Can be problematic if other entries listen to the contract.

Tools Used

Manual review

Recommendations

Make sure the lender is not address(0) by adding the following check in the validation:

p.lender != address(0)

Support

FAQs

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

Give us feedback!