← Index
Source: docs/zsub/hacking-instructions-2/sensitive-onchain-data-3.md (auto-generated by scripts/generate-docs-html.mjs — edit the .md, not this file)

Sensitive On-Chain Data Exercise 3

Intro

Cryptic Raffle is a new on-chain lottery game.

The raffle contract is deployed on Goerli testnet, and it's address is:

0xca0B461f6F8Af197069a68f5f8A263b497569140

Anyone can participate and earn ETH.

The game is initially deployed with 0.1 ETH.

Rules

There are some addicted gamblers who are trying different strategies to win the raffle.

Lucky you, you can beat them all thanks to your smart contract hacking skills.

You're (your Attacker account) broke and you only own 0.1 ETH.

Your goal is to win the current raffle round and claim all the pot.

Note: This exercise is executed on an Goerli testnet local fork block number 8660077. Everything is already configured in the hardhat.config.js file.

Note: In this exercise you don't have access to the source code of the CrypticRaffle.sol smart contract.

Setup

Update your .env file and add the GOERLI Infura RPC url:

GOERLI = 'https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161'

Accounts

Tasks

Task 1

Win the raffle and claim all the ETH that is currently in the contract's pot.

Bonus

Find another way to find the winnig numbers :)

Goerli Public RPC Nodes

https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161
https://ethereum-goerli-rpc.allthatnode.com