diff --git a/.github/workflows/contracts-ecdsa.yml b/.github/workflows/contracts-ecdsa.yml index b3cd549f5a..484bd37c85 100644 --- a/.github/workflows/contracts-ecdsa.yml +++ b/.github/workflows/contracts-ecdsa.yml @@ -27,8 +27,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 @@ -252,8 +252,15 @@ jobs: - name: Deploy contracts env: - CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }} - ACCOUNTS_PRIVATE_KEYS: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + # Using fake ternary expression 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 }} + ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} run: yarn deploy --network ${{ github.event.inputs.environment }} @@ -340,8 +347,15 @@ 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 }} + # Using fake ternary expression 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 }} + ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} run: yarn deploy --network ${{ github.event.inputs.environment }} diff --git a/.github/workflows/contracts-random-beacon.yml b/.github/workflows/contracts-random-beacon.yml index 17cf44b937..12e6007283 100644 --- a/.github/workflows/contracts-random-beacon.yml +++ b/.github/workflows/contracts-random-beacon.yml @@ -27,8 +27,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 @@ -248,8 +248,15 @@ jobs: - name: Deploy contracts env: - CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }} - ACCOUNTS_PRIVATE_KEYS: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + # Using fake ternary expression 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 }} + ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} run: yarn deploy --network ${{ github.event.inputs.environment }} @@ -334,8 +341,15 @@ 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 }} + # Using fake ternary expression 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 }} + ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} run: yarn deploy --network ${{ github.event.inputs.environment }} diff --git a/solidity/ecdsa/deploy/09_deploy_wallet_registry_governance.ts b/solidity/ecdsa/deploy/09_deploy_wallet_registry_governance.ts index 90ebc50acb..965e04ad0a 100644 --- a/solidity/ecdsa/deploy/09_deploy_wallet_registry_governance.ts +++ b/solidity/ecdsa/deploy/09_deploy_wallet_registry_governance.ts @@ -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", diff --git a/solidity/ecdsa/hardhat.config.ts b/solidity/ecdsa/hardhat.config.ts index 52bad239db..b9e160bf6e 100644 --- a/solidity/ecdsa/hardhat.config.ts +++ b/solidity/ecdsa/hardhat.config.ts @@ -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, @@ -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 }, }, @@ -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"], }, }, diff --git a/solidity/random-beacon/deploy/01_deploy_reimbursement_pool.ts b/solidity/random-beacon/deploy/01_deploy_reimbursement_pool.ts index 5e1990076f..9832d42288 100644 --- a/solidity/random-beacon/deploy/01_deploy_reimbursement_pool.ts +++ b/solidity/random-beacon/deploy/01_deploy_reimbursement_pool.ts @@ -16,6 +16,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { }) if (hre.network.tags.etherscan) { + await hre.ethers.provider.waitForTransaction( + ReimbursementPool.transactionHash, + 2, + 300000 + ) await helpers.etherscan.verify(ReimbursementPool) } diff --git a/solidity/random-beacon/deploy/02_deploy_beacon_sortition_pool.ts b/solidity/random-beacon/deploy/02_deploy_beacon_sortition_pool.ts index 7b8dbcce0c..12ce503e42 100644 --- a/solidity/random-beacon/deploy/02_deploy_beacon_sortition_pool.ts +++ b/solidity/random-beacon/deploy/02_deploy_beacon_sortition_pool.ts @@ -27,6 +27,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { ) if (hre.network.tags.etherscan) { + await hre.ethers.provider.waitForTransaction( + BeaconSortitionPool.transactionHash, + 2, + 300000 + ) await helpers.etherscan.verify(BeaconSortitionPool) } diff --git a/solidity/random-beacon/deploy/03_deploy_beacon_dkg_validator.ts b/solidity/random-beacon/deploy/03_deploy_beacon_dkg_validator.ts index 84f69c1f21..ae34ed752a 100644 --- a/solidity/random-beacon/deploy/03_deploy_beacon_dkg_validator.ts +++ b/solidity/random-beacon/deploy/03_deploy_beacon_dkg_validator.ts @@ -15,6 +15,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { }) if (hre.network.tags.etherscan) { + await hre.ethers.provider.waitForTransaction( + BeaconDkgValidator.transactionHash, + 2, + 300000 + ) await helpers.etherscan.verify(BeaconDkgValidator) } diff --git a/solidity/random-beacon/deploy/04_deploy_random_beacon.ts b/solidity/random-beacon/deploy/04_deploy_random_beacon.ts index 72b0c85c27..9ff3a57b6f 100644 --- a/solidity/random-beacon/deploy/04_deploy_random_beacon.ts +++ b/solidity/random-beacon/deploy/04_deploy_random_beacon.ts @@ -59,6 +59,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { ) if (hre.network.tags.etherscan) { + await hre.ethers.provider.waitForTransaction( + RandomBeacon.transactionHash, + 2, + 300000 + ) await helpers.etherscan.verify(BLS) await helpers.etherscan.verify(BeaconAuthorization) await helpers.etherscan.verify(BeaconDkg) diff --git a/solidity/random-beacon/deploy/07_deploy_random_beacon_governance.ts b/solidity/random-beacon/deploy/07_deploy_random_beacon_governance.ts index 9a5261c115..95e2b41815 100644 --- a/solidity/random-beacon/deploy/07_deploy_random_beacon_governance.ts +++ b/solidity/random-beacon/deploy/07_deploy_random_beacon_governance.ts @@ -20,6 +20,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { ) if (hre.network.tags.etherscan) { + await hre.ethers.provider.waitForTransaction( + RandomBeaconGovernance.transactionHash, + 2, + 300000 + ) await helpers.etherscan.verify(RandomBeaconGovernance) } diff --git a/solidity/random-beacon/deploy/09_deploy_random_beacon_chaosnet.ts b/solidity/random-beacon/deploy/09_deploy_random_beacon_chaosnet.ts index 0cf013857e..9828554555 100644 --- a/solidity/random-beacon/deploy/09_deploy_random_beacon_chaosnet.ts +++ b/solidity/random-beacon/deploy/09_deploy_random_beacon_chaosnet.ts @@ -19,6 +19,11 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { ) if (hre.network.tags.etherscan) { + await hre.ethers.provider.waitForTransaction( + RandomBeaconChaosnet.transactionHash, + 2, + 300000 + ) await helpers.etherscan.verify(RandomBeaconChaosnet) } diff --git a/solidity/random-beacon/hardhat.config.ts b/solidity/random-beacon/hardhat.config.ts index a4a4092bfb..020c0ce0d9 100644 --- a/solidity/random-beacon/hardhat.config.ts +++ b/solidity/random-beacon/hardhat.config.ts @@ -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, @@ -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 }, }, @@ -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"], }, },