-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathIOracle.sol
33 lines (25 loc) · 951 Bytes
/
IOracle.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
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;
import "@equilibria/root/attribute/interfaces/IInstance.sol";
import "@equilibria/perennial-v2/contracts/interfaces/IOracleProvider.sol";
interface IOracle is IOracleProvider, IInstance {
error OracleOutOfSyncError();
error OracleOutOfOrderCommitError();
event OracleUpdated(IOracleProvider newProvider);
/// @dev The state for a single epoch
struct Epoch {
/// @dev The oracle provider for this epoch
IOracleProvider provider;
/// @dev The last timestamp that this oracle provider is valid
uint96 timestamp;
}
/// @dev The global state for oracle
struct Global {
/// @dev The current epoch
uint128 current;
/// @dev The latest epoch
uint128 latest;
}
function initialize(IOracleProvider initialProvider) external;
function update(IOracleProvider newProvider) external;
}