Public functions that are never called by a contract should be declared external in order to conserve gas.
Impact
Smart Contracts are required to have effective Gas usage as they cost real money and each function should be monitored for the amount of gas it costs to make it gas efficient.
Public functions cost more Gas than external functions
PoC
The function l1CirculatingSupply is marked as public but not used anywhere.
Handle
SolidityScan
Vulnerability details
Description
Public
functions that are never called by a contract should be declaredexternal
in order to conserve gas.Impact
Smart Contracts are required to have effective Gas usage as they cost real money and each function should be monitored for the amount of gas it costs to make it gas efficient.
Public
functions cost more Gas thanexternal
functionsPoC
The function
l1CirculatingSupply
is marked as public but not used anywhere.https://github.com/livepeer/arbitrum-lpt-bridge/blob/ebf68d11879c2798c5ec0735411b08d0bea4f287/contracts/L2/gateway/L2LPTDataCache.sol#L88-L95
The following function should be declared as
external
to save gasRecommended Mitigation Steps
Use the
external
state visibility for functions that are never called from the contract.