-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protocol): deploy the generated Yul plonk verifier (#13016)
- Loading branch information
1 parent
1bfa69b
commit eb5d564
Showing
18 changed files
with
1,839 additions
and
165 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ typechain | |
abis | ||
abi | ||
deployments/*.json | ||
|
||
bin | ||
yarn.lock | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
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 |
---|---|---|
|
@@ -6,18 +6,19 @@ | |
|
||
pragma solidity ^0.8.9; | ||
|
||
import "../thirdparty/LibMerkleTrie.sol"; | ||
import "../common/EssentialContract.sol"; | ||
import "../libs/LibZKP.sol"; | ||
import "../thirdparty/LibMerkleTrie.sol"; | ||
|
||
/// @author dantaik <[email protected]> | ||
interface IProofVerifier { | ||
function verifyZKP( | ||
bytes memory verificationKey, | ||
string memory verifierId, | ||
bytes calldata zkproof, | ||
bytes32 blockHash, | ||
address prover, | ||
bytes32 txListHash | ||
) external pure returns (bool verified); | ||
) external view returns (bool verified); | ||
|
||
function verifyMKP( | ||
bytes memory key, | ||
|
@@ -27,17 +28,21 @@ interface IProofVerifier { | |
) external pure returns (bool verified); | ||
} | ||
|
||
contract ProofVerifier is IProofVerifier { | ||
contract ProofVerifier is IProofVerifier, EssentialContract { | ||
function init(address addressManager) external initializer { | ||
EssentialContract._init(addressManager); | ||
} | ||
|
||
function verifyZKP( | ||
bytes memory verificationKey, | ||
string memory verifierId, | ||
bytes calldata zkproof, | ||
bytes32 blockHash, | ||
address prover, | ||
bytes32 txListHash | ||
) external pure returns (bool) { | ||
) external view returns (bool) { | ||
return | ||
LibZKP.verify({ | ||
verificationKey: verificationKey, | ||
plonkVerifier: resolve(verifierId, false), | ||
zkproof: zkproof, | ||
blockHash: blockHash, | ||
prover: prover, | ||
|
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.