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
Links
- XMoney DApp: XMoney
- XID DApp: XID
- XID Protocol: XID on GitHub
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
- Clone the repository:
git clone <your-repo-url>
cd XMoney-Contract- Install dependencies:
forge install- Copy environment variables:
cp .env.example .env- Configure your
.envfile with the required addresses and keys.
Usage
Build
forge buildTest
forge testDeploy
Deploy the contracts to network:
forge script script/DeployContract.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcastTransfer Tokens
Send tokens to an XID username:
forge script script/TransferToken.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcastBatch Transfer
Send to multiple recipients:
forge script script/BatchTransferEth.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcastCheck 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_hereContract Architecture
The system consists of two main contracts:
-
XMoney: Handles the transfer logic and fee management
- Supports BNB and BEP-20 token transfers
- Implements reentrancy protection
- Configurable fee system
- Batch transfer capabilities
-
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
- Website: xmoney.to
- Twitter: @XMoneyProtocol
- XID Protocol: xid.so
License
This project is licensed under the MIT License.