Skip to content

Commit

Permalink
Addressing the review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpop committed Jul 4, 2024
1 parent 261c5dd commit 206a827
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 94 deletions.
29 changes: 14 additions & 15 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ import {TaikoDaoFactory} from "../src/factory/TaikoDaoFactory.sol";
import {IVotesUpgradeable} from "@openzeppelin/contracts-upgradeable/governance/utils/IVotesUpgradeable.sol";
import {GovernanceERC20} from "@aragon/osx/token/ERC20/governance/GovernanceERC20.sol";
import {GovernanceWrappedERC20} from "@aragon/osx/token/ERC20/governance/GovernanceWrappedERC20.sol";
import {Multisig} from "../src/Multisig.sol";
import {MultisigPluginSetup} from "../src/setup/MultisigPluginSetup.sol";
import {EmergencyMultisig} from "../src/EmergencyMultisig.sol";
import {EmergencyMultisigPluginSetup} from "../src/setup/EmergencyMultisigPluginSetup.sol";
import {OptimisticTokenVotingPlugin} from "../src/OptimisticTokenVotingPlugin.sol";
import {OptimisticTokenVotingPluginSetup} from "../src/setup/OptimisticTokenVotingPluginSetup.sol";
import {PublicKeyRegistry} from "../src/PublicKeyRegistry.sol";
import {PluginRepo} from "@aragon/osx/framework/plugin/repo/PluginRepo.sol";
import {DelegationWall} from "../src/DelegationWall.sol";
import {PluginRepoFactory} from "@aragon/osx/framework/plugin/repo/PluginRepoFactory.sol";
import {PluginSetupProcessor} from "@aragon/osx/framework/plugin/setup/PluginSetupProcessor.sol";
import {GovernanceERC20Mock} from "../test/mocks/GovernanceERC20Mock.sol";
Expand Down Expand Up @@ -52,27 +48,30 @@ contract Deploy is Script {

TaikoDaoFactory factory = new TaikoDaoFactory(settings);
factory.deployOnce();
TaikoDaoFactory.Deployment memory deployment = factory.getDeployment();
TaikoDaoFactory.Deployment memory daoDeployment = factory.getDeployment();
address delegationWall = address(new DelegationWall());

vm.stopBroadcast();

// Print summary
console.log("Factory contract:", address(factory));
console.log("DAO contract:", address(deployment.dao));
console.log("DAO contract:", address(daoDeployment.dao));
console.log("");

console.log("- Multisig plugin:", address(deployment.multisigPlugin));
console.log("- Emergency multisig plugin:", address(deployment.emergencyMultisigPlugin));
console.log("- Optimistic token voting plugin:", address(deployment.optimisticTokenVotingPlugin));
console.log("- Multisig plugin:", address(daoDeployment.multisigPlugin));
console.log("- Emergency multisig plugin:", address(daoDeployment.emergencyMultisigPlugin));
console.log("- Optimistic token voting plugin:", address(daoDeployment.optimisticTokenVotingPlugin));
console.log("");

console.log("- Multisig plugin repository:", address(deployment.multisigPluginRepo));
console.log("- Emergency multisig plugin repository:", address(deployment.emergencyMultisigPluginRepo));
console.log("- Optimistic token voting plugin repository:", address(deployment.optimisticTokenVotingPluginRepo));
console.log("- Multisig plugin repository:", address(daoDeployment.multisigPluginRepo));
console.log("- Emergency multisig plugin repository:", address(daoDeployment.emergencyMultisigPluginRepo));
console.log(
"- Optimistic token voting plugin repository:", address(daoDeployment.optimisticTokenVotingPluginRepo)
);
console.log("");

console.log("Public key registry", address(deployment.publicKeyRegistry));
console.log("Delegation wall", address(deployment.delegationWall));
console.log("Public key registry", address(daoDeployment.publicKeyRegistry));
console.log("Delegation wall", address(delegationWall));
}

function getMainnetSettings() internal view returns (TaikoDaoFactory.DeploymentSettings memory settings) {
Expand Down
18 changes: 9 additions & 9 deletions src/DelegationWall.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pragma solidity ^0.8.17;
/// @notice A smart contract where any wallet can register its own libsodium public key for encryption purposes
contract DelegationWall {
struct Candidate {
bytes message;
bytes contentUrl;
bytes socialUrl;
}

Expand All @@ -17,22 +17,22 @@ contract DelegationWall {
address[] public candidateAddresses;

/// @notice Emitted when a wallet registers as a candidate
event CandidateRegistered(address indexed candidate, bytes message, bytes socialUrl);
event CandidateRegistered(address indexed candidate, bytes contentUrl, bytes socialUrl);

/// @notice Raised when a delegate registers with an empty message
error EmptyMessage();
/// @notice Raised when a delegate registers with an empty contentUrl
error EmptyContent();

function register(bytes memory _message, bytes memory _socialUrl) public {
if (_message.length == 0) revert EmptyMessage();
function register(bytes memory _contentUrl, bytes memory _socialUrl) public {
if (_contentUrl.length == 0) revert EmptyContent();

if (candidates[msg.sender].message.length == 0) {
if (candidates[msg.sender].contentUrl.length == 0) {
candidateAddresses.push(msg.sender);
}

candidates[msg.sender].message = _message;
candidates[msg.sender].contentUrl = _contentUrl;
candidates[msg.sender].socialUrl = _socialUrl;

emit CandidateRegistered(msg.sender, _message, _socialUrl);
emit CandidateRegistered(msg.sender, _contentUrl, _socialUrl);
}

function candidateCount() public view returns (uint256) {
Expand Down
8 changes: 0 additions & 8 deletions src/factory/TaikoDaoFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
pragma solidity ^0.8.17;

import {DAO} from "@aragon/osx/core/dao/DAO.sol";
import {IDAO} from "@aragon/osx/core/dao/IDAO.sol";
import {DAOFactory} from "@aragon/osx/framework/dao/DAOFactory.sol";
import {Multisig} from "../Multisig.sol";
import {EmergencyMultisig} from "../EmergencyMultisig.sol";
import {PublicKeyRegistry} from "../PublicKeyRegistry.sol";
import {DelegationWall} from "../DelegationWall.sol";
import {OptimisticTokenVotingPlugin} from "../OptimisticTokenVotingPlugin.sol";
import {OptimisticTokenVotingPluginSetup} from "../setup/OptimisticTokenVotingPluginSetup.sol";
import {MultisigPluginSetup} from "../setup/MultisigPluginSetup.sol";
Expand Down Expand Up @@ -64,7 +62,6 @@ contract TaikoDaoFactory {
PluginRepo optimisticTokenVotingPluginRepo;
// Other
PublicKeyRegistry publicKeyRegistry;
DelegationWall delegationWall;
}

/// @notice Thrown when attempting to call deployOnce() when the DAO is already deployed.
Expand Down Expand Up @@ -130,7 +127,6 @@ contract TaikoDaoFactory {

// DEPLOY OTHER CONTRACTS
deployment.publicKeyRegistry = deployPublicKeyRegistry();
deployment.delegationWall = deployDelegationWall();
}

function prepareDao() internal returns (DAO dao) {
Expand Down Expand Up @@ -269,10 +265,6 @@ contract TaikoDaoFactory {
return new PublicKeyRegistry();
}

function deployDelegationWall() internal returns (DelegationWall) {
return new DelegationWall();
}

function applyPluginInstallation(
DAO dao,
address plugin,
Expand Down
Loading

0 comments on commit 206a827

Please sign in to comment.