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

281 fix vested staking #82

Merged
merged 14 commits into from
Nov 21, 2024
Merged

281 fix vested staking #82

merged 14 commits into from
Nov 21, 2024

Conversation

SamBorisov
Copy link
Contributor

No top-up is allowed on vested staking.
Now Delegtarts can delegate to the validator even after minStake is changed.
Clear stakingRewardsHistory, before opening vestedStaking.
Handle debt by requiring a staker to provide liquidity tokens, before opening a position!

@SamBorisov SamBorisov requested a review from R-Santev November 15, 2024 16:24
@coveralls
Copy link

coveralls commented Nov 15, 2024

Pull Request Test Coverage Report for Build 11956212792

Details

  • 21 of 21 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 89.059%

Totals Coverage Status
Change from base Build 11955558126: 0.1%
Covered Lines: 1272
Relevant Lines: 1351

💛 - Coveralls

@SamBorisov SamBorisov requested a review from R-Santev November 19, 2024 14:21
@@ -59,6 +59,15 @@ abstract contract VestedStaking is IVestedStaking, Staking, Vesting {
_stake(msg.sender, msg.value);
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

IVestedStaking doesn't inherit IStaking

* @inheritdoc IHydraStaking
*/
function stake() public payable override(IHydraStaking, Staking, VestedStaking) {
VestedStaking.stake();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not using super here?

* @notice Stakes sent amount.
* @dev If user has active vested position, it will revert.
*/
function stake() external payable;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This must be in IStaking

*/
function stake() public payable virtual override {
if (vestedStakingPositions[msg.sender].isActive()) {
revert StakeRequirement({src: "stake", msg: "IN_ACTIVE_POSITION"});
Copy link
Collaborator

Choose a reason for hiding this comment

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

super is not called here

@SamBorisov SamBorisov force-pushed the 281-fix-vested-staking branch from 8f8e9c6 to cb1cc1d Compare November 21, 2024 10:28
@SamBorisov SamBorisov requested a review from R-Santev November 21, 2024 11:10
@SamBorisov SamBorisov force-pushed the 281-fix-vested-staking branch from ebaa88f to fbda956 Compare November 21, 2024 15:06
@SamBorisov SamBorisov merged commit 33a8277 into main Nov 21, 2024
7 checks passed
@SamBorisov SamBorisov deleted the 281-fix-vested-staking branch November 21, 2024 15:38
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.

3 participants