Skip to content
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

Merged
merged 5 commits into from
Apr 27, 2022

Conversation

pdyraga
Copy link
Member

@pdyraga pdyraga commented Apr 26, 2022

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 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.

@pdyraga pdyraga self-assigned this Apr 26, 2022
@pdyraga pdyraga requested a review from dimpar April 26, 2022 10:16
@@ -630,6 +630,14 @@
"@openzeppelin/contracts" "^4.3.2"
"@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf"

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in bc00d15.

Base automatically changed from rewards-api-2 to main April 26, 2022 15:01
pdyraga added 5 commits April 27, 2022 08:43
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.
@pdyraga
Copy link
Member Author

pdyraga commented Apr 27, 2022

#2953 got merged so I rebased this PR over main. Undrafting now.

@pdyraga pdyraga marked this pull request as ready for review April 27, 2022 07:01
Copy link
Contributor

@dimpar dimpar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dimpar dimpar merged commit 3b65dfd into main Apr 27, 2022
@dimpar dimpar deleted the rewards-api-3 branch April 27, 2022 07:44
@pdyraga pdyraga removed their assignment Apr 28, 2022
@pdyraga pdyraga added this to the solidity/v2.0.0 milestone Jun 2, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants