Utilities

This document is better viewed on the docs page.

Libraries and general purpose utilities to help develop hooks.

  • CurrencySettler: Library used to interact with the PoolManager to settle any open deltas, with support for ERC-6909 and native currencies.

Libraries

CurrencySettler

import "uniswap-hooks/src/utils/CurrencySettler.sol";

Library used to interact with the PoolManager to settle any open deltas. To settle a positive delta (a credit to the user), a user may take or mint. To settle a negative delta (a debt on the user), a user may transfer or burn to pay off a debt.

Deltas are synced before any ERC-20 transfers in settle function.

settle(Currency currency, contract IPoolManager poolManager, address payer, uint256 amount, bool burn) internal

take(Currency currency, contract IPoolManager poolManager, address recipient, uint256 amount, bool claims) internal