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

2 stars 0 forks source link

using += to save gas #265

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

rfa

Vulnerability details

Impact

expensive gas

Proof of Concept

https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/RocketJoeStaking.sol#L169-L172

Tools Used

Recommended Mitigation Steps

            accRJoePerShare  +=
            (rJoeReward * PRECISION) /
            joeSupply;
cryptofish7 commented 2 years ago

Fix: https://github.com/traderjoe-xyz/rocket-joe/pull/136