From b8915010319d8356f0270249c970c7e599193510 Mon Sep 17 00:00:00 2001 From: anton-matterlabs <106071574+anton-matterlabs@users.noreply.github.com> Date: Sun, 10 Mar 2024 10:35:44 +0100 Subject: [PATCH] Swap blob and withdrawer back for normal ops (#26) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What ❔ Swap the order back to normal operations --- src/index.ts | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2b5c692..46c4bf5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -300,36 +300,35 @@ async function sendETH(ethWallet: ethers.Wallet, to: string, amount: BigNumber) [transferAmount, l1feeAccountBalance] = await calculateTransferAmount( l1feeAccountBalance, - withdrawerBalance, - UPPER_BOUND_WITHDRAWER_THRESHOLD, - LOWER_BOUND_WITHDRAWER_THRESHOLD, + blobOperatorBalance, + UPPER_BOUND_BLOB_OPERATOR_THRESHOLD, + LOWER_BOUND_BLOB_OPERATOR_THRESHOLD, L1_ETH_TRANSFER_THRESHOLD ); console.log( - `Amount which fee account can send to withdrawer: ${ethers.utils.formatEther(transferAmount)} ETH; + `Amount which fee account can send to blob operator: ${ethers.utils.formatEther(transferAmount)} ETH; fee account l1 balance in this case will be ${ethers.utils.formatEther(l1feeAccountBalance)} ETH` ); - console.log('Step 5 - send ETH to withdrawal finalizer'); - await sendETH(ethWallet, WITHDRAWAL_FINALIZER_ETH_ADDRESS, transferAmount); + console.log('Step 5 - send ETH to blob operator'); + await sendETH(ethWallet, BLOB_OPERATOR_ADDRESS, transferAmount); console.log(`----------------------------------------------------------------------------`); - [transferAmount, l1feeAccountBalance] = await calculateTransferAmount( l1feeAccountBalance, - blobOperatorBalance, - UPPER_BOUND_BLOB_OPERATOR_THRESHOLD, - LOWER_BOUND_BLOB_OPERATOR_THRESHOLD, + withdrawerBalance, + UPPER_BOUND_WITHDRAWER_THRESHOLD, + LOWER_BOUND_WITHDRAWER_THRESHOLD, L1_ETH_TRANSFER_THRESHOLD ); console.log( - `Amount which fee account can send to blob operator: ${ethers.utils.formatEther(transferAmount)} ETH; + `Amount which fee account can send to withdrawer: ${ethers.utils.formatEther(transferAmount)} ETH; fee account l1 balance in this case will be ${ethers.utils.formatEther(l1feeAccountBalance)} ETH` ); - console.log('Step 6 - send ETH to blob operator'); - await sendETH(ethWallet, BLOB_OPERATOR_ADDRESS, transferAmount); + console.log('Step 6 - send ETH to withdrawal finalizer'); + await sendETH(ethWallet, WITHDRAWAL_FINALIZER_ETH_ADDRESS, transferAmount); console.log(`----------------------------------------------------------------------------`);