Last active
June 9, 2022 18:42
-
-
Save marco-martins/826c575a0ca7bd39219895e823403da0 to your computer and use it in GitHub Desktop.
MPP - Choice & If
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"valueParameterInfo":[["Amount",{"valueParameterFormat":{"contents":[6,"Ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount"}]],"timeParameterDescriptions":[["despositDeadline","Deadline for the deposit"],["choiceDeadline","Deadline for the choice"]],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Let | |
| "amount" | |
| (ConstantParam "Amount") | |
| (When | |
| [Case | |
| (Deposit | |
| (Role "giver") | |
| (Role "giver") | |
| (Token "" "") | |
| (UseValue "amount") | |
| ) | |
| (When | |
| [Case | |
| (Choice | |
| (ChoiceId | |
| "Choice" | |
| (Role "chooser") | |
| ) | |
| [Bound 1 2] | |
| ) | |
| (If | |
| (ValueEQ | |
| (ChoiceValue | |
| (ChoiceId | |
| "Choice" | |
| (Role "chooser") | |
| )) | |
| (Constant 1) | |
| ) | |
| (Pay | |
| (Role "giver") | |
| (Account (Role "receiver1")) | |
| (Token "" "") | |
| (UseValue "amount") | |
| Close | |
| ) | |
| (Pay | |
| (Role "giver") | |
| (Account (Role "receiver2")) | |
| (Token "" "") | |
| (UseValue "amount") | |
| Close | |
| ) | |
| )] | |
| (TimeParam "choiceDeadline") | |
| Close | |
| )] | |
| (TimeParam "despositDeadline") | |
| Close | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment