20,000 USDC
View results
Submission Details
Severity: gas

Un-indexed event parameters

Summary

Indexing an event parameter makes the parameter more quickly accessible to off-chain tools that parse events. Indexed parameters appear in the structure of topics, not the data portion of the EVM log. Parameters that do not have the indexed attribute are ABI-encoded into the data portion of the log.

Vulnerability Details

There are 9 instances of this issue.

View 9 Instances
File: src/Lender.sol
11: event PoolCreated(bytes32 indexed poolId, Pool pool);
12: event PoolUpdated(bytes32 indexed poolId, Pool pool);
13: event PoolBalanceUpdated(bytes32 indexed poolId, uint256 newBalance);
14: event PoolInterestRateUpdated(
15: bytes32 indexed poolId,
16: uint256 newInterestRate
17: );
18: event PoolMaxLoanRatioUpdated(
19: bytes32 indexed poolId,
20: uint256 newMaxLoanRatio
21: );
49: event LoanBought(uint256 loanId);
56: event Refinanced(uint256 loanId);
File Link Instance Count Instance Links
Lender.sol 7 11,12,13,14,18,49,56

File: src/interfaces/IERC20.sol
5: event Transfer(address indexed from, address indexed to, uint256 value);
6: event Approval(address indexed owner, address indexed spender, uint256 value);
File Link Instance Count Instance Links
IERC20.sol 2 5,6

Impact

Decreased usability of emitted events.

Tools Used

baudit: a custom static code analysis tool; manual review

Recommendations

Since there is a limit of three indexed parameters per event, a best practice is:

  • If there are <= 3 parameters, all of the parameters should have the indexed attribute.

  • If there are > 3 parameters, add the indexed attribute to the three most important/useful parameters.

Support

FAQs

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