Oracle
Oracle
network name:kovan chain id: 42
Interface
The Oracle contract connects to two oracle platforms, BandProcotal, ChainLink. GetTokenPrice takes the average price of the three platforms in a 1:2 ratio.
Events
Methods(Read Contract)
1. Get Band Price
function getBandPrice(string sybmol) public view returns (uint256);
Get bandprotocol price
param | type | description |
---|---|---|
sybmol | string | ERC20 token name,like ETH |
return | type | description |
---|---|---|
_prices | uint256 | price |
2. Get ChainLink Price
function getChainLinkPrice(string sybmol) public view returns (uint256)
Get ChainLink Price
param | type | description |
---|---|---|
sybmol | string | ERC20 token name,like ETH |
return | type | description |
---|---|---|
_prices | uint256 | price |
3. Get Token Price
function getTokenPrice(string sybmol) external view returns (uint256 _price, uint8 _decimals)
Get two oracle prices at the same time and calculate the final price
param | type | description |
---|---|---|
sybmol | string | ERC20 token name,like ETH |
return | type | description |
---|---|---|
prices | uint256 | price |
4. Get Circul Supplys
function getCirculSupplys(string sybmol) external view returns (uint256)
**Get the number of token issues, and the number of issues for contract record, which is not real-time **
param | type | description |
---|---|---|
sybmol | string | ERC20 token name,like ETH |
return | type | description |
---|---|---|
amount | uint256 | amount |
Methods(Write Contract)
1. Set Weight
function setWeight( uint8 _chainLinkWeight, uint8 _bandWeight, uint8 _uniswapv3Weight) external;
Set oracle weight
param | type | description |
---|---|---|
_chainLinkWeight | uint8 | chainlink weight |
_bandWeight | uint8 | band protocol weight |
_uniswapv3Weight | uint8 | uniswapv3 weight |
Last updated