To make sure some assets are distributed properly among many addresses (useful for airdrops for example):
val properSending = {
val imp = OUTPUTS.slice(1, OUTPUTS.size - 1)
val appended = imp.fold(OUTPUTS(0).propositionBytes, {(x:Coll[Byte], b:Box) => {
x ++ b.propositionBytes
}})
blake2b256(appended) == $outHash
}
It both makes sure of proper outputs and preserves proper order. The same can be done for value.