The Daml Cheat Sheet Flashcards
Memorize the material in "The Fast Track to Daml", also known as "The Cheat Sheet". https://docs.daml.com/cheat-sheet/
Fill in the blanks:
“Daml is an open-source _ _ _
designed to build composable applications
on an _ _ _.”
“… smart contract language…
… an abstract ledger model.”
Fill in the blanks:
“Daml is a high-level language
that focuses on _ _ and _ of distributed applications.”
“… data privacy and authorization …”
True or False?
Daml is a statically-typed
functional language?
True
What Daml concept is this?
A person or legal entity that can create contracts and exercise choices.
Party
A built-in data type in Daml.
What are four roles that a party can have on a contract?
- Signatory
- Observer
- Controller
- Maintainer
Roles apply to instances of the Party type.
Fill in the blank:
“Contracts are created from blueprints called _.”
… templates.”
This is the Daml code you write.
Daml templates include what three elements?
- Contract data
- Authorization
- Choices
True or false?
Once a contract is created, its data can be changed by a choice.
False
Contracts are immutable.
Fill in the blanks:
“Every contract is a template instance stored as a _ on the _.”
… entry on the ledger.
What Daml concept is this?
The action that a party can take on a contract.
Choice
True or False?
Choices can archive the current contract and create a new version of the contract, with updated contract data.
True
Contracts are immutable.
Fill in the blank:
“A choice can only be exercised by its _”
“… controller.”
Fill in the blanks:
“A choice contains the authorization of:
1. all of the _ and
2. the _ .
(what two sets of parties?)
- all of the signatories, and
- the controller.
What Daml concept is this?
The database where all contracts are recorded.
Ledger
Daml Assistant command
Create a Daml project
daml new
Daml Assistant command
Create a Daml/React full stack project
daml create-daml-app
Daml Assistant command
Start the IDE
daml studio
Launches Visual Studio Code and the Daml extension
Daml Assistant command
Compile the DAML models into a DAR file
daml build
Daml Assistant command
Launch the sandbox ledger and JSON-API
daml start
Also builds the project
Daml Assistant command
Launch the sandbox ledger
in wall-clock time-mode
daml sandbox
Daml Assistant command
Launch the sandbox ledger
in static time-mode
daml sandbox --static-time
Daml Assistant command
Launch the JSON-API server
requires a running ledger
daml json-api
--ledger-host localhost --ledger-port 6865 --http-port 7575
Daml Assistant command
Upload a DAR to the ledger
daml ledger upload-dar
Daml Assistant command
Run the test scripts
in the current project
daml test
Daml Assistant command
Run the test scripts
in a specific file
daml test --files MyTests.daml
Daml Assistant command
Run the test scripts
in the current project and dependencies
daml test --all
Daml Assistant command
What is the name of the project configuration file?
daml.yaml
Daml basics
What is the end-of-line comment delimiter?
two hyphens
let i = 1 -- This is a comment
Daml basics
What are the delimiters for surrounding comments?
curly brace and hyphen
{- This is another comment -}
Daml basics
What does every Daml file start with?
a module header
module MyModule where
Module name must be capitalized and match the file name.