DefaultOperatorRewards
Methods
NETWORK_MIDDLEWARE_SERVICE
function NETWORK_MIDDLEWARE_SERVICE() external view returns (address)
Get the network middleware service’s address.
Returns
Name | Type | Description |
---|---|---|
address | address 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
Name | Type | Description |
---|---|---|
network | address | address of the network |
token | address | address of the token |
Returns
Name | Type | Description |
---|---|---|
uint256 | amount 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
Name | Type | Description |
---|---|---|
recipient | address | address of the rewards’ recipient |
network | address | address of the network |
token | address | address of the token |
totalClaimable | uint256 | total amount of the reward tokens for the whole time |
proof | bytes32[] | Merkle proof of the reward distribution |
Returns
Name | Type | Description |
---|---|---|
amount | uint256 | amount 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
Name | Type | Description |
---|---|---|
network | address | address of the network |
token | address | address of the token |
account | address | address of the claimer |
Returns
Name | Type | Description |
---|---|---|
amount | uint256 | claimed 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
Name | Type | Description |
---|---|---|
network | address | address of the network |
token | address | address of the token |
amount | uint256 | amount of tokens to send to the contract |
root | bytes32 | Merkle 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
Name | Type | Description |
---|---|---|
network | address | address of the network |
token | address | address of the token |
Returns
Name | Type | Description |
---|---|---|
value | bytes32 | Merkle 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
Name | Type | Description |
---|---|---|
recipient | address | address of the rewards’ recipient |
network indexed | address | address of the network |
token indexed | address | address of the token |
claimer indexed | address | address of the rewards’ claimer |
amount | uint256 | amount 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
Name | Type | Description |
---|---|---|
network indexed | address | address of the network that distributed rewards |
token indexed | address | address of the token |
amount | uint256 | amount of tokens sent to the contract |
root | bytes32 | Merkle root of the rewards distribution |
Initialized
event Initialized(uint64 version)
Triggered when the contract has been initialized or reinitialized.
Parameters
Name | Type | Description |
---|---|---|
version | uint64 |