Skip to content

Two-Dream/Web3_tutorial_Chinese

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web3 教程 - Solidity,Hardhat,Token standard,Interoperability

This tutorial represents an educational example to use a Chainlink system, product, or service and is provided to demonstrate how to interact with Chainlink's systems, products, and services to integrate them into your own. This template is provided "AS IS" and "AS AVAILABLE" without warranties of any kind, it has not been audited, and it may be missing key checks or error handling to make the usage of the system, product or service more clear. Do not use the code in this example in a production environment without completing your own audits and application of best practices. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for unintended outputs that are generated due to errors in code.

中文 | English for review

这个 repository 是初学者课程《Web3 和区块链技术》的代码部分,并且包括课程中提到过的资料。

测试网水龙头(Testnet Faucets)

Chainlink 测试网水龙头:https://faucets.chain.link
Alchemy 测试网水龙头:https://sepoliafaucet.com/
Infura 测试网水龙头:https://www.infura.io/faucet/sepolia

在哪里讨论,问题?

目录

第一课:区块链基础知识 & 操作
  1. 区块链简史
  2. 区块链的设计哲学:去中心化和共识
  3. Web3:面向资产的互联网
  4. 智能合约简介
  5. 自托管钱包Metamask
  6. 密码学基础 & Metamask配置
  7. 领取测试币
  8. 签名&发送交易
  9. 燃料费(gas费)介绍
第二课:Solidity基础:Hello World
  1. Remix,Solidity编译器和开源协议
  2. Solidity基础数据类型
  3. Solidity函数
  4. Solidity存储模式:memory, storage, calldata
  5. Solidity数据结构:结构体,数组和映射
  6. 合约间交互:工厂模式
  7. 总结
第三课:Solidity进阶:FundMe
  1. 通过函数发送ETH
  2. 通过预言机设定最小额度
  3. 通过函数提取合约中的ETH
  4. 修改器和时间锁
  5. Token和Coin的区别
  6. 创建一个Token合约
  7. 继承ERC-20合约
  8. 部署和验证合约
第四课:Hardhat基础:部署交互FundMe
  1. 环境搭建:Hardhat介绍
  2. 环境搭建:安装node.js
  3. 环境搭建:安装VS Code和git
  4. 创建Hardhat项目
  5. 通过Hardhat编译和部署合约
  6. Hardhat网络&其他配置
  7. 与FundMe合约交互
  8. 创建Hardhat自定义任务
第五课:Hardhat进阶:测试FundMe
  1. Hardhat测试介绍
  2. Hardhat deploy任务
  3. 使用mock合约
  4. 给FundMe写单元测试
  5. gas reporter和coverage
第六课:跨链应用
  1. NFT介绍
  2. NFT的metadata
  3. NFT基础合约
  4. Chainlink ccip
  5. 资产跨链池
  6. chainlink-local & 单元测试
  7. 跨链NFT的Hardhat的自定义任务

教程中用到的代码

第一课:区块链基础知识 & 操作

第一课视频教程:WIP
第一课代码:本章没有代码

区块链简史

区块链设计哲学:去中心化和共识

Web3:面向资产的互联网

智能合约简介

自托管钱包Metamask

密码学基础 & Metamask配置

领取测试币

签名&发送交易

燃料费(gas费)介绍


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
恭喜完成第一课的学习!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

第二课:Solidity基础:Hello World

第二课视频教程:WIP
第二课代码:https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-2

Remix,Solidity编译器和开源协议

Solidity 基础数据类型

Solidity 函数

Solidity 存储模式:memory, storage, calldata

这一节知识是底层原理,不需要完全理解也可以继续学习,这部分英文文档会更加清晰。

Solidity 基础数据结构:结构体,数组,和映射

Solidity 官方文档中,关于数据和结构体,英文文档比中文文档在定义上表述更清晰。

合约间交互:工厂模式


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
恭喜完成第二课的学习!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

第三课:Solidity进阶:FundMe

第三课视频教程:WIP
第三课代码:https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-3

通过函数发送ETH

通过预言机设定最小额度

-Solidity的数据类型没有double或者floating(小数),如果想要表示带有小数的以太币,把wei当成最小单位,它是ether的10e-18,也就是0.000000000000000001。

通过函数提取合约中的ETH

函数修饰符和时间锁

Token和Coin的区别

创建一个Token合约

继承ERC-20合约

部署和验证合约


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
恭喜完成第三课的学习!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

第四课:Hardhat基础:部署交互FundMe

第四课视频教程:WIP
第四课代码:https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-4

环境搭建:Hardhat介绍

环境搭建:安装node.js

环境搭建:安装VS Code和git

创建Hardhat项目

通过Hardhat编译和部署合约

Hardhat网络&其他配置

与FundMe合约交互

创建Hardhat自定义任务


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
恭喜完成第四课的学习!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

第五课:Hardhat进阶:测试FundMe

第五课视频教程:WIP
第五课代码:https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-5

Hardhat 测试介绍

Hardhat deploy

使用mock合约

给FundMe写单元&集成测试

gas reporter和coverage


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
恭喜完成第五课的学习!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

第六课:跨链应用

第六课视频教程:WIP
第六课代码:https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-6

NFT介绍

NFT的metadata

ERC721基础合约

Chainlink CCIP (跨链互操作协议)

跨链资产池

Chainlink-local 和单元测试

跨链NFT的hardhat自定义任务


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
恭喜完成第六课的学习!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

这个 repository 是初学者课程《Web3 和区块链技术》的代码部分,并且包括课程中提到过的资料。

English for review

Testnet Faucets

Chainlink testnet faucets:https://faucets.chain.link
Alchemy testnet faucets:https://sepoliafaucet.com/
Infura testnet faucets:https://www.infura.io/faucet/sepolia

Where to discuss?

目录

Lesson 1: blockchain basics
  1. What is blockchain?
  2. Philosophy of blockchain: Trust-minimization
  3. Web3: decentralized internet for asset
  4. Introduction for smart contracts
  5. Self Custody wallet & metamask
  6. Crypto basics & metamask setup
  7. Claim test tokens on Sepolia testnet
  8. Sign a transaction
  9. Intro to gas
Solidity Basics: Hello World
  1. Remix & compiler version & license
  2. Solidity: basic data types
  3. Solidity: function
  4. Storage & memory & calldata
  5. Solidity: basic data structure
  6. HelloWorld factory: interact with other contracts
Lesson 3: Solidity Advanced: FundMe & ERC20
  1. Payable function: send ETH to a contract
  2. Set the minimum for USD with Chainlink Data feed
  3. Transfer token using function
  4. Modifer and timelock
  5. Coin vs token
  6. Create a token contract
  7. ERC-20 token standard
  8. Deployment & verification
Lesson 4: hardhat FundMe
  1. env setup: Introduction to Hardhat
  2. env setup: Install nodejs
  3. env setup: Install vscode & git
  4. Create hardhat project
  5. Compile and deploy the contract through Hardhat
  6. Hardhat network & other configurations
  7. Interact with FundMe
  8. create custom hardhat task
Lesson 5: Test FundMe
  1. Introduction to the unit tests in Hardhat
  2. Hardhat deploy task
  3. mock contract
  4. write unit test for FundMe
  5. gas Reporter & coverage
Lesson 6: cross-chain application
  1. Introduction for NFT
  2. NFT metadata
  3. ERC-721 token standard
  4. Chainlink ccip
  5. Token pool for ccip
  6. chainlink-local & unit test
  7. Hardhat custom task cross-chain nft

Codes used in the course

Lesson1: blockchain basics

Video of lesson 1:WIP
Codes of lesseon 1:NA

What is blockchain

Philosophy of blockchain: Trust-minimization

Web3: decentralized internet for asset

Introduction for smart contracts

Self Custody wallet & metamask

Crypto basics & metamask setup

Claim test tokens on Sepolia testnet

Sign a transaction

Intro to gas fee


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
Congratulations! You complete the lesson 1!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

Lesson 2: Solidity Basics: Hello World

Video of lesson 2: WIP
Codes of lesson 2: https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-2

Remix & compiler version & license

Solidity: basic data types

Solidity: function

Storage & memory & calldata

Solidity: basic data structure

HelloWorld factory: interact with other contracts


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
Congratulations! You complete the lesson 2!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

Lesson 3: Solidity Advanced: FundMe & ERC20

Video of lesson 3: WIP
Codes of lesson 3:https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-3

Payable function: send ETH to a contract

Set the minimum for USD with Chainlink Data feed

Transfer token using function

Modifier and timelock

Token vs Coin

Create a token contract

ERC-20 token standard

Deployment & verification


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
Congratulations! You complete the lesson 3!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

Lesson 4: hardhat FundMe

Video of lesson 4: WIP
Codes of lesson 4: https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-4

env setup: Introduction to Hardhat

env setup: Install nodejs

env setup: Install vscode & git

Create hardhat project

Compile and deploy the contract through Hardhat

Hardhat network & other configurations

Interact with FundMe

create custom hardhat task


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
Congratulations! You complete the lesson 4!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

Lesson 5: Test FundMe

Video of lesson 5:WIP
Codes of lesson 5: https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-5

Introduction to the unit tests in Hardhat

Hardhat deploy task

mock contract

write unit test for FundMe

gas Reporter & coverage


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
Congratulations! You complete the lesson 5!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

Lesson 6: cross-chain application

Video of lesson 6: WIP
Codes of lesson 6: https://github.com/smartcontractkit/Web3_tutorial_Chinese/tree/main/lesson-6

Introduction for NFT

NFT metadata

ERC-721 token standard

Chainlink CCIP (Cross-chain Interoperability Protocol)

Token pool in CCIP

Chainlink-local & unit test

hardhat custom task for cross-chain NFT


🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
Congratulations! You complete the lesson 6!
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 61.3%
  • JavaScript 38.7%