Last active
June 9, 2022 19:06
-
-
Save ajuggler/3756cff038ba3f82c4dd5f6ee57a49bd to your computer and use it in GitHub Desktop.
simple choice
This file contains 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 to be transferred"}]],"timeParameterDescriptions":[["DepositDeadline","Deposit deadline"],["ChoiceDeadline","Make choice deadline"]],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Simple Choice","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]} |
This file contains 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 "DepositDeadline") | |
Close | |
) |
This file contains 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