[Bug][Contract] LoanManager refinance_loan fails to update term_ledgers and reset interest_residual
Maintainer thường phản hồi trong vòng 5 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- backend, blockchain
Hướng nghiên cứu
Bắt đầu tại contracts/loan_manager/src/lib.rs, ở LoanManager::refinance_loan khoảng dòng 2284–2295, rồi so sánh với approve_loan khoảng dòng 1244–1246 và các luồng tính lãi ở dòng 389 và 673. Thêm một bài kiểm thử đơn vị thực hiện tái cấp vốn với kỳ hạn khác và kiểm tra việc tính lãi tiếp theo cùng thời điểm áp dụng phí trả chậm; hoàn tất khi hành vi của kỳ hạn mới, số dư còn lại và thời gian ân hạn khớp với mô tả issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Issue #122
LoanManager refinance_loan Fails to Update term_ledgers and Reset interest_residual
- Title:
[Bug][Contract] LoanManager refinance_loan fails to update term_ledgers and reset interest_residual - Labels:
bug, contracts, smart-contract, good first issue - Location:
contracts/loan_manager/src/lib.rs:2284-2295 - Description:
InLoanManager::refinance_loan, when resetting the loan state for the new term (loan.amount = new_amount; loan.due_date = current_ledger.checked_add(new_term)...;),loan.term_ledgersis never updated tonew_term,loan.interest_residualis not reset to0, andloan.last_late_fee_ledgeris set toloan.due_dateinstead ofloan.due_date + grace_period_ledgers(compare withapprove_loanat lines 1244-1246). Becauseaccrue_interest(line 389) andaccrue_late_fee(line 673) divide byloan.term_ledgers, a loan refinanced into a different term length continues accruing interest and late fees using the oldterm_ledgersdenominator. - Impact:
Refinancing a loan to a longer or shorternew_termmiscalculates all subsequent interest and late fee accruals, and starts accruing late fees before the grace period has elapsed. - Suggested Fix:
Inrefinance_loan(around line 2290), setloan.term_ledgers = new_term;,loan.interest_residual = 0;, andloan.last_late_fee_ledger = loan.due_date.checked_add(Self::grace_period_ledgers(&env)).expect("grace period overflow");. Add a unit test refinancing a loan with a differentnew_termand verifying subsequent interest accrual.
- Ngôn ngữ chính
- TypeScript
- Star
- 22
- Fork
- 313
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 78
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 LabsCrypt/remitlend
-
[Bug][Backend] scoreController.getScoreBreakdown uses CROSS JOIN with current_score_cte returning empty breakdown for users without a scores rowCó thể đã có người làm @alagbesadat208-prog đã nhận 4 ngày trước. Đang mởbackend bug database good first issue Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
LabsCrypt/remitlend#2021 · 7 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[Bug][Backend] loanController.requestLoan compares human-readable token amount against poolBalance in stroops (10^7 unit mismatch)Có thể đã có người làm @alagbesadat208-prog đã nhận 4 ngày trước. Đang mởbackend bug good first issue Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
LabsCrypt/remitlend#2019 · 7 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[Bug][Frontend] LoanDetailsPageClient does not refetch loan or events after refinance/extension and omits locale on linksCó thể đã có người làm @sksneh đã nhận 2 ngày trước. Đang mởbug frontend good first issue Stellar Wave ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
LabsCrypt/remitlend#2009 · 9 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[Bug][Frontend] Mobile BottomNav links to non-existent /profile route (404) and hardcodes English labelsCó thể đã có người làm @sksneh đã nhận 2 ngày trước. Đang mởbug frontend good first issue Stellar Wave ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
LabsCrypt/remitlend#2007 · 10 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[Bug][Contract] Inconsistent default fallbacks in LoanManager get_min_term_ledgers and get_max_term_ledgersCó thể đã có người làm @goodness-cpu đã nhận 2 ngày trước. Đang mởbug contracts good first issue smart-contract Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
LabsCrypt/remitlend#2003 · 5 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của LabsCrypt/remitlend
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
braintrustdata/braintrust-sdk-javascript#2659 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
body-parser 2.3.0 in the published ai-dial-chat-bff image is vulnerable (CVE-2026-111181, HIGH)Có thể đã có người làm @illya-havsiyevych đã nhận hôm nay. Đang mởbug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
epam/ai-dial-chat#9566 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
はさみアイコンを修正するĐang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
resource.reload() while params is in error switches the resource to 'idle' instead of retryingĐang mởarea: core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày