File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -214,18 +214,19 @@ contract AlignedLayerServiceManager is
214214 // 70k was measured by trial and error until the aggregator got paid a bit over what it needed
215215 uint256 txCost = (initialGasLeft - gasleft () + 70_000 ) * tx .gasprice ;
216216
217- if (txCost > currentBatch.respondToTaskFeeLimit) {
218- // Subtract the txCost from the batcher's balance
219- batchersBalances[senderAddress] -= currentBatch.respondToTaskFeeLimit;
220- } else {
221- batchersBalances[senderAddress] -= txCost;
222- }
217+ // limit amount to spend is respondToTaskFeeLimit
218+ // transferAmount = if txCost > currentBatch.respondToTaskFeeLimit -> currentBatch.respondToTaskFeeLimit; else -> txCost
219+ uint256 transferAmount = txCost > currentBatch.respondToTaskFeeLimit ?
220+ currentBatch.respondToTaskFeeLimit : txCost;
221+
222+ batchersBalances[senderAddress] -= transferAmount;
223223
224224 emit BatcherBalanceUpdated (
225225 senderAddress,
226226 batchersBalances[senderAddress]
227227 );
228- payable (alignedAggregator).transfer (txCost);
228+
229+ payable (alignedAggregator).transfer (transferAmount);
229230 }
230231
231232 function isVerifierDisabled (
You can’t perform that action at this time.
0 commit comments