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 #3706

Merged
merged 9 commits into from
Sep 25, 2023
44 changes: 37 additions & 7 deletions .github/workflows/contracts-ecdsa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
workflow_dispatch:
inputs:
environment:
description: "Environment (network) for workflow execution, e.g. `goerli`"
description: "Environment (network) for workflow execution, e.g. `sepolia`"
required: false
upstream_builds:
description: "Upstream builds"
Expand Down Expand Up @@ -252,9 +252,24 @@ jobs:

- name: Deploy contracts
env:
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
# Use fake ternary expressions to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI...` credentials
# are empty, the expressions will be evaluated to the `SEPOLIA...`
# ones.
lukasz-zimnoch marked this conversation as resolved.
Show resolved Hide resolved
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
# TODO: Shouldn't we use `ACCOUNTS_PRIVATE_KEYS` here instead of the
# two below envs?
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY
|| secrets.SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
run: yarn deploy --network ${{ github.event.inputs.environment }}

- name: Bump up package version
Expand Down Expand Up @@ -340,9 +355,24 @@ jobs:

- name: Deploy contracts
env:
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
# Use fake ternary expressions to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI...` credentials
# are empty, the expressions will be evaluated to the `SEPOLIA...`
# ones.
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
# TODO: Shouldn't we use `ACCOUNTS_PRIVATE_KEYS` here instead of the
# two below envs?
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY
|| secrets.DAPP_DEV_SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
run: yarn deploy --network ${{ github.event.inputs.environment }}

- name: Bump up package version
Expand Down
44 changes: 37 additions & 7 deletions .github/workflows/contracts-random-beacon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
workflow_dispatch:
inputs:
environment:
description: "Environment (network) for workflow execution, e.g. `goerli`"
description: "Environment (network) for workflow execution, e.g. `sepolia`"
required: false
upstream_builds:
description: "Upstream builds"
Expand Down Expand Up @@ -248,9 +248,24 @@ jobs:

- name: Deploy contracts
env:
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
# Use fake ternary expressions to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI...` credentials
# are empty, the expressions will be evaluated to the `SEPOLIA...`
# ones.
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
# TODO: Shouldn't we use `ACCOUNTS_PRIVATE_KEYS` here instead of the
# two below envs?
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY
|| secrets.SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
run: yarn deploy --network ${{ github.event.inputs.environment }}

- name: Bump up package version
Expand Down Expand Up @@ -334,9 +349,24 @@ jobs:

- name: Deploy contracts
env:
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
# Use fake ternary expressions to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI...` credentials
# are empty, the expressions will be evaluated to the `SEPOLIA...`
# ones.
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
# TODO: Shouldn't we use `ACCOUNTS_PRIVATE_KEYS` here instead of the
# two below envs?
lukasz-zimnoch marked this conversation as resolved.
Show resolved Hide resolved
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY
|| secrets.DAPP_DEV_SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
run: yarn deploy --network ${{ github.event.inputs.environment }}

- name: Bump up package version
Expand Down
7 changes: 5 additions & 2 deletions solidity/ecdsa/deploy/09_deploy_wallet_registry_governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {

const WalletRegistry = await deployments.get("WalletRegistry")

// 60 seconds for Goerli. 1 week otherwise.
const GOVERNANCE_DELAY = hre.network.name === "goerli" ? 60 : 604800
// 60 seconds for Goerli/Sepolia. 1 week otherwise.
const GOVERNANCE_DELAY =
hre.network.name === "goerli" || hre.network.name === "sepolia"
? 60
: 604800

const WalletRegistryGovernance = await deployments.deploy(
"WalletRegistryGovernance",
Expand Down
16 changes: 16 additions & 0 deletions solidity/ecdsa/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ const config: HardhatUserConfig = {
: undefined,
tags: ["etherscan", "tenderly", "useRandomBeaconChaosnet"],
},
sepolia: {
url: process.env.CHAIN_API_URL || "",
chainId: 11155111,
accounts: process.env.ACCOUNTS_PRIVATE_KEYS
? process.env.ACCOUNTS_PRIVATE_KEYS.split(",")
: undefined,
tags: ["etherscan", "tenderly", "useRandomBeaconChaosnet"],
},
mainnet: {
url: process.env.CHAIN_API_URL || "",
chainId: 1,
Expand All @@ -143,21 +151,25 @@ const config: HardhatUserConfig = {
deployer: {
default: 1, // take the second account
goerli: 0,
sepolia: 0,
mainnet: 0, // "0x123694886DBf5Ac94DDA07135349534536D14cAf"
},
governance: {
default: 2,
goerli: 0,
sepolia: 0,
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
},
chaosnetOwner: {
default: 3,
goerli: 0,
sepolia: 0,
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
},
esdm: {
default: 4,
goerli: 0,
sepolia: 0,
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
},
},
Expand Down Expand Up @@ -192,6 +204,10 @@ const config: HardhatUserConfig = {
"node_modules/@threshold-network/solidity-contracts/artifacts",
"node_modules/@keep-network/random-beacon/artifacts",
],
sepolia: [
"node_modules/@threshold-network/solidity-contracts/artifacts",
"node_modules/@keep-network/random-beacon/artifacts",
],
mainnet: ["./external/mainnet"],
},
},
Expand Down
12 changes: 12 additions & 0 deletions solidity/random-beacon/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ const config: HardhatUserConfig = {
: undefined,
tags: ["etherscan", "tenderly"],
},
sepolia: {
url: process.env.CHAIN_API_URL || "",
chainId: 11155111,
accounts: process.env.ACCOUNTS_PRIVATE_KEYS
? process.env.ACCOUNTS_PRIVATE_KEYS.split(",")
: undefined,
tags: ["etherscan", "tenderly"],
},
mainnet: {
url: process.env.CHAIN_API_URL || "",
chainId: 1,
Expand All @@ -131,16 +139,19 @@ const config: HardhatUserConfig = {
deployer: {
default: 1,
goerli: 0,
sepolia: 0,
mainnet: 0, // "0x123694886DBf5Ac94DDA07135349534536D14cAf"
},
governance: {
default: 2,
goerli: 0,
sepolia: 0,
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
},
chaosnetOwner: {
default: 3,
goerli: 0,
sepolia: 0,
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
},
},
Expand All @@ -166,6 +177,7 @@ const config: HardhatUserConfig = {
"node_modules/@threshold-network/solidity-contracts/deployments/development",
],
goerli: ["node_modules/@threshold-network/solidity-contracts/artifacts"],
sepolia: ["node_modules/@threshold-network/solidity-contracts/artifacts"],
mainnet: ["./external/mainnet"],
},
},
Expand Down