40,000 USDC
View results
Submission Details
Severity: gas

Non-external/public variable and function names should begin with an underscore

Summary

According to the Solidity Style Guide, Non-external/public variable and function names should begin with an underscore

Vulnerability Details

When designing a smart contract, the public-facing API is an important consideration.

Leading underscores allow you to immediately recognize the intent of such functions, but more importantly, if you change a function from non-external to external (including public) and rename it accordingly, this forces you to review every call site while renaming.

Instances: 6

  • Escrow.sol:
    |uint256 private immutable i_price;
    |IERC20 private immutable i_tokenContract;
    |address private immutable i_buyer;
    |address private immutable i_seller;
    |address private immutable i_arbiter;
    |uint256 private immutable i_arbiterFee;

Impact

While reading the code of the contact you might not recognize if a variable is internal/private or not.

Tools Used

Manual

Recommendations

Use the underscore as the first character for each of the above-mentioned. Such as:
uint256 private immutable _i_arbiterFee;

Support

FAQs

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