
Smart Contracts Explained: Self-Executing Blockchain Agreements
CodeLucky
In this video, Ankita from CodeByAnkita explains a very common beginner mistake in Solidity — Shadowing Inherited State Variables. You’ll learn why redeclaring a variable in a child contract causes a compiler error, and how to correctly override values using constructors or functions instead. We’ll walk through the full example in Remix IDE step-by-step using Contracts A, B, and C, and see how Solidity handles inheritance at the state variable level. 📘 What You’ll Learn What is variable shadowing in Solidity Why Solidity (from 0.6+) disallows state variable shadowing How to correctly override inherited state variables How inheritance works for variables vs. functions Hands-on demo in Remix IDE 🔗 Resources 🔹 GitHub (Solidity Course Code): https://github.com/codebyankita/solidity-smart-contract-course 🔹 Medium Articles: https://medium.com/@ankitacode11 🔹 LinkedIn: https://www.linkedin.com/in/ankita-virani-4bb478282/
Category
Smart Contract DevelopmentFeed
Smart Contract Development
Featured Date
November 1, 2025Quality Rank
#1