Skip to content
Permalink
Browse files

Translate Crowd Funding contract to Marlowe 2.0

  • Loading branch information...
palas committed Mar 15, 2019
1 parent 7cca63b commit 3600a11a369d3f59ab28e0db1125bd239f943aff
Showing with 1 addition and 1 deletion.
  1. +1 −1 meadow-client/src/Marlowe/Contracts.purs
@@ -4,7 +4,7 @@ depositIncentive :: String
depositIncentive = "Commit 1 1 1\n (Constant 100)\n 10 200\n (Commit 2 2 2\n (Constant 20)\n 20 200\n (When (ChoseSomething (1, 1))\n 100\n (Both (Pay 3 1 1 (Constant 100) 200 Null Null)\n (Pay 4 2 2 (Constant 20) 200 Null Null))\n (Both (Pay 5 1 1 (Constant 100) 200 Null Null)\n (Pay 6 2 1 (Constant 20) 200 Null Null)))\n (Pay 7 1 1 (Constant 100) 200 Null Null))\n Null"

crowdFunding :: String
crowdFunding = "Both (Both (Both (When (AndObs (PersonChoseSomething (IdentChoice 1) 1)\n (ValueGE (MoneyFromChoice (IdentChoice 1) 1\n (ConstMoney 0))\n (ConstMoney 1)))\n 10\n (CommitCash (IdentCC 1) 1\n (MoneyFromChoice (IdentChoice 1) 1\n (ConstMoney 0))\n 10 20 Null Null)\n Null)\n (When (AndObs (PersonChoseSomething (IdentChoice 2) 2)\n (ValueGE (MoneyFromChoice (IdentChoice 2) 2\n (ConstMoney 0))\n (ConstMoney 1)))\n 10\n (CommitCash (IdentCC 2) 2\n (MoneyFromChoice (IdentChoice 2) 2\n (ConstMoney 0))\n 10 20 Null Null)\n Null))\n (Both (When (AndObs (PersonChoseSomething (IdentChoice 3) 3)\n (ValueGE (MoneyFromChoice (IdentChoice 3) 3\n (ConstMoney 0))\n (ConstMoney 1)))\n 10\n (CommitCash (IdentCC 3) 3\n (MoneyFromChoice (IdentChoice 3) 3\n (ConstMoney 0))\n 10 20 Null Null)\n Null)\n (When (AndObs (PersonChoseSomething (IdentChoice 4) 4)\n (ValueGE (MoneyFromChoice (IdentChoice 4) 4\n (ConstMoney 0))\n (ConstMoney 1)))\n 10\n (CommitCash (IdentCC 4) 4\n (MoneyFromChoice (IdentChoice 4) 4\n (ConstMoney 0))\n 10 20 Null Null)\n Null)))\n (When FalseObs 10 Null\n (Choice (ValueGE (AddMoney (AddMoney (AvailableMoney (IdentCC 1))\n (AvailableMoney (IdentCC 2)))\n (AddMoney (AvailableMoney (IdentCC 3))\n (AvailableMoney (IdentCC 4))))\n (ConstMoney 1000))\n (Both (Both (Pay (IdentPay 1) 1 5\n (AvailableMoney (IdentCC 1))\n 20 Null)\n (Pay (IdentPay 2) 2 5\n (AvailableMoney (IdentCC 2))\n 20 Null))\n (Both (Pay (IdentPay 3) 3 5\n (AvailableMoney (IdentCC 3))\n 20 Null)\n (Pay (IdentPay 4) 4 5\n (AvailableMoney (IdentCC 4))\n 20 Null)))\n Null))\n"
crowdFunding = "Both (Both (Both (When (AndObs (ChoseSomething (1, 1))\n (ValueGE (ValueFromChoice (1, 1)\n (Constant 0))\n (Constant 1)))\n 10\n (Commit 1 1 1\n (ValueFromChoice (1, 1)\n (Constant 0))\n 10 20 Null Null)\n Null)\n (When (AndObs (ChoseSomething (2, 2))\n (ValueGE (ValueFromChoice (2, 2)\n (Constant 0))\n (Constant 1)))\n 10\n (Commit 2 2 2\n (ValueFromChoice (2, 2)\n (Constant 0))\n 10 20 Null Null)\n Null))\n (Both (When (AndObs (ChoseSomething (3, 3))\n (ValueGE (ValueFromChoice (3, 3)\n (Constant 0))\n (Constant 1)))\n 10\n (Commit 3 3 3\n (ValueFromChoice (3, 3)\n (Constant 0))\n 10 20 Null Null)\n Null)\n (When (AndObs (ChoseSomething (4, 4))\n (ValueGE (ValueFromChoice (4, 4)\n (Constant 0))\n (Constant 1)))\n 10\n (Commit 4 4 4\n (ValueFromChoice (4, 4)\n (Constant 0))\n 10 20 Null Null)\n Null)))\n (When FalseObs 10 Null\n (Choice (ValueGE (AddValue (AddValue (Committed 1)\n (Committed 2))\n (AddValue (Committed 3)\n (Committed 4)))\n (Constant 1000))\n (Both (Both (Pay 5 1 5\n (Committed 1)\n 20 Null Null)\n (Pay 6 2 5\n (Committed 2)\n 20 Null Null))\n (Both (Pay 7 3 5\n (Committed 3)\n 20 Null Null)\n (Pay 8 4 5\n (Committed 4)\n 20 Null Null)))\n Null))\n"

escrow :: String
escrow = "CommitCash (IdentCC 1) 1\n (ConstMoney 450)\n 10 100\n (When (OrObs (OrObs (AndObs (PersonChoseThis (IdentChoice 1) 1 0)\n (OrObs (PersonChoseThis (IdentChoice 2) 2 0)\n (PersonChoseThis (IdentChoice 3) 3 0)))\n (AndObs (PersonChoseThis (IdentChoice 2) 2 0)\n (PersonChoseThis (IdentChoice 3) 3 0)))\n (OrObs (AndObs (PersonChoseThis (IdentChoice 1) 1 1)\n (OrObs (PersonChoseThis (IdentChoice 2) 2 1)\n (PersonChoseThis (IdentChoice 3) 3 1)))\n (AndObs (PersonChoseThis (IdentChoice 2) 2 1)\n (PersonChoseThis (IdentChoice 3) 3 1))))\n 90\n (Choice (OrObs (AndObs (PersonChoseThis (IdentChoice 1) 1 1)\n (OrObs (PersonChoseThis (IdentChoice 2) 2 1)\n (PersonChoseThis (IdentChoice 3) 3 1)))\n (AndObs (PersonChoseThis (IdentChoice 2) 2 1)\n (PersonChoseThis (IdentChoice 3) 3 1)))\n (Pay (IdentPay 1) 1 2\n (AvailableMoney (IdentCC 1))\n 100\n (RedeemCC (IdentCC 1) Null))\n (RedeemCC (IdentCC 1) Null))\n (RedeemCC (IdentCC 1) Null))\n Null\n"

0 comments on commit 3600a11

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