token:disperse
Transfer a token to multiple recipients, encoding one transfer per recipient.
Syntax
Section titled “Syntax”token:disperse <token> <recipients> <amounts>Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
token | address | Token address |
recipients | array | Recipient addresses |
amounts | array | number | Per-recipient amounts in token units (wei), or a single amount sent to every recipient |
Examples
Section titled “Examples”load token
set $token 0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdbset $alice 0x4F2083f5fBede34C2714aFfb3105539775f7FE64set $bob 0x64c007ba4ab6184753dc1e8e7263e8d06831c5f6
# Pay each recipient its own amounttoken:disperse $token [$alice $bob] [100e18 50e18]
# Send the same amount to every recipienttoken:disperse $token [$alice $bob] 10e18See Also
Section titled “See Also”- token:transfer
- loop — for payouts that need per-recipient logic