Closed code423n4 closed 2 years ago
I don't understand how the internal function would save gas here
You'd be calling an internal function, which then performs an external call, you're still paying for the external calls gas, it's no like the free function
would make those costs free
In lack of evidence I'm setting this as invalid, would love to see a POC and am happy to change my mind
marking invalid as per findings sheet
Handle
WatchPug
Vulnerability details
Functions can be defined outside of a contract, also called “free functions”, always have implicit internal visibility.
Every call to an external contract costs a decent amount of gas. For optimization of gas usage, use free functions to replace external calls can save gas.
For example:
Basket.sol#validateWeights()
can be defined as a free function, so thatFactory.sol#proposeBasketLicense()
can save an external call.https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Factory.sol#L72