-
Clone the Repository:
git clone https://github.com/Akshat-cs/ERC20-Faucet
-
Set Environment Variables:
- Set
GOERLI_RPC_URL
andPRIVATE_KEY
in the.env
file.
- Set
-
Install Dependencies:
yarn
-
Deploy MetaToken Contract:
- Execute:
yarn hardhat run --network goerli ./scripts/deploy.js
- Set the deployed token contract address in the
deploy-faucet.js
file and also setTOKEN_CONTRACT_ADDRESS
in the.env
file.
-
Update Faucet Contract Address:
- Set the deployed token contract address in the
deploy-faucet.js
file and after deploying faucet contract using:
yarn hardhat run --network goerli ./scripts/deploy-faucet.js
- Set the deployed faucet contract address as
CONTRACT_ADDRESS_FAUCET
in the.env
file.
- Set the deployed token contract address in the
-
Start the Application:
- Paste the token contract address in
index.js
and setcontractAddress
,contractAbi
,GOERLI_RPC_URL
, andPRIVATE_KEY
.
- Paste the token contract address in
-
Set Up and Run dApp:
node index.js node app.js
-
Access the Faucet in Browser:
- Open a browser and navigate to
localhost:3000
to access the faucet.
- Open a browser and navigate to
-
View Tokens in Wallet:
- To view requested MTK tokens in your wallet, import tokens into your wallet.
In summary, the MetaToken contract provides ERC-20 functionalities, and the Faucet contract utilizes these features to distribute tokens periodically. Follow the provided steps to deploy and operate the dApp on your local environment.