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

Verification staking reward #24

Merged

Conversation

shoham-certora
Copy link
Contributor

Initial spec for StakingRewardStream and mutations.

uint256 earned1Late = earnedReward(e1, staker1, rewarded, reward, forfeitRecentReward);
uint256 earned2Late = earnedReward(e2, staker1, rewarded, reward, forfeitRecentReward);

mathint diff1 = earned1Late - earned1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

it seems that earned1Late == earned1 && earned2Late == earned2 which implies diff1 == diff2 == 0. I guess it should be done as follows instead:

uint256 earned1 = earnedReward(e1, staker1, rewarded, reward, forfeitRecentReward);
uint256 earned2 = earnedReward(e2, staker1, rewarded, reward, forfeitRecentReward);

require e2.block.timestamp > e1.block.timestamp;
uint256 earned1Late = earnedReward(e2, staker1, rewarded, reward, forfeitRecentReward);
uint256 earned2Late = earnedReward(e2, staker2, rewarded, reward, forfeitRecentReward);

Copy link
Contributor

Choose a reason for hiding this comment

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

yes agree it was wrong. Proving the assertion requires first proving some other properties on the reward calculation. So change for now to only satisfy

@kasperpawlowski kasperpawlowski merged commit 21db65f into euler-xyz:master Aug 7, 2024
1 check passed
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