Files
dodo-contractV2/contracts/helper/ChainlinkEthPriceOracleProxy.sol

26 lines
510 B
Solidity
Raw Normal View History

2020-07-13 16:55:55 +08:00
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
2020-08-31 13:19:42 +08:00
2020-07-13 16:55:55 +08:00
interface IChainlink {
function latestAnswer() external view returns (uint256);
}
2020-08-31 13:19:42 +08:00
2020-07-13 16:55:55 +08:00
// for WETH-USDC(decimals=6) price convert
contract ChainlinkETHPriceOracleProxy {
2020-08-31 13:19:42 +08:00
address public chainlink = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419;
2020-07-13 16:55:55 +08:00
function getPrice() external view returns (uint256) {
return IChainlink(chainlink).latestAnswer() / 100;
}
}