Skip to content

segment7/token-vendor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Token Vendor dApp

License: AGPL Solidity React Node.js

An Ethereum-based decentralized application (dApp) that allows users to seamlessly buy and sell ERC-20 tokens (Token G9) in exchange for ETH using a vendor smart contract and an ERC-20 contract.

🌐 Live Demo

Please visit the live demo at group9-evm.vercel.app.

📦 Stack

  • Frontend: Next.js 15, TailwindCSS, DaisyUI
  • Wallet Integration: Reownkit, wagmi, viem
  • Smart Contracts: Solidity, Hardhat, OpenZeppelin
  • Deployment: Vercel (frontend), Sepolia testnet (contracts)

📸 Diagrams

System Architecture

System Diagram

User Flow – Buy/Sell

Flowchart

Contract Interaction

Contract Diagram


🚀 Features

  • Buy tokens by sending ETH to the Vendor contract
  • Sell tokens back to the contract in exchange for ETH
  • Real-time balances for ETH and tokens
  • Wallet integration via Reownkit for seamless Web3 experience

🧪 Local Development

Clone and install dependencies:

git clone https://github.com/segment7/token-vendor.git
cd token-vendor
yarn install

Run the local blockchain and deploy:

# Start local Hardhat chain
yarn chain

# Deploy contracts
yarn deploy

Start the frontend:

yarn start

Access at http://localhost:3000

📄 Contracts

  • TokenG9.sol – Custom ERC-20 token, initial supply: 1000 G9 tokens
  • Vendor.sol – Vendor contract with the following key functions:
    • buyTokens() (payable)
    • sellTokens()
    • withdraw() (owner only)

Events:

  • BuyTokens (buyer, ethAmount, tokenAmount)
  • SellTokens (seller, ethAmount, tokenAmount)

🙏 Acknowledgments

✍️ Author

Created and customized by Group 9
Built with 💙 for the EVM Bootcamp

📄 License

About

EVM Bootcamp teamwork project for Group 9

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •