With this article, you will find out how to create your first smart contract with Solidity and run your code online or on your local environment. So let’s set off on a journey and have fun!
What’s all the fuss about?
There are many different Ethereum programming languages currently available like Solidity, LLL, Vyper or Serpent. Each of these languages has its pros and cons and particular use. For our purposes, Solidity will be a good choice, because it is a great balance between simplicity of code and the ability to create complex systems. If you’re hungry to learn more about the differences between the most popular Ethereum languages, see details in this article.
Solidity is contract-oriented language. What does it mean? The code in Solidity is encapsulated in smart contracts. A conception of smart contracts is very similar to the contract in the real world. It is like an agreement between two or more parties in the form of code.
In practice, smart contracts are very similar to object-oriented classes. They can call another smart contract, create and use objects of another class. A contract can have variables and functions and store some data. What makes smart contract different from a standard object is the fact that after you deploy a contract to Ethereum, it’s immutable and stays permanently on the blockchain. No one can modify or update this code, it is impossible to add additional functions to it. If there is a serious defect, there is no way to fix it after deployment. The only option is to deploy a new contract and tell your users to change the used contract address to the new one. It sounds like a big failure but it is also a feature, really. A smart contract mirrors a real contract, a code is a digital law. You can be sure that this contract will be exactly the same every time you call a function. There is no place for unexpected behavior or result. That’s why it is essential to consider all known security issues and optimize your code before you locate it on the blockchain. The best bet is to try out your code before you use it on main Ethereum blockchain.
Remix – when you are scared about installing anything on your machine
The easiest way to try out Solidity, without installing any tools, is using Remix. It is open source Ethereum IDE running straight in the browser. It helps you start writing, testing, debugging, and running smart contracts. When you open Remix IDE, you will notice that there is a sample smart contract already written for you. You can modify the prepared code, try to run below sample or implement your own. If you aren’t comfortable using the online version, you can download the source, compile and run it as a private version on your computer.
Read more: https://dook.pro/blog/programming/17-build-your-first-smart-contract-on-ethereum