Skip to content

Conversation

0xdewy
Copy link
Contributor

@0xdewy 0xdewy commented Jan 16, 2023

Context

Closes #562

Changes proposed in this pull request

This PR adds a modifier to the staking pool, to block all deposits and cover buys on a staking pool if 100% of the active stake has been burned.
This is done to avoid division-by-zero issues.

Test plan

A unit test was added at StakingPool/burnStake.js

Checklist

  • Rebased the base branch
  • Attached corresponding Github issue
  • Prefixed the name with the type of change (i.e. feat, chore, test)
  • Performed a self-review of my own code
  • Followed the style guidelines of this project
  • Made corresponding changes to the documentation
  • Didn't generate new warnings
  • Didn't generate failures on existing tests
  • Added tests that prove my fix is effective or that my feature works

Review

When reviewing a PR, please indicate intention in comments using the following emojis:

  • 🍰 = Nice to have but not essential.
  • 💡 = Suggestion or a comment based on personal opinion
  • 🔨 = I believe this should be changed.
  • 🤔 = I don’t understand something, do you mind giving me more context?
  • 🚀 = Feedback

@0xdewy 0xdewy changed the title Block deposits and allocations when 100% of stake is burned Feature: Block deposits and allocations when 100% of stake is burned Jan 16, 2023
@0xdewy 0xdewy force-pushed the feature/staking-burns-100-percent branch from dee050b to 2131528 Compare January 16, 2023 16:23
@0xdewy 0xdewy marked this pull request as ready for review January 17, 2023 00:10
@0xdewy 0xdewy requested review from shark0der and roxdanila January 17, 2023 00:10
@0xdewy 0xdewy linked an issue Jan 17, 2023 that may be closed by this pull request
@0xdewy 0xdewy force-pushed the feature/staking-burns-100-percent branch from 2131528 to 4a1ab9d Compare January 17, 2023 19:20
Copy link
Contributor

@shark0der shark0der left a comment

Choose a reason for hiding this comment

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

see comments

@0xdewy 0xdewy force-pushed the feature/staking-burns-100-percent branch from 9338f5f to f8f402e Compare January 20, 2023 22:26
@roxdanila roxdanila force-pushed the feature/staking-burns-100-percent branch from f8f402e to 3e63fff Compare January 23, 2023 11:24
@0xdewy 0xdewy force-pushed the feature/staking-burns-100-percent branch from 3e63fff to 4f38be0 Compare January 24, 2023 16:19
@roxdanila roxdanila force-pushed the feature/staking-burns-100-percent branch 4 times, most recently from 9345591 to dcccfe2 Compare January 26, 2023 15:37
@0xdewy 0xdewy force-pushed the feature/staking-burns-100-percent branch 2 times, most recently from b508625 to 6b2180e Compare January 27, 2023 01:24
@0xdewy 0xdewy requested a review from shark0der January 27, 2023 01:24
@roxdanila
Copy link
Contributor

@kyledewy one conflict and a failed test to look at

@0xdewy 0xdewy force-pushed the feature/staking-burns-100-percent branch from 79f68e8 to b099cf9 Compare January 27, 2023 17:12
@roxdanila roxdanila merged commit 547a08c into nexus-v2 Jan 30, 2023
@roxdanila roxdanila deleted the feature/staking-burns-100-percent branch January 30, 2023 13:31
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.

Staking: block deposits in staking pool if it had 100% burn
3 participants