code-423n4 / 2023-07-moonwell-findings

1 stars 0 forks source link

Divide before multiply #341

Closed code423n4 closed 11 months ago

code423n4 commented 12 months ago

Lines of code

https://github.com/code-423n4/2023-07-moonwell/blob/fced18035107a345c31c9a9497d0da09105df4df/src/core/MultiRewardDistributor/MultiRewardDistributor.sol#L886-L892

Vulnerability details

Impact

Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.

Proof of Concept

https://github.com/crytic/slither/wiki/Detector-Documentation#divide-before-multiply

Tools Used

Recommended Mitigation Steps

Consider ordering multiplication before division.

Assessed type

Math

0xSorryNotSorry commented 11 months ago

The submission does not provide any demonstration of the issue, reasoning and code blocks.

c4-pre-sort commented 11 months ago

0xSorryNotSorry marked the issue as low quality report

c4-judge commented 11 months ago

alcueca marked the issue as unsatisfactory: Insufficient proof