BIMOHookDeployer

0xcc197d89838fb6767117cc609eb0f2ffdce76c6f

Verification
Verified
v0.8.24+commit.e11b9ed9
Type
Contract
12,424 bytes
ABI entries
5
1 read · 1 write
License
none

Contract information

Address
0xcc197d89838fb6767117cc609eb0f2ffdce76c6f
Chain
Robinhood Chain (4663)
Compiler
v0.8.24+commit.e11b9ed9
Optimization
Enabled
Creation tx
0x6c5389bca7…53dc4486c9

Token

Not a token

This contract does not expose ERC-20 metadata.

Read contract (1)

deployer()address

Events (1)

HookDeployed

ABI

[
  {
    "inputs": [],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [],
    "name": "Unauthorized",
    "type": "error"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "hook",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "bytes32",
        "name": "salt",
        "type": "bytes32"
      }
    ],
    "name": "HookDeployed",
    "type": "event"
  },
  {
    "inputs": [
      {
        "internalType": "bytes32",
        "name": "salt",
        "type": "bytes32"
      },
      {
        "internalType": "address",
        "name": "poolManager",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "stateView",
        "type": "address"
      },
      {
        "internalType": "bytes32",
        "name": "stateViewCodehash",
        "type": "bytes32"
      },
      {
        "internalType": "address",
        "name": "bimo",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "weth",
        "type": "address"
      },
      {
        "internalType": "uint160",
        "name": "initialSqrtPriceX96",
        "type": "uint160"
      }
    ],
    "name": "deploy",
    "outputs": [
      {
        "internalType": "address",
        "name": "hook",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "deployer",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  }
]

Source code

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

import {BIMOBurnHook} from "./BIMOBurnHook.sol";

/// @notice Stateless create2 helper. Deploy it first, mine a salt for its address, then deploy the Hook once.
contract BIMOHookDeployer {
    address public immutable deployer;

    error Unauthorized();

    event HookDeployed(address indexed hook, bytes32 indexed salt);

    modifier onlyDeployer() {
        if (msg.sender != deployer) revert Unauthorized();
        _;
    }

    constructor() {
        deployer = msg.sender;
    }

    function deploy(
        bytes32 salt,
        address poolManager,
        address stateView,
        bytes32 stateViewCodehash,
        address bimo,
        address weth,
        uint160 initialSqrtPriceX96
    ) external onlyDeployer returns (address hook) {
        // Solidity emits CREATE2 for a constructor invocation with `salt`.
        hook = address(
            new BIMOBurnHook{salt: salt}(
                poolManager, stateView, stateViewCodehash, bimo, weth, initialSqrtPriceX96
            )
        );
        emit HookDeployed(hook, salt);
    }
}
Chain explorer3129msChain node80ms