Skip to content

Commit

Permalink
Merge pull request #75 from OffchainLabs/multiple_batch
Browse files Browse the repository at this point in the history
Add option to post multiple batch in simple.sol
  • Loading branch information
gzeoneth authored Dec 5, 2023
2 parents 8e29dac + a5e8f33 commit b0df580
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/mocks/Simple.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

pragma solidity ^0.8.0;

import "../bridge/ISequencerInbox.sol";
import "../precompiles/ArbRetryableTx.sol";
import "../precompiles/ArbSys.sol";

Expand Down Expand Up @@ -130,4 +131,24 @@ contract Simple {
to.staticcall{gas: before - 10000}(input);
return before - gasleft();
}

function postManyBatches(
ISequencerInbox sequencerInbox,
bytes memory batchData,
uint256 numberToPost
) external {
uint256 sequenceNumber = sequencerInbox.batchCount();
uint256 delayedMessagesRead = sequencerInbox.totalDelayedMessagesRead();
for (uint256 i = 0; i < numberToPost; i++) {
sequencerInbox.addSequencerL2Batch(
sequenceNumber,
batchData,
delayedMessagesRead,
IGasRefunder(address(0)),
0,
0
);
sequenceNumber++;
}
}
}

0 comments on commit b0df580

Please sign in to comment.