If a channel has been finalized on chain, the adjudicator contract knows about the final outcome. This tutorial section covers releasing the assets.
transfer method pays out a given asset to a given set of destinations, according to outcomes that it knows about, if the channel is sufficiently funded.
If the destination specified in the outcome is external, the assets are paid out (as in the example above). Otherwise the destination is a channel id, and the contract updates its internal accounting such that this channel has its direct funding increased.
This method executes payouts that might benefit multiple participants. If multiple actors try and call this method, after the first transaction is confirmed the remaining ones may fail.
It may be desirable to payout to a subset of destinations (or even a single one). The
transfer method can be used to do this, and accepts a list of
indices to transfer from. See the contract API for more information. More information coming soon, including how to track the updated allocation after a
transfer is mined.
claim method will pay out a particular asset held against a guarantor channel, according to a target channel's outcome (and the specified allocation items) but with an preference order controlled by the guarantor channel. The API is otherwise similar to
transfer, only metadata about both channels must be supplied.
If this process seems overly complicated to you: remember that guarantor channels are only required when virtually funding a channel. Also bear in mind that this process is unlinkely to actually play out on chain very often: it is in everyone's interest to administrate inter-channel funding off chain as much as possible, with the on chain administration such as this used as a last resort.
If we wish to liquidate all assets from a channel, it is more convenient to use the
transferAllAssets method, which will do this in a gas efficient manner.
If we have a finalization proof, then we can call
concludeAndTransferAllAssets to do the channel conclusion and payouts for all assets in one transaction.