https://github.com/halas77/halas
This project is a hands-on exercise focused on creating an ERC-20 token, named Halas.
https://github.com/halas77/halas
erc-20 hardhat openzeppelin-contracts scripting testing
Last synced: 3 months ago
JSON representation
This project is a hands-on exercise focused on creating an ERC-20 token, named Halas.
- Host: GitHub
- URL: https://github.com/halas77/halas
- Owner: halas77
- Created: 2024-08-21T11:14:08.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-21T13:19:48.000Z (9 months ago)
- Last Synced: 2025-01-14T07:49:54.768Z (4 months ago)
- Topics: erc-20, hardhat, openzeppelin-contracts, scripting, testing
- Language: JavaScript
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Halas - ERC-20 Token Development
## Introduction
This project is a hands-on exercise focused on creating an ERC-20 token, named `Halas`, using the Hardhat development environment along with OpenZeppelin’s robust contract libraries. The purpose of this project is to provide a comprehensive learning experience in blockchain development, from setting up the development environment to deploying and interacting with a real-world token on the Ethereum network.
## Running the Project
### 1. Compile the Contract
To compile the smart contract, run the following command:
```bash
npx hardhat compile
```This will compile your Solidity contracts and generate the necessary artifacts.
### 2. Deploy the Contract
Deploy the contract to a local Hardhat network using the following command:
```bash
npx hardhat node
``````bash
npm run local```
These commands will deploy the `Halas` contract and provide you with the contract address.
### 3. Run Interaction Scripts
To interact with the deployed contract, execute the interaction script:
```bash
npm run script
```This script demonstrates how to:
- **Approve a spender:** Allows a specific address to spend tokens on behalf of the token owner.
- **Check allowances:** Verifies how many tokens a spender is allowed to use.
- **Transfer tokens:** Moves tokens from one address to another, either directly or through an approved spender.
- **Check balances:** Displays the token balance of a specific address.## Testing
To ensure that the smart contract works as expected, you can run the provided tests. These tests cover various ERC-20 functionalities such as minting tokens, approving spenders, transferring tokens, and more.
### Running Tests
Execute the following command to run the tests:
```bash
npx hardhat test```
This will run all the test scripts located in the test/ directory