Skip to main content
Version: v2.0

Destinations

As with sources, there are several options when it comes to deciding where should funds in a financial transaction comes from. The send statement provides the following ways of defining destinations:

Single destination

send [COIN 100] (
source = @world
destination = @users:001
)

Allocation destinations

Similar to portioned sources, destination can be defined as a sequence of fractions to split the monetary onto multiple accounts.

In any case, the summed total of fractions in a block needs to be equal to 1 and the remaining keyword can be used to reach that total:

send [COIN 100] (
source = @world
destination = {
90/100 to @users:001
remaining to @fees
}
)

Out of convenience, percentage notation is also available:

send [COIN 100] (
source = @world
destination = {
90% to @users:001
remaining to @fees
}
)

Nested destinations

Finally, as with sources, destination blocks can be nested:

send [COIN 100] (
source = @world
destination = {
80% to @users:001
20% to {
70% to @platform
15% to @taxes
remaining to @charity
}
}
)