Skip to content

Commit

Permalink
Swap blob and withdrawer back for normal ops (#26)
Browse files Browse the repository at this point in the history
# What ❔

Swap the order back to normal operations
  • Loading branch information
anton-matterlabs authored Mar 10, 2024
1 parent 2cf3ec5 commit b891501
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(`----------------------------------------------------------------------------`);

Expand Down

0 comments on commit b891501

Please sign in to comment.