Skip to content

Make owner configurable in the constructor #1009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
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
Loading