第107篇 Compound 中的 InterestRateModel

Posted wonderBlock

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第107篇 Compound 中的 InterestRateModel相关的知识,希望对你有一定的参考价值。

 一、接口

先来看看 InterestRateModel.sol 合约代码:

pragma solidity ^0.5.16;

/**
  * @title Compound\'s InterestRateModel Interface
  * @author Compound
  */
contract InterestRateModel 
    /// @notice Indicator that this is an InterestRateModel contract (for inspection)
    bool public constant isInterestRateModel = true;

    /**
      * @notice Calculates the current borrow interest rate per block
      * @param cash The total amount of cash the market has
      * @param borrows The total amount of borrows the market has outstanding
      * @param reserves The total amount of reserves the market has
      * @return The borrow rate per block (as a percentage, and scaled by 1e18)
      */
    function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);

    /**
      * @notice Calculates the current supply interest rate per block
      * @param cash The total amount of cash the mark

以上是关于第107篇 Compound 中的 InterestRateModel的主要内容,如果未能解决你的问题,请参考以下文章