Closed code423n4 closed 2 years ago
hyh
Gas is overspent on checks
withdrawAVAX:
https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol#L361
withdraw:
https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/RocketJoeStaking.sol#L129
Can use unchecked as subtraction safety is already required in both cases
Duplicate of #233
Handle
hyh
Vulnerability details
Impact
Gas is overspent on checks
Proof of Concept
withdrawAVAX:
https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol#L361
withdraw:
https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/RocketJoeStaking.sol#L129
Recommended Mitigation Steps
Can use unchecked as subtraction safety is already required in both cases