Function can external instead of public to save gas #37
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
G (Gas Optimization)
Handle
cyberboy
Vulnerability details
Impact
public functions that are never called by the contract should be declared external to save gas. This affects all the Governed contract functions. They have been marked as public but they can be external.
Proof of Concept
https://github.com/code-423n4/2021-11-streaming/blob/main/Streaming/src/Locke.sol#L22-L24
https://github.com/code-423n4/2021-11-streaming/blob/main/Streaming/src/Locke.sol#L27-L31
https://github.com/code-423n4/2021-11-streaming/blob/main/Streaming/src/Locke.sol#L34-L39
https://github.com/code-423n4/2021-11-streaming/blob/main/Streaming/src/Locke.sol#L41-L43
https://github.com/code-423n4/2021-11-streaming/blob/main/Streaming/src/Locke.sol#L46-L50
Tools Used
Slither
Recommended Mitigation Steps
Mark the following function external instead of the public to save gas.
governorship()
setPendingGov()
acceptGov()
setEmergencyGov()
__abdicate()
The text was updated successfully, but these errors were encountered: