22 lines
446 B
Solidity
22 lines
446 B
Solidity
|
|
// SPDX-License-Identifier: MIT
|
||
|
|
pragma solidity ^0.8.0;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @title IPriceFeed
|
||
|
|
* @notice 价格预言机接口
|
||
|
|
*/
|
||
|
|
interface IPriceFeed {
|
||
|
|
/**
|
||
|
|
* @notice 获取资产价格
|
||
|
|
* @return price 价格 (scaled by 1e8)
|
||
|
|
*/
|
||
|
|
function getPrice() external view returns (uint256 price);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @notice 获取价格精度
|
||
|
|
* @return 价格小数位数
|
||
|
|
*/
|
||
|
|
function decimals() external view returns (uint8);
|
||
|
|
}
|
||
|
|
|