-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2aed42b
commit c09f88b
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Foundry-ERC20 | ||
This project implements an ERC-20 token using OpenZeppelin contracts and provides additional features for deployment and testing. | ||
|
||
Overview | ||
The project contains the following key components: | ||
|
||
1. OurToken.sol | ||
This is the main ERC-20 token contract. | ||
Inherits the standard ERC-20 implementation from OpenZeppelin. | ||
Implements all core functionalities of an ERC-20 token. | ||
2. ManualToken.sol | ||
A custom ERC-20 token implementation created manually for learning and experimentation purposes. | ||
Provides a basic understanding of how ERC-20 tokens work without relying on libraries. | ||
3. Tests | ||
Comprehensive tests for the token contracts are included to ensure their correctness and security. | ||
Uses Foundry for testing. | ||
Covers standard ERC-20 functionalities like transfer, approve, and transferFrom. | ||
4. Deployment Script | ||
Includes a script to deploy the token contracts on the blockchain. | ||
Script is flexible and supports deployment on test networks like Sepolia or local networks like Anvil. | ||
How to Use | ||
Install Dependencies | ||
Make sure you have Foundry installed. If not, install it by following the instructions here. | ||
|
||
Clone the Repository | ||
bash | ||
Copy code | ||
git clone https://github.com/Hamadiftikharr/foundry-erc20.git | ||
cd foundry-erc20 | ||
Run Tests | ||
To ensure everything is working as expected: | ||
|
||
bash | ||
Copy code | ||
forge test | ||
Deploy the Contract | ||
To deploy the OurToken contract: | ||
|
||
bash | ||
Copy code | ||
forge script script/DeployOurToken.s.sol:DeployOurToken --rpc-url <RPC_URL> --private-key <PRIVATE_KEY> --broadcast | ||
Key Features | ||
Reusable: Uses OpenZeppelin's highly tested and secure libraries for token implementation. | ||
Custom Implementation: ManualToken provides insight into the inner workings of ERC-20 contracts. | ||
Complete Setup: Includes tests and deployment scripts for a full development workflow. |