The ProtoToken Faucet is a web application designed to allow users to receive test tokens for testing purposes on blockchain environments. This application is divided into two main components: a backend, developed using Express and TypeScript, and a frontend, developed using React and TypeScript.
The project is organized into two main folders:
- Backend: Contains all the necessary code to interact with the ProtoToken smart contract, mint tokens, and transfer them to users without requiring them to pay transaction fees.
- Frontend: A user interface built with React and TypeScript that allows users to easily interact with the faucet by providing their wallet addresses to receive tokens.
The backend of the faucet utilizes Express and TypeScript to create an API that handles requests from the frontend. It directly interacts with the ProtoToken smart contract to mint tokens and transfer them to the user-provided wallet address.
To set up and run the backend, follow these steps:
- Navigate to the
backend
folder. - Install dependencies using
yarn
. - Create a
.env
file in the root of thebackend
folder with the following variables:PORT
: The port on which the backend server will run.PRIVATE_KEY
: The private key of the wallet that owns the contract.PUBLIC_KEY
: The public key of the wallet that owns the contract.CONTRACT_ADDRESS
: The address of the ProtoToken contract.NODE_URL
: Your Infura or other node URL to access the blockchain network.FRONT_URL
: The URL of the frontend application.
- Run the server using
yarn start
.
The frontend provides a user-friendly interface for users to request tokens. It collects the user's wallet address and communicates with the backend to transfer the tokens.
To set up and run the frontend, follow these steps:
- Navigate to the
frontend
folder. - Install dependencies using
yarn
. - Run the application using
yarn dev
. - The application will be accessible through a browser at
http://localhost:5173
.
The ProtoToken smart contract is deployed on the Sepolia network and can be accessed at the following address: 0x7B2ebb6f23c112A54025c52c29F378a65b1A6e86
To view the contract and its transactions, you can use the following link to Sepolia Etherscan:
View Contract on Sepolia Etherscan
Contributions to the project are always welcome. If you would like to contribute, please create a pull request or open an issue for discussion.
This README serves as a basic introduction and setup guide for the ProtoToken Faucet. Ensure you follow the detailed setup instructions for each part of the project to ensure everything operates correctly.