https://github.com/jcsec-security/smart-contracts-and-hacking-101
Material of my talk/workshop "Smart contracts and Hacking 101"
https://github.com/jcsec-security/smart-contracts-and-hacking-101
Last synced: over 1 year ago
JSON representation
Material of my talk/workshop "Smart contracts and Hacking 101"
- Host: GitHub
- URL: https://github.com/jcsec-security/smart-contracts-and-hacking-101
- Owner: jcsec-security
- Created: 2023-12-21T13:04:45.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-27T12:35:57.000Z (over 1 year ago)
- Last Synced: 2025-03-27T13:34:38.783Z (over 1 year ago)
- Language: Solidity
- Size: 7.81 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Smart Contracts and Hacking 101
If you are attending my talk about blockchain technology, smart contracts and common security issues of the latter, this repo is for you!
## Smart Contracts
To have your first peek into a [basic smart contract](./basics/MyFirstApp.sol) deployed in the Sepolia testnet, check this [Etherscan URL](https://sepolia.etherscan.io/address/0x4747df6e3bc844b21f681dcf0270e9cab51b33a6)
Here you can check:
- History of transactions directed to the contract
- Current Ether balance, although the most common ERC20 tokens are also listed
- Deployed bytecode, and, optionally, the verified code
- Value of the state variables (storage)
## Vulnerabilities
1) Front-running:
- [Crack the hash challenge](./vulnerabilities/crack_the_hash.sol)
2) Clear-text secrets:
- [Case study 1](./vulnerabilities/password_1.sol)
- [Case study 2](./vulnerabilities/password_2.sol)
- [Case study 3](./vulnerabilities/password_3.sol)
3) Integer over/underflow:
- Play with a basic one [deployed in Sepolia](https://sepolia.etherscan.io/address/0xdf847035247a545d5ba09f3ebdef48786603c65f) - unchecked, solc 0.7.6
- [Cooldown!](./vulnerabilities/cooldown.sol) - checked underflow
5) Reentrancy:
- [Victim](./vulnerabilities/reentrancy_victim.sol)
- [Attacker template](./vulnerabilities/reentrancy_attacker.sol)