Skip to content

Instantly share code, notes, and snippets.

@mattu08
Last active December 3, 2022 20:53
Show Gist options
  • Save mattu08/f9428e7f1cb5f9c254ff187e3b3c01c7 to your computer and use it in GitHub Desktop.
Save mattu08/f9428e7f1cb5f9c254ff187e3b3c01c7 to your computer and use it in GitHub Desktop.
Hotel Booking Smart Contract ADA
{"valueParameterInfo":[],"timeParameterDescriptions":[["Booking Date","Booking Date"]],"roleDescriptions":[["Guest","Guest"],["Hotel","Hotel"]],"contractType":"Other","contractShortDescription":"Hotel Booking Smart Contract ADA","contractName":"Hotel Booking Smart Contract ADA","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[["Book Room",{"choiceFormat":{"contents":[0,"Book Room"],"tag":"DecimalFormat"},"choiceDescription":"Option 1. Book standard room. Option 2. Book standard room with breakfast included. Option 3. Book luxury room includs breakfast."}]]}
When
[Case
(Choice
(ChoiceId
"Book Room"
(Role "Guest")
)
[Bound 1 3]
)
(If
(ValueEQ
(ChoiceValue
(ChoiceId
"Book Room"
(Role "Guest")
))
(Constant 1)
)
(When
[Case
(Deposit
(Role "Guest")
(Role "Guest")
(Token "" "")
(Constant 90)
)
(Pay
(Role "Guest")
(Party (Role "Hotel"))
(Token "" "")
(Constant 90)
Close
)]
(TimeParam "Booking Date")
Close
)
(If
(ValueEQ
(ChoiceValue
(ChoiceId
"Book Room"
(Role "Guest")
))
(Constant 2)
)
(When
[Case
(Deposit
(Role "Guest")
(Role "Guest")
(Token "" "")
(Constant 120)
)
(Pay
(Role "Guest")
(Party (Role "Hotel"))
(Token "" "")
(Constant 120)
Close
)]
(TimeParam "Booking Date")
Close
)
(If
(ValueEQ
(ChoiceValue
(ChoiceId
"Book Room"
(Role "Guest")
))
(Constant 3)
)
(When
[Case
(Deposit
(Role "Guest")
(Role "Guest")
(Token "" "")
(Constant 150)
)
(Pay
(Role "Guest")
(Party (Role "Hotel"))
(Token "" "")
(Constant 150)
Close
)]
(TimeParam "Booking Date")
Close
)
Close
)
)
)]
(TimeParam "Booking Date")
Close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment