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

Function ordering does not follow the Solidity style guide

Summary

Function ordering does not follow the Solidity style guide

Vulnerability Details

Functions should be grouped according to their visibility and ordered:

  • constructor

  • receive function (if exists)

  • fallback function (if exists)

  • external

  • public

  • internal

  • private

Within a grouping, place the view and pure functions last.

Source: https://docs.soliditylang.org/en/v0.8.17/style-guide.html#order-of-functions

File: src/Beedle.sol
36: function mint(address to, uint256 amount) external onlyOwner {

Link to code - https://github.com/Cyfrin/2023-07-beedle/tree/main/src/Beedle.sol

File: src/Lender.sol
116: function getLoanDebt(uint256 loanId) external view returns (uint256 debt) {

Link to code - https://github.com/Cyfrin/2023-07-beedle/tree/main/src/Lender.sol

File: src/interfaces/IERC20.sol
9: function transfer(address to, uint256 amount) external returns (bool);

Link to code - https://github.com/Cyfrin/2023-07-beedle/tree/main/src/interfaces/IERC20.sol

Tools Used

Code Review

Recommendations

Follow the Solidity style guide

Auditor

NeoCrao

Support

FAQs

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