OraclesManager

The base contract for oracles management. Allows adding/removing oracles, managing the minimal required amount of confirmations.

Variables

minConfirmations

  uint8 public minConfirmations;

Minimal required confirmations

excessConfirmations

  uint8 public excessConfirmations;

Minimal required confirmations in case of too many confirmations

requiredOraclesCount

  uint8 public requiredOraclesCount;

Count of required oracles

oracleAddresses

  address[] public oracleAddresses;

Oracle addresses

getOracleInfo

  mapping(address => struct IOraclesManager.OracleInfo) public getOracleInfo;

Maps an oracle address to the oracle details

Functions

initialize

  function initialize(
            uint8 _minConfirmations,
            uint8 _excessConfirmations
  ) internal

Constructor that initializes the most important configurations.

Parameters:

NameTypeDescription

_minConfirmations

uint8

Minimal required confirmations.

_excessConfirmations

uint8

Minimal required confirmations in case of too many confirmations.

setMinConfirmations

  function setMinConfirmations(
            uint8 _minConfirmations
  ) external

Sets minimal required confirmations.

Parameters:

NameTypeDescription

_minConfirmations

uint8

Minimal required confirmations.

setExcessConfirmations

  function setExcessConfirmations(
            uint8 _excessConfirmations
  ) external

Sets minimal required confirmations in case of too many confirmations.

Parameters:

NameTypeDescription

_excessConfirmations

uint8

Minimal required confirmations in case of too many confirmations.

addOracles

  function addOracles(
            address[] _oracles,
            bool[] _required
  ) external

Add oracles.

Parameters:

NameTypeDescription

_oracles

address[]

Oracles' addresses.

_required

bool[]

A transfer will not be confirmed without oracles having required set to true,

updateOracle

  function updateOracle(
            address _oracle,
            bool _isValid,
            bool _required
  ) external

Update an oracle.

Parameters:

NameTypeDescription

_oracle

address

An oracle address.

_isValid

bool

Is this oracle valid, i.e. should it be treated as an oracle.

_required

bool

If set to true a transfer will not be confirmed without this oracle.

Last updated