forked from Uniswap/v3-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMockTimeUniswapV3PoolDeployer.sol
More file actions
35 lines (29 loc) · 969 Bytes
/
Copy pathMockTimeUniswapV3PoolDeployer.sol
File metadata and controls
35 lines (29 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;
import '../interfaces/IUniswapV3PoolDeployer.sol';
import './MockTimeUniswapV3Pool.sol';
contract MockTimeUniswapV3PoolDeployer is IUniswapV3PoolDeployer {
struct Parameters {
address factory;
address token0;
address token1;
uint24 fee;
int24 tickSpacing;
}
Parameters public override parameters;
event PoolDeployed(address pool);
function deploy(
address factory,
address token0,
address token1,
uint24 fee,
int24 tickSpacing
) external returns (address pool) {
parameters = Parameters({factory: factory, token0: token0, token1: token1, fee: fee, tickSpacing: tickSpacing});
pool = address(
new MockTimeUniswapV3Pool{salt: keccak256(abi.encodePacked(token0, token1, fee, tickSpacing))}()
);
emit PoolDeployed(pool);
delete parameters;
}
}