Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Why this matters
In lending_pool/src/lib.rs, redeem_shares calls calc_assets_to_redeem(shares, total_assets, cur_total_shares) which does shares.checked_mul(total_assets).and_then(checked_div(cur_total_shares)).expect("share redeem overflow"). If cur_total_shares is inconsistent with a holding, or total_assets is 0 after loans drain the pool, redemption either panics with a non-typed expect or returns 0 and reverts with InvalidAmount, trapping funds. The provider-share vs total-share invariant is never asserted.
Acceptance criteria
Files to touch
Out of scope
- Changing the loan disbursement source
- Yield distribution redesign
Why this matters
In lending_pool/src/lib.rs, redeem_shares calls calc_assets_to_redeem(shares, total_assets, cur_total_shares) which does shares.checked_mul(total_assets).and_then(checked_div(cur_total_shares)).expect("share redeem overflow"). If cur_total_shares is inconsistent with a holding, or total_assets is 0 after loans drain the pool, redemption either panics with a non-typed expect or returns 0 and reverts with InvalidAmount, trapping funds. The provider-share vs total-share invariant is never asserted.
Acceptance criteria
Files to touch
Out of scope