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

Certora rules and migration fixes #47

Closed
wants to merge 1 commit into from

Conversation

3esmit
Copy link
Collaborator

@3esmit 3esmit commented Jan 24, 2024

Description

  • Implement migration properly
  • Fix calculation on rewards (now it reduces epoch supply and epoch reward), to keep all accounts getting a fair share
  • Fix bug that reverted the processAccount due math overflow, when user process lower epochs than currentEpoch
  • Fix bug that made pastEpochs to not update totalSupply when processing late accounts.

Checklist

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

  • Added natspec comments?
  • Ran forge snapshot?
  • Ran pnpm lint?
  • Ran forge test?
  • Ran pnpm verify?

Comment on lines +60 to +80
modifier noMigration() {
if (address(migration) != address(0)) {
revert StakeManager__PendingMigration();
}
_;
}

modifier onlyMigration() {
if (address(migration) == address(0)) {
revert StakeManager__NoPendingMigration();
}
_;
}

modifier onlyOldManager() {
if (msg.sender != address(oldManager)) {
revert StakeManager__SenderIsNotPreviousStakeManager();
}
_;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Implement migration properly

*/

function increaseMPFromMigration(uint256 _increasedMP) external onlyOldManager {
multiplierSupply += _increasedMP;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Implement migration properly

@0x-r4bbit 0x-r4bbit changed the title fix migration (?) Certora rules and migration fixes Feb 7, 2024
@0x-r4bbit
Copy link
Collaborator

Friendly ping that this needs to be reviewed (I've cleaned up the commits).
There is one question re: simplification() I still need feedback on (see: https://discord.com/channels/864066763682218004/1143915396462809108/1204750696918814792)

Can update the PR once clarified

@0x-r4bbit 0x-r4bbit mentioned this pull request Feb 19, 2024
5 tasks
@0x-r4bbit 0x-r4bbit changed the base branch from develop to chore/more-mp-invariants February 19, 2024 19:37
@0x-r4bbit
Copy link
Collaborator

Closing this as this has already landed via #59

@0x-r4bbit 0x-r4bbit closed this Feb 23, 2024
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.

2 participants