Skip to content

Step by step beginner guide on how to use Daml smart contract programming language and framework

License

Notifications You must be signed in to change notification settings

Tomasz-Zdeb/Daml-Sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daml Sandbox

An overview guide on Daml language.

Getting started

Daml docs provide a great Getting Started guide. This project will be based on Daml Open Source.

Please take into account that projects generated by Daml toolkit may be provided under different licensing terms than this guide.

daml version

Displays versions of installed SKDs.

daml new <project_name>

Creates new project with a specified name and default template. To specify the template use:

daml new <project_name> --template <template_name>
daml new --list

Lists all the available project templates

Templates

They are the most important component of Daml ecosystem. They define data and behavior of Contracts on Daml Ledger. Which means they provide logic that answers these questions:

  • Who can see what?
  • Who can alter the ledger?
  • How can they alter the ledger?
  • Under what conditions?

Contracts are immutable in Daml - once created they cannot be changed

With section

Template declaration must start with: with section. Data fields are defined in the with section.

The requirement the with section is to contain at least one Party.

template MyOffer
  with
    issuer: Party
    owner: Party
    price: Decimal
    royaltyRate: Deciaml
    (...)

In general with section a mix of Parties included in the contract as well as the contract's payload.