Open code423n4 opened 2 years ago
0x0x0x
Negation(!) is a better optimized implementation of applying == false. It requires less gas and also the recommended approach to compute the negation.
== false
In other words: x == false and !x compute the same result, but !x costs less gas.
x == false
!x
./Auction.sol:37: require(auctionOngoing == false, 'ongoing auction'); ./Basket.sol:92: require(auction.auctionOngoing() == false); ./Basket.sol:109: require(auction.auctionOngoing() == false); ./Basket.sol:221: if (auction.auctionOngoing() == false) { ./Basket.sol:259: require(auction.auctionOngoing() == false);
Handle
0x0x0x
Vulnerability details
Concept
Negation(!) is a better optimized implementation of applying
== false
. It requires less gas and also the recommended approach to compute the negation.In other words:
x == false
and!x
compute the same result, but!x
costs less gas.Scope