View Source: contracts/oracles/StableOracle.solโ
โ Extends: IOracle, Ownableโ
StableOracle
Constants & Variables
contract IOracle public oracle;uint256 public lastPrice;uint256 public evictPercentage;bool public manualOverride;uint256 public manualPrice;
Events
event ChangeOracle(address _oldOracle, address _newOracle);event ChangeEvictPercentage(uint256 _oldEvictPercentage, uint256 _newEvictPercentage);event SetManualPrice(uint256 _oldPrice, uint256 _newPrice);event SetManualOverride(bool _override);
โgetCurrencyAddress()โ
โgetCurrencySymbol()โ
โgetCurrencyDenominated()โ
โgetPrice()โ
Creates a new stable oracle based on existing oracle
function (address _oracle, uint256 _evictPercentage) public nonpayable
Arguments
Name | Type | Description |
_oracle | address | address of underlying oracle |
_evictPercentage | uint256 | โ |
Updates medianizer address
function changeOracle(address _oracle) public nonpayable onlyOwner
Arguments
Name | Type | Description |
_oracle | address | Address of underlying oracle |
Updates eviction percentage
function changeEvictPercentage(uint256 _evictPercentage) public nonpayable onlyOwner
Arguments
Name | Type | Description |
_evictPercentage | uint256 | Percentage multiplied by 10**16 |
โคพ overrides IOracle.getCurrencyAddressโ
Returns address of oracle currency (0x0 for ETH)
function getCurrencyAddress() external viewreturns(address)
Arguments
Name | Type | Description |
โคพ overrides IOracle.getCurrencySymbolโ
Returns symbol of oracle currency (0x0 for ETH)
function getCurrencySymbol() external viewreturns(bytes32)
Arguments
Name | Type | Description |
โคพ overrides IOracle.getCurrencyDenominatedโ
Returns denomination of price
function getCurrencyDenominated() external viewreturns(bytes32)
Arguments
Name | Type | Description |
โคพ overrides IOracle.getPriceโ
Returns price - should throw if not valid
function getPrice() external nonpayablereturns(uint256)
Arguments
Name | Type | Description |
function _change(uint256 _newPrice, uint256 _oldPrice) internal purereturns(uint256)
Arguments
Name | Type | Description |
_newPrice | uint256 | โ |
_oldPrice | uint256 | โ |
Set a manual price. NA - this will only be used if manualOverride == true
function setManualPrice(uint256 _price) public nonpayable onlyOwner
Arguments
Name | Type | Description |
_price | uint256 | Price to set |
Determine whether manual price is used or not
function setManualOverride(bool _override) public nonpayable onlyOwner
Arguments
Name | Type | Description |
_override | bool | Whether to use the manual override price or not |