stake.link

stake.link
DeFiHardhatBridge
27,500 USDC
View results
Submission Details
Severity: low
Invalid

Precision Loss When Dividing Odd Integers by Two

Summary

The contract has a flaw where it may lose precision when dividing odd integers by two. This
is because in Solidity, integer division is floor division, meaning that the result of the division operation will be the largest integer less than or equal to the exact result.

Impact

when an odd integer is divided by two, the result will be rounded down, leading to a loss of precision.

Tools Used

Manual review

Recommendations

When dividing an amount by two, consider taking the first amount as the division result by
two, and the second one to be the total amount minus the first one.

Updates

Lead Judging Commences

0kage Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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