DAI - Part 1

What are Stablecoins? Stablecoins are cryptocurrencies designed to maintain a stable value, typically pegged to a reference asset such as fiat money, exchange-traded commodities, and another cryptocurrency. DAI is a decentralized stablecoin running on the Ethereum blockchain that attempts to maintain a value of 1 USD. In Part 1 of the DAI course, we will learn to build a StableCoin contract including the deposit and withdraw collateral functions.

Skill LevelBeginner
Total Length1.3h

Intended Learners

Who’s This Course For

  • For developers who are interested in blockchain finance
  • For developers who are interested in decentralized stablecoins, especially DAI
  • For developers who are looking to learn Solidity programming applications


  • Basic understanding of stablecoin concepts
  • Familiar with the ERC20 standard
  • Basic Solidity programming skills, with a recommendation to first complete Solidity foundational courses (at least Solidity 101 to 104)
  • Possess an Ethereum account, connected to both Mantle and a wallet, holding either Mantle tokens or test tokens (for those wishing to perform real on-chain operations, though deployment can also be done directly in a local environment if test tokens are not available)

What You’ll Learn

  • Introduction to stablecoins and DAI
  • Definition of contract initialization, variable definitions, and the deposit and withdrawal of collateral.


  • Setup Contract

    Begin the SimpleStableCoin contract development by importing the necessary standards and defining the constructor.

  • Define Variables

    In this section, define the essential variables and implement the constructor for the SimpleStableCoin contract.

  • DepositCollateral

    Learn to write the 'depositCollateral' function, which is a key component of the contract's functionality.

  • WithdrawCollateral - Section 1

    Start writing the 'withdrawCollateral' function, focusing on the initial structure and logic.

  • WithdrawCollateral - Section 2

    Complete the 'withdrawCollateral' function, ensuring its full functionality and integration into the SimpleStableCoin contract.


DAI - Part 1

24 lessons
Access on mobile and desktop