Code Monkey home page Code Monkey logo

ex-models's Introduction

DAML Examples

Overview

This repository contains examples for several use cases modeled in DAML. They showcase useful patterns and practices when writing DAML applications. Refer to the readme files for more information.

Prerequisites

Contributing

We welcome suggestions for improvements via issues, or direct contributions via pull requests.

Examples

Airline Seat Allocation

A lean, but somewhat privacy-preserving process to issue airline tickets and allocate seats.

Project Readme

Approval Chain

A three-step, sequential approval process, collecting signatures from approvers along the way.

Project Readme

Auction

An auction model with private bids.

Project Readme

Broadcast

A model showing how a broadcaster can broadcast information to subscribers via the ledger in a non-guaranteed, but efficient manner.

Project Readme

Group Chat

A model demonstrating a distributed group chat application with dynamic, admin-less chat groups.

Project Readme

Chess

A chess game written in DAML.

Project Readme

Crowd Funding

A model for a crowd funding campaign where backers commit Ious to a project. The originator can claim the funds if they surpass a threshold, and funds can be reclaimed if the threshold isn't reached.

Project Readme

Expense Pool

A shared expense pool where expenses are added in form of Ious, which then get split fairly between the partcipants.

Project Readme

Governance

A model demonstrating how on-chain governance can be modeled in DAML. Citizens can vote for the creation of a consititution contract, for the update of the constitution text, or for the upgrade of the constitution contract to a newer version.

Project Readme

Issuer Token

Example of token issuance by a central controlling party.

Project Readme

Onboarding

A task-list app with composable sub-tasks, designed to check off onboarding tasks.

Project Readme

Option

A European style cash settled option.

Project Readme

Shop

A marketplace example where vendors offer items to buyers.

Project Readme

Task Tracking

A Jira-like work tracking model implementing a linear task workflow. Tasks can be created, assigned, reassigned, started and completed.

Project Readme

Tic-Tac-Toe

A model for the Tic-Tac-Toe game for two players playing against each other.

Project Readme

Voting

A simple voting model where ballots are organized around proposals, and decision being taken are represented as contracts on the ledger.

Project Readme

ex-models's People

Contributors

bame-da avatar cocreature avatar da-tanabe avatar dimitri-da avatar fieldera-da avatar garyverhaegen-da avatar georgschneider avatar leonidr-da avatar lucianojoublanc-da avatar richardkapolnai-da avatar rleonid avatar rohanjr avatar sormeter avatar vivd-da avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ex-models's Issues

readme update

models not listed in the readme:

  • shop
  • xlbitcoin
  • generic-auction-market
  • auction

In the Tic-Tac-Toe contract `hasWonCounterDiagonal` option missing from `hasWon` function definition

I think the correct definition is the following:

hasWon game player =
  let
    moves = filter (\m -> m.player == player) game.moves
    hasAllHorizontal i = count (\m -> m.x == i) moves == game.size
    hasAllVertical i = count (\m -> m.y == i) moves == game.size
    hasAllDiagonal i = count (\m -> m.y == i && m.x == i) moves == game.size
    hasAllCounterDiagonal i = count (\m -> m.y == i && m.x == game.size - 1 - i) moves == game.size
    hasWonHorizontal = any hasAllHorizontal [0 .. game.size - 1]
    hasWonVertical = any hasAllVertical [0 .. game.size - 1]
    hasWonDiagonal = any hasAllDiagonal [0 .. game.size - 1]
    hasWonCounterDiagonal = any hasAllCounterDiagonal [0 .. game.size - 1]
  in hasWonHorizontal || hasWonVertical || hasWonDiagonal || hasWonCounterDiagonal```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.