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

0 stars 0 forks source link

Immutable variables #47

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

pauliax

Vulnerability details

Impact

'immutable' greatly reduces gas costs. There are variables that do not change so they can be marked as immutable to greatly improve the gas costs. Examples of such variables are: yieldSource in YieldSourcePrizePool. prizePool in PrizeSplitStrategy. controller in ControlledToken.

Recommended Mitigation Steps

Consider applying immutable keyword to the variables that are assigned only once.

asselstine commented 3 years ago

https://github.com/pooltogether/v4-core/pull/237

GalloDaSballo commented 3 years ago

Sponsor has implemented by using immutable