Skip to content

Latest commit

 

History

History
564 lines (462 loc) · 14.8 KB

RegistryLibV1.md

File metadata and controls

564 lines (462 loc) · 14.8 KB

RegistryLibV1.sol

View Source: contracts/libraries/RegistryLibV1.sol

RegistryLibV1

Functions

getGovernanceContract

function getGovernanceContract(IStore s) external view
returns(contract IGovernance)

Arguments

Name Type Description
s IStore
Source Code
function getGovernanceContract(IStore s) external view returns (IGovernance) {
    return IGovernance(s.getContractInternal(ProtoUtilV1.CNS_GOVERNANCE, ProtoUtilV1.KEY_INTENTIONALLY_EMPTY));
  }

getResolutionContract

function getResolutionContract(IStore s) external view
returns(contract IGovernance)

Arguments

Name Type Description
s IStore
Source Code
function getResolutionContract(IStore s) external view returns (IGovernance) {
    return IGovernance(s.getContractInternal(ProtoUtilV1.CNS_GOVERNANCE_RESOLUTION, ProtoUtilV1.KEY_INTENTIONALLY_EMPTY));
  }

getStakingContract

function getStakingContract(IStore s) external view
returns(contract ICoverStake)

Arguments

Name Type Description
s IStore
Source Code
function getStakingContract(IStore s) external view returns (ICoverStake) {
    return ICoverStake(s.getContractInternal(ProtoUtilV1.CNS_COVER_STAKE, ProtoUtilV1.KEY_INTENTIONALLY_EMPTY));
  }

getCxTokenFactory

function getCxTokenFactory(IStore s) external view
returns(contract ICxTokenFactory)

Arguments

Name Type Description
s IStore
Source Code
function getCxTokenFactory(IStore s) external view returns (ICxTokenFactory) {
    return ICxTokenFactory(s.getContractInternal(ProtoUtilV1.CNS_COVER_CXTOKEN_FACTORY, ProtoUtilV1.KEY_INTENTIONALLY_EMPTY));
  }

getPolicyContract

function getPolicyContract(IStore s) external view
returns(contract IPolicy)

Arguments

Name Type Description
s IStore
Source Code
function getPolicyContract(IStore s) external view returns (IPolicy) {
    return IPolicy(s.getContractInternal(ProtoUtilV1.CNS_COVER_POLICY, ProtoUtilV1.KEY_INTENTIONALLY_EMPTY));
  }

getReassuranceContract

function getReassuranceContract(IStore s) external view
returns(contract ICoverReassurance)

Arguments

Name Type Description
s IStore
Source Code
function getReassuranceContract(IStore s) external view returns (ICoverReassurance) {
    return ICoverReassurance(s.getContractInternal(ProtoUtilV1.CNS_COVER_REASSURANCE, ProtoUtilV1.KEY_INTENTIONALLY_EMPTY));
  }

getBondPoolContract

function getBondPoolContract(IStore s) external view
returns(contract IBondPool)

Arguments

Name Type Description
s IStore
Source Code
function getBondPoolContract(IStore s) external view returns (IBondPool) {
    return IBondPool(getBondPoolAddress(s));
  }

getProtocolContract

function getProtocolContract(IStore s, bytes32 cns) public view
returns(address)

Arguments

Name Type Description
s IStore
cns bytes32
Source Code
function getProtocolContract(IStore s, bytes32 cns) public view returns (address) {
    return s.getAddressByKeys(ProtoUtilV1.NS_CONTRACTS, cns);
  }

getProtocolContract

function getProtocolContract(IStore s, bytes32 cns, bytes32 key) public view
returns(address)

Arguments

Name Type Description
s IStore
cns bytes32
key bytes32
Source Code
function getProtocolContract(
    IStore s,
    bytes32 cns,
    bytes32 key
  ) public view returns (address) {
    return s.getAddressByKeys(ProtoUtilV1.NS_CONTRACTS, cns, key);
  }

getCoverContract

function getCoverContract(IStore s) external view
returns(contract ICover)

Arguments

Name Type Description
s IStore
Source Code
function getCoverContract(IStore s) external view returns (ICover) {
    address vault = getProtocolContract(s, ProtoUtilV1.CNS_COVER);
    return ICover(vault);
  }

getVault

function getVault(IStore s, bytes32 coverKey) external view
returns(contract IVault)

Arguments

Name Type Description
s IStore
coverKey bytes32
Source Code
function getVault(IStore s, bytes32 coverKey) external view returns (IVault) {
    return IVault(getVaultAddress(s, coverKey));
  }

getVaultAddress

function getVaultAddress(IStore s, bytes32 coverKey) public view
returns(address)

Arguments

Name Type Description
s IStore
coverKey bytes32
Source Code
function getVaultAddress(IStore s, bytes32 coverKey) public view returns (address) {
    address vault = getProtocolContract(s, ProtoUtilV1.CNS_COVER_VAULT, coverKey);
    return vault;
  }

getVaultDelegate

function getVaultDelegate(IStore s) external view
returns(address)

Arguments

Name Type Description
s IStore
Source Code
function getVaultDelegate(IStore s) external view returns (address) {
    address vaultImplementation = getProtocolContract(s, ProtoUtilV1.CNS_COVER_VAULT_DELEGATE);
    return vaultImplementation;
  }

getStakingPoolAddress

function getStakingPoolAddress(IStore s) external view
returns(address)

Arguments

Name Type Description
s IStore
Source Code
function getStakingPoolAddress(IStore s) external view returns (address) {
    address pool = getProtocolContract(s, ProtoUtilV1.CNS_STAKING_POOL);
    return pool;
  }

getBondPoolAddress

function getBondPoolAddress(IStore s) public view
returns(address)

Arguments

Name Type Description
s IStore
Source Code
function getBondPoolAddress(IStore s) public view returns (address) {
    address pool = getProtocolContract(s, ProtoUtilV1.CNS_BOND_POOL);
    return pool;
  }

getVaultFactoryContract

function getVaultFactoryContract(IStore s) external view
returns(contract IVaultFactory)

Arguments

Name Type Description
s IStore
Source Code
function getVaultFactoryContract(IStore s) external view returns (IVaultFactory) {
    address factory = s.getContractInternal(ProtoUtilV1.CNS_COVER_VAULT_FACTORY, ProtoUtilV1.KEY_INTENTIONALLY_EMPTY);
    return IVaultFactory(factory);
  }

Contracts