@@ -6,21 +6,51 @@ import {IL1MessageQueueV2} from "../L1/rollup/IL1MessageQueueV2.sol";
66
77import {ScrollChainValidium} from "../validium/ScrollChainValidium.sol " ;
88
9+ /// @title ScrollChainValidiumMock
10+ /// @dev This contract should only be deployed on testnet.
911contract ScrollChainValidiumMock is ScrollChainValidium {
12+ /*********************
13+ * Storage Variables *
14+ *********************/
15+
16+ /// @notice If set to false, we allow finalizing bundles with an arbitrary (or empty) proof.
17+ bool public requireProof;
18+
19+ /***************
20+ * Constructor *
21+ ***************/
22+
1023 constructor (
1124 uint64 _chainId ,
1225 address _messageQueueV2 ,
1326 address _verifier
1427 ) ScrollChainValidium (_chainId, _messageQueueV2, _verifier) {}
1528
29+ /************************
30+ * Restricted Functions *
31+ ************************/
32+
33+ function setRequireProof (bool _requireProof ) external onlyRole (DEFAULT_ADMIN_ROLE) {
34+ requireProof = _requireProof;
35+ }
36+
37+ /**********************
38+ * Internal Functions *
39+ **********************/
40+
1641 /// @dev Internal function to finalize a bundle.
1742 /// @param batchHeader The header of the last batch in this bundle.
1843 /// @param totalL1MessagesPoppedOverall The number of messages processed after this bundle.
44+ /// @param aggrProof The bundle proof for this bundle.
1945 function _finalizeBundle (
2046 bytes calldata batchHeader ,
2147 uint256 totalL1MessagesPoppedOverall ,
22- bytes calldata
48+ bytes calldata aggrProof
2349 ) internal virtual override {
50+ if (requireProof) {
51+ return super ._finalizeBundle (batchHeader, totalL1MessagesPoppedOverall, aggrProof);
52+ }
53+
2454 // actions before verification
2555 (, bytes32 batchHash , uint256 batchIndex , ) = _beforeFinalizeBatch (batchHeader);
2656
0 commit comments