Asks Zoe (via zcf) to rearrange the allocations among the seats mentioned. This is a set of changes to allocations that must satisfy several constraints. If these constraints are all met, then the reallocation happens atomically. Otherwise it does not happen at all.

The conditions

  • All the mentioned seats are still live -- enforced by ZCF.
  • No outstanding stagings for any of the mentioned seats. Stagings now deprecated in favor or atomicRearrange. To prevent confusion, for each reallocation, it can only be expressed in the old way or the new way, but not a mixture.
  • Offer safety -- enforced by ZCF.
  • Overall conservation -- enforced by ZCF.
  • The overall transfer is expressed as an array of TransferPart. Each individual TransferPart is one of
    • A transfer from a fromSeat to a toSeat. This is not needed for Zoe's safety, as Zoe does its own overall conservation check. Rather, it helps catch and diagnose contract bugs earlier.
    • A taking from a fromSeat's allocation. See the fromOnly helper.
      • A giving into a toSeat's allocation. See the toOnly helper.

TODO(6679) Refactor atomicRearrangefrom being a helper into being zcf's replacement for reallocate. It was made a helper during the transition, to avoid interference with progress on Zoe durability.

See the helpers below, fromOnly, toOnly, and atomicTransfer, which will remain helpers. These helper are for convenience in expressing atomic rearrangements clearly.

use the zcf builtin instead