Skip to content

Commit

Permalink
Merge pull request #299 from OffchainLabs/bigmap-develop
Browse files Browse the repository at this point in the history
chore: bigmap mock and update metadata hash script
  • Loading branch information
gzeoneth authored Feb 6, 2025
2 parents 33a495a + 402ac22 commit 612fe67
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/printMetadataHashes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ async function main() {
'Outbox',
'SequencerInbox',
'Bridge',
'RollupEventInbox',
'ERC20Inbox',
'ERC20Outbox',
'SequencerInbox',
'ERC20Bridge',
'ERC20RollupEventInbox',
'RollupProxy',
'RollupAdminLogic',
'RollupUserLogic',
'ChallengeManager',
'EdgeChallengeManager',
]

// Print the current git tag
Expand Down
23 changes: 23 additions & 0 deletions src/mocks/BigMap.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2025, Offchain Labs, Inc.
// For license information, see:
// https://github.com/OffchainLabs/nitro/blob/master/LICENSE.md
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

contract BigMap {
mapping(uint256 => uint256) public data;
uint256 size;

function clearAndAddValues(uint256 clear, uint256 add) external {
uint256 i = size;
while (i < size + add) {
data[i] = 8675309;
i++;
}
size = i;
for (uint256 j = 0; j < clear; j++) {
data[j] = 0;
}
}
}

0 comments on commit 612fe67

Please sign in to comment.