Skip to content

Fixed bugged to claim the lottery rewards #5

Open
0xStalin-eth wants to merge 3 commits into
EatTheBlocks:masterfrom
0xStalin-eth:stalinMacias-claiming-lottery-rewards-bug
Open

Fixed bugged to claim the lottery rewards #5
0xStalin-eth wants to merge 3 commits into
EatTheBlocks:masterfrom
0xStalin-eth:stalinMacias-claiming-lottery-rewards-bug

Conversation

@0xStalin-eth

Copy link
Copy Markdown

No description provided.

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...)
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