-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #338 from Thetta/dev-enkogu-sept
Dev enkogu sept
- Loading branch information
Showing
2 changed files
with
56 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
var migrateLibs = require('../scripts/migrateLibs'); | ||
|
||
module.exports = function (deployer, network, accounts) { | ||
return migrateLibs(artifacts, deployer, network, accounts); | ||
return migrateLibs(artifacts, [], deployer, network, accounts); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,58 @@ | ||
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, [Voting, GenericCallerLib, GenericCaller, 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])) | ||
function migrateLibs (artifacts, additionalContracts, deployer, network, accounts) { | ||
|
||
return deployer.then(async () => { | ||
var UtilsLib = artifacts.require("./UtilsLib"); | ||
var GenericCallerLib = artifacts.require("./GenericCallerLib"); | ||
var VotingLib = artifacts.require("./VotingLib"); | ||
var DaoBaseLib = artifacts.require("./DaoBaseLib"); | ||
|
||
async function linkIfExist(contractName){ | ||
try { | ||
await deployer.link(UtilsLib, artifacts.require(contractName)); | ||
await deployer.link(VotingLib, artifacts.require(contractName)); | ||
await deployer.link(GenericCallerLib, artifacts.require(contractName)); | ||
await deployer.link(DaoBaseLib, artifacts.require(contractName)); | ||
} catch(error) {} | ||
} | ||
|
||
await deployer.deploy(UtilsLib); | ||
await deployer.link(UtilsLib, VotingLib); | ||
await deployer.deploy(VotingLib); | ||
await deployer.link(VotingLib, GenericCallerLib); | ||
await deployer.deploy(GenericCallerLib); | ||
await deployer.deploy(DaoBaseLib); | ||
|
||
contractsArr = [ "./DaoBaseImpersonated" | ||
, "./DaoBaseWithUnpackers" | ||
, "./GenericCaller" | ||
, "./VotingLib" | ||
, "./DaoBaseAuto" | ||
, "./DaoBaseWithUnpackersMock" | ||
, "./DaoBaseMock" | ||
, "./DaoStorage" | ||
, "./StdDaoToken" | ||
, "./Voting" | ||
, "./GenericCallerLib" | ||
, "./GenericCaller" | ||
, "./MoneyflowAuto" | ||
, "./DaoBaseAuto" | ||
, "./GenericCaller" | ||
, "./MoneyflowAuto" | ||
, "./DaoBaseAuto" | ||
, "./DaoBase" | ||
, "./DaoBaseWithUnpackers" | ||
, "./DaoBaseWithUnpackersMock" | ||
, "./DaoBaseMock" | ||
] | ||
|
||
contractsArr = contractsArr.concat(additionalContracts); | ||
|
||
for(let contract of contractsArr){ | ||
await linkIfExist(contract); | ||
} | ||
|
||
|
||
}); | ||
}; | ||
|
||
module.exports = migrateLibs |