Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: low
Invalid

Functions Can Be Marked `external` Instead of `public`

Root Cause:

Functions that are not called internally within the contract are marked as public instead of external. The public visibility allows both external and internal calls, whereas external is intended for functions that are only called from outside the contract. Using external can be more gas-efficient.

// src/Counter.sol
function setNumber(uint256 newNumber) public {
number = newNumber;
}
function increment() public {
number++;
}

Impact:

  • Gas Inefficiency: public functions copy arguments from calldata to memory, which consumes more gas. external functions read directly from calldata.

  • Unoptimized Contracts: Failing to use the most appropriate visibility specifier can lead to slightly higher transaction costs for users interacting with the contract.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
0xbrivan2 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!