diff --git a/contracts/UniswapV3Factory.sol b/contracts/UniswapV3Factory.sol index 3553ce55e..6dd7b011b 100644 --- a/contracts/UniswapV3Factory.sol +++ b/contracts/UniswapV3Factory.sol @@ -19,9 +19,9 @@ contract UniswapV3Factory is IUniswapV3Factory, UniswapV3PoolDeployer, NoDelegat /// @inheritdoc IUniswapV3Factory mapping(address => mapping(address => mapping(uint24 => address))) public override getPool; - constructor() { - owner = msg.sender; - emit OwnerChanged(address(0), msg.sender); + constructor(address initialOwner) { + owner = initialOwner; + emit OwnerChanged(address(0), initialOwner); feeAmountTickSpacing[500] = 10; emit FeeAmountEnabled(500, 10); diff --git a/test/UniswapV3Factory.spec.ts b/test/UniswapV3Factory.spec.ts index afdc9221d..ebd2c7559 100644 --- a/test/UniswapV3Factory.spec.ts +++ b/test/UniswapV3Factory.spec.ts @@ -22,7 +22,7 @@ describe('UniswapV3Factory', () => { let poolBytecode: string const fixture = async () => { const factoryFactory = await ethers.getContractFactory('UniswapV3Factory') - return (await factoryFactory.deploy()) as UniswapV3Factory + return (await factoryFactory.deploy(wallet.address)) as UniswapV3Factory } let loadFixture: ReturnType diff --git a/test/shared/fixtures.ts b/test/shared/fixtures.ts index 11c84bb72..3351a5fb5 100644 --- a/test/shared/fixtures.ts +++ b/test/shared/fixtures.ts @@ -15,7 +15,8 @@ interface FactoryFixture { async function factoryFixture(): Promise { const factoryFactory = await ethers.getContractFactory('UniswapV3Factory') - const factory = (await factoryFactory.deploy()) as UniswapV3Factory + const owner = (await ethers.getSigners())[0] + const factory = (await factoryFactory.deploy(owner.address)) as UniswapV3Factory return { factory } }