A Message From Rocket Pool

Learn more about Rocket Pool @ https://rocketpool.net/.

1. A Message From Rocket Pool
Learn more about Rocket Pool @ https://rocketpool.net/. Duration: 1min
2. Introduction
Learn to find bugs without code inspection. Topics include fuzzing, AMMs, constant product formula, Uniswap/Curve Finance concepts, and more. Duration: 5min
3. Phase 1: Scoping
Beginning our scoping phase of TSwap a fork of Uniswap V1. Duration: 9min
4. Primer On This Review
Learn about protocol invariance without code. Study DEXs & DeFi Security Reviews. Explore TSWAP Protocol Docs w/ Diagrams & Videos. Duration: 2min
5. What is a DEX?
Decentralized exchanges explained through Uniswap and TSwap Duration: 3min
6. What is an AMM?
We're walked through what an AMM is and how it works in DeFi. Duration: 10min
7. Liquidity Providers
An explanation on liquidity providers and the sources of AMM fees for traders. Duration: 11min
8. How AMMs Work
Patrick further details AMMs and how they function in this quick review on How AMMs Work. Duration: 5min
9. TSwap Recon Continued
TSwap - Create New Pools, Swap Tokens via Multiple Pools, Liquidity Providers. Duration: 3min
10. Invariant & Properties Introduction
In-depth explanation of blockchain protocol invariants and fuzz testing. Examples from ERC-20 & ERC-721 tokens. Duration: 3min
11. Stateful And Stateless Fuzzing
Patrick details the differences between stateful and stateless fuzz testing and how each can be used to break protocol invariants. Duration: 10min
12. Stateless And Stateful Fuzzing Practice
Patrick emphasizes the importance of practice to master stateful and stateless fuzz testing. Duration: 5min
13. Stateless Fuzzing
Patrick walks through stateless fuzzing to catch an invariant break in TSwap! Duration: 9min
14. Where Stateless Fuzzing Fails
Patrick walks through some testing failures and how Foundry can be configured to achieve better results. Duration: 11min
15. Fuzzing Where Method 1 Fails
Introduction to different methods of fuzzing when we have no luck with Method 1. Duration: 18min
16. Stateful Fuzzing Method 2
A second approach to stateful fuzzing by Patrick. Duration: 14min
17. Debugging Fuzz Sequences
Uncover a broken invariant and debug the output sequence of our fuzz testing in this TSwap lesson. Duration: 7min
18. Fuzzing Recap
Stateful/Stateless Fuzzing, Handler Method Importance, ERC20 Exploit, TSWAP Testing & Bugs. Duration: 2min
19. Weird ERC20s
Patrick discusses various ERC20 quirks that can affect a protocol's security including missing return values and fee-on-transfer tokens. Duration: 4min
20. Writing Stateful Fuzz Test Suite
Stateful Fuzzing & Manual Review for TSWAP Bugs Duration: 1min
21. Constant Product Formula Explained
Explore the constant product formula and test it's implementation in TSwap through Fuzz and Unit testing. Duration: 9min
22. Invariant.t.sol
Patrick walks us through the invariant testing we perform on TSwap in invariant.t.sol. Duration: 17min
23. Handler.t.sol
Implementing the deposit function within our testing handler. Duration: 18min
24. Handler Swap Function
Implementing the swap function within our testing handler. Duration: 12min
25. Final Invariant And Tweaks
Comparing Deltas in Handler Test - Quick Guide. Demonstrates how to set up and run an assertion test for deltas in a handler. Duration: 3min
26. Debugging The Fuzzer
Debug Solidity Test Failures with Foundry Duration: 8min
27. One Last Huzzah
Patrick explains how fuzz testing methods can be used together to detect bugs in Solidity smart contracts. Duration: 10min
28. Notes On Invariants
Covers security tools like fuzzing, Echidna, and mutation/diff testing to detect issues stresses the importance of testing & learning from history. Duration: 4min
29. Recon: Manual Review Introduction
In this video, Patrick discusses the importance of manual codebase review along with tooling, specifically focusing on TSWAP pool. Duration: 2min
30. Slither
Patrick runs through using Slither on the TSwap repo. Duration: 2min
31. Aderyn
Using Cyfrin's Aderyn to find some non-critical bugs in TSwap! Duration: 2min
32. PoolFactory.sol
In this video, Patrick reviews PoolFactory.sol for TSwap liquidity pools, covering structure, functions, variables, bugs, and best practices. Duration: 6min
33. Manual Review: TSwapPool
Patrick discusses the security review of TSWAP pool in the context of Uniswap V1, He highlights a swap counting bug that breaks protocol invariants Duration: 3min
34. Using The Compiler As Static Analysis Tool
Importance is placed on addressing compiler warnings for potential issues and how they can help us in an audit scenario. Duration: 6min
35. Add Liquidity
Performing a manual review of the addLiquidity function and assessing risks found within! Duration: 8min
36. Remove Liquidity
Withdrawing Liquidity: Burning LP tokens to exchange for underlying money, parameters explained. Duration: 8min
37. swapExactInput
Understanding Swap Exact Input/Output & Protocol Checks in DeFi Duration: 6min
38. swapExactOutput
swapExactOutput lacks slippage protection for sudden price changes. Duration: 3min
39. sellPoolTokens
Sells pool tokens for WETH; business logic error: swap exact output instead of swap exact input. Duration: 2min
40. Checking the Last Few Functions
Patrick quickly skims the final few functions for vulnerabilities in TSwap. Duration: 2min
41. Phase 4: Reporting
Quick overview of reporting process - finding reports & appropriate tags. Multiple passes suggested for thoroughness. Duration: 5min
42. Reporting: Missing Deadline
TSWAP pool deposit function vulnerability. Deadline parameter accepted but unused, allowing MEV attacks during unfavourable market conditions. Medium impact. Duration: 4min
43. Reporting Continued
Patrick continues by showing how to report issues with examples and proofs to fix them. Duration: 10min
44. Reporting: No Slippage Protection
Slippage Protection Lacking in SwapExactOutput, Add Max Input for Safety. Patrick elaborates with a Proof-Of-Concept Scenario. Duration: 8min
45. Reporting: sellPoolTokens
Patrick highlights flawed SellPool tokens calculation. Recommends using swapExactInput & adding a MinWethToReceive w/Deadline to prevent exploitation. Duration: 4min
46. Reporting: Invariant Break & PoC
In this video, Patrick explains how to create a unit test that replicates a sequence found using fuzz testing to break an invariant. Duration: 9min
47. Reporting: Weird ERC20
Uniswap V1, TSWAP pool issues, breaks protocol invariance. Explore, and report weird ERC20s, DeFi vulnerabilities. Duration: 4min
48. Creating PDF For Your Portfolio
Creating a PDF of your audit report to add to your GitHub portfolio! Show case your achievements! Duration: 4min
49. Recap
Recap things covered in this section. Common issues in DeFi: liquidity, price manipulation, governance attacks. Duration: 8min
50. Exercises
Learn smart contract security testing by coding a fuzz test, discover reentrancy attacks, share insights on Twitter. Upcoming sections explained. Duration: 3min