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

0 stars 0 forks source link

Declare functions as `external` to save gas #107

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

shw

Vulnerability details

Impact

Functions (e.g., supplyTokenTo, redeemToken) in the BadgerYieldSource and SushiYieldSource can be declared external instead of public to save gas.

Proof of Concept

Referenced code: BadgerYieldSource.sol#L26 BadgerYieldSource.sol#L32 BadgerYieldSource.sol#L43 BadgerYieldSource.sol#L57 SushiYieldSource.sol#L29 SushiYieldSource.sol#L35 SushiYieldSource.sol#L47 SushiYieldSource.sol#L66

Recommended Mitigation Steps

Change the keyword public to external.

kamescg commented 3 years ago

Badger

Sushi