code-423n4 / 2021-11-fairside-findings

0 stars 0 forks source link

Several public functions can be declared as external #88

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

Reigada

Vulnerability details

Impact

There are functions marked as public but they are never directly called within the same contract or in any of its descendants, hence they can be declared as external to save some gas:

Tools Used

Slither

Recommended Mitigation Steps

Declare those functions as external to save some gas.

YunChe404 commented 2 years ago

8

pauliax commented 2 years ago

Valid suggestion, it is also a good practice to make your functions external if they are not intended to be called internally. But please note that 'external' is not always cheaper than 'public', see: https://ethereum.stackexchange.com/a/107939/17387

Making this a primary issue as it contains the most examples where this suggestion can be applied.