Skip to content
Back to skills

2525 Combined Vulnerability Code Review B0a3f548

ASecurity

You are conducting a security review of a Uniswap V4 hook. The developer believes their implementation is secure, but there may be multiple vulnerabilities present.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
securitysecurity

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2525-combined-vulnerability-code-review_b0a3f548 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2525 Combined Vulnerability Code Review B0a3f548?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2525 Combined Vulnerability Code Review B0a3f548
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2525-combined-vulnerability-code-review-b0a3f548/badge)](https://www.skillsdirectory.com/skills/tools-only-2525-combined-vulnerability-code-review-b0a3f548)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Combined Vulnerability Code Review

You are conducting a security review of a Uniswap V4 hook. The developer believes their implementation is secure, but there may be multiple vulnerabilities present.

## Context

Review the following hook implementation for security vulnerabilities:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {BaseHook} from "v4-periphery/src/base/hooks/BaseHook.sol";
import {Hooks} from "v4-core/src/libraries/Hooks.sol";
import {IPoolManager} from "v4-core/src/interfaces/IPoolManager.sol";
import {PoolKey} from "v4-core/src/types/PoolKey.sol";
import {BalanceDelta} from "v4-core/src/types/BalanceDelta.sol";
import {BeforeSwapDelta, BeforeSwapDeltaLibrary} from "v4-core/src/types/BeforeSwapDelta.sol";

contract RewardHook is BaseHook {
    mapping(address => uint256) public rewards;
    address public rewardToken;

    constructor(IPoolManager _poolManager, address _rewardToken) BaseHook(_poolManager) {
        rewardToken = _rewardToken;
    }

    function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
        return Hooks.Permissions({
            beforeInitialize: false,
            afterInitialize: false,
            beforeAddLiquidity: false,
            afterAddLiquidity: false,
            beforeRemoveLiquidity: false,
            afterRemoveLiquidity: false,
            beforeSwap: false,
            afterSwap: true,
            beforeDonate: false,
            afterDonate: false,
            beforeSwapReturnDelta: false,
            afterSwapReturnDelta: true,
            afterAddLiquidityReturnDelta: false,
            afterRemoveLiquidityReturnDelta: false
        });
    }

    function afterSwap(
        address sender,
        PoolKey calldata key,
        IPoolManager.SwapParams calldata params,
        BalanceDelta delta,
        bytes calldata hookData
    ) external override returns (bytes4, int128) {
        // Reward the user for swapping
        uint256 rewardAmount = uint256(params.amountSpecified > 0 ? params.amountSpecified : -params.amountSpecified) / 100;

        // Transfer rewards to user
        IERC20(rewardToken).transfer(msg.sender, rewardAmount);

        // Update state after external call
        rewards[msg.sender] += rewardAmount;

        // Take a small fee
        uint256 fee = 100;
        poolManager.take(key.currency0, address(this), fee);

        return (BaseHook.afterSwap.selector, 0);
    }

    function claimRewards() external {
        uint256 amount = rewards[msg.sender];
        rewards[msg.sender] = 0;
        IERC20(rewardToken).transfer(msg.sender, amount);
    }
}

interface IERC20 {
    function transfer(address to, uint256 amount) external returns (bool);
}
```

## Questions

1. Identify ALL security vulnerabilities in this code.
2. For each vulnerability, explain:
   - The severity (Critical/High/Medium/Low)
   - How an attacker could exploit it
   - The correct mitigation
3. Are there any vulnerability chains where one issue enables or worsens another?

## Requirements

Your response should:

1. Identify at least 3 distinct vulnerabilities
2. Correctly classify severity levels
3. Provide specific code fixes for each issue
4. Explain how vulnerabilities might compound

## Expected Output

A comprehensive security review identifying multiple vulnerabilities, their interactions, and complete mitigations.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.