Checking if lpProfitCut > 0
can save gas
#310
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-11-malt/blob/c3a204a2c0f7c653c6c2dda9f4563fd1dc1cecf3/src/contracts/SwingTrader.sol#L136-L141
Given that
lpProfitCut
can be0
, checking iflpProfitCut > 0
can avoid unnecessary code execution (including external calls) and save some gas.The text was updated successfully, but these errors were encountered: