返回
项目实战

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.

语言solidity
难度简单
总时长1.3小时

目标学习者

这门课是给谁上的

  • 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)

你会学到什么

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

课程安排

  • 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.

practice

DAI - Part 1

24 小节
移动端和桌面端均可访问