code-423n4 / 2021-09-sushimiso-findings

0 stars 0 forks source link

Improper Boolean Comparison #144

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

leastwood

Vulnerability details

Impact

There are a number of instances where readAndAgreedToMarketParticipationAgreement is checked. This check can be further simplified from readAndAgreedToMarketParticipationAgreement == false to !readAndAgreedToMarketParticipationAgreement.

Proof of Concept

https://github.com/sushiswap/miso/blob/master/contracts/Auctions/DutchAuction.sol#L268 https://github.com/sushiswap/miso/blob/master/contracts/Auctions/DutchAuction.sol#L311 https://github.com/sushiswap/miso/blob/master/contracts/Auctions/HyperbolicAuction.sol#L273 https://github.com/sushiswap/miso/blob/master/contracts/Auctions/HyperbolicAuction.sol#L310 https://github.com/sushiswap/miso/blob/master/contracts/Auctions/Crowdsale.sol#L230 https://github.com/sushiswap/miso/blob/master/contracts/Auctions/Crowdsale.sol#L274 https://github.com/sushiswap/miso/blob/master/contracts/Auctions/BatchAuction.sol#L194 https://github.com/sushiswap/miso/blob/master/contracts/Auctions/BatchAuction.sol#L219

Tools Used

Slither

Recommended Mitigation Steps

Consider implementing the above changes

Clearwood commented 2 years ago

I believe this is a styling question, rather than a bug or potential optimization