Skip to content

Latest commit

 

History

History
595 lines (487 loc) · 16.3 KB

ICover.md

File metadata and controls

595 lines (487 loc) · 16.3 KB

ICover.sol

View Source: contracts/interfaces/ICover.sol

↗ Extends: IMember ↘ Derived Contracts: CoverBase

ICover

Structs

AddCoverArgs

struct AddCoverArgs {
 bytes32 coverKey,
 string info,
 string tokenName,
 string tokenSymbol,
 bool supportsProducts,
 bool requiresWhitelist,
 uint256 stakeWithFee,
 uint256 initialReassuranceAmount,
 uint256 minStakeToReport,
 uint256 reportingPeriod,
 uint256 cooldownPeriod,
 uint256 claimPeriod,
 uint256 floor,
 uint256 ceiling,
 uint256 reassuranceRate,
 uint256 leverageFactor
}

AddProductArgs

struct AddProductArgs {
 bytes32 coverKey,
 bytes32 productKey,
 string info,
 bool requiresWhitelist,
 uint256 productStatus,
 uint256 efficiency
}

UpdateProductArgs

struct UpdateProductArgs {
 bytes32 coverKey,
 bytes32 productKey,
 string info,
 uint256 productStatus,
 uint256 efficiency
}

Events

event CoverCreated(bytes32 indexed coverKey, string  info, string  tokenName, string  tokenSymbol, bool indexed supportsProducts, bool indexed requiresWhitelist);
event ProductCreated(bytes32 indexed coverKey, bytes32  productKey, string  info);
event CoverUpdated(bytes32 indexed coverKey, string  info);
event ProductUpdated(bytes32 indexed coverKey, bytes32  productKey, string  info);
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(struct ICover.AddCoverArgs args) external nonpayable
returns(address)

Arguments

Name Type Description
args struct ICover.AddCoverArgs
Source Code
function addCover(AddCoverArgs calldata args) external returns (address);

addCovers

function addCovers(struct ICover.AddCoverArgs[] args) external nonpayable
returns(vaults address[])

Arguments

Name Type Description
args struct ICover.AddCoverArgs[]
Source Code
function addCovers(AddCoverArgs[] calldata args) external returns (address[] memory vaults);

addProduct

function addProduct(struct ICover.AddProductArgs args) external nonpayable

Arguments

Name Type Description
args struct ICover.AddProductArgs
Source Code
function addProduct(AddProductArgs calldata args) external;

addProducts

function addProducts(struct ICover.AddProductArgs[] args) external nonpayable

Arguments

Name Type Description
args struct ICover.AddProductArgs[]
Source Code
function addProducts(AddProductArgs[] calldata args) external;

updateProduct

function updateProduct(struct ICover.UpdateProductArgs args) external nonpayable

Arguments

Name Type Description
args struct ICover.UpdateProductArgs
Source Code
function updateProduct(UpdateProductArgs calldata args) external;

updateCover

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

function updateCover(bytes32 coverKey, string info) external nonpayable

Arguments

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

updateCoverCreatorWhitelist

function updateCoverCreatorWhitelist(address[] account, bool[] whitelisted) external nonpayable

Arguments

Name Type Description
account address[]
whitelisted bool[]
Source Code
function updateCoverCreatorWhitelist(address[] calldata account, bool[] calldata 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