Closed code423n4 closed 2 years ago
haku
Replacing condition == false for !condition can saves gas.
https://github.com/code-423n4/2022-01-sherlock/blob/c763f10c4b5fe2127677d6c25b83adcf3bcec212/contracts/SherBuy.sol#L89 https://github.com/code-423n4/2022-01-sherlock/blob/c763f10c4b5fe2127677d6c25b83adcf3bcec212/contracts/SherBuy.sol#L126
VS Code
condition == false for !condition
Dup #132
Handle
haku
Vulnerability details
Impact
Replacing condition == false for !condition can saves gas.
Proof of Concept
https://github.com/code-423n4/2022-01-sherlock/blob/c763f10c4b5fe2127677d6c25b83adcf3bcec212/contracts/SherBuy.sol#L89 https://github.com/code-423n4/2022-01-sherlock/blob/c763f10c4b5fe2127677d6c25b83adcf3bcec212/contracts/SherBuy.sol#L126
Tools Used
VS Code
Recommended Mitigation Steps
condition == false for !condition