Closed code423n4 closed 2 years ago
Immutable variables cannot be read during contract creation time. Making the suggested variables immutable would lead to https://github.com/code-423n4/2022-01-yield/blob/e946f40239b33812e54fafc700eb2298df1a2579/contracts/ConvexStakingWrapper.sol#L77-L78 to fail.
dup of #124
Handle
TomFrenchBlockchain
Vulnerability details
Impact
Gas savings
Proof of Concept
We have a number of variables in ConvexStakingWrapper which appear to only be set on construction and never again.
https://github.com/code-423n4/2022-01-yield/blob/e946f40239b33812e54fafc700eb2298df1a2579/contracts/ConvexStakingWrapper.sol#L41-L45
We can then make use of the
immutable
keyword to save on gas.Recommended Mitigation Steps
Make use of immutable keyword for variables which are only set on construction