[BUG] Precision Loss from Floating Point Math
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- blockchain, javascript
- Lĩnh vực
- fintech-quant, payments
Hướng nghiên cứu
Start with src/helpers.js and inspect calculateBcUsdEquivalent, especially the conversion from large amounts to USD. Reproduce the reported precision loss with a very large amount, such as the 10^18 wei equivalent, and compare the result with the expected precision. Done means currency calculations retain precision until display; an open linked pull request already addresses this issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[y] I have checked for duplicate issues
Description:
Conversion functions for USD equivalents use native JS parseFloat and multipliers like 1e6. This causes rounding errors for large currency amounts.
How to Reproduce:
Call calculateBcUsdEquivalent with a very large amountFloat (e.g., 10^18 wei equivalent).
Actual Behaviour:
Resulting values lose precision after the 15th significant digit, which is unacceptable for financial software.
Expected Behaviour:
All currency calculations must stay within BigInt or a dedicated library like bignumber.js until the final display stage.
Location: StablePay/djed-sdk/src/helpers.js
[y] I want to work on this issue
- Ngôn ngữ chính
- JavaScript
- Star
- 16
- Fork
- 29
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của StabilityNexus/StablePay
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
StabilityNexus/StablePay#64 · 1 bình luận ·
-
[BUG]: Missing SDK API documentation and incomplete developer-facing usage guide in StablePay READMEĐang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
StabilityNexus/StablePay#104 · 1 bình luận ·
-
[BUG]: `stablepay-sdk` README documents an unrelated thirdweb app instead of the actual SDK APIĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
StabilityNexus/StablePay#102 ·
-
[FEATURE]: Centralize transaction initialization and quote fetching to avoid duplicate RPC calls in the widgetCó thể làm lại được @CaptainLevi2k04 đã nhận 81 ngày trước và không có pull request nào đang mở. Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
StabilityNexus/StablePay#101 · 1 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
StabilityNexus/StablePay#96 · 1 bình luận ·
Tất cả issue của StabilityNexus/StablePay
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 82/100
Leonxlnx/taste-skill#216 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docs: 11 broken linksĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
all-contributors/cli#690 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày