Skip to content

Commit

Permalink
Update LibEthDepositing.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Jun 2, 2023
1 parent 93f2805 commit e08aefa
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/protocol/contracts/L1/libs/LibEthDepositing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,18 @@ library LibEthDepositing {
&& state.nextEthDepositToProcess
+ config.maxEthDepositsPerBlock > i
) {
TaikoData.EthDeposit storage deposit = state.ethDeposits[i];
if (deposit.amount > feePerDeposit) {
totalFee += feePerDeposit;

depositsProcessed[j].recipient = deposit.recipient;
depositsProcessed[j].amount =
deposit.amount - feePerDeposit;
depositsProcessed[j].id = deposit.id;
depositsProcessed[j] = state.ethDeposits[i];

++j;
if (depositsProcessed[j].amount > feePerDeposit) {
totalFee += feePerDeposit;
depositsProcessed[j].amount -= feePerDeposit;
} else {
totalFee += deposit.amount;
totalFee += depositsProcessed[j].amount;
depositsProcessed[j].amount = 0;
}

++i;
++j;
}

// Fee collecting deposit
Expand Down

0 comments on commit e08aefa

Please sign in to comment.