code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

Public function that could be declared external #246

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

a_delamo

Vulnerability details

Impact

In all the contracts we find most of the methods defined as public instead of external. Most of these methods are not being called from inside the contract, so could be defined as external and save some gas cost when being called.

Proof of Concept

https://github.com/crytic/slither/wiki/Detector-Documentation#public-function-that-could-be-declared-external

https://ethereum.stackexchange.com/questions/19380/external-vs-public-best-practices?answertab=active#tab-top

Tools Used

Slither

Recommended Mitigation Steps

Just use external when possible in order to reduce the gas cost

0xBrian commented 3 years ago

Probably addressed in mega external patch, https://github.com/vetherasset/vaderprotocol-contracts/commit/d946b6262ac83cdb7722baa3a8684c4ceabf4ea3

dmvt commented 3 years ago

duplicate of #14