forked from neptune-mutual-blue/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathICover.sol
100 lines (88 loc) · 3.93 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
// 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 key, bytes32 info);
event CoverUpdated(bytes32 key, bytes32 info);
event CoverStopped(bytes32 indexed coverKey, address indexed deletedBy, string reason);
event WhitelistUpdated(address account, bool status);
event CoverFeeSet(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 liquidityToken Provide the address of the token this cover will be quoted against.
* @param liquidityName Enter a description or ENS name of your liquidity token.
*
*/
function initialize(address liquidityToken, bytes32 liquidityName) 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 key Enter a unique key for this cover
* @param info IPFS info of the cover contract
* @param reassuranceToken **Optional.** Token added as an reassurance of this cover. <br /><br />
*
* Reassurance tokens can be added by a project to demonstrate coverage support
* for their own project. This helps bring the cover fee down and enhances
* liquidity provider confidence. Along with the NPM tokens, the reassurance tokens are rewarded
* as a support to the liquidity providers when a cover incident occurs.
* @param values[0] minStakeToReport A cover creator can override default min NPM stake to avoid spam reports
* @param values[1] reportingPeriod The period during when reporting happens.
* @param values[2] stakeWithFee Enter the total NPM amount (stake + fee) to transfer to this contract.
* @param values[3] initialReassuranceAmount **Optional.** Enter the initial amount of
* reassurance tokens you'd like to add to this pool.
* @param values[4] initialLiquidity **Optional.** Enter the initial stablecoin liquidity for this cover.
*/
function addCover(
bytes32 key,
bytes32 info,
address reassuranceToken,
uint256[] memory values
) external;
/**
* @dev Updates the cover contract.
* This feature is accessible only to the cover owner or protocol owner (governance).
*
* @param key Enter the cover key
* @param info Enter a new IPFS URL to update
*/
function updateCover(bytes32 key, bytes32 info) external;
function updateWhitelist(address account, bool whitelisted) external;
/**
* @dev Get info of a cover contract by key
* @param key Enter the cover key
* @param coverOwner Returns the address of the cover creator
* @param info Gets the IPFS hash of the cover info
* @param values Array of uint256 values. See `CoverUtilV1.getCoverInfo`.
*/
function getCover(bytes32 key)
external
view
returns (
address coverOwner,
bytes32 info,
uint256[] memory values
);
function stopCover(bytes32 key, string memory reason) external;
function checkIfWhitelisted(address account) external view returns (bool);
function setCoverFees(uint256 value) external;
function setMinCoverCreationStake(uint256 value) external;
function setMinStakeToAddLiquidity(uint256 value) external;
}