# after shut, no pulled redistribution yang will be locked

After Shrine shutdown, redistributed yang not yet pulled into a trove cannot be released by caretaker.release(), locking that collateral in the contract.

- Payout: Contest reward
- Severity: medium
- Program: Opus
- Credited: bin2chen
- Disclosed: 2024-03-08
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-01-opus-findings/issues/202
- Library page: https://bugbountylibrary.com/r/c4%3A2024-01-opus%3AM-02
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:business-logic

**Target:** Caretaker/Shrine collateral release logic (Cairo/Starknet)
**Root cause:** caretaker.release() only iterates yangs already recorded via shrine.get_deposit(); once Shrine is not live, pull_redistributed_debt_and_yangs() can no longer be called, so pending redistributed yang never gets credited to the trove and is skipped during release.
**Steps:**
1. Trigger an exceptional redistribution so a trove has redistributed yang not yet pulled.
2. Call shrine.shut() making get_live() false.
3. Call caretaker.release(trove_id): loop reads shrine.get_deposit(yang, trove_id) which excludes unpulled redistributed yang.
4. Those yang amounts are never seized/transferred and remain locked in the contract.
**How found:** Code reading of caretaker.release() loop: noticed it only releases yangs present in shrine.get_deposit(), and that pull_redistributed_debt_and_yangs() is gated on Shrine being live, so shutdown strands unpulled redistributions.
**Insight:** When auditing shutdown/graceful-exit paths, check that every lazy-accrual mechanism (redistribution, rewards, pending debt) can still be flushed after the system is frozen; release loops that read only settled state will silently skip unflushed balances.
