How to use the @0x/sol-trace.TruffleArtifactAdapter function in @0x/sol-trace

To help you get started, we’ve selected a few @0x/sol-trace 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 celo-org / celo-monorepo / packages / protocol / truffle-config.js View on Github external
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(
github poanetwork / tokenbridge-contracts / truffle-config.js View on Github external
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)
github sablierhq / sablier / packages / protocol / truffle-config.js View on Github external
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,
github 0xProject / dev-tools-truffle-example / truffle-config.js View on Github external
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,
github AztecProtocol / AZTEC / packages / protocol / truffle-config.js View on Github external
`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);

@0x/sol-trace

Prints stack trace on Solidity revert

Apache-2.0
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis

Similar packages