Skip to content

Latest commit

 

History

History
508 lines (417 loc) · 13.7 KB

IVault.md

File metadata and controls

508 lines (417 loc) · 13.7 KB

IVault.sol

View Source: contracts/interfaces/IVault.sol

↗ Extends: IMember, IERC20 ↘ Derived Contracts: VaultBase

IVault

Structs

VaultInfoType

struct VaultInfoType {
 uint256 totalPods,
 uint256 balance,
 uint256 extendedBalance,
 uint256 totalReassurance,
 uint256 myPodBalance,
 uint256 myShare,
 uint256 withdrawalOpen,
 uint256 withdrawalClose
}

AddLiquidityArgs

struct AddLiquidityArgs {
 bytes32 coverKey,
 uint256 amount,
 uint256 npmStakeToAdd,
 bytes32 referralCode
}

Events

event GovernanceTransfer(address indexed to, uint256  amount);
event StrategyTransfer(address indexed token, address indexed strategy, bytes32 indexed name, uint256  amount);
event StrategyReceipt(address indexed token, address indexed strategy, bytes32 indexed name, uint256  amount, uint256  income, uint256  loss);
event PodsIssued(address indexed account, uint256  issued, uint256  liquidityAdded, bytes32 indexed referralCode);
event PodsRedeemed(address indexed account, uint256  redeemed, uint256  liquidityReleased);
event FlashLoanBorrowed(address indexed lender, address indexed borrower, address indexed stablecoin, uint256  amount, uint256  fee);
event NpmStaken(address indexed account, uint256  amount);
event NpmUnstaken(address indexed account, uint256  amount);
event InterestAccrued(bytes32 indexed coverKey);
event Entered(bytes32 indexed coverKey, address indexed account);
event Exited(bytes32 indexed coverKey, address indexed account);

Functions

key

function key() external view
returns(bytes32)

Arguments

Name Type Description
Source Code
function key() external view returns (bytes32);

sc

function sc() external view
returns(address)

Arguments

Name Type Description
Source Code
function sc() external view returns (address);

addLiquidity

Adds liquidity to the specified cover contract

function addLiquidity(struct IVault.AddLiquidityArgs args) external nonpayable

Arguments

Name Type Description
args struct IVault.AddLiquidityArgs
Source Code
function addLiquidity(AddLiquidityArgs calldata args) external;

accrueInterest

function accrueInterest() external nonpayable

Arguments

Name Type Description
Source Code
function accrueInterest() external;

removeLiquidity

Removes liquidity from the specified cover contract

function removeLiquidity(bytes32 coverKey, uint256 amount, uint256 npmStake, bool exit) external nonpayable

Arguments

Name Type Description
coverKey bytes32 Enter the cover key
amount uint256 Enter the amount of liquidity token to remove.
npmStake uint256 Enter the amount of NPM stake to remove.
exit bool Indicates NPM stake exit.
Source Code
function removeLiquidity(
    bytes32 coverKey,
    uint256 amount,
    uint256 npmStake,
    bool exit
  ) external;

transferGovernance

Transfers liquidity to governance contract.

function transferGovernance(bytes32 coverKey, address to, uint256 amount) external nonpayable

Arguments

Name Type Description
coverKey bytes32 Enter the cover key
to address Enter the destination account
amount uint256 Enter the amount of liquidity token to transfer.
Source Code
function transferGovernance(
    bytes32 coverKey,
    address to,
    uint256 amount
  ) external;

transferToStrategy

Transfers liquidity to strategy contract.

function transferToStrategy(IERC20 token, bytes32 coverKey, bytes32 strategyName, uint256 amount) external nonpayable

Arguments

Name Type Description
token IERC20
coverKey bytes32 Enter the cover key
strategyName bytes32 Enter the strategy's name
amount uint256 Enter the amount of liquidity token to transfer.
Source Code
function transferToStrategy(
    IERC20 token,
    bytes32 coverKey,
    bytes32 strategyName,
    uint256 amount
  ) external;

receiveFromStrategy

Receives from strategy contract.

function receiveFromStrategy(IERC20 token, bytes32 coverKey, bytes32 strategyName, uint256 amount) external nonpayable

Arguments

Name Type Description
token IERC20
coverKey bytes32 Enter the cover key
strategyName bytes32 Enter the strategy's name
amount uint256 Enter the amount of liquidity token to transfer.
Source Code
function receiveFromStrategy(
    IERC20 token,
    bytes32 coverKey,
    bytes32 strategyName,
    uint256 amount
  ) external;

calculatePods

function calculatePods(uint256 forStablecoinUnits) external view
returns(uint256)

Arguments

Name Type Description
forStablecoinUnits uint256
Source Code
function calculatePods(uint256 forStablecoinUnits) external view returns (uint256);

calculateLiquidity

function calculateLiquidity(uint256 podsToBurn) external view
returns(uint256)

Arguments

Name Type Description
podsToBurn uint256
Source Code
function calculateLiquidity(uint256 podsToBurn) external view returns (uint256);

getInfo

function getInfo(address forAccount) external view
returns(info struct IVault.VaultInfoType)

Arguments

Name Type Description
forAccount address
Source Code
function getInfo(address forAccount) external view returns (VaultInfoType memory info);

getStablecoinBalanceOf

Returns the stablecoin balance of this vault This also includes amounts lent out in lending strategies

function getStablecoinBalanceOf() external view
returns(uint256)

Arguments

Name Type Description
Source Code
function getStablecoinBalanceOf() external view returns (uint256);

Contracts