Layout of a Solidity Source File - Part 2
Comments in Solidity
Solidity, like any other programming language, allows commenting code. Solidity supports three sorts of comments:
Single line comments
Multiline comments
Natural Ethereum Specs (Natspec)
Multiline comments are denoted by /* and /, whereas single-line comments are indicated by //. Natspec offers two formats: /// for single-line comments combination of /* for beginning and */ for the end of multiline comments. Natspec is a documentation tool with its own standard.
Let us examine the Solidity comments in the code below:
|
Structure of a Smart Contract
Solidity contracts are like classes in modern Object-Oriented Programming languages. State variables, Functions, Function Modifiers, Events, Errors, Struct and Enum Types may all be declared in a contract. Contracts may also be inherited from other contracts.
Libraries and interfaces are two types of special contracts.
Solidity is used to construct smart contracts for Ethereum. EVMs use smart contracts to deploy and execute their code.
A contract contains multiple constructs:
State variables
Structures
Modifiers
Declaratives
Enumerations
Functions
A typical Smart Contract consists of all the preceding constructs.
For Part 1 - https://hashnode.com/post/cld1v4m6n000808mk3ndp2b4a
For more content, follow me on - https://linktr.ee/shlokkumar2303