Mimo DeFi contest - peritoflores's results

Bridging the chasm between the DeFi world and the world of regulated financial institutions.

General Information

Platform: Code4rena

Start Date: 28/04/2022

Pot Size: $50,000 USDC

Total HM: 7

Participants: 43

Period: 5 days

Judge: gzeon

Total Solo HM: 2

Id: 115

League: ETH

Mimo DeFi

Findings Distribution

Researcher Performance

Rank: 28/43

Findings: 1

Award: $104.94

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

104.9405 USDC - $104.94

Labels

bug
QA (Quality Assurance)

External Links

QA for MIMO Defi Apr-2022 by PeritoFlores

[L-01] Series of div

In the function convertTo#PriceFeed.sol (and other) there is a serie of 2 sequential divs. This is not a good idea because you are losing precision. When possible it is better to calculate the numerator, then the denominator and finally divide. In addition division is more gas expensive.

return _amount.mul(collateralAccuracy).div(price).div(parAccuracy);

Lines affected

https://github.com/code-423n4/2022-04-mimo/blob/b18670f44d595483df2c0f76d1c57a7bfbfbc083/core/contracts/core/PriceFeed.sol#L106

https://github.com/code-423n4/2022-04-mimo/blob/b18670f44d595483df2c0f76d1c57a7bfbfbc083/core/contracts/inception/priceFeed/ChainlinkInceptionPriceFeed.sol#L66

Similar issues

https://github.com/code-423n4/2021-07-sherlock-findings/issues/24

Use this formula instead

return _amount.mul(collateralAccuracy).div(price.mul(parAccuracy));

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter