PoolFactory
Inherits: IPoolFactory, OwnableInternal, ReentrancyGuard
State Variables
DIAMOND
address internal immutable DIAMOND;
POOL_FACTORY_DEPLOYER
address internal immutable POOL_FACTORY_DEPLOYER;
Functions
constructor
constructor(address diamond, address poolFactoryDeployer);
isPool
Returns whether the given address is a pool
function isPool(address contractAddress) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
contractAddress | address | The address to check |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether the given address is a pool |
getPoolAddress
Returns the address of a valid pool, and whether it has been deployed. If the pool configuration is invalid the transaction will revert.
function getPoolAddress(PoolKey calldata k) external view returns (address pool, bool isDeployed);
Parameters
Name | Type | Description |
---|---|---|
k | PoolKey | The pool key |
Returns
Name | Type | Description |
---|---|---|
pool | address | The pool address |
isDeployed | bool | Whether the pool has been deployed |
_getPoolAddress
Returns the address of a pool using the encoded poolKey
function _getPoolAddress(bytes32 poolKey) internal view returns (address);
deployPool
Deploy a new option pool
function deployPool(PoolKey calldata k) external payable nonReentrant returns (address poolAddress);
Parameters
Name | Type | Description |
---|---|---|
k | PoolKey | The pool key |
Returns
Name | Type | Description |
---|---|---|
poolAddress | address | The address of the deployed pool |
initializationFee
DEPRECATED: Calculates the initialization fee for a pool
function initializationFee(IPoolFactory.PoolKey calldata k) public pure returns (UD60x18);
Parameters
Name | Type | Description |
---|---|---|
k | IPoolFactory.PoolKey | The pool key |
Returns
Name | Type | Description |
---|---|---|
<none> | UD60x18 | The initialization fee (18 decimals) |
_safeTransferNativeToken
Safely transfer native token to the given address
function _safeTransferNativeToken(address to, uint256 amount) internal;
_revertIfAddressInvalid
Revert if the base and quote are identical or if the base, quote, or oracle adapter are zero
function _revertIfAddressInvalid(PoolKey calldata k) internal pure;
_revertIfOptionStrikeInvalid
Revert if the strike price is not a multiple of the strike interval
function _revertIfOptionStrikeInvalid(UD60x18 strike) internal pure;
_revertIfOptionMaturityInvalid
Revert if the maturity is invalid
function _revertIfOptionMaturityInvalid(uint256 maturity) internal view;