Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 838 Bytes

README.md

File metadata and controls

46 lines (30 loc) · 838 Bytes

Simple Ethereum Exploit Project

Presentation

Here: Smart contract hacking

Spin a local ethereum node

  1. Copy .env to .env.sample and fill up with your private/miner keys, miner address and RPC URL (see below).
  2. Run ERIGON_URL=http://127.0.0.1:8545 docker-compose up

Exposed endpoints:

  • RPC URL: http://127.0.0.1:8545
  • Otterscan: http://127.0.0.1:8080

Install deps

npm install

Compile the contracts

npx hardhat compile

Run exploits locally

npx hardhat test test/dice.js
npx hardhat test test/fixeddice.js

Deploy the contracts to the local ethereum node

node scripts/deploy.js

Run exploits on a forked network:

FORK=1 node scripts/fork.js