public Instead of external Despite No Internal UsageSeveral functions in the OrderBook contract are marked public, even though they are never called internally. In Solidity, marking such functions as external is more gas-efficient for external callers and more accurately communicates the developer's intent.
Using public unnecessarily:
Slightly increases gas costs when called externally
Expands the ABI unnecessarily
Reduces code clarity and increases maintenance burden
This pattern was identified via Solidity Metrics.
| Function | Visibility | Internal Usage |
|---|---|---|
createSellOrder() |
public |
❌ |
amendSellOrder() |
public |
❌ |
cancelSellOrder() |
public |
❌ |
buyOrder() |
public |
❌ |
getOrder() |
public |
❌ |
getOrderDetailsString() |
public |
❌ |
Change visibility from public to external for all functions that are not called internally:
This adheres to gas optimization best practices and reduces the contract's external surface area.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.