code-423n4 / 2022-01-yield-findings

1 stars 0 forks source link

Immutable variables #84

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

defsec

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.

Proof of Concept

  1. For instance : https://github.com/code-423n4/2022-01-yield/blob/e946f40239b33812e54fafc700eb2298df1a2579/contracts/ConvexStakingWrapper.sol#L42

Tools Used

Code Review

Recommended Mitigation Steps

Mark variables as immutable.

devtooligan commented 2 years ago

dup of #42