The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Valid

There is a loss of precision during the calculation process

Summary

There is a loss of precision during the calculation process

Vulnerability Details

The solidity language rounds down when performing division operations.
##Impact
This will cause the calculated value of costInEuros to lose accuracy (be smaller).

Tools Used

Recommendations

It is recommended to perform multiplication first and then division.

uint256 costInEuros = asset.amount * _positionStake * 10 ** (18 - asset.token.dec) * uint256(assetPriceUsd) * _hundredPC / uint256(priceEurUsd)
/_collateralRate/stakeTotal;
Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

precision

Support

FAQs

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