Skip to content

Instantly share code, notes, and snippets.

View engn33r's full-sized avatar

engn33r engn33r

View GitHub Profile
@engn33r
engn33r / vulncreate2detector.sh
Last active December 26, 2023 22:44
Detect contracts vulnerable to CREATE2 manipulation
#!/bin/bash
# This script is a hacked together PoC, don't trust it to work well
# For proper detection of vulnerable contracts, recursive testing must be performed because CREATE2 in a contract's ancestry could be problematic: https://medium.com/@jason.carver/defend-against-wild-magic-in-the-next-ethereum-upgrade-b008247839d2#3f90
# Improved tool and full research coming from yAcademy next month: https://twitter.com/yAcademyDAO
contract_addr="0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852" # default value is a uniswap V2 pair from https://v2.info.uniswap.org/pairs
etherscan_api_key=""
if [[ -z "$etherscan_api_key" ]]; then