Advanced Solidity: Get In-depth Knowledge

Deploying Ethereum DApps with Truffle will walk you through the process of deploying your smart contracts with Truffle.

What you'll learn:
Deploying DApps with Truffle
Testing Smart Contracts with Truffle
How to Build an Oracle
How to Build an Oracle - Part 2
How to Build an Oracle - Part 3

Course Content

5 lessons

Deploying DApps with Truffle

0% completed

Remember that we promised to teach you how to deploy a smart contract?

It's been a while, but the time has come!

In this lesson, we will be teaching you how to deploy to Ethereum using Truffle.

And this is not all. You are going to learn how to deploy your smart contracts to Loom as well😎.

Why deploy to Loom? After all, Ethereum is the most secure network.

Yes, we totally agree with that. But on Ethereum each transaction costs gas, so your users will have to pay fees for each and every transaction. Also, they will have to wait at least 10 seconds for each transaction to be confirmed.

In a nutshell, on Ethereum, all transactions benefit from the same security guarantees. For something like a user-facing DApp or a game, this level of security isn't always a requirement. In fact, it just harms the user experience.

On Loom, users have access to much speedier and gas-free transactions. This makes Loom a much better fit for something like a game or a user-facing DApp.

Enough talking! Let's get started😉

Testing Smart Contracts with Truffle

0% completed

Welcome! By completing the previous lessons you’ve demonstrated that you really know your stuff.

So, go ahead and deploy the game to the mainnet. Enjoy your success!

Hang on a moment... There are a few things you might have already thought of. After all, once contracts get deployed to the mainnet, they will live there forever. If there are mistakes in them, they will still live on as well. Like undead zombies.

Mistakes, or bugs, happen to every coder, no matter how skilled. It's unlikely that you would make a major mistake like giving attacking zombies a 100% chance of victory, but it could happen.

Clearly giving the attacking side 100% of wins would mean what you had written was no longer a game, or even any fun at all. A bug like this would kill your game dead, and no promise of juicy brains would drag your zombies from their graves.

To stop this terrible thing from happening, it is essential that you thoroughly test every aspect of the game.

By the end of this lesson, you will be able to:

  • Test your smart contracts with Truffle against Ganache
  • Use Chai to write more expressive assertions
  • Test against Loom😉

Let's get started!

How to Build an Oracle

0% completed

By completing the previous tutorials you've demonstrated a good grasp of Solidity and JavaScript; and you are probably well on your way to building your first dapp. If so, you may already have noticed that smart contracts can't directly access data from the outside world through an HTTP request or something similar. Instead, smart contracts pull data through something called an oracle.

This lesson is the first in the sequence of three lessons that aim to show how you can build and interact with an oracle.

In the first two lessons, we will be teaching you to build and interact with the simplest possible oracle that allows only one user, its owner, to fetch data from Binance's public API.

That said, I have a question for you: why would users trust your oracle?🤔🤔🤔

The quick answer is that they wouldn't. At least not until there social trust or you come up with a decentralized version. Thus, in the third lesson, we'll show you how to make your oracle more decentralized. But, for now, let's start with the beginning.

Time to write some code!

How to Build an Oracle - Part 2

0% completed

Welcome to the second part of our series about building an oracle. This lesson picks up where we left off last time, and we're going to look at how to:

  • Implement the JavaScript component of the oracle.
  • Write a simple Node.js client that interacts with the oracle. To keep things simple, you won't be building a fully-fledged web interface, but the code you'll write in this lesson will help you understand all the key aspects.
  • To glue everything together, we'll teach you how to deploy the smart contracts and run the oracle.

Note that this is an advanced lesson and it requires:

  • A bit of JavaScript knowledge.
  • A basic understanding of web3. If you don’t know how web3 works, don't worry. We've got you covered. Just head over to Lesson 6 first.

How to Build an Oracle - Part 3

0% completed

Now that you've got a bit of experience under your belt, we're going to dive into some of the more technical aspects of writing an oracle.

Remember that, even if you've covered a lot of ground, your oracle is still somehow centralized, meaning that only the owner is allowed to update the ETH price.

In this lesson, we'll show you how to make your oracle more decentralized.