20,000 USDC
View results
Submission Details
Severity: gas

event missing indexed field

Summary

Event is missing indexed fields

Vulnerability Details

Lender.sol line 56 event Refinanced(uint256 loanId); loanId can be indexed
Lender.sol lines 699 emits event Borrowed() and line 798 Refinanced() in function refinance() yes they are seperate but it may be ideal to emit a single event BorrowedRefinance() to reflect that the borrow that happens in refinance is different form other borrows as its a refinance. Emit single event vs 2 events

Impact

Informational:Indexed events help off chain tool, reporting, monitoring, etc as indexed fields are quicker to access and parse. Each event can have up to 3 indexed fields.

Emitting single event is cleaner, clearer more interpretable for offchain tooling, tracking, front ends and analysis

Tools Used

Manual Analysis

Recommendations

It is recommended to create a single event reflecting a borrow happening in refinance
If still decide to keep 2 events ensure Refinance() indexes loandId as you may want to filter by refinanced loandId's offchain

Support

FAQs

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

Give us feedback!