Skip to content

Latest commit

 

History

History
443 lines (373 loc) · 12.3 KB

MockVaultLibUser.md

File metadata and controls

443 lines (373 loc) · 12.3 KB

MockVaultLibUser.sol

View Source: contracts/mock/lib-user/MockVaultLibUser.sol

MockVaultLibUser

Contract Members

Constants & Variables

contract IStore public s;

Functions

function (IStore store) public nonpayable

Arguments

Name Type Description
store IStore
Source Code
constructor(IStore store) {
    s = store;
  }

setFlashLoanStatus

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);
  }

getFlashLoanStatus

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);
  }

preAddLiquidityInternal

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);
  }

preRemoveLiquidityInternal

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");
  }

setAmountInStrategies

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);
  }

mustHaveNoBalanceInStrategies

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);
  }

getMaxFlashLoanInternal

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);
  }

setAddressByKey

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);
  }

getAddressByKey

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);
  }

Contracts