# Reposition Exercises In this exercise, you will write a simple contract to reposition liquidity. The starter code for this exercise is provided in [`foundry/src/exercises/Reposition.sol`](https://github.com/Cyfrin/defi-uniswap-v4/blob/main/foundry/src/exercises/Reposition.sol) Solution is in [`foundry/src/solutions/Reposition.sol`](https://github.com/Cyfrin/defi-uniswap-v4/blob/main/foundry/src/solutions/Reposition.sol) ## Task 1 - Reposition ```solidity function reposition(uint256 tokenId, int24 tickLower, int24 tickUpper) external returns (uint256 newTokenId) {} ``` This function repositions the liquidity of `tokenId` to the specified `tickLower` and `tickUpper` boundaries. ## Test ```shell forge test --fork-url $FORK_URL --match-path test/Reposition.test.sol -vvv ```
In this exercise, you will write a simple contract to reposition liquidity.
The starter code for this exercise is provided in foundry/src/exercises/Reposition.sol
Solution is in foundry/src/solutions/Reposition.sol
This function repositions the liquidity of tokenId to the specified tickLower and tickUpper boundaries.
Previous lesson
Previous
Next lesson
Next
Course Overview
About the course
Difference between Uniswap v3 and v4
Uniswap v4 PoolManager
Uniswap v4 Hooks
Uniswap v4 PositionManager
Uniswap v4 Universal Router
Uniswap v4 Singleton architecture and flash accounting
Uniswap v4 operations and lifecycle
Uniswap v4 multihopping and quoting
How to build a Uniswap v4 swap router
How to build a smart contract a liquidation bot executes
Last updated on November 6, 2025
Duration: 5min
Duration: 7min
Duration: 39min
Duration: 35min
Duration: 34min
Duration: 31min
Course Overview
About the course
Difference between Uniswap v3 and v4
Uniswap v4 PoolManager
Uniswap v4 Hooks
Uniswap v4 PositionManager
Uniswap v4 Universal Router
Uniswap v4 Singleton architecture and flash accounting
Uniswap v4 operations and lifecycle
Uniswap v4 multihopping and quoting
How to build a Uniswap v4 swap router
How to build a smart contract a liquidation bot executes
Last updated on November 6, 2025