From 9781b873c52f19018a071c29d533a1c1fba0c308 Mon Sep 17 00:00:00 2001 From: CJ42 <31145285+CJ42@users.noreply.github.com> Date: Wed, 22 Feb 2023 12:54:48 +0000 Subject: [PATCH] ci: output deployer address to fund when CI fails --- scripts/ci/check-deployer-balance.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ci/check-deployer-balance.ts b/scripts/ci/check-deployer-balance.ts index 6b6c76d60..48fee9b15 100644 --- a/scripts/ci/check-deployer-balance.ts +++ b/scripts/ci/check-deployer-balance.ts @@ -5,6 +5,7 @@ import { resolve } from "path"; dotenvConfig({ path: resolve(__dirname, "./.env") }); const wallet = new ethers.Wallet(process.env.CONTRACT_VERIFICATION_PK); +const deployerAddress = wallet.address; const provider = new ethers.providers.JsonRpcProvider( config.networks.luksoL16["url"] @@ -14,17 +15,16 @@ const provider = new ethers.providers.JsonRpcProvider( const MINIMUM_DEPLOYER_BALANCE = ethers.utils.parseUnits("1.0", "ether"); async function main() { - const deployerBalance = await provider.getBalance( - "0xb873C3987112b0043A5C441722097C13F2dd5E78" - ); + const deployerBalance = await provider.getBalance(deployerAddress); if (deployerBalance.lt(MINIMUM_DEPLOYER_BALANCE)) { throw new Error( - `❌ Deployer balance is too low. Please fund the deployer with at least ${MINIMUM_DEPLOYER_BALANCE} LYXe` + `❌ Deployer balance is too low. Please fund the deployer address ${deployerAddress} with at least ${MINIMUM_DEPLOYER_BALANCE} LYXe` ); } else { console.log( `✅ Deployer balance sufficient to deploy + verify contracts. + Deployer address: ${deployerAddress} Balance: ${ethers.utils.formatEther(deployerBalance)} LYXe` ); }