Skip to content

Latest commit

 

History

History
366 lines (302 loc) · 10.5 KB

CoverBase.md

File metadata and controls

366 lines (302 loc) · 10.5 KB

Base Cover Contract (CoverBase.sol)

View Source: contracts/core/lifecycle/CoverBase.sol

↗ Extends: ICover, Recoverable ↘ Derived Contracts: Cover

CoverBase

Functions

Constructs this smart contract

function (IStore store) internal nonpayable Recoverable 

Arguments

Name Type Description
store IStore Provide the address of an eternal storage contract to use. This contract must be a member of the Protocol for write access to the storage
Source Code
constructor(IStore store) Recoverable(store) {}

initialize

Initializes this contract

function initialize(address stablecoin, bytes32 friendlyName) external nonpayable nonReentrant 

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 override nonReentrant {
    s.mustNotBePaused();
    AccessControlLibV1.mustBeCoverManager(s);

    require(s.getAddressByKey(ProtoUtilV1.CNS_COVER_STABLECOIN) == address(0), "Already initialized");

    s.initializeCoverInternal(stablecoin, friendlyName);
    emit CoverInitialized(stablecoin, friendlyName);
  }

setCoverCreationFee

Sets the cover creation fee

function setCoverCreationFee(uint256 value) external nonpayable nonReentrant 

Arguments

Name Type Description
value uint256 Enter the cover creation fee in NPM token units
Source Code
function setCoverCreationFee(uint256 value) external override nonReentrant {
    require(value > 0, "Please specify value");

    s.mustNotBePaused();
    AccessControlLibV1.mustBeCoverManager(s);

    uint256 previous = s.setCoverCreationFeeInternal(value);
    emit CoverCreationFeeSet(previous, value);
  }

setMinCoverCreationStake

Sets minimum stake to create a new cover

function setMinCoverCreationStake(uint256 value) external nonpayable nonReentrant 

Arguments

Name Type Description
value uint256 Enter the minimum cover creation stake in NPM token units
Source Code
function setMinCoverCreationStake(uint256 value) external override nonReentrant {
    require(value > 0, "Please specify value");

    s.mustNotBePaused();
    AccessControlLibV1.mustBeCoverManager(s);

    uint256 previous = s.setMinCoverCreationStakeInternal(value);
    emit MinCoverCreationStakeSet(previous, value);
  }

setMinStakeToAddLiquidity

Sets minimum stake to add liquidity

function setMinStakeToAddLiquidity(uint256 value) external nonpayable nonReentrant 

Arguments

Name Type Description
value uint256 Enter the minimum stake to add liquidity.
Source Code
function setMinStakeToAddLiquidity(uint256 value) external override nonReentrant {
    // require(value > 0, "Please specify value"); // <-- ZERO value is allowed now

    s.mustNotBePaused();
    AccessControlLibV1.mustBeCoverManager(s);

    uint256 previous = s.setMinStakeToAddLiquidityInternal(value);
    emit MinStakeToAddLiquiditySet(previous, value);
  }

version

Version number of this contract

function version() external pure
returns(bytes32)

Arguments

Name Type Description
Source Code
function version() external pure override returns (bytes32) {
    return "v0.1";
  }

getName

Name of this contract

function getName() external pure
returns(bytes32)

Arguments

Name Type Description
Source Code
function getName() external pure override returns (bytes32) {
    return ProtoUtilV1.CNAME_COVER;
  }

Contracts