Skip to content

Commit d1a880d

Browse files
Support deployment on Sepolia
The Görli testnet currently used by Threshold/Keep for development purposes is planned to become deprecated with the end of year 2023. The testnet that is planned to replace it is called [Holešky](https://github.com/eth-clients/holesky), however it's not yet available - it's planned it will become widely accessible on Oct 1, 2023 ([source](https://everstake.one/blog/new-ethereum-testnet-holesky-all-you-need-to-know-now)). Switching our infrastructure to support new testnet is quite time consuming, so moving directly from Görli to Holešky may be quite risky, especially if there would be some delays in the date of Holešky genesis (not meeting the planned timelines is not a rare occurrence in the Ethereum space). As a solution, we decided to switch first to another testnet that is currently live - Sepolia. This testnet's EOL is planned for 2026, which gives us plenty of time to move to Holešky before Sepolia gets deprecated.
1 parent f6996df commit d1a880d

File tree

5 files changed

+50
-22
lines changed

5 files changed

+50
-22
lines changed

.github/workflows/contracts.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
workflow_dispatch:
2525
inputs:
2626
environment:
27-
description: "Environment (network) for workflow execution, e.g. `goerli`"
27+
description: "Environment (network) for workflow execution, e.g. `sepolia`"
2828
required: false
2929
upstream_builds:
3030
description: "Upstream builds"
@@ -153,9 +153,22 @@ jobs:
153153

154154
- name: Deploy contracts
155155
env:
156-
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
157-
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
158-
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
156+
# Use fake ternary expressions to decide which credentials to use,
157+
# depending on chosen environment. Note: if `GOERLI...` credentials
158+
# are empty, the expressions will be evaluated to the `SEPOLIA...`
159+
# ones.
160+
CHAIN_API_URL: |
161+
${{ inputs.github.event.inputs.environment == 'goerli'
162+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
163+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
164+
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
165+
${{ inputs.github.event.inputs.environment == 'goerli'
166+
&& secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY
167+
|| secrets.SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
168+
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
169+
${{ inputs.github.event.inputs.environment == 'goerli'
170+
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY
171+
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
159172
run: yarn deploy --network ${{ github.event.inputs.environment }}
160173

161174
- name: Bump up package version
@@ -224,7 +237,14 @@ jobs:
224237
- name: Verify contracts on Etherscan
225238
env:
226239
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
227-
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
240+
# Use fake ternary expression to decide which credentials to use,
241+
# depending on chosen environment. Note: if `GOERLI...` credential
242+
# is empty, the expressions will be evaluated to the `SEPOLIA...`
243+
# one.
244+
CHAIN_API_URL: |
245+
${{ inputs.github.event.inputs.environment == 'goerli'
246+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
247+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
228248
run: |
229249
yarn run hardhat --network ${{ github.event.inputs.environment }} \
230250
etherscan-verify --license GPL-3.0 --force-license
@@ -259,9 +279,22 @@ jobs:
259279

260280
- name: Deploy contracts
261281
env:
262-
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
263-
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
264-
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
282+
# Use fake ternary expressions to decide which credentials to use,
283+
# depending on chosen environment. Note: if `GOERLI...` credentials
284+
# are empty, the expressions will be evaluated to the `SEPOLIA...`
285+
# ones.
286+
CHAIN_API_URL: |
287+
${{ inputs.github.event.inputs.environment == 'goerli'
288+
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
289+
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
290+
CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
291+
${{ inputs.github.event.inputs.environment == 'goerli'
292+
&& secrets.DAPP_DEV_GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY
293+
|| secrets.DAPP_DEV_SEPOLIA_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
294+
KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: |
295+
${{ inputs.github.event.inputs.environment == 'goerli'
296+
&& secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY
297+
|| secrets.SEPOLIA_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
265298
run: yarn deploy --network ${{ github.event.inputs.environment }}
266299

267300
- name: Bump up package version

deploy/00_resolve_nucypher_staking_escrow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2626
} else if (
2727
// TODO: For testnets currently we deploy a stub contract. We should consider
2828
// switching to an actual contract.
29-
hre.network.name !== "ropsten" &&
29+
hre.network.name !== "sepolia" &&
3030
hre.network.name !== "goerli" &&
3131
(!hre.network.tags.allowStubs ||
3232
(hre.network.config as HardhatNetworkConfig)?.forking?.enabled)

deploy/00_resolve_nucypher_token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2121
} else if (
2222
// TODO: For testnets currently we deploy a stub contract. We should consider
2323
// switching to an actual contract.
24-
hre.network.name !== "ropsten" &&
24+
hre.network.name !== "sepolia" &&
2525
hre.network.name !== "goerli" &&
2626
(!hre.network.tags.allowStubs ||
2727
(hre.network.config as HardhatNetworkConfig)?.forking?.enabled)

deploy/07_deploy_token_staking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2525
]
2626
const tokenStakingInitializerArgs = []
2727

28-
// TODO: Consider upgradable deployment also for goerli.
28+
// TODO: Consider upgradable deployment also for goerli/sepolia.
2929
let tokenStakingAddress
3030
if (hre.network.name == "mainnet") {
3131
const TokenStaking = await ethers.getContractFactory("TokenStaking")

hardhat.config.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,13 @@ const config: HardhatUserConfig = {
5757
: undefined,
5858
tags: ["tenderly"],
5959
},
60-
rinkeby: {
60+
sepolia: {
6161
url: process.env.CHAIN_API_URL || "",
62-
chainId: 4,
63-
accounts: process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY
64-
? [process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY]
65-
: undefined,
66-
tags: ["tenderly"],
67-
},
68-
ropsten: {
69-
url: process.env.CHAIN_API_URL || "",
70-
chainId: 3,
62+
chainId: 11155111,
7163
accounts: process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY
7264
? [
7365
process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY,
74-
process.env.KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY,
66+
process.env.KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY, // TODO: verify if we have different owner here or can we remove this
7567
]
7668
: undefined,
7769
tags: ["tenderly"],
@@ -100,13 +92,15 @@ const config: HardhatUserConfig = {
10092
// to the contract artifacts.
10193
hardhat: process.env.FORKING_URL ? ["./external/mainnet"] : [],
10294
goerli: ["./external/goerli"],
95+
sepolia: ["./external/sepolia"],
10396
mainnet: ["./external/mainnet"],
10497
},
10598
},
10699
namedAccounts: {
107100
deployer: {
108101
default: 1, // take the first account as deployer
109102
goerli: 0,
103+
sepolia: 0,
110104
// mainnet: "0x123694886DBf5Ac94DDA07135349534536D14cAf",
111105
},
112106
thresholdCouncil: {
@@ -116,6 +110,7 @@ const config: HardhatUserConfig = {
116110
default: 1, // same as the deployer
117111
ropsten: "0x923C5Dbf353e99394A21Aa7B67F3327Ca111C67D",
118112
goerli: "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc",
113+
// sepolia: "", TODO: Fill with the address of the deployer
119114
},
120115
},
121116
mocha: {

0 commit comments

Comments
 (0)