all files / contracts/interfaces/risk/ ICoverageDataProviderV2.sol

100% Statements 0/0
100% Branches 0/0
100% Functions 0/0
100% Lines 0/0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98                                                                                                                                                                                                   
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
 
/**
 * @title ICoverageDataProviderV2
 * @author solace.fi
 * @notice Holds underwriting pool amounts in `USD`. Provides information to the [**Risk Manager**](./RiskManager.sol) that is the maximum amount of cover that `Solace` protocol can sell as a coverage.
*/
interface ICoverageDataProviderV2 {
  
    /***************************************
     EVENTS
    ***************************************/
 
    /// @notice Emitted when the underwriting pool is set.
    event UnderwritingPoolSet(string uwpName, uint256 amount);
 
    /// @notice Emitted when underwriting pool is removed.
    event UnderwritingPoolRemoved(string uwpName);
 
    /// @notice Emitted when underwriting pool updater is set.
    event UwpUpdaterSet(address uwpUpdater);
 
    /// @notice Emitted when underwriting pool updater is removed.
    event UwpUpdaterRemoved(address uwpUpdater);
 
    /***************************************
     MUTUATOR FUNCTIONS
    ***************************************/
 
    /**
      * @notice Resets the underwriting pool balances.
      * @param uwpNames The underwriting pool values to set.
      * @param amounts The underwriting pool balances.
    */
    function set(string[] calldata uwpNames, uint256[] calldata amounts) external;
 
    /**
     * @notice Removes the given underwriting pool.
     * @param uwpNames The underwriting pool names to remove.
    */
    function remove(string[] calldata uwpNames) external;
 
    /***************************************
     VIEW FUNCTIONS
    ***************************************/
 
    /**
     * @notice Returns the balance of the underwriting pool in `USD`.
     * @param uwpName The underwriting pool name to get balance.
     * @return amount The balance of the underwriting pool in `USD`.
    */
    function balanceOf(string memory uwpName) external view returns (uint256 amount); 
 
    /**
     * @notice Returns underwriting pool name for given index.
     * @param index The underwriting pool index to get.
     * @return uwpName The underwriting pool name.
    */
    function poolOf(uint256 index) external view returns (string memory uwpName);
 
    /**
     * @notice Returns if given address is a valid underwriting pool updater.
     * @param updater The address to check.
     * @return status True if the address is valid updater.
    */
    function isUpdater(address updater) external view returns (bool status);
 
    /**
     * @notice Returns updater for given index.
     * @param index The index to get updater.
     * @return updater The updater address.
    */
    function updaterAt(uint256 index) external view returns (address updater);
 
    /**
     * @notice Returns the length of the updaters.
     * @return count The updater count.
    */
    function numsOfUpdater() external view returns (uint256 count);
    
    /***************************************
     GOVERNANCE FUNCTIONS
    ***************************************/
 
    /**
     * @notice Sets the underwriting pool bot updater.
     * @param updater The bot address to set.
    */
    function addUpdater(address updater) external;
 
    /**
     * @notice Sets the underwriting pool bot updater.
     * @param updater The bot address to set.
    */
    function removeUpdater(address updater) external;
}