# 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
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