Skip to content

Instantly share code, notes, and snippets.

@marco-martins
Last active June 14, 2022 15:53
Show Gist options
  • Save marco-martins/015eb7be1ff940f0eb32b91311b06ca2 to your computer and use it in GitHub Desktop.
Save marco-martins/015eb7be1ff940f0eb32b91311b06ca2 to your computer and use it in GitHub Desktop.
simple-payment-close.js
{"valueParameterInfo":[["Deposit",{"valueParameterFormat":{"contents":[6,""],"tag":"DecimalFormat"},"valueParameterDescription":""}]],"timeParameterDescriptions":[],"roleDescriptions":[["Giver1",""]],"contractType":"Other","contractShortDescription":"","contractName":"Double Pay","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
// main function
function payment (giver: Party, receiver: Party, amount: Value, deadline: Timeout): Contract {
return When([
Case(
Deposit(receiver, giver, ada, amount),
Close
)
], deadline, Close)
}
return payment(
Role("Giver"),
Role("Receiver"),
Constant(100000000),
TimeParam("Deadline")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment