[Bug][Contract] LoanManager refinance_loan fails to update term_ledgers and reset interest_residual
メンテナーはふだん 3 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- backend, blockchain
調査の方向性
contracts/loan_manager/src/lib.rs の LoanManager::refinance_loan(2284~2295行付近)から始め、approve_loan(1244~1246行付近)および389行と673行の利息計上処理と比較してください。異なる期間で借り換えを行い、その後の利息計上と延滞料が発生するタイミングを確認する単体テストを追加してください。新しい期間、残額、猶予期間の動作がissueの説明と一致したら完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 22
- フォーク
- 313
- 平均マージ
- 4日 16時間
- マージ済み PR(30日)
- 92
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
LabsCrypt/remitlend のほかの issue
-
[Bug][Backend] scoreController.getScoreBreakdown uses CROSS JOIN with current_score_cte returning empty breakdown for users without a scores row対応中かも @alagbesadat208-prog が 6 日前に担当しました。 オープンbackend bug database good first issue Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
LabsCrypt/remitlend#2021 · コメント 7 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
[Bug][Backend] loanController.requestLoan compares human-readable token amount against poolBalance in stroops (10^7 unit mismatch)対応中かも @alagbesadat208-prog が 6 日前に担当しました。 オープンbackend bug good first issue Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
LabsCrypt/remitlend#2019 · コメント 7 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
[Bug][Frontend] LoanDetailsPageClient does not refetch loan or events after refinance/extension and omits locale on links対応中かも @sksneh が 4 日前に担当しました。 オープンbug frontend good first issue Stellar Wave ui
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
LabsCrypt/remitlend#2009 · コメント 9 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
[Bug][Frontend] Mobile BottomNav links to non-existent /profile route (404) and hardcodes English labels対応中かも @sksneh が 4 日前に担当しました。 オープンbug frontend good first issue Stellar Wave ui
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
LabsCrypt/remitlend#2007 · コメント 10 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
[Bug][Contract] Inconsistent default fallbacks in LoanManager get_min_term_ledgers and get_max_term_ledgers対応中かも @goodness-cpu が 4 日前に担当しました。 オープンbug contracts good first issue smart-contract Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
LabsCrypt/remitlend#2003 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
LabsCrypt/remitlend の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
grafana/profiles-drilldown#1212 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
grafana/traces-drilldown#980 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openremote/openremote#3487 · コメント 1 件 ·
-
triage:needs-human
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
garrytan/gbrain#7635 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
coollabsio/jean#867 ·
メンテナーはふだん 1 日以内に返信