Overview
IOraclesManager defines the interface for managing the validator network.
Interface Location: contracts/interfaces/IOraclesManager.sol
Structs
OracleInfo
struct OracleInfo {
bool exist;
bool isValid;
bool required;
}
Whether the oracle has been registered
Whether the oracle is currently active
Whether this oracle must sign every transaction
Events
AddOracle
event AddOracle(address oracle, bool required);
Emitted when a new oracle is added to the network.
UpdateOracle
event UpdateOracle(address oracle, bool required, bool isValid);
Emitted when an oracle’s status is updated.
View Functions
function minConfirmations() external view returns (uint8);
function excessConfirmations() external view returns (uint8);
function requiredOraclesCount() external view returns (uint8);
function oracleAddresses(uint256 index) external view returns (address);
function getOracleInfo(address oracle) external view returns (OracleInfo memory);
Integration Example
IOraclesManager oraclesManager = IOraclesManager(managerAddress);
// Check oracle status
IOraclesManager.OracleInfo memory info = oraclesManager.getOracleInfo(oracleAddress);
require(info.isValid, "Oracle not valid");
// Get confirmation requirements
uint8 minSigs = oraclesManager.minConfirmations();
uint8 requiredCount = oraclesManager.requiredOraclesCount();