This content originally appeared on DEV Community and was authored by Hanane Bendisari
I’ve been learning Solidity by building an escrow smart contract for milestone-based payments between clients and artists.
But instead of stopping at the happy path — I wanted to understand failure cases too.
So I used Foundry to write a full test suite that covers:
✅ role-based access control
✅ milestone validation
✅ reverts for unauthorized actions
✅ edge cases like double validation or overpayments
✅ gas profiling for critical functions
All contracts are modular for clarity:
- BaseContract.sol for storage
- ValidationContract.sol for validator flow
- EscrowContract.sol for deposits, refunds, and release
- ArtVault.sol ties it all together
Full repo with README, tests and gas report here:
→ https://github.com/HananeBendisari/ArtVault
Feedback welcome — especially from other Solidity learners or people who audit/test smart contracts regularly.
This content originally appeared on DEV Community and was authored by Hanane Bendisari

Hanane Bendisari | Sciencx (2025-04-10T01:27:37+00:00) From it works to it reverts: learning Solidity the hard way. Retrieved from https://www.scien.cx/2025/04/10/from-it-works-to-it-reverts-learning-solidity-the-hard-way/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.