LaunchEvent's createPair calls token.decimals() twice #264
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
G (Gas Optimization)
Handle
hyh
Vulnerability details
Impact
Gas is overspent first of all on function call
Proof of Concept
wavaxReserve * 10**token.decimals()
is computed twise when the condition is true:https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol#L396-398
Recommended Mitigation Steps
Consider saving
wavaxReserve * 10**token.decimals()
to memory and reuse inside the if statementThe text was updated successfully, but these errors were encountered: