From 1ae9f68db8c9768e68d1eab1f411b346e9512c1c Mon Sep 17 00:00:00 2001
From: August Skare
- Sol-trace is a subprovider that needs to be prepended to your provider engine.
- Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-trace
- ships with the
+ Configure via a Example of settings:
+
-
npm install @0x/sol-trace --save
- npm install @0x/sol-compiler --g
+
- {`import { SolCompilerArtifactAdapter } from '@0x/sol-trace';
+
- cd /your_project_dir && sol-compiler
+ mkdir compiler.json
+
+ {`{
+ "contractsDir": "contracts",
+ "artifactsDir": "artifacts",
+ "contracts": "*",
+ "compilerSettings": {
+ "optimizer": { "enabled": false },
+ "outputSelection": {
+ "*": {
+ "*": ["abi", "evm.bytecode.object"]
+ }
+ }
+ }
+}`}
+
+
+ {`{
+ ...
+ "compilerSettings": {
+ "outputSelection": {
+ "*": {
+ "*": ["abi"]
+ }
+ }
+ }
+ ...
+}`}
+
+
+ {`{
+ ...
+ "compilerSettings": {
+ "outputSelection": {
+ "*": {
+ "*": [
+ "abi",
+ "evm.bytecode.object",
+ "evm.bytecode.sourceMap",
+ "evm.deployedBytecode.object",
+ "evm.deployedBytecode.sourceMap"
+ ]
+ }
+ }
+ }
+ ...
+}`}
+
+
+ {`{
+ ...
+ "compilerOutput": {
+ "abi": [...],
+ "evm": {
+ "bytecode": {
+ "object": "0xdeadbeef",
+ "sourceMap": "26:480:..."
+ },
+ "deployedBytecode": {
+ "object": "0xdeadbeef",
+ "sourceMap": "26:480:0..."
+ }
+ }
+ }
+ "sources": {
+ "Migrations.sol": {
+ "id": 0
+ }
+ },
+ ...
+}`}
+
+ npm install @0x/sol-trace --save
+ npm install @0x/sol-cov --save
+
- Sol-trace is a subprovider that needs to be prepended to your provider engine.
- Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-trace
- ships with the
@@ -50,6 +60,25 @@ const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDi
Truffle
Custom
+ Now that we have an
+ {`import { ProviderEngine, RpcSubprovider } from 'web3-provider-engine';
+import { RevertTraceSubprovider } from '@0x/sol-cov';
+
+const defaultFromAddress = "..."; // Some ethereum address with test funds
+const revertTraceSubprovider = new RevertTraceSubprovider(artifactAdapter, defaultFromAddress);
+
+const providerEngine = new ProviderEngine();
+providerEngine.addProvider(revertTraceSubprovider);
+providerEngine.addProvider(new RpcSubprovider({rpcUrl: 'http://localhost:8545'}));
+providerEngine.start();`}
+
+ npm install @0x/sol-trace --save
+ npm install @0x/sol-trace --save
+
Sol-trace is a subprovider that needs to be prepended to your provider engine.
Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-trace
- ships with the
@@ -50,6 +60,25 @@ const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDi
Truffle
Custom
+ Now that we have an
+ {`import { ProviderEngine, RpcSubprovider } from 'web3-provider-engine';
+import { RevertTraceSubprovider } from '@0x/sol-cov';
+
+const defaultFromAddress = "..."; // Some ethereum address with test funds
+const revertTraceSubprovider = new RevertTraceSubprovider(artifactAdapter, defaultFromAddress);
+
+const providerEngine = new ProviderEngine();
+providerEngine.addProvider(revertTraceSubprovider);
+providerEngine.addProvider(new RpcSubprovider({rpcUrl: 'http://localhost:8545'}));
+providerEngine.start();`}
+
+ npm install @0x/sol-trace --save
+ npm install @0x/sol-trace --save
+
Sol-trace is a subprovider that needs to be prepended to your provider engine.
Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-trace
- ships with the
@@ -44,6 +54,25 @@ const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDi
Truffle
Custom
+ Now that we have an
+ {`import { ProviderEngine, RpcSubprovider } from 'web3-provider-engine';
+import { RevertTraceSubprovider } from '@0x/sol-cov';
+
+const defaultFromAddress = "..."; // Some ethereum address with test funds
+const revertTraceSubprovider = new RevertTraceSubprovider(artifactAdapter, defaultFromAddress);
+
+const providerEngine = new ProviderEngine();
+providerEngine.addProvider(revertTraceSubprovider);
+providerEngine.addProvider(new RpcSubprovider({rpcUrl: 'http://localhost:8545'}));
+providerEngine.start();`}
+
+