Skip to content

Latest commit

 

History

History
533 lines (443 loc) · 15.7 KB

ICover.md

File metadata and controls

533 lines (443 loc) · 15.7 KB

ICover.sol

View Source: contracts/interfaces/ICover.sol

↗ Extends: IMember ↘ Derived Contracts: CoverBase

ICover

Events

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

Functions

initialize

Initializes this contract

function initialize(address stablecoin, bytes32 friendlyName) external nonpayable

Arguments

Name Type Description
stablecoin address Provide the address of the token this cover will be quoted against.
friendlyName bytes32 Enter a description or ENS name of your liquidity token.
Source Code
function initialize(address stablecoin, bytes32 friendlyName) 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 coverKey, bytes32 info, string tokenName, string tokenSymbol, bool supportsProducts, bool requiresWhitelist, uint256[] values) external nonpayable
returns(address)

Arguments

Name Type Description
coverKey bytes32 Enter a unique key for this cover
info bytes32 IPFS info of the cover contract
tokenName string
tokenSymbol string
supportsProducts bool
requiresWhitelist bool
values uint256[] [0] stakeWithFee Enter the total NPM amount (stake + fee) to transfer to this contract.
Source Code
function addCover(
    bytes32 coverKey,
    bytes32 info,
    string calldata tokenName,
    string calldata tokenSymbol,
    bool supportsProducts,
    bool requiresWhitelist,
    uint256[] calldata values
  ) external returns (address);

addProduct

function addProduct(bytes32 coverKey, bytes32 productKey, bytes32 info, bool requiresWhitelist, uint256[] values) external nonpayable

Arguments

Name Type Description
coverKey bytes32
productKey bytes32
info bytes32
requiresWhitelist bool
values uint256[]
Source Code
function addProduct(
    bytes32 coverKey,
    bytes32 productKey,
    bytes32 info,
    bool requiresWhitelist,
    uint256[] calldata values
  ) external;

updateProduct

function updateProduct(bytes32 coverKey, bytes32 productKey, bytes32 info, uint256[] values) external nonpayable

Arguments

Name Type Description
coverKey bytes32
productKey bytes32
info bytes32
values uint256[]
Source Code
function updateProduct(
    bytes32 coverKey,
    bytes32 productKey,
    bytes32 info,
    uint256[] calldata values
  ) external;

updateCover

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

function updateCover(bytes32 coverKey, bytes32 info) external nonpayable

Arguments

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

updateCoverCreatorWhitelist

function updateCoverCreatorWhitelist(address account, bool whitelisted) external nonpayable

Arguments

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

updateCoverUsersWhitelist

function updateCoverUsersWhitelist(bytes32 coverKey, bytes32 productKey, address[] accounts, bool[] statuses) external nonpayable

Arguments

Name Type Description
coverKey bytes32
productKey bytes32
accounts address[]
statuses bool[]
Source Code
function updateCoverUsersWhitelist(
    bytes32 coverKey,
    bytes32 productKey,
    address[] calldata accounts,
    bool[] calldata statuses
  ) external;

disablePolicy

function disablePolicy(bytes32 coverKey, bytes32 productKey, bool status, string reason) external nonpayable

Arguments

Name Type Description
coverKey bytes32
productKey bytes32
status bool
reason string
Source Code
function disablePolicy(
    bytes32 coverKey,
    bytes32 productKey,
    bool status,
    string calldata reason
  ) external;

checkIfWhitelistedCoverCreator

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

Arguments

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

checkIfWhitelistedUser

function checkIfWhitelistedUser(bytes32 coverKey, bytes32 productKey, address account) external view
returns(bool)

Arguments

Name Type Description
coverKey bytes32
productKey bytes32
account address
Source Code
function checkIfWhitelistedUser(
    bytes32 coverKey,
    bytes32 productKey,
    address account
  ) external view returns (bool);

setCoverCreationFee

function setCoverCreationFee(uint256 value) external nonpayable

Arguments

Name Type Description
value uint256
Source Code
function setCoverCreationFee(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