-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DisposableCoverProducts contract
- Loading branch information
Showing
9 changed files
with
1,428 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
pragma solidity >=0.5.0; | ||
|
||
import "./ILegacyCover.sol"; | ||
|
||
interface IDisposableCoverProducts { | ||
|
||
/* ========== VIEWS ========== */ | ||
|
||
function allowedPoolsCount(uint productId) external view returns (uint); | ||
|
||
function products(uint id) external view returns (Product memory); | ||
|
||
function productNames(uint productId) external view returns (string memory); | ||
|
||
function productsCount() external view returns (uint); | ||
|
||
function productTypesCount() external view returns (uint); | ||
|
||
function productTypes(uint id) external view returns (ProductType memory); | ||
|
||
function getProducts() external view returns (Product[] memory); | ||
|
||
function getProductTypes() external view returns (ProductType[] memory); | ||
|
||
function isPoolAllowed(uint productId, uint poolId) external view returns (bool); | ||
|
||
function requirePoolIsAllowed(uint[] calldata productIds, uint poolId) external view; | ||
|
||
function getProductWithType(uint productId) external view returns (Product memory, ProductType memory); | ||
|
||
/* === MUTATIVE FUNCTIONS ==== */ | ||
|
||
function setProductTypes(ProductTypeParam[] calldata productTypes) external; | ||
|
||
function setProducts(ProductParam[] calldata params) external; | ||
|
||
|
||
/* ========== EVENTS ========== */ | ||
|
||
event ProductSet(uint id, string ipfsMetadata); | ||
event ProductTypeSet(uint id, string ipfsMetadata); | ||
|
||
// Products | ||
error ProductDoesntExist(); | ||
error ProductTypeNotFound(); | ||
error ProductDeprecated(); | ||
error InvalidProductType(); | ||
error UnexpectedProductId(); | ||
error PoolNotAllowedForThisProduct(uint productId); | ||
|
||
// Cover and payment assets | ||
error UnsupportedCoverAssets(); | ||
error UnexpectedEthSent(); | ||
|
||
// Price & Commission | ||
error PriceExceedsMaxPremiumInAsset(); | ||
error TargetPriceBelowGlobalMinPriceRatio(); | ||
error InitialPriceRatioBelowGlobalMinPriceRatio(); | ||
error InitialPriceRatioAbove100Percent(); | ||
error CommissionRateTooHigh(); | ||
|
||
// Misc | ||
error CapacityReductionRatioAbove100Percent(); | ||
|
||
function getPriceAndCapacityRatios(uint[] calldata productIds) external view returns ( | ||
uint[] memory _initialPrices, | ||
uint[] memory _capacityReductionRatios | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.