-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathIPoolFactory.sol
96 lines (81 loc) · 2.84 KB
/
IPoolFactory.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
94
95
96
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title Interface to the Pool Factory
*/
interface IPoolFactory {
/**************************************************************************/
/* Errors */
/**************************************************************************/
/**
* @notice Unsupported Pool implementation
*/
error UnsupportedImplementation();
/**
* @notice Invalid Pool
*/
error InvalidPool();
/**************************************************************************/
/* Events */
/**************************************************************************/
/**
* @notice Emitted when a pool is created
* @param pool Pool instance
* @param implementation Implementation contract
*/
event PoolCreated(address indexed pool, address indexed implementation);
/**
* @notice Emitted when a pool implementation is added to allowlist
* @param implementation Implementation contract
*/
event PoolImplementationAdded(address indexed implementation);
/**
* @notice Emitted when a pool implementation is removed from allowlist
* @param implementation Implementation contract
*/
event PoolImplementationRemoved(address indexed implementation);
/**************************************************************************/
/* API */
/**************************************************************************/
/**
* Create a pool (immutable)
* @param poolImplementation Pool implementation contract
* @param params Pool parameters
* @return Pool address
*/
function create(address poolImplementation, bytes calldata params) external returns (address);
/**
* Create a pool (proxied)
* @param poolBeacon Pool beacon contract
* @param params Pool parameters
* @return Pool address
*/
function createProxied(address poolBeacon, bytes calldata params) external returns (address);
/**
* @notice Check if address is a pool
* @param pool Pool address
* @return True if address is a pool, otherwise false
*/
function isPool(address pool) external view returns (bool);
/**
* @notice Get list of pools
* @return List of pool addresses
*/
function getPools() external view returns (address[] memory);
/**
* @notice Get count of pools
* @return Count of pools
*/
function getPoolCount() external view returns (uint256);
/**
* @notice Get pool at index
* @param index Index
* @return Pool address
*/
function getPoolAt(uint256 index) external view returns (address);
/**
* @notice Get list of supported pool implementations
* @return List of pool implementations
*/
function getPoolImplementations() external view returns (address[] memory);
}