From 2cda86a0b2746438478cda44157e5fec08cb4272 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Mon, 7 Jul 2025 23:46:25 +0300 Subject: [PATCH] check balance top up --- rollup-bridge-contracts/task/nil-smart-account.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rollup-bridge-contracts/task/nil-smart-account.ts b/rollup-bridge-contracts/task/nil-smart-account.ts index cd3ae56ef..83fb2f5cc 100644 --- a/rollup-bridge-contracts/task/nil-smart-account.ts +++ b/rollup-bridge-contracts/task/nil-smart-account.ts @@ -133,6 +133,11 @@ export async function generateNilSmartAccount(networkName: string): Promise<[Sma console.log(`faucet topup initiation done`); await waitTillCompleted(client, topUpFaucet); + const ownerBalance = await smartAccount.getBalance(); + if (ownerBalance === 0n) { + throw new Error(`Owner smart account balance is 0 after faucet top-up`); + } + if ((await smartAccount.checkDeploymentStatus()) === false) { await smartAccount.selfDeploy(true); } @@ -146,6 +151,11 @@ export async function generateNilSmartAccount(networkName: string): Promise<[Sma console.log(`faucet topup initiation done`); await waitTillCompleted(client, topUpFaucet); + const depositBalance = await depositRecipientSmartAccount.getBalance(); + if (depositBalance === 0n) { + throw new Error(`Deposit recipient smart account balance is 0 after faucet top-up`); + } + if ((await depositRecipientSmartAccount.checkDeploymentStatus()) === false) { await depositRecipientSmartAccount.selfDeploy(true); }