Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
provider: function() {
if (coverageProvider == null) {
console.log('building provider!')
coverageProvider = new ProviderEngine()
const projectRoot = ''
const artifactAdapter = new TruffleArtifactAdapter(projectRoot, SOLC_VERSION)
global.coverageSubprovider = new CoverageSubprovider(artifactAdapter, DEVELOPMENT_FROM, {
isVerbose: true,
ignoreFilesGlobs: [
// Proxies
'**/*Proxy.sol',
// Test contracts
'**/test/*.sol',
// Interfaces
'**/interfaces/*.sol',
],
})
coverageProvider.addProvider(global.coverageSubprovider)
coverageProvider.addProvider(
const mochaOptions =
process.env.GASREPORT === 'true'
? {
reporter: 'eth-gas-reporter',
reporterOptions: {
currency: 'USD',
gasPrice: 1
}
}
: {}
const projectRoot = ''
const solcVersion = '0.4.24'
const defaultFromAddress = '0x5409ed021d9299bf6814279a6a1411a7e866a631'
const isVerbose = true
const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion)
const provider = new Web3ProviderEngine()
if (process.env.SOLIDITY_COVERAGE === 'true') {
global.coverageSubprovider = new CoverageSubprovider(artifactAdapter, defaultFromAddress, {
isVerbose,
ignoreFilesGlobs: ['**/Migrations.sol', '**/node_modules/**', '**/mocks/**', '**/interfaces/**']
})
provider.addProvider(global.coverageSubprovider)
const ganacheSubprovider = new GanacheSubprovider({
default_balance_ether: '1000000000000000000000000',
total_accounts: 10,
port: 8545
})
provider.addProvider(ganacheSubprovider)
provider.start(err => {
if (err !== undefined) {
process.exit(1)
const defaultFromAddress = getFirstAddress();
const isVerbose = true;
const coverageSubproviderConfig = {
isVerbose,
ignoreFilesGlobs: [
"**/Migrations.sol",
"**/interfaces/**",
"**/mocks/**",
"**/node_modules/**",
"**/test/**",
"**/zeppelin/**",
],
};
const projectRoot = "";
const artifactAdapter = new TruffleArtifactAdapter(projectRoot, compilerConfig.solcVersion);
const provider = new ProviderEngine();
let kovanProvider;
let rinkebyProvider;
let ropstenProvider;
switch (process.env.MODE) {
case "profile":
global.profilerSubprovider = new ProfilerSubprovider(artifactAdapter, defaultFromAddress, isVerbose);
global.profilerSubprovider.stop();
provider.addProvider(global.profilerSubprovider);
break;
case "coverage":
global.coverageSubprovider = new CoverageSubprovider(
artifactAdapter,
defaultFromAddress,
const ProviderEngine = require("web3-provider-engine");
const WebsocketSubprovider = require("web3-provider-engine/subproviders/websocket.js")
const { TruffleArtifactAdapter } = require("@0x/sol-trace");
const { ProfilerSubprovider } = require("@0x/sol-profiler");
const { CoverageSubprovider } = require("@0x/sol-coverage");
const { RevertTraceSubprovider } = require("@0x/sol-trace");
const mode = process.env.MODE;
const projectRoot = "";
const solcVersion = "0.5.0";
const defaultFromAddress = "0x5409ed021d9299bf6814279a6a1411a7e866a631";
const isVerbose = true;
const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion);
const provider = new ProviderEngine();
if (mode === "profile") {
global.profilerSubprovider = new ProfilerSubprovider(
artifactAdapter,
defaultFromAddress,
isVerbose
);
global.profilerSubprovider.stop();
provider.addProvider(global.profilerSubprovider);
provider.addProvider(new WebsocketSubprovider({ rpcUrl: "http://localhost:8545" }));
} else {
if (mode === "coverage") {
global.coverageSubprovider = new CoverageSubprovider(
artifactAdapter,
defaultFromAddress,
`https://${network}.infura.io/v3/` + process.env.INFURA_API_KEY,
);
};
}
let rinkebyProvider = {};
let mainnetProvider = {};
let ropstenProvider = {};
const projectRoot = '';
const isVerbose = true;
const coverageSubproviderConfig = {
isVerbose,
ignoreFilesGlobs: ['**/Migrations.sol', '**/node_modules/**', '**/interfaces/**', '**/test/**'],
};
const artifactAdapter = new TruffleArtifactAdapter(projectRoot, compilerConfig.solcVersion);
const engine = new ProviderEngine();
let defaultFromAddress;
const testModes = ['profile', 'coverage', 'trace'];
if (testModes.includes(process.env.MODE)) {
defaultFromAddress = getFirstAddress();
}
switch (process.env.MODE) {
case 'profile':
global.profilerSubprovider = new ProfilerSubprovider(artifactAdapter, defaultFromAddress, isVerbose);
engine.addProvider(global.profilerSubprovider);
break;
case 'coverage':
global.coverageSubprovider = new CoverageSubprovider(artifactAdapter, defaultFromAddress, coverageSubproviderConfig);
engine.addProvider(global.coverageSubprovider);