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

Missing event logging in ReleaseGold #3112

Closed
mgcolburn opened this issue Mar 16, 2020 · 0 comments · Fixed by #3153
Closed

Missing event logging in ReleaseGold #3112

mgcolburn opened this issue Mar 16, 2020 · 0 comments · Fixed by #3153

Comments

@mgcolburn
Copy link

Missing event logging in ReleaseGold

Severity: Informational
Difficulty: Low
Type: Auditing and Logging

Description

Several critical operations in the ReleaseGold contract do not trigger events. As a result, it could be difficult to review the correct behavior of the contracts once deployed.

Critical operations that would benefit from triggering events include:

  • withdraw: this function self-destructs once its balance reaches zero. It could be helpful to emit an event before triggering contract destruction.
  • refundAndFinalize: this function also self-destructs when called after the release schedule has been revoked. While that revocation is logged with an event, since this is a separate function call it could also be useful to log separately as well.

Users and blockchain monitoring systems will not be able to easily detect suspicious behaviors without events.

Exploit Scenario

Bob withdraws the last of his tokens from the contract, causing it to self-destruct. However, he miscalculated his remaining balance and believes there are still tokens remaining in the contract. Bob attempts to withdraw them again but the calls fail. He reviews the event log for the contract but does not see anything that would cause his calls to fail.

Recommendation

Short term, add the missing events for the operations noted above.

Long term, err on the side of logging events for any state transitions. Events help to monitor the contracts and trace suspicious behavior.

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 a pull request may close this issue.

1 participant