From it works to it reverts: learning Solidity the hard way

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 su…


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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » From it works to it reverts: learning Solidity the hard way." Hanane Bendisari | Sciencx - Thursday April 10, 2025, https://www.scien.cx/2025/04/10/from-it-works-to-it-reverts-learning-solidity-the-hard-way/
HARVARD
Hanane Bendisari | Sciencx Thursday April 10, 2025 » From it works to it reverts: learning Solidity the hard way., viewed ,<https://www.scien.cx/2025/04/10/from-it-works-to-it-reverts-learning-solidity-the-hard-way/>
VANCOUVER
Hanane Bendisari | Sciencx - » From it works to it reverts: learning Solidity the hard way. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/04/10/from-it-works-to-it-reverts-learning-solidity-the-hard-way/
CHICAGO
" » From it works to it reverts: learning Solidity the hard way." Hanane Bendisari | Sciencx - Accessed . https://www.scien.cx/2025/04/10/from-it-works-to-it-reverts-learning-solidity-the-hard-way/
IEEE
" » From it works to it reverts: learning Solidity the hard way." Hanane Bendisari | Sciencx [Online]. Available: https://www.scien.cx/2025/04/10/from-it-works-to-it-reverts-learning-solidity-the-hard-way/. [Accessed: ]
rf:citation
» From it works to it reverts: learning Solidity the hard way | Hanane Bendisari | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.