The JavaScript server responsible for processing and storing accumulated points for the Steaking contract may face precision issues due to the limitations of the JavaScript Number
type when handling large ETH amounts. This issue can affect the accuracy of point calculations.
The server code uses the JavaScript Number
type for handling ETH amounts and performing arithmetic operations. The Number
type has limitations in accurately representing very large integers, which can lead to precision errors in calculations, especially when dealing with large ETH values.
Precision errors can lead to inaccuracies in point calculations, potentially causing financial discrepancies and incorrect point totals for users. This may impact user trust and the overall reliability of the staking system.
To mitigate precision issues, use the BigInt type for handling large numbers in JavaScript. Update the code to perform calculations using BigInt to ensure accurate arithmetic operations with large ETH values. Since MongoDB doesn't support BigInt, store the result as a string to preserve precision. Storing as a string ensures that large numbers are not truncated or rounded, and they can be accurately converted back to BigInt when needed.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.