🚀 Objective:
- Understand the ERC-20 token standard and how to implement it.
- Learn how to create DeFi protocols like staking and yield farming.
- Implement Chainlink oracles for fetching real-world data (e.g., token prices).
- Deploy a DeFi contract and interact with it via the frontend.
🧠What is DeFi?
DeFi (Decentralized Finance) refers to the financial services built on top of blockchain technology, eliminating intermediaries like banks and centralized exchanges. These services are often open-source and run on smart contracts deployed on Ethereum or other blockchains.
🔑 Core DeFi Protocols:
- ERC-20 Tokens: The standard for fungible tokens that can represent assets like stablecoins, utility tokens, or governance tokens.
- Staking: A process where users lock up tokens to support network operations (e.g., proof-of-stake) or participate in liquidity pools.
- Yield Farming: A way to earn rewards (usually in the form of additional tokens) by providing liquidity to a decentralized exchange (DEX) or lending protocol.
- Liquidity Pools: A collection of assets in a smart contract used to facilitate decentralized trading, lending, and borrowing.
📘 ERC-20 Token Standard
The ERC-20 standard defines a common set of rules for fungible tokens, ensuring that tokens can be traded, transferred, and interacted with across different platforms and DApps.
🔑 ERC-20 Core Functions:
totalSupply(): Returns the total supply of the token.
balanceOf(address account): Returns the balance of tokens held by a given address.
transfer(address recipient, uint256 amount): Allows users to transfer tokens to another address.