-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Adjusting WalletRegistry to Threshold IApplication rewards API #2954
Conversation
@@ -630,6 +630,14 @@ | |||
"@openzeppelin/contracts" "^4.3.2" | |||
"@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once #2953 is merged, we need to update @keep-network/random-beacon
dependency to eliminate the sortition pool entry above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge #2956 first. Then, once a new @keep-network/random-beacon
NPM package is published, I will update this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in bc00d15.
The most recent version includes improvements to rewards API. First, it is possible to fetch the amount of rewards withdrawable. Second, withdrawRewards function returns the amount withdrawn.
`WalletRegistry.withdrawRewards` emits `RewardsWithdrawn` event informing about the amount of tokens withdrawn in the transaction. `WalletRegistry.availableRewards` informs about the amount of reward tokens available for withdrawal for the staking provider.
SortitionPool is trusted contract so there is no risk of re-entrancy. The event emitted after the call needs the amount and amount is returned by the SortitionPool.
Updated @keep-network/random-beacon and @threshold-network/solidity-contracts dependencies to the most recent development versions. The most recent versions are both aligned around reward-related changes in IApplication interface.
This event is now declared as a part of IApplication interface, WalletRegistry extends.
#2953 got merged so I rebased this PR over |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Depends on #2953; Keeping it as a draft PR until #2953 is not merged.Refs threshold-network/solidity-contracts#89
Refs #2935
See threshold-network/solidity-contracts#95
See keep-network/sortition-pools#162
See keep-network/sortition-pools#163
WalletRegistry.withdrawRewards
emitsRewardsWithdrawn
event informing aboutthe amount of tokens withdrawn in the transaction.
WalletRegistry.availableRewards
informs about the amount of reward tokensavailable for withdrawal for the staking provider.