Interface Contract

  • All Implemented Interfaces:

    
    public interface Contract
    
                        

    Defines a mechanism for implementing contracts, which perform transaction verification.

    All participants run this code for every input and output state for every transaction they see on the network. All contracts must verify and accept the associated transaction for it to be finalized and persisted to the ledger. Failure of any contract constraint aborts the transaction, resulting in the transaction not being finalized.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      boolean isVisible(@NotNull() ContractState state, @NotNull() VisibilityChecker checker) Determines whether the specified state is visible to a node observing, or recording the associated transaction.
      abstract void verify(@NotNull() UtxoLedgerTransaction transaction) Verifies the specified transaction associated with the current contract.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • isVisible

        @Suspendable() boolean isVisible(@NotNull() ContractState state, @NotNull() VisibilityChecker checker)

        Determines whether the specified state is visible to a node observing, or recording the associated transaction.

        The default implementation determines that a state should be visible to its participants.

        Parameters:
        state - The ContractState for which to determine visibility.
        checker - Provides a mechanism to determine visibility of the specified ContractState.
      • verify

         abstract void verify(@NotNull() UtxoLedgerTransaction transaction)

        Verifies the specified transaction associated with the current contract.

        Parameters:
        transaction - The transaction to verify.