-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added reward-related functions to IApplication interface #95
Conversation
The interface is minimal and does not enforce any specific requirements on how the rewards are actually accrued. `function withdrawRewards(address stakingProvider) external` withdraws application rewards for the given staking provider. Rewards are withdrawn to the staking provider's beneficiary address set in the staking contract. Function emits `RewardsWithdrawn(address indexed stakingProvider, uint96 amount)` so that applications can easily track the total amount of rewards accrued so far. `function availableRewards(address stakingProvider)` Returns the amount of application rewards available for withdrawal for the given staking provider.
Although this doesn't affect the PR, just to note that the In fact, I just realized if it makes sense to make a differentiation about accrued rewards and withdrawable rewards, e.g., because some app has some specific logic that limits withdrawals. In other words, is it possible that there's a context where, for some application, |
Correct, that was my intention and I think it is reflected in the code in the current form. The PR description is misleading but I'll leave it as-is given we have this conversation here.
I am not sure if accrued rewards should be a part of |
I take that there's no need for a function in this interface that withdraws only a part of accrued rewards? Also, I don't think |
I would not impose such requirements on applications. We want the reward withdrawal to be as cheap as possible, hence the minimum interface. If some application wants to provide something extra, sure but outside of the "must-have" contract.
There is no way we can enforce it on the compilation level but there is a |
Closes #89
The interface is minimal and does not enforce any specific requirements on how the rewards are actually accrued.
function withdrawRewards(address stakingProvider) external
withdraws application rewards for the given staking provider. Rewards are withdrawn to the staking provider's beneficiary address set in the staking contract. Function emitsRewardsWithdrawn(address indexed stakingProvider, uint96 amount)
so that applications can easily track the total amount of rewards accrued so far.function availableRewards(address stakingProvider)
Returns the amount of application rewards available for withdrawal for the given staking provider.