A decentralized tipping system on Ethereum that splits tips between a designated recipient and random previous tippers.
Make It Rain is a smart contract that creates a community-driven tipping ecosystem. When you send a tip, 50% goes directly to your chosen recipient, and the other 50% is randomly distributed among previous participants. Anyone who sends or receives a tip becomes a member, making them eligible to receive a portion of future tips.
- Sending Tips: Send Ether to the contract along with a designated recipient address
- 50/50 Split: Half of your tip goes directly to your chosen recipient
- Random Distribution: The other half is evenly distributed among 5 randomly selected previous members (configurable)
- Automatic Membership: Both senders and recipients automatically become members and eligible for future random tips
- Claiming Rewards: Members can claim their accumulated tips at any time while maintaining membership
- Balanced Distribution: 50% direct tipping, 50% community reward system
- Fair Randomization: Uses blockchain-based randomization to select recipients
- Configurable Distribution: Admin can adjust the number of random recipients to optimize for gas costs
- Automatic Membership: Anyone who sends or receives a tip automatically joins the pool
- Simple Claiming: One-click function to withdraw your accumulated tips
- Detailed Events: Emits events for tips, distributions, and claims for transparency
- Statistics Tracking: Records total tips, distributions, and amounts
- Built on Ethereum using Solidity 0.8.20
- Randomization based on block hashes for fair selection
- Efficient member tracking and balance management
- Integrated with ENS (Ethereum Name Service) for discoverability
- Admin functionality for configuration and contract management
- Gas-optimized to balance distribution fairness with transaction costs
- Alice sends a 1 ETH tip to Bob
- 0.5 ETH goes directly to Bob's balance
- The other 0.5 ETH is divided among 5 random previous members (0.1 ETH each)
- Both Alice and Bob are now members and eligible to receive random portions of future tips
- Charlie sends a 0.4 ETH tip to Dave
- Alice, Bob, or both might receive a portion of the 0.2 ETH community distribution
// Send a tip with default settings (5 random recipients)
contract.makeItRain.value(amountInWei)(recipientAddress);
// Or specify the number of random recipients
contract.makeItRain.value(amountInWei)(recipientAddress, numberOfRandomRecipients);contract.claim();Based on analysis, the gas costs for different numbers of random recipients are:
| Random Recipients | Est. Gas Cost | ETH Cost (50 Gwei) | % of 1 ETH |
|---|---|---|---|
| 1 | 41,500 | 0.00208 | 0.21% |
| 5 | 63,500 | 0.00318 | 0.32% |
| 10 | 91,000 | 0.00455 | 0.46% |
For most use cases, 5 random recipients provides a good balance between distribution fairness and gas costs. The contract defaults to 5 recipients but allows the admin to adjust this based on network conditions.
- Deploy the contract to Ethereum mainnet or testnet
- Interact with the contract using a wallet like MetaMask or any web3 interface
- Start tipping and potentially receiving random tips from others!
MIT License
https://ethercasts.github.io/make-it-rain/make-it-rain.html
Inspired by The Doge Tipping App - http://youtu.be/1MSzYjHPNS0