A Solidity smart contract built with Hardhat 3 that allows users to send tips in ETH with optional messages.
This project is a Hardhat 3 project using the native Node.js test runner (node:test) and the viem library for Ethereum interactions.
Features:
- A simple
TipJarsmart contract for receiving tips - Owner-based withdrawal functionality
- Event logging for all tip transactions
- Comprehensive test suite using
node:testandviem - Deployed on Sepolia testnet
Contract Address (Sepolia): 0x0e54a8B9ce9644AE19cc69A2372305Fa9C3b3821
To run all the tests in the project, execute the following command:
npx hardhat testYou can also selectively run the Solidity or node:test tests:
npx hardhat test solidity
npx hardhat test nodejsTo deploy to Sepolia, you need an account with funds. The Hardhat configuration includes a SEPOLIA_PRIVATE_KEY configuration variable.
Set the private key using hardhat-keystore:
npx hardhat keystore set SEPOLIA_PRIVATE_KEYThen deploy:
npx hardhat ignition deploy --network sepolia ignition/modules/TipJar.ts