|
1 | | -Foundry-ERC20 |
| 1 | +# Foundry-ERC20-F24 |
| 2 | + |
2 | 3 | This project implements an ERC-20 token using OpenZeppelin contracts and provides additional features for deployment and testing. |
3 | 4 |
|
4 | | -Overview |
| 5 | +## Overview |
| 6 | + |
5 | 7 | The project contains the following key components: |
6 | 8 |
|
7 | | -1. OurToken.sol |
8 | | -This is the main ERC-20 token contract. |
9 | | -Inherits the standard ERC-20 implementation from OpenZeppelin. |
10 | | -Implements all core functionalities of an ERC-20 token. |
11 | | -2. ManualToken.sol |
12 | | -A custom ERC-20 token implementation created manually for learning and experimentation purposes. |
13 | | -Provides a basic understanding of how ERC-20 tokens work without relying on libraries. |
14 | | -3. Tests |
15 | | -Comprehensive tests for the token contracts are included to ensure their correctness and security. |
16 | | -Uses Foundry for testing. |
17 | | -Covers standard ERC-20 functionalities like transfer, approve, and transferFrom. |
18 | | -4. Deployment Script |
19 | | -Includes a script to deploy the token contracts on the blockchain. |
20 | | -Script is flexible and supports deployment on test networks like Sepolia or local networks like Anvil. |
21 | | -How to Use |
22 | | -Install Dependencies |
23 | | -Make sure you have Foundry installed. If not, install it by following the instructions here. |
24 | | - |
25 | | -Clone the Repository |
26 | | -bash |
27 | | -Copy code |
| 9 | +### 1. **OurToken.sol** |
| 10 | +- This is the main ERC-20 token contract. |
| 11 | +- Inherits the standard ERC-20 implementation from [OpenZeppelin](https://openzeppelin.com/contracts/). |
| 12 | +- Implements all core functionalities of an ERC-20 token. |
| 13 | + |
| 14 | +### 2. **ManualToken.sol** |
| 15 | +- A custom ERC-20 token implementation created manually for learning and experimentation purposes. |
| 16 | +- Provides a basic understanding of how ERC-20 tokens work without relying on libraries. |
| 17 | + |
| 18 | +### 3. **Tests** |
| 19 | +- Comprehensive tests for the token contracts are included to ensure their correctness and security. |
| 20 | +- Uses [Foundry](https://getfoundry.sh/) for testing. |
| 21 | +- Covers standard ERC-20 functionalities like `transfer`, `approve`, and `transferFrom`. |
| 22 | + |
| 23 | +### 4. **Deployment Script** |
| 24 | +- Includes a script to deploy the token contracts on the blockchain. |
| 25 | +- Script is flexible and supports deployment on test networks like Sepolia or local networks like Anvil. |
| 26 | + |
| 27 | +## How to Use |
| 28 | + |
| 29 | +### Install Dependencies |
| 30 | +Make sure you have Foundry installed. If not, install it by following the instructions [here](https://book.getfoundry.sh/getting-started/installation.html). |
| 31 | + |
| 32 | +### Clone the Repository |
| 33 | +```bash |
28 | 34 | git clone https://github.com/Hamadiftikharr/foundry-erc20.git |
29 | 35 | cd foundry-erc20 |
| 36 | + |
30 | 37 | Run Tests |
31 | 38 | To ensure everything is working as expected: |
32 | 39 |
|
33 | 40 | bash |
34 | | -Copy code |
35 | 41 | forge test |
36 | 42 | Deploy the Contract |
37 | 43 | To deploy the OurToken contract: |
38 | 44 |
|
39 | 45 | bash |
40 | | -Copy code |
41 | 46 | forge script script/DeployOurToken.s.sol:DeployOurToken --rpc-url <RPC_URL> --private-key <PRIVATE_KEY> --broadcast |
42 | 47 | Key Features |
43 | 48 | Reusable: Uses OpenZeppelin's highly tested and secure libraries for token implementation. |
|
0 commit comments