-
Notifications
You must be signed in to change notification settings - Fork 19
/
IPythFactory.sol
32 lines (27 loc) · 1.14 KB
/
IPythFactory.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
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;
import "@equilibria/root/token/types/Token18.sol";
import "@equilibria/root/attribute/interfaces/IFactory.sol";
import "@equilibria/perennial-v2/contracts/interfaces/IOracleProviderFactory.sol";
import "./IPythOracle.sol";
import "./IOracleFactory.sol";
interface IPythFactory is IOracleProviderFactory, IFactory {
struct Granularity {
uint64 latestGranularity;
uint64 currentGranularity;
uint128 effectiveAfter;
}
event GranularityUpdated(uint256 newGranularity, uint256 effectiveAfter);
// sig: 0x3d225882
error PythFactoryNotInstanceError();
// sig: 0xa7cc0264
error PythFactoryInvalidGranularityError();
// sig: 0xf2f2ce54
error PythFactoryAlreadyCreatedError();
function initialize(IOracleFactory oracleFactory) external;
function create(bytes32 id) external returns (IPythOracle oracle);
function claim(UFixed6 amount) external;
function current() external view returns (uint256);
function granularity() external view returns (Granularity memory);
function updateGranularity(uint256 newGranularity) external;
}