Structure Of A Smart Contract In Ethereum
Posted By : Shashwat Gupta | 27-Mar-2018
Let’s take a look at very basic smart contract structure which has written in Solidity.
Structure of a Contract
classes in object-oriented languages and Contracts in Solidity are very same . all contract could consist of State Variables, Modifiers and functions, Events, Struct Types and Enum Types. moreover, you can use other contracts. using inheritance.
State variables are stored in contract storage.
Functions are like a few lines of code that can perform something within the contract.
Function modifiers are like a function that checks the validation rules before executing the main function.
Struct is custom defined data types that consists of several variables declared in it.
Events are functions that are bubbled up after compilation of function execution if event code written there .it provide EVM logging facilities.
Enum is used to create custom types and it has fix the set of values
Structure of a Smart Contract in Ethereum