Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
hookmate — (Experimental) Solidity components and utilities for Uniswap v4 Hook development | Kitploit
Tools/GitHubGitHub/gmh5225/hookmate
General Purpose UtilitiesCryptographyUtilities & Frameworks
GitHubgmh5225/hookmate

hookmate

(Experimental) Solidity components and utilities for Uniswap v4 Hook development

View Repository
202 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

hookmate

Experimental solidity utilities, libraries, and components for Uniswap v4 Hook development


Installation

requires foundry

forge install uniswapfoundation/hookmate

Documentation

Libraries

PoolStateLibrary.sol

⚠️ Not production-ready. Will have breaking changes in the future ⚠️

until v4-core code-freezes, the interfaces are subject to changes

A solidity library to access Pool.State information -- even the nested mappings. Relies on the arbitrary storage slot reads exposed via PoolManager.extsload

Every value in mapping(PoolId id => Pool.State) public pools; is available via PoolStateLibrary:

// PoolManager.sol
mapping(PoolId id => Pool.State) public pools;

// Pool.sol
struct State {
    Slot0 slot0;                   // getSlot0()
        | uint160 sqrtPriceX96;
        | int24 tick;
        | uint16 protocolFee;
        | uint24 swapFee;
    uint256 feeGrowthGlobal0X128;  // getFeeGrowthGlobal()
    uint256 feeGrowthGlobal1X128;  // ..
    uint128 liquidity;             // getLiquidity()
    mapping(int24 => TickInfo) ticks;      // getTickInfo()
        | uint128 liquidityGross;          // getTickLiquidity()
        | int128 liquidityNet;             // ..
        | uint256 feeGrowthOutside0X128;   // getTickFeeGrowthOutside()
        | uint256 feeGrowthOutside1X128;   // ..
    mapping(int16 => uint256) tickBitmap;  // getTickBitmap()
    mapping(bytes32 => Position.Info) positions;  // getPositionInfo()
        | uint128 liquidity;                      // getPositionLiquidity()
        | uint256 feeGrowthInside0LastX128;       // getFeeGrowthInside() (calculated live)
        | uint256 feeGrowthInside1LastX128;       // ..
}

Example Usage: Get Position Fees

import {PoolStateLibrary} from "hookmate/libraries/PoolStateLibrary.sol";
import {PoolId, PoolIdLibrary} from "v4-core/src/types/PoolId.sol";

...

using PoolIdLibrary for PoolKey;

...

IPoolManager manager = address(0xABC);
address liquidityOwner = address(0x123); // likely will be PoolModifyLiquidityTest
int24 tickLower = -60;
int24 tickUpper = 60;
PoolKey memory key = PoolKey(...);

bytes32 positionId = keccak256(abi.encodePacked(address(liquidityOwner), tickLower, tickUpper));

(uint128 liquidity, uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) =
    PoolStateLibrary.getPositionInfo(manager, key.toId(), positionId);

Download Tool