💸 Peer Tipping
A simple on-chain tipping mechanism that allows users to reward their peers with ETH directly on the blockchain.
Description
💸 Peer Tipping Smart Contract
A simple on-chain tipping mechanism that allows users to reward their peers with ETH directly on the blockchain.
This project is built for Flow Blockchain (Testnet) to demonstrate decentralized peer recognition and rewards.
🚀 Overview
The Peer Tipping Contract enables users to send ETH-based tips to peers in a decentralized and transparent manner.
Each peer accumulates tips over time and can withdraw their total balance anytime.
This implementation uses no imports, no constructors, and no input fields — maintaining a minimal and secure smart contract structure.
🧠 Key Features
Send Tips: Reward other users by sending ETH to the contract.
Withdraw Tips: Recipients can withdraw their accumulated tips anytime.
View Balance: Check how much tip balance you’ve received.
Owner Controls: The contract owner can perform an emergency withdrawal if needed.
Event Tracking: All activities are logged for transparency.
⚙️ Functions Overview
Function | Description |
---|---|
| Sets the contract owner (only callable once). |
| Sends ETH as a tip to a randomly assigned peer. |
| Withdraws the sender’s accumulated tip balance. |
| Returns the tip balance for the caller. |
| Allows owner to withdraw all ETH in emergencies. |
| Accepts direct ETH transfers. |
📜 Example Flow
Deploy Contract on Flow Testnet.
Call
initialize()
once to set your wallet as the owner.Anyone can call
tipPeer()
and send ETH to a peer.Recipients call
withdrawTips()
to receive their rewards.Owner can use
emergencyWithdrawAll()
if needed.
🧩 Technical Details
Language: Solidity
^0.8.0
Libraries: None (pure Solidity)
Constructor: None (manual
initialize()
used)Randomness: Simple pseudo-random peer generation (for demo)
Gas Efficient: Minimal storage and logic
🌐 Flow Testnet Deployment
Blockchain: Flow (Testnet)
Contract Address: 0xEBB5e4159aBb83cC6d6018b602b5F6bdDE8D40E2
You can interact with this contract using Flow’s testnet tools or Remix IDE configured for Flow EVM testnet.
🔒 Security Notes
This contract uses a pseudo-random function for demonstration.
In production, a secure randomness source like Chainlink VRF should be used.Always verify contract source and owner before interacting.
Keep private keys secure when calling
initialize()
.
🧑💻 Example Usage (Remix)
Copy-paste the contract into Remix.
Select Solidity version
0.8.0
.Deploy on Flow Testnet.
Run:
initialize()
to set yourself as owner.tipPeer()
and send ETH asmsg.value
.withdrawTips()
to withdraw received tips.
📬 Events
Event | Description |
---|---|
| Logs contract initialization. |
| Emitted when a tip is sent. |
| Emitted when a peer withdraws tips. |
| Logs emergency withdrawals by the owner. |
🧾 License
MIT License — Free to use, modify, and distribute.
Developed for educational and demonstration purposes on Flow Testnet.
🪙 Contract Address Summary
Flow Testnet Contract Address:
0xEBB5e4159aBb83cC6d6018b602b5F6bdDE8D40E2
🛠 Built For
Flow Blockchain — Testnet Environment
Demonstrating decentralized peer-to-peer tipping rewards.
Progress During Hackathon
80%