Detect reentrancy in Uniswap V4 hooks via the PoolManager unlock/lock callback. V4 uses a singleton PoolManager with transient lock state; all pool mutations happen inside an unlockCallback. A hook that makes external calls during beforeSwap/afterSwap/before*Liquidity (to tokens with hooks, arbitrary routers, or user-controlled contracts) can be re-entered, and because the manager is already unlocked the attacker can recursively swap/modify liquidity against stale hook state. Activate on any V4 hook performing external calls inside a callback, or custom unlockCallback logic.
$npx -y skills add omermaksutii/rugproof --skill v4-hook-reentrancy-via-unlockInstalls into the current project.
Run `npx skills use "https://github.com/omermaksutii/rugproof" --skill "omermaksutii/rugproof/v4-hook-reentrancy-via-unlock"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/omermaksutii/rugproof" that are relevant to the current task. Run `npx skills add "https://github.com/omermaksutii/rugproof"` and select the relevant skills, then follow their instructions.