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

Repeated write on account.lastMPUpdateTime #80

Closed
3esmit opened this issue Dec 2, 2024 · 0 comments · Fixed by #91
Closed

Repeated write on account.lastMPUpdateTime #80

3esmit opened this issue Dec 2, 2024 · 0 comments · Fixed by #91
Assignees

Comments

@3esmit
Copy link
Contributor

3esmit commented Dec 2, 2024

stake()
Calls _updateAccountMP(address)

_updateAccountMP(msg.sender);

Which writes account.lastMPUpdateTime:

account.lastMPUpdateTime = block.timestamp;

later account.lastMPUpdateTime is written again

account.lastMPUpdateTime = block.timestamp;

The same happens for lock()

_updateAccountMP(msg.sender);

account.lastMPUpdateTime = block.timestamp;

0x-r4bbit added a commit that referenced this issue Dec 4, 2024
…tMPupdateTime`

Whenever `account.lastMPupdateTime` is set, we also call
`_updateAccountMP()` before that, which never reverts, so the value set
there will never differ from the ones we set later explicitly.

Closes #80
@0x-r4bbit 0x-r4bbit self-assigned this Dec 4, 2024
@0x-r4bbit 0x-r4bbit moved this to Needs Review in Tasks - Smart Contracts Dec 4, 2024
0x-r4bbit added a commit that referenced this issue Dec 5, 2024
…tMPupdateTime`

Whenever `account.lastMPupdateTime` is set, we also call
`_updateAccountMP()` before that, which never reverts, so the value set
there will never differ from the ones we set later explicitly.

Closes #80
@github-project-automation github-project-automation bot moved this from Needs Review to Done in Tasks - Smart Contracts Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
2 participants