net.corda.core.contracts

## Interface Contract

- All Known Subinterfaces:
    UpgradedContract<OldState,NewState>
  All Known Implementing Classes:
    Cash, CommercialPaper, CommercialPaperLegacy, CommodityContract, DummyContract, DummyContractV2, DummyDealContract, DummyLinearContract, Obligation, OnLedgerAsset

      public Contract

  Implemented by a program that implements business logic on the shared ledger. All participants run this code for every LedgerTransaction they see on the network, for every input and output state. All contracts must accept the transaction for it to be accepted: failure of any aborts the entire thing. The time is taken from a trusted timestamp attached to the transaction itself i.e. it is NOT necessarily the current time.

  TODO: Contract serialization is likely to change, so the annotation is likely temporary.

  See Also:
    LedgerTransaction

- - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `SecureHash` | `getLegalContractReference()` Unparsed reference to the natural language contract that this code is supposed to express (usually a hash of the contract's contents).
    `void` | `verify(TransactionForContract tx)` Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense. Must throw an exception if there's a problem that should prevent state transition. Takes a single object rather than an argument so that additional data can be added without breaking binary compatibility with existing contract code.

- - ### Method Detail

    - #### verify

          void verify(TransactionForContract tx)

      Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense. Must throw an exception if there's a problem that should prevent state transition. Takes a single object rather than an argument so that additional data can be added without breaking binary compatibility with existing contract code.

    - #### getLegalContractReference

          SecureHash getLegalContractReference()

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