Skip to content

token:disperse

Transfer a token to multiple recipients, encoding one transfer per recipient.

Supports runtime fields inside smart blocks. Use explicit @helper! expressions or captured outputs; other fields are evaluated at build time.

token:disperse <token> <recipients> <amounts>
NameTypeEvaluationDescription
tokenaddressRuntime in smart blocksToken address
recipientsarrayRuntime in smart blocksRecipient addresses
amountsarray | numberRuntime in smart blocksPer-recipient amounts in token units (wei), or a single amount sent to every recipient
NameTypeEvaluationDescription
--max-recipientsnumberBuild timeMaximum recipients for a runtime array (default 32, at most 256); exceeding it reverts the batch
load token
set $token 0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb
set $alice 0x4F2083f5fBede34C2714aFfb3105539775f7FE64
set $bob 0x64c007ba4ab6184753dc1e8e7263e8d06831c5f6
# Pay each recipient its own amount
token:disperse $token [$alice $bob] [100e18 50e18]
# Send the same amount to every recipient
token:disperse $token [$alice $bob] 10e18