-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #299 from OffchainLabs/bigmap-develop
chore: bigmap mock and update metadata hash script
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |