-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,773 additions
and
1,316 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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* eslint-disable no-case-declarations */ | ||
require("@nomiclabs/hardhat-web3"); | ||
|
||
const { doActions } = require("./utils/do-actions"); | ||
|
||
task("actions-dxdao-contracts", "Execute actions on dxdao-contracts") | ||
.addParam("actions", "The actions json array in string format") | ||
.addParam( | ||
"networkContracts", | ||
"The networkContracts json object in string format" | ||
) | ||
.setAction(async ({ actions, networkContracts }) => { | ||
// Do actions | ||
await doActions(JSON.parse(actions), JSON.parse(networkContracts)); | ||
|
||
return; | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* eslint-disable no-case-declarations */ | ||
require("@nomiclabs/hardhat-web3"); | ||
|
||
const moment = require("moment"); | ||
|
||
const { deployTokens } = require("./utils/deploy-tokens"); | ||
const { | ||
deployPermissionRegistry, | ||
} = require("./utils/deploy-permissionRegistry"); | ||
const { deployGuildRegistry } = require("./utils/deploy-guildRegistry"); | ||
const { deployDao } = require("./utils/deploy-dao"); | ||
const { deployGuilds } = require("./utils/deploy-guilds"); | ||
const { doActions } = require("./utils/do-actions"); | ||
|
||
task("deploy-dxdao-contracts", "Deploy dxdao-contracts") | ||
.addParam("deployconfig", "The deploy config json in string format") | ||
.setAction(async ({ deployconfig }) => { | ||
// Set networkContracts object that will store the contracts deployed | ||
let networkContracts = { | ||
fromBlock: (await web3.eth.getBlock("latest")).number, | ||
avatar: null, | ||
reputation: null, | ||
token: null, | ||
controller: null, | ||
permissionRegistry: null, | ||
schemes: {}, | ||
utils: {}, | ||
votingMachines: {}, | ||
addresses: {}, | ||
}; | ||
|
||
// Parse string json config to json object | ||
const deploymentConfig = JSON.parse(deployconfig); | ||
|
||
if (deploymentConfig.tokens) { | ||
networkContracts = Object.assign( | ||
await deployTokens(deploymentConfig.tokens, networkContracts), | ||
networkContracts | ||
); | ||
} | ||
|
||
if (deploymentConfig.permissionRegistry) { | ||
networkContracts = Object.assign( | ||
await deployPermissionRegistry( | ||
deploymentConfig.permissionRegistry, | ||
networkContracts | ||
), | ||
networkContracts | ||
); | ||
} | ||
|
||
if (deploymentConfig.dao) { | ||
networkContracts = Object.assign( | ||
await deployDao(deploymentConfig.dao, networkContracts), | ||
networkContracts | ||
); | ||
} | ||
|
||
if (deploymentConfig.guildRegistry) { | ||
networkContracts = Object.assign( | ||
await deployGuildRegistry( | ||
deploymentConfig.guildRegistry, | ||
networkContracts | ||
), | ||
networkContracts | ||
); | ||
} | ||
|
||
if (deploymentConfig.guilds) { | ||
networkContracts = Object.assign( | ||
await deployGuilds(deploymentConfig.guilds, networkContracts), | ||
networkContracts | ||
); | ||
} | ||
|
||
console.log("Contracts deployed:", networkContracts); | ||
|
||
return networkContracts; | ||
}); |
Oops, something went wrong.