Skip to main content

DefaultOperatorRewards

Git Source

Methods

NETWORK_MIDDLEWARE_SERVICE

function NETWORK_MIDDLEWARE_SERVICE() external view returns (address)

Get the network middleware service's address.

Returns

NameTypeDescription
addressaddress of the network middleware service

balance

function balance(address network, address token) external view returns (uint256 amount)

Get an amount of tokens that can be claimed for a particular network.

Parameters

NameTypeDescription
networkaddressaddress of the network
tokenaddressaddress of the token

Returns

NameTypeDescription
uint256amount of tokens that can be claimed

claimRewards

function claimRewards(address recipient, address network, address token, uint256 totalClaimable, bytes32[] proof) external nonpayable returns (uint256 amount)

Claim rewards for a particular network and token by providing a Merkle proof.

Parameters

NameTypeDescription
recipientaddressaddress of the rewards' recipient
networkaddressaddress of the network
tokenaddressaddress of the token
totalClaimableuint256total amount of the reward tokens for the whole time
proofbytes32[]Merkle proof of the reward distribution

Returns

NameTypeDescription
amountuint256amount of tokens claimed

claimed

function claimed(address network, address token, address account) external view returns (uint256 amount)

Get a claimed amount of rewards for a particular account, network, and token.

Parameters

NameTypeDescription
networkaddressaddress of the network
tokenaddressaddress of the token
accountaddressaddress of the claimer

Returns

NameTypeDescription
amountuint256claimed amount of tokens

distributeRewards

function distributeRewards(address network, address token, uint256 amount, bytes32 root) external nonpayable

Distribute rewards by a particular network using a given token by providing a Merkle root.

Parameters

NameTypeDescription
networkaddressaddress of the network
tokenaddressaddress of the token
amountuint256amount of tokens to send to the contract
rootbytes32Merkle root of the reward distribution

root

function root(address network, address token) external view returns (bytes32 value)

Get a Merkle root of a reward distribution for a particular network and token.

Parameters

NameTypeDescription
networkaddressaddress of the network
tokenaddressaddress of the token

Returns

NameTypeDescription
valuebytes32Merkle root of the reward distribution

Events

ClaimRewards

event ClaimRewards(address recipient, address indexed network, address indexed token, address indexed claimer, uint256 amount)

Emitted when rewards are claimed by a particular account for a particular network using a given token.

Parameters

NameTypeDescription
recipientaddressaddress of the rewards' recipient
network indexedaddressaddress of the network
token indexedaddressaddress of the token
claimer indexedaddressaddress of the rewards' claimer
amountuint256amount of tokens claimed

DistributeRewards

event DistributeRewards(address indexed network, address indexed token, uint256 amount, bytes32 root)

Emitted when rewards are distributed by a particular network using a given token by providing a Merkle root.

The Merkle tree's leaves must represent an account and a claimable amount (the total amount of the reward tokens for the whole time).

Parameters

NameTypeDescription
network indexedaddressaddress of the network that distributed rewards
token indexedaddressaddress of the token
amountuint256amount of tokens sent to the contract
rootbytes32Merkle root of the rewards distribution

Initialized

event Initialized(uint64 version)

Triggered when the contract has been initialized or reinitialized.

Parameters

NameTypeDescription
versionuint64