Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions contracts/mocks/MockUniswapV3PoolDeployer.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;

import {IUniswapV3PoolDeployer} from '@uniswap/v3-core/contracts/interfaces/IUniswapV3PoolDeployer.sol';
import {MockUniswapV3Pool} from './MockUniswapV3Pool.sol';
import {IUniswapV3PoolDeployer} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3PoolDeployer.sol";
import {MockUniswapV3Pool} from "./MockUniswapV3Pool.sol";

contract MockUniswapV3PoolDeployer is IUniswapV3PoolDeployer {
struct Parameters {
Expand All @@ -24,8 +24,18 @@ contract MockUniswapV3PoolDeployer is IUniswapV3PoolDeployer {
uint24 fee,
int24 tickSpacing
) external returns (address pool) {
parameters = Parameters({factory: factory, token0: token0, token1: token1, fee: fee, tickSpacing: tickSpacing});
pool = address(new MockUniswapV3Pool{salt: keccak256(abi.encodePacked(token0, token1, fee, tickSpacing))}());
parameters = Parameters({
factory: factory,
token0: token0,
token1: token1,
fee: fee,
tickSpacing: tickSpacing
});

pool = address(
new MockUniswapV3Pool{salt: keccak256(abi.encodePacked(token0, token1, fee, tickSpacing))}()
);

emit PoolDeployed(pool);
delete parameters;
}
Expand Down