For staker rewards calculation, the vault provides the following data:
-
activeSharesOfAt(account, timestamp, hint)
-$\text{active}$ shares of the user at a specific timestamp -
activeSharesAt(timestamp, hint)
- total$\text{active}$ shares at a specific timestamp. - Other checkpointed getters
Reward processing is not integrated into the vault's functionality. Instead, external reward contracts should manage this using the provided data.
However, we created the first version of the IStakerRewards
interface to facilitate more generic reward distribution across networks.
IStakerRewards.version()
- provides a version of the interface that a particular rewards contract usesIStakerRewards.distributeRewards(network, token, amount, data)
- call to distributeamount
oftoken
on behalf ofnetwork
using an arbitrarydata
source .env
Deployment script: click
forge script script/deploy/DefaultStakerRewardsFactory.s.sol:DefaultStakerRewardsFactoryScript 0x0000000000000000000000000000000000000000 0x0000000000000000000000000000000000000000 --sig "run(address,address)" --broadcast --rpc-url=$ETH_RPC_URL
Deployment script: click
forge script script/deploy/DefaultStakerRewards.s.sol:DefaultStakerRewardsScript 0x0000000000000000000000000000000000000000 0x0000000000000000000000000000000000000000 0 0x0000000000000000000000000000000000000000 0x0000000000000000000000000000000000000000 0x0000000000000000000000000000000000000000 --sig "run(address,address,uint256,address,address,address)" --broadcast --rpc-url=$ETH_RPC_URL