View Source: contracts/core/liquidity/Vault.sol
↗ Extends: WithFlashLoan
Vault
When a cover is created, a corresponding liquidity pool is also constituted.
An instance of this contract represents the liquidity pool of a cover.
The vaults are denominated in a single stablecoin and may be less susceptible
to underwriting risks associated with cryptocurrency price volatility.
When requested by the Cover Contract, the VaultFactory contract deploys a vault.
Per cover, only one vault is permitted. Since the vault contract is not upgradable,
some of the validation logic of it is outsourced to the VaultDelegate contract.
The vault contract is also an ERC-20 token, commonly known as POD (or Proof of Deposit).
As there is always on-chain stablecoin liquidity available for withdrawal,
PODs are fully redeemable and also income or loss bearing certificates
(loss if the cover had an event that resulted in a claims payout).
Unlike cxTokens, PODs can be freely transferred, staked,
and exchanged on secondary marketplaces.
Disclaimer:
The protocol does not provide any warranty, guarantee, or endorsement
for the peg of this stablecoin or any other stablecoin we may use on a different chain.
Both risk poolers (underwriters) and policyholders
must agree to utilize the same stablecoin to interfact with the protocol.
Note that the Neptune Mutual protocol only covers risks related to smart contracts and,
to a certain extent, frontend attacks. We don't cover risks arising from
teams losing private keys because of gross misconduct or negligence.
We don't cover people who put their money at risk in trading activities
like margin calls, leverage trading, or liquidation.
We don't cover 51% attack or any other type of consensus attack.
We don't cover bridge hacks and a whole variety of other exclusions.
- constructor(IStore store, bytes32 coverKey, string tokenName, string tokenSymbol, IERC20 stablecoin)
- getInfo(address you)
- version()
- getName()
Contructs this contract
function (IStore store, bytes32 coverKey, string tokenName, string tokenSymbol, IERC20 stablecoin) public nonpayable VaultBase
Arguments
Name | Type | Description |
---|---|---|
store | IStore | Provide store instance |
coverKey | bytes32 | Provide a cover key that doesn't have a vault deployed |
tokenName | string | Enter the token name of the POD. Example: Uniswap nDAI or Uniswap nUSDC |
tokenSymbol | string | Enter the token symbol of the POD. Example: UNI-NDAI or UNI-NUSDC . |
stablecoin | IERC20 | Provide an instance of the stablecoin this vault supports. |
Source Code
constructor(
IStore store,
bytes32 coverKey,
string memory tokenName,
string memory tokenSymbol,
IERC20 stablecoin
) VaultBase(store, coverKey, tokenName, tokenSymbol, stablecoin) {}
Gets information of a given vault by the cover key Warning: this function does not validate the input argument.
function getInfo(address you) external view
returns(struct IVault.VaultInfoType)
Arguments
Name | Type | Description |
---|---|---|
you | address | The address for which the info will be customized |
Source Code
function getInfo(address you) external view override returns (VaultInfoType memory) {
return delgate().getInfoImplementation(key, you);
}
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";
}
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_LIQUIDITY_VAULT;
}
- AaveStrategy
- AccessControl
- AccessControlLibV1
- Address
- BaseLibV1
- BokkyPooBahsDateTimeLibrary
- BondPool
- BondPoolBase
- BondPoolLibV1
- CompoundStrategy
- Context
- Cover
- CoverBase
- CoverLibV1
- CoverReassurance
- CoverStake
- CoverUtilV1
- cxToken
- cxTokenFactory
- cxTokenFactoryLibV1
- Delayable
- Destroyable
- ERC165
- ERC20
- FakeAaveLendingPool
- FakeCompoundDaiDelegator
- FakePriceOracle
- FakeRecoverable
- FakeStore
- FakeToken
- FakeUniswapPair
- FakeUniswapV2FactoryLike
- FakeUniswapV2PairLike
- FakeUniswapV2RouterLike
- FaultyAaveLendingPool
- FaultyCompoundDaiDelegator
- Finalization
- ForceEther
- Governance
- GovernanceUtilV1
- IAaveV2LendingPoolLike
- IAccessControl
- IBondPool
- IClaimsProcessor
- ICompoundERC20DelegatorLike
- ICover
- ICoverReassurance
- ICoverStake
- ICxToken
- ICxTokenFactory
- IERC165
- IERC20
- IERC20Detailed
- IERC20Metadata
- IERC3156FlashBorrower
- IERC3156FlashLender
- IFinalization
- IGovernance
- ILendingStrategy
- ILiquidityEngine
- IMember
- INeptuneRouterV1
- InvalidStrategy
- IPausable
- IPolicy
- IPolicyAdmin
- IPriceOracle
- IProtocol
- IRecoverable
- IReporter
- IResolution
- IResolvable
- IStakingPools
- IStore
- IStoreLike
- IUniswapV2FactoryLike
- IUniswapV2PairLike
- IUniswapV2RouterLike
- IUnstakable
- IVault
- IVaultDelegate
- IVaultFactory
- IWitness
- LiquidityEngine
- MaliciousToken
- MockAccessControlUser
- MockCoverUtilUser
- MockCxToken
- MockCxTokenPolicy
- MockCxTokenStore
- MockFlashBorrower
- MockLiquidityEngineUser
- MockProcessorStore
- MockProcessorStoreLib
- MockProtocol
- MockRegistryClient
- MockStore
- MockStoreKeyUtilUser
- MockValidationLibUser
- MockVault
- MockVaultLibUser
- NeptuneRouterV1
- NPM
- NpmDistributor
- NTransferUtilV2
- NTransferUtilV2Intermediate
- Ownable
- Pausable
- Policy
- PolicyAdmin
- PolicyHelperV1
- PoorMansERC20
- POT
- PriceLibV1
- Processor
- ProtoBase
- Protocol
- ProtoUtilV1
- Recoverable
- ReentrancyGuard
- RegistryLibV1
- Reporter
- Resolution
- Resolvable
- RoutineInvokerLibV1
- SafeERC20
- StakingPoolBase
- StakingPoolCoreLibV1
- StakingPoolInfo
- StakingPoolLibV1
- StakingPoolReward
- StakingPools
- Store
- StoreBase
- StoreKeyUtil
- StrategyLibV1
- Strings
- TimelockController
- Unstakable
- ValidationLibV1
- Vault
- VaultBase
- VaultDelegate
- VaultDelegateBase
- VaultDelegateWithFlashLoan
- VaultFactory
- VaultFactoryLibV1
- VaultLibV1
- VaultLiquidity
- VaultStrategy
- WithFlashLoan
- WithPausability
- WithRecovery
- Witness