Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support deployment on Sepolia #151

Merged
merged 7 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 30 additions & 9 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ on:
workflow_dispatch:
inputs:
environment:
description: "Environment (network) for workflow execution, e.g. `goerli`"
required: false
description: "Environment (network) for workflow execution, e.g. `sepolia`"
required: true
upstream_builds:
description: "Upstream builds"
required: false
Expand Down Expand Up @@ -153,9 +153,16 @@ jobs:

- name: Deploy contracts
env:
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
# Using fake ternary expressions to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
# is empty, the expression will be evaluated to
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY
run: yarn deploy --network ${{ github.event.inputs.environment }}

- name: Bump up package version
Expand Down Expand Up @@ -224,7 +231,14 @@ jobs:
- name: Verify contracts on Etherscan
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
# Using fake ternary expressions to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
# is empty, the expression will be evaluated to
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
run: |
yarn run hardhat --network ${{ github.event.inputs.environment }} \
etherscan-verify --license GPL-3.0 --force-license
Expand Down Expand Up @@ -259,9 +273,16 @@ jobs:

- name: Deploy contracts
env:
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
# Using fake ternary expressions to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
# is empty, the expression will be evaluated to
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY
run: yarn deploy --network ${{ github.event.inputs.environment }}

- name: Bump up package version
Expand Down
2 changes: 1 addition & 1 deletion deploy/00_resolve_nucypher_staking_escrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
} else if (
// TODO: For testnets currently we deploy a stub contract. We should consider
// switching to an actual contract.
hre.network.name !== "ropsten" &&
hre.network.name !== "sepolia" &&
hre.network.name !== "goerli" &&
(!hre.network.tags.allowStubs ||
(hre.network.config as HardhatNetworkConfig)?.forking?.enabled)
Expand Down
2 changes: 1 addition & 1 deletion deploy/00_resolve_nucypher_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
} else if (
// TODO: For testnets currently we deploy a stub contract. We should consider
// switching to an actual contract.
hre.network.name !== "ropsten" &&
hre.network.name !== "sepolia" &&
hre.network.name !== "goerli" &&
(!hre.network.tags.allowStubs ||
(hre.network.config as HardhatNetworkConfig)?.forking?.enabled)
Expand Down
2 changes: 1 addition & 1 deletion deploy/07_deploy_token_staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
]
const tokenStakingInitializerArgs = []

// TODO: Consider upgradable deployment also for goerli.
// TODO: Consider upgradable deployment also for goerli/sepolia.
let tokenStakingAddress
if (hre.network.name == "mainnet") {
const TokenStaking = await ethers.getContractFactory("TokenStaking")
Expand Down
Loading
Loading