new oracle

This commit is contained in:
mingda
2020-09-26 10:34:28 +08:00
parent 7da95f1c12
commit 286f0f04df
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
interface IBandOracleAggregator {
function getReferenceData(string memory base, string memory quote)
external
view
returns (uint256);
}
contract BandBNBBUSDPriceOracleProxy {
IBandOracleAggregator public aggregator;
constructor(IBandOracleAggregator _aggregator) public {
aggregator = _aggregator;
}
function getPrice() public view returns (uint256) {
return aggregator.getReferenceData("BNB", "USD");
}
}

View File

@@ -0,0 +1,22 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
contract ConstOracle {
uint256 public tokenPrice;
constructor(uint256 _price) public {
tokenPrice = _price;
}
function getPrice() external view returns (uint256) {
return tokenPrice;
}
}