forked from neptune-mutual-blue/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathICover.sol
121 lines (106 loc) · 4.6 KB
/
ICover.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Neptune Mutual Protocol (https://neptunemutual.com)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import "./IMember.sol";
interface ICover is IMember {
event CoverCreated(bytes32 indexed coverKey, bytes32 info, string tokenName, string tokenSymbol, bool indexed supportsProducts, bool indexed requiresWhitelist);
event ProductCreated(bytes32 indexed coverKey, bytes32 productKey, bytes32 info, bool requiresWhitelist, uint256[] values);
event CoverUpdated(bytes32 indexed coverKey, bytes32 info);
event ProductUpdated(bytes32 indexed coverKey, bytes32 productKey, bytes32 info, uint256[] values);
event ProductStateUpdated(bytes32 indexed coverKey, bytes32 indexed productKey, address indexed updatedBy, bool status, string reason);
event VaultDeployed(bytes32 indexed coverKey, address vault);
event CoverCreatorWhitelistUpdated(address account, bool status);
event CoverUserWhitelistUpdated(bytes32 indexed coverKey, bytes32 indexed productKey, address indexed account, bool status);
event CoverCreationFeeSet(uint256 previous, uint256 current);
event MinCoverCreationStakeSet(uint256 previous, uint256 current);
event MinStakeToAddLiquiditySet(uint256 previous, uint256 current);
event CoverInitialized(address indexed stablecoin, bytes32 withName);
/**
* @dev Initializes this contract
* @param stablecoin Provide the address of the token this cover will be quoted against.
* @param friendlyName Enter a description or ENS name of your liquidity token.
*
*/
function initialize(address stablecoin, bytes32 friendlyName) external;
/**
* @dev Adds a new coverage pool or cover contract.
* To add a new cover, you need to pay cover creation fee
* and stake minimum amount of NPM in the Vault. <br /> <br />
*
* Through the governance portal, projects will be able redeem
* the full cover fee at a later date. <br /> <br />
*
* **Apply for Fee Redemption** <br />
* https://docs.neptunemutual.com/covers/cover-fee-redemption <br /><br />
*
* As the cover creator, you will earn a portion of all cover fees
* generated in this pool. <br /> <br />
*
* Read the documentation to learn more about the fees: <br />
* https://docs.neptunemutual.com/covers/contract-creators
*
* @param coverKey Enter a unique key for this cover
* @param info IPFS info of the cover contract
* @param values[0] stakeWithFee Enter the total NPM amount (stake + fee) to transfer to this contract.
* @param values[1] initialReassuranceAmount **Optional.** Enter the initial amount of
* @param values[2] minStakeToReport A cover creator can override default min NPM stake to avoid spam reports
* @param values[3] reportingPeriod The period during when reporting happens.
* reassurance tokens you'd like to add to this pool.
* @param values[4] cooldownperiod Enter the cooldown period for governance.
* @param values[5] claimPeriod Enter the claim period.
* @param values[6] floor Enter the policy floor rate.
* @param values[7] ceiling Enter the policy ceiling rate.
*/
function addCover(
bytes32 coverKey,
bytes32 info,
string calldata tokenName,
string calldata tokenSymbol,
bool supportsProducts,
bool requiresWhitelist,
uint256[] calldata values
) external returns (address);
function addProduct(
bytes32 coverKey,
bytes32 productKey,
bytes32 info,
bool requiresWhitelist,
uint256[] calldata values
) external;
function updateProduct(
bytes32 coverKey,
bytes32 productKey,
bytes32 info,
uint256[] calldata values
) external;
/**
* @dev Updates the cover contract.
* This feature is accessible only to the cover owner or protocol owner (governance).
*
* @param coverKey Enter the cover key
* @param info Enter a new IPFS URL to update
*/
function updateCover(bytes32 coverKey, bytes32 info) external;
function updateCoverCreatorWhitelist(address account, bool whitelisted) external;
function updateCoverUsersWhitelist(
bytes32 coverKey,
bytes32 productKey,
address[] calldata accounts,
bool[] calldata statuses
) external;
function disablePolicy(
bytes32 coverKey,
bytes32 productKey,
bool status,
string calldata reason
) external;
function checkIfWhitelistedCoverCreator(address account) external view returns (bool);
function checkIfWhitelistedUser(
bytes32 coverKey,
bytes32 productKey,
address account
) external view returns (bool);
function setCoverCreationFee(uint256 value) external;
function setMinCoverCreationStake(uint256 value) external;
function setMinStakeToAddLiquidity(uint256 value) external;
}