code-423n4 / 2021-12-yetifinance-findings

0 stars 0 forks source link

Declare state variables as immutable #162

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

p4st13r4

Vulnerability details

Impact

In WJLP.sol, state variables JLP and JOE are initialized in the constructor and never reassigned again. Thus, they can be declared immutable rather than constant in order to save gas

Proof of Concept

https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/AssetWrappers/WJLP/WJLP.sol#L41

Tools Used

Editor

kingyetifinance commented 2 years ago

@LilYeti: Again similar to #10 and #148 and #132 but different variables