Python Unittesting for Ethereum Smart Contracts or how not to create your own Crypto
summary
Claims that Python can unit test Ethereum smart contracts get shown with concrete tools and failures: Populus is used to create an in‑memory chain and accounts fixtures, deploy Solidity bytecode, call transact and chain wait_for_receipt, and assert state changes. A little Snowballs game is deployed and its tests pass (first run), but a logic bug lets a player throw at themselves and mint snowballs, illustrating real risks like the DAO \$50,000,000 loss and the Parity \$150,000,000 freeze; constructor gives 100 snowballs.
AI-written summary · about
chapters (12)
- 0:00Python and Ethereum intro
- 1:31Blockchain and Ethereum basics
- 12:57Smart contracts and EVM
- 16:33Smart contract risks
- 19:49Testing with Populus
- 21:36Live demo: snowball game
- 24:05First unit test: snowball game
- 26:13Adding throw functionality
- 27:39Testing throw ball transaction
- 29:56Fixing contract vulnerabilities
- 31:00Key takeaways
- 32:50Q&A
related talks
54mProperty Based Testing - Smart testing of smart contracts
43mOutsmarting Smart Contracts
28mRobust Tests for Unconventional Environments
48mD1T2 - Smashing Ethereum Smart Contracts for Fun and ACTUAL Profit
25mCommSec D2 - Smart Contract (In)Security
51mA Deal with the Devil: Breaking Smart Contracts
01mOverview on Tools - Slither, Echidna, Manticore
20mLearning How to Build Secure Smart Contracts
