# Liquidity provided when initializing a collection in Locker.sol will be stuck in Uniswap, with no way for the user to recover it

Flayer's Locker.initializeCollection deposits user liquidity into Uniswap v4 owned by the Implementation contract, with no withdrawal path, permanently locking funds.

- Payout: Audit contest
- Severity: high
- Program: Flayer
- Found by: 0x37
- Disclosed: 2024-08-06
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2024-08-flayer-judging/issues/248
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-flayer%3AH-8
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** Locker.sol / UniswapImplementation.sol (Uniswap v4 peripheral)
**Root cause:** PoolManager credits liquidity positions to msg.sender (the Implementation contract), and the Implementation only ever calls unlock()/modifyLiquidity() during initialization with liquidityDelta cast to uint, so no negative delta or withdrawal path exists for the depositor.
**Steps:**
1. Call `locker.initializeCollection(collection, 10e18, tokenIds, 1, 79228162514264337593543950336)` with 10 NFTs and 10 WETH approved.
2. Implementation calls `poolManager.unlock(...)` and in `_unlockCallback` calls `modifyLiquidity` with positive `liquidityDelta`, making the Implementation the position owner.
3. Attempt withdrawal via any peripheral (e.g. `PoolModifyLiquidityTest.modifyLiquidity` with `liquidityDelta: -100`) — reverts because caller is not the position owner.
4. Confirm no function in Locker or Implementation can call unlock() again or pass a negative delta.
**How found:** Code-reading: noticed `unlock()` is called only once in initializeCollection and `liquidityDelta` is cast to uint, then traced PoolManager.modifyLiquidity to see position ownership is assigned to msg.sender (the Implementation), revealing no withdrawal path.
**Exploitation:** Not an attack; a design flaw. Any user initializing a collection irreversibly donates their NFTs and WETH as Uniswap v4 liquidity owned by the Implementation contract.
**Insight:** When integrating Uniswap v4, check who owns the position: PoolManager credits msg.sender of modifyLiquidity, so any peripheral that deposits on behalf of users must also expose a withdrawal path with negative liquidityDelta and track the depositor.

