Skip to content

feat(credit): implement repay_credit token flow + events#170

Open
rocknwa wants to merge 4 commits intoCreditra:mainfrom
rocknwa:feature/repay-credit-tokens
Open

feat(credit): implement repay_credit token flow + events#170
rocknwa wants to merge 4 commits intoCreditra:mainfrom
rocknwa:feature/repay-credit-tokens

Conversation

@rocknwa
Copy link
Contributor

@rocknwa rocknwa commented Mar 25, 2026

Closes #109

Changes

  • Implemented repay_credit with full transfer_from token flow when liquidity token is configured
  • Repayment allowed on Active / Suspended / Defaulted (only Closed is rejected)
  • Over-repayment safely capped at utilized_amount (never pulls excess tokens)
  • Reentrancy guard + allowance/balance checks before any state mutation
  • Emits correct RepaymentEvent (uses effective amount, not nominal)
  • Added comprehensive smoke tests for all major functions + remaining error paths

@drips-wave
Copy link

drips-wave bot commented Mar 25, 2026

@rocknwa Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

repay_credit transfer_from and utilization accounting

1 participant