Last active
June 9, 2022 22:08
-
-
Save Dave-Lindberg/5d2557001ed076f30d22228e3044270d to your computer and use it in GitHub Desktop.
week-3_double-donation
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":[["donation",{"valueParameterFormat":{"contents":null,"tag":"DefaultFormat"},"valueParameterDescription":"In Lovelace"}]],"timeParameterDescriptions":[["initial-deadline",""],["donation1-deadline",""],["donation2-deadline",""]],"roleDescriptions":[["Giver1","Donor #1"],["Giver2","Donor #2"],["Receiver","Recipient of all donations"]],"contractType":"Other","contractShortDescription":"Two donors give funds to a recipient","contractName":"Double Donation, Week 3","contractLongDescription":"Two donors give funds to a recipient","choiceInfo":[["initial-donor",{"choiceFormat":{"contents":null,"tag":"DefaultFormat"},"choiceDescription":"input \"1\" for Giver1, \"2\" for Giver2"}]]} |
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
If | |
(ValueLT | |
(ConstantParam "donation") | |
?value2 | |
) | |
(When | |
[Case | |
(Deposit | |
(Role "Giver1") | |
(Role "Giver1") | |
(Token "" "") | |
(ConstantParam "donation") | |
) | |
(When | |
[Case | |
(Deposit | |
(Role "Giver2") | |
(Role "Giver2") | |
(Token "" "") | |
(ConstantParam "donation") | |
) | |
(Pay | |
(Role "Giver2") | |
(Party (Role "Receiver")) | |
(Token "" "") | |
(ConstantParam "donation") | |
(Pay | |
(Role "Giver1") | |
(Party (Role "Receiver")) | |
(Token "" "") | |
(ConstantParam "donation") | |
Close | |
) | |
)] | |
(TimeParam "donation2-giver2-deadline") | |
Close | |
)] | |
(TimeParam "donation1-giver1-deadline") | |
Close | |
) | |
(When | |
[Case | |
(Deposit | |
(Role "Giver2") | |
(Role "Giver2") | |
(Token "" "") | |
(ConstantParam "donation") | |
) | |
(When | |
[Case | |
(Deposit | |
(Role "Giver1") | |
(Role "Giver1") | |
(Token "" "") | |
(ConstantParam "donation") | |
) | |
(Pay | |
(Role "Giver2") | |
(Party (Role "Receiver")) | |
(Token "" "") | |
(ConstantParam "donation") | |
(Pay | |
(Role "Giver1") | |
(Party (Role "Receiver")) | |
(Token "" "") | |
(ConstantParam "donation") | |
Close | |
) | |
)] | |
(TimeParam "donation2-giver1-deadline") | |
Close | |
)] | |
(TimeParam "donation1-giver2-deadline") | |
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