SOLIDITY BASICS - 1 πŸ›ΈπŸͺ

Digest 6 of "Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course" by @PatrickAlphaC ⭐🀩

A Thread.🧡

#solidity #coding #blockchain #smartcontracts #web3 πŸš€
@PatrickAlphaC If you haven't checked out the previous threads covering the basics of blockchain, please do before getting started on this one! 🧱
@PatrickAlphaC SOLIDITY ✨
- It is a programming language developed by Ethereum developers. πŸ”—
- Helps build smart contracts that run on Ethereum blockchain.
@PatrickAlphaC REMIX IDE πŸ’»
- It is a desktop application that allows developing and deploying smart contracts easily. βœ”οΈ
remix.ethereum.org
@PatrickAlphaC WRITE YOUR FIRST CONTRACT 🀩
- Create a new file - SimpleStorage.sol
- Find the full code on the GitHub repository πŸ‘‡πŸ½
github.com/PatrickAlphaC/…
@PatrickAlphaC Topics covered πŸ‘‡πŸ½
βœ… Licence Identifier
βœ… Solidity Version
βœ… Contract
βœ… Data Types
βœ… Variable Declaration
βœ… Functions
βœ… Function Visibility Specifiers
βœ… Deploy and Run Transaction
@PatrickAlphaC 1. LICENCE IDENTIFIER (optional) πŸ—’οΈ
- This line is optional in most cases and is commented out.
- We use:

//SPDX-Licence-Identifier: MIT
@PatrickAlphaC 2. SOLIDITY VERSION πŸ“Ž
- We begin by mentioning the version of the solidity language used.
- The caret symbol represents that any version above that mentioned is acceptable. βœ…

pragma solidity ^0.8.7;

NOTE: The semicolon is MANDATORY at the end of each line.
@PatrickAlphaC 3. CONTRACT πŸ“œ
- The "contract" keyword is used to define contracts in Solidity.
- The keyword is followed by the name of the contract.

contract SimpleStorage{
}

- Contents of the contract are enclosed within the curly brackets {}.
@PatrickAlphaC 4. DATA TYPES ⌨️
- Some of the data types available are:
-> uint256 - unsigned integer (i.e., whole nos) represented using 256 bits.
-> int256 - integers (i.e., +ve and -ve nos) represented using 256bits.
-> bool - boolean values such as True and False.
-> address
@PatrickAlphaC 5. VARIABLE DECLARATION
- Syntax: variableType visibility variableName;

uint256 public favoriteNumber;

- When not initialized, the variable is set to 0 by default.
- If visibility is not mentioned, it is considered to be "internal" by default (more of that is discussed below)
@PatrickAlphaC 6. FUNCTIONS πŸ’‘
- Functions help us execute a subset of code when called.
- The "function" keyword is used to declare a function.
- Syntax:
function functionName (parameterType parameter) visibility {
//type here
}
- Ex:
function store (unit favNum) public{
}
@PatrickAlphaC 7. FUNCTION VISIBILITY SPECIFIERS πŸ‘οΈ
- public: visible externally and internally; creates a getter function
- private: only visible in the current contract
- internal: only visible to the current contract and its children
- external: only visible externally
@PatrickAlphaC 8. DEPLOY AND RUN TRANSACTION βœ…
- After compiling the code, set the Environment to Javascript VM (London)
- It is a fake local blockchain where we can simulate our transactions without having the need to wait for them to go through on a testnet.
- Deploy. πŸ₯³
@PatrickAlphaC 🚨 Note 1
Every smart contract has an address.

🚨 Note 2
-Deploying a smart contract is the same as sending a transaction. Therefore some gas is used.
- Sending ETH requires 21,000 gas units.
- Complex transactions consume more gas.
@PatrickAlphaC That was 30 minutes of the course summarized for you. πŸ™ƒ
@PatrickAlphaC If you're a web3 enthusiast, wanting to explore, learn and grow as a developer, do watch this video and learn along with me.

@PatrickAlphaC Digest 7 (summarizing the next few minutes of the course) coming soon... πŸ˜‰
If you liked this thread, retweet, like, and share the tweet below. πŸ‘‡
Follow @LearnWithSiv for updates. ✨

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Sivakama Sundari πŸ‘©β€πŸ’»πŸ₯€

Sivakama Sundari πŸ‘©β€πŸ’»πŸ₯€ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @LearnWithSiv

Jun 8
SOLIDITY BASICS - 7 (Loops, Constructors, Modifiers & Sending ETH) πŸ›ΈπŸͺ

Digest 12 of "Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course" by @PatrickAlphaC ⭐🀩

A Thread.🧡

#solidity #coding #blockchain #smartcontracts #web3 πŸš€
@PatrickAlphaC Check out the previous thread of the series here πŸ‘‡πŸ½
@PatrickAlphaC πŸ“šIn this lesson we see how to withdraw the deposited funds from our contract. πŸ€‘
We cover:
- for loop
- ways to transfer eth
- constructors
- modifiers
Read 24 tweets
Jun 7
SOLIDITY BASICS - 6 (Arrays, Libraries, SafeMath, unchecked Keyword)πŸ›ΈπŸͺ

Digest 11 of "Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course" by @PatrickAlphaC ⭐🀩

A Thread.🧡

#solidity #coding #blockchain #smartcontracts #web3 πŸš€
@PatrickAlphaC Check out the previous thread of the series here πŸ‘‡πŸ½
@PatrickAlphaC πŸ“šIn this lesson we learn:
- how to keep track of the funders πŸ’°
- what are libraries and how to use them
Read 22 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(