PumpV4HookDeployer
0xfbe376d50e82389cc9649eed6c2ec9ca6cf23fd6
Verification
Verified
v0.8.26+commit.8a97fa7a
Type
Contract
8,390 bytes
ABI entries
3
1 read · 1 write
License
none
Contract information
- Address
- 0xfbe376d50e82389cc9649eed6c2ec9ca6cf23fd6
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.26+commit.8a97fa7a
- Optimization
- Enabled
- Creator
- 0x981DA90234…44b386e587
- Creation tx
- 0x83a96abec3…bf79daac8a
Token
Not a token
This contract does not expose ERC-20 metadata.
Read contract (1)
computeAddress(bytes32, address, address, address, address) → address
Events (1)
HookDeployed
ABI
[
{
"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": "contract IPoolManager",
"name": "poolManager",
"type": "address"
},
{
"internalType": "address",
"name": "factory",
"type": "address"
},
{
"internalType": "address",
"name": "positionManager",
"type": "address"
},
{
"internalType": "address",
"name": "weth",
"type": "address"
}
],
"name": "computeAddress",
"outputs": [
{
"internalType": "address",
"name": "predicted",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
},
{
"internalType": "contract IPoolManager",
"name": "poolManager",
"type": "address"
},
{
"internalType": "address",
"name": "factory",
"type": "address"
},
{
"internalType": "address",
"name": "positionManager",
"type": "address"
},
{
"internalType": "address",
"name": "weth",
"type": "address"
}
],
"name": "deploy",
"outputs": [
{
"internalType": "contract PumpV4Hook",
"name": "hook",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]Source code
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
import {PumpV4Hook} from "./PumpV4Hook.sol";
/**
* @notice Deterministic deployer for a pre-mined PumpV4Hook salt.
* @dev Salt mining is intentionally off-chain; computeAddress is provided so a
* deployment can be checked before the CREATE2 transaction is submitted.
*/
contract PumpV4HookDeployer {
event HookDeployed(address indexed hook, bytes32 indexed salt);
function deploy(bytes32 salt, IPoolManager poolManager, address factory, address positionManager, address weth)
external
returns (PumpV4Hook hook)
{
hook = new PumpV4Hook{salt: salt}(poolManager, factory, positionManager, weth);
emit HookDeployed(address(hook), salt);
}
function computeAddress(
bytes32 salt,
IPoolManager poolManager,
address factory,
address positionManager,
address weth
) external view returns (address predicted) {
// CREATE2's full init-code hash is required for an exact prediction.
// slither-disable-next-line too-many-digits
bytes32 initCodeHash = keccak256(
abi.encodePacked(type(PumpV4Hook).creationCode, abi.encode(poolManager, factory, positionManager, weth))
);
predicted =
address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, initCodeHash)))));
}
}
Chain explorer3148msChain node94ms