WARNING: This repository is currently undergoing updates and revisions to incorporate the latest information and advancements in Solidity programming. Please be advised that the content may not be up-to-date or accurate during this time. We expect the updates to be completed within the next 30 days, and appreciate your patience during this process. Thank you for your understanding.
- Day 1 - Licenses and Pragma
- Day 2 - Comments
- Day 3 - Initializing Basic Contract
- Day 4 - Variables and Scopes
- Day 5 - Operators
- Day 6 - Types
- Day 7 - Functions
- Day 8 - Loops
- Day 9 - Decision Making
- Day 10 - Arrays
- Day 11 - Array Operations
- Day 12 - Enums
- Day 13 - Structs
- Day 14 - Mappings
- Day 15 - Units
- Day 16 - Require Statement
- Day 17 - Assert Statement
- Day 18 - Revert Statement
- Day 19 - Function Modifiers
- Day 20 Constructors
- Day 21 Single Inheritance
- Day 22 Multi-Level Inheritance
- Day 23 Hierarchical Inheritance
- Day 24 Multiple Inheritance
- Day 25 Fallback and Receive Function
- Day 26 Events and Hashing
- Day 27 Libraries
- Day 28 Abstract Contract and Interface
- Day 29 Assembly
- Day 30 Polymorphism
🧡🧡🧡 HAPPY CODING 🧡🧡🧡
// SPDX-License-Identifier: License Name
SPDX license identifiers should be added to the top of contract files. The license should be from one of the following: https://spdx.org/licenses/.
❗ If there are multiple license identifiers in the contract file the compiler will now show an error.
eg -
// SPDX-License-Identifier: MIT
In Solidity the pragma keyword is used to configure compiler features and checks. The pragma directive is always local to the current file and is not global. Hence to make it applicable in your entire project of Solidity you have to include pragma directive in every file to work.
The first line is a pragma directive which tells that the source code is written for which Solidity version.
pragma solidity ^0.8.7;
// Anything above 0.8.7
pragma solidity >=0.8.0 <0.9.0;
// Anything between 0.8.0 to 0.9.0 where 0.9.0 is not included.
pragma solidity 0.8.7;
// Only Version 0.8.7