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

2 stars 0 forks source link

Cache phase3Start #292

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

pauliax

Vulnerability details

Impact

phase3Start will not change once auctionStart is initialized, so I think it would make sense to calculate it once and store the value instead of re-calculating it every time:

    modifier timelockElapsed() {
        uint256 phase3Start = auctionStart +
            PHASE_ONE_DURATION +
            PHASE_TWO_DURATION;
cryptofish7 commented 2 years ago

Duplicate of #59