com.r3corda.contracts.clause / AbstractIssue

AbstractIssue

abstract class AbstractIssue<in S : ContractState, C : CommandData, T : Any> : ConcreteClause<S, C, Issued<T>>

Standard issue clause for contracts that issue fungible assets.

Parameters

S - the type of contract state which is being issued.

T - the token underlying the issued state.

sum - function to convert a list of states into an amount of the token. Must error if there are no states in the list.

sumOrZero - function to convert a list of states into an amount of the token, and returns zero if there are no states in the list. Takes in an instance of the token definition for constructing the zero amount if needed.


Constructors

<init> AbstractIssue(sum: List<S>.() -> Amount<Issued<T>>, sumOrZero: List<S>.(Issued<T>) -> Amount<Issued<T>>)

Standard issue clause for contracts that issue fungible assets.

Properties

sum val sum: List<S>.() -> Amount<Issued<T>>
sumOrZero val sumOrZero: List<S>.(Issued<T>) -> Amount<Issued<T>>

Inherited Properties

requiredCommands open val requiredCommands: Set<Class<out CommandData>>

Determine whether this clause runs or not

Functions

verify open fun verify(tx: TransactionForContract, inputs: List<S>, outputs: List<S>, commands: List<AuthenticatedObject<C>>, groupingKey: Issued<T>?): Set<C>

Verify the transaction matches the conditions from this clause. For example, a "no zero amount output" clause would check each of the output states that it applies to, looking for a zero amount, and throw IllegalStateException if any matched.

Extension Functions

matches fun <C : CommandData> Clause<*, C, *>.matches(commands: List<AuthenticatedObject<C>>): Boolean

Determine if the given list of commands matches the required commands for a clause to trigger.

Inheritors

Issue class Issue : AbstractIssue<State, Commands, Currency>
Issue class Issue : AbstractIssue<State, Commands, Commodity>

Standard issue clause, specialised to match the commodity issue command.

Issue class Issue<P> : AbstractIssue<State<P>, Commands, Terms<P>>

Generic issuance clause

Issue class Issue : AbstractIssue<State, Commands, Terms>