Solidity
Solidity is an object oriented, high-level programming language for implementing smart contracts. It allows to write programs, which governs the behavior of accounts within blockchain network. It is statically typed, supports contract inheritance and has many built-in Contract Libraries. Solidity is similar to programming languages like C++, Python and JavaScript.
It comprised of:
- variables
- operators
- loops
- conditionals
- modifiers
- functions
- objects and types
- events
- interfaces
- and handles money transactions!
Before jumping to coding with Solidity it is important to familiarize oneself with blockchain's mental models - these are essential because of the contrasting difference in a blockchain application architecture and a common web application architecture. Where we want to go is Web 3.0, where servers and databases are as decentralized as the clients. In other words, clients can also act as servers or databases or both (aka, peer-to-peer). With many-to-many relationships at all levels of the stack, there are no concentrations of control and a single point of failure. The network is maximally distributed.
Essentially the following points need to be kept in mind always:
- Memory is limited - each memory element requires all nodes on the blockchain to confirm and store that element
- Computation complexity is limited
- Reading data is free
- Each write operation has a cost associated with it - you pay it with ether. The cost is measured in gas.
Tools for Working With Solidity
- Truffle: DApp development framework
- Remix: Web IDE for Solidity
- Web3
- Metamask