This repository contains examples of common Ethereum smart contract vulnerabilities, including code from real smart contracts. It also includes a repository and analysis of several honeypots
- Bad randomness: Contract attempts to get on-chain randomness, which can be manipulated by users
- Denial of Service: Attacker stalls contract execution by failing in strategic way
- Incorrect Interface: Implementation uses different function signatures than interface
- Integer Overflow: Arithmetic in Solidity (or EVM) is not safe by default
- Forced Ether Reception: Contracts can be forced to receive Ether
- Missing Constructor: Anyone can become owner of contract due to missing constructor
- Race Condition: Transactions can be frontrun on the blockchain
- Reentrancy: Calling external contracts gives them control over execution
- Unchecked External Call: Some Solidity operations silently fail
- Unprotected Function: Failure to use function modifier allows attacker to manipulate contract
- Variable Shadowing: Local variable name is identical to one in outer scope
These examples are developed and maintained by Trail of Bits. Contributions are encouraged and are covered under our bounty program.
If you have questions, problems, or just want to learn more, then join the #ethereum channel on the Empire Hacking Slack or contact us directly.