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

imp(distribution): Add ClaimRewards transaction, interface, types and event #1949

Merged
merged 9 commits into from Oct 26, 2023

Conversation

Vvaradinov
Copy link
Contributor

Description

This PR adds the ClaimRewards transaction, Interface definition, types and event.


Closes ENG-2234

@Vvaradinov Vvaradinov requested a review from a team as a code owner October 26, 2023 11:27
@Vvaradinov Vvaradinov requested review from facs95 and GAtom22 and removed request for a team October 26, 2023 11:27
@linear
Copy link

linear bot commented Oct 26, 2023

ENG-2234 ClaimRewards Distribution transaction

Context

Because of the deprecation of Cosmos txs, we now want to have all dApp store interactions go through the EVM. This requires the addition of some custom extension transactions that are not default transaction in the Cosmos SDK. The proposed transaction is ClaimRewards

  • Claims all rewards from all (or select) validators for a delegator address (origin of transaction)

  • Iterate through all delegations of the delegatorAddress and withdraw any pending rewards

        event ClaimRewards(
            address indexed delegatorAddress,
            uint256 amount
        );
    
        // Optionally add more fields here like string[] validators to be able to pick which ones to claim from
        // If we pass an empty array for validators we can default to withdrawing from everyone
        function claimRewards(
            address delegatorAddress,
            string[] validators, 
        ) external returns (bool success);
    

@Vvaradinov Vvaradinov changed the title imp(distribution): Add ClaimRewards transaction boilerplate imp(distribution): Add ClaimRewards transaction, interface, types and event Oct 26, 2023
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

LGTM, we'll need to add tests too

precompiles/distribution/DistributionI.sol Outdated Show resolved Hide resolved
precompiles/distribution/events.go Dismissed Show dismissed Hide dismissed
@Vvaradinov
Copy link
Contributor Author

@fedekunze adding tests in separate PRs

@Vvaradinov Vvaradinov enabled auto-merge (squash) October 26, 2023 11:53
@fedekunze fedekunze merged commit f69110e into main Oct 26, 2023
25 of 29 checks passed
@fedekunze fedekunze deleted the Vvaradinov/claim-rewards-tx branch October 26, 2023 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants