code-423n4 / 2021-07-pooltogether-findings

0 stars 0 forks source link

Declaring functions as `external` to save gas #55

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

shw

Vulnerability details

Impact

In general, if not called by the contract itself, public functions can be declared as external to save gas.

Proof of Concept

Referenced code: MStableYieldSource.sol#L61 MStableYieldSource.sol#L69 SwappableYieldSource.sol#L67 SwappableYieldSource.sol#L98 SwappableYieldSource.sol#L219

Recommended Mitigation Steps

Change public to external in the referenced functions.

PierrickGT commented 3 years ago

SwappableYieldSource PR: https://github.com/pooltogether/swappable-yield-source/pull/12