Skip to content

Commit

Permalink
chore: add deployment instructions to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Orland0x authored Oct 13, 2023
1 parent 2012fcf commit 6645e39
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,26 @@ Get a test coverage report:
```sh
$ forge coverage
```

### Deployment

To deploy the protocol to an EVM chain, first set the following environment variables:

```sh
# The address of the account that the will be used to deploy from.
DEPLOYER_ADDRESS=
# The name of the chain you want to deploy on. The contract addresses of the deployed contracts will be stored at /deployments/network.json
NETWORK=
# An RPC URL for the chain.
RPC_URL=
# An API key for a block explorer on the chain (Optional).
ETHERSCAN_API_KEY=
```

Following this, a [Foundry Script](https://book.getfoundry.sh/tutorials/solidity-scripting) can be run to deploy the entire protocol. Example usage to deploy from a Ledger Hardware Wallet and verify on a block explorer:

```sh
forge script script/Deployer.s.sol:Deployer --rpc-url $RPC_URL --optimize --broadcast --verify -vvvv --ledger --sender $DEPLOYER_ADDRESS --hd-paths "m/44'/60'/4'/0/0"
```
The script uses the [Singleton Factory](https://eips.ethereum.org/EIPS/eip-2470) for the deployments which ensures that the addresses of the contracts are the same on all chains (so long as the chain is fully EVM equivalent).

0 comments on commit 6645e39

Please sign in to comment.