2017-11-16 15:31:52 +00:00
|
|
|
Hello, World! Pt.2 - Contract constraints
|
|
|
|
=========================================
|
2017-07-17 11:23:14 +00:00
|
|
|
|
2017-11-16 15:31:52 +00:00
|
|
|
.. note:: This tutorial extends the CorDapp built during the :doc:`Hello, World tutorial <hello-world-introduction>`.
|
|
|
|
|
|
|
|
In the Hello, World tutorial, we built a CorDapp allowing us to model IOUs on ledger. Our CorDapp was made up of two
|
2017-07-17 11:23:14 +00:00
|
|
|
elements:
|
|
|
|
|
2018-11-13 11:50:24 +00:00
|
|
|
* An ``IOUState``, representing IOUs on the blockchain
|
2018-12-03 22:30:15 +00:00
|
|
|
* An ``IOUFlow`` and ``IOUFlowResponder`` flow pair, orchestrating the process of agreeing the creation of an IOU on-ledger
|
2017-07-17 11:23:14 +00:00
|
|
|
|
2018-11-13 11:50:24 +00:00
|
|
|
However, our CorDapp did not impose any constraints on the evolution of IOUs on the blockchain over time. Anyone was free
|
2017-11-16 15:31:52 +00:00
|
|
|
to create IOUs of any value, between any party.
|
2017-07-17 11:23:14 +00:00
|
|
|
|
2017-11-16 15:31:52 +00:00
|
|
|
In this tutorial, we'll write a contract to imposes rules on how an ``IOUState`` can change over time. In turn, this
|
|
|
|
will require some small changes to the flow we defined in the previous tutorial.
|
2017-07-17 11:23:14 +00:00
|
|
|
|
2018-06-21 15:57:30 +00:00
|
|
|
We'll start by writing the contract.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
|
|
|
tut-two-party-contract
|
|
|
|
tut-two-party-flow
|