Directory / marlowe / checklist.md
You are browsing a mirror of a file hosted on GitHub. View original
Converting Marlowe contracts from v1.3 to v2.0
The overview describes the differences between Marlowe 2.0 and Marlowe 1.3; here that information is presented as a checklist for converting contracts between v1.3 and v2.0.
Rename the constructor to
An action id field needs to be added as the first field of the constructor. As long as it is unique within the contract, the particular value is not relevant to the behaviour of the contract, but is used in constructing inputs, e.g. in Meadow.
The amount of money to be comitted must be converted from type
Value, see item 3.
An action id field needs to replace the payment id as the first field of the constructor. Note that this must be unique within the contract.
Personmaking the contract is no longer a field; this is replaced by the
IdCommitof the commitment from which the payment is to be made.
Payments originally had a single continuation
Contract, irrespective of whether or not the construct had timed out. This is now distinguished, and so the original continuation should be duplicated.
The amount of money to be paid must be converted from type
Value, see item 3.
Expressions of type
Moneyshould be renamed to their corresponding expressions of type
Marlowe 1.3 Marlowe 2.0 AvailableMoney Committed AddMoney AddValue ConstMoney Constant MoneyFromChoice ValueFromChoice
Redeemconstructor has been removed, and it should be replaced by a
Payconstructor. This will be a payment from the commitment to the person who made the commitment initially.
More details of how to construct payments in v2.0 are given above, but note that the extra information required will include an action id, a timeout, and a continuation to use if the timeout is exceeded.
Identifiers for choices now include the choice and the participant as part of the identifier as described in the overview document. This affects
Moneyexpressions that depend on choices:
PersonChoseThis idCh per cbecomes
ChoseThis (idCh, per) c
PersonChoseSomething idCh per cbecomes
ChoseSomething (idCh, per) c
MoneyFromChoice idCh per valbecomes
ValueFromChoice (idCh, per) val