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

Consider using named mappings

Summary

To help clarify the purpose of a mapping and make maintenance easier, consider using named mappings. Named mappings were introduced in Solidity 0.8.18.

Example:

// Before:
mapping(address => uint256) private mappingName;
// After:
mapping(address contractAddress => uint256 functionCount) private mappingName;

Vulnerability Details

There are 4 instances of this issue.

File: src/Lender.sol
70: mapping(bytes32 => Pool) public pools;
File Link Instance Count Instance Link
Lender.sol 1 70

File: src/Staking.sol
19: mapping(address => uint256) public supplyIndex;
22: mapping(address => uint256) public balances;
24: mapping(address => uint256) public claimable;
File Link Instance Count Instance Links
Staking.sol 3 19,22,24

Impact

Decreased readability and usability.

Tools Used

baudit: a custom static code analysis tool; manual review

Recommendations

Use named mappings were introduced in Solidity 0.8.18.

Support

FAQs

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