Skip to content

Instantly share code, notes, and snippets.

View ajuggler's full-sized avatar

Antonio Hernandez ajuggler

View GitHub Profile
@ajuggler
ajuggler / metadata.json
Last active June 9, 2022 17:56
simple payment A
{"valueParameterInfo":[["Amount",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount to be transferred"}]],"timeParameterDescriptions":[],"roleDescriptions":[["Giver","Party making the payment"],["Receiver","Party receiving the payment"]],"contractType":"Other","contractShortDescription":"Giver makes a payment to receiver","contractName":"MPP - Simple payment (close)","contractLongDescription":"Giver makes a payment to receiver","choiceInfo":[]}
@ajuggler
ajuggler / metadata.json
Created June 9, 2022 18:11
simple payment B
{"valueParameterInfo":[["Amount",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount to be transferred"}]],"timeParameterDescriptions":[["Deadline","Time by which the Giver's deposit has to be made"]],"roleDescriptions":[["Giver","Party making payment"],["Receiver","Party receiving payment"]],"contractType":"Other","contractShortDescription":"Giver makes payment to Receiver","contractName":"MPP - Simple payment (shorter)","contractLongDescription":"Giver makes payment to Receiver","choiceInfo":[]}
@ajuggler
ajuggler / metadata.json
Last active June 9, 2022 19:06
simple choice
{"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":[]}
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Funds from two parties get transferred to a receiving party","contractName":"MPP - Double Giving (HW)","contractLongDescription":"Funds from two parties get transferred to a receiving party","choiceInfo":[]}
@ajuggler
ajuggler / metadata.json
Created June 9, 2022 23:07 — forked from brunjlar/metadata.json
MPP - Double Pay
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@ajuggler
ajuggler / metadata.json
Created June 10, 2022 19:30
double pay (marlowe)
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@ajuggler
ajuggler / metadata.json
Created June 10, 2022 21:18
double pay (blockly)
{"valueParameterInfo":[["Deposit",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Deposit by each giver"}]],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Two givers pay to one recipient","contractName":"Double Pay (Blockly)","contractLongDescription":"Two givers pay to one recipient","choiceInfo":[]}
@ajuggler
ajuggler / Main.hs
Last active June 11, 2022 05:36
Double Pay (Haskell)
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe.Extended
main :: IO ()
main = printJSON $ contract (Role "Giver1") (Role "Giver2") (Role "Receiver") (ConstantParam "Deposit") (TimeParam "Deadline")
contract :: Party -> Party -> Party -> Value -> Timeout -> Contract
contract giver1 giver2 receiver amount deadline =
{"valueParameterInfo":[["Deposit",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount of deposit by each payer"}]],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Multiple Payers give to Receiver","contractName":"Multi Pay","contractLongDescription":"Multiple Payers give to Receiver","choiceInfo":[]}
@ajuggler
ajuggler / metadata.json
Last active June 12, 2022 05:28
Bank Client (draft)
{"valueParameterInfo":[["Amount",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Deposit amount"}]],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Bank conditionally rewards Client for all deposits","contractName":"Bank & Client","contractLongDescription":"Bank conditionally rewards Client for all deposits, penalizes if at least one deposit is missing","choiceInfo":[]}