aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'packages/deployer/README.md')
-rw-r--r--packages/deployer/README.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/packages/deployer/README.md b/packages/deployer/README.md
index f92605f4a..8b6f9799c 100644
--- a/packages/deployer/README.md
+++ b/packages/deployer/README.md
@@ -10,6 +10,8 @@ yarn add @0xproject/deployer
## Usage
+### CLI Usage
+
```bash
node ./node_modules/@0xproject/deployer/lib/cli.js --help
cli.js [command]
@@ -33,6 +35,34 @@ Options:
--help Show help [boolean]
```
+### API Usage
+
+## Migrations
+
+You might want to write a migrations script (similar to `truffle migrate`), that deploys multiple contracts and configures them. Bellow you'll find a simplest example of such a script to help you get started.
+
+```
+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);
+```
+
+More sophisticated example can be found [here](https://github.com/0xProject/0x-monorepo/tree/development/packages/contracts/migrations)
+
## Contributing
We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.