Skip to content

Commit

Permalink
ci: output deployer address to fund when CI fails
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Feb 22, 2023
1 parent 005e174 commit 9781b87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/ci/check-deployer-balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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`
);
}
Expand Down

0 comments on commit 9781b87

Please sign in to comment.