diff --git a/contracts/helper/BandBNBBUSDPriceOracleProxy.sol b/contracts/helper/BandBNBBUSDPriceOracleProxy.sol new file mode 100644 index 0000000..681f31a --- /dev/null +++ b/contracts/helper/BandBNBBUSDPriceOracleProxy.sol @@ -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"); + } +} diff --git a/contracts/helper/ConstOracle.sol b/contracts/helper/ConstOracle.sol new file mode 100644 index 0000000..87181e8 --- /dev/null +++ b/contracts/helper/ConstOracle.sol @@ -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; + } +}