Skip to content
Permalink
Browse files

fixes

  • Loading branch information...
shmish111 committed Sep 11, 2019
1 parent c347831 commit c851f136ce4e1505f9be01317dd5dcd015781a42
@@ -140,5 +140,3 @@ ____

IOHK plans to implement the full ACTUS standard using Marlowe and Plutus
over the coming year.

==== link:./playground-overview.adoc[Prev] link:./README.adoc[Up]
@@ -10,7 +10,7 @@ and reusable descriptions of Marlowe contracts.
image:escrow.png[Escrow]

Recall that we developed this Marlowe contract in our
link:./escrow-ex.adoc[earlier tutorial].
xref:escrow-ex#escrow-ex[earlier tutorial].

While we presented it there as a “monolothic” contract, we can use Haskell definitions to make it more readable. To start with, we can separate the initial commitment from the _inner_ working part of the contract:

@@ -207,5 +207,3 @@ tutorial you will learn about how to _exercise_ Marlowe contracts in ghci.
https://github.com/input-output-hk/marlowe/blob/master/semantics-3.0/src/Language/Marlowe/Examples/EscrowSimpleV2.hs[`+EscrowSimpleV2.hs+`]

* The expanded version comes from the Marlowe Playground, which supports expansion of embedded definitions into pure Marlowe..

==== link:./marlowe-data.adoc[Prev] link:./README.adoc[Up] link:./using-marlowe.adoc[Next]
@@ -143,13 +143,11 @@ There is a timeout of `10` slots on making the deposit; if that is reached witho
=== Definitions


We will see link:./embedded-marlowe.adoc[later] that parts of this
We will see xref:embedded-marlowe#embedded-marlowe[later] that parts of this
contract description, such as `+arbitrate+`, `agreement`, and `price`, use the Haskell
_embedding_ of Marlowe DSL to give some shorthand definitions. We also use _overloaded_ strings to make some descriptions – e.g. of accounts – more concise.

These are discussed in
more detail when we look at link:./embedded-marlowe.adoc[embedded
Marlowe].
These are discussed in more detail when we look at xref:embedded-marlowe#embedded-marlowe[embedded Marlowe].

____
*Exercise*
@@ -177,5 +175,3 @@ deployed on a blockchain.
contracts: an adventure in financial engineering]
* https://dl.acm.org/citation.cfm?id=2784747[Certified symbolic
management of financial multi-party contracts]

==== link:./introducing-marlowe.adoc[Prev] link:./README.adoc[Up] link:./marlowe-model.adoc[Next]
@@ -1,4 +1,4 @@
= marlowe Tutorial
= Marlowe Tutorial
:email: plutus@iohk.io
:orgname: IOHK
:doctype: article
@@ -29,7 +29,7 @@ include::introducing-marlowe.adoc[leveloffset=+ 1]
include::escrow-ex.adoc[leveloffset=+1]
include::marlowe-model.adoc[leveloffset=+1]
include::marlowe-step-by-step.adoc[leveloffset=+1]
include::escrow-step-by-step.adoc[leveloffset=+1]
// include::escrow-step-by-step.adoc[leveloffset=+1]
include::marlowe-data.adoc[leveloffset=+1]
include::embedded-marlowe.adoc[leveloffset=+1]
include::using-marlowe.adoc[leveloffset=+1]
@@ -114,5 +114,3 @@ https://github.com/input-output-hk/marlowe[link]
* The Marlowe paper: https://iohk.io/research/papers/#2WHKDRA8[link]
* Marlowe video from PlutusFest, December 2018:
https://www.youtube.com/watch?v=rSpFOADHLqw[link]

==== link:./README.adoc[Up] link:./escrow-ex.adoc[Next]
@@ -20,7 +20,7 @@ data Contract = Refund
| Let ValueId Value Contract
----

We saw link:./marlowe-step-by-step.adoc[in the previous tutorial] what these contracts do. In the rest of this tutorial we will dig a bit deeper into the Haskell types that are used to represent the various components of the contracts, including accounts, values, observations, and actions. We will also look at types that relate to the execution of contracts, including inputs, states, the environment.
We saw xref:marlowe-step-by-step#marlowe-step-by-step[in the previous tutorial] what these contracts do. In the rest of this tutorial we will dig a bit deeper into the Haskell types that are used to represent the various components of the contracts, including accounts, values, observations, and actions. We will also look at types that relate to the execution of contracts, including inputs, states, the environment.

=== Basic components

@@ -206,5 +206,3 @@ constructors. This makes them strict in that field. We choose to make
Marlowe strict in all arguments to all constructors, so that Marlowe
contracts are wholly _finite_ data structures, with no partial or
infinite components.

==== link:./marlowe-step-by-step.adoc[Prev] link:./README.adoc[Up] link:./embedded-marlowe.adoc[Next]
@@ -46,6 +46,3 @@ Putting this together gives us a _transaction_, as shown in the diagram below, a
[caption="Figure 1: "]
image:transaction.svg[]


==== link:./escrow-ex.adoc[Prev] link:./README.adoc[Up] link:./marlowe-step-by-step.adoc[Next]

@@ -12,8 +12,7 @@ compiles Haskell code into serialized Plutus Core code, to create a
Cardano _validator script_ that ensures the correct execution of the
contract. This form of implementation relies on the extensions to the
UTxO model that are described in
https://github.com/input-output-hk/plutus/blob/master/docs/extended-utxo/README.md[this
overview].
https://iohk.io/research/papers/#functional-blockchain-contracts[this paper].

Marlowe contract execution on the blockchain consists of a chain of
transactions where, at each stage, the remaining contract and its state
@@ -37,7 +36,7 @@ number of advantages:
all Marlowe contracts, thus making it easier to implement, review, and
test what we have done.
* It is close to the semantics of Marlowe, as described in the
link:./marlowe-semantics.adoc[earlier tutorial], so making it easier to
xref:marlowe-data#marlowe-data[earlier tutorial], so making it easier to
validate.
* It means that the same implementation can be used for both on- and
off-chain (wallet) execution of Marlowe code.
@@ -59,9 +58,8 @@ simplifies contract reflection and retrospection.
=== Contract lifecycle on extended UTxO model

The current implementation works on the mockchain, as described in
https://github.com/input-output-hk/plutus/blob/master/plutus-tutorial/tutorial/Tutorial/02-wallet-api.md[the
Wallet API]. We expect to have to make only minimal changes to run on
the production implementation because the mockchain is designed to be
https://prod.playground.plutus.iohkdev.io/tutorial/#testing-contract-03[Testing a Contract].
We expect to have to make only minimal changes to run on the production implementation because the mockchain is designed to be
faithful to that.

As we described above, the Marlowe interpreter is realised as a
@@ -222,10 +220,6 @@ ____
=== Where to go to find out more

* The PlutusTX tutorial
https://github.com/input-output-hk/plutus/blob/master/plutus-tutorial/tutorial/Tutorial/01-plutus-tx.md[link]
https://prod.playground.plutus.iohkdev.io/tutorial/#plutus-tx[link]
* The Wallet API tutorial
https://github.com/input-output-hk/plutus/blob/master/plutus-tutorial/tutorial/Tutorial/02-wallet-api.md[link]
* The extended UTxO model
https://github.com/input-output-hk/plutus/blob/master/docs/extended-utxo/README.md[link]

==== link:./actus-marlowe.adoc[Prev] link:./README.adoc[Up] link:[Next]
https://prod.playground.plutus.iohkdev.io/tutorial/#validator-scripts[link]
@@ -14,7 +14,7 @@ participants. Concretely, we represent a transaction as a list of
`+AnyInput+`s together with a set of integers representing the set of
signatories.

As we mentioned in link:./marlowe-data.adoc[the previous tutorial], inputs
As we mentioned in xref:marlowe-data#marlowe-data[the previous tutorial], inputs
can have one out of four kinds: `+Commit+`, `+Pay+`, `+Choice+`, and
`+Oracle+`. Of these, `+Commit+` and `+Pay+` are considered to be
_actions_ and are typically associated with the transfer of money
@@ -458,6 +458,4 @@ Note that if `+Use+` is not defined it will expand to `+Null+`.

Analogously to `+Scale+`, `+Let+` construct will only get reduced when
there are no corresponding `+Use+` constructs that use it, this clean-up
procedure is carried out by `+simplify+` function.

==== link:./marlowe-data.adoc[Prev] link:./README.adoc[Up] link:./embedded-marlowe.adoc[Next]
procedure is carried out by `+simplify+` function.
@@ -38,7 +38,3 @@ In order to make sure that the contract makes progress eventually, the contract
A let contract `Let id val cont` allows a contract to _name a value_ using an identifier. In this case, the expression `val` is evaluated, and stored with the name `id`. The contract then continues as `cont`.

As well as allowing us to use abbreviations, this mechanism also means that we can capture and save volatile values that might be changing with time, e.g. the current price of oil, or the current slot number, at a particular point in the execution of the contract, to be used later on in contract execution.

==== link:./marlowe-model.adoc[Prev] link:./README.adoc[Up] link:./marlowe-data.adoc[Next]


@@ -3,7 +3,8 @@
This document gives an overview of a set of Marlowe tutorials.


. xref:introducing-marlowe#introducing-marlowe[] Introducing Marlowe
[start=2]
. xref:introducing-marlowe#introducing-marlowe[leveloffset=+ 1] Introducing Marlowe
This tutorial gives an overview of the ideas behind Marlowe, as a
domain-specific language embedded in Haskell. It also introduces
commitments and timeouts, which are central to how Marlowe works in a
@@ -17,8 +18,6 @@ In this tutorial we look at our general approach to modelling contracts in Marlo
. xref:marlowe-step-by-step#marlowe-step-by-step[] Marlowe step by step
This tutorial explains the five ways of building contracts in Marlowe. Four of these – `Pay`, `Let`, `If` and `When` – build a complex contract from simpler contracts, and the fifth, `Refund`, is a simple contract.
In explaining these contracts we will also explain Marlowe _values_, _observations_ and _actions_, which are used to supply external information and inputs to a running contract to control how it will evolve.
. xref:escrow-step-by-step#escrow-step-by-step[] Escrow step by step NOT YET UPDATED
On this tutorial we build the escrow contract step by step. From a single contract with a single actor (Alice) to multiple actors (Alice,Bob,Carol) and multiple interactions. /This was the script for the example in the udemy class/.
. xref:marlowe-data#marlowe-data[] The Marlowe data types
This tutorial formally introduces Marlowe as a Haskell data type, as well as presenting
the different types used by the model, and discussing a
@@ -39,6 +38,9 @@ their execution.
This tutorial gives an introduction to the general idea of the ACTUS
taxonomy, plus examples implemented in Marlowe.

// . xref:escrow-step-by-step#escrow-step-by-step[] Escrow step by step NOT YET UPDATED
// On this tutorial we build the escrow contract step by step. From a single contract with a single actor (Alice) to multiple actors (Alice,Bob,Carol) and multiple interactions. /This was the script for the example in the udemy class/.

////
. xref:marlowe-semantics#marlowe-semantics[] Understanding the semantics IGNORE THIS

@@ -41,16 +41,16 @@ image:haskell-2.png[The Haskell editor]

The figure shows a screenshot of the Marlowe Playground in the middle of
developing an “escrow” contract; other contract examples, based on the
link:./actus-marlowe.adoc[ACTUS] standard, can be loaded by clicking on
xref:actus-marlowe#actus-marlowe[ACTUS] standard, can be loaded by clicking on
the named *Demos* below the *HASKELL EDITOR* tab.

image:gists.png[Loading and saving github gists]

If you have a github account, it's also possible to save contracts that you develop as _github gists_. To do this log into your account using the *Log in* button at the top right of the screen. You will then see buttons to allow you to *Publish* or save contracts as gists, and to *Load* contracts from github.

=== BLOCKLY: developing Marlowe contracts visually
// === BLOCKLY: developing Marlowe contracts visually

This is covered in the tutorial on link:./escrow_step_by_step.adoc[Escrow step by step].
// This is covered in the tutorial on link:./escrow_step_by_step.adoc[Escrow step by step].

=== Simulating Marlowe contracts

@@ -147,7 +147,7 @@ system to its initial state by pressing the *Reset* button.
Use the Marlowe Playground to interact with the `+escrow+` contract in
the various scenarios discussed earlier, in the tutorial on
link:./using-marlowe.adoc[using Marlowe].
xref:using-marlowe#using-marlowe[using Marlowe].
Explore making some changes to the contract, and interactions with those
modified contracts.
@@ -159,6 +159,4 @@ modified contracts.
Use the Marlowe Playground to explore the other contracts presented in
there: the deposit incentive contract, and the crowd-funding example.
====

==== link:./using-marlowe.adoc[Prev] link:./README.adoc[Up] link:./actus-marlowe.adoc[Next]
====
@@ -169,6 +169,4 @@ Yes, there is!

We look next at our tool, the Marlowe Playground, that
will capitalise on the fact that we are working in a DSL to _automate_
picking the right inputs and allow users to interact with contracts.

==== link:./embedded-marlowe.adoc[Prev] link:./README.adoc[Up] link:./playground-overview.adoc[Next]
picking the right inputs and allow users to interact with contracts.

0 comments on commit c851f13

Please sign in to comment.
You can’t perform that action at this time.