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

Refactor(StakeManager): Abstract out part of the contract that can be reused #139

Closed
3esmit opened this issue Sep 28, 2024 · 0 comments · Fixed by #140
Closed

Refactor(StakeManager): Abstract out part of the contract that can be reused #139

3esmit opened this issue Sep 28, 2024 · 0 comments · Fixed by #140
Assignees

Comments

@3esmit
Copy link
Collaborator

3esmit commented Sep 28, 2024

StakeManager.sol currently holds too much functionality.

For better code reuse, and readability, it should be split into separate contract whenever is possible.

Some obvious changes are:

  • Place the storage contract on its own file
  • Abstract the codehash verification logic to its own contract and inherit it from where its needed

Other possible changes are:

  • Create library for dealing with mathematical formulas of APY
  • Create library for dealing with account management
  • Create library for dealing with epoch management
  • (...) TBD

This issue will be closed once we are satisfied with the abstraction. We should experiment alternatives to see what we can improve in the code readability and reusability, considering the upcoming implementation of other staking solutions in this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant