-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into denis/dev_func_args_4
- Loading branch information
Showing
91 changed files
with
564 additions
and
545 deletions.
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
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
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
34 changes: 34 additions & 0 deletions
34
l1-contracts/contracts/state-transition/TestnetVerifier.sol
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,34 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.20; | ||
|
||
import {Verifier} from "./Verifier.sol"; | ||
import {IVerifier} from "./chain-interfaces/IVerifier.sol"; | ||
|
||
/// @author Matter Labs | ||
/// @custom:security-contact [email protected] | ||
/// @notice Modified version of the main verifier contract for the testnet environment | ||
/// @dev This contract is used to skip the zkp verification for the testnet environment. | ||
/// If the proof is not empty, it will verify it using the main verifier contract, | ||
/// otherwise, it will skip the verification. | ||
contract TestnetVerifier is Verifier { | ||
constructor() { | ||
assert(block.chainid != 1); | ||
} | ||
|
||
/// @dev Verifies a zk-SNARK proof, skipping the verification if the proof is empty. | ||
/// @inheritdoc IVerifier | ||
function verify( | ||
uint256[] calldata _publicInputs, | ||
uint256[] calldata _proof, | ||
uint256[] calldata _recursiveAggregationInput | ||
) public view override returns (bool) { | ||
// We allow skipping the zkp verification for the test(net) environment | ||
// If the proof is not empty, verify it, otherwise, skip the verification | ||
if (_proof.length == 0) { | ||
return true; | ||
} | ||
|
||
return super.verify(_publicInputs, _proof, _recursiveAggregationInput); | ||
} | ||
} |
Oops, something went wrong.