-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up the V3Factory owner contract & test harness
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity 0.8.23; | ||
|
||
contract V3FactoryOwner { | ||
address public admin; | ||
|
||
constructor(address _admin) { | ||
admin = _admin; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity 0.8.23; | ||
|
||
import {Test, console2} from "forge-std/Test.sol"; | ||
import {V3FactoryOwner} from "src/V3FactoryOwner.sol"; | ||
|
||
contract V3FactoryOwnerTest is Test { | ||
V3FactoryOwner factoryOwner; | ||
address admin = address(0xb055beef); | ||
|
||
function setUp() public { | ||
vm.label(admin, "Admin"); | ||
|
||
factoryOwner = new V3FactoryOwner(admin); | ||
vm.label(address(factoryOwner), "Factory Owner"); | ||
} | ||
} | ||
|
||
contract Constructor is V3FactoryOwnerTest { | ||
function test_SetsTheAdmin() public { | ||
assertEq(factoryOwner.admin(), admin); | ||
} | ||
|
||
function testFuzz_SetTheAdminToAnArbitraryAddress(address _admin) public { | ||
V3FactoryOwner _factoryOwner = new V3FactoryOwner(_admin); | ||
assertEq(_factoryOwner.admin(), _admin); | ||
} | ||
} |