Skip to content

Commit

Permalink
Updating github actions to run correctly (#14)
Browse files Browse the repository at this point in the history
Updating github actions to run correctly and distinguishing mainnet and testnet proxy contracts


---------
Authored-by: Robert Leonard <[email protected]>
  • Loading branch information
Robert-H-Leonard authored Sep 21, 2023
1 parent 54d8d98 commit c5b15fe
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 45 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/mainnet-deployment-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ env:
DEFENDER_RELAY_KEY: ${{ secrets.DEFENDER_BNB_RELAY_KEY }}
DEFENDER_RELAY_SECRET: ${{ secrets.DEFENDER_BNB_RELAY_SECRET }}
EXPLORER_API_KEY: ${{ secrets.BNB_EXPLORER_API_KEY }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_PROXY_ADDRESS }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_MAINNET_PROXY_ADDRESS }}
GNOSIS_ADDRESS: ${{ secrets.GNOSIS_ADDRESS }}
BNB_TESTNET_RPC_URL: ${{ secrets.BNB_TESTNET_RPC_URL }}
BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }}

jobs:
check:
upgrade-mainnet:
strategy:
fail-fast: true

name: Bnb testnet deployment
name: Bnb mainnet upgrade
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -31,11 +31,6 @@ jobs:
with:
version: nightly

- name: Install Forge Dependencies
run: |
forge install openzeppelin-contracts-upgradeable=OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
id: install-dependency-contracts

- name: Run Forge build
run: |
forge --version
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/mainnet-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ env:
DEFENDER_RELAY_KEY: ${{ secrets.DEFENDER_BNB_RELAY_KEY }}
DEFENDER_RELAY_SECRET: ${{ secrets.DEFENDER_BNB_RELAY_SECRET }}
EXPLORER_API_KEY: ${{ secrets.BNB_EXPLORER_API_KEY }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_PROXY_ADDRESS }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_MAINNET_PROXY_ADDRESS }}
GNOSIS_ADDRESS: ${{ secrets.GNOSIS_ADDRESS }}
BNB_TESTNET_RPC_URL: ${{ secrets.BNB_TESTNET_RPC_URL }}
BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }}

jobs:
check:
deploy-mainnet:
strategy:
fail-fast: true

name: Bnb testnet deployment
name: Bnb mainnet deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -31,11 +31,6 @@ jobs:
with:
version: nightly

- name: Install Forge Dependencies
run: |
forge install openzeppelin-contracts-upgradeable=OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
id: install-dependency-contracts

- name: Run Forge build
run: |
forge --version
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/testnet-deployment-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ on:
push:
branches:
- main
workflow_dispatch:

env:
DEFENDER_KEY: ${{ secrets.DEFENDER_KEY }}
DEFENDER_SECRET: ${{ secrets.DEFENDER_SECRET }}
DEFENDER_RELAY_KEY: ${{ secrets.DEFENDER_BNB_TESTNET_RELAY_KEY }}
DEFENDER_RELAY_SECRET: ${{ secrets.DEFENDER_BNB_TESTNET_RELAY_SECRET }}
EXPLORER_API_KEY: ${{ secrets.BNB_EXPLORER_API_KEY }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_PROXY_ADDRESS }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_TESTNET_PROXY_ADDRESS }}
GNOSIS_ADDRESS: ${{ secrets.GNOSIS_ADDRESS }}
BNB_TESTNET_RPC_URL: ${{ secrets.BNB_TESTNET_RPC_URL }}
BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }}

jobs:
check:
upgrade-testnet:
strategy:
fail-fast: true

name: Bnb testnet deployment
name: Bnb testnet upgrade
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -33,11 +34,6 @@ jobs:
with:
version: nightly

- name: Install Forge Dependencies
run: |
forge install openzeppelin-contracts-upgradeable=OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
id: install-dependency-contracts

- name: Run Forge build
run: |
forge --version
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/testnet-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
name: bnb-testnet-deployment

on:
push:
branches:
- main
workflow_dispatch:

env:
DEFENDER_KEY: ${{ secrets.DEFENDER_KEY }}
DEFENDER_SECRET: ${{ secrets.DEFENDER_SECRET }}
DEFENDER_RELAY_KEY: ${{ secrets.DEFENDER_BNB_TESTNET_RELAY_KEY }}
DEFENDER_RELAY_SECRET: ${{ secrets.DEFENDER_BNB_TESTNET_RELAY_SECRET }}
EXPLORER_API_KEY: ${{ secrets.BNB_EXPLORER_API_KEY }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_PROXY_ADDRESS }}
DID_REGISTRY_PROXY_ADDRESS: ${{ secrets.DID_REGISTRY_TESTNET_PROXY_ADDRESS }}
GNOSIS_ADDRESS: ${{ secrets.GNOSIS_ADDRESS }}
BNB_TESTNET_RPC_URL: ${{ secrets.BNB_TESTNET_RPC_URL }}
BNB_RPC_URL: ${{ secrets.BNB_RPC_URL }}

jobs:
check:
deploy-testnet:
strategy:
fail-fast: true

Expand All @@ -33,11 +31,6 @@ jobs:
with:
version: nightly

- name: Install Forge Dependencies
run: |
forge install openzeppelin-contracts-upgradeable=OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
id: install-dependency-contracts

- name: Run Forge build
run: |
forge --version
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,7 @@ To run the test and get a test coverage report you can run:
### Contract deployment
This project uses hardhat scripts in combination with [Openzeppelin defender](https://www.openzeppelin.com/defender) and a multi-sig wallet (both on testnet and mainnet) for contract deployments. All deployment transactions occur through a [relayer](https://docs.openzeppelin.com/defender/v2/manage/relayers) and once deployed ownership of all contracts is transferred to the multi-sig wallet that is also managed in Defender.

#### Bnb testnet
Deployments are automatically triggered on every merge to the `main` branch via a github action and can also be run manually. Before deployments please ensure the relayer has enough testnet BNB. You can get more testnet bnb at [this faucet](https://testnet.bnbchain.org/faucet-smart).

- Relayer address: [0x8785567484518943B3eeB59882Ab9199994d04bF](https://testnet.bscscan.com/address/0x8785567484518943B3eeB59882Ab9199994d04bF)

- DidRegistry proxy address: 0x88a05b4370BbB90c9F3EEa72A65c77131a7bc18d
This project also uses BnB's explorer api key to verify contracts.

#### Bnb testnet
Deployments are automatically triggered on every merge to the `main` branch via a github action and can also be run manually. Before deployments please ensure the relayer has enough testnet BNB. You can get more testnet bnb at [this faucet](https://testnet.bnbchain.org/faucet-smart).
Expand All @@ -212,4 +207,21 @@ Deployments are manually triggered via a github action. Before deployments pleas

- Relayer address: TBD

- DidRegistry proxy address: TBD
- DidRegistry proxy address: TBD


#### Local deployment
To deploy locally you must have the following enviornment variables in your `.env` file:

- `DEFENDER_KEY` and `DEFENDER_SECRET`
- `DEFENDER_RELAY_KEY` and `DEFENDER_RELAY_SECRET`

- `EXPLORER_API_KEY`: Needed for contract source code verification

- `DID_REGISTRY_PROXY_ADDRESS`: Target address for upgrades and ownership changes
- `GNOSIS_ADDRESS`: Multi-sig wallet address that will become owner of deployed contracts

- `BNB_TESTNET_RPC_URL`: Needed for bnb testnet deployments
- `BNB_RPC_URL`: Needed for bnb mainnet deployments

Once these are configured you can run any of the deployment/upgrade scripts inside the `package.json` scripts.
4 changes: 0 additions & 4 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ const config: HardhatUserConfig = {
url: process.env.BNB_TESTNET_RPC_URL!,
chainId: 97
},
opBnb: {
url: "https://opbnb-testnet-rpc.bnbchain.org",
accounts: [process.env.BNB_TESTNET_PK!]
},
bnbSmartChain: {
url: process.env.BNB_RPC_URL!,
chainId: 56,
Expand Down

0 comments on commit c5b15fe

Please sign in to comment.