-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
77 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.16; | ||
|
||
import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol"; | ||
import {TypeAndVersionInterface} from "../../interfaces/TypeAndVersionInterface.sol"; | ||
import {IChannelVerifierProxy} from "./interfaces/IChannelVerifierProxy.sol"; | ||
|
||
contract ChannelVerifierProxy is IChannelVerifierProxy, ConfirmedOwner, TypeAndVersionInterface { | ||
|
||
error AccessForbidden(); | ||
|
||
constructor() ConfirmedOwner(msg.sender) { | ||
} | ||
|
||
/// @inheritdoc TypeAndVersionInterface | ||
function typeAndVersion() external pure override returns (string memory) { | ||
return "ChannelVerifierProxy 0.0.0"; | ||
} | ||
|
||
/// @inheritdoc IChannelVerifierProxy | ||
function verify( | ||
bytes calldata payload, | ||
bytes calldata parameterPayload | ||
) external payable returns (bytes memory) { | ||
_verify(payload, parameterPayload); | ||
|
||
return new bytes(0); | ||
} | ||
|
||
/// @inheritdoc IChannelVerifierProxy | ||
function verifyBulk( | ||
bytes[] calldata payloads, | ||
bytes calldata parameterPayload | ||
) external payable returns (bytes[] memory verifiedReports) { | ||
verifiedReports = new bytes[](payloads.length); | ||
for (uint256 i; i < payloads.length; ++i) { | ||
_verify(payloads[i], parameterPayload); | ||
} | ||
|
||
return new bytes[](0); | ||
} | ||
|
||
function _verify(bytes calldata payload, bytes calldata parameterPayload) internal pure returns (bytes memory, bytes memory) { | ||
return (payload, parameterPayload); | ||
} | ||
|
||
function supportsInterface(bytes4 interfaceId) external pure returns (bool) { | ||
return interfaceId == type(IChannelVerifierProxy).interfaceId; | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
contracts/src/v0.8/llo-feeds/dev/interfaces/IChannelVerifierProxy.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,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.16; | ||
|
||
import {IERC165} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; | ||
import {Common} from "../../libraries/Common.sol"; | ||
|
||
interface IChannelVerifierProxy is IERC165 { | ||
|
||
function verify( | ||
bytes calldata payload, | ||
bytes calldata parameterPayload | ||
) external payable returns (bytes memory verifierResponse); | ||
|
||
function verifyBulk( | ||
bytes[] calldata payloads, | ||
bytes calldata parameterPayload | ||
) external payable returns (bytes[] memory verifiedReports); | ||
} |
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