Well that's definitely a good puzzle. I've tried to model it for a bit, but it indeed looks like we'd need to add something to the language to make it possible at all! Thanks for bringing this up.
For example, you could have something like this:
send [USD/2 *] (
source = @users:1234
destination = {
// first $1000 are taxed at 10%
max [USD/2 100000] to {
10% to @taxes
remaining kept
}
// Anything above that is, taxed at 20%
remaining to {
20% to @taxes
remaining kept
}
}
)
(You can test it on the playground, you'll just want to feed the "users:1234" account with an initial balance in the input section)