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

Repeated code

Summary

The getPoolId() function in Lender.sol is not used in some places thereby not following solidity style guidelines

Vulnerability Details

In line 570,595 repeated code is used. eg in 595 the following is used.

bytes32 oldPoolId = keccak256(
abi.encode(
loans[loanId].lender,
loans[loanId].loanToken,
loans[loanId].collateralToken
)
);

Impact

Increase in technical debt.

Tools Used

Manual review

Recommendations

Use the following in line 108.

function getPoolId(
address lender,
address loanToken,
address collateralToken
) public pure returns (bytes32 poolId) {
poolId = keccak256(abi.encode(lender, loanToken, collateralToken));
}

Support

FAQs

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

Give us feedback!