Ethereum smart contract development using Solidity

Today, I randomly came across a website called crypto zombies.

crypto zombies
It’s a nice platform to learn solidity and smart contract dev. I completed a starting course (pretty easy if we know programming basics) which consists 15 chapters. Here r …


This content originally appeared on DEV Community and was authored by Chiranjeevi Tirunagari

Today, I randomly came across a website called crypto zombies.
Image of Crypto Zombie website
crypto zombies
It's a nice platform to learn solidity and smart contract dev. I completed a starting course (pretty easy if we know programming basics) which consists 15 chapters. Here r few learnings of today:

  1. In every solidity program, we need to specify the version of language we are using in it using "pragma solidity ".

  2. A smart contract or simply contract is a building block of an Ethereum app. It contains the variables, functions etc. just like a class in java/c++.

  3. This contract is deployed on blockchain which acts as the backend of our decentralized app (dapp).

  4. A contract once deployed on blockchain can't be modified. So, we need to be very careful when writing them.

  5. There are many data types in solidity just like other programming languages.

  6. Integers are broadly 2 types, signed (int) and unsigned (uint), there are different sizes as well (8, 16, .., 256 bits).

  7. Strings are used to store from letters to sentences.

  8. Arrays are also 2 types. Static and Dynamic. When we know we make changes to an array in runtime, we should dynamic arrays as they provide push and pop functionality.

  9. "function () returns (){}".
    Above is the syntax to write a function.

  10. Public functions can be called from external contracts also and Private functions are restricted from doing it.

  11. A pure type function can only access data which is passed to it as parameters.

  12. A view type function can access data which is not passed to but present in that contract.

  13. Struct is another data type which is user-defined which contains other variables in it.

  14. Parameters can be passed in 2 ways to a function. Pass by value and Pass by reference.

  15. To pass a parameter with reference, we need to give keyword "memory" before the name of argument.

  16. We can create events, so that when that event occurs, we can perform certain things in our frontend.

  17. "event (arguments)". We can catch these events using web3JS.

  18. To fire that event in a function, we use "emit ".

  19. Push method of dynamic array returns the size of array after pushing.

20.All this info in 20 mins read. Try it if u want to get started.

My twitter: twitter
My LinkedIn: linkedin
My showwcase: showwcase


This content originally appeared on DEV Community and was authored by Chiranjeevi Tirunagari


Print Share Comment Cite Upload Translate Updates
APA

Chiranjeevi Tirunagari | Sciencx (2021-12-29T17:42:32+00:00) Ethereum smart contract development using Solidity. Retrieved from https://www.scien.cx/2021/12/29/ethereum-smart-contract-development-using-solidity/

MLA
" » Ethereum smart contract development using Solidity." Chiranjeevi Tirunagari | Sciencx - Wednesday December 29, 2021, https://www.scien.cx/2021/12/29/ethereum-smart-contract-development-using-solidity/
HARVARD
Chiranjeevi Tirunagari | Sciencx Wednesday December 29, 2021 » Ethereum smart contract development using Solidity., viewed ,<https://www.scien.cx/2021/12/29/ethereum-smart-contract-development-using-solidity/>
VANCOUVER
Chiranjeevi Tirunagari | Sciencx - » Ethereum smart contract development using Solidity. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/12/29/ethereum-smart-contract-development-using-solidity/
CHICAGO
" » Ethereum smart contract development using Solidity." Chiranjeevi Tirunagari | Sciencx - Accessed . https://www.scien.cx/2021/12/29/ethereum-smart-contract-development-using-solidity/
IEEE
" » Ethereum smart contract development using Solidity." Chiranjeevi Tirunagari | Sciencx [Online]. Available: https://www.scien.cx/2021/12/29/ethereum-smart-contract-development-using-solidity/. [Accessed: ]
rf:citation
» Ethereum smart contract development using Solidity | Chiranjeevi Tirunagari | Sciencx | https://www.scien.cx/2021/12/29/ethereum-smart-contract-development-using-solidity/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.