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

27 lines
866 B
Solidity
Raw Normal View History

// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
2020-08-20 10:44:51 +00:00
import {ILendingRateOracle} from '../../interfaces/ILendingRateOracle.sol';
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
contract LendingRateOracle is ILendingRateOracle, Ownable {
2020-07-13 08:54:08 +00:00
mapping(address => uint256) borrowRates;
mapping(address => uint256) liquidityRates;
2020-07-13 08:54:08 +00:00
function getMarketBorrowRate(address _asset) external override view returns (uint256) {
return borrowRates[_asset];
}
2020-07-13 08:54:08 +00:00
function setMarketBorrowRate(address _asset, uint256 _rate) external override onlyOwner {
borrowRates[_asset] = _rate;
}
2020-07-13 08:54:08 +00:00
function getMarketLiquidityRate(address _asset) external view returns (uint256) {
return liquidityRates[_asset];
}
2020-07-13 08:54:08 +00:00
function setMarketLiquidityRate(address _asset, uint256 _rate) external onlyOwner {
liquidityRates[_asset] = _rate;
}
}