From efb1706821de2c62feea36795069ff6193dbd796 Mon Sep 17 00:00:00 2001 From: Ibo Sy Date: Fri, 10 Jul 2026 16:22:58 +0200 Subject: [PATCH 1/3] update daml core concepts page, move embedded snippets Signed-off-by: Ibo Sy --- .../overview/understand/core-concepts.mdx | 8 ++++---- ...overview_understand_core-concepts_L223.mdx | 2 +- ...o-asset-multi-trade-fora-example-begin.mdx | 10 +++++----- ...o-choices-daml-party-roles-asset-begin.mdx | 15 ++++++++++++++ ...l-party-roles-template-structure-begin.mdx | 20 +++++++++++++++++++ 5 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-asset-begin.mdx create mode 100644 docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-template-structure-begin.mdx diff --git a/docs-main/overview/understand/core-concepts.mdx b/docs-main/overview/understand/core-concepts.mdx index d90a82bad..4488501ef 100644 --- a/docs-main/overview/understand/core-concepts.mdx +++ b/docs-main/overview/understand/core-concepts.mdx @@ -3,9 +3,9 @@ title: "Core Concepts" description: "Essential building blocks of Canton Network: parties, validators, synchronizers, and smart contracts" --- -import DamlOverviewUnderstandCoreConceptsL183 from "/snippets/daml-docs/overview_understand_core-concepts_L183.mdx"; +import DamlPartyRolesAsset from "/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-asset-begin.mdx"; +import DamlPartyRolesTemplateStructure from "/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-template-structure-begin.mdx"; import DamlOverviewUnderstandCoreConceptsL223 from "/snippets/daml-docs/overview_understand_core-concepts_L223.mdx"; -import DamlOverviewUnderstandCoreConceptsL44 from "/snippets/daml-docs/overview_understand_core-concepts_L44.mdx"; Understanding Canton requires grasping four fundamental concepts: **parties**, **validator** node, **synchronizers**, and **templates** (smart contracts). This page introduces each and explains how they work together. @@ -46,7 +46,7 @@ Unlike Ethereum addresses, parties create state on validators and have costs ass Parties interact with contracts in three roles: - + | Role | Can Create | Can See | Can Act | |------|------------|---------|---------| @@ -171,7 +171,7 @@ Smart contracts in Canton are defined using **Daml**, a purpose-built language f ### Template Structure - + ### Contracts Are Immutable diff --git a/docs-main/snippets/daml-docs/overview_understand_core-concepts_L223.mdx b/docs-main/snippets/daml-docs/overview_understand_core-concepts_L223.mdx index 87e97e54d..dce53f8d5 100644 --- a/docs-main/snippets/daml-docs/overview_understand_core-concepts_L223.mdx +++ b/docs-main/snippets/daml-docs/overview_understand_core-concepts_L223.mdx @@ -1,6 +1,6 @@ ```haskell -- Consuming: archives the contract -choice Transfer : ContractId Token +choice ChangeOwner : ContractId Token controller owner do create this with owner = newOwner diff --git a/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-9-daml-test-intro-asset-multi-trade-fora-example-begin.mdx b/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-9-daml-test-intro-asset-multi-trade-fora-example-begin.mdx index bcca05b53..af65751f7 100644 --- a/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-9-daml-test-intro-asset-multi-trade-fora-example-begin.mdx +++ b/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-9-daml-test-intro-asset-multi-trade-fora-example-begin.mdx @@ -1,6 +1,6 @@ -```haskell - [usdCid, chfCid] <- forA [usdCid, chfCid] (\cid -> submit alice do - exerciseCmd cid SetObservers with - newObservers = [bob] - ) +```daml +[usdCid, chfCid] <- forA [usdCid, chfCid] (\cid -> submit alice do + exerciseCmd cid SetObservers with + newObservers = [bob] + ) ``` \ No newline at end of file diff --git a/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-asset-begin.mdx b/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-asset-begin.mdx new file mode 100644 index 000000000..89cf12116 --- /dev/null +++ b/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-asset-begin.mdx @@ -0,0 +1,15 @@ +```haskell +template Asset + with + issuer : Party -- Will be signatory + owner : Party -- Will be observer and controller + auditor : Party -- Will be observer + where + signatory issuer -- Must authorize creation; always sees contract + observer owner, auditor -- Can see contract + + choice ChangeOwner : ContractId Asset + with newOwner : Party + controller owner -- Only owner can exercise this choice + do create this with owner = newOwner +``` \ No newline at end of file diff --git a/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-template-structure-begin.mdx b/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-template-structure-begin.mdx new file mode 100644 index 000000000..3e20eb646 --- /dev/null +++ b/docs-main/snippets/external/daml/main/tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-template-structure-begin.mdx @@ -0,0 +1,20 @@ +```haskell +template Token + with + -- Data fields + owner : Party + issuer : Party + amount : Decimal + where + -- Authorization + signatory issuer + observer owner + + -- Actions + choice ChangeOwner : ContractId Token + with + newOwner : Party + controller owner + do + create this with owner = newOwner +``` \ No newline at end of file From 2e70f79aa2981de320276d0da293c084b7b860b7 Mon Sep 17 00:00:00 2001 From: Ibo Sy Date: Fri, 10 Jul 2026 16:24:21 +0200 Subject: [PATCH 2/3] update daml snippet config Signed-off-by: Ibo Sy --- .../daml-snippet-list-remote.json | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/config/snippet-config/daml-snippet-list-remote.json b/config/snippet-config/daml-snippet-list-remote.json index 6d6d78e38..93ccbdc5b 100644 --- a/config/snippet-config/daml-snippet-list-remote.json +++ b/config/snippet-config/daml-snippet-list-remote.json @@ -13,6 +13,34 @@ "options": { "language": "daml" } + }, + { + "snippetName": "tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-asset-begin", + "sourceRepo": "daml", + "sourceFilepath": "sdk/docs/sharable/sdk/tutorials/smart-contracts/daml/daml-intro-choices/daml/PartyRoles.daml", + "location": { + "type": "stringMarker", + "start": "-- ASSET_BEGIN", + "end": "-- ASSET_END" + }, + "description": "Core concepts: party roles in contracts (Asset template)", + "options": { + "language": "haskell" + } + }, + { + "snippetName": "tutorials-smart-contracts-daml-daml-intro-choices-daml-party-roles-template-structure-begin", + "sourceRepo": "daml", + "sourceFilepath": "sdk/docs/sharable/sdk/tutorials/smart-contracts/daml/daml-intro-choices/daml/TemplateChoices.daml", + "location": { + "type": "stringMarker", + "start": "-- TEMPLATE_STRUCTURE_BEGIN", + "end": "-- TEMPLATE_STRUCTURE_END" + }, + "description": "Core concepts: template structure (Token template)", + "options": { + "language": "haskell" + } } ] } From c0f78681735cf616d75f2f178c7b2a5556e00d8d Mon Sep 17 00:00:00 2001 From: Ibo Sy Date: Fri, 10 Jul 2026 16:30:53 +0200 Subject: [PATCH 3/3] update snippet config Signed-off-by: Ibo Sy --- config/snippet-config/daml-snippet-list-remote.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/snippet-config/daml-snippet-list-remote.json b/config/snippet-config/daml-snippet-list-remote.json index 93ccbdc5b..b9381a4e8 100644 --- a/config/snippet-config/daml-snippet-list-remote.json +++ b/config/snippet-config/daml-snippet-list-remote.json @@ -11,7 +11,7 @@ }, "description": "", "options": { - "language": "daml" + "language": "haskell" } }, {