DAML's powerful type system makes it easy to model complex data schemas for your application following domain-driven design.
Specify who needs to sign a given contract,who can see it and who is allowed to perform actions on it.
Describe the actions available on a contract, together with their parameters, assertions, and precise consequences.
Test your business logic and workflows with an expressive scenario language. Interact with the ledger using multiple parties and verify the effects of your transactions instantly.
template Cash with issuer : Party owner : Party amount : Decimal where signatory issuer controller owner can Transfer : ContractId Cash with newOwner: Party do create this with owner = newOwner template TicketAgreement with organizer : Party owner : Party where signatory organizer, owner template TicketOffer with organizer : Party buyer : Party price : Decimal where signatory organizer observer buyer controller buyer can Accept : ContractId TicketAgreement with cashId : ContractId Cash do cash <- fetch cashId assert (cash.amount == price) exercise cashId Transfer with newOwner = organizer create TicketAgreement with organizer; owner = buyer validateTicketPurchase = scenario do issuer <- getParty "Issuer" organizer <- getParty "Organizer" buyer <- getParty "Buyer" cash <- submit issuer do create Cash with issuer; owner = buyer; amount = 20.0 offer <- submit organizer do create TicketOffer with organizer; buyer; price = 20.0 submit buyer do exercise offer Accept with cashId = cash
The runtime abstracts away the persistence layer so DAML programs can be written in a storage-agnostic way.
Contract data in the IDE is presented in an easily digestible format:
Building applications takes more than just a language, you need a complete toolchain.
The Visual Studio Code extension provides rich language support out of the box. Code highlighting, navigation, autocomplete, and type checking. A built in linter helps you write idiomatic DAML, and points out opportunities for refactoring.
An integrated simulation tool lets you spin up an in-memory ledger and run through scenarios in milliseconds. Nicely formatted transcripts let you inspect a trace of the interactions.