View Source: contracts/mock/lib-user/MockVaultLibUser.sol
MockVaultLibUser
Constants & Variables
contract IStore public s;
- constructor(IStore store)
- setFlashLoanStatus(bytes32 coverKey, bool status)
- getFlashLoanStatus(bytes32 coverKey)
- preAddLiquidityInternal(bytes32 coverKey, address pod, address account, uint256 amount, uint256 npmStakeToAdd)
- preRemoveLiquidityInternal(bytes32 coverKey, address pod, address account, uint256 podsToRedeem, uint256 npmStakeToRemove, bool exit)
- setAmountInStrategies(bytes32 coverKey, address stablecoin, uint256 amount)
- mustHaveNoBalanceInStrategies(bytes32 coverKey, address stablecoin)
- getMaxFlashLoanInternal(bytes32 coverKey, address token)
- setAddressByKey(bytes32 key, address value)
- getAddressByKey(bytes32 key)
function (IStore store) public nonpayable
Arguments
Name | Type | Description |
---|---|---|
store | IStore |
Source Code
constructor(IStore store) {
s = store;
}
function setFlashLoanStatus(bytes32 coverKey, bool status) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
coverKey | bytes32 | |
status | bool |
Source Code
function setFlashLoanStatus(bytes32 coverKey, bool status) external {
s.setBoolByKeys(ProtoUtilV1.NS_COVER_HAS_FLASH_LOAN, coverKey, status);
}
function getFlashLoanStatus(bytes32 coverKey) external view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
coverKey | bytes32 |
Source Code
function getFlashLoanStatus(bytes32 coverKey) external view returns (bool) {
return s.getBoolByKeys(ProtoUtilV1.NS_COVER_HAS_FLASH_LOAN, coverKey);
}
function preAddLiquidityInternal(bytes32 coverKey, address pod, address account, uint256 amount, uint256 npmStakeToAdd) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
coverKey | bytes32 | |
pod | address | |
account | address | |
amount | uint256 | |
npmStakeToAdd | uint256 |
Source Code
function preAddLiquidityInternal(
bytes32 coverKey,
address pod,
address account,
uint256 amount,
uint256 npmStakeToAdd
) external {
s.preAddLiquidityInternal(coverKey, pod, account, amount, npmStakeToAdd);
}
function preRemoveLiquidityInternal(bytes32 coverKey, address pod, address account, uint256 podsToRedeem, uint256 npmStakeToRemove, bool exit) external nonpayable
returns(stablecoin address, releaseAmount uint256)
Arguments
Name | Type | Description |
---|---|---|
coverKey | bytes32 | |
pod | address | |
account | address | |
podsToRedeem | uint256 | |
npmStakeToRemove | uint256 | |
exit | bool |
Source Code
function preRemoveLiquidityInternal(
bytes32 coverKey,
address pod,
address account,
uint256 podsToRedeem,
uint256 npmStakeToRemove,
bool exit
) external returns (address stablecoin, uint256 releaseAmount) {
(stablecoin, releaseAmount) = s.preRemoveLiquidityInternal(coverKey, pod, account, podsToRedeem, npmStakeToRemove, exit);
require(releaseAmount == 0, "Release amount should be zero");
}
function setAmountInStrategies(bytes32 coverKey, address stablecoin, uint256 amount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
coverKey | bytes32 | |
stablecoin | address | |
amount | uint256 |
Source Code
function setAmountInStrategies(
bytes32 coverKey,
address stablecoin,
uint256 amount
) external {
// getStrategyOutKeyInternal
bytes32 k = keccak256(abi.encodePacked(ProtoUtilV1.NS_VAULT_STRATEGY_OUT, coverKey, stablecoin));
s.setUintByKey(k, amount);
}
function mustHaveNoBalanceInStrategies(bytes32 coverKey, address stablecoin) external view
Arguments
Name | Type | Description |
---|---|---|
coverKey | bytes32 | |
stablecoin | address |
Source Code
function mustHaveNoBalanceInStrategies(bytes32 coverKey, address stablecoin) external view {
s.mustHaveNoBalanceInStrategies(coverKey, stablecoin);
}
function getMaxFlashLoanInternal(bytes32 coverKey, address token) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
coverKey | bytes32 | |
token | address |
Source Code
function getMaxFlashLoanInternal(bytes32 coverKey, address token) external view returns (uint256) {
return s.getMaxFlashLoanInternal(coverKey, token);
}
function setAddressByKey(bytes32 key, address value) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
key | bytes32 | |
value | address |
Source Code
function setAddressByKey(bytes32 key, address value) external {
s.setAddressByKey(key, value);
}
function getAddressByKey(bytes32 key) external view
returns(address)
Arguments
Name | Type | Description |
---|---|---|
key | bytes32 |
Source Code
function getAddressByKey(bytes32 key) external view returns (address) {
return s.getAddressByKey(key);
}
- 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
- FakeCompoundStablecoinDelegator
- FakePriceOracle
- FakeRecoverable
- FakeStore
- FakeToken
- FakeUniswapPair
- FakeUniswapV2FactoryLike
- FakeUniswapV2PairLike
- FakeUniswapV2RouterLike
- FaultyAaveLendingPool
- FaultyCompoundStablecoinDelegator
- 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