Overview
AppRewardsDistributor distributes app-specific rewards to holders of that app’s token. Each app has its own distributor instance, funded by the app’s share of collected fees.
Key Functions
Read
| Function | Returns | Description |
|---|---|---|
earned(uint256 appId, address account) | uint256 | Unclaimed app rewards |
rewardRate(uint256 appId) | uint256 | Reward emission rate for app |
totalStaked(uint256 appId) | uint256 | Total app tokens staked |
stakedBalance(uint256 appId, address account) | uint256 | User’s staked app tokens |
Write
| Function | Access | Description |
|---|---|---|
stake(uint256 appId, uint256 amount) | Token holder | Stake app tokens for rewards |
unstake(uint256 appId, uint256 amount) | Token holder | Unstake app tokens |
claim(uint256 appId) | Token holder | Claim accrued rewards |
distribute(uint256 appId, uint256 amount) | FeeManager | Push new rewards for an app |
Reward Flow
Events
| Event | Emitted When |
|---|---|
Staked(uint256 appId, address account, uint256 amount) | Tokens staked |
Unstaked(uint256 appId, address account, uint256 amount) | Tokens unstaked |
RewardClaimed(uint256 appId, address account, uint256 amount) | Rewards claimed |
RewardDistributed(uint256 appId, uint256 amount) | New rewards pushed |