About This Course

Get an overview of the course, the tech stack we'll be using, and what you'll get out of it.

Course overview

This hands-on course is based on the reasoning of first principles, where we’ll learn to develop and deploy probabilistic play-to-earn games from scratch in Solidity.

We’ll use play-to-earn games as an application domain, and we’ll also cover Solidity development in general. This course serves as a foundation to develop all sorts of smart contracts for Solidity-compatible blockchains, such as:

  • Ethereum
  • Polygon
  • Solana
  • Binance Smart Chain
  • Tron
  • Hedera

Beyond Solidity, the focus of this course is highlighting key differences between blockchain development and development in traditional server-client infrastructures.

We’ll learn how to think about developing an immutable decentralized software and try to get it right the first time (because we don’t get a second chance to get it right on the blockchain anyway). This method can cut years of trial and error, and potentially save users millions of lost value due to non-secure code.

Tech stack

In this course, we'll focus on smart contract development and deployment. In addition to the executable code widgets on the Educative platform, we'll use the following:

  • A browser-based IDE called Remix.

  • A block explorer called Etherscan, which consults transactions on the Ethereum blockchain.

  • Standard interfaces from OpenZeppelin, which is the equivalent of libraries in other programming languages.

  • Chainlink's Verified Random Function, used as an off-chain oracle to generate pseudo-random numbers.

These tools will be enough for our purpose. However, there are other aspects of blockchain development that will not be covered, notably how to hook up our smart contracts with a frontend. For that, we would need other developer tools, such as Web3.js and Ether.js. There are also more complete development environments than Remix, such as Ganache-Truffle Suite and Hardhat, which notably offer more options for writing automated tests for our smart contracts.

Course structure

Developing play-to-earn games is also interesting in its own right because it presents some unique challenges. We'll see the advantages and limitations of blockchain-based games and cover light Game Theory principles that are important to map before we start coding our games.

Press + to interact

After that, in the chapter “Ethereum Fundamentals,” we'll look at some fundamental design features of the Ethereum blockchain. These features constitute an added value when it comes to hosting decentralized software, as well as technical limitations, which we'll have to keep in mind when making design decisions for our games. The second chapter will also present Remix, which will be our main Integrated Development Environment (IDE), besides the code widget on the Educative platform.

Next, the chapter “Solidity Smart Contract Structure and Syntax” will cover the basics of Solidity. This will be a standalone chapter that you can refer to any time during the course if you have any questions about smart contracts structure and syntax. By the end, you should be able to read any smart contracts and understand what it does, as well as write your own smart contracts for most applications.

Over the years, there have been several best practices and standard contracts that have emerged in the Solidity development community (think of them as the equivalent to libraries in other programming languages). These offer secure and efficient standard methods and will help us avoid reinventing the wheel. The chapter “Inheritance” will cover some of these standard contracts and interfaces (such as the ERC-721 Non-Fungible Token Standard ) that we will integrate into our own contracts.

Some applications may require securely retrieving information outside the blockchain to use as input in our smart contracts (such as the conversion rate of a cryptocurrency or random numbers for our play-to-earn games, which cannot be securely generated on-chain). For these applications, we'll have to rely on secure external sources—known as off-chain oracles—which are comparable to external APIs in traditional server-client architectures. However, they imply some trade-offs, and since our contract would no longer fully run on-chain, they would be known as hybrid smart contracts. The chapter “Off-Chain Oracles” expands on these concepts as they pertain to securely generating randomness for our games.

The chapter “Putting it All Together: The Treasure Hunt Game” will be where all the ideas discussed up to that point are amalgamated together. We'll implement our very own treasure-hunting game, which represents a general type of probabilistic NFT-gated play-to-earn games.

Lastly, the chapter “What's Next for You?” will describe your final project in this course and share some pointers about what's next for you as a blockchain developer after you complete this course.

This course is self-paced, so feel free to jump around between chapters.

Learning outcomes

By the end of this course, you’ll have the following skills:

  • Understand the added value of public blockchains in terms of immutability, transparency, trustlessness, access control, and payment processing.

  • Contrast this added value with the limitations of public blockchains regarding processing power, transaction costs, and information vulnerability.

  • Assess the challenges of randomness generation in decentralized software and the need for off-chain oracles.

  • Calculate basic probabilities and expectations resulting from probabilistic play-to-earn games.

  • Program smart contracts in Solidity.

  • Implement Solidity design patterns (Pausability, Ownability, Reentrancy Guards).

  • Implement interface inheritance. Securely request data from off-chain oracles.

  • Assess the implications of security design patterns and off-chain oracles on immutability, transparency, and trustlessness.

  • Build probabilistic play-to-earn games in Solidity.

  • Deploy smart contracts.