CrowdFund
Perhaps you're familiar with ICOs (Initial Coin Offerings)? This is a method that allows project initiators to raise funds from global investors and offer rewards in the form of tokens. In the blockchain world, using tokens for crowdfunding not only enhances the liquidity of funds but also increases the visibility and participation of the project. In this course, we will use the Solidity to build a basic crowdfunding project, simulating the entire process from launching the crowdfunding to claiming funds or refunds.
目标学习者
这门课是给谁上的
- For developers who are interested in learning about DeFi.
- For developers who are interested in the practice of ERC20 Token.
要求
- Basic understanding of Solidity is recommended - at a minimum, you should be familiar with the content from the course Solidity101 to Solidity104
- Basic understanding of the ERC20 standard.
你会学到什么
- Using the Solidity, write a project to implementfunctionssuch as launching crowdfunding campaigns, users pledging funds, and project initiators claiming funds.
- How to use a wallet to initiate transactions, get your project on-chain, and view relevant information.
课程安排
Define the Contract
In this section, we will construct the framework for the crowdfunding contract, including defining the IERC20 interface and initializing the token contract through the constructor.
Unit 2 - Define the data structures
To support the initiation and management of crowdfunding activities, we need to introduce specialized data structures to store information related to crowdfunding. In this chapter, we will define these key data structures in detail.
Unit 3 - Launch a Crowdfunding Campaign
This chapter explains how to initiate a crowdfunding campaign through the launch function, including recording campaign information and triggering events.
Unit 4 - Cancel a Crowdfunding Campaign
In this section, we will cover how to define the cancel function, a feature that allows the initiator of a crowdfunding campaign to cancel the campaign before it begins
Unit 5 - Pledge
This chapter primarily focuses on writing the pledging process within the crowdfunding contract, including how to allow users to pledge tokens to a specific campaign, update pledge records, and notify the crowdfunding progress through events.
Unit 6 - Cancel a pledge
This chapter explains how to implement the functionality to cancel a pledge, including updating pledge records, returning tokens to the user, and notifying the cancellation of the pledge through an event.
Unit 7 - Claim
This chapter explains the process for project initiators to safely withdraw the funds raised after a successful crowdfunding campaign, including verifying conditions, updating the status, and executing the fund transfer.
Unit 8 - Refund
Complete the refund function
Interaction
Try to interact with the contract to simulate the on-chain crowdfunding process
CrowdFund