Level 3 - Coin Flip ⏺⏺
Level Setup
Level Contract
Exploit
This exploit is possible because the coinflip isn't random but deterministic. By copying the same logic that's used to determine the result and executing it in the same block just before guessing, you can guess correctly every time.
Run the same calculation and use the result to call the CoinFlip contract already deployed.
Submit instance... 🥳
Completion Message
Notes
The real challenge is getting the script to run 10 times.
This was hard to do in foundry with a real blockchian, but would have been easy to test on anvil simply by advancing the block by one then calling it again.
Last updated