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

For the borrow(), repay() & startAuction() functions in Lender.sol the public visibility modifiers should be changed to external, to help optimize gas usage

  1. For the borrow() & repay() in Lender.sol the public visibility modifiers should be changed to external, to help optimize gas usage. Since it doesn't seem these functions are called internally at all, external modifier should be sufficient.

https://github.com/Cyfrin/2023-07-beedle/blob/d9718f2ca6521756624c017c90f3d4d4e80da90c/src/Lender.sol#L232
https://github.com/Cyfrin/2023-07-beedle/blob/d9718f2ca6521756624c017c90f3d4d4e80da90c/src/Lender.sol#L292

Recommendation:

Change from:

function borrow(Borrow[] calldata borrows) public {
and
function repay(uint256[] calldata loanIds) public {
and
function startAuction(uint256[] calldata loanIds) public {

to:

function borrow(Borrow[] calldata borrows) external {
and
function repay(uint256[] calldata loanIds) external {
and
function startAuction(uint256[] calldata loanIds) external {

Support

FAQs

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