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

1 stars 0 forks source link

Use `external` keyword instead of `public` for some functions #25

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

xYrYuYx

Vulnerability details

Impact

https://github.com/code-423n4/2021-11-overlay/blob/main/contracts/OverlayV1UniswapV3Market.sol#L90 https://github.com/code-423n4/2021-11-overlay/blob/main/contracts/collateral/OverlayV1OVLCollateral.sol#L139 https://github.com/code-423n4/2021-11-overlay/blob/main/contracts/market/OverlayV1Governance.sol#L54 https://github.com/code-423n4/2021-11-overlay/blob/main/contracts/market/OverlayV1Governance.sol#L60 https://github.com/code-423n4/2021-11-overlay/blob/main/contracts/market/OverlayV1Market.sol#L171

external functions use less gas than public functions.

Tools Used

Manual

Recommended Mitigation Steps

Use external keyword instead of public keyword of functions which are not used internally.

mikeyrf commented 2 years ago

duplicate #6 - public to external

dmvt commented 2 years ago

6 explanation by sponsor does not hold here. The first function uses variables in memory. Not a duplicate.

mesozoic-technology commented 2 years ago

By a variable in memory I mean a parameter.

It could reduce the cost by having a parameter located in calldata instead of memory.

We don’t have any functions that do that.

On Tue, Dec 21, 2021 at 9:14 AM Dan Matthews @.***> wrote:

6 https://github.com/code-423n4/2021-11-overlay-findings/issues/6

explanation by sponsor does not hold here. The first function uses variables in memory. Not a duplicate.

— Reply to this email directly, view it on GitHub https://github.com/code-423n4/2021-11-overlay-findings/issues/25#issuecomment-998813441, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADG5UGLRS2B3T2CIYIALYULUSCDWFANCNFSM5IMFPNMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>