# Users can fail to closePositionFarm and lose their funds

CurveSpell.closePositionFarm reverts when Curve pool is_killed is true, blocking debt repayment and exposing users to liquidation.

- Payout: Contest reward
- Severity: medium
- Program: Blueberry
- Credited: Bauer
- Disclosed: 2023-04-07
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-04-blueberry-judging/issues/64
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-04-blueberry%3AM-4
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:dos vuln:liquidation

**Target:** CurveSpell.closePositionFarm / Curve pool remove_liquidity_one_coin
**Root cause:** closePositionFarm unconditionally calls Curve's remove_liquidity_one_coin, which asserts not self.is_killed; when the pool is killed the whole unwind path reverts, so debt cannot be repaid.
**Steps:**
1. User has a farming position via CurveSpell staking LP tokens in a Curve pool.
2. Curve pool admin sets is_killed = true on the pool.
3. User calls `CurveSpell.closePositionFarm()` to unwind and repay debt.
4. `ICurvePool(pool).remove_liquidity_one_coin(amountPosRemove, tokenIndex, 0)` reverts on `assert not self.is_killed`.
5. Repayment path never reached; position remains open and becomes liquidatable.
**How found:** Code review of CurveSpell.closePositionFarm's dependency on Curve's remove_liquidity_one_coin, cross-referencing Curve pool source to note the is_killed assert.
**Exploitation:** Not an attacker-driven exploit; a griefing/availability condition where a killed Curve pool blocks the only unwind path, leaving the user unable to repay before liquidation.
**Insight:** When integrating external pools, check admin-controlled kill switches/pause flags in the callee; any unwind/repay path that hard-depends on a pausable external call becomes a liquidation DoS for users.
