forked from yetanotherco/aligned_layer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VerifyBatchInclusionCaller.sol
37 lines (32 loc) · 1.17 KB
/
VerifyBatchInclusionCaller.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.12;
contract VerifyBatchInclusionCaller {
address public targetContract;
constructor(address _targetContract) {
targetContract = _targetContract;
}
function verifyBatchInclusion(
bytes32 proofCommitment,
bytes32 pubInputCommitment,
bytes32 provingSystemAuxDataCommitment,
bytes20 proofGeneratorAddr,
bytes32 batchMerkleRoot,
bytes memory merkleProof,
uint256 verificationDataBatchIndex
) external view returns (bool) {
(bool callWasSuccessfull, bytes memory proofIsIncluded) = targetContract.staticcall(
abi.encodeWithSignature(
"verifyBatchInclusion(bytes32,bytes32,bytes32,bytes20,bytes32,bytes,uint256)",
proofCommitment,
pubInputCommitment,
provingSystemAuxDataCommitment,
proofGeneratorAddr,
batchMerkleRoot,
merkleProof,
verificationDataBatchIndex
)
);
require(callWasSuccessfull, "static_call failed");
return abi.decode(proofIsIncluded, (bool));
}
}