Skip to content

Commit

Permalink
Make owner configurable in the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
gretzke committed Nov 3, 2024
1 parent d8b1c63 commit e05f6c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions contracts/UniswapV3Factory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/UniswapV3Factory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof createFixtureLoader>
Expand Down
3 changes: 2 additions & 1 deletion test/shared/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ interface FactoryFixture {

async function factoryFixture(): Promise<FactoryFixture> {
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 }
}

Expand Down

0 comments on commit e05f6c0

Please sign in to comment.