I am working with OpenZeppelin's new Uniswap Hooks Library to experiment with hooks in V4. I am trying to reconcile a comment in the code with the reality that I am experiencing. In short, I am experimenting with creating custom TBC curves using hooks. The comment in question:
This is fine, makes sense, and I am able to override _getAmountIn
(which is called inside of addLiquidity
) to add liquidity to the curve. Swaps occur as expected.
However, when I call balanceOf
for one of the tokens on the hook contract's address, I get an answer of 0. When I call balanceOf
on the PoolManager
, I get a positive value that comports with the single-sided liquidity adding activity that has occurred. This is confirmed by looking at the traces of a swap:
The to
field in the Transfer
event is the address 0xE03A1074c86CFeDd5C142C4F04F1a1536e203543
which is the PoolManager in Sepolia.
What am I missing here? Is liquidity not actually stored in the hook?