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

`public` functions not used by the contract should use `external` visibility

Summary

Functions should use minimally required visibility, so if a function is not called internally be the contract, it should be declared as external (only visible externally) rather than public (visible externally and internally).

Vulnerability Details

There are 7 instances of this issue.

View 7 Instances
File: src/Fees.sol
26: function sellProfits(address _profits) public {
File Link Instance Count Instance Link
Fees.sol 1 26

File: src/Lender.sol
232: function borrow(Borrow[] calldata borrows) public {
292: function repay(uint256[] calldata loanIds) public {
437: function startAuction(uint256[] calldata loanIds) public {
548: function seizeLoan(uint256[] calldata loanIds) public {
591: function refinance(Refinance[] calldata refinances) public {
File Link Instance Count Instance Links
Lender.sol 5 232,292,437,548,591

File: src/utils/Ownable.sol
19: function transferOwnership(address _owner) public virtual onlyOwner {
File Link Instance Count Instance Link
Ownable.sol 1 19

Impact

Decreased readability and maintainability.

Tools Used

baudit: a custom static code analysis tool; manual review

Recommendations

Reduce function visibility from public to external when unused from within the contract and not required to be public by a parent contract.

Support

FAQs

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