Skip to content

Latest commit

 

History

History
406 lines (333 loc) · 11.5 KB

ICover.md

File metadata and controls

406 lines (333 loc) · 11.5 KB

ICover.sol

View Source: contracts/interfaces/ICover.sol

↗ Extends: IMember ↘ Derived Contracts: CoverBase

ICover

Events

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);

Functions

initialize

Initializes this contract

function initialize(address liquidityToken, bytes32 liquidityName) external nonpayable

Arguments

Name Type Description
liquidityToken address Provide the address of the token this cover will be quoted against.
liquidityName bytes32 Enter a description or ENS name of your liquidity token.
Source Code
function initialize(address liquidityToken, bytes32 liquidityName) external;

addCover

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.

Through the governance portal, projects will be able redeem the full cover fee at a later date.

Apply for Fee Redemption
https://docs.neptunemutual.com/covers/cover-fee-redemption

As the cover creator, you will earn a portion of all cover fees generated in this pool.

Read the documentation to learn more about the fees:
https://docs.neptunemutual.com/covers/contract-creators

function addCover(bytes32 key, bytes32 info, address reassuranceToken, uint256[] values) external nonpayable

Arguments

Name Type Description
key bytes32 Enter a unique key for this cover
info bytes32 IPFS info of the cover contract
reassuranceToken address Optional. Token added as an reassurance of this cover.

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.
values uint256[] [0] minStakeToReport A cover creator can override default min NPM stake to avoid spam reports
Source Code
function addCover(
    bytes32 key,
    bytes32 info,
    address reassuranceToken,
    uint256[] memory values
  ) external;

updateCover

Updates the cover contract. This feature is accessible only to the cover owner or protocol owner (governance).

function updateCover(bytes32 key, bytes32 info) external nonpayable

Arguments

Name Type Description
key bytes32 Enter the cover key
info bytes32 Enter a new IPFS URL to update
Source Code
function updateCover(bytes32 key, bytes32 info) external;

updateWhitelist

function updateWhitelist(address account, bool whitelisted) external nonpayable

Arguments

Name Type Description
account address
whitelisted bool
Source Code
function updateWhitelist(address account, bool whitelisted) external;

getCover

Get info of a cover contract by key

function getCover(bytes32 key) external view
returns(coverOwner address, info bytes32, values uint256[])

Arguments

Name Type Description
key bytes32 Enter the cover key
Source Code
function getCover(bytes32 key)
    external
    view
    returns (
      address coverOwner,
      bytes32 info,
      uint256[] memory values
    );

stopCover

function stopCover(bytes32 key, string reason) external nonpayable

Arguments

Name Type Description
key bytes32
reason string
Source Code
function stopCover(bytes32 key, string memory reason) external;

checkIfWhitelisted

function checkIfWhitelisted(address account) external view
returns(bool)

Arguments

Name Type Description
account address
Source Code
function checkIfWhitelisted(address account) external view returns (bool);

setCoverFees

function setCoverFees(uint256 value) external nonpayable

Arguments

Name Type Description
value uint256
Source Code
function setCoverFees(uint256 value) external;

setMinCoverCreationStake

function setMinCoverCreationStake(uint256 value) external nonpayable

Arguments

Name Type Description
value uint256
Source Code
function setMinCoverCreationStake(uint256 value) external;

setMinStakeToAddLiquidity

function setMinStakeToAddLiquidity(uint256 value) external nonpayable

Arguments

Name Type Description
value uint256
Source Code
function setMinStakeToAddLiquidity(uint256 value) external;

Contracts