feat(Directory): add ownership capabilities to `Directory` (#90)

This commit is contained in:
r4bbit 2023-10-30 16:10:19 +01:00 committed by GitHub
parent 4f5651871b
commit af449861d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5388 additions and 5100 deletions

View File

@ -1,7 +1,9 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;
contract Directory {
import { Ownable2Step } from "@openzeppelin/contracts/access/Ownable2Step.sol";
contract Directory is Ownable2Step {
address public votingContract;
address public featuredVotingContract;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,7 @@ pragma solidity ^0.8.19;
import { Test } from "forge-std/Test.sol";
import { DeployContracts } from "../script/DeployContracts.s.sol";
import { DeploymentConfig } from "../script/DeploymentConfig.s.sol";
import { Directory } from "../contracts/Directory.sol";
import { VotingContract } from "../contracts/VotingContract.sol";
import { FeaturedVotingContract } from "../contracts/FeaturedVotingContract.sol";
@ -11,6 +12,7 @@ contract DirectoryTest is Test {
Directory public directory;
address internal votingContract;
address internal featuredVotingContract;
address internal deployer;
bytes internal communityID = "communityID";
bytes internal communityID2 = "communityID2";
@ -23,6 +25,9 @@ contract DirectoryTest is Test {
directory = _directory;
votingContract = address(_votingContract);
featuredVotingContract = address(_featuredVotingContract);
DeploymentConfig deploymentConfig = deployment.getDeploymentConfig();
deployer = deploymentConfig.deployer();
}
function _addCommunitiesToDirectory(bytes[] memory communityIDs) internal {
@ -35,6 +40,12 @@ contract DirectoryTest is Test {
assert(directory.isCommunityInDirectory(communityIDs[i]));
}
}
function testDeployment() public {
assertEq(directory.owner(), deployer);
assertEq(directory.votingContract(), votingContract);
assertEq(directory.featuredVotingContract(), featuredVotingContract);
}
}
contract IsCommunityInDirectoryTest is DirectoryTest {