FreeCodeCamp’s Solidity, Blockchain, Smart Contracts Beginner to Expert Course Summary, Part 2

Kris Ograbek
5 min readMar 25, 2022

Let’s continue with Lessons 1, 2, and 3 of this free tutorial.

Welcome to the second part of my summary! I’m happy you found this article. To find out how I started my Blockchain journey, check out part 1. Also, you’ll find the summary of Lesson 0.

In this part, I’ll go through Lessons 1, 2, and 3. They are great because you can learn Solidity in your browser.

Introduction to Solidity

Watching Lesson 1, I saw Solidity code for the first time. Solidity is a programming language for writing Smart Contracts. If you have any coding experience, you’ll find many similarities. Solidity is inspired by many popular languages, including C++, Java, and Python.

The good news

You already have all the tools to start programming with Solidity. Remix IDE is an open-source web application that helps you write Solidity smart contracts from your browser. Having an intuitive GUI and many useful plugins, it’s a perfect tool for beginners. It contains modules for deploying, debugging, and testing smart contracts. As a beginner, you don’t need anything else. If you don’t know where to start, click the above link, and you’re all set.

Let’s jump into the lessons!

Lesson 1: Welcome to Remix. Simple Storage.

Summary

In this lesson, you learn the basics of Solidity. As mentioned, the only tool you use is Remix IDE. You create, compile and deploy your first Smart Contract. Deployment takes place either on a JavaScript Virtual Machine or a live network, e.g., Rinkeby or Kovan. To perform the latter, you need to set up a crypto wallet. Metamask is one of the most popular. The author guides you on how to do it step-by-step in Lesson 0.

Lessons Learned

  1. Visibility in Solidity. Variables and functions always have a specified level of visibility public, internal, private, and external. Internal is a default.
  2. Solidity variable types. In Solidity, you’ll work a lot with numbers. There are many types of unsigned integers (unit), like uint256. In this case, 256 means it takes 256 bits of memory. You’ll also find other common types, including bool or string. To define an Ethereum address, we use address type.
  3. Solidity functions. We use functions to change a state of a smart contract. There are two keywords to define a read-only function: view or pure. Their benefit is that they don’t cost any gas hence money.
  4. Deployment of the first Smart Contract. At this point, I didn’t understand what I was doing, but I deployed a smart contract for the first time. In Remix, it’s only a matter of a click.

New Terminology

  1. Ethereum Virtual Machine (EVM). Solidity code gets compiled down to Ethereum Virtual Machine. EVM runs on all the Nodes that are part of the Ethereum Blockchain
  2. pure and view function in Solidity.
  3. mapping in Solidity. Mapping is a data structure similar to dictionaries because we have unique keys. To define a mapping, we write which types we want to tie together, e.g., string to string or address to int.

Technologies

Solidity, Remix IDE.

Lesson 2: Storage Factory

Summary

In this 15-minutes lesson, you’ll expand your Solidity knowledge. You’ll create a new contract, Storage Factory, that follows a factory pattern. Then, you’ll import the contract from the previous lesson. In the Storage Factory contract, you’ll call functions from Simple Storage.

Lessons Learned

  1. Interactions between Smart Contracts. To interact with a Smart Contract, we need two things: the contract’s address and the contract’s ABI.
  2. Inheritance in Solidity. To inherit a contract, we use the keyword “is”.

New Terminology

  1. Application Binary Interface (ABI). It is required to interact with any Smart Contract. You can think of it as an instruction of a contract. It contains a detailed list of variables and functions along with parameters.

Technologies

Solidity, Remix IDE.

Lesson 3: Fund Me

Summary

Finally! Let’s make transactions! In this valuable lesson, you’ll learn how to fund money. Also, you’ll find out how to use Chainlink’s AggregatorV3Interface to get the current Ethereum price. The contracts from previous lessons were a playground to learn Solidity. FundMe is important to understand the principles and ideas behind Smart Contracts.

Lessons Learned

  1. A payable function in Solidity allows transferring many within a Smart Contract.
  2. To get the current price of a cryptocurrency in USD, we need off-chain data. To keep Blockchain decentralized, we need a secure and trusted system to retrieve real-world data. Chainlink is such a system. In our project, we obtain the current ETH/USD conversion rate.
  3. Converting money in Smart Contracts is tricky. I still find it confusing. Usually, we convert everything to Wei (see below) hence we deal with big numbers. One mistake in calculations may lead to differences in magnitudes. Always test your calculations!

New Terminology

  1. Wei, Gwei. Wei is the smallest denomination of Ethereum. It’s helpful for smaller amounts of Ether. 1 Ether = ¹⁰⁹ Gwei = ¹⁰¹⁸ Wei
  2. msg.sender, msg.value. In every transaction for every Smart Contract, there are keywords associated with it. The msg.sender tells who sent a transaction, whereas msg.value is the amount sent.
  3. require statement. It’s similar to an “if statement.” If the required condition is not true, we revert a transaction.
  4. Owner of a contract. The owner is an address that deployed the contract. In our contract, we want to prevent users from calling certain functions. The owner is the only user with permission to call a function.
  5. modifiers in Solidity. We use modifiers to change the behavior of a function in a declarative way. Combining the last two points, you can create an onlyOwner modifier with a require-statement. It will check if a user calling an onlyOwner function is the same who deployed a contract.
  6. Chainlink Datafeeds. The list of addresses provided by Chainlink to get the real-world data without breaking the decentralization of Blockchain. Throughout the course, you’ll use price feeds for Ethereum.
  7. Interfaces in Solidity. When we want to interact with another contract, Solidity must know how to do it. As already mentioned, we use ABI to achieve it. Interfaces are one of the ways to provide ABI. The main difference between a contract and an interface is that the latter doesn’t include function implementations. It gives information about function parameters and returns.

Technologies

Solidity, Remix IDE.

Final Thoughts

That’s it for today. My goal is to encourage you to take on the course. And I hope I managed to do just that.

Did you enjoy it? Do you like this kind of summary? Let me know in the comments!

References

YouTube Video

GitHub Repo

--

--

Kris Ograbek

I build Large Language Model projects and teach how to do the same | LLM Specialist | Prompt Engineer