How to use @nomiclabs/buidler - 10 common examples

To help you get started, we’ve selected a few @nomiclabs/buidler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MolochVentures / moloch / test / v2 / moloch.js View on Github external
const { assert } = chai

// const BN = web3.utils.BN

chai
  .use(require('chai-as-promised'))
  .should()

async function blockTime () {
  const block = await web3.eth.getBlock('latest')
  return block.timestamp
}

const Moloch = artifacts.require('./Moloch')
const GuildBank = artifacts.require('./GuildBank')
const Token = artifacts.require('./Token')

const initSummonerBalance = 100

const deploymentConfig = {
  'SUMMONER': '0x9a8d670c323e894dda9a045372a75d607a47cb9e',
  'PERIOD_DURATION_IN_SECONDS': 17280,
  'VOTING_DURATON_IN_PERIODS': 35,
  'GRACE_DURATON_IN_PERIODS': 35,
  'EMERGENCY_EXIT_WAIT_IN_PERIODS': 35,
  'PROPOSAL_DEPOSIT': 10,
  'DILUTION_BOUND': 3,
  'PROCESSING_REWARD': 1,
  'TOKEN_SUPPLY': 10000
}

contract('Moloch V2', ([creator, summoner, applicant1, applicant2, processor, delegateKey, ...otherAccounts]) => {
github MolochVentures / moloch / test / v2 / moloch.js View on Github external
const chai = require('chai')
const { assert } = chai

// const BN = web3.utils.BN

chai
  .use(require('chai-as-promised'))
  .should()

async function blockTime () {
  const block = await web3.eth.getBlock('latest')
  return block.timestamp
}

const Moloch = artifacts.require('./Moloch')
const GuildBank = artifacts.require('./GuildBank')
const Token = artifacts.require('./Token')

const initSummonerBalance = 100

const deploymentConfig = {
  'SUMMONER': '0x9a8d670c323e894dda9a045372a75d607a47cb9e',
  'PERIOD_DURATION_IN_SECONDS': 17280,
  'VOTING_DURATON_IN_PERIODS': 35,
  'GRACE_DURATON_IN_PERIODS': 35,
  'EMERGENCY_EXIT_WAIT_IN_PERIODS': 35,
  'PROPOSAL_DEPOSIT': 10,
  'DILUTION_BOUND': 3,
  'PROCESSING_REWARD': 1,
  'TOKEN_SUPPLY': 10000
}
github MolochVentures / moloch / test / v2 / moloch.js View on Github external
const { artifacts, web3 } = require('@nomiclabs/buidler')
const chai = require('chai')
const { assert } = chai

// const BN = web3.utils.BN

chai
  .use(require('chai-as-promised'))
  .should()

async function blockTime () {
  const block = await web3.eth.getBlock('latest')
  return block.timestamp
}

const Moloch = artifacts.require('./Moloch')
const GuildBank = artifacts.require('./GuildBank')
const Token = artifacts.require('./Token')

const initSummonerBalance = 100

const deploymentConfig = {
  'SUMMONER': '0x9a8d670c323e894dda9a045372a75d607a47cb9e',
  'PERIOD_DURATION_IN_SECONDS': 17280,
  'VOTING_DURATON_IN_PERIODS': 35,
  'GRACE_DURATON_IN_PERIODS': 35,
  'EMERGENCY_EXIT_WAIT_IN_PERIODS': 35,
  'PROPOSAL_DEPOSIT': 10,
  'DILUTION_BOUND': 3,
  'PROCESSING_REWARD': 1,
  'TOKEN_SUPPLY': 10000
}
github aragon / aragon-cli / packages / buidler / tasks / start.ts View on Github external
.setAction(async ({}, { web3, run }) => {
    console.log(`Starting...`);

    // Define internal tasks.
    internalTask(TASK_START_NEW_DAO, newDao);
    internalTask(TASK_START_NEW_APP_PROXY, newAppProxy);
    internalTask(TASK_START_UPDATE_PROXY_IMPLEMENTATION, updateProxyImplementation);
    internalTask(TASK_START_WATCH_CONTRACTS, watchContracts)

    // Compile contracts.
    await run('compile')

    // Retrieve active accounts.
    const accounts = await web3.eth.getAccounts();
    const root = accounts[0];

    const dao = await run(TASK_START_NEW_DAO, { root });
    console.log(`New DAO created at: ${dao.address}`);

    const proxy = await run(TASK_START_NEW_APP_PROXY, { root, dao });
    console.log(`New app proxy created at: ${proxy.address}`);
github aragon / aragon-cli / packages / buidler / tasks / start.ts View on Github external
.setAction(async ({}, { web3, run }) => {
    console.log(`Starting...`);

    // Define internal tasks.
    internalTask(TASK_START_NEW_DAO, newDao);
    internalTask(TASK_START_NEW_APP_PROXY, newAppProxy);
    internalTask(TASK_START_UPDATE_PROXY_IMPLEMENTATION, updateProxyImplementation);
    internalTask(TASK_START_WATCH_CONTRACTS, watchContracts)

    // Compile contracts.
    await run('compile')

    // Retrieve active accounts.
    const accounts = await web3.eth.getAccounts();
    const root = accounts[0];

    const dao = await run(TASK_START_NEW_DAO, { root });
    console.log(`New DAO created at: ${dao.address}`);

    const proxy = await run(TASK_START_NEW_APP_PROXY, { root, dao });
    console.log(`New app proxy created at: ${proxy.address}`);
github aragon / aragon-cli / packages / buidler / tasks / start / index.ts View on Github external
TASK_COMPILE,
} from '../task-names';

import {
  createDao,
  deployImplementation,
  createProxy,
  updateProxy,
  createRepo,
  updateRepo,
  setPermissions,
  getMainContractName,
  getMainContractPath
} from './utils/backend';

internalTask(TASK_START_WATCH_CONTRACTS, watchContracts);

const APP_ID = '0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF';

/**
 * Main, composite, task.
 */
task(TASK_START, 'Starts Aragon app development').setAction(
  async ({}, { web3, run, artifacts }: BuidlerRuntimeEnvironment) => {
    console.log(`Starting...`);

    await run(TASK_COMPILE);

    // Retrieve active accounts.
    const accounts: string[] = await web3.eth.getAccounts();
    const root = accounts[0];
github aragon / aragon-cli / packages / buidler / tasks / start.ts View on Github external
.setAction(async ({}, { web3, run }) => {
    console.log(`Starting...`);

    // Define internal tasks.
    internalTask(TASK_START_NEW_DAO, newDao);
    internalTask(TASK_START_NEW_APP_PROXY, newAppProxy);
    internalTask(TASK_START_UPDATE_PROXY_IMPLEMENTATION, updateProxyImplementation);
    internalTask(TASK_START_WATCH_CONTRACTS, watchContracts)

    // Compile contracts.
    await run('compile')

    // Retrieve active accounts.
    const accounts = await web3.eth.getAccounts();
    const root = accounts[0];

    const dao = await run(TASK_START_NEW_DAO, { root });
    console.log(`New DAO created at: ${dao.address}`);

    const proxy = await run(TASK_START_NEW_APP_PROXY, { root, dao });
    console.log(`New app proxy created at: ${proxy.address}`);

    await run(TASK_START_WATCH_CONTRACTS, { root, dao })
github aragon / aragon-cli / packages / buidler / tasks / start.ts View on Github external
TASK_START_NEW_DAO,
  TASK_START_NEW_APP_PROXY,
  TASK_START_UPDATE_PROXY_IMPLEMENTATION,
  TASK_START_WATCH_CONTRACTS
} from './task-names'

// import {
//   TASK_COMPILE
// } from '@nomiclabs/buidler/src/builtin-tasks/task-names'

import filewatcher from 'filewatcher'

const BASE_NAMESPACE = '0xf1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0f';
const APP_ID = '0xDEADBEEF';

task(TASK_START, 'Starts Aragon app development')
  .setAction(async ({}, { web3, run }) => {
    console.log(`Starting...`);

    // Define internal tasks.
    internalTask(TASK_START_NEW_DAO, newDao);
    internalTask(TASK_START_NEW_APP_PROXY, newAppProxy);
    internalTask(TASK_START_UPDATE_PROXY_IMPLEMENTATION, updateProxyImplementation);
    internalTask(TASK_START_WATCH_CONTRACTS, watchContracts)

    // Compile contracts.
    await run('compile')

    // Retrieve active accounts.
    const accounts = await web3.eth.getAccounts();
    const root = accounts[0];
github aragon / aragon-cli / packages / buidler / tasks / start / index.ts View on Github external
updateProxy,
  createRepo,
  updateRepo,
  setPermissions,
  getMainContractName,
  getMainContractPath
} from './utils/backend';

internalTask(TASK_START_WATCH_CONTRACTS, watchContracts);

const APP_ID = '0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF';

/**
 * Main, composite, task.
 */
task(TASK_START, 'Starts Aragon app development').setAction(
  async ({}, { web3, run, artifacts }: BuidlerRuntimeEnvironment) => {
    console.log(`Starting...`);

    await run(TASK_COMPILE);

    // Retrieve active accounts.
    const accounts: string[] = await web3.eth.getAccounts();
    const root = accounts[0];

    // Create a DAO.
    const dao = await createDao(root, artifacts);
    console.log(`New DAO created at: ${dao.address}`);

    // Create an APM repo for the app.
    const repo = await createRepo(root, artifacts);
    console.log(`New APM Repository created at: ${repo.address}`)
github cosmos / gravity-bridge / solidity / buidler.config.ts View on Github external
import { usePlugin } from "@nomiclabs/buidler/config";
usePlugin("@nomiclabs/buidler-waffle");
usePlugin("buidler-gas-reporter");
usePlugin("buidler-typechain");

// // This is a sample Buidler task. To learn how to create your own go to
// // https://buidler.dev/guides/create-task.html
// task("accounts", "Prints the list of accounts", async (taskArgs, bre) => {
//   const accounts = await bre.ethers.getSigners();

//   for (const account of accounts) {
//     console.log(await account.getAddress());
//   }
// });

// You have to export an object to set up your config
// This object can have the following optional entries:
// defaultNetwork, networks, solc, and paths.