-
Notifications
You must be signed in to change notification settings - Fork 0
/
OvalLiquidationDemoPriceFeed.sol
44 lines (37 loc) · 1.4 KB
/
OvalLiquidationDemoPriceFeed.sol
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
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import {IAggregatorV3Source} from "oval/src/interfaces/chainlink/IAggregatorV3Source.sol";
import {Ownable} from "openzeppelin-contracts/contracts/access/Ownable.sol";
contract OvalLiquidationDemoPriceFeed is IAggregatorV3Source, Ownable {
int256 public answer;
uint80 public roundId;
uint256 public updatedAt;
uint256 public startedAt;
uint80 public answeredInRound;
constructor() {
answer = 100 * 10 ** 8; // 1 ETH = 100 USD (8 decimals)
roundId = 1;
updatedAt = block.timestamp;
startedAt = block.timestamp;
answeredInRound = 1;
}
function decimals() external view returns (uint8) {
return 8;
}
function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80) {
return (roundId, answer, startedAt, updatedAt, answeredInRound);
}
function getRoundData(uint80) external view returns (uint80, int256, uint256, uint256, uint80) {
return (roundId, answer, startedAt, updatedAt, answeredInRound);
}
function setValues(int256 _answer, uint80 _roundId, uint256 _updatedAt, uint256 _startedAt, uint80 _answeredInRound)
external
onlyOwner
{
answer = _answer;
roundId = _roundId;
updatedAt = _updatedAt;
startedAt = _startedAt;
answeredInRound = _answeredInRound;
}
}