2/5
# Reader Exercise In this exercise, you'll learn how to read transient storage from the [`PoolManager`](https://github.com/Uniswap/v4-core/blob/main/src/PoolManager.sol) contract. The starter code for this exercise is provided in [`foundry/src/exercises/Reader.sol`](https://github.com/Cyfrin/defi-uniswap-v4/blob/main/foundry/src/exercises/Reader.sol) Solution is in [`foundry/src/solutions/Reader.sol`](https://github.com/Cyfrin/defi-uniswap-v4/blob/main/foundry/src/solutions/Reader.sol) ## Task 1 - Get currency delta ```solidity function getCurrencyDelta(address target, address currency) public view returns (int256 delta) { // Write your code here } ``` Get the currency delta identified by `target` and `currency`. The test will take tokens from the `PoolManager` contract to check the currency delta store in the `PoolManager` with the value returned from your code. ## Test ```shell forge test --fork-url $FORK_URL --match-path test/Reader.test.sol -vvv ```
In this exercise, you'll learn how to read transient storage from the PoolManager
contract.
The starter code for this exercise is provided in foundry/src/exercises/Reader.sol
Solution is in foundry/src/solutions/Reader.sol
Get the currency delta identified by target
and currency
.
The test will take tokens from the PoolManager
contract to check the currency delta store in the PoolManager
with the value returned from your code.
A practical exercise to Reader Exercise - Learn how to read from Uniswap v4's transient storage by implementing a function to get the currency delta from the PoolManager contract.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Difference between Uniswap v3 and v4
Uniswap v4 PoolManager
Uniswap v4 Hooks
Uniswap v4 Singleton architecture
Uniswap v4 flash accounting
Uniswap v4 operations
Uniswap v4 lifecycle
How to build a Uniswap v4 swap router
Last updated on September 22, 2025
Duration: 5min
Duration: 7min
Duration: 39min
Duration: 35min
Course Overview
About the course
Difference between Uniswap v3 and v4
Uniswap v4 PoolManager
Uniswap v4 Hooks
Uniswap v4 Singleton architecture
Uniswap v4 flash accounting
Uniswap v4 operations
Uniswap v4 lifecycle
How to build a Uniswap v4 swap router
Last updated on September 22, 2025