com.r3corda.contracts.asset / FungibleAsset

FungibleAsset

abstract class FungibleAsset<T> : Contract

Superclass for contracts representing assets which are fungible, countable and issued by a specific party. States contain assets which are equivalent (such as cash of the same currency), so records of their existence can be merged or split as needed where the issuer is the same. For instance, dollars issued by the Fed are fungible and countable (in cents), barrels of West Texas crude are fungible and countable (oil from two small containers can be poured into one large container), shares of the same class in a specific company are fungible and countable, and so on.

See Cash for an example subclass that implements currency.



Parameters

T - a type that represents the asset in question. This should describe the basic type of the asset (GBP, USD, oil, shares in company , etc.) and any additional metadata (issuer, grade, class, etc.)


Types

Commands interface Commands : CommandData
State interface State<T> : FungibleAssetState<T, AssetIssuanceDefinition<T>>

A state representing a claim against some party

Constructors

<init> FungibleAsset()

Superclass for contracts representing assets which are fungible, countable and issued by a specific party. States contain assets which are equivalent (such as cash of the same currency), so records of their existence can be merged or split as needed where the issuer is the same. For instance, dollars issued by the Fed are fungible and countable (in cents), barrels of West Texas crude are fungible and countable (oil from two small containers can be poured into one large container), shares of the same class in a specific company are fungible and countable, and so on.

Inherited Properties

legalContractReference abstract val legalContractReference: SecureHash

Unparsed reference to the natural language contract that this code is supposed to express (usually a hash of the contracts contents).

Functions

verify open fun verify(tx: TransactionForVerification): Unit

This is the function EVERYONE runs

Inheritors

Cash class Cash : FungibleAsset<Currency>

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.