Package net.corda.v5.ledger.utxo
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.
-
-
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. -
-
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.
-
-
-
-