Skip to content

Commit

Permalink
#50
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill authored and Kirill committed Sep 3, 2018
1 parent 7fe8c22 commit cfac632
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 93 deletions.
16 changes: 8 additions & 8 deletions contracts/1-HierarchyDao/1-HierarchyDao.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract HierarchyDaoFactory {
StdDaoToken public token;

HierarchyDao public dao;
DaoBaseAuto public aac;
DaoBaseAuto public hierarcyDaoAuto;

address[] tokens;

Expand All @@ -28,7 +28,7 @@ contract HierarchyDaoFactory {
address[] _outsiders
) public {
createDao(_boss, _managers, _employees, _outsiders);
// setupAac();
// setupHierarchyDaoAuto();
}

function createDao(
Expand Down Expand Up @@ -90,18 +90,18 @@ contract HierarchyDaoFactory {

}

/*function setupAac() internal {
/*function setupHierarchyDaoAuto() internal {
aac = new DaoBaseAuto(dao);
hierarcyDaoAuto = new DaoBaseAuto(dao);
// set voring params 1 person 1 vote
uint8 VOTING_TYPE_1P1V = 1;
aac.setVotingParams("manageGroups", VOTING_TYPE_1P1V, bytes32(0), "Managers", bytes32(50), bytes32(50), 0);
hierarcyDaoAuto.setVotingParams("manageGroups", VOTING_TYPE_1P1V, bytes32(0), "Managers", bytes32(50), bytes32(50), 0);
dao.allowActionByAddress(keccak256("addNewProposal"), aac);
dao.allowActionByAddress(keccak256("manageGroups"), aac);
dao.allowActionByAddress(keccak256("addNewProposal"), hierarcyDaoAuto);
dao.allowActionByAddress(keccak256("manageGroups"), hierarcyDaoAuto);
aac.transferOwnership(msg.sender);
hierarcyDaoAuto.transferOwnership(msg.sender);
}*/

}
36 changes: 18 additions & 18 deletions contracts/2-BoD/2-BoD.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import "@thetta/core/contracts/tokens/StdDaoToken.sol";
contract BodDaoFactory {

DaoBaseWithUnpackers public daoBase;
DaoBaseAuto public aac;
DaoBaseAuto public bodDaoAuto;
DaoStorage store;
StdDaoToken public token;

address[] tokens;

constructor(address _creator, address[] _directors, address[] _employees) public {
createDao(_creator, _directors, _employees);
// setupAac();
// setupBodDaoAuto();
}

function createDao(address _creator, address[] _directors, address[] _employees) internal returns (address) {
Expand Down Expand Up @@ -74,25 +74,25 @@ contract BodDaoFactory {
}
}

/*function setupAac() internal {
/*function setupBodDaoAuto() internal {
aac = new DaoBaseAuto(daoBase);
bodDaoAuto = new DaoBaseAuto(daoBase);
uint VOTING_TYPE_1P1V = 1;
aac.setVotingParams("manageGroups", VOTING_TYPE_1P1V, 0, "BoD", 50, 50, 0);
aac.setVotingParams("addNewTask", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
aac.setVotingParams("modifyMoneyscheme", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
aac.setVotingParams("issueTokens", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
aac.setVotingParams("upgradeDaoContract", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
aac.setVotingParams("withdrawDonations", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
aac.setVotingParams("flushReserveFundTo", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
aac.setVotingParams("flushDividendsFundTo", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
daoBase.allowActionByAddress(keccak256("manageGroups"), aac);
daoBase.allowActionByAddress(keccak256("addNewProposal"), aac);
daoBase.allowActionByAddress(keccak256("modifyMoneyscheme"), aac);
aac.transferOwnership(msg.sender);
bodDaoAuto.setVotingParams("manageGroups", VOTING_TYPE_1P1V, 0, "BoD", 50, 50, 0);
bodDaoAuto.setVotingParams("addNewTask", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
bodDaoAuto.setVotingParams("modifyMoneyscheme", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
bodDaoAuto.setVotingParams("issueTokens", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
bodDaoAuto.setVotingParams("upgradeDaoContract", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
bodDaoAuto.setVotingParams("withdrawDonations", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
bodDaoAuto.setVotingParams("flushReserveFundTo", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
bodDaoAuto.setVotingParams("flushDividendsFundTo", VOTING_TYPE_1P1V, (24 * 60), "BoD", 50, 50, 0);
daoBase.allowActionByAddress(keccak256("manageGroups"), bodDaoAuto);
daoBase.allowActionByAddress(keccak256("addNewProposal"), bodDaoAuto);
daoBase.allowActionByAddress(keccak256("modifyMoneyscheme"), bodDaoAuto);
bodDaoAuto.transferOwnership(msg.sender);
}*/

}
50 changes: 25 additions & 25 deletions contracts/3-DevZenDao/DevZenDaoFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ contract DevZenDaoFactory {
DevZenDaoWithUnpackers public devZenDao;
DaoBase public daoBase;
DaoStorage store;
DevZenDaoAuto public aac;
DevZenDaoAuto public devZenDaoAuto;

constructor(address _boss, address[] _devZenTeam) public{
createDao(_boss, _devZenTeam);
setupAac();
setupDevZenDaoAuto();
daoBase.renounceOwnership();
}

Expand Down Expand Up @@ -98,34 +98,34 @@ contract DevZenDaoFactory {
devZenDao = new DevZenDaoWithUnpackers(_daoBase, _tokens, _defaultParams);
}

function setupAac() internal {
function setupDevZenDaoAuto() internal {
// TODO: add all custom actions to the DaoBaseAuto derived contract

aac = new DevZenDaoAuto(IDaoBase(daoBase), devZenDao);
devZenDaoAuto = new DevZenDaoAuto(IDaoBase(daoBase), devZenDao);

daoBase.allowActionByAddress(daoBase.ADD_NEW_PROPOSAL(), aac);
daoBase.allowActionByAddress(daoBase.MANAGE_GROUPS(), aac);
daoBase.allowActionByAddress(daoBase.UPGRADE_DAO_CONTRACT(), aac);
daoBase.allowActionByAddress(daoBase.ADD_NEW_PROPOSAL(), devZenDaoAuto);
daoBase.allowActionByAddress(daoBase.MANAGE_GROUPS(), devZenDaoAuto);
daoBase.allowActionByAddress(daoBase.UPGRADE_DAO_CONTRACT(), devZenDaoAuto);

daoBase.allowActionByAddress(devZenDao.DEV_ZEN_UPDATE_DAO_PARAMS(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_WITHDRAW_ETHER(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_SELECT_NEXT_HOST(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_BURN_GUEST_STAKE(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_CHANGE_GUEST(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_EMERGENCY_CHANGE_GUEST(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_MOVE_TO_NEXT_EPISODE(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_UPDATE_DAO_PARAMS(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_WITHDRAW_ETHER(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_SELECT_NEXT_HOST(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_BURN_GUEST_STAKE(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_CHANGE_GUEST(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_EMERGENCY_CHANGE_GUEST(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_MOVE_TO_NEXT_EPISODE(), devZenDaoAuto);

uint VOTING_TYPE_1P1V = 1;
aac.setVotingParams(daoBase.MANAGE_GROUPS(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(daoBase.UPGRADE_DAO_CONTRACT(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_UPDATE_DAO_PARAMS(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_WITHDRAW_ETHER(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_SELECT_NEXT_HOST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_BURN_GUEST_STAKE(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_CHANGE_GUEST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_EMERGENCY_CHANGE_GUEST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_MOVE_TO_NEXT_EPISODE(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);

aac.transferOwnership(daoBase);
devZenDaoAuto.setVotingParams(daoBase.MANAGE_GROUPS(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(daoBase.UPGRADE_DAO_CONTRACT(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_UPDATE_DAO_PARAMS(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_WITHDRAW_ETHER(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_SELECT_NEXT_HOST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_BURN_GUEST_STAKE(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_CHANGE_GUEST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_EMERGENCY_CHANGE_GUEST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_MOVE_TO_NEXT_EPISODE(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);

devZenDaoAuto.transferOwnership(daoBase);
}
}
50 changes: 25 additions & 25 deletions contracts/3-DevZenDao/DevZenDaoFactoryTestable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ contract DevZenDaoFactoryTestable {
DevZenDaoWithUnpackersTestable public devZenDao;
DaoBase public daoBase;
DaoStorage store;
DevZenDaoAutoTestable public aac;
DevZenDaoAutoTestable public devZenDaoAuto;

constructor(address _boss, address[] _devZenTeam) public{
createDao(_boss, _devZenTeam);
setupAac();
setupDevZenDaoAuto();
daoBase.renounceOwnership();
}

Expand Down Expand Up @@ -84,35 +84,35 @@ contract DevZenDaoFactoryTestable {
devZenDao = new DevZenDaoWithUnpackersTestable(_daoBase, _tokens, _defaultParams);
}

function setupAac() internal {
function setupDevZenDaoAuto() internal {
// TODO: add all custom actions to the DaoBaseAuto derived contract

aac = new DevZenDaoAutoTestable(IDaoBase(daoBase), devZenDao);
devZenDaoAuto = new DevZenDaoAutoTestable(IDaoBase(daoBase), devZenDao);

daoBase.allowActionByAddress(daoBase.ADD_NEW_PROPOSAL(), aac);
daoBase.allowActionByAddress(daoBase.MANAGE_GROUPS(), aac);
daoBase.allowActionByAddress(daoBase.UPGRADE_DAO_CONTRACT(), aac);
daoBase.allowActionByAddress(daoBase.ADD_NEW_PROPOSAL(), devZenDaoAuto);
daoBase.allowActionByAddress(daoBase.MANAGE_GROUPS(), devZenDaoAuto);
daoBase.allowActionByAddress(daoBase.UPGRADE_DAO_CONTRACT(), devZenDaoAuto);

daoBase.allowActionByAddress(devZenDao.DEV_ZEN_UPDATE_DAO_PARAMS(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_WITHDRAW_ETHER(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_SELECT_NEXT_HOST(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_BURN_GUEST_STAKE(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_CHANGE_GUEST(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_EMERGENCY_CHANGE_GUEST(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_MOVE_TO_NEXT_EPISODE(), aac);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_UPDATE_DAO_PARAMS(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_WITHDRAW_ETHER(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_SELECT_NEXT_HOST(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_BURN_GUEST_STAKE(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_CHANGE_GUEST(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_EMERGENCY_CHANGE_GUEST(), devZenDaoAuto);
daoBase.allowActionByAddress(devZenDao.DEV_ZEN_MOVE_TO_NEXT_EPISODE(), devZenDaoAuto);

uint VOTING_TYPE_1P1V = 1;
aac.setVotingParams(daoBase.MANAGE_GROUPS(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(daoBase.UPGRADE_DAO_CONTRACT(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_UPDATE_DAO_PARAMS(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_WITHDRAW_ETHER(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_SELECT_NEXT_HOST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_BURN_GUEST_STAKE(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_CHANGE_GUEST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_EMERGENCY_CHANGE_GUEST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
aac.setVotingParams(devZenDao.DEV_ZEN_MOVE_TO_NEXT_EPISODE(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);

aac.transferOwnership(daoBase);
devZenDaoAuto.setVotingParams(daoBase.MANAGE_GROUPS(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(daoBase.UPGRADE_DAO_CONTRACT(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_UPDATE_DAO_PARAMS(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_WITHDRAW_ETHER(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_SELECT_NEXT_HOST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_BURN_GUEST_STAKE(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_CHANGE_GUEST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_EMERGENCY_CHANGE_GUEST(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);
devZenDaoAuto.setVotingParams(devZenDao.DEV_ZEN_MOVE_TO_NEXT_EPISODE(), VOTING_TYPE_1P1V, bytes32(0), UtilsLib.stringToBytes32("DevZenTeam"), bytes32(65), bytes32(65), 0);

devZenDaoAuto.transferOwnership(daoBase);
}

}
2 changes: 1 addition & 1 deletion test/BoD.functional.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract("BodDaoFactory", (accounts) => {
var bodDaoFactory;
// let store;
let daoBase;
let aac;
let bodDaoAuto;
let informalProposal;
let weiTask;
let voting;
Expand Down
Loading

0 comments on commit cfac632

Please sign in to comment.