Skip to content

Commit

Permalink
#335: migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill authored and Kirill committed Sep 24, 2018
1 parent 70530fa commit f6442f9
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 84 deletions.
2 changes: 1 addition & 1 deletion contracts/DaoBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ contract DaoBase is IDaoBase, Ownable {
*/
function addGroupMember(string _groupName, address _a) public isCanDoOrByOwner(MANAGE_GROUPS) {
emit DaoBaseAddGroupMember(_groupName, _a);
require (_groupName.length>0);
require(bytes(_groupName).length>0);
daoStorage.addGroupMember(stringHash(_groupName), _a);
}

Expand Down
5 changes: 5 additions & 0 deletions migrations/2_deploy_contracts_libraries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var migrateLibs = require('../scripts/migrateLibs');

module.exports = function (deployer, network, accounts) {
return migrateLibs(artifacts, deployer, network, accounts);
};
32 changes: 0 additions & 32 deletions migrations/2_deploy_contracts_utilsLib.js

This file was deleted.

17 changes: 0 additions & 17 deletions migrations/3_deploy_contracts_votingLib.js

This file was deleted.

19 changes: 0 additions & 19 deletions migrations/4_deploy_contracts_genericCallerLib.js

This file was deleted.

15 changes: 0 additions & 15 deletions migrations/5_deploy_contracts_daoLib.js

This file was deleted.

29 changes: 29 additions & 0 deletions scripts/migrateLibs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
function migrateLibs (artifacts, deployer, network, accounts) {
var UtilsLib = artifacts.require("./UtilsLib");
var DaoBase = artifacts.require("./DaoBase");
var DaoBaseImpersonated = artifacts.require("./DaoBaseImpersonated");
var DaoBaseWithUnpackers = artifacts.require("./DaoBaseWithUnpackers");
var GenericCaller = artifacts.require("./GenericCaller");
var GenericCallerLib = artifacts.require("./GenericCallerLib");
var MoneyflowAuto = artifacts.require("./MoneyflowAuto");
var Voting = artifacts.require("./Voting");
var VotingLib = artifacts.require("./VotingLib");
var DaoBaseAuto = artifacts.require("./DaoBaseAuto");
var DaoBaseWithUnpackersMock = artifacts.require("./DaoBaseWithUnpackersMock");
var DaoStorage = artifacts.require("./DaoStorage");
var DaoBaseMock = artifacts.require("./DaoBaseMock");
var StdDaoToken = artifacts.require("./StdDaoToken");
var DaoBaseLib = artifacts.require("./DaoBaseLib");

return deployer
.then(() => deployer.deploy(UtilsLib))
.then(() => deployer.link(UtilsLib, [DaoBaseImpersonated, DaoBaseWithUnpackers, GenericCaller, VotingLib, DaoBaseAuto, DaoBaseWithUnpackersMock, DaoBaseMock, DaoStorage, StdDaoToken]))
.then(() => deployer.deploy(VotingLib))
.then(() => deployer.link(VotingLib, [GenericCaller, GenericCallerLib, MoneyflowAuto, DaoBaseAuto]))
.then(() => deployer.deploy(GenericCallerLib))
.then(() => deployer.link(GenericCallerLib, [GenericCaller, MoneyflowAuto, DaoBaseAuto]))
.then(() => deployer.deploy(DaoBaseLib))
.then(() => deployer.link(DaoBaseLib, [DaoBase, DaoBaseWithUnpackers, DaoBaseWithUnpackersMock, DaoBaseMock]))
};

module.exports = migrateLibs

0 comments on commit f6442f9

Please sign in to comment.