How to use the @nomiclabs/buidler.artifacts.require function in @nomiclabs/buidler

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 MolochVentures / moloch / test / guildBank.js View on Github external
const { artifacts, ethereum, web3 } = require('@nomiclabs/buidler')
const chai = require('chai')
const { assert } = chai

const BN = web3.utils.BN

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

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

const deploymentConfig = {
  'TOKEN_SUPPLY': 10000
}

const SolRevert = 'VM Exception while processing transaction: revert'

async function snapshot () {
  return ethereum.send('evm_snapshot', [])
}

async function restore (snapshotId) {
  return ethereum.send('evm_revert', [snapshotId])
}

contract('GuildBank', ([creator, shareHolder, random, ...otherAccounts]) => {
github MolochVentures / moloch / test / guildBank.js View on Github external
const { artifacts, ethereum, web3 } = require('@nomiclabs/buidler')
const chai = require('chai')
const { assert } = chai

const BN = web3.utils.BN

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

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

const deploymentConfig = {
  'TOKEN_SUPPLY': 10000
}

const SolRevert = 'VM Exception while processing transaction: revert'

async function snapshot () {
  return ethereum.send('evm_snapshot', [])
}

async function restore (snapshotId) {
  return ethereum.send('evm_revert', [snapshotId])
}