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

Fixed bug when executing the reentrant exploit #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stalinMacias
Copy link

If the reamining ETH on the victim contract is less than the ETH the reentrant call will take, an error will occur, and all the changes will be reverted! The reamining ETH balance on the victim contract must be greater than the ETH that will be taken in the next reentrant call, otherwise, an error will occur and all the contract's interaction changes will be reverted
/// Error: VM Exception while processing transaction: reverted with reason string 'Address: unable to send value, recipient may have reverted'

If the reamining ETH on the victim contract is less than the ETH the reentrant call will take, an error will occur, and all the changes will be reverted!
The reamining ETH balance on the victim contract must be greater than the ETH that will be taken in the next reentrant call, otherwise, an error will occur and all the contract's interaction changes will be reverted
/// Error: VM Exception while processing transaction: reverted with reason string 'Address: unable to send value, recipient may have reverted'
Previously there was no way to claim the rewards of the lottery. The winner will be set to the attacker contract address, hence, if the attacker contract doesn't call the withdrawPrize() function, the funds will be stuck forever (unless there is another winner, but that is a different scenario...)
…-rewards-bug

Fixed bugged to claim the lottery rewards
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.

1 participant