-
Notifications
You must be signed in to change notification settings - Fork 0
/
TendermintZKLightClientPlonk.sol
31 lines (27 loc) · 1.19 KB
/
TendermintZKLightClientPlonk.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
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.20;
import {Height} from "@hyperledger-labs/yui-ibc-solidity/contracts/proto/Client.sol";
import {TendermintZKLightClient} from "../TendermintZKLightClient.sol";
import {PlonkVerifier} from "./PlonkVerifier.sol";
contract TendermintZKLightClientPlonk is TendermintZKLightClient, PlonkVerifier {
constructor(address ibcHandler_, uint256 stepVerifierDigest_, uint256 skipVerifierDigest_, uint64 revisionNumber_)
TendermintZKLightClient(ibcHandler_, stepVerifierDigest_, skipVerifierDigest_, revisionNumber_)
{}
function routeUpdateState(string calldata clientId, UpdateStateInput memory m, bytes memory zkp)
public
pure
virtual
override
returns (bytes4 selector, bytes memory args)
{
return (this.updateStatePlonk.selector, abi.encode(clientId, m, abi.decode(zkp, (bytes))));
}
function updateStatePlonk(
string calldata clientId,
UpdateStateInput calldata message,
bytes calldata proof
) public virtual returns (Height.Data[] memory heights) {
require(Verify(proof, message.input));
return updateState(clientId, message);
}
}