View Source: contracts/feeds/testnet/PriceFeedsMoC.sol
↗ Extends: IPriceFeedsExt, Ownable
Constants & Variables
address public mocOracleAddress;
address public rskOracleAddress;
Events
event SetMoCOracleAddress(address indexed mocOracleAddress, address changerAddress);
event SetRSKOracleAddress(address indexed rskOracleAddress, address changerAddress);
- peek()
- constructor(address _mocOracleAddress, address _rskOracleAddress)
- latestAnswer()
- setMoCOracleAddress(address _mocOracleAddress)
- setRSKOracleAddress(address _rskOracleAddress)
function peek() external view
returns(bytes32, bool)
Source Code
function peek() external view returns (bytes32, bool);
Initialize a new MoC Oracle. *
function (address _mocOracleAddress, address _rskOracleAddress) public nonpayable
Arguments
Name | Type | Description |
---|---|---|
_mocOracleAddress | address | The MoC Oracle address. |
_rskOracleAddress | address | The RSK Oracle address. |
Source Code
constructor(address _mocOracleAddress, address _rskOracleAddress) public {
setMoCOracleAddress(_mocOracleAddress);
setRSKOracleAddress(_rskOracleAddress);
}
undefined
Get the las time oracle updated the price.
function latestAnswer() external view
returns(uint256)
Source Code
function latestAnswer() external view returns (uint256) {
(bytes32 value, bool hasValue) = Medianizer(mocOracleAddress).peek();
if (hasValue) {
return uint256(value);
} else {
(uint256 price, ) = IRSKOracle(rskOracleAddress).getPricing();
return price;
}
}
Set the MoC Oracle address. *
function setMoCOracleAddress(address _mocOracleAddress) public nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
_mocOracleAddress | address | The MoC Oracle address. |
Source Code
function setMoCOracleAddress(address _mocOracleAddress) public onlyOwner {
require(Address.isContract(_mocOracleAddress), "_mocOracleAddress not a contract");
mocOracleAddress = _mocOracleAddress;
emit SetMoCOracleAddress(mocOracleAddress, msg.sender);
}
Set the RSK Oracle address. *
function setRSKOracleAddress(address _rskOracleAddress) public nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
_rskOracleAddress | address | The RSK Oracle address. |
Source Code
function setRSKOracleAddress(address _rskOracleAddress) public onlyOwner {
require(Address.isContract(_rskOracleAddress), "_rskOracleAddress not a contract");
rskOracleAddress = _rskOracleAddress;
emit SetRSKOracleAddress(rskOracleAddress, msg.sender);
}
- Address
- Administered
- AdminRole
- AdvancedToken
- AdvancedTokenStorage
- Affiliates
- AffiliatesEvents
- ApprovalReceiver
- BProPriceFeed
- CheckpointsShared
- Constants
- Context
- DevelopmentFund
- DummyContract
- EnumerableAddressSet
- EnumerableBytes32Set
- EnumerableBytes4Set
- ERC20
- ERC20Detailed
- ErrorDecoder
- Escrow
- EscrowReward
- FeedsLike
- FeesEvents
- FeeSharingCollector
- FeeSharingCollectorProxy
- FeeSharingCollectorStorage
- FeesHelper
- FourYearVesting
- FourYearVestingFactory
- FourYearVestingLogic
- FourYearVestingStorage
- GenericTokenSender
- GovernorAlpha
- GovernorVault
- IApproveAndCall
- IChai
- IContractRegistry
- IConverterAMM
- IERC1820Registry
- IERC20_
- IERC20
- IERC777
- IERC777Recipient
- IERC777Sender
- IFeeSharingCollector
- IFourYearVesting
- IFourYearVestingFactory
- IFunctionsList
- ILiquidityMining
- ILiquidityPoolV1Converter
- ILoanPool
- ILoanToken
- ILoanTokenLogicBeacon
- ILoanTokenLogicModules
- ILoanTokenLogicProxy
- ILoanTokenModules
- ILoanTokenWRBTC
- ILockedSOV
- IMoCState
- IModulesProxyRegistry
- Initializable
- InterestUser
- IPot
- IPriceFeeds
- IPriceFeedsExt
- IProtocol
- IRSKOracle
- ISovryn
- ISovrynSwapNetwork
- IStaking
- ISwapsImpl
- ITeamVesting
- ITimelock
- IV1PoolOracle
- IVesting
- IVestingFactory
- IVestingRegistry
- IWrbtc
- IWrbtcERC20
- LenderInterestStruct
- LiquidationHelper
- LiquidityMining
- LiquidityMiningConfigToken
- LiquidityMiningProxy
- LiquidityMiningStorage
- LoanClosingsEvents
- LoanClosingsLiquidation
- LoanClosingsRollover
- LoanClosingsShared
- LoanClosingsWith
- LoanClosingsWithoutInvariantCheck
- LoanInterestStruct
- LoanMaintenance
- LoanMaintenanceEvents
- LoanOpenings
- LoanOpeningsEvents
- LoanParamsStruct
- LoanSettings
- LoanSettingsEvents
- LoanStruct
- LoanToken
- LoanTokenBase
- LoanTokenLogicBeacon
- LoanTokenLogicLM
- LoanTokenLogicProxy
- LoanTokenLogicStandard
- LoanTokenLogicStorage
- LoanTokenLogicWrbtc
- LoanTokenSettingsLowerAdmin
- LockedSOV
- MarginTradeStructHelpers
- Medianizer
- ModuleCommonFunctionalities
- ModulesCommonEvents
- ModulesProxy
- ModulesProxyRegistry
- MultiSigKeyHolders
- MultiSigWallet
- Mutex
- Objects
- OrderStruct
- OrigingVestingCreator
- OriginInvestorsClaim
- Ownable
- Pausable
- PausableOz
- PreviousLoanToken
- PreviousLoanTokenSettingsLowerAdmin
- PriceFeedRSKOracle
- PriceFeeds
- PriceFeedsLocal
- PriceFeedsMoC
- PriceFeedV1PoolOracle
- ProtocolAffiliatesInterface
- ProtocolLike
- ProtocolSettings
- ProtocolSettingsEvents
- ProtocolSettingsLike
- ProtocolSwapExternalInterface
- ProtocolTokenUser
- Proxy
- ProxyOwnable
- ReentrancyGuard
- RewardHelper
- RSKAddrValidator
- SafeERC20
- SafeMath
- SafeMath96
- setGet
- SharedReentrancyGuard
- SignedSafeMath
- SOV
- sovrynProtocol
- StakingAdminModule
- StakingGovernanceModule
- StakingInterface
- StakingProxy
- StakingRewards
- StakingRewardsProxy
- StakingRewardsStorage
- StakingShared
- StakingStakeModule
- StakingStorageModule
- StakingStorageShared
- StakingVestingModule
- StakingWithdrawModule
- State
- SwapsEvents
- SwapsExternal
- SwapsImplLocal
- SwapsImplSovrynSwap
- SwapsUser
- TeamVesting
- Timelock
- TimelockHarness
- TimelockInterface
- TokenSender
- UpgradableProxy
- USDTPriceFeed
- Utils
- VaultController
- Vesting
- VestingCreator
- VestingFactory
- VestingLogic
- VestingRegistry
- VestingRegistry2
- VestingRegistry3
- VestingRegistryLogic
- VestingRegistryProxy
- VestingRegistryStorage
- VestingStorage
- WeightedStakingModule
- WRBTC