OracleManager

Contract for oracle's staking

Read-Only Functions

getOracleInfo

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

Returns oracle info.

Parameter

Type

Description

_oracle

address

Oracle's address

token

function token() public view returns (IERC20);

Returns staked token address

confiscatedFunds

function confiscatedFunds() public view returns (uint256);

Returns total confiscated tokens.

totalLocked

function totalLocked() public view returns (uint256);

Returns total staked tokens.

timelock

function timelock() public view returns (uint256);

Returns duration of withdrawal timelock.

getWithdrawalRequest

function getWithdrawalRequest(address _oracle, uint256 _withdrawalId)
public
view
returns (WithdrawalInfo memory);

Returns withdrawal request details.

Parameter

Type

Description

_oracle

address

Oracle's address

_withdrawalId

uint256

Token's receiver

State-Changing Functions

stake

function stake(address _oracle, uint256 _amount) external;

Used for calls where native asset transfer is involved.

Parameter

Type

Description

_oracle

address

Oracle's address

_amount

uint256

Amount of tokens to stake

requestUnstake

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

Withdraws oracle reward.

Parameter

Type

Description

_oracle

address

Oracle's address

_recipient

address

Token's receiver

_amount

uint256

Amount of tokens to stake

executeUnstake

function executeUnstake(address _oracle, uint256 _withdrawalId) external;

Withdraw stake if called by the oracle admin.

Parameter

Type

Description

_oracle

address

Oracle's address

_withdrawalId

uint256

Token's receiver

setTimelock

function setTimelock(uint256 _newTimelock) external;

Change withdrawal timelock.

Parameter

Type

Description

_newTimelock

address

Withdrawal timelock

addOracle

function addOracle(address _oracle, address _admin) external;

Add new oracle if called by the contract owner.

Parameter

Type

Description

_oracle

address

Oracle's address

_admin

address

Admin address

cancelUnstake

function cancelUnstake(address _oracle, uint256 _withdrawalId)
external;

Cancel unstake if called by the contract owner.

Parameter

Type

Description

_oracle

address

Oracle's address

_withdrawalId

uint256

Token's receiver

liquidate

function liquidate(address _oracle, uint256 _amount) external;

Confiscate stake.

Parameter

Type

Description

_oracle

address

Oracle's address

_amount

uint256

Amount of tokens to stake

withdrawFunds

function withdrawFunds(address _recipient, uint256 _amount)
external;

Withdraws confiscated tokens if called by contract's owner.

Parameter

Type

Description

_recipient

address

Token's receiver

_amount

uint256

Amount of tokens to stake