Skip to content

Commit

Permalink
update dev deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMayflower committed May 23, 2021
1 parent 30ed783 commit dfbc5eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
26 changes: 10 additions & 16 deletions scripts/demo/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ import { parseEther } from "ethers/lib/utils";
import { ERC20__factory } from "../../src";
import { WorkhardClient } from "../../src";

import deployed from "../../deployed.dev.json";

export async function startEmission() {
console.log(
"Start Emission - snapshot id: ",
await ethers.provider.send("evm_snapshot", [])
);

const [signer] = await ethers.getSigners();
const client = await WorkhardClient.from(ethers.provider, {
const client = await WorkhardClient.from(ethers.provider, deployed, {
account: signer,
deployed: require("../../deployed.dev.json"),
});
const masterDAO = await client.getMasterDAO({ account: signer });

Expand All @@ -34,9 +35,8 @@ export async function distribute() {
);

const [signer] = await ethers.getSigners();
const client = await WorkhardClient.from(ethers.provider, {
const client = await WorkhardClient.from(ethers.provider, deployed, {
account: signer,
deployed: require("../../deployed.dev.json"),
});
const masterDAO = await client.getMasterDAO();

Expand All @@ -53,9 +53,8 @@ export async function mintBaseCurrency() {
);

const [signer] = await ethers.getSigners();
const client = await WorkhardClient.from(ethers.provider, {
const client = await WorkhardClient.from(ethers.provider, deployed, {
account: signer,
deployed: require("../../deployed.dev.json"),
});
const masterDAO = await client.getMasterDAO();
const { baseCurrency } = masterDAO;
Expand All @@ -72,9 +71,8 @@ export async function addLiquidity() {
await ethers.provider.send("evm_snapshot", [])
);
const [signer] = await ethers.getSigners();
const client = await WorkhardClient.from(ethers.provider, {
const client = await WorkhardClient.from(ethers.provider, deployed, {
account: signer,
deployed: require("../../deployed.dev.json"),
});
const masterDAO = await client.getMasterDAO();
const { vision } = masterDAO;
Expand Down Expand Up @@ -109,9 +107,8 @@ export async function launchWorkersUnion() {
);

const [signer] = await ethers.getSigners();
const client = await WorkhardClient.from(ethers.provider, {
const client = await WorkhardClient.from(ethers.provider, deployed, {
account: signer,
deployed: require("../../deployed.dev.json"),
});
const masterDAO = await client.getMasterDAO();
const { workersUnion } = masterDAO;
Expand All @@ -130,9 +127,8 @@ export async function newCryptoJob() {
);

const [signer] = await ethers.getSigners();
const client = await WorkhardClient.from(ethers.provider, {
const client = await WorkhardClient.from(ethers.provider, deployed, {
account: signer,
deployed: require("../../deployed.dev.json"),
});
const masterDAO = await client.getMasterDAO();

Expand All @@ -149,9 +145,8 @@ export async function approveProject() {
);

const [signer] = await ethers.getSigners();
const client = await WorkhardClient.from(ethers.provider, {
const client = await WorkhardClient.from(ethers.provider, deployed, {
account: signer,
deployed: require("../../deployed.dev.json"),
});
const masterDAO = await client.getMasterDAO();
const { jobBoard, timelock } = masterDAO;
Expand All @@ -170,9 +165,8 @@ export async function distributeReward() {
);

const [signer] = await ethers.getSigners();
const client = await WorkhardClient.from(ethers.provider, {
const client = await WorkhardClient.from(ethers.provider, deployed, {
account: signer,
deployed: require("../../deployed.dev.json"),
});
const masterDAO = await client.getMasterDAO();
const { baseCurrency, dividendPool } = masterDAO;
Expand Down
2 changes: 0 additions & 2 deletions scripts/demo/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import {
launchWorkersUnion,
mintBaseCurrency,
newCryptoJob,
startEmission,
} from "./actions";

async function main() {
await startEmission();
await distribute();
await mintBaseCurrency();
await addLiquidity();
Expand Down

0 comments on commit dfbc5eb

Please sign in to comment.