This document tracks the implementation status of issues #257, #256, #258, and #261.
Completed:
- Added
RateConfigstruct to verification registry types - Implemented
set_rate_config()admin function in registry - Implemented
get_rate_config()getter function - Implemented
get_borrower_rate()to resolve rates dynamically
Remaining Work:
- Update
resolve_borrower_interest_rate()in lending-pool contract to callregistry.get_borrower_rate() - Add unit tests verifying rate changes affect new loans but not existing ones
- Update lending-pool types to export new client methods
Files Modified:
contracts/verification-registry/src/types.rs- Added Rate Config structcontracts/verification-registry/src/lib.rs- Added rate management functions
Files to Modify:
contracts/lending-pool/src/lib.rs- Update resolve function to use registry ratescontracts/lending-pool/src/test.rs- Add dynamic rate tests
Required Implementation:
- Add
clawback_defaulter_balance(borrower: Address)to lending pool - Call escrow contract to transfer locked funds back to pool
- Distribute recovered funds across tranches based on loss waterfall
- Add admin-only authorization check
- Update tranche balances in instance storage
- Write comprehensive tests for partial/full recovery scenarios
Files to Create/Modify:
contracts/lending-pool/src/lib.rs- Add clawback functioncontracts/lending-pool/src/types.rs- May need ClawbackRecord typecontracts/escrow/src/lib.rs- May need admin transfer functioncontracts/lending-pool/src/test.rs- Clawback scenario tests
Required Implementation:
- Refactor token client initialization to accept dynamic SAC addresses
- Add
token_addressfield to PoolConfig - Store asset-specific metadata (USDC vs EURC)
- Update all token operations to use configured token
- Add integration tests for both USDC and EURC flows
Complexity Note: This may require separate pool instances per currency or a multi-token vault system. Design decision needed on architecture.
Files to Modify:
contracts/lending-pool/src/lib.rs- Parameterize token clientcontracts/lending-pool/src/types.rs- Add token configcontracts/escrow/src/lib.rs- Same token parameterization- Integration tests for both currencies
Implementation: See backend implementation below.
Since the Soroban contract changes (#256, #258) require significant Rust development and testing infrastructure, I've prioritized the backend database backup feature which is immediately deployable.