This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
IController.sol
93 lines (86 loc) · 5 KB
/
IController.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;
import "@equilibria/root/number/types/UFixed18.sol";
import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";
import "./ICollateral.sol";
import "./IIncentivizer.sol";
import "./IProduct.sol";
import "./IMultiInvoker.sol";
import "./types/PayoffDefinition.sol";
interface IController {
/// @dev Coordinator of a one or many products
struct Coordinator {
/// @dev Pending owner of the product, can accept ownership
address pendingOwner;
/// @dev Owner of the product, allowed to update select parameters
address owner;
/// @dev Treasury of the product, collects fees
address treasury;
}
event CollateralUpdated(ICollateral newCollateral);
event IncentivizerUpdated(IIncentivizer newIncentivizer);
event ProductBeaconUpdated(IBeacon newProductBeacon);
event MultiInvokerUpdated(IMultiInvoker newMultiInvoker);
event ProtocolFeeUpdated(UFixed18 newProtocolFee);
event MinFundingFeeUpdated(UFixed18 newMinFundingFee);
event LiquidationFeeUpdated(UFixed18 newLiquidationFee);
event IncentivizationFeeUpdated(UFixed18 newIncentivizationFee);
event MinCollateralUpdated(UFixed18 newMinCollateral);
event ProgramsPerProductUpdated(uint256 newProgramsPerProduct);
event PauserUpdated(address newPauser);
event PausedUpdated(bool newPaused);
event CoordinatorPendingOwnerUpdated(uint256 indexed coordinatorId, address newPendingOwner);
event CoordinatorOwnerUpdated(uint256 indexed coordinatorId, address newOwner);
event CoordinatorTreasuryUpdated(uint256 indexed coordinatorId, address newTreasury);
event CoordinatorCreated(uint256 indexed coordinatorId, address owner);
event ProductCreated(IProduct indexed product, IProduct.ProductInfo productInfo);
error ControllerNotProductError();
error ControllerNoZeroCoordinatorError();
error ControllerNotPauserError();
error ControllerNotOwnerError(uint256 controllerId);
error ControllerNotPendingOwnerError(uint256 controllerId);
error ControllerInvalidProtocolFeeError();
error ControllerInvalidMinFundingFeeError();
error ControllerInvalidLiquidationFeeError();
error ControllerInvalidIncentivizationFeeError();
error ControllerNotContractAddressError();
function collateral() external view returns (ICollateral);
function incentivizer() external view returns (IIncentivizer);
function productBeacon() external view returns (IBeacon);
function multiInvoker() external view returns (IMultiInvoker);
function coordinators(uint256 collateralId) external view returns (Coordinator memory);
function coordinatorFor(IProduct product) external view returns (uint256);
function protocolFee() external view returns (UFixed18);
function minFundingFee() external view returns (UFixed18);
function liquidationFee() external view returns (UFixed18);
function incentivizationFee() external view returns (UFixed18);
function minCollateral() external view returns (UFixed18);
function programsPerProduct() external view returns (uint256);
function pauser() external view returns (address);
function paused() external view returns (bool);
function initialize(ICollateral collateral_, IIncentivizer incentivizer_, IBeacon productBeacon_) external;
function createCoordinator() external returns (uint256);
function updateCoordinatorPendingOwner(uint256 coordinatorId, address newPendingOwner) external;
function acceptCoordinatorOwner(uint256 coordinatorId) external;
function updateCoordinatorTreasury(uint256 coordinatorId, address newTreasury) external;
function createProduct(uint256 coordinatorId, IProduct.ProductInfo calldata productInfo) external returns (IProduct);
function updateCollateral(ICollateral newCollateral) external;
function updateIncentivizer(IIncentivizer newIncentivizer) external;
function updateProductBeacon(IBeacon newProductBeacon) external;
function updateMultiInvoker(IMultiInvoker newMultiInvoker) external;
function updateProtocolFee(UFixed18 newProtocolFee) external;
function updateMinFundingFee(UFixed18 newMinFundingFee) external;
function updateLiquidationFee(UFixed18 newLiquidationFee) external;
function updateIncentivizationFee(UFixed18 newIncentivizationFee) external;
function updateMinCollateral(UFixed18 newMinCollateral) external;
function updateProgramsPerProduct(uint256 newProductsPerProduct) external;
function updatePauser(address newPauser) external;
function updatePaused(bool newPaused) external;
function isProduct(IProduct product) external view returns (bool);
function owner() external view returns (address);
function owner(uint256 coordinatorId) external view returns (address);
function owner(IProduct product) external view returns (address);
function treasury() external view returns (address);
function treasury(uint256 coordinatorId) external view returns (address);
function treasury(IProduct product) external view returns (address);
}