aave-protocol-v2/contracts/mocks/oracle/LendingRateOracle.sol

28 lines
860 B
Solidity
Raw Normal View History

// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
import "../../interfaces/ILendingRateOracle.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract LendingRateOracle is ILendingRateOracle, Ownable {
mapping(address => uint256) borrowRates;
mapping(address => uint256) liquidityRates;
function getMarketBorrowRate(address _asset) external override view returns(uint256) {
return borrowRates[_asset];
}
function setMarketBorrowRate(address _asset, uint256 _rate) external override onlyOwner {
borrowRates[_asset] = _rate;
}
function getMarketLiquidityRate(address _asset) external view returns(uint256) {
return liquidityRates[_asset];
}
function setMarketLiquidityRate(address _asset, uint256 _rate) external onlyOwner {
liquidityRates[_asset] = _rate;
}
}