Wallet multisend

From XSpoonAi/spoon-awesome-skill · View interactive version

Wallet multisend is an AI agent skill from the GitHub repository XSpoonAi/spoon-awesome-skill. Send tokens to multiple addresses in optimized transactions. Supports batch transfers, gas optimization, and balance checking.

How to use this skill

Skill file

Description

Send tokens to multiple addresses in optimized transactions. Supports batch transfers, gas optimization, and balance checking.

Inputs

{
  "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "chain": "ethereum",
  "sender": "0x1111111254fb6c44bac0bed2854e76f90643097d",
  "recipients": [
    {
      "address": "0x2222222254fb6c44bac0bed2854e76f90643097d",
      "amount": "100.50"
    },
    {
      "address": "0x3333333254fb6c44bac0bed2854e76f90643097d",
      "amount": "250.75"
    }
  ]
}

Response:

{
  "success": true,
  "multisend": {
    "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "chain": "ethereum",
    "sender": "0x1111111254fb6c44bac0bed2854e76f90643097d",
    "decimals": 6,
    "transfers": [
      {
        "to": "0x2222222254Fb6c44BAC0BeD2854e76F90643097d",
        "amount": "100.500000",
        "amount_wei": "100500000",
        "calldata": "0xa9059cbb0000000000000000000000002222222254Fb6c44BAC0BeD2854e76F90643097d0000000000000000000000000000000000000000000000000000000005fd8220"
      },
      {
        "to": "0x3333333254fB6C44bac0BED2854E76F90643097D",
        "amount": "250.750000",
        "amount_wei": "250750000",
        "calldata": "0xa9059cbb0000000000000000000000003333333254fB6C44bac0BED2854E76F90643097D000000000000000000000000000000000000000000000000000000000ef22430"
      }
    ],
    "success_count": 2,
    "failed_count": 0,
    "total_amount": "351.250000",
    "total_amount_wei": "351250000",
    "current_block": 24399021,
    "gas_estimate": "131000",
    "gas_price_gwei": "1.26",
    "estimated_cost_eth": "0.000166",
    "sender_balance_wei": "0",
    "sender_balance": "0.000000"
  }
}

Transaction Format

ERC20 Transfer Calldata

All transfers use the standard ERC20 transfer function signature:

Function: transfer(address to, uint256 amount)
Selector: 0xa9059cbb

Encoding:
- 0xa9059cbb (4 bytes) - function selector
- recipient_address (32 bytes) - padded with zeros on left
- amount_wei (32 bytes) - transfer amount in wei

Example Parsing:

Calldata: 0xa9059cbb0000000000000000000000002222222254Fb6c44BAC0BeD2854e76F90643097d0000000000000000000000000000000000000000000000000000000005fd8220

Decoded:
- Function: transfer (a9059cbb)
- To: 0x2222222254Fb6c44BAC0BeD2854e76F90643097d
- Amount: 100500000 wei (100.50 USDC with 6 decimals)

Gas Estimation Formula

For batch transfers, gas is calculated as:

Base: 21,000 (transaction base)
First transfer: 65,000
Additional per transfer: 45,000

Formula: 21000 + 65000 + (45000 * (n - 1))

Examples:
- 1 transfer: 86,000 gas
- 2 transfers: 131,000 gas
- 3 transfers: 176,000 gas
- 5 transfers: 266,000 gas

Real-World Data

Test Case 1: Ethereum USDC Batch (2 Recipients)

Input:

Real Results:

Test Case 2: Arbitrum USDC Batch (2 Recipients)

Input:

Real Results:

Error Handling

Error Codes

| Status | Error Type | Cause | Recovery |

|--------|-----------|-------|----------|

| 400 | invalid_token | Token address format invalid | Use valid 0x... address |

| 400 | validation_error | Recipients invalid or empty | Check recipient addresses and amounts |

| 400 | missing_parameter | Required field absent | Provide token and recipients array |

| 400 | unsupported_chain | Chain not in supported list | Use: ethereum, arbitrum, optimism, base, bsc |

| 500 | rpc_error | RPC connection failed | Check network connectivity |

| 500 | invalid_json | Input not valid JSON | Verify JSON format |

Example Errors

Invalid recipients:

{
  "success": false,
  "error": "validation_error",
  "message": "batch size limited to 100 recipients"
}

Invalid token address:

{
  "success": false,
  "error": "invalid_token",
  "message": "Token address is invalid"
}

Unsupported chain:

{
  "success": false,
  "error": "unsupported_chain",
  "message": "Unsupported chain: solana"
}

Token Decimals

The skill automatically retrieves token decimals from the contract. Common values:

| Token | Decimals | 1 Token = |

|-------|----------|-----------|

| USDC | 6 | 1,000,000 wei |

| USDT | 6 | 1,000,000 wei |

| DAI | 18 | 1,000,000,000,000,000,000 wei |

| WMATIC | 18 | 1,000,000,000,000,000,000 wei |

Supported Chains

| Chain | Network ID | RPC Provider | Block Time | Token |

|-------|-----------|-------------|-----------|-------|

| Ethereum | 1 | Blast | 13s | USDC (0xA0b8...) |

| Arbitrum | 42161 | Blast | 0.25s | USDC (0xFF97...) |

| Optimism | 10 | Blast | 2s | USDC (0x0b2c...) |

| Base | 8453 | Blast | 2s | USDC (0x833...) |

| BSC | 56 | Blast | 3s | USDC (0x8AC7...) |

Features

Implemented

✅ Real ERC20 transfer calldata encoding

✅ Multi-chain support (5 EVM chains)

✅ Token decimal detection

✅ Gas price queries from RPC

✅ Sender balance checking

✅ Batch validation (max 100 recipients)

✅ Real block information

✅ Proper amount wei conversion

Not Implemented

❌ Transaction signing (returns calldata only)

❌ Transaction submission/broadcasting

❌ Nonce management

❌ Slippage protection

❌ Multisig contract integration

Performance

Real-World Measurements:

Dependencies

Python Packages:

No API Keys Required - All RPC providers are free public endpoints

Limitations

  1. No Signing - Returns calldata only, doesn't sign transactions
  2. No Broadcasting - Doesn't submit transactions to network
  3. No Nonce Handling - Sender must manage nonce manually
  4. Batch Only - Multiple recipients per transaction (not single transfers)
  5. RPC-Only - No fallback to block explorers

Future Enhancements

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.