PancakeV3PoolDeployer
0x41ff9aa7e16b8b1a8a8dc4f0efacd93d02d071c9
Verification
Verified
v0.7.6+commit.7338295f
Type
Contract
24,556 bytes
ABI entries
5
2 read · 2 write
License
none
Contract information
- Address
- 0x41ff9aa7e16b8b1a8a8dc4f0efacd93d02d071c9
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.7.6+commit.7338295f
- Optimization
- Enabled
- Creator
- 0x40492810a7…DfeA511047
- Creation tx
- 0xa1751373b7…e1c6f3725b
Token
Not a token
This contract does not expose ERC-20 metadata.
Read contract (2)
factoryAddress() → address
parameters() → address, address, address, uint24, int24
Events (1)
SetFactoryAddress
ABI
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "factory",
"type": "address"
}
],
"name": "SetFactoryAddress",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "factory",
"type": "address"
},
{
"internalType": "address",
"name": "token0",
"type": "address"
},
{
"internalType": "address",
"name": "token1",
"type": "address"
},
{
"internalType": "uint24",
"name": "fee",
"type": "uint24"
},
{
"internalType": "int24",
"name": "tickSpacing",
"type": "int24"
}
],
"name": "deploy",
"outputs": [
{
"internalType": "address",
"name": "pool",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "factoryAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "parameters",
"outputs": [
{
"internalType": "address",
"name": "factory",
"type": "address"
},
{
"internalType": "address",
"name": "token0",
"type": "address"
},
{
"internalType": "address",
"name": "token1",
"type": "address"
},
{
"internalType": "uint24",
"name": "fee",
"type": "uint24"
},
{
"internalType": "int24",
"name": "tickSpacing",
"type": "int24"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_factoryAddress",
"type": "address"
}
],
"name": "setFactoryAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]Source code
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
import "./interfaces/IPancakeV3PoolDeployer.sol";
import "./PancakeV3Pool.sol";
contract PancakeV3PoolDeployer is IPancakeV3PoolDeployer {
struct Parameters {
address factory;
address token0;
address token1;
uint24 fee;
int24 tickSpacing;
}
/// @inheritdoc IPancakeV3PoolDeployer
Parameters public override parameters;
address public factoryAddress;
/// @notice Emitted when factory address is set
event SetFactoryAddress(address indexed factory);
modifier onlyFactory() {
require(msg.sender == factoryAddress, "only factory can call deploy");
_;
}
function setFactoryAddress(address _factoryAddress) external {
require(factoryAddress == address(0), "already initialized");
factoryAddress = _factoryAddress;
emit SetFactoryAddress(_factoryAddress);
}
/// @dev Deploys a pool with the given parameters by transiently setting the parameters storage slot and then
/// clearing it after deploying the pool.
/// @param factory The contract address of the PancakeSwap V3 factory
/// @param token0 The first token of the pool by address sort order
/// @param token1 The second token of the pool by address sort order
/// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
/// @param tickSpacing The spacing between usable ticks
function deploy(address factory, address token0, address token1, uint24 fee, int24 tickSpacing)
external
override
onlyFactory
returns (address pool)
{
parameters = Parameters({factory: factory, token0: token0, token1: token1, fee: fee, tickSpacing: tickSpacing});
pool = address(new PancakeV3Pool{salt: keccak256(abi.encode(token0, token1, fee))}());
delete parameters;
}
}
Chain explorer2266msChain node78ms