Commit 4e03f8a9 authored by Karl Floersch's avatar Karl Floersch Committed by GitHub

feat: add hardhat deploy instructions to readme (#965)

* feat: add deployment instructions to readme

* Add changeset

* fix style

* Update README.md
parent 245136f1
---
'@eth-optimism/contracts': patch
---
Update contracts README to add deploy instructions.
...@@ -84,5 +84,81 @@ You can also build specific components as follows: ...@@ -84,5 +84,81 @@ You can also build specific components as follows:
yarn build:contracts yarn build:contracts
``` ```
### Deploying the Contracts
To deploy the contracts first clone, install, and build the contracts package.
Next set the following env vars:
```bash
CONTRACTS_TARGET_NETWORK=...
CONTRACTS_DEPLOYER_KEY=...
CONTRACTS_RPC_URL=...
```
Then to perform the actual deployment run:
```bash
npx hardhat deploy \
--network ... \ # `network` MUST equal your env var `CONTRACTS_TARGET_NETWORK`
--ovm-address-manager-owner ... \
--ovm-proposer-address ... \
--ovm-relayer-address ... \
--ovm-sequencer-address ... \
--scc-fraud-proof-window ... \
--scc-sequencer-publish-window ...
```
This will deploy the contracts to the network specified in your env and create
an artifacts directory in `./deployments`.
To view all deployment options run:
```bash
npx hardhat deploy --help
Hardhat version 2.2.1
Usage: hardhat [GLOBAL OPTIONS] deploy [--ctc-force-inclusion-period-seconds <INT>] [--ctc-max-transaction-gas-limit <INT>] --deploy-scripts <STRING> [--em-max-gas-per-queue-per-epoch <INT>] [--em-max-transaction-gas-limit <INT>] [--em-min-transaction-gas-limit <INT>] [--em-ovm-chain-id <INT>] [--em-seconds-per-epoch <INT>] --export <STRING> --export-all <STRING> --gasprice <STRING> [--l1-block-time-seconds <INT>] [--no-compile] [--no-impersonation] --ovm-address-manager-owner <STRING> --ovm-proposer-address <STRING> --ovm-relayer-address <STRING> --ovm-sequencer-address <STRING> [--reset] [--scc-fraud-proof-window <INT>] [--scc-sequencer-publish-window <INT>] [--silent] --tags <STRING> [--watch] --write <BOOLEAN>
OPTIONS:
--ctc-force-inclusion-period-seconds Number of seconds that the sequencer has to include transactions before the L1 queue. (default: 2592000)
--ctc-max-transaction-gas-limit Max gas limit for L1 queue transactions. (default: 9000000)
--deploy-scripts override deploy script folder path
--em-max-gas-per-queue-per-epoch Maximum gas allowed in a given queue for each epoch. (default: 250000000)
--em-max-transaction-gas-limit Maximum allowed transaction gas limit. (default: 9000000)
--em-min-transaction-gas-limit Minimum allowed transaction gas limit. (default: 50000)
--em-ovm-chain-id Chain ID for the L2 network. (default: 420)
--em-seconds-per-epoch Number of seconds in each epoch. (default: 0)
--export export current network deployments
--export-all export all deployments into one file
--gasprice gas price to use for transactions
--l1-block-time-seconds Number of seconds on average between every L1 block. (default: 15)
--no-compile disable pre compilation
--no-impersonation do not impersonate unknown accounts
--ovm-address-manager-owner Address that will own the Lib_AddressManager. Must be provided or this deployment will fail.
--ovm-proposer-address Address of the account that will propose state roots. Must be provided or this deployment will fail.
--ovm-relayer-address Address of the message relayer. Must be provided or this deployment will fail.
--ovm-sequencer-address Address of the sequencer. Must be provided or this deployment will fail.
--reset whether to delete deployments files first
--scc-fraud-proof-window Number of seconds until a transaction is considered finalized. (default: 604800)
--scc-sequencer-publish-window Number of seconds that the sequencer is exclusively allowed to post state roots. (default: 1800)
--silent whether to remove log
--tags specify which deploy script to execute via tags, separated by commas
--watch redeploy on every change of contract or deploy script
--write whether to write deployments to file
deploy: Deploy contracts
For global options help run: hardhat help
```
### Verifying Deployments on Etherscan
If you are using a network which Etherscan supports you can verify your contracts with:
```bash
npx hardhat etherscan-verify --api-key ... --network ...
```
## Security ## Security
Please refer to our [Security Policy](https://github.com/ethereum-optimism/.github/security/policy) for information about how to disclose security issues with this code. Please refer to our [Security Policy](https://github.com/ethereum-optimism/.github/security/policy) for information about how to disclose security issues with this code.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment