This is a simple template of a decentralized application (DApp) built with React, and Solidity. It is designed to help you kickstart your DApp development journey.
This template creates a simple DApp that allows users to interact with an erc20 token contract called Fiorino. Users can send and receive tokens, and the contract owner can mint new tokens.
Ensure your development environment is set up with the following:
- Node.js (v18 or later): Download here 📥
- Yarn: Install here 🧶
- Docker (for containerization): Get Docker 🐳
- Hardhat (for smart contracts): Getting Started with Hardhat ⛑️
A blazing-fast React application powered by Vite:
- Vechain dapp-kit: Streamline wallet connections and interactions. Learn more
Smart contract in Solidity, managed with Hardhat for deployment on the Vechain Thor network.
Shared configurations and utility functions to unify and simplify your development process.
Clone the repository and install dependencies with ease:
yarn # Run this at the root level of the project
Place your .env
files in the root folder, you can copy .env.example
file and rename it to .env
changing the values to your own:
yarn solo-up
Run the frontend and deploy the contracts on the Local Solo Network (if not deployed yet) with a single command:
yarn dev
You should see a log like this, that means the frontend is running:
frontend:dev: VITE v5.3.2 ready in 135 ms
frontend:dev:
frontend:dev: ➜ Local: http://localhost:5001/
frontend:dev: ➜ Network: http://192.168.1.26:5001/
frontend:dev: ➜ Network: http://192.168.64.1:5001/
frontend:dev: ➜ press h + enter to show help
and then you see a log like this, that means the contracts are deployed:
@repo/contracts:check-contracts-deployment: ================ Contracts deployed in 0m 9s
@repo/contracts:check-contracts-deployment: Contracts { fiorino: '0xE55842798426F155Ad7Ff6E9C93378690d1FF46a' }
@repo/contracts:check-contracts-deployment: Contracts and libraries addresses saved to /path/apps/react-dapp-template/packages/contracts/deploy_output
@repo/contracts:check-contracts-deployment: Total execution time: 0m 9s
@repo/contracts:check-contracts-deployment: Deployment completed successfully!
@repo/contracts:check-contracts-deployment: ================================================================================
@repo/contracts:check-contracts-deployment: Writing new config file to /path/apps/react-dapp-template/packages/config/local.ts
or a log like this, that means the contracts are already deployed (if you run the yarn dev
command again):
@repo/contracts:check-contracts-deployment: Checking contracts deployment on vechain_solo (http://localhost:8669)...
@repo/contracts:check-contracts-deployment: fiorino contract already deployed
yarn contracts:deploy
or
Put empty string in the fiorinoContractAddress
in the packages/config/local.ts
file:
fiorinoContractAddress: "",
and then run the yarn dev
command again.
yarn solo-down
yarn solo-clean
yarn contracts:deploy:testnet
yarn dev:testnet
yarn contracts:deploy:mainnet
yarn dev:mainnet
This template serves as a foundational starting point and should be thoroughly reviewed and customized to suit your project’s specific requirements. Pay special attention to configurations, security settings, and environment variables to ensure a secure and efficient deployment.