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

feat: introduce StakeVault and IStakeManager #61

Merged
merged 2 commits into from
Oct 22, 2024
Merged

Conversation

0x-r4bbit
Copy link
Collaborator

@0x-r4bbit 0x-r4bbit commented Oct 17, 2024

These two commits do the following:

  1. Add a first version of StakeVault which actually works with RewardStreamerMP
  2. Add an IStakeManager that asks for functions that are currently supported by the protocol

This work is highly inspired by @3esmit work in #39 but sliced into smaller chunks for easier review and so that we can start landing some of those changes.

This does currently not add

And leaving the system. (#66 )

Again, most of this work was done by @3esmit, this PR just makes some of the changes in #39 mergeable

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Added natspec comments?
  • Ran pnpm adorno?
  • Ran pnpm verify?

@0x-r4bbit 0x-r4bbit force-pushed the chore/stake-vault branch 3 times, most recently from d4b25c8 to c8b8c3e Compare October 17, 2024 18:33
@0x-r4bbit 0x-r4bbit changed the base branch from main to refactor/user-account October 17, 2024 18:34
@0x-r4bbit 0x-r4bbit changed the title refactor(RewardStreamerMP): rename user vars to account feat: introduce StakeVault and IStakeManager Oct 17, 2024
function MAX_LOCKUP_PERIOD() external view returns (uint256);
function MP_RATE_PER_YEAR() external view returns (uint256);
function MAX_MULTIPLIER() external view returns (uint256);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@3esmit I left out functions that aren't yet compatible with the reward streamer:

  • Upgradeability
  • Exiting
  • Locking after stake

Will address those in future PRs

function amountStaked() public view returns (uint256) {
return stakeManager.getStakedBalance(address(this));
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@3esmit In this vault implementation I remove the functions to withdraw ETH.

The reason being is that this contract doesn't have any payable functions or fallback/receive implementations, so it can't receive any ETH anyways.

@0x-r4bbit 0x-r4bbit changed the base branch from refactor/user-account to main October 21, 2024 12:09
This ports the `StakeVault` contract over to this repository
and exposes functions to interface with the reward streamer contract
to address issue #14.

Closes #14
This introduces a first version of `IStakeManager`, highly inspired by
the changes done in
#39.

However, in this commit, it only adds the methods that are currently
supported by both, `StakeManager` and `RewardStreamerMP`.

Future commits will add APIs for locking and leaving.
@0x-r4bbit 0x-r4bbit merged commit 18a8465 into main Oct 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants