Marlowe Pioneer
 
w0802t_cbg
20220925

The Coupon Bond Guaranteed contract as-is

The run that succeeds

This is the run with the unmodified contract (or original contract), as described on w0802_cbg

This one succeeds because the contract is NOT funded by the lender, but by another party, the patron. My ref: output of a run of the scripts in daedtest:~/work/20220925_cbg_take5

export FUND_CONTRACT=3000000                    # the amount to fund the contract with 
export MINIMUM_ADA=2000000                      # the minimum lovelace to be included with native token output.

export PRINCIPAL_AMOUNT=50000000                # the principal is 50₳
export INTEREST_INSTALLMENT=4000000             # the interest is 4₳

The overall result, comparing before/after run:

======================================
     ALIAS    START   CHANGE      END
    patron   100.00    -0.63    99.37
    lender   100.00     9.16   109.16
  borrower   100.00   -17.24    82.76
 guarantor   100.00    -2.70    97.30
  contract                           
    payout                           
     TOTAL   400.00   -11.40   388.60
======================================

104b_patron_funds_contract.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron    -3.21    96.79
    lender            100.00
  borrower            100.00
 guarantor            100.00
  contract     3.00     3.00
    payout                  
     TOTAL    -0.21   399.79
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =   100.00 |
* 60e01c24abcb2f7a89b09231a4bae27368e06e32abba2fb93ce3bc0e992c1869#0    | +    95.64 | Greatest Pure Ada
* 60e01c24abcb2f7a89b09231a4bae27368e06e32abba2fb93ce3bc0e992c1869#1    | +     2.00 | [ "Lender"×1 ]
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   100.00 |
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* b279357b7974447c35fca9a54b8d5800ff6a34722d9ccd1ad3713544599d6b60#0    | +    95.82 | Greatest Pure Ada
* b279357b7974447c35fca9a54b8d5800ff6a34722d9ccd1ad3713544599d6b60#1    | +     2.00 | [ "Borrower"×1 ]
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =   100.00 |
* 683ac37cb56eb59ad1e8f3eccea1e6bf916d9771d23816c06920e2e9b8d88cdc#0    | +    95.80 | Greatest Pure Ada
* 683ac37cb56eb59ad1e8f3eccea1e6bf916d9771d23816c06920e2e9b8d88cdc#1    | +     2.00 | [ "Guarantor"×1 ]
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =     3.00 |
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#1    | +     3.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     0.00 |

106_guarantor_deposit.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender            100.00
  borrower            100.00
 guarantor   -63.42    36.58
  contract    62.00    65.00
    payout                  
     TOTAL    -1.42   398.36
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =   100.00 |
* 60e01c24abcb2f7a89b09231a4bae27368e06e32abba2fb93ce3bc0e992c1869#0    | +    95.64 | Greatest Pure Ada
* 60e01c24abcb2f7a89b09231a4bae27368e06e32abba2fb93ce3bc0e992c1869#1    | +     2.00 | [ "Lender"×1 ]
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   100.00 |
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* b279357b7974447c35fca9a54b8d5800ff6a34722d9ccd1ad3713544599d6b60#0    | +    95.82 | Greatest Pure Ada
* b279357b7974447c35fca9a54b8d5800ff6a34722d9ccd1ad3713544599d6b60#1    | +     2.00 | [ "Borrower"×1 ]
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    36.58 |
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#0    | +    32.38 | Greatest Pure Ada
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#2    | +     2.00 | [ "Guarantor"×1 ]
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =    65.00 |
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#1    | +    65.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     0.00 |

The marlowe file produced by executing the script.
Note: annotated json (shortened hex-strings, translated posix-time).

{
    "state": {
        "choices": [],
        "boundValues": [],
        "accounts": [
            [
                [
                    {
                        "role_token": "Patron"
                    },
                    {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                ],
                3000000
            ],
            [
                [
                    {
                        "role_token": "Lender"
                    },
                    {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                ],
                62000000
            ]
        ],
        "minTime": 1664125136000 [[2022-09-25 16:58:56 +0000 UTC]]
    },
    "payments": [],
    "contract": {
        "timeout": 1664168914000 [[2022-09-26 05:08:34 +0000 UTC]],
        "when": [
            {
                "then": {
                    "then": {
                        "timeout": 1664172514000 [[2022-09-26 06:08:34 +0000 UTC]],
                        "when": [
                            {
                                "then": {
                                    "then": {
                                        "then": {
                                            "timeout": 1664176114000 [[2022-09-26 07:08:34 +0000 UTC]],
                                            "when": [
                                                {
                                                    "then": {
                                                        "then": {
                                                            "then": {
                                                                "timeout": 1664179714000 [[2022-09-26 08:08:34 +0000 UTC]],
                                                                "when": [
                                                                    {
                                                                        "then": {
                                                                            "then": {
                                                                                "then": "close",
                                                                                "to": {
                                                                                    "party": {
                                                                                        "role_token": "Guarantor"
                                                                                    }
                                                                                },
                                                                                "from_account": {
                                                                                    "role_token": "Lender"
                                                                                },
                                                                                "pay": {
                                                                                    "and": 50000000,
                                                                                    "add": 4000000
                                                                                },
                                                                                "token": {
                                                                                    "currency_symbol": "",
                                                                                    "token_name": ""
                                                                                }
                                                                            },
                                                                            "to": {
                                                                                "party": {
                                                                                    "role_token": "Lender"
                                                                                }
                                                                            },
                                                                            "from_account": {
                                                                                "role_token": "Lender"
                                                                            },
                                                                            "pay": {
                                                                                "and": 50000000,
                                                                                "add": 4000000
                                                                            },
                                                                            "token": {
                                                                                "currency_symbol": "",
                                                                                "token_name": ""
                                                                            }
                                                                        },
                                                                        "case": {
                                                                            "deposits": {
                                                                                "and": 50000000,
                                                                                "add": 4000000
                                                                            },
                                                                            "into_account": {
                                                                                "role_token": "Lender"
                                                                            },
                                                                            "of_token": {
                                                                                "currency_symbol": "",
                                                                                "token_name": ""
                                                                            },
                                                                            "party": {
                                                                                "role_token": "Borrower"
                                                                            }
                                                                        }
                                                                    }
                                                                ],
                                                                "timeout_continuation": "close"
                                                            },
                                                            "to": {
                                                                "party": {
                                                                    "role_token": "Guarantor"
                                                                }
                                                            },
                                                            "from_account": {
                                                                "role_token": "Lender"
                                                            },
                                                            "pay": 4000000,
                                                            "token": {
                                                                "currency_symbol": "",
                                                                "token_name": ""
                                                            }
                                                        },
                                                        "to": {
                                                            "party": {
                                                                "role_token": "Lender"
                                                            }
                                                        },
                                                        "from_account": {
                                                            "role_token": "Lender"
                                                        },
                                                        "pay": 4000000,
                                                        "token": {
                                                            "currency_symbol": "",
                                                            "token_name": ""
                                                        }
                                                    },
                                                    "case": {
                                                        "deposits": 4000000,
                                                        "into_account": {
                                                            "role_token": "Lender"
                                                        },
                                                        "of_token": {
                                                            "currency_symbol": "",
                                                            "token_name": ""
                                                        },
                                                        "party": {
                                                            "role_token": "Borrower"
                                                        }
                                                    }
                                                }
                                            ],
                                            "timeout_continuation": "close"
                                        },
                                        "to": {
                                            "party": {
                                                "role_token": "Guarantor"
                                            }
                                        },
                                        "from_account": {
                                            "role_token": "Lender"
                                        },
                                        "pay": 4000000,
                                        "token": {
                                            "currency_symbol": "",
                                            "token_name": ""
                                        }
                                    },
                                    "to": {
                                        "party": {
                                            "role_token": "Lender"
                                        }
                                    },
                                    "from_account": {
                                        "role_token": "Lender"
                                    },
                                    "pay": 4000000,
                                    "token": {
                                        "currency_symbol": "",
                                        "token_name": ""
                                    }
                                },
                                "case": {
                                    "deposits": 4000000,
                                    "into_account": {
                                        "role_token": "Lender"
                                    },
                                    "of_token": {
                                        "currency_symbol": "",
                                        "token_name": ""
                                    },
                                    "party": {
                                        "role_token": "Borrower"
                                    }
                                }
                            }
                        ],
                        "timeout_continuation": "close"
                    },
                    "to": {
                        "party": {
                            "role_token": "Borrower"
                        }
                    },
                    "from_account": {
                        "role_token": "Borrower"
                    },
                    "pay": 50000000,
                    "token": {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                },
                "case": {
                    "deposits": 50000000,
                    "into_account": {
                        "role_token": "Borrower"
                    },
                    "of_token": {
                        "currency_symbol": "",
                        "token_name": ""
                    },
                    "party": {
                        "role_token": "Lender"
                    }
                }
            }
        ],
        "timeout_continuation": {
            "then": "close",
            "to": {
                "party": {
                    "role_token": "Guarantor"
                }
            },
            "from_account": {
                "role_token": "Lender"
            },
            "pay": {
                "and": 50000000,
                "add": {
                    "multiply": 3,
                    "times": 4000000
                }
            },
            "token": {
                "currency_symbol": "",
                "token_name": ""
            }
        }
    },
    "rolesValidator": {
        "hash": "362efa127d235b77e6c8014d2fef75ca0966a9bf24a17dd7ae605bab",
        "size": 2469,
        "address": "addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk",
        "cost": {
            "exBudgetMemory": 14600,
            "exBudgetCPU": 4317185
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "5909a55909a201000033232332232323⋯⋯₄₉₄₄⋯⋯4811f12d41fada930241e4b8dae90001",
            "description": ""
        }
    },
    "range": [
        14175505,
        14179705
    ],
    "marloweValidator": {
        "hash": "17ba2636fc5becd051e0f9f5e2933f178e6d3a8e526751587ccb6789",
        "size": 12415,
        "address": "addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z",
        "cost": {
            "exBudgetMemory": 82900,
            "exBudgetCPU": 24652144
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "59307f59307c01000033232323322323⋯⋯₂₄₈₃₆⋯⋯41e4b8dae90022123300100300220011",
            "description": ""
        }
    },
    "inputs": [
        {
            "input_from_party": {
                "role_token": "Guarantor"
            },
            "into_account": {
                "role_token": "Lender"
            },
            "of_token": {
                "currency_symbol": "",
                "token_name": ""
            },
            "that_deposits": 62000000
        }
    ],
    "roles": {
        "unCurrencySymbol": "4828cdeadb9049570aa0210824894811f12d41fada930241e4b8dae9"
    },
    "slotConfig": {
        "scSlotLength": 1000,
        "scSlotZeroTime": 1649949631000 [[2022-04-14 15:20:31 +0000 UTC]]
    }
}

108_lender_deposit.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender   -51.56    48.44
  borrower            100.00
 guarantor             36.58
  contract             65.00
    payout    50.00    50.00
     TOTAL    -1.56   396.80
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =    48.44 |
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
* a05e3473b89c41e853d4223442fe3e5a32b161a4ca36f76900dba98fbe5bbccd#0    | +    44.08 | Greatest Pure Ada
* a05e3473b89c41e853d4223442fe3e5a32b161a4ca36f76900dba98fbe5bbccd#3    | +     2.00 | [ "Lender"×1 ]
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   100.00 |
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* b279357b7974447c35fca9a54b8d5800ff6a34722d9ccd1ad3713544599d6b60#0    | +    95.82 | Greatest Pure Ada
* b279357b7974447c35fca9a54b8d5800ff6a34722d9ccd1ad3713544599d6b60#1    | +     2.00 | [ "Borrower"×1 ]
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    36.58 |
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#0    | +    32.38 | Greatest Pure Ada
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#2    | +     2.00 | [ "Guarantor"×1 ]
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =    65.00 |
* a05e3473b89c41e853d4223442fe3e5a32b161a4ca36f76900dba98fbe5bbccd#1    | +    65.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =    50.00 |
* a05e3473b89c41e853d4223442fe3e5a32b161a4ca36f76900dba98fbe5bbccd#2    | +    50.00 | GreatestByTxHavingDatum

The marlowe file produced by executing the script.
Note: annotated json (shortened hex-strings, translated posix-time).

{
    "state": {
        "choices": [],
        "boundValues": [],
        "accounts": [
            [
                [
                    {
                        "role_token": "Patron"
                    },
                    {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                ],
                3000000
            ],
            [
                [
                    {
                        "role_token": "Lender"
                    },
                    {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                ],
                62000000
            ]
        ],
        "minTime": 1664125153000 [[2022-09-25 16:59:13 +0000 UTC]]
    },
    "payments": [
        {
            "payee": {
                "party": {
                    "role_token": "Borrower"
                }
            },
            "accountId": {
                "role_token": "Borrower"
            },
            "money": {
                "getValue": [
                    [
                        {
                            "unCurrencySymbol": ""
                        },
                        [
                            [
                                {
                                    "unTokenName": ""
                                },
                                50000000
                            ]
                        ]
                    ]
                ]
            }
        }
    ],
    "contract": {
        "timeout": 1664172514000 [[2022-09-26 06:08:34 +0000 UTC]],
        "when": [
            {
                "then": {
                    "then": {
                        "then": {
                            "timeout": 1664176114000 [[2022-09-26 07:08:34 +0000 UTC]],
                            "when": [
                                {
                                    "then": {
                                        "then": {
                                            "then": {
                                                "timeout": 1664179714000 [[2022-09-26 08:08:34 +0000 UTC]],
                                                "when": [
                                                    {
                                                        "then": {
                                                            "then": {
                                                                "then": "close",
                                                                "to": {
                                                                    "party": {
                                                                        "role_token": "Guarantor"
                                                                    }
                                                                },
                                                                "from_account": {
                                                                    "role_token": "Lender"
                                                                },
                                                                "pay": {
                                                                    "and": 50000000,
                                                                    "add": 4000000
                                                                },
                                                                "token": {
                                                                    "currency_symbol": "",
                                                                    "token_name": ""
                                                                }
                                                            },
                                                            "to": {
                                                                "party": {
                                                                    "role_token": "Lender"
                                                                }
                                                            },
                                                            "from_account": {
                                                                "role_token": "Lender"
                                                            },
                                                            "pay": {
                                                                "and": 50000000,
                                                                "add": 4000000
                                                            },
                                                            "token": {
                                                                "currency_symbol": "",
                                                                "token_name": ""
                                                            }
                                                        },
                                                        "case": {
                                                            "deposits": {
                                                                "and": 50000000,
                                                                "add": 4000000
                                                            },
                                                            "into_account": {
                                                                "role_token": "Lender"
                                                            },
                                                            "of_token": {
                                                                "currency_symbol": "",
                                                                "token_name": ""
                                                            },
                                                            "party": {
                                                                "role_token": "Borrower"
                                                            }
                                                        }
                                                    }
                                                ],
                                                "timeout_continuation": "close"
                                            },
                                            "to": {
                                                "party": {
                                                    "role_token": "Guarantor"
                                                }
                                            },
                                            "from_account": {
                                                "role_token": "Lender"
                                            },
                                            "pay": 4000000,
                                            "token": {
                                                "currency_symbol": "",
                                                "token_name": ""
                                            }
                                        },
                                        "to": {
                                            "party": {
                                                "role_token": "Lender"
                                            }
                                        },
                                        "from_account": {
                                            "role_token": "Lender"
                                        },
                                        "pay": 4000000,
                                        "token": {
                                            "currency_symbol": "",
                                            "token_name": ""
                                        }
                                    },
                                    "case": {
                                        "deposits": 4000000,
                                        "into_account": {
                                            "role_token": "Lender"
                                        },
                                        "of_token": {
                                            "currency_symbol": "",
                                            "token_name": ""
                                        },
                                        "party": {
                                            "role_token": "Borrower"
                                        }
                                    }
                                }
                            ],
                            "timeout_continuation": "close"
                        },
                        "to": {
                            "party": {
                                "role_token": "Guarantor"
                            }
                        },
                        "from_account": {
                            "role_token": "Lender"
                        },
                        "pay": 4000000,
                        "token": {
                            "currency_symbol": "",
                            "token_name": ""
                        }
                    },
                    "to": {
                        "party": {
                            "role_token": "Lender"
                        }
                    },
                    "from_account": {
                        "role_token": "Lender"
                    },
                    "pay": 4000000,
                    "token": {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                },
                "case": {
                    "deposits": 4000000,
                    "into_account": {
                        "role_token": "Lender"
                    },
                    "of_token": {
                        "currency_symbol": "",
                        "token_name": ""
                    },
                    "party": {
                        "role_token": "Borrower"
                    }
                }
            }
        ],
        "timeout_continuation": "close"
    },
    "rolesValidator": {
        "hash": "362efa127d235b77e6c8014d2fef75ca0966a9bf24a17dd7ae605bab",
        "size": 2469,
        "address": "addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk",
        "cost": {
            "exBudgetMemory": 14600,
            "exBudgetCPU": 4317185
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "5909a55909a201000033232332232323⋯⋯₄₉₄₄⋯⋯4811f12d41fada930241e4b8dae90001",
            "description": ""
        }
    },
    "range": [
        14175522,
        14179722
    ],
    "marloweValidator": {
        "hash": "17ba2636fc5becd051e0f9f5e2933f178e6d3a8e526751587ccb6789",
        "size": 12415,
        "address": "addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z",
        "cost": {
            "exBudgetMemory": 82900,
            "exBudgetCPU": 24652144
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "59307f59307c01000033232323322323⋯⋯₂₄₈₃₆⋯⋯41e4b8dae90022123300100300220011",
            "description": ""
        }
    },
    "inputs": [
        {
            "input_from_party": {
                "role_token": "Lender"
            },
            "into_account": {
                "role_token": "Borrower"
            },
            "of_token": {
                "currency_symbol": "",
                "token_name": ""
            },
            "that_deposits": 50000000
        }
    ],
    "roles": {
        "unCurrencySymbol": "4828cdeadb9049570aa0210824894811f12d41fada930241e4b8dae9"
    },
    "slotConfig": {
        "scSlotLength": 1000,
        "scSlotZeroTime": 1649949631000 [[2022-04-14 15:20:31 +0000 UTC]]
    }
}

110_borrower_withdraws.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender             48.44
  borrower    49.57   149.57
 guarantor             36.58
  contract             65.00
    payout   -50.00         
     TOTAL    -0.43   396.37
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =    48.44 |
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
* a05e3473b89c41e853d4223442fe3e5a32b161a4ca36f76900dba98fbe5bbccd#0    | +    44.08 | Greatest Pure Ada
* a05e3473b89c41e853d4223442fe3e5a32b161a4ca36f76900dba98fbe5bbccd#3    | +     2.00 | [ "Lender"×1 ]
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   149.57 |
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* 96bb4966f5000fe0849e2f583002893e156323060fa5a14ee5ec11f10308265f#0    | +    95.39 | Greatest Pure Ada
* 96bb4966f5000fe0849e2f583002893e156323060fa5a14ee5ec11f10308265f#1    | +    50.00 | Pure Ada
* 96bb4966f5000fe0849e2f583002893e156323060fa5a14ee5ec11f10308265f#2    | +     2.00 | [ "Borrower"×1 ]
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    36.58 |
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#0    | +    32.38 | Greatest Pure Ada
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#2    | +     2.00 | [ "Guarantor"×1 ]
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =    65.00 |
* a05e3473b89c41e853d4223442fe3e5a32b161a4ca36f76900dba98fbe5bbccd#1    | +    65.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     0.00 |

202_borrower_pays_installment1.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender             48.44
  borrower    -5.69   143.89
 guarantor             36.58
  contract    -4.00    61.00
    payout     8.00     8.00
     TOTAL    -1.69   394.69
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =    48.44 |
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
* a05e3473b89c41e853d4223442fe3e5a32b161a4ca36f76900dba98fbe5bbccd#0    | +    44.08 | Greatest Pure Ada
* a05e3473b89c41e853d4223442fe3e5a32b161a4ca36f76900dba98fbe5bbccd#3    | +     2.00 | [ "Lender"×1 ]
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   143.89 |
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#0    | +    89.70 | Greatest Pure Ada
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#4    | +     2.00 | [ "Borrower"×1 ]
* 96bb4966f5000fe0849e2f583002893e156323060fa5a14ee5ec11f10308265f#1    | +    50.00 | Pure Ada
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    36.58 |
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#0    | +    32.38 | Greatest Pure Ada
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#2    | +     2.00 | [ "Guarantor"×1 ]
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =    61.00 |
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#1    | +    61.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     8.00 |
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#2    | +     4.00 | GreatestByTxHavingDatum
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#3    | +     4.00 | Datum

The marlowe file produced by executing the script.
Note: annotated json (shortened hex-strings, translated posix-time).

{
    "state": {
        "choices": [],
        "boundValues": [],
        "accounts": [
            [
                [
                    {
                        "role_token": "Patron"
                    },
                    {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                ],
                3000000
            ],
            [
                [
                    {
                        "role_token": "Lender"
                    },
                    {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                ],
                58000000
            ]
        ],
        "minTime": 1664125245000 [[2022-09-25 17:00:45 +0000 UTC]]
    },
    "payments": [
        {
            "payee": {
                "party": {
                    "role_token": "Lender"
                }
            },
            "accountId": {
                "role_token": "Lender"
            },
            "money": {
                "getValue": [
                    [
                        {
                            "unCurrencySymbol": ""
                        },
                        [
                            [
                                {
                                    "unTokenName": ""
                                },
                                4000000
                            ]
                        ]
                    ]
                ]
            }
        },
        {
            "payee": {
                "party": {
                    "role_token": "Guarantor"
                }
            },
            "accountId": {
                "role_token": "Lender"
            },
            "money": {
                "getValue": [
                    [
                        {
                            "unCurrencySymbol": ""
                        },
                        [
                            [
                                {
                                    "unTokenName": ""
                                },
                                4000000
                            ]
                        ]
                    ]
                ]
            }
        }
    ],
    "contract": {
        "timeout": 1664176114000 [[2022-09-26 07:08:34 +0000 UTC]],
        "when": [
            {
                "then": {
                    "then": {
                        "then": {
                            "timeout": 1664179714000 [[2022-09-26 08:08:34 +0000 UTC]],
                            "when": [
                                {
                                    "then": {
                                        "then": {
                                            "then": "close",
                                            "to": {
                                                "party": {
                                                    "role_token": "Guarantor"
                                                }
                                            },
                                            "from_account": {
                                                "role_token": "Lender"
                                            },
                                            "pay": {
                                                "and": 50000000,
                                                "add": 4000000
                                            },
                                            "token": {
                                                "currency_symbol": "",
                                                "token_name": ""
                                            }
                                        },
                                        "to": {
                                            "party": {
                                                "role_token": "Lender"
                                            }
                                        },
                                        "from_account": {
                                            "role_token": "Lender"
                                        },
                                        "pay": {
                                            "and": 50000000,
                                            "add": 4000000
                                        },
                                        "token": {
                                            "currency_symbol": "",
                                            "token_name": ""
                                        }
                                    },
                                    "case": {
                                        "deposits": {
                                            "and": 50000000,
                                            "add": 4000000
                                        },
                                        "into_account": {
                                            "role_token": "Lender"
                                        },
                                        "of_token": {
                                            "currency_symbol": "",
                                            "token_name": ""
                                        },
                                        "party": {
                                            "role_token": "Borrower"
                                        }
                                    }
                                }
                            ],
                            "timeout_continuation": "close"
                        },
                        "to": {
                            "party": {
                                "role_token": "Guarantor"
                            }
                        },
                        "from_account": {
                            "role_token": "Lender"
                        },
                        "pay": 4000000,
                        "token": {
                            "currency_symbol": "",
                            "token_name": ""
                        }
                    },
                    "to": {
                        "party": {
                            "role_token": "Lender"
                        }
                    },
                    "from_account": {
                        "role_token": "Lender"
                    },
                    "pay": 4000000,
                    "token": {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                },
                "case": {
                    "deposits": 4000000,
                    "into_account": {
                        "role_token": "Lender"
                    },
                    "of_token": {
                        "currency_symbol": "",
                        "token_name": ""
                    },
                    "party": {
                        "role_token": "Borrower"
                    }
                }
            }
        ],
        "timeout_continuation": "close"
    },
    "rolesValidator": {
        "hash": "362efa127d235b77e6c8014d2fef75ca0966a9bf24a17dd7ae605bab",
        "size": 2469,
        "address": "addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk",
        "cost": {
            "exBudgetMemory": 14600,
            "exBudgetCPU": 4317185
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "5909a55909a201000033232332232323⋯⋯₄₉₄₄⋯⋯4811f12d41fada930241e4b8dae90001",
            "description": ""
        }
    },
    "range": [
        14175614,
        14179814
    ],
    "marloweValidator": {
        "hash": "17ba2636fc5becd051e0f9f5e2933f178e6d3a8e526751587ccb6789",
        "size": 12415,
        "address": "addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z",
        "cost": {
            "exBudgetMemory": 82900,
            "exBudgetCPU": 24652144
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "59307f59307c01000033232323322323⋯⋯₂₄₈₃₆⋯⋯41e4b8dae90022123300100300220011",
            "description": ""
        }
    },
    "inputs": [
        {
            "input_from_party": {
                "role_token": "Borrower"
            },
            "into_account": {
                "role_token": "Lender"
            },
            "of_token": {
                "currency_symbol": "",
                "token_name": ""
            },
            "that_deposits": 4000000
        }
    ],
    "roles": {
        "unCurrencySymbol": "4828cdeadb9049570aa0210824894811f12d41fada930241e4b8dae9"
    },
    "slotConfig": {
        "scSlotLength": 1000,
        "scSlotZeroTime": 1649949631000 [[2022-04-14 15:20:31 +0000 UTC]]
    }
}

204_lender_withdraws.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender     3.57    52.01
  borrower            143.89
 guarantor             36.58
  contract             61.00
    payout    -4.00     4.00
     TOTAL    -0.43   394.26
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =    52.01 |
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#0    | +    43.65 | Greatest Pure Ada
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#1    | +     4.00 | Pure Ada
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#2    | +     2.00 | [ "Lender"×1 ]
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   143.89 |
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#0    | +    89.70 | Greatest Pure Ada
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#4    | +     2.00 | [ "Borrower"×1 ]
* 96bb4966f5000fe0849e2f583002893e156323060fa5a14ee5ec11f10308265f#1    | +    50.00 | Pure Ada
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    36.58 |
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#0    | +    32.38 | Greatest Pure Ada
* 4ae99facb1984fbb928102cadd1954db1f6c82c927a3a6c7d097d9933dfbf6b0#2    | +     2.00 | [ "Guarantor"×1 ]
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =    61.00 |
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#1    | +    61.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     4.00 |
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#3    | +     4.00 | GreatestByTxHavingDatum

206_guarantor_withdraws.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender             52.01
  borrower            143.89
 guarantor     3.58    40.15
  contract             61.00
    payout    -4.00         
     TOTAL    -0.42   393.84
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =    52.01 |
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#0    | +    43.65 | Greatest Pure Ada
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#1    | +     4.00 | Pure Ada
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#2    | +     2.00 | [ "Lender"×1 ]
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   143.89 |
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#0    | +    89.70 | Greatest Pure Ada
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#4    | +     2.00 | [ "Borrower"×1 ]
* 96bb4966f5000fe0849e2f583002893e156323060fa5a14ee5ec11f10308265f#1    | +    50.00 | Pure Ada
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    40.15 |
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#0    | +    31.95 | Greatest Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#1    | +     4.00 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#2    | +     2.00 | [ "Guarantor"×1 ]
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =    61.00 |
* 708423dca7a87a81a07e3be9dc0c3e8eb27753019a1efa1e2ec5f25d46179740#1    | +    61.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     0.00 |

302_borrower_pays_installment2.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender             52.01
  borrower    -5.65   138.24
 guarantor             40.15
  contract    -4.00    57.00
    payout     8.00     8.00
     TOTAL    -1.65   392.19
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =    52.01 |
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#0    | +    43.65 | Greatest Pure Ada
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#1    | +     4.00 | Pure Ada
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#2    | +     2.00 | [ "Lender"×1 ]
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   138.24 |
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#0    | +    84.06 | Greatest Pure Ada
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#4    | +     2.00 | [ "Borrower"×1 ]
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* 96bb4966f5000fe0849e2f583002893e156323060fa5a14ee5ec11f10308265f#1    | +    50.00 | Pure Ada
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    40.15 |
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#0    | +    31.95 | Greatest Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#1    | +     4.00 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#2    | +     2.00 | [ "Guarantor"×1 ]
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =    57.00 |
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#1    | +    57.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     8.00 |
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#2    | +     4.00 | GreatestByTxHavingDatum
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#3    | +     4.00 | Datum

The marlowe file produced by executing the script.
Note: annotated json (shortened hex-strings, translated posix-time).

{
    "state": {
        "choices": [],
        "boundValues": [],
        "accounts": [
            [
                [
                    {
                        "role_token": "Patron"
                    },
                    {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                ],
                3000000
            ],
            [
                [
                    {
                        "role_token": "Lender"
                    },
                    {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                ],
                54000000
            ]
        ],
        "minTime": 1664125414000 [[2022-09-25 17:03:34 +0000 UTC]]
    },
    "payments": [
        {
            "payee": {
                "party": {
                    "role_token": "Lender"
                }
            },
            "accountId": {
                "role_token": "Lender"
            },
            "money": {
                "getValue": [
                    [
                        {
                            "unCurrencySymbol": ""
                        },
                        [
                            [
                                {
                                    "unTokenName": ""
                                },
                                4000000
                            ]
                        ]
                    ]
                ]
            }
        },
        {
            "payee": {
                "party": {
                    "role_token": "Guarantor"
                }
            },
            "accountId": {
                "role_token": "Lender"
            },
            "money": {
                "getValue": [
                    [
                        {
                            "unCurrencySymbol": ""
                        },
                        [
                            [
                                {
                                    "unTokenName": ""
                                },
                                4000000
                            ]
                        ]
                    ]
                ]
            }
        }
    ],
    "contract": {
        "timeout": 1664179714000 [[2022-09-26 08:08:34 +0000 UTC]],
        "when": [
            {
                "then": {
                    "then": {
                        "then": "close",
                        "to": {
                            "party": {
                                "role_token": "Guarantor"
                            }
                        },
                        "from_account": {
                            "role_token": "Lender"
                        },
                        "pay": {
                            "and": 50000000,
                            "add": 4000000
                        },
                        "token": {
                            "currency_symbol": "",
                            "token_name": ""
                        }
                    },
                    "to": {
                        "party": {
                            "role_token": "Lender"
                        }
                    },
                    "from_account": {
                        "role_token": "Lender"
                    },
                    "pay": {
                        "and": 50000000,
                        "add": 4000000
                    },
                    "token": {
                        "currency_symbol": "",
                        "token_name": ""
                    }
                },
                "case": {
                    "deposits": {
                        "and": 50000000,
                        "add": 4000000
                    },
                    "into_account": {
                        "role_token": "Lender"
                    },
                    "of_token": {
                        "currency_symbol": "",
                        "token_name": ""
                    },
                    "party": {
                        "role_token": "Borrower"
                    }
                }
            }
        ],
        "timeout_continuation": "close"
    },
    "rolesValidator": {
        "hash": "362efa127d235b77e6c8014d2fef75ca0966a9bf24a17dd7ae605bab",
        "size": 2469,
        "address": "addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk",
        "cost": {
            "exBudgetMemory": 14600,
            "exBudgetCPU": 4317185
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "5909a55909a201000033232332232323⋯⋯₄₉₄₄⋯⋯4811f12d41fada930241e4b8dae90001",
            "description": ""
        }
    },
    "range": [
        14175783,
        14179983
    ],
    "marloweValidator": {
        "hash": "17ba2636fc5becd051e0f9f5e2933f178e6d3a8e526751587ccb6789",
        "size": 12415,
        "address": "addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z",
        "cost": {
            "exBudgetMemory": 82900,
            "exBudgetCPU": 24652144
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "59307f59307c01000033232323322323⋯⋯₂₄₈₃₆⋯⋯41e4b8dae90022123300100300220011",
            "description": ""
        }
    },
    "inputs": [
        {
            "input_from_party": {
                "role_token": "Borrower"
            },
            "into_account": {
                "role_token": "Lender"
            },
            "of_token": {
                "currency_symbol": "",
                "token_name": ""
            },
            "that_deposits": 4000000
        }
    ],
    "roles": {
        "unCurrencySymbol": "4828cdeadb9049570aa0210824894811f12d41fada930241e4b8dae9"
    },
    "slotConfig": {
        "scSlotLength": 1000,
        "scSlotZeroTime": 1649949631000 [[2022-04-14 15:20:31 +0000 UTC]]
    }
}

304_lender_withdraws.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender     3.57    55.58
  borrower            138.24
 guarantor             40.15
  contract             57.00
    payout    -4.00     4.00
     TOTAL    -0.43   391.76
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =    55.58 |
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#0    | +    43.22 | Greatest Pure Ada
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#1    | +     4.00 | Pure Ada
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#2    | +     2.00 | [ "Lender"×1 ]
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#1    | +     4.00 | Pure Ada
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   138.24 |
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#0    | +    84.06 | Greatest Pure Ada
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#4    | +     2.00 | [ "Borrower"×1 ]
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* 96bb4966f5000fe0849e2f583002893e156323060fa5a14ee5ec11f10308265f#1    | +    50.00 | Pure Ada
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    40.15 |
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#0    | +    31.95 | Greatest Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#1    | +     4.00 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#2    | +     2.00 | [ "Guarantor"×1 ]
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =    57.00 |
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#1    | +    57.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     4.00 |
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#3    | +     4.00 | GreatestByTxHavingDatum

306_guarantor_withdraws.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender             55.58
  borrower            138.24
 guarantor     3.57    43.73
  contract             57.00
    payout    -4.00         
     TOTAL    -0.43   391.34
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =    55.58 |
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#0    | +    43.22 | Greatest Pure Ada
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#1    | +     4.00 | Pure Ada
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#2    | +     2.00 | [ "Lender"×1 ]
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#1    | +     4.00 | Pure Ada
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =   138.24 |
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#0    | +    84.06 | Greatest Pure Ada
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#4    | +     2.00 | [ "Borrower"×1 ]
* 68b4d6f5ebd4d449c9288ffd6e3e7e6bd9415b19064672931a381b4ecb7d3908#1    | +     2.18 | Pure Ada
* 96bb4966f5000fe0849e2f583002893e156323060fa5a14ee5ec11f10308265f#1    | +    50.00 | Pure Ada
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    43.73 |
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#0    | +    31.53 | Greatest Pure Ada
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#1    | +     4.00 | Pure Ada
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#2    | +     2.00 | [ "Guarantor"×1 ]
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#1    | +     4.00 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =    57.00 |
* 1f522c10d3fb9ad708c899c68fc476313864cef82ab261a0d7dcab770d82b1cc#1    | +    57.00 | GreatestByTxHavingDatum
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     0.00 |

402_borrower_pays_installment3.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender             55.58
  borrower   -55.48    82.76
 guarantor             43.73
  contract   -57.00         
    payout   111.00   111.00
     TOTAL    -1.48   389.86
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =    55.58 |
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#0    | +    43.22 | Greatest Pure Ada
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#1    | +     4.00 | Pure Ada
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#2    | +     2.00 | [ "Lender"×1 ]
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#1    | +     4.00 | Pure Ada
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =    82.76 |
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#0    | +    80.76 | Greatest Pure Ada
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#4    | +     2.00 | [ "Borrower"×1 ]
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    43.73 |
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#0    | +    31.53 | Greatest Pure Ada
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#1    | +     4.00 | Pure Ada
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#2    | +     2.00 | [ "Guarantor"×1 ]
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#1    | +     4.00 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =     0.00 |
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =   111.00 |
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#1    | +    54.00 | GreatestByTxHavingDatum
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#2    | +    54.00 | Datum
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#3    | +     3.00 | Datum

The marlowe file produced by executing the script.
Note: annotated json (shortened hex-strings, translated posix-time).

{
    "state": {
        "choices": [],
        "boundValues": [],
        "accounts": [],
        "minTime": 1664125572000 [[2022-09-25 17:06:12 +0000 UTC]]
    },
    "payments": [
        {
            "payee": {
                "party": {
                    "role_token": "Lender"
                }
            },
            "accountId": {
                "role_token": "Lender"
            },
            "money": {
                "getValue": [
                    [
                        {
                            "unCurrencySymbol": ""
                        },
                        [
                            [
                                {
                                    "unTokenName": ""
                                },
                                54000000
                            ]
                        ]
                    ]
                ]
            }
        },
        {
            "payee": {
                "party": {
                    "role_token": "Guarantor"
                }
            },
            "accountId": {
                "role_token": "Lender"
            },
            "money": {
                "getValue": [
                    [
                        {
                            "unCurrencySymbol": ""
                        },
                        [
                            [
                                {
                                    "unTokenName": ""
                                },
                                54000000
                            ]
                        ]
                    ]
                ]
            }
        },
        {
            "payee": {
                "party": {
                    "role_token": "Patron"
                }
            },
            "accountId": {
                "role_token": "Patron"
            },
            "money": {
                "getValue": [
                    [
                        {
                            "unCurrencySymbol": ""
                        },
                        [
                            [
                                {
                                    "unTokenName": ""
                                },
                                3000000
                            ]
                        ]
                    ]
                ]
            }
        }
    ],
    "contract": "close",
    "rolesValidator": {
        "hash": "362efa127d235b77e6c8014d2fef75ca0966a9bf24a17dd7ae605bab",
        "size": 2469,
        "address": "addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk",
        "cost": {
            "exBudgetMemory": 14600,
            "exBudgetCPU": 4317185
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "5909a55909a201000033232332232323⋯⋯₄₉₄₄⋯⋯4811f12d41fada930241e4b8dae90001",
            "description": ""
        }
    },
    "range": [
        14175941,
        14180141
    ],
    "marloweValidator": {
        "hash": "17ba2636fc5becd051e0f9f5e2933f178e6d3a8e526751587ccb6789",
        "size": 12415,
        "address": "addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z",
        "cost": {
            "exBudgetMemory": 82900,
            "exBudgetCPU": 24652144
        },
        "script": {
            "type": "PlutusScriptV1",
            "cborHex": "59307f59307c01000033232323322323⋯⋯₂₄₈₃₆⋯⋯41e4b8dae90022123300100300220011",
            "description": ""
        }
    },
    "inputs": [
        {
            "input_from_party": {
                "role_token": "Borrower"
            },
            "into_account": {
                "role_token": "Lender"
            },
            "of_token": {
                "currency_symbol": "",
                "token_name": ""
            },
            "that_deposits": 54000000
        }
    ],
    "roles": {
        "unCurrencySymbol": "4828cdeadb9049570aa0210824894811f12d41fada930241e4b8dae9"
    },
    "slotConfig": {
        "scSlotLength": 1000,
        "scSlotZeroTime": 1649949631000 [[2022-04-14 15:20:31 +0000 UTC]]
    }
}

404_lender_withdraws.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender    53.58   109.16
  borrower             82.76
 guarantor             43.73
  contract                  
    payout   -54.00    57.00
     TOTAL    -0.42   389.44
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =   109.16 |
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#1    | +     4.00 | Pure Ada
* 5a56af71544e7231e3ebdd6ad25dbabab3c1c8e2660f390f1c4533121910857c#0    | +    42.80 | Pure Ada
* 5a56af71544e7231e3ebdd6ad25dbabab3c1c8e2660f390f1c4533121910857c#1    | +    54.00 | Greatest Pure Ada
* 5a56af71544e7231e3ebdd6ad25dbabab3c1c8e2660f390f1c4533121910857c#2    | +     2.00 | [ "Lender"×1 ]
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#1    | +     4.00 | Pure Ada
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =    82.76 |
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#0    | +    80.76 | Greatest Pure Ada
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#4    | +     2.00 | [ "Borrower"×1 ]
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    43.73 |
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#0    | +    31.53 | Greatest Pure Ada
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#1    | +     4.00 | Pure Ada
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#2    | +     2.00 | [ "Guarantor"×1 ]
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#1    | +     4.00 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =     0.00 |
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =    57.00 |
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#2    | +    54.00 | GreatestByTxHavingDatum
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#3    | +     3.00 | Datum

406_guarantor_withdraws.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron             96.79
    lender            109.16
  borrower             82.76
 guarantor    53.58    97.30
  contract                  
    payout   -54.00     3.00
     TOTAL    -0.42   389.01
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    96.79 |
* 321739a651fd05ee74d9586698c441543c2abbac00e3fe80855de60872d88955#1    | +     2.00 | [ "Patron"×1 ]
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* f268ad03c96e5f48a942e5053dfb3a88f828976381a8c58777797b1f73419862#0    | +    92.69 | Greatest Pure Ada
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =   109.16 |
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#1    | +     4.00 | Pure Ada
* 5a56af71544e7231e3ebdd6ad25dbabab3c1c8e2660f390f1c4533121910857c#0    | +    42.80 | Pure Ada
* 5a56af71544e7231e3ebdd6ad25dbabab3c1c8e2660f390f1c4533121910857c#1    | +    54.00 | Greatest Pure Ada
* 5a56af71544e7231e3ebdd6ad25dbabab3c1c8e2660f390f1c4533121910857c#2    | +     2.00 | [ "Lender"×1 ]
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#1    | +     4.00 | Pure Ada
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =    82.76 |
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#0    | +    80.76 | Greatest Pure Ada
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#4    | +     2.00 | [ "Borrower"×1 ]
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    97.30 |
* 78dc5bfbc7d1005d4355ba23d313a102513cbd7ad36de8f90203f43d2626589e#0    | +    31.10 | Pure Ada
* 78dc5bfbc7d1005d4355ba23d313a102513cbd7ad36de8f90203f43d2626589e#1    | +    54.00 | Greatest Pure Ada
* 78dc5bfbc7d1005d4355ba23d313a102513cbd7ad36de8f90203f43d2626589e#2    | +     2.00 | [ "Guarantor"×1 ]
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#1    | +     4.00 | Pure Ada
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#1    | +     4.00 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =     0.00 |
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     3.00 |
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#3    | +     3.00 | GreatestByTxHavingDatum

408_patron_withdraws.sh

Output of the script:

The balance after the script run:


==============================
     ALIAS   CHANGE  BALANCE
    patron     2.58    99.37
    lender            109.16
  borrower             82.76
 guarantor             97.30
  contract                  
    payout    -3.00         
     TOTAL    -0.42   388.60
==============================

Snapshot taken after the script run:


--- patron       -----------------------------------------------------------------------------------------------
addr_test1vzynpzgnuws0ghj3n5rwpr8jwd352ralu28pqaglccvatnc0rpe69         | =    99.37 |
* 38ddae21df5d7ab3995254956d0b9ad86fd38f41dc597c415a84c0e07e718237#1    | +     2.10 | Pure Ada
* 8984969342e4d96ba7138feac510953a2206ebf5f580440ecb06bdc23c491f02#0    | +    92.27 | Greatest Pure Ada
* 8984969342e4d96ba7138feac510953a2206ebf5f580440ecb06bdc23c491f02#1    | +     3.00 | Pure Ada
* 8984969342e4d96ba7138feac510953a2206ebf5f580440ecb06bdc23c491f02#2    | +     2.00 | [ "Patron"×1 ]
--- lender       -----------------------------------------------------------------------------------------------
addr_test1vpup4jzflgrml95vlq39ajczpgt30a3aa8q039vg7g82uyc3ajcls         | =   109.16 |
* 1f62ab87a269b060b9e667d125f483ee6cad0a6db5e8262921e751c4d5a36bc4#1    | +     4.00 | Pure Ada
* 5a56af71544e7231e3ebdd6ad25dbabab3c1c8e2660f390f1c4533121910857c#0    | +    42.80 | Pure Ada
* 5a56af71544e7231e3ebdd6ad25dbabab3c1c8e2660f390f1c4533121910857c#1    | +    54.00 | Greatest Pure Ada
* 5a56af71544e7231e3ebdd6ad25dbabab3c1c8e2660f390f1c4533121910857c#2    | +     2.00 | [ "Lender"×1 ]
* 62a6ea0549dd8f92f8e825b87f5643f2da4a5c9fcc4962c78afe093e14ff1be3#1    | +     4.00 | Pure Ada
* 95c5190b1e9c4a796ccefc562be9f762c2e9572c39d1828f91a1242e0e1ebccb#1    | +     2.36 | Pure Ada
--- borrower     -----------------------------------------------------------------------------------------------
addr_test1vqt83wtgcxpx3sje6uf5m9ydv4nw9fep8358axj769ca0aq4qg082         | =    82.76 |
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#0    | +    80.76 | Greatest Pure Ada
* c4608e0a1c067270956941e4843b6510b1beeb651e0aa7d883a661addf2a1b1b#4    | +     2.00 | [ "Borrower"×1 ]
--- guarantor    -----------------------------------------------------------------------------------------------
addr_test1vzxlp4nzmnj7408jlx7dkpr36cg5aaynccrhan5c6cks2rsautf9z         | =    97.30 |
* 78dc5bfbc7d1005d4355ba23d313a102513cbd7ad36de8f90203f43d2626589e#0    | +    31.10 | Pure Ada
* 78dc5bfbc7d1005d4355ba23d313a102513cbd7ad36de8f90203f43d2626589e#1    | +    54.00 | Greatest Pure Ada
* 78dc5bfbc7d1005d4355ba23d313a102513cbd7ad36de8f90203f43d2626589e#2    | +     2.00 | [ "Guarantor"×1 ]
* 9ead2a35bd2ba59002dc0b5b357d5e8646d3df95943669600f37146842e9849f#1    | +     4.00 | Pure Ada
* a449195b936d2681702af2a6b47bc41dd76e9e18de89e7cc21350bb7a5400d1f#1    | +     2.20 | Pure Ada
* c77f3c54f9cf48f443a73605d197f9bef9378b75860e0b35a9515f67f66c7322#1    | +     4.00 | Pure Ada
--- contract     -----------------------------------------------------------------------------------------------
addr_test1wqtm5f3kl3d7e5z3urultc5n8utcumf63efxw52c0n9k0zggzqx9z         | =     0.00 |
--- payout       -----------------------------------------------------------------------------------------------
addr_test1wqmza7sj0534kalxeqq56tl0wh9qje4fhuj2zlwh4es9h2c5gu5vk         | =     0.00 |
 
Notes by wmoco. Generated on momo:/home/willem/sync/20220806_wmoco_pubcoms/20220806_marlowe_pioneer at 2023-06-14 18:32