Skip to content
Verified contractExactMIT

PoolInit

Address0x4e0031b842d350353f2fb252e6329fe78315fe69
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.30

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.30+commit.73712a01
Language
solidity
Optimization
Yes, 200 runs
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,131,977
Creation transaction
0x617e623d50…93417cb4fc

gpu-nodes/contracts/PoolInit.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;

interface IPoolManager {
    struct PoolKey {
        address currency0;
        address currency1;
        uint24  fee;
        int24   tickSpacing;
        address hooks;
    }
    function initialize(PoolKey memory key, uint160 sqrtPriceX96) external returns (int24 tick);
}

contract PoolInit {
    address public constant POOL_MANAGER = 0x000000000004444c5dc75cB358380D2e3dE08A90;
    address public constant NATIVE       = address(0);
    uint24  public constant DYNAMIC_FEE  = 0x800000;
    int24   public constant TICK_SPACING = 60;

    event PoolOpened(int24 tick, address indexed token, address indexed hook);

    function openPool(address token, address hook, uint160 sqrtPriceX96)
        external returns (int24 tick)
    {
        require(token != address(0) && hook != address(0), "zero addr");
        IPoolManager.PoolKey memory key = IPoolManager.PoolKey({
            currency0:   NATIVE,
            currency1:   token,
            fee:         DYNAMIC_FEE,
            tickSpacing: TICK_SPACING,
            hooks:       hook
        });
        tick = IPoolManager(POOL_MANAGER).initialize(key, sqrtPriceX96);
        emit PoolOpened(tick, token, hook);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.