Atomic batch distributions up to 200 addresses and ECDSA oracle-verified lucky chat packets
RainDistributor.sol facilitates atomic community airdrops to up to 200 addresses (MAX_RECIPIENTS = 200) in a single transaction. Each recipient transfer is isolated with a 30,000 gas cap, ensuring that a failing receiver address never halts the distribution to other members.
In live community chat rooms, creators and members can drop interactive Red Packets. The creator locks tokens or ETH into TribFiPacketDrop.sol. Active chat participants claim their share by presenting a cryptographically signed voucher from the protocol oracle:
// TribFiPacketDrop.sol - Oracle-Verified Claim
function claimPacket(
string calldata packetId,
uint256 amount,
bytes calldata signature
) external nonReentrant {
bytes32 messageHash = keccak256(abi.encodePacked(packetId, msg.sender, amount, block.chainid));
bytes32 ethSigned = MessageHashUtils.toEthSignedMessageHash(messageHash);
require(ethSigned.recover(signature) == oracleSigner, "Invalid oracle signature");
require(!claimed[packetId][msg.sender], "Already claimed");
claimed[packetId][msg.sender] = true;
_payout(packet.token, msg.sender, amount);
}Drops support two mathematical models:
- Equal Distribution: Total pot is divided symmetrically among all claimers.
- Lucky Distribution: Randomized Pareto curve giving participants random variance with rare "Jackpot" shares.
The oracle requires verified account age and chat participation before issuing signatures. Creators can call refundPacket() after the claim deadline to recover any unclaimed tokens.