corda / net.corda.core.contracts / ContractState

ContractState

interface ContractState

A contract state (or just "state") contains opaque data used by a contract program. It can be thought of as a disk file that the program can use to persist data across transactions. States are immutable: once created they are never updated, instead, any changes must generate a new successor state. States can be updated (consumed) only once: the notary is responsible for ensuring there is no "double spending" by only signing a transaction if the input states are all free.

Properties

participants

abstract val participants: List<AbstractParty>

A participant is any party that should be notified when the state is created or consumed.

Extension Functions

contextLogger

fun Any.contextLogger(): <ERROR CLASS>

When called from a companion object, returns the logger for the enclosing class.

hash

fun ContractState.hash(): SecureHash

Returns the SHA-256 hash of the serialised contents of this state (not cached!)

fun ContractState.hash(algorithm: String): SecureHash

Returns the hash of the serialised contents of this state (not cached!)

Inheritors

FungibleState

interface FungibleState<T : Any> : ContractState

Interface to represent things which are fungible, this means that there is an expectation that these things can be split and merged. That's the only assumption made by this interface.

LinearState

interface LinearState : ContractState

A state that evolves by superseding itself, all of which share the common "linearId".

OwnableState

interface OwnableState : ContractState

A contract state that can have a single owner.

QueryableState

interface QueryableState : ContractState

A contract state that may be mapped to database schemas configured for this node to support querying for, or filtering of, states.

SchedulableState

interface SchedulableState : ContractState