GNSTriggerRewards

Facet #6: Trigger rewards

Methods

claimPendingTriggerRewards

function claimPendingTriggerRewards(address _oracle) external nonpayable

Claims pending GNS trigger rewards for the caller

Parameters

NameTypeDescription

_oracle

address

address of the oracle

distributeTriggerReward

function distributeTriggerReward(uint256 _rewardGns) external nonpayable

Distributes GNS rewards to oracles for a specific trigger

Parameters

NameTypeDescription

_rewardGns

uint256

total GNS reward to be distributed among oracles

getTriggerPendingRewardsGns

function getTriggerPendingRewardsGns(address _oracle) external view returns (uint256)

Returns the pending GNS trigger rewards for an oracle

Parameters

NameTypeDescription

_oracle

address

address of the oracle

Returns

NameTypeDescription

_0

uint256

getTriggerTimeoutBlocks

function getTriggerTimeoutBlocks() external view returns (uint16)

Returns current triggerTimeoutBlocks value

Returns

NameTypeDescription

_0

uint16

hasActiveOrder

function hasActiveOrder(uint256 _orderBlock) external view returns (bool)

Checks if an order is active (exists and has not timed out)

Parameters

NameTypeDescription

_orderBlock

uint256

block number of the order

Returns

NameTypeDescription

_0

bool

initializeTriggerRewards

function initializeTriggerRewards(uint16 _timeoutBlocks) external nonpayable

Initializes parameters for trigger rewards facet

Parameters

NameTypeDescription

_timeoutBlocks

uint16

blocks after which a trigger times out

updateTriggerTimeoutBlocks

function updateTriggerTimeoutBlocks(uint16 _timeoutBlocks) external nonpayable

Updates the blocks after which a trigger times out

Parameters

NameTypeDescription

_timeoutBlocks

uint16

blocks after which a trigger times out

Events

TriggerRewarded

event TriggerRewarded(uint256 rewardsPerOracleGns, uint256 oraclesCount)

Emitted when trigger rewards are distributed for a specific order

Parameters

NameTypeDescription

rewardsPerOracleGns

uint256

reward in GNS distributed per oracle

oraclesCount

uint256

number of oracles rewarded

TriggerRewardsClaimed

event TriggerRewardsClaimed(address oracle, uint256 rewardsGns)

Emitted when pending GNS trigger rewards are claimed by an oracle

Parameters

NameTypeDescription

oracle

address

address of the oracle

rewardsGns

uint256

GNS rewards claimed

TriggerTimeoutBlocksUpdated

event TriggerTimeoutBlocksUpdated(uint16 timeoutBlocks)

Emitted when timeoutBlocks is updated

Parameters

NameTypeDescription

timeoutBlocks

uint16

blocks after which a trigger times out

Errors

AboveMax

error AboveMax()

AlreadyExists

error AlreadyExists()

BelowMin

error BelowMin()

BlockOrder

error BlockOrder()

DoesntExist

error DoesntExist()

InitError

error InitError()

InvalidAddresses

error InvalidAddresses()

InvalidCollateralIndex

error InvalidCollateralIndex()

InvalidInputLength

error InvalidInputLength()

NoPendingTriggerRewards

error NoPendingTriggerRewards()

NotAllowed

error NotAllowed()

NotAuthorized

error NotAuthorized()

Overflow

error Overflow()

Paused

error Paused()

TimeoutBlocksZero

error TimeoutBlocksZero()

WrongAccess

error WrongAccess()

WrongIndex

error WrongIndex()

WrongLength

error WrongLength()

WrongOrder

error WrongOrder()

WrongParams

error WrongParams()

WrongTradeType

error WrongTradeType()

ZeroAddress

error ZeroAddress()

ZeroValue

error ZeroValue()

Last updated