diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt index 8d20dc5778..398a03eb01 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt @@ -4,9 +4,12 @@ import net.corda.core.contracts.CommandData import net.corda.core.contracts.Contract import net.corda.core.transactions.LedgerTransaction -val TEMPLATE_CONTRACT_ID = "com.template.TemplateContract" - open class TemplateContract : Contract { + // This is used to identify our contract when building a transaction. + companion object { + val ID = "com.template.TemplateContract" + } + // A transaction is considered valid if the verify() function of the contract of each of the transaction's input // and output states does not throw an exception. override fun verify(tx: LedgerTransaction) { @@ -17,4 +20,4 @@ open class TemplateContract : Contract { interface Commands : CommandData { class Action : Commands } -} \ No newline at end of file +}