Aggregator

Base contract for aggregation of transfer's confirmations

Modifiers

onlyOracle

modifier onlyOracle();

Throws if called by any account other than the oracle.

onlyAdmin

modifier onlyAdmin();

Throws if called by any account other than the admin.

Read-Only Functions

ORACLE_ROLE

function ORACLE_ROLE() public view returns (bytes32);

Returns oracle role identifier.

minConfirmations

function minConfirmations() public view returns (uint256);

Returns minimal required confirmations to confirm the transfer.

allocatedFunds

function allocatedFunds() public view returns (uint256);

Returns LINK's amount assigned to oracles for the past submissions; total amount of earned and not withdrawn LINKs.

availableFunds

function availableFunds() public view returns (uint256);

Returns LINK's amount available to be paid to oracles.

payment

function payment() public view returns (uint256);

Returns payment for the single submission.

function link() public view returns (IERC20);

Returns LINK's token address.

getOracleInfo

function getOracleInfo(address _oracle)
public
view
returns (OracleInfo memory);

Returns information about the oracle.

Parameter

Type

Description

_oracle

address

Oracle's address

getWithdrawable

function getWithdrawable(address _oracle) external view returns (uint256);

Returns oracle virtual balance.

Parameter

Type

Description

_oracle

address

Oracle's address

State-Changing Functions

withdrawPayment

function withdrawPayment(
address _oracle,
address _recipient,
uint256 _amount
) external;

Withdraws oracle reward if called by oracle's admin.

Parameter

Type

Description

_oracle

address

Oracle address

_recipient

address

Recipient address

_amount

uint256

Withdrawal amount

updateOracleAddress

function updateOracleAddress(address _oracle, address _newOracle) external;

Updates oracle's address if called by oracle's admin.

Parameter

Type

Description

_oracle

address

Oracle address

_newOracle

address

Update oracle address

updateOracleAdmin

function updateOracleAdmin(address _oracle, address _newOracleAdmin)
external;

Updates oracle's admin if called by oracle's admin.

Parameter

Type

Description

_oracle

address

Oracle address

_newOracleAdmin

address

Update admin address

updateAvailableFunds

function updateAvailableFunds() public;

Updates reward amount that can be distributed.

onTokenTransfer

function onTokenTransfer(
address,
uint256,
bytes calldata _data
) external;

Updates link balance during the LINK's transfer call.

Parameter

Type

Description

_data

bytes

Calldata; should be empty

withdrawFunds

function withdrawFunds(address _recipient, uint256 _amount)
external;

Withdraws earned LINK's if called by oracle's admin.

Parameter

Type

Description

_recipient

address

Receiver address

_amount

address

Amount to withdraw

setMinConfirmations

function setMinConfirmations(uint256 _minConfirmations) external;

Sets minimal required confirmations to confirm the transfer.

Parameter

Type

Description

_minConfirmations

uint256

Minimal required confirmations

setPayment

function setPayment(uint128 _payment) external;

Sets new oracle reward.

Parameter

Type

Description

_payment

uint256

Payment for the confirmation

addOracle

function addOracle(address _oracle, address _admin) external;

Add new oracle.

Parameter

Type

Description

_oracle

address

Oracle's address

_admin

address

Admin's address

removeOracle

function removeOracle(address _oracle) external;

Remove oracle.

Parameter

Type

Description

_oracle

address

Oracle's address