contracts

Package contracts

Types

Cash class Cash : Contract

A cash transaction may split and merge money represented by a set of (issuer, depositRef) pairs, across multiple input and output states. Imagine a Bitcoin transaction but in which all UTXOs had a colour (a blend of issuer+depositRef) and you couldnt merge outputs of two colours together, but you COULD put them in the same transaction.

CommercialPaper class CommercialPaper : Contract
CrowdFund class CrowdFund : Contract

This is a basic crowd funding contract. It allows a party to create a funding opportunity, then for others to pledge during the funding period , and then for the party to either accept the funding (if the target has been reached) return the funds to the pledge-makers (if the target has not been reached).

DummyContract class DummyContract : Contract

Exceptions

InsufficientBalanceException class InsufficientBalanceException : Exception

Extensions for External Classes

kotlin.collections.Iterable

Properties

CASH_PROGRAM_ID val CASH_PROGRAM_ID: <ERROR CLASS>
CP_PROGRAM_ID val CP_PROGRAM_ID: <ERROR CLASS>

This is an ultra-trivial implementation of commercial paper, which is essentially a simpler version of a corporate bond. It can be seen as a company-specific currency. A company issues CP with a particular face value, say $100, but sells it for less, say $90. The paper can be redeemed for cash at a given date in the future. Thus this example would have a 10% interest rate with a single repayment. Commercial paper is often rolled over (the maturity date is adjusted as if the paper was redeemed and immediately repurchased, but without having to front the cash).

CROWDFUND_PROGRAM_ID val CROWDFUND_PROGRAM_ID: <ERROR CLASS>
DUMMY_PROGRAM_ID val DUMMY_PROGRAM_ID: <ERROR CLASS>