Skip to content

SkySwordSaint26/ERC-20-Token-Splitter

Repository files navigation

ERC-20 Token Splitter

This project demonstrates an ERC-20 token splitter implemented with Hardhat. It includes:

  • An ERC-20 token contract.
  • A splitter contract that allows splitting tokens among multiple recipients.
  • Frontend code (HTML, CSS, JavaScript) to interact with the contracts.

Setup

  1. Install dependencies:

    npm install
  2. Compile contracts:

    npx hardhat compile

Deployment

  1. Start a local Hardhat node:

    npx hardhat node
  2. Deploy contracts (in a separate terminal):

    npx hardhat run scripts/deploy.js --network localhost

    This will deploy the contracts to the local Hardhat network and output the contract addresses.

Frontend Usage

  1. Open frontend/index.html in your browser.

  2. Connect your MetaMask wallet.

  3. Enter the token address and recipient addresses.

  4. Enter the amounts to split.

  5. Click "Split Tokens" to initiate the token splitting.

Contracts

ERC-20 Token

  • contracts/Token.sol: A basic ERC-20 token contract.

Splitter

  • contracts/Splitter.sol: The splitter contract that handles splitting tokens among multiple recipients.

Scripts

  • scripts/deploy.js: Deploys the ERC-20 token and splitter contracts to the network.

Frontend

  • frontend/index.html: Main HTML file for the frontend.
  • frontend/script.js: JavaScript file for interacting with the contracts.
  • frontend/style.css: CSS file for styling the frontend.

Tasks

npx hardhat help         # Show available tasks
npx hardhat test         # Run tests
REPORT_GAS=true npx hardhat test # Run tests with gas reporting
npx hardhat node         # Start a local Hardhat node

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published