aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/asset-buyer/src/asset_buyer.ts1
-rw-r--r--packages/devnet/docker-compose.yml8
-rwxr-xr-xpackages/devnet/run.sh1
-rw-r--r--packages/instant/README.md6
-rw-r--r--packages/instant/package.json8
-rw-r--r--packages/instant/src/components/erc20_asset_amount_input.tsx2
-rw-r--r--packages/instant/webpack.config.js25
-rw-r--r--packages/sol-coverage/src/coverage_subprovider.ts4
-rw-r--r--packages/sol-profiler/CHANGELOG.json9
-rw-r--r--packages/sol-trace/CHANGELOG.json9
-rw-r--r--packages/sol-trace/package.json1
-rw-r--r--packages/sol-trace/src/revert_trace_subprovider.ts17
-rw-r--r--packages/sol-tracing-utils/CHANGELOG.json29
-rw-r--r--packages/sol-tracing-utils/package.json2
-rw-r--r--packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts19
-rw-r--r--packages/sol-tracing-utils/src/ast_visitor.ts4
-rw-r--r--packages/sol-tracing-utils/src/collect_coverage_entries.ts14
-rw-r--r--packages/sol-tracing-utils/src/trace_collector.ts17
-rw-r--r--packages/sol-tracing-utils/src/utils.ts34
-rw-r--r--packages/sol-tracing-utils/test/collect_coverage_entries_test.ts3
-rw-r--r--packages/website/public/images/team/marcs.jpgbin0 -> 40348 bytes
-rw-r--r--packages/website/public/index.html1
-rw-r--r--packages/website/ts/pages/about/team.tsx5
-rw-r--r--packages/website/ts/pages/documentation/docs_home.tsx77
-rw-r--r--packages/website/ts/pages/why.tsx4
-rw-r--r--packages/website/ts/types.ts5
26 files changed, 239 insertions, 66 deletions
diff --git a/packages/asset-buyer/src/asset_buyer.ts b/packages/asset-buyer/src/asset_buyer.ts
index ad4b3bb60..b22b1a122 100644
--- a/packages/asset-buyer/src/asset_buyer.ts
+++ b/packages/asset-buyer/src/asset_buyer.ts
@@ -193,6 +193,7 @@ export class AssetBuyer {
): Promise<LiquidityForAssetData> {
const shouldForceOrderRefresh =
options.shouldForceOrderRefresh !== undefined ? options.shouldForceOrderRefresh : false;
+ assert.isString('assetData', assetData);
assetDataUtils.decodeAssetDataOrThrow(assetData);
assert.isBoolean('options.shouldForceOrderRefresh', shouldForceOrderRefresh);
diff --git a/packages/devnet/docker-compose.yml b/packages/devnet/docker-compose.yml
new file mode 100644
index 000000000..1c1e7ca75
--- /dev/null
+++ b/packages/devnet/docker-compose.yml
@@ -0,0 +1,8 @@
+version: '3'
+services:
+ devnet:
+ image: 0x-devnet:latest
+ build:
+ context: .
+ ports:
+ - 8501:8501
diff --git a/packages/devnet/run.sh b/packages/devnet/run.sh
index dea243396..6000813f0 100755
--- a/packages/devnet/run.sh
+++ b/packages/devnet/run.sh
@@ -15,6 +15,7 @@ mkdir -p /var/log
--rpc \
--rpcaddr '0.0.0.0' \
--rpcport 8501 \
+ --rpcvhosts '*' \
--rpcapi 'personal,db,eth,net,web3,txpool,miner,debug' \
--networkid 50 \
--gasprice '2000000000' \
diff --git a/packages/instant/README.md b/packages/instant/README.md
index 8832e562d..f09c4776c 100644
--- a/packages/instant/README.md
+++ b/packages/instant/README.md
@@ -8,11 +8,11 @@ Check out a live sample integration [here](https://www.rexrelay.com/instant).
## Installation
-The package is available as a UMD module named `zeroExInstant` at https://instant.0xproject.com/instant.js.
+The package is available as a UMD module named `zeroExInstant` at https://instant.0x.org/instant.js.
```html
<head>
- <script type="text/javascript" src="https://instant.0xproject.com/instant.js" charset="utf-8"></script>
+ <script type="text/javascript" src="https://instant.0x.org/instant.js" charset="utf-8"></script>
</head>
<body>
<div id="zeroExInstantContainer"></div>
@@ -47,7 +47,7 @@ To build and deploy to this bundle, run
yarn deploy_staging
```
-Finally, we have our live production bundle that is only meant to be updated with stable, polished releases: https://instant.0xproject.com/instant.js
+Finally, we have our live production bundle that is only meant to be updated with stable, polished releases: https://instant.0x.org/instant.js
To build and deploy to this bundle, run
diff --git a/packages/instant/package.json b/packages/instant/package.json
index 86fac9afe..f7e15a3e0 100644
--- a/packages/instant/package.json
+++ b/packages/instant/package.json
@@ -9,6 +9,7 @@
"main": "umd/instant.js",
"scripts": {
"build": "webpack --mode production",
+ "build:dev": "webpack --mode development",
"build:ci": "yarn build",
"dev": "dotenv webpack-dev-server -- --mode development",
"lint": "tslint --format stylish --project .",
@@ -50,6 +51,7 @@
"@0x/typescript-typings": "^3.0.8",
"@0x/utils": "^3.0.1",
"@0x/web3-wrapper": "^3.2.4",
+ "babel-runtime": "^6.26.0",
"bowser": "^1.9.4",
"copy-to-clipboard": "^3.0.8",
"ethereum-types": "^1.1.6",
@@ -78,6 +80,12 @@
"@types/redux": "^3.6.0",
"@types/styled-components": "4.0.1",
"awesome-typescript-loader": "^5.2.1",
+ "babel-loader": "^7.1.5",
+ "babel-preset-env": "^1.7.0",
+ "babel-plugin-transform-runtime": "^6.23.0",
+ "babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
+ "babel-plugin-transform-es3-property-literals": "^6.22.0",
+ "babel-plugin-transform-object-assign": "^6.22.0",
"dotenv-cli": "^1.4.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx
index 0418f9165..7e09f777a 100644
--- a/packages/instant/src/components/erc20_asset_amount_input.tsx
+++ b/packages/instant/src/components/erc20_asset_amount_input.tsx
@@ -95,7 +95,7 @@ export class ERC20AssetAmountInput extends React.PureComponent<ERC20AssetAmountI
if (_.isUndefined(numberOfAssetsAvailable)) {
text = 'Loading...';
} else if (numberOfAssetsAvailable === 0) {
- text = 'Assets Unavailable';
+ text = 'Tokens Unavailable';
}
return (
<Flex>
diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js
index e74cf36d9..13d574de4 100644
--- a/packages/instant/webpack.config.js
+++ b/packages/instant/webpack.config.js
@@ -141,12 +141,25 @@ const generateConfig = (dischargeTarget, heapConfigOptions, rollbarConfigOptions
},
{
test: /\.js$/,
- loader: 'source-map-loader',
- exclude: [
- // instead of /\/node_modules\//
- path.join(process.cwd(), 'node_modules'),
- path.join(process.cwd(), '../..', 'node_modules'),
- ],
+ use: [{
+ loader: 'babel-loader',
+ options: {
+ "plugins": ["transform-runtime"],
+ 'presets': [
+ ['env', {
+ 'targets': {
+ "chrome": 41
+ },
+ }],
+ ],
+ },
+ }, {
+ loader: 'source-map-loader',
+ }],
+ exclude: function(modulePath) {
+ return /node_modules/.test(modulePath) &&
+ /node_modules\/(core-js|lodash|react|websocket)/.test(modulePath);
+ },
},
],
},
diff --git a/packages/sol-coverage/src/coverage_subprovider.ts b/packages/sol-coverage/src/coverage_subprovider.ts
index d03963ed6..2d92b25ca 100644
--- a/packages/sol-coverage/src/coverage_subprovider.ts
+++ b/packages/sol-coverage/src/coverage_subprovider.ts
@@ -50,6 +50,8 @@ export class CoverageSubprovider extends TraceInfoSubprovider {
}
}
+const IGNORE_REGEXP = /\/\*\s*solcov\s+ignore\s+next\s*\*\/\s*/gm;
+
/**
* Computed partial coverage for a single file & subtrace.
* @param contractData Contract metadata (source, srcMap, bytecode)
@@ -65,7 +67,7 @@ export const coverageHandler: SingleFileSubtraceHandler = (
fileIndex: number,
): Coverage => {
const absoluteFileName = contractData.sources[fileIndex];
- const coverageEntriesDescription = collectCoverageEntries(contractData.sourceCodes[fileIndex]);
+ const coverageEntriesDescription = collectCoverageEntries(contractData.sourceCodes[fileIndex], IGNORE_REGEXP);
// if the source wasn't provided for the fileIndex, we can't cover the file
if (_.isUndefined(coverageEntriesDescription)) {
diff --git a/packages/sol-profiler/CHANGELOG.json b/packages/sol-profiler/CHANGELOG.json
index 550ca2feb..fc928b516 100644
--- a/packages/sol-profiler/CHANGELOG.json
+++ b/packages/sol-profiler/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "2.0.1",
+ "changes": [
+ {
+ "note": "Fix a bug when some parts of the profiling report were missing because of the coverage ignore lines",
+ "pr": 1535
+ }
+ ]
+ },
+ {
"version": "2.0.0",
"changes": [
{
diff --git a/packages/sol-trace/CHANGELOG.json b/packages/sol-trace/CHANGELOG.json
index 550ca2feb..b633b3d21 100644
--- a/packages/sol-trace/CHANGELOG.json
+++ b/packages/sol-trace/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "2.0.1",
+ "changes": [
+ {
+ "note": "Improve error messages when unable to find matching bytecode",
+ "pr": 1558
+ }
+ ]
+ },
+ {
"version": "2.0.0",
"changes": [
{
diff --git a/packages/sol-trace/package.json b/packages/sol-trace/package.json
index 2aedf7ebc..25e81a82a 100644
--- a/packages/sol-trace/package.json
+++ b/packages/sol-trace/package.json
@@ -32,6 +32,7 @@
"@0x/sol-tracing-utils": "^4.0.1",
"@0x/subproviders": "^2.1.11",
"@0x/typescript-typings": "^3.0.8",
+ "chalk": "^2.3.0",
"ethereum-types": "^1.1.6",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.5",
diff --git a/packages/sol-trace/src/revert_trace_subprovider.ts b/packages/sol-trace/src/revert_trace_subprovider.ts
index 046dad812..ea2b684a5 100644
--- a/packages/sol-trace/src/revert_trace_subprovider.ts
+++ b/packages/sol-trace/src/revert_trace_subprovider.ts
@@ -11,6 +11,7 @@ import {
TraceCollectionSubprovider,
utils,
} from '@0x/sol-tracing-utils';
+import chalk from 'chalk';
import { stripHexPrefix } from 'ethereumjs-util';
import * as _ from 'lodash';
import { getLogger, levels, Logger } from 'loglevel';
@@ -71,9 +72,21 @@ export class RevertTraceSubprovider extends TraceCollectionSubprovider {
const bytecode = await this._web3Wrapper.getContractCodeAsync(evmCallStackEntry.address);
const contractData = utils.getContractDataIfExists(this._contractsData, bytecode);
if (_.isUndefined(contractData)) {
+ const shortenHex = (hex: string) => {
+ /**
+ * Length choosen so that both error messages are of the same length
+ * and it's enough data to figure out which artifact has a problem.
+ */
+ const length = 18;
+ return `${hex.substr(0, length + 2)}...${hex.substr(hex.length - length, length)}`;
+ };
const errMsg = isContractCreation
- ? `Unknown contract creation transaction`
- : `Transaction to an unknown address: ${evmCallStackEntry.address}`;
+ ? `Unable to find matching bytecode for contract creation ${chalk.bold(
+ shortenHex(bytecode),
+ )}, please check your artifacts. Ignoring...`
+ : `Unable to find matching bytecode for contract address ${chalk.bold(
+ evmCallStackEntry.address,
+ )}, please check your artifacts. Ignoring...`;
this._logger.warn(errMsg);
continue;
}
diff --git a/packages/sol-tracing-utils/CHANGELOG.json b/packages/sol-tracing-utils/CHANGELOG.json
index ef96dc69b..89a5b6876 100644
--- a/packages/sol-tracing-utils/CHANGELOG.json
+++ b/packages/sol-tracing-utils/CHANGELOG.json
@@ -1,5 +1,34 @@
[
{
+ "version": "6.0.0",
+ "changes": [
+ {
+ "note": "`SolCompilerArtifactAdapter` now uses `SolResolver` under the hood which allows to resolve `NPM` dependencies properly",
+ "pr": 1535
+ },
+ {
+ "note": "Cache the `utils.getContractDataIfExists` leading to faster execution",
+ "pr": 1535
+ },
+ {
+ "note": "`SolCompilerArtifactAdapter` now doesn't return the `ContractData` for interfaces",
+ "pr": 1535
+ },
+ {
+ "note": "Print resasonable error message on bytecode collision",
+ "pr": 1535
+ },
+ {
+ "note": "Fix the bug in `ASTVisitor` causing the 'cannot read property `range` of `null`' error",
+ "pr": 1557
+ },
+ {
+ "note": "Improve error messages when unable to find matching bytecode",
+ "pr": 1558
+ }
+ ]
+ },
+ {
"version": "5.0.0",
"changes": [
{
diff --git a/packages/sol-tracing-utils/package.json b/packages/sol-tracing-utils/package.json
index cabb752d2..929c73b84 100644
--- a/packages/sol-tracing-utils/package.json
+++ b/packages/sol-tracing-utils/package.json
@@ -44,6 +44,7 @@
"dependencies": {
"@0x/dev-utils": "^1.0.24",
"@0x/sol-compiler": "^2.0.2",
+ "@0x/sol-resolver": "^1.2.3",
"@0x/subproviders": "^2.1.11",
"@0x/typescript-typings": "^3.0.8",
"@0x/utils": "^3.0.1",
@@ -52,6 +53,7 @@
"ethereum-types": "^1.1.6",
"ethereumjs-util": "^5.1.1",
"glob": "^7.1.2",
+ "chalk": "^2.3.0",
"istanbul": "^0.4.5",
"lodash": "^4.17.5",
"loglevel": "^1.6.1",
diff --git a/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts
index d52587f2c..bfd3a504a 100644
--- a/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts
+++ b/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts
@@ -1,3 +1,4 @@
+import { FallthroughResolver, FSResolver, NPMResolver, RelativeFSResolver, URLResolver } from '@0x/sol-resolver';
import { logUtils } from '@0x/utils';
import { CompilerOptions, ContractArtifact } from 'ethereum-types';
import * as fs from 'fs';
@@ -14,6 +15,7 @@ const CONFIG_FILE = 'compiler.json';
export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
private readonly _artifactsPath: string;
private readonly _sourcesPath: string;
+ private readonly _resolver: FallthroughResolver;
/**
* Instantiates a SolCompilerArtifactAdapter
* @param artifactsPath Path to your artifacts directory
@@ -32,6 +34,12 @@ export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
throw new Error(`contractsDir not found in ${CONFIG_FILE}`);
}
this._sourcesPath = (sourcesPath || config.contractsDir) as string;
+ this._resolver = new FallthroughResolver();
+ this._resolver.appendResolver(new URLResolver());
+ const packagePath = path.resolve('');
+ this._resolver.appendResolver(new NPMResolver(packagePath));
+ this._resolver.appendResolver(new RelativeFSResolver(this._sourcesPath));
+ this._resolver.appendResolver(new FSResolver());
}
public async collectContractsDataAsync(): Promise<ContractData[]> {
const artifactsGlob = `${this._artifactsPath}/**/*.json`;
@@ -46,10 +54,9 @@ export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
const sources: Sources = {};
const sourceCodes: SourceCodes = {};
_.map(artifact.sources, (value: { id: number }, relativeFilePath: string) => {
- const filePath = path.resolve(this._sourcesPath, relativeFilePath);
- const fileContent = fs.readFileSync(filePath).toString();
- sources[value.id] = filePath;
- sourceCodes[value.id] = fileContent;
+ const source = this._resolver.resolve(relativeFilePath);
+ sources[value.id] = source.absolutePath;
+ sourceCodes[value.id] = source.source;
});
const contractData = {
sourceCodes,
@@ -59,6 +66,10 @@ export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
runtimeBytecode: artifact.compilerOutput.evm.deployedBytecode.object,
sourceMapRuntime: artifact.compilerOutput.evm.deployedBytecode.sourceMap,
};
+ const isInterfaceContract = contractData.bytecode === '0x' && contractData.runtimeBytecode === '0x';
+ if (isInterfaceContract) {
+ continue;
+ }
contractsData.push(contractData);
}
return contractsData;
diff --git a/packages/sol-tracing-utils/src/ast_visitor.ts b/packages/sol-tracing-utils/src/ast_visitor.ts
index 1ac9cd1de..27f19378b 100644
--- a/packages/sol-tracing-utils/src/ast_visitor.ts
+++ b/packages/sol-tracing-utils/src/ast_visitor.ts
@@ -89,7 +89,9 @@ export class ASTVisitor {
this._visitStatement(ast);
}
public ExpressionStatement(ast: Parser.ExpressionStatement): void {
- this._visitStatement(ast.expression);
+ if (!_.isNull(ast.expression)) {
+ this._visitStatement(ast.expression);
+ }
}
public InlineAssemblyStatement(ast: Parser.InlineAssemblyStatement): void {
this._visitStatement(ast);
diff --git a/packages/sol-tracing-utils/src/collect_coverage_entries.ts b/packages/sol-tracing-utils/src/collect_coverage_entries.ts
index 9e3591d74..d5045b106 100644
--- a/packages/sol-tracing-utils/src/collect_coverage_entries.ts
+++ b/packages/sol-tracing-utils/src/collect_coverage_entries.ts
@@ -5,18 +5,18 @@ import * as parser from 'solidity-parser-antlr';
import { ASTVisitor, CoverageEntriesDescription } from './ast_visitor';
import { getOffsetToLocation } from './source_maps';
-const IGNORE_RE = /\/\*\s*solcov\s+ignore\s+next\s*\*\/\s*/gm;
-
// Parsing source code for each transaction/code is slow and therefore we cache it
const sourceHashToCoverageEntries: { [sourceHash: string]: CoverageEntriesDescription } = {};
-export const collectCoverageEntries = (contractSource: string) => {
+export const collectCoverageEntries = (contractSource: string, ignoreRegexp?: RegExp) => {
const sourceHash = ethUtil.sha3(contractSource).toString('hex');
if (_.isUndefined(sourceHashToCoverageEntries[sourceHash]) && !_.isUndefined(contractSource)) {
const ast = parser.parse(contractSource, { range: true });
const offsetToLocation = getOffsetToLocation(contractSource);
- const ignoreRangesBegingingAt = gatherRangesToIgnore(contractSource);
- const visitor = new ASTVisitor(offsetToLocation, ignoreRangesBegingingAt);
+ const ignoreRangesBeginningAt = _.isUndefined(ignoreRegexp)
+ ? []
+ : gatherRangesToIgnore(contractSource, ignoreRegexp);
+ const visitor = new ASTVisitor(offsetToLocation, ignoreRangesBeginningAt);
parser.visit(ast, visitor);
sourceHashToCoverageEntries[sourceHash] = visitor.getCollectedCoverageEntries();
}
@@ -25,12 +25,12 @@ export const collectCoverageEntries = (contractSource: string) => {
};
// Gather the start index of all code blocks preceeded by "/* solcov ignore next */"
-function gatherRangesToIgnore(contractSource: string): number[] {
+function gatherRangesToIgnore(contractSource: string, ignoreRegexp: RegExp): number[] {
const ignoreRangesStart = [];
let match;
do {
- match = IGNORE_RE.exec(contractSource);
+ match = ignoreRegexp.exec(contractSource);
if (match) {
const matchLen = match[0].length;
ignoreRangesStart.push(match.index + matchLen);
diff --git a/packages/sol-tracing-utils/src/trace_collector.ts b/packages/sol-tracing-utils/src/trace_collector.ts
index f5dde8762..2a1f15b83 100644
--- a/packages/sol-tracing-utils/src/trace_collector.ts
+++ b/packages/sol-tracing-utils/src/trace_collector.ts
@@ -1,4 +1,5 @@
import { promisify } from '@0x/utils';
+import chalk from 'chalk';
import { stripHexPrefix } from 'ethereumjs-util';
import * as fs from 'fs';
import { Collector } from 'istanbul';
@@ -71,9 +72,21 @@ export class TraceCollector {
: (traceInfo as TraceInfoExistingContract).runtimeBytecode;
const contractData = utils.getContractDataIfExists(this._contractsData, bytecode);
if (_.isUndefined(contractData)) {
+ const shortenHex = (hex: string) => {
+ /**
+ * Length chooses so that both error messages are of the same length
+ * and it's enough data to figure out which artifact has a problem.
+ */
+ const length = 18;
+ return `${hex.substr(0, length + 2)}...${hex.substr(hex.length - length, length)}`;
+ };
const errMsg = isContractCreation
- ? `Unknown contract creation transaction`
- : `Transaction to an unknown address: ${traceInfo.address}`;
+ ? `Unable to find matching bytecode for contract creation ${chalk.bold(
+ shortenHex(bytecode),
+ )}, please check your artifacts. Ignoring...`
+ : `Unable to find matching bytecode for contract address ${chalk.bold(
+ traceInfo.address,
+ )}, please check your artifacts. Ignoring...`;
this._logger.warn(errMsg);
return;
}
diff --git a/packages/sol-tracing-utils/src/utils.ts b/packages/sol-tracing-utils/src/utils.ts
index 89c158ee7..7dc1844a5 100644
--- a/packages/sol-tracing-utils/src/utils.ts
+++ b/packages/sol-tracing-utils/src/utils.ts
@@ -1,15 +1,14 @@
-import { addressUtils, BigNumber } from '@0x/utils';
+import { addressUtils, BigNumber, logUtils } from '@0x/utils';
import { OpCode, StructLog } from 'ethereum-types';
import { addHexPrefix } from 'ethereumjs-util';
import * as _ from 'lodash';
import { ContractData, LineColumn, SingleFileSourceRange } from './types';
-// This is the minimum length of valid contract bytecode. The Solidity compiler
-// metadata is 86 bytes. If you add the '0x' prefix, we get 88.
-const MIN_CONTRACT_BYTECODE_LENGTH = 88;
const STATICCALL_GAS_COST = 40;
+const bytecodeToContractDataIfExists: { [bytecode: string]: ContractData | undefined } = {};
+
export const utils = {
compareLineColumn(lhs: LineColumn, rhs: LineColumn): number {
return lhs.line !== rhs.line ? lhs.line - rhs.line : lhs.column - rhs.column;
@@ -47,22 +46,29 @@ export const utils = {
if (!bytecode.startsWith('0x')) {
throw new Error(`0x hex prefix missing: ${bytecode}`);
}
- const contractData = _.find(contractsData, contractDataCandidate => {
+ // HACK(leo): We want to cache the values that are possibly undefined.
+ // That's why we can't check for undefined as we usually do, but need to use `hasOwnProperty`.
+ if (bytecodeToContractDataIfExists.hasOwnProperty(bytecode)) {
+ return bytecodeToContractDataIfExists[bytecode];
+ }
+ const contractDataCandidates = _.filter(contractsData, contractDataCandidate => {
const bytecodeRegex = utils.bytecodeToBytecodeRegex(contractDataCandidate.bytecode);
- // If the bytecode is less than the minimum length, we are probably
- // dealing with an interface. This isn't what we're looking for.
- if (bytecodeRegex.length < MIN_CONTRACT_BYTECODE_LENGTH) {
- return false;
- }
const runtimeBytecodeRegex = utils.bytecodeToBytecodeRegex(contractDataCandidate.runtimeBytecode);
- if (runtimeBytecodeRegex.length < MIN_CONTRACT_BYTECODE_LENGTH) {
- return false;
- }
// We use that function to find by bytecode or runtimeBytecode. Those are quasi-random strings so
// collisions are practically impossible and it allows us to reuse that code
return !_.isNull(bytecode.match(bytecodeRegex)) || !_.isNull(bytecode.match(runtimeBytecodeRegex));
});
- return contractData;
+ if (contractDataCandidates.length > 1) {
+ const candidates = contractDataCandidates.map(
+ contractDataCandidate => _.values(contractDataCandidate.sources)[0],
+ );
+ const errMsg =
+ "We've found more than one artifact that contains the exact same bytecode and therefore are unable to detect which contract was executed. " +
+ "We'll be assigning all traces to the first one.";
+ logUtils.warn(errMsg);
+ logUtils.warn(candidates);
+ }
+ return (bytecodeToContractDataIfExists[bytecode] = contractDataCandidates[0]);
},
isCallLike(op: OpCode): boolean {
return _.includes([OpCode.CallCode, OpCode.StaticCall, OpCode.Call, OpCode.DelegateCall], op);
diff --git a/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts b/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts
index 7832ec316..d3ca8930c 100644
--- a/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts
+++ b/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts
@@ -130,7 +130,8 @@ describe('Collect coverage entries', () => {
solcovIgnoreContractBaseName,
);
const solcovIgnoreContract = fs.readFileSync(solcovIgnoreContractFileName).toString();
- const coverageEntries = collectCoverageEntries(solcovIgnoreContract);
+ const IGNORE_REGEXP = /\/\*\s*solcov\s+ignore\s+next\s*\*\/\s*/gm;
+ const coverageEntries = collectCoverageEntries(solcovIgnoreContract, IGNORE_REGEXP);
const fnIds = _.keys(coverageEntries.fnMap);
expect(fnIds.length).to.be.equal(1);
diff --git a/packages/website/public/images/team/marcs.jpg b/packages/website/public/images/team/marcs.jpg
new file mode 100644
index 000000000..fefc24156
--- /dev/null
+++ b/packages/website/public/images/team/marcs.jpg
Binary files differ
diff --git a/packages/website/public/index.html b/packages/website/public/index.html
index 738b675e7..dd17beebc 100644
--- a/packages/website/public/index.html
+++ b/packages/website/public/index.html
@@ -11,6 +11,7 @@
content="An Open Protocol For Decentralized Exchange On The Ethereum Blockchain"
/>
<meta property="og:image" content="/images/og_image.png" />
+ <meta name="google-site-verification" content="0wu9KbpKgGXUhUboLQw-MGtAHJHQ67rMFQN8KrX5I1s" />
<title>0x: The Protocol for Trading Tokens</title>
<link rel="icon" type="image/png" href="/images/favicon/favicon-2-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="/images/favicon/favicon-2-16x16.png" sizes="16x16" />
diff --git a/packages/website/ts/pages/about/team.tsx b/packages/website/ts/pages/about/team.tsx
index 466ba9f43..808fea049 100644
--- a/packages/website/ts/pages/about/team.tsx
+++ b/packages/website/ts/pages/about/team.tsx
@@ -152,6 +152,11 @@ const team: TeamMember[] = [
name: 'Brent Oshiro',
title: 'community engagement lead',
},
+ {
+ imageUrl: '/images/team/marcs.jpg',
+ name: 'Marc Savino',
+ title: 'technical sourcer',
+ },
];
const advisors: TeamMember[] = [
diff --git a/packages/website/ts/pages/documentation/docs_home.tsx b/packages/website/ts/pages/documentation/docs_home.tsx
index d11cf02fb..5849a2a03 100644
--- a/packages/website/ts/pages/documentation/docs_home.tsx
+++ b/packages/website/ts/pages/documentation/docs_home.tsx
@@ -55,7 +55,7 @@ const TUTORIALS: TutorialInfo[] = [
];
const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = {
- [Categories.ZeroExProtocol]: [
+ [Categories.ZeroExProtocolTypescript]: [
{
description:
'A library for interacting with the 0x protocol. It is a high level package which combines a number of smaller specific-purpose packages such as [order-utils](https://0x.org/docs/order-utils) and [contract-wrappers](https://0x.org/docs/contract-wrappers).',
@@ -92,23 +92,6 @@ const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = {
},
{
description:
- "A Python library for interacting with 0x orders. Generate an orderHash, sign an order, validate it's signature and more.",
- link: {
- title: '0x-order-utils.py',
- to: 'http://0x-order-utils-py.s3-website-us-east-1.amazonaws.com/',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: 'A Python Standard Relayer API client',
- link: {
- title: '0x-sra-client.py',
- to: 'https://pypi.org/project/0x-sra-client/',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
'An http & websocket client for interacting with relayers that have implemented the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api)',
link: {
title: '@0x/connect',
@@ -190,6 +173,57 @@ const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = {
},
},
],
+ [Categories.ZeroExProtocolPython]: [
+ {
+ description:
+ "A library for interacting with 0x orders. Generate an orderHash, sign an order, validate it's signature and more.",
+ link: {
+ title: '0x-order-utils',
+ to: 'https://pypi.org/project/0x-order-utils/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'A Standard Relayer API client',
+ link: {
+ title: '0x-sra-client',
+ to: 'https://pypi.org/project/0x-sra-client/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'Package containing the addresses at which the 0x smart contracts have been deployed',
+ link: {
+ title: '0x-contract-addresses',
+ to: 'https://pypi.org/project/0x-contract-addresses/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'Package containing the 0x smart contract compilation artifacts',
+ link: {
+ title: '0x-contract-artifacts',
+ to: 'https://pypi.org/project/0x-contract-artifacts/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: '0x JSON schemas for those developing on top of 0x protocol',
+ link: {
+ title: '0x-json-schemas',
+ to: 'https://pypi.org/project/0x-json-schemas/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'Demo project showing how to interact with the 0x smart contracts using Python',
+ link: {
+ title: '0x-contract-demo',
+ to: 'https://github.com/0xProject/0x-monorepo/blob/development/python-packages/contract_demo/README.md',
+ shouldOpenInNewTab: true,
+ },
+ },
+ ],
[Categories.Ethereum]: [
{
description:
@@ -409,7 +443,10 @@ export class DocsHome extends React.Component<DocsHomeProps, DocsHomeState> {
title: this.props.translate.get(tutorialInfo.link.title as Key, Deco.Cap),
};
}),
- [Categories.ZeroExProtocol]: _.map(CATEGORY_TO_PACKAGES[Categories.ZeroExProtocol], pkg => pkg.link),
+ [Categories.ZeroExProtocolTypescript]: _.map(
+ CATEGORY_TO_PACKAGES[Categories.ZeroExProtocolTypescript],
+ pkg => pkg.link,
+ ),
[Categories.Ethereum]: _.map(CATEGORY_TO_PACKAGES[Categories.Ethereum], pkg => pkg.link),
[Categories.CommunityMaintained]: _.map(
CATEGORY_TO_PACKAGES[Categories.CommunityMaintained],
@@ -466,4 +503,4 @@ export class DocsHome extends React.Component<DocsHomeProps, DocsHomeState> {
});
return menuItems;
}
-}
+} // tslint:disable:max-file-line-count
diff --git a/packages/website/ts/pages/why.tsx b/packages/website/ts/pages/why.tsx
index a0ed5f95a..48888d10a 100644
--- a/packages/website/ts/pages/why.tsx
+++ b/packages/website/ts/pages/why.tsx
@@ -102,7 +102,7 @@ export class NextWhy extends React.Component {
<DocumentTitle title="Features & Benefits - 0x" />
<Hero
title="The exchange layer for the crypto economy"
- description="The world's assets are becoming tokenized on public blockchains. 0x Protocol is free, open-source infrastracture that developers and businesses utilize to build products that enable the purchasing and trading of crypto tokens."
+ description="The world's assets are becoming tokenized on public blockchains. 0x Protocol is free, open-source infrastructure that developers and businesses utilize to build products that enable the purchasing and trading of crypto tokens."
actions={buildAction}
/>
@@ -110,7 +110,7 @@ export class NextWhy extends React.Component {
<Definition
title="Support for all Ethereum Standards"
titleSize="small"
- description="0x Protocol facitilites the decentralized exchange of a growing number of Ethereum-based tokens, including all ERC-20 and ERC-721 assets."
+ description="0x Protocol facilitates the decentralized exchange of a growing number of Ethereum-based tokens, including all ERC-20 and ERC-721 assets."
icon="supportForAllEthereumStandards"
iconSize="large"
isInline={true}
diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts
index 9492da5a5..081c6d014 100644
--- a/packages/website/ts/types.ts
+++ b/packages/website/ts/types.ts
@@ -655,8 +655,9 @@ export interface TutorialInfo {
}
export enum Categories {
- ZeroExProtocol = '0x Protocol',
- Ethereum = 'Ethereum',
+ ZeroExProtocolTypescript = '0x Protocol (Typescript/Javascript)',
+ ZeroExProtocolPython = '0x Protocol (Python)',
+ Ethereum = 'Ethereum (Typescript/Javascript)',
CommunityMaintained = 'Community Maintained',
}