Skip to main content
Interface for GNSTriggerRewards facet (inherits types and also contains functions, events, and custom errors)

initializeTriggerRewards

function initializeTriggerRewards(uint16 _timeoutBlocks) external
Initializes parameters for trigger rewards facet

Parameters

NameTypeDescription
_timeoutBlocksuint16blocks after which a trigger times out

updateTriggerTimeoutBlocks

function updateTriggerTimeoutBlocks(uint16 _timeoutBlocks) external
Updates the blocks after which a trigger times out

Parameters

NameTypeDescription
_timeoutBlocksuint16blocks after which a trigger times out

distributeTriggerReward

function distributeTriggerReward(uint256 _rewardGns) external
Distributes GNS rewards to oracles for a specific trigger

Parameters

NameTypeDescription
_rewardGnsuint256total GNS reward to be distributed among oracles

claimPendingTriggerRewards

function claimPendingTriggerRewards(address _oracle) external
Claims pending GNS trigger rewards for the caller

Parameters

NameTypeDescription
_oracleaddressaddress of the oracle

getTriggerTimeoutBlocks

function getTriggerTimeoutBlocks() external view returns (uint16)
Returns current triggerTimeoutBlocks value

hasActiveOrder

function hasActiveOrder(uint256 _orderBlock) external view returns (bool)
Checks if an order is active (exists and has not timed out)

Parameters

NameTypeDescription
_orderBlockuint256block number of the order

getTriggerPendingRewardsGns

function getTriggerPendingRewardsGns(address _oracle) external view returns (uint256)
Returns the pending GNS trigger rewards for an oracle

Parameters

NameTypeDescription
_oracleaddressaddress of the oracle

TriggerTimeoutBlocksUpdated

event TriggerTimeoutBlocksUpdated(uint16 timeoutBlocks)
Emitted when timeoutBlocks is updated

Parameters

NameTypeDescription
timeoutBlocksuint16blocks after which a trigger times out

TriggerRewarded

event TriggerRewarded(uint256 rewardsPerOracleGns, uint256 oraclesCount)
Emitted when trigger rewards are distributed for a specific order

Parameters

NameTypeDescription
rewardsPerOracleGnsuint256reward in GNS distributed per oracle
oraclesCountuint256number of oracles rewarded

TriggerRewardsClaimed

event TriggerRewardsClaimed(address oracle, uint256 rewardsGns)
Emitted when pending GNS trigger rewards are claimed by an oracle

Parameters

NameTypeDescription
oracleaddressaddress of the oracle
rewardsGnsuint256GNS rewards claimed

TimeoutBlocksZero

error TimeoutBlocksZero()

NoPendingTriggerRewards

error NoPendingTriggerRewards()