code-423n4 / 2022-01-trader-joe-findings

2 stars 0 forks source link

Variable can be changed to immutable #256

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

saian

Vulnerability details

Impact

Variable PRECISION is set once in constructor and not updated later, it can be changed to immutable to save gas.

Proof of Concept

https://github.com/code-423n4/2022-01-trader-joe/blob/a1579f6453bc4bf9fb0db9c627beaa41135438ed/contracts/RocketJoeStaking.sol#L70

Tools Used

Manual Analysis

Recommended Mitigation Steps

Change variable to immutable

cryptofish7 commented 2 years ago

Duplicate of #239

dmvt commented 2 years ago

Per sponsor, this is invalid because the contract in question is proxied.