-
Notifications
You must be signed in to change notification settings - Fork 108
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
feat: add function to withdraw and check delegator rewards #3088
base: develop
Are you sure you want to change the base?
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3088 +/- ##
===========================================
- Coverage 63.43% 62.60% -0.83%
===========================================
Files 425 428 +3
Lines 30003 30405 +402
===========================================
+ Hits 19031 19034 +3
- Misses 10137 10537 +400
+ Partials 835 834 -1
|
// - Check the amount to unlock is valid. | ||
// - Burn the Cosmos coins. | ||
// - Unlock the ZRC20 coins. | ||
for _, coin := range coins { |
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.
Do we want this function to actually withdraw the ZRC20?
An alternative could be withdrawing the cosmos coin to the delegator cosmos address, and then the delegator would unlock these coins from the bank precompile.
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.
I think it's better to keep the full workflow at the EVM.
Now you can still call a bank precompile from the same contract in the call but I think if you have a claim
function it's would be intuitive that the claim is represented by a transfer on the EVM side
654e153
to
f2e421b
Compare
f2e421b
to
6afbaec
Compare
Description
Add distribute functions to the staking precompile:
getDelegatorValidators
: returns all the validators where a delegator has delegated to.getRewards
: returns all the outstanding rewards in a validator for an specific delegator.claimRewards
: claims all the delegation rewards. The caller has to be the delegator, or a contract called by the delegator.How Has This Been Tested?