Rename deployer to sol-compiler
This commit is contained in:
parent
96037aed52
commit
a6f72de09d
@ -70,7 +70,7 @@ jobs:
|
||||
key: coverage-contracts-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/contracts/coverage/lcov.info
|
||||
test-deployer:
|
||||
test-sol-compiler:
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
working_directory: ~/repo
|
||||
@ -82,11 +82,11 @@ jobs:
|
||||
name: testrpc
|
||||
command: npm run testrpc -- --db testrpc_snapshot
|
||||
background: true
|
||||
- run: yarn lerna:run --scope @0xproject/deployer test:circleci
|
||||
- run: yarn lerna:run --scope @0xproject/sol-compiler test:circleci
|
||||
- save_cache:
|
||||
key: coverage-deployer-{{ .Environment.CIRCLE_SHA1 }}
|
||||
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/deployer/coverage/lcov.info
|
||||
- ~/repo/packages/sol-compiler/coverage/lcov.info
|
||||
test-rest:
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
@ -99,7 +99,7 @@ jobs:
|
||||
name: testrpc
|
||||
command: npm run testrpc -- --db testrpc_snapshot
|
||||
background: true
|
||||
- run: yarn lerna:run --ignore contracts --ignore 0x.js --ignore @0xproject/deployer test:circleci
|
||||
- run: yarn lerna:run --ignore contracts --ignore 0x.js --ignore @0xproject/sol-compiler test:circleci
|
||||
- save_cache:
|
||||
key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
@ -177,7 +177,7 @@ jobs:
|
||||
- coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-deployer-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-0xjs-{{ .Environment.CIRCLE_SHA1 }}
|
||||
@ -199,7 +199,7 @@ workflows:
|
||||
- test-contracts:
|
||||
requires:
|
||||
- build
|
||||
- test-deployer:
|
||||
- test-sol-compiler:
|
||||
requires:
|
||||
- build
|
||||
- test-rest:
|
||||
@ -214,6 +214,6 @@ workflows:
|
||||
- submit-coverage:
|
||||
requires:
|
||||
- test-0xjs
|
||||
- test-deployer
|
||||
- test-sol-compiler
|
||||
- test-rest
|
||||
- test-contracts
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -85,8 +85,8 @@ packages/contracts/src/contract_wrappers/generated/
|
||||
packages/metacoin/src/contract_wrappers
|
||||
packages/migrations/src/contract_wrappers
|
||||
|
||||
# solc-bin in deployer
|
||||
packages/deployer/solc_bin/
|
||||
# solc-bin in sol-compiler
|
||||
packages/sol-compiler/solc_bin/
|
||||
|
||||
# Monorepo scripts
|
||||
packages/*/scripts/
|
||||
|
@ -24,7 +24,7 @@ This repository is a monorepo including the 0x protocol smart contracts and nume
|
||||
| [`@0xproject/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages |
|
||||
| [`@0xproject/base-contract`](/packages/base-contract) | [](https://www.npmjs.com/package/@0xproject/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
|
||||
| [`@0xproject/connect`](/packages/connect) | [](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the Standard Relayer API |
|
||||
| [`@0xproject/deployer`](/packages/deployer) | [](https://www.npmjs.com/package/@0xproject/deployer) | Solidity project compiler and deployer framework |
|
||||
| [`@0xproject/sol-compiler`](/packages/sol-compiler) | [](https://www.npmjs.com/package/@0xproject/sol-compiler) | Solidity project compiler framework |
|
||||
| [`@0xproject/dev-utils`](/packages/dev-utils) | [](https://www.npmjs.com/package/@0xproject/dev-utils) | Dev utils to be shared across 0x projects and packages |
|
||||
| [`@0xproject/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas |
|
||||
| [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | [](https://www.npmjs.com/package/@0xproject/monorepo-scripts) | Monorepo scripts |
|
||||
@ -56,7 +56,7 @@ Dedicated documentation pages:
|
||||
* [0x Connect](https://0xproject.com/docs/connect)
|
||||
* [Smart contracts](https://0xproject.com/docs/contracts)
|
||||
* [Subproviders](https://0xproject.com/docs/subproviders)
|
||||
* [Deployer](https://0xproject.com/docs/deployer)
|
||||
* [Sol Compiler](https://0xproject.com/docs/sol-compiler)
|
||||
* [Web3-wrapper](https://0xproject.com/docs/web3-wrapper)
|
||||
* [JSON-schemas](https://0xproject.com/docs/json-schemas)
|
||||
* [Sol-cov](https://0xproject.com/docs/sol-cov)
|
||||
|
@ -21,10 +21,9 @@
|
||||
"test": "run-s clean test:commonjs",
|
||||
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
|
||||
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
|
||||
"update_artifacts": "for i in ${npm_package_config_contracts}; do copyfiles -u 4 ../migrations/artifacts/1.0.0/$i.json test/artifacts; done;",
|
||||
"clean": "shx rm -rf _bundles lib test_temp scripts",
|
||||
"build:umd:prod": "NODE_ENV=production webpack",
|
||||
"build:commonjs": "tsc && yarn update_artifacts && copyfiles -u 2 './src/compact_artifacts/**/*.json' ./lib/src/compact_artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
|
||||
"build:commonjs": "tsc && copyfiles -u 2 './src/compact_artifacts/**/*.json' ./lib/src/compact_artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
|
||||
"test:commonjs": "run-s build:commonjs run_mocha",
|
||||
"run_mocha": "mocha lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit",
|
||||
"manual:postpublish": "yarn build; node ./scripts/postpublish.js",
|
||||
@ -34,7 +33,6 @@
|
||||
},
|
||||
"config": {
|
||||
"compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry",
|
||||
"contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels",
|
||||
"postpublish": {
|
||||
"assets": [
|
||||
"packages/0x.js/_bundles/index.js",
|
||||
@ -61,7 +59,7 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/deployer": "^0.4.3",
|
||||
"@0xproject/sol-compiler": "^0.4.3",
|
||||
"@0xproject/dev-utils": "^0.4.1",
|
||||
"@0xproject/migrations": "^0.0.5",
|
||||
"@0xproject/monorepo-scripts": "^0.1.19",
|
||||
|
@ -11,6 +11,6 @@ before('migrate contracts', async function() {
|
||||
gas: devConstants.GAS_ESTIMATE,
|
||||
from: devConstants.TESTRPC_FIRST_ADDRESS,
|
||||
};
|
||||
const artifactsDir = path.resolve('test', 'artifacts');
|
||||
const artifactsDir = '../migrations/artifacts/1.0.0';
|
||||
await runMigrationsAsync(provider, artifactsDir, defaults);
|
||||
});
|
||||
|
@ -114,7 +114,7 @@ for (const abiFileName of abiFileNames) {
|
||||
if (_.isUndefined(ABI)) {
|
||||
logUtils.log(`${chalk.red(`ABI not found in ${abiFileName}.`)}`);
|
||||
logUtils.log(
|
||||
`Please make sure your ABI file is either an array with ABI entries or a truffle artifact or 0x deployer artifact`,
|
||||
`Please make sure your ABI file is either an array with ABI entries or a truffle artifact or 0x sol-compiler artifact`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
import { BaseContract } from '@0xproject/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, MethodAbi, Provider, TxData, TxDataPayable } from '@0xproject/types';
|
||||
import { BigNumber, classUtils, promisify } from '@0xproject/utils';
|
||||
import { ContractArtifact } from '@0xproject/deployer';
|
||||
import { ContractArtifact } from '@0xproject/sol-compiler';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
|
@ -16,7 +16,7 @@
|
||||
"test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov",
|
||||
"run_mocha": "mocha 'lib/test/**/*.js' --timeout 100000 --bail --exit",
|
||||
"compile:comment": "Yarn workspaces do not link binaries correctly so we need to reference them directly https://github.com/yarnpkg/yarn/issues/3846",
|
||||
"compile": "node ../deployer/lib/src/cli.js compile",
|
||||
"compile": "node ../sol-compiler/lib/src/cli.js",
|
||||
"clean": "shx rm -rf ./lib",
|
||||
"generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'",
|
||||
"lint": "tslint --project . 'migrations/**/*.ts' 'test/**/*.ts' 'util/**/*.ts' 'deploy/**/*.ts'",
|
||||
@ -60,7 +60,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"0x.js": "^0.37.2",
|
||||
"@0xproject/deployer": "^0.4.3",
|
||||
"@0xproject/sol-compiler": "^0.4.3",
|
||||
"@0xproject/types": "^0.6.3",
|
||||
"@0xproject/typescript-typings": "^0.3.1",
|
||||
"@0xproject/utils": "^0.6.1",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ContractArtifact } from '@0xproject/deployer';
|
||||
import { ContractArtifact } from '@0xproject/sol-compiler';
|
||||
|
||||
import * as AccountLevels from '../src/artifacts/AccountLevels.json';
|
||||
import * as Arbitrage from '../src/artifacts/Arbitrage.json';
|
||||
|
@ -18,14 +18,14 @@
|
||||
"coverage:report:html": "istanbul report html && open coverage/index.html",
|
||||
"coverage:report:lcov": "istanbul report lcov",
|
||||
"test:circleci": "yarn test:coverage",
|
||||
"compile": "node ../deployer/lib/src/cli.js compile"
|
||||
"compile": "node ../sol-compiler/lib/src/cli.js compile"
|
||||
},
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@0xproject/abi-gen": "^0.2.13",
|
||||
"@0xproject/base-contract": "^0.3.1",
|
||||
"@0xproject/deployer": "^0.4.3",
|
||||
"@0xproject/sol-compiler": "^0.4.3",
|
||||
"@0xproject/sol-cov": "^0.0.10",
|
||||
"@0xproject/subproviders": "^0.10.1",
|
||||
"@0xproject/tslint-config": "^0.4.17",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ContractArtifact } from '@0xproject/deployer';
|
||||
import { ContractArtifact } from '@0xproject/sol-compiler';
|
||||
import { BlockchainLifecycle, devConstants } from '@0xproject/dev-utils';
|
||||
import { LogWithDecodedArgs } from '@0xproject/types';
|
||||
import { BigNumber } from '@0xproject/utils';
|
||||
|
@ -15,7 +15,7 @@
|
||||
"script:migrate": "node ./lib/migrate.js",
|
||||
"copy_artifacts": "copyfiles 'artifacts/1.0.0/**/*' ./lib",
|
||||
"generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers && prettier --write 'src/contract_wrappers/**.ts'",
|
||||
"compile": "node ../deployer/lib/src/cli.js compile"
|
||||
"compile": "node ../sol-compiler/lib/src/cli.js compile"
|
||||
},
|
||||
"config": {
|
||||
"abis": "artifacts/1.0.0/@(DummyToken|TokenTransferProxy|Exchange|TokenRegistry|MultiSigWallet|MultiSigWalletWithTimeLock|MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress|TokenRegistry|ZRXToken|Arbitrage|EtherDelta|AccountLevels|WETH9|MaliciousToken).json"
|
||||
@ -31,7 +31,7 @@
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/deployer": "^0.4.3",
|
||||
"@0xproject/sol-compiler": "^0.4.3",
|
||||
"@0xproject/base-contract": "^0.3.1",
|
||||
"@0xproject/utils": "^0.6.1",
|
||||
"@0xproject/web3-wrapper": "^0.6.3",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { BaseContract } from '@0xproject/base-contract';
|
||||
import { ContractArtifact } from '@0xproject/deployer';
|
||||
import { ContractArtifact } from '@0xproject/sol-compiler';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
|
@ -18,7 +18,9 @@ import { tokenInfo } from './utils/token_info';
|
||||
* Custom migrations should be defined in this function. This will be called with the CLI 'migrate' command.
|
||||
* Migrations could be written to run in parallel, but if you want contract addresses to be created deterministically,
|
||||
* the migration should be written to run synchronously.
|
||||
* @param deployer Deployer instance.
|
||||
* @param provider Provider instance.
|
||||
* @param artifactsDir The directory with artifact files.
|
||||
* @param defaults Default transaction values to use.
|
||||
*/
|
||||
export const runMigrationsAsync = async (provider: Provider, artifactsDir: string, defaults: Partial<TxData>) => {
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
|
@ -10,7 +10,7 @@ import { constants } from './constants';
|
||||
import { utils } from './utils';
|
||||
|
||||
// For some reason, `depcheck` hangs on some packages. Add them here.
|
||||
const IGNORE_PACKAGES = ['@0xproject/deployer'];
|
||||
const IGNORE_PACKAGES = ['@0xproject/sol-compiler'];
|
||||
|
||||
(async () => {
|
||||
utils.log('*** NOTE: Not all deps listed here are actually not required. ***');
|
||||
|
@ -32,7 +32,7 @@ const packageNameToWebsitePath: { [name: string]: string } = {
|
||||
contracts: 'contracts',
|
||||
connect: 'connect',
|
||||
'json-schemas': 'json-schemas',
|
||||
deployer: 'deployer',
|
||||
'sol-compiler': 'sol-compiler',
|
||||
'sol-cov': 'sol-cov',
|
||||
subproviders: 'subproviders',
|
||||
'order-utils': 'order-utils',
|
||||
|
@ -1,21 +1,21 @@
|
||||
## @0xproject/deployer
|
||||
## @0xproject/sol-compiler
|
||||
|
||||
This repository contains a CLI tool that facilitates compiling and deployment of smart contracts.
|
||||
This repository contains a CLI tool that facilitates compiling smart contracts.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/deployer).
|
||||
### Read the [Documentation](https://0xproject.com/docs/sol-compiler).
|
||||
|
||||
## Installation
|
||||
|
||||
#### CLI Installation
|
||||
|
||||
```bash
|
||||
yarn global add @0xproject/deployer
|
||||
yarn global add @0xproject/sol-compiler
|
||||
```
|
||||
|
||||
#### API Installation
|
||||
|
||||
```bash
|
||||
yarn add @0xproject/deployer
|
||||
yarn add @0xproject/sol-compiler
|
||||
```
|
||||
|
||||
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
|
||||
@ -29,13 +29,13 @@ If your project is in [TypeScript](https://www.typescriptlang.org/), add the fol
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { Compiler } from '@0xproject/deployer';
|
||||
import { Compiler } from '@0xproject/sol-compiler';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var Compiler = require('@0xproject/deployer').Compiler;
|
||||
var Compiler = require('@0xproject/sol-compiler').Compiler;
|
||||
```
|
||||
|
||||
## Contributing
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@0xproject/deployer",
|
||||
"name": "@0xproject/sol-compiler",
|
||||
"version": "0.4.3",
|
||||
"description": "Smart contract deployer of 0x protocol",
|
||||
"description": "Solidity compiler wrapper and artifactor",
|
||||
"main": "lib/src/index.js",
|
||||
"types": "lib/src/index.d.ts",
|
||||
"scripts": {
|
||||
@ -28,13 +28,13 @@
|
||||
"extraFileIncludes": [
|
||||
"../types/src/index.ts"
|
||||
],
|
||||
"s3BucketPath": "s3://doc-jsons/deployer/",
|
||||
"s3StagingBucketPath": "s3://staging-doc-jsons/deployer/"
|
||||
"s3BucketPath": "s3://doc-jsons/sol-compiler/",
|
||||
"s3StagingBucketPath": "s3://staging-doc-jsons/sol-compiler/"
|
||||
}
|
||||
}
|
||||
},
|
||||
"bin": {
|
||||
"0x-deployer": "lib/src/cli.js"
|
||||
"sol-compiler": "lib/src/cli.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -45,7 +45,7 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/0xProject/0x-monorepo/issues"
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/deployer/README.md",
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md",
|
||||
"devDependencies": {
|
||||
"@0xproject/dev-utils": "^0.4.1",
|
||||
"@0xproject/monorepo-scripts": "^0.1.19",
|
@ -55,8 +55,8 @@ describe('Compiler utils', () => {
|
||||
const dependencies = parseDependencies({ source, path });
|
||||
const expectedDependencies = [
|
||||
'zeppelin-solidity/contracts/token/ERC20/ERC20.sol',
|
||||
'packages/deployer/lib/test/fixtures/contracts/TokenTransferProxy.sol',
|
||||
'packages/deployer/lib/test/fixtures/contracts/base/SafeMath.sol',
|
||||
'packages/sol-compiler/lib/test/fixtures/contracts/TokenTransferProxy.sol',
|
||||
'packages/sol-compiler/lib/test/fixtures/contracts/base/SafeMath.sol',
|
||||
];
|
||||
_.each(expectedDependencies, expectedDepdency => {
|
||||
const foundDependency = _.find(dependencies, dependency => _.endsWith(dependency, expectedDepdency));
|
@ -14,7 +14,7 @@
|
||||
"run_mocha": "mocha lib/test/**/*_test.js --exit",
|
||||
"clean": "shx rm -rf lib scripts",
|
||||
"build": "copyfiles 'test/fixtures/**/*' ./lib && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
|
||||
"compile_test": "node ../deployer/lib/src/cli.js compile",
|
||||
"compile_test": "node ../sol-compiler/lib/src/cli.js compile",
|
||||
"manual:postpublish": "yarn build; node ./scripts/postpublish.js",
|
||||
"docs:stage": "yarn build && node ./scripts/stage_docs.js",
|
||||
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES",
|
||||
@ -54,7 +54,7 @@
|
||||
"solidity-parser-antlr": "^0.2.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/deployer": "^0.3.5",
|
||||
"@0xproject/sol-compiler": "^0.3.5",
|
||||
"@0xproject/monorepo-scripts": "^0.1.19",
|
||||
"@0xproject/tslint-config": "^0.4.17",
|
||||
"@types/istanbul": "^0.4.29",
|
||||
|
@ -1,23 +0,0 @@
|
||||
#### CLI Installation
|
||||
|
||||
```bash
|
||||
yarn global add @0xproject/deployer
|
||||
```
|
||||
|
||||
#### API Installation
|
||||
|
||||
```bash
|
||||
yarn add @0xproject/deployer
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { Compiler } from '@0xproject/deployer';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var Compiler = require('@0xproject/deployer').Compiler;
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
Welcome to the [Deployer](https://github.com/0xProject/0x-monorepo/tree/development/packages/deployer) documentation! Deployer is a tool for compiling and deploying Solidity smart contracts with ease.
|
||||
|
||||
It serves a similar purpose as parts of the [Truffle framework](http://truffleframework.com/), but with the UNIX philosophy in mind: Make each program do one thing well. This tool is for intermediate to advanced Solidity developers that require greater configurability and reliability.
|
||||
|
||||
Deployer has the following advantages over Truffle:
|
||||
|
||||
* Deploy each smart contract with a specific version of Solidity.
|
||||
* Improved artifact files:
|
||||
* Properly segregated artifacts to support storing different versions of smart contract deployed on different networks.
|
||||
* Storage of constructor args, source maps and paths to all requisite source files.
|
||||
* An easy to maintain codebase: TypeScript + Single repo.
|
||||
* Allows you to specify the deployer RPC address.
|
||||
* Supports Solidity version ranges - contract compiled with latest Solidity version that satisfies the range.
|
||||
* Migrations that work with `async/await`.
|
||||
* Migrations that can be written synchronously in order to guarentee deterministic contract addresses.
|
||||
* No race conditions when running migrations.
|
||||
|
||||
Deployer can be used as a command-line tool or as an imported module.
|
@ -1,56 +0,0 @@
|
||||
#### CLI Usage
|
||||
|
||||
```bash
|
||||
$ 0x-deployer --help
|
||||
0x-deployer [command]
|
||||
|
||||
Commands:
|
||||
0x-deployer compile compile contracts
|
||||
0x-deployer deploy deploy a single contract with provided arguments
|
||||
|
||||
Options:
|
||||
--version Show version number [boolean]
|
||||
--contracts-dir path of contracts directory to compile [string] [default:
|
||||
"/path/to/contracts"]
|
||||
--network-id mainnet=1, kovan=42, testrpc=50 [number] [default: 50]
|
||||
--should-optimize enable optimizer [boolean] [default: false]
|
||||
--artifacts-dir path to write contracts artifacts to [string] [default:
|
||||
"/path/to/artifacts"]
|
||||
--jsonrpc-port port connected to JSON RPC [number] [default: 8545]
|
||||
--gas-price gasPrice to be used for transactions
|
||||
[string] [default: "2000000000"]
|
||||
--account account to use for deploying contracts [string]
|
||||
--contracts comma separated list of contracts to compile
|
||||
[string] [default: "*"]
|
||||
--help Show help [boolean]
|
||||
```
|
||||
|
||||
#### API Usage
|
||||
|
||||
##### Migrations
|
||||
|
||||
You can write migration scripts (similar to `truffle migrate`), that deploys multiple contracts and configures them. Below you'll find a simple example of such a script to help you get started.
|
||||
|
||||
```typescript
|
||||
import { Deployer } from '@0xproject/deployer';
|
||||
import * as path from 'path';
|
||||
|
||||
const deployerOpts = {
|
||||
artifactsDir: path.resolve('src', 'artifacts'),
|
||||
jsonrpcUrl: 'http://localhost:8545',
|
||||
networkId: 50,
|
||||
defaults: {
|
||||
gas: 1000000,
|
||||
},
|
||||
};
|
||||
|
||||
const deployer = new Deployer(deployerOpts);
|
||||
|
||||
(async () => {
|
||||
const etherToken = await deployer.deployAndSaveAsync('WETH9');
|
||||
})().catch(console.log);
|
||||
```
|
||||
|
||||
**Tip:** Be sure to start an Ethereum node at the supplied `jsonrpcUrl`. We recommend testing with [Ganache-cli](https://github.com/trufflesuite/ganache-cli)
|
||||
|
||||
A more sophisticated example can be found [here](https://github.com/0xProject/0x-monorepo/tree/development/packages/contracts/migrations)
|
23
packages/website/md/docs/sol-compiler/installation.md
Normal file
23
packages/website/md/docs/sol-compiler/installation.md
Normal file
@ -0,0 +1,23 @@
|
||||
#### CLI Installation
|
||||
|
||||
```bash
|
||||
yarn global add @0xproject/sol-compiler
|
||||
```
|
||||
|
||||
#### API Installation
|
||||
|
||||
```bash
|
||||
yarn add @0xproject/sol-compiler
|
||||
```
|
||||
|
||||
**Import**
|
||||
|
||||
```typescript
|
||||
import { Compiler } from '@0xproject/sol-compiler';
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```javascript
|
||||
var Compiler = require('@0xproject/sol-compiler').Compiler;
|
||||
```
|
13
packages/website/md/docs/sol-compiler/introduction.md
Normal file
13
packages/website/md/docs/sol-compiler/introduction.md
Normal file
@ -0,0 +1,13 @@
|
||||
Welcome to the [sol-compiler](https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-compiler) documentation! Sol-compiler is a tool for compiling Solidity smart contracts and generating artifacts with ease.
|
||||
|
||||
It serves a similar purpose as parts of the [Truffle framework](http://truffleframework.com/), but with the UNIX philosophy in mind: Make each program do one thing well. This tool is for intermediate to advanced Solidity developers that require greater configurability and reliability.
|
||||
|
||||
Sol-compiler has the following advantages over Truffle:
|
||||
|
||||
* Compile each smart contract with a specific version of Solidity.
|
||||
* Improved artifact files:
|
||||
* Storage of constructor args, source maps and paths to all requisite source files.
|
||||
* An easy to maintain codebase: TypeScript + Single repo.
|
||||
* Supports Solidity version ranges - contract compiled with latest Solidity version that satisfies the range.
|
||||
|
||||
Sol-compiler can be used as a command-line tool or as an imported module.
|
24
packages/website/md/docs/sol-compiler/usage.md
Normal file
24
packages/website/md/docs/sol-compiler/usage.md
Normal file
@ -0,0 +1,24 @@
|
||||
#### CLI Usage
|
||||
|
||||
```bash
|
||||
$ sol-compiler
|
||||
Options:
|
||||
--version Show version number [boolean]
|
||||
--contracts-dir path of contracts directory to compile [string]
|
||||
--artifacts-dir path to write contracts artifacts to [string]
|
||||
--contracts comma separated list of contracts to compile
|
||||
[string] [default: "*"]
|
||||
--help Show help [boolean]
|
||||
```
|
||||
|
||||
#### API Usage
|
||||
|
||||
```typescript
|
||||
import { Compiler } from '@0xproject/sol-compiler';
|
||||
|
||||
const compiler = new Compiler();
|
||||
|
||||
(async () => {
|
||||
await compiler.compileAllAsync();
|
||||
})().catch(console.log);
|
||||
```
|
@ -56,7 +56,7 @@
|
||||
"ABOUT": "关于我们",
|
||||
"CAREERS": "人才招聘",
|
||||
"CONTACT": "联系方式",
|
||||
"DEPLOYER": "Deployer",
|
||||
"SOL_COMPILER": "Solidity Compiler",
|
||||
"JSON_SCHEMAS": "JSON Schemas",
|
||||
"SOL_COV": "Solidity Coverage",
|
||||
"SUBPROVIDERS": "Subproviders",
|
||||
|
@ -57,7 +57,7 @@
|
||||
"ABOUT": "about",
|
||||
"CAREERS": "careers",
|
||||
"CONTACT": "contact",
|
||||
"DEPLOYER": "Deployer",
|
||||
"SOL_COMPILER": "Solidity Compiler",
|
||||
"JSON_SCHEMAS": "JSON Schemas",
|
||||
"SOL_COV": "Solidity Coverage",
|
||||
"SUBPROVIDERS": "Subproviders",
|
||||
|
@ -56,7 +56,7 @@
|
||||
"ABOUT": "기업 정보",
|
||||
"CAREERS": "채용",
|
||||
"CONTACT": "문의",
|
||||
"DEPLOYER": "Deployer",
|
||||
"SOL_COMPILER": "Solidity Compiler",
|
||||
"JSON_SCHEMAS": "JSON Schemas",
|
||||
"SOL_COV": "Solidity Coverage",
|
||||
"SUBPROVIDERS": "Subproviders",
|
||||
|
@ -56,7 +56,7 @@
|
||||
"ABOUT": "Kоманда",
|
||||
"CAREERS": "Карьера",
|
||||
"CONTACT": "Связаться с нами",
|
||||
"DEPLOYER": "Deployer",
|
||||
"SOL_COMPILER": "Solidity Compiler",
|
||||
"JSON_SCHEMAS": "JSON Schemas",
|
||||
"SOL_COV": "Solidity Coverage",
|
||||
"SUBPROVIDERS": "Subproviders",
|
||||
|
@ -57,7 +57,7 @@
|
||||
"ABOUT": "equipo",
|
||||
"CAREERS": "empleo",
|
||||
"CONTACT": "contacto",
|
||||
"DEPLOYER": "Deployer",
|
||||
"SOL_COMPILER": "Solidity Compiler",
|
||||
"JSON_SCHEMAS": "JSON Schemas",
|
||||
"SOL_COV": "Solidity Coverage",
|
||||
"SUBPROVIDERS": "Subproviders",
|
||||
|
@ -149,10 +149,10 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
|
||||
primaryText={this.props.translate.get(Key.OrderUtils, Deco.CapWords)}
|
||||
/>
|
||||
</Link>,
|
||||
<Link key="subMenuItem-deployer" to={WebsitePaths.Deployer} className="text-decoration-none">
|
||||
<Link key="subMenuItem-sol-compiler" to={WebsitePaths.SolCompiler} className="text-decoration-none">
|
||||
<MenuItem
|
||||
style={{ fontSize: styles.menuItem.fontSize }}
|
||||
primaryText={this.props.translate.get(Key.Deployer, Deco.CapWords)}
|
||||
primaryText={this.props.translate.get(Key.SolCompiler, Deco.CapWords)}
|
||||
/>
|
||||
</Link>,
|
||||
<Link key="subMenuItem-sol-cov" to={WebsitePaths.SolCov} className="text-decoration-none">
|
||||
@ -328,10 +328,10 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
|
||||
</MenuItem>
|
||||
</Link>
|
||||
)}
|
||||
{!this._isViewingDeployerDocs() && (
|
||||
<Link to={WebsitePaths.Deployer} className="text-decoration-none">
|
||||
{!this._isViewingSolCompilerDocs() && (
|
||||
<Link to={WebsitePaths.SolCompiler} className="text-decoration-none">
|
||||
<MenuItem className="py2">
|
||||
{this.props.translate.get(Key.Deployer, Deco.Cap)}{' '}
|
||||
{this.props.translate.get(Key.SolCompiler, Deco.Cap)}{' '}
|
||||
{this.props.translate.get(Key.Docs, Deco.Cap)}
|
||||
</MenuItem>
|
||||
</Link>
|
||||
@ -476,8 +476,8 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
|
||||
_.includes(this.props.location.pathname, WebsiteLegacyPaths.Web3Wrapper)
|
||||
);
|
||||
}
|
||||
private _isViewingDeployerDocs() {
|
||||
return _.includes(this.props.location.pathname, WebsitePaths.Deployer);
|
||||
private _isViewingSolCompilerDocs() {
|
||||
return _.includes(this.props.location.pathname, WebsitePaths.SolCompiler);
|
||||
}
|
||||
private _isViewingJsonSchemasDocs() {
|
||||
return _.includes(this.props.location.pathname, WebsitePaths.JSONSchemas);
|
||||
@ -498,7 +498,7 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
|
||||
this._isViewingFAQ() ||
|
||||
this._isViewingSmartContractsDocs() ||
|
||||
this._isViewingWeb3WrapperDocs() ||
|
||||
this._isViewingDeployerDocs() ||
|
||||
this._isViewingSolCompilerDocs() ||
|
||||
this._isViewingJsonSchemasDocs() ||
|
||||
this._isViewingSolCovDocs() ||
|
||||
this._isViewingSubprovidersDocs() ||
|
||||
|
@ -12,9 +12,9 @@ import { constants } from 'ts/utils/constants';
|
||||
import { Translate } from 'ts/utils/translate';
|
||||
|
||||
/* tslint:disable:no-var-requires */
|
||||
const IntroMarkdown = require('md/docs/deployer/introduction');
|
||||
const InstallationMarkdown = require('md/docs/deployer/installation');
|
||||
const UsageMarkdown = require('md/docs/deployer/usage');
|
||||
const IntroMarkdown = require('md/docs/sol-compiler/introduction');
|
||||
const InstallationMarkdown = require('md/docs/sol-compiler/installation');
|
||||
const UsageMarkdown = require('md/docs/sol-compiler/usage');
|
||||
/* tslint:enable:no-var-requires */
|
||||
|
||||
const docSections = {
|
||||
@ -22,21 +22,19 @@ const docSections = {
|
||||
installation: 'installation',
|
||||
usage: 'usage',
|
||||
compiler: 'compiler',
|
||||
deployer: 'deployer',
|
||||
types: docConstants.TYPES_SECTION_NAME,
|
||||
};
|
||||
|
||||
const docsInfoConfig: DocsInfoConfig = {
|
||||
id: DocPackages.Deployer,
|
||||
id: DocPackages.SolCompiler,
|
||||
type: SupportedDocJson.TypeDoc,
|
||||
displayName: 'Deployer',
|
||||
displayName: 'Sol Compiler',
|
||||
packageUrl: 'https://github.com/0xProject/0x-monorepo',
|
||||
menu: {
|
||||
introduction: [docSections.introduction],
|
||||
install: [docSections.installation],
|
||||
usage: [docSections.usage],
|
||||
compiler: [docSections.compiler],
|
||||
deployer: [docSections.deployer],
|
||||
types: [docSections.types],
|
||||
},
|
||||
sectionNameToMarkdown: {
|
||||
@ -45,13 +43,12 @@ const docsInfoConfig: DocsInfoConfig = {
|
||||
[docSections.usage]: UsageMarkdown,
|
||||
},
|
||||
sectionNameToModulePath: {
|
||||
[docSections.compiler]: ['"deployer/src/compiler"'],
|
||||
[docSections.deployer]: ['"deployer/src/deployer"'],
|
||||
[docSections.types]: ['"deployer/src/utils/types"', '"types/src/index"'],
|
||||
[docSections.compiler]: ['"sol-compiler/src/compiler"'],
|
||||
[docSections.types]: ['"sol-compiler/src/utils/types"', '"types/src/index"'],
|
||||
},
|
||||
menuSubsectionToVersionWhenIntroduced: {},
|
||||
sections: docSections,
|
||||
visibleConstructors: [docSections.compiler, docSections.deployer],
|
||||
visibleConstructors: [docSections.compiler],
|
||||
typeConfigs: {
|
||||
// Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is
|
||||
// currently no way to extract the re-exported types from index.ts via TypeDoc :(
|
@ -74,7 +74,7 @@ const docsInfoConfig: DocsInfoConfig = {
|
||||
[docSections.redundantRPCSubprovider]: ['"subproviders/src/subproviders/redundant_rpc"'],
|
||||
[docSections.ganacheSubprovider]: ['"subproviders/src/subproviders/ganache"'],
|
||||
[docSections.nonceTrackerSubprovider]: ['"subproviders/src/subproviders/nonce_tracker"'],
|
||||
[docSections.types]: ['"deployer/src/utils/types"', '"types/src/index"', '"subproviders/src/types"'],
|
||||
[docSections.types]: ['"sol-compiler/src/utils/types"', '"types/src/index"', '"subproviders/src/types"'],
|
||||
},
|
||||
menuSubsectionToVersionWhenIntroduced: {},
|
||||
sections: docSections,
|
||||
|
@ -54,8 +54,8 @@ const LazyConnectDocumentation = createLazyComponent('Documentation', async () =
|
||||
const LazyWeb3WrapperDocumentation = createLazyComponent('Documentation', async () =>
|
||||
System.import<any>(/* webpackChunkName: "web3WrapperDocs" */ 'ts/containers/web3_wrapper_documentation'),
|
||||
);
|
||||
const LazyDeployerDocumentation = createLazyComponent('Documentation', async () =>
|
||||
System.import<any>(/* webpackChunkName: "deployerDocs" */ 'ts/containers/deployer_documentation'),
|
||||
const LazySolCompilerDocumentation = createLazyComponent('Documentation', async () =>
|
||||
System.import<any>(/* webpackChunkName: "solCompilerDocs" */ 'ts/containers/sol_compiler_documentation'),
|
||||
);
|
||||
const LazyJSONSchemasDocumentation = createLazyComponent('Documentation', async () =>
|
||||
System.import<any>(/* webpackChunkName: "jsonSchemasDocs" */ 'ts/containers/json_schemas_documentation'),
|
||||
@ -91,7 +91,10 @@ render(
|
||||
<Route path={WebsitePaths.Wiki} component={Wiki as any} />
|
||||
<Route path={`${WebsitePaths.ZeroExJs}/:version?`} component={LazyZeroExJSDocumentation} />
|
||||
<Route path={`${WebsitePaths.Connect}/:version?`} component={LazyConnectDocumentation} />
|
||||
<Route path={`${WebsitePaths.Deployer}/:version?`} component={LazyDeployerDocumentation} />
|
||||
<Route
|
||||
path={`${WebsitePaths.SolCompiler}/:version?`}
|
||||
component={LazySolCompilerDocumentation}
|
||||
/>
|
||||
<Route path={`${WebsitePaths.SolCov}/:version?`} component={LazySolCovDocumentation} />
|
||||
<Route
|
||||
path={`${WebsitePaths.JSONSchemas}/:version?`}
|
||||
|
@ -30,7 +30,7 @@ const docIdToSubpackageName: { [id: string]: string } = {
|
||||
[DocPackages.Connect]: 'connect',
|
||||
[DocPackages.SmartContracts]: 'contracts',
|
||||
[DocPackages.Web3Wrapper]: 'web3-wrapper',
|
||||
[DocPackages.Deployer]: 'deployer',
|
||||
[DocPackages.SolCompiler]: 'sol-compiler',
|
||||
[DocPackages.JSONSchemas]: 'json-schemas',
|
||||
[DocPackages.SolCov]: 'sol-cov',
|
||||
[DocPackages.Subproviders]: 'subproviders',
|
||||
|
@ -357,7 +357,7 @@ export enum WebsitePaths {
|
||||
SmartContracts = '/docs/contracts',
|
||||
Connect = '/docs/connect',
|
||||
Web3Wrapper = '/docs/web3-wrapper',
|
||||
Deployer = '/docs/deployer',
|
||||
SolCompiler = '/docs/sol-compiler',
|
||||
JSONSchemas = '/docs/json-schemas',
|
||||
SolCov = '/docs/sol-cov',
|
||||
Subproviders = '/docs/subproviders',
|
||||
@ -370,7 +370,7 @@ export enum DocPackages {
|
||||
ZeroExJs = 'ZERO_EX_JS',
|
||||
SmartContracts = 'SMART_CONTRACTS',
|
||||
Web3Wrapper = 'WEB3_WRAPPER',
|
||||
Deployer = 'DEPLOYER',
|
||||
SolCompiler = 'SOL_COMPILER',
|
||||
JSONSchemas = 'JSON_SCHEMAS',
|
||||
SolCov = 'SOL_COV',
|
||||
Subproviders = 'SUBPROVIDERS',
|
||||
@ -423,7 +423,7 @@ export enum Key {
|
||||
About = 'ABOUT',
|
||||
Careers = 'CAREERS',
|
||||
Contact = 'CONTACT',
|
||||
Deployer = 'DEPLOYER',
|
||||
SolCompiler = 'SOL_COMPILER',
|
||||
JsonSchemas = 'JSON_SCHEMAS',
|
||||
SolCov = 'SOL_COV',
|
||||
Subproviders = 'SUBPROVIDERS',
|
||||
|
@ -6,9 +6,9 @@
|
||||
version "0.3.9"
|
||||
resolved "https://registry.yarnpkg.com/8fold-marked/-/8fold-marked-0.3.9.tgz#bb89c645612f8ccfaffac1ca6e3c11f168c9cf59"
|
||||
|
||||
"@0xproject/deployer@^0.3.5":
|
||||
"@0xproject/sol-compiler@^0.3.5":
|
||||
version "0.3.5"
|
||||
resolved "https://registry.yarnpkg.com/@0xproject/deployer/-/deployer-0.3.5.tgz#3b4144ac62cfbbe4fc7174cbf92f29594f411973"
|
||||
resolved "https://registry.yarnpkg.com/@0xproject/sol-compiler/-/deployer-0.3.5.tgz#3b4144ac62cfbbe4fc7174cbf92f29594f411973"
|
||||
dependencies:
|
||||
"@0xproject/json-schemas" "^0.7.19"
|
||||
"@0xproject/types" "^0.5.0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user