code-423n4 / 2021-11-yaxis-findings

0 stars 0 forks source link

State variables can be `immutable`s #83

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

pants

Vulnerability details

Vulnerability details

These state variables can be immutables since they are only set once, at the constructor:

Impact

Reading from immutable state variables is much cheaper than from regular state variables.

Proof of Concept

https://blog.soliditylang.org/2020/05/13/immutable-keyword/

Tool Used

Manual code review.

Recommended Mitigation Steps

Define these state variables as immutables.

0xleastwood commented 2 years ago

Marking this as a valid issue. MetaVault.sol may or may not be used as the chosen vault within the YaxisVaultAdapter.sol contract which is an in-scope contract.