GitHunt

XMoney Protocol

XMoney is a revolutionary crypto payment protocol built on top of XID, enabling seamless transfers to ๐• users using only their handle โ€” no wallet address required. Users can send BNB, stablecoins, and any BEP-20 token directly through social interactions.

Key Capabilities

  • Handle-Based Transfers: Send crypto to any ๐• user using just their @handle
  • Multi-Recipient Support: Transfer to single users or batches of recipients
  • No Wallet Required: Recipients don't need to know their wallet address
  • Secure Vault System: Funds are safely stored until users claim them

By combining identity and onchain payments, XMoney unlocks a powerful new toolset for mass crypto adoption on ๐•.

Contract Addresses (BSC Mainnet)

  • XMoney Contract: 0x6efC8Da0F812aA83A697cF2737B0dFAE8a9B9480
  • XVault Contract: 0xf09455165668218E13298cA14827f1FaEb0BBdee

Features

  • Transfer BNB and BEP-20 tokens using ๐• username
  • Secure vault system for unclaimed funds
  • Batch transfer support for multiple recipients
  • Built with OpenZeppelin contracts for security
  • Non-custodial design
  • Reentrancy protection

Prerequisites

  • Foundry
  • Solidity ^0.8.24
  • OpenZeppelin Contracts ^5.0.0

Installation

  1. Clone the repository:
git clone <your-repo-url>
cd XMoney-Contract
  1. Install dependencies:
forge install
  1. Copy environment variables:
cp .env.example .env
  1. Configure your .env file with the required addresses and keys.

Usage

Build

forge build

Test

forge test

Deploy

Deploy the contracts to network:

forge script script/DeployContract.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcast

Transfer Tokens

Send tokens to an XID username:

forge script script/TransferToken.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcast

Batch Transfer

Send to multiple recipients:

forge script script/BatchTransferEth.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcast

Check Balances

Query balances for an XID username:

forge script script/GetBalance.s.sol --rpc-url <your_rpc_url>

Environment Variables

Create a .env file with the following variables:

# Private key for deployment (without 0x prefix)
PRIVATE_KEY=your_private_key_here

# Contract addresses
XID_ADDRESS=0x0000000000000000000000000000000000000000
FEE_RECEIVER=0x0000000000000000000000000000000000000000

# BSC MAINNET
XMONEY_ADDRESS=0x0000000000000000000000000000000000000000
XVAULT_ADDRESS=0x0000000000000000000000000000000000000000

# Test configuration
TEST_TOKEN_ADDRESS=0x0000000000000000000000000000000000000000
TEST_USER_PRIVATE_KEY=your_test_private_key_here

Contract Architecture

The system consists of two main contracts:

  1. XMoney: Handles the transfer logic and fee management

    • Supports BNB and BEP-20 token transfers
    • Implements reentrancy protection
    • Configurable fee system
    • Batch transfer capabilities
  2. XVault: Manages unclaimed funds

    • Secure storage for unclaimed BNB and tokens
    • Balance tracking per username
    • Withdrawal mechanism for claimed funds
    • Fee calculation on withdrawals

Security Features

  • Uses OpenZeppelin's ReentrancyGuard
  • Non-custodial design - funds are either transferred directly or held in XVault
  • Configurable fee system with owner controls
  • Event emission for all important operations
  • Built on audited OpenZeppelin contracts
  • SafeERC20 for secure token transfers

Documentation

For detailed documentation about Foundry's capabilities, visit the Foundry Book.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Ecosystem

Applications built on XMoney:

  • XID Protocol: xid.so - On-chain identity layer mapping X usernames to BNB Chain addresses
  • ClawMoney: clawmoney.ai - Social task marketplace with rewards distributed via XMoney
  • BNBot: github.com/bnbot-ai - AI-powered Chrome extension for Twitter/X
  • OpenClaw: openclaw.ai - AI agent framework powering the ClawMoney ecosystem

Community & Support

License

This project is licensed under the MIT License.

XMoney-Protocol/XMoney-Contract | GitHunt