Structs are custom data types that can group several variables. They represent a record of “something”. Suppose you want to…
Enum in Solidity smart contracts
Short for enumeration, enums restrict a variable to have one of only a few predefined values. The values in this…
Maps in a solidity smart contract
This post has been updated click here A map is like a hash table that allows you to save data…
How to create an array in a Solidity smart contract
In place of creating different variables of the same data type you can create an array to store a list…
How to create a For Loop in a Solidity smart contract
A loop will run n times where n is the number we pass into the function. There should be an…
Fallback function in Solidity smart contracts
A fallback function is executed when a contract receives Ether without any additional data. For your contract to receive Ether…
Error Handling in Solidity smart contracts
Assert – is used to check for conditions that should never be possible. Asserts should always evaluate to true and…
Events in Solidity smart contracts
Events are used to inform a calling application about the current state of a smart contract. As transactions occur on…