20,000 USDC
View results
Submission Details
Severity: low

Multiple before Divided :Staking.sol

Summary

Calculate Reward with update and updateFor when the calculate the reward their is no bracket to define the operations order and solidity is not good in math operations parentheses that are used to enclose a set of terms.

Vulnerability Details

When we calculate share or ration it values result will be different if we divided and then multiple so better way is to put bracket to make it correct and save from math error.

Impact

It will provide wrong share which maybe more or less then actual values which cause lose in terms of money.

Tools Used

Foundry and Remix.

Recommendations

Assign Bracket as, I put is provide code examples.

Support

FAQs

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