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

2 stars 0 forks source link

Gas Optimisation - Simplify `_atPhase()` Logic #162

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

kirk-baird

Vulnerability details

Impact

The logic in _atPhase()` can be simplified to save gas and code complexity.

The code can be simplified to the follwoing.

    function _atPhase(Phase _phase) internal view {
            require(currentPhase() == _phase, "LaunchEvent: incorrect phase");
    }

Proof of Concept

n/a

Tools Used

n/a

Recommended Mitigation Steps

Consider updating the code to that procided above.

cryptofish7 commented 2 years ago

Fixed https://github.com/traderjoe-xyz/rocket-joe/pull/152/