DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

redondant conditions

Summary

Vulnerability Details

in the function bidMatchAlgo() at line 208 bool dustErcAmount is define such as:

bool dustErcAmount = (lowestSell.ercAmount - incomingBid.ercAmount)
.mul(lowestSell.price) == 0;

which means if

incomingBid.ercAmount == lowestSell.ercAmount

dustErcAmount will always be true

therefore in line 211 it's useless to have this OR condition

if (dustErcAmount || incomingBid.ercAmount == lowestSell.ercAmount)

Impact

just code optimization

Tools Used

reading the code

Recommendations

replace

if (dustErcAmount || incomingBid.ercAmount == lowestSell.ercAmount)

by

if (dustErcAmount )
Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Gas optimizations

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.