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

[governance] add delegation staking pool implementation #4187

Merged
merged 5 commits into from
Sep 20, 2022

Conversation

emmazzz
Copy link
Contributor

@emmazzz emmazzz commented Aug 19, 2022

This draft PR adds a delegation staking pool implementation and connects it with other modules:

  • A new staking_pool module is added. Pool tokens are distributed to users at epoch boundaries after rewards are added to the pool.
  • delegation module and epoch_reward_record module are removed as they are no longer relevant.

/// the pool tokens until they activate the delegation on or after the `earliest_activation_epoch`.
public(friend) fun request_add_delegation(pool: &mut StakingPool, stake: Balance<SUI>, sui_token_lock: Option<EpochTimeLock>, ctx: &mut TxContext) {
assert!(balance::value(&stake) > 0, 0);
let delegation = Delegation {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible for user to have 2 Delegations for the same validator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Or more than 2.

@emmazzz emmazzz changed the title [governance] add draft delegation staking pool implementation [governance] add delegation staking pool implementation Sep 20, 2022
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

3 participants