Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion src/mocks/ScrollChainValidiumMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,51 @@ import {IL1MessageQueueV2} from "../L1/rollup/IL1MessageQueueV2.sol";

import {ScrollChainValidium} from "../validium/ScrollChainValidium.sol";

/// @title ScrollChainValidiumMock
/// @dev This contract should only be deployed on testnet.
contract ScrollChainValidiumMock is ScrollChainValidium {
/*********************
* Storage Variables *
*********************/

/// @notice If set to false, we allow finalizing bundles with an arbitrary (or empty) proof.
bool public requireProof;

/***************
* Constructor *
***************/

constructor(
uint64 _chainId,
address _messageQueueV2,
address _verifier
) ScrollChainValidium(_chainId, _messageQueueV2, _verifier) {}

/************************
* Restricted Functions *
************************/

function setRequireProof(bool _requireProof) external onlyRole(DEFAULT_ADMIN_ROLE) {
requireProof = _requireProof;
}

/**********************
* Internal Functions *
**********************/

/// @dev Internal function to finalize a bundle.
/// @param batchHeader The header of the last batch in this bundle.
/// @param totalL1MessagesPoppedOverall The number of messages processed after this bundle.
/// @param aggrProof The bundle proof for this bundle.
function _finalizeBundle(
bytes calldata batchHeader,
uint256 totalL1MessagesPoppedOverall,
bytes calldata
bytes calldata aggrProof
) internal virtual override {
if (requireProof) {
return super._finalizeBundle(batchHeader, totalL1MessagesPoppedOverall, aggrProof);
}

// actions before verification
(, bytes32 batchHash, uint256 batchIndex, ) = _beforeFinalizeBatch(batchHeader);

Expand Down
3 changes: 3 additions & 0 deletions src/validium/ScrollChainValidium.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ contract ScrollChainValidium is AccessControlUpgradeable, PausableUpgradeable, I
/// @dev An array of encryption keys.
EncryptionKey[] public encryptionKeys;

/// @dev The storage slots reserved for future usage.
uint256[50] private __gap;

/***************
* Constructor *
***************/
Expand Down
Loading