diff --git a/.circleci/config.yml b/.circleci/config.yml index a1fc7dc933..0aec168cfb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -202,7 +202,7 @@ jobs: steps: - checkout - run: sudo chown -R circleci:circleci /usr/local/bin - - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages + - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7 - restore_cache: key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - run: @@ -250,7 +250,7 @@ jobs: steps: - checkout - run: sudo chown -R circleci:circleci /usr/local/bin - - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages + - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7 - restore_cache: key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - run: @@ -278,7 +278,7 @@ jobs: steps: - checkout - run: sudo chown -R circleci:circleci /usr/local/bin - - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages + - run: sudo chown -R circleci:circleci /usr/local/lib/python3.7 - restore_cache: key: deps9-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - run: diff --git a/packages/instant/src/assets/icons/usdc.svg b/packages/instant/src/assets/icons/usdc.svg new file mode 100644 index 0000000000..a9201efb65 --- /dev/null +++ b/packages/instant/src/assets/icons/usdc.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index 0418f9165c..7e09f777a7 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 diff --git a/packages/instant/src/data/asset_data_network_mapping.ts b/packages/instant/src/data/asset_data_network_mapping.ts index 4fd0a25eda..77fe75adc9 100644 --- a/packages/instant/src/data/asset_data_network_mapping.ts +++ b/packages/instant/src/data/asset_data_network_mapping.ts @@ -63,4 +63,9 @@ export const assetDataNetworkMapping: AssetDataByNetwork[] = [ [Network.Kovan]: '0xf47261b00000000000000000000000008cb3971b8eb709c14616bd556ff6683019e90d9c', [Network.Mainnet]: '0xf47261b00000000000000000000000001985365e9f78359a9b6ad760e32412f4a445e862', }, + // USDC + { + [Network.Kovan]: '', + [Network.Mainnet]: '0xf47261b0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + }, ]; diff --git a/packages/instant/src/data/asset_meta_data_map.ts b/packages/instant/src/data/asset_meta_data_map.ts index 88611a8c07..a8cb349f06 100644 --- a/packages/instant/src/data/asset_meta_data_map.ts +++ b/packages/instant/src/data/asset_meta_data_map.ts @@ -199,4 +199,11 @@ export const assetMetaDataMap: ObjectMap = { symbol: 'dai', name: 'Dai Stablecoin', }, + '0xf47261b0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': { + assetProxyId: AssetProxyId.ERC20, + decimals: 6, + primaryColor: '#2775CA', + symbol: 'usdc', + name: 'USD Coin', + }, }; diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 64ae94b14c..ffda41e103 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -5,6 +5,18 @@ { "note": "Upgrade the bignumber.js to v8.0.2", "pr": 1517 + }, + { + "note": "Removed `owner` in Migrations", + "pr": 1533 + }, + { + "note": "`txDefaults` parameter now requires the `from` field", + "pr": 1533 + }, + { + "note": "Convert `from` to lower case when passed in via cli", + "pr": 1533 } ] }, diff --git a/packages/migrations/src/cli.ts b/packages/migrations/src/cli.ts index 2404e79217..4e8ce982fa 100644 --- a/packages/migrations/src/cli.ts +++ b/packages/migrations/src/cli.ts @@ -27,8 +27,9 @@ const args = yargs const provider = new Web3ProviderEngine(); provider.addProvider(rpcSubprovider); provider.start(); + const normalizedFromAddress = (args.from as string).toLowerCase(); const txDefaults = { - from: args.from, + from: normalizedFromAddress, }; await runMigrationsAsync(provider, txDefaults); process.exit(0); diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts index e0f2450173..7668ec9238 100644 --- a/packages/migrations/src/migration.ts +++ b/packages/migrations/src/migration.ts @@ -16,10 +16,8 @@ import { erc20TokenInfo, erc721TokenInfo } from './utils/token_info'; * @param txDefaults Default transaction values to use when deploying contracts (e.g., specify the desired contract creator with the `from` parameter). * @returns The addresses of the contracts that were deployed. */ -export async function runMigrationsAsync(provider: Provider, txDefaults: Partial): Promise { +export async function runMigrationsAsync(provider: Provider, txDefaults: TxData): Promise { const web3Wrapper = new Web3Wrapper(provider); - const accounts: string[] = await web3Wrapper.getAvailableAddressesAsync(); - const owner = accounts[0]; // Proxies const erc20Proxy = await wrappers.ERC20ProxyContract.deployFrom0xArtifactAsync( @@ -84,48 +82,38 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial ); await web3Wrapper.awaitTransactionSuccessAsync( - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { - from: owner, - }), + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, txDefaults), ); await web3Wrapper.awaitTransactionSuccessAsync( - await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { - from: owner, - }), + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, txDefaults), ); await web3Wrapper.awaitTransactionSuccessAsync( - await multiAssetProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { - from: owner, - }), + await multiAssetProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, txDefaults), ); // MultiAssetProxy await web3Wrapper.awaitTransactionSuccessAsync( - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { - from: owner, - }), + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, txDefaults), ); await web3Wrapper.awaitTransactionSuccessAsync( - await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { - from: owner, - }), + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, txDefaults), ); await web3Wrapper.awaitTransactionSuccessAsync( - await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address), + await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, txDefaults), ); await web3Wrapper.awaitTransactionSuccessAsync( - await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address), + await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address, txDefaults), ); // Register the Asset Proxies to the Exchange await web3Wrapper.awaitTransactionSuccessAsync( - await exchange.registerAssetProxy.sendTransactionAsync(erc20Proxy.address), + await exchange.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, txDefaults), ); await web3Wrapper.awaitTransactionSuccessAsync( - await exchange.registerAssetProxy.sendTransactionAsync(erc721Proxy.address), + await exchange.registerAssetProxy.sendTransactionAsync(erc721Proxy.address, txDefaults), ); await web3Wrapper.awaitTransactionSuccessAsync( - await exchange.registerAssetProxy.sendTransactionAsync(multiAssetProxy.address), + await exchange.registerAssetProxy.sendTransactionAsync(multiAssetProxy.address, txDefaults), ); // Forwarder @@ -156,7 +144,8 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial ); // Multisigs - const owners = [accounts[0], accounts[1]]; + const accounts: string[] = await web3Wrapper.getAvailableAddressesAsync(); + const owners = _.uniq([accounts[0], accounts[1], txDefaults.from]); const confirmationsRequired = new BigNumber(2); const secondsRequired = new BigNumber(0); @@ -173,19 +162,13 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial // Transfer Ownership to the Asset Proxy Owner await web3Wrapper.awaitTransactionSuccessAsync( - await erc20Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, { - from: owner, - }), + await erc20Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, txDefaults), ); await web3Wrapper.awaitTransactionSuccessAsync( - await erc721Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, { - from: owner, - }), + await erc721Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, txDefaults), ); await web3Wrapper.awaitTransactionSuccessAsync( - await multiAssetProxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, { - from: owner, - }), + await multiAssetProxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, txDefaults), ); // Fund the Forwarder with ZRX @@ -220,10 +203,7 @@ let _cachedContractAddresses: ContractAddresses; * @param txDefaults Default transaction values to use when deploying contracts (e.g., specify the desired contract creator with the `from` parameter). * @returns The addresses of the contracts that were deployed. */ -export async function runMigrationsOnceAsync( - provider: Provider, - txDefaults: Partial, -): Promise { +export async function runMigrationsOnceAsync(provider: Provider, txDefaults: TxData): Promise { if (!_.isUndefined(_cachedContractAddresses)) { return _cachedContractAddresses; } diff --git a/packages/sol-trace/CHANGELOG.json b/packages/sol-trace/CHANGELOG.json index 550ca2feb9..b633b3d212 100644 --- a/packages/sol-trace/CHANGELOG.json +++ b/packages/sol-trace/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "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 2aedf7ebc8..25e81a82af 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 046dad8124..ea2b684a59 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 16a12ca632..89a5b6876d 100644 --- a/packages/sol-tracing-utils/CHANGELOG.json +++ b/packages/sol-tracing-utils/CHANGELOG.json @@ -17,6 +17,14 @@ { "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 } ] }, diff --git a/packages/sol-tracing-utils/package.json b/packages/sol-tracing-utils/package.json index 4b0fff222a..929c73b84e 100644 --- a/packages/sol-tracing-utils/package.json +++ b/packages/sol-tracing-utils/package.json @@ -53,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/ast_visitor.ts b/packages/sol-tracing-utils/src/ast_visitor.ts index 1ac9cd1de9..27f19378bc 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/trace_collector.ts b/packages/sol-tracing-utils/src/trace_collector.ts index f5dde87621..2a1f15b838 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/website/public/index.html b/packages/website/public/index.html index 738b675e75..dd17beebc4 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" /> + 0x: The Protocol for Trading Tokens diff --git a/packages/website/ts/components/portal/back_button.tsx b/packages/website/ts/components/portal/back_button.tsx index bea69bb95d..9b4451196d 100644 --- a/packages/website/ts/components/portal/back_button.tsx +++ b/packages/website/ts/components/portal/back_button.tsx @@ -31,7 +31,7 @@ export const BackButton = (props: BackButtonProps) => {
-
{props.labelText}
+
{props.labelText}
diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx index 59cf2db71e..6ebbf8d1fb 100644 --- a/packages/website/ts/components/portal/portal.tsx +++ b/packages/website/ts/components/portal/portal.tsx @@ -321,7 +321,7 @@ export class Portal extends React.Component { }; return (
} + header={} body={} /> ); diff --git a/packages/website/ts/icons/illustrations/low-cost.svg b/packages/website/ts/icons/illustrations/low-cost.svg index 530cbdd791..da0d2e27c5 100644 --- a/packages/website/ts/icons/illustrations/low-cost.svg +++ b/packages/website/ts/icons/illustrations/low-cost.svg @@ -1,30 +1,30 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/website/ts/icons/illustrations/networkedLiquidity.svg b/packages/website/ts/icons/illustrations/networkedLiquidity.svg index c50ba7e7c3..e03488ac7e 100755 --- a/packages/website/ts/icons/illustrations/networkedLiquidity.svg +++ b/packages/website/ts/icons/illustrations/networkedLiquidity.svg @@ -1,28 +1,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/packages/website/ts/icons/illustrations/secureTrading.svg b/packages/website/ts/icons/illustrations/secureTrading.svg index 21912961d1..109ddbb5ba 100755 --- a/packages/website/ts/icons/illustrations/secureTrading.svg +++ b/packages/website/ts/icons/illustrations/secureTrading.svg @@ -1,15 +1,15 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/packages/website/ts/pages/why.tsx b/packages/website/ts/pages/why.tsx index a0ed5f95a4..48888d10a7 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 { @@ -110,7 +110,7 @@ export class NextWhy extends React.Component {