core / 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.

### Properties

programRef | `abstract val programRef: SecureHash` Refers to a bytecode program that has previously been published to the network. This contract program will be executed any time this state is used in an input. It must accept in order for the transaction to proceed.

### Extension Functions

hash | `fun ContractState.hash(): SecureHash` Returns the SHA-256 hash of the serialised contents of this state (not cached)

### Inheritors

OwnableState | `interface OwnableState : ContractState`
State | `data class State : ContractState`
State | `class State : ContractState`