This README provides documentation for the Hardhat Tutorial Token, a non-ERC20-compliant smart contract deployed on the Sepolia Testnet.
🚀 Project Overview This is a basic token contract written in Solidity, based on the Hardhat official tutorial. It includes:
✅ Token Transfers between accounts ✅ Balance Tracking via balanceOf() ✅ Total Supply Management (Fixed at 1,000,000 tokens) ✅ Ownership Assignment (Deployer is the owner) ✅ Event Emission for Transfers
📜 Smart Contract Details Token Name: My Hardhat Token Symbol: MHT Total Supply: 1,000,000 MHT Contract Address (Sepolia Testnet): 🔗 View on Etherscan
🛠 Tech Stack Solidity 0.8.0 Hardhat (Development & Testing) ethers.js (Frontend Interaction) MetaMask (Wallet Integration)
📌 Contract Functions Function Description transfer(address _to, uint _amount) Transfers _amount tokens from sender to _to balanceOf() Returns the balance of the caller totalSupply Public variable storing total tokens owner Stores the contract owner's address
📂 Project Structure hardhat-project/ │── contracts/ │ ├── Token.sol # Solidity Smart Contract │── frontend/ │ ├── src/ │ │ ├── ContractInteraction.js # Hardcoded contract address & ethers.js logic │── test/ │ ├── Token.js # Hardhat Mocha/Chai tests │── scripts/ │ ├── deploy.js # Deployment script │── hardhat.config.js # Hardhat configuration │── README.md # Project Documentation │── .gitignore # Ignore unnecessary files │── package.json # Dependencies
📥 Installation & Running Locally To run this project on your local machine, follow these steps:
1️⃣ Clone the Repository git clone https://github.com/YOUR_GITHUB_USERNAME/hardhat-tutorial-token.git cd hardhat-tutorial-token 2️⃣ Install Dependencies npm install 3️⃣ Compile the Smart Contract npx hardhat compile 4️⃣ Run Tests npx hardhat test 5️⃣ Deploy to Sepolia
Make sure to add your Infura API Key and private key to a .env file (DO NOT hardcode keys): INFURA_API_KEY=your_infura_api_key_here SEPOLIA_PRIVATE_KEY=your_private_key_here
Then run: npx hardhat run scripts/deploy.js --network sepolia 6️⃣ Start the Frontend Navigate to the frontend/ folder and run: cd frontend npm start Now open http://localhost:3000/ and interact with the contract! 🚀
🌍 Live Deployment 🔗 Smart Contract on Sepolia: View on Etherscan 🔗 Frontend (If Hosted): 🌍 Coming Soon (Will be deployed on Vercel/Netlify)
🚀 Next Steps ✅ Upload Smart Contract to GitHub (Done!) ✅ Deploy the contract to Sepolia Testnet (Done!) ⏳ Host the frontend on Vercel/Netlify ⏳ Improve the UI & add MetaMask integration
🏆 Acknowledgments Special thanks to:
Hardhat Team for their amazing tutorial Ethers.js for making contract interactions easy
📩 Connect 💬 Questions? Open an issue or reach out! 🐙 GitHub: simob75 💼 LinkedIn: https://www.linkedin.com/in/bruna-simonian-779a4818/