Skip to content

Commit

Permalink
Set up the V3Factory owner contract & test harness
Browse files Browse the repository at this point in the history
  • Loading branch information
apbendi committed Jan 4, 2024
1 parent 00603e9 commit a5d84f9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/V3FactoryOwner.sol
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;
}
}
28 changes: 28 additions & 0 deletions test/V3FactoryOwner.t.sol
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);
}
}

0 comments on commit a5d84f9

Please sign in to comment.