# Missing rent cleanup The piggy program is designed so that only the PDA derived from the caller can withdraw SOL after some time. But there is a bug in this program. Find the bug and take SOL from the PDA. # Task 1 - Write your exploit Write your exploit inside [`test`](https://github.com/Cyfrin/solana-course/blob/main/apps/ctf/rent/exercise/tests/test.rs). # Build ```shell cargo build-sbf ``` # Test Your exploit is successful if the test passes. ```shell cargo test -- --nocapture ```
The piggy program is designed so that only the PDA derived from the caller can withdraw SOL after some time.
But there is a bug in this program. Find the bug and take SOL from the PDA.
Write your exploit inside test.
Your exploit is successful if the test passes.
A tactical challenge to Missing Rent Cleanup - Analyze a vulnerable piggy bank contract to uncover a critical bug in how account rent is managed. Develop a Rust exploit to bypass PDA restrictions and successfully extract the locked SOL.
Previous lesson
Previous
Course Overview
About the course
Native Rust & Anchor framework
PDAs, CPIs, and SPL Tokens
DeFi builds: oracles, auctions, AMMs
Last updated on January 12, 2026
Rust Developer
SolanaDuration: 8min
Duration: 23min
Duration: 4min
Duration: 2min
Duration: 4min
Duration: 11min
Duration: 4min
Duration: 0min
Duration: 0min
Course Overview
About the course
Native Rust & Anchor framework
PDAs, CPIs, and SPL Tokens
DeFi builds: oracles, auctions, AMMs
Last updated on January 12, 2026