Giter VIP home page Giter VIP logo

cardano-dex-contracts's Introduction

Spectrum Finance contracts implementation for Cardano

This repository contains implementations of the following scripts:

  • CFMM DEX scripts
    • Pool
    • Swap proxy
    • Deposit proxy
    • Redeem proxy

Setting up

Cabal+Nix build

Alternatively, use the Cabal+Nix build if you want to develop with incremental builds, but also have it automatically download all dependencies.

Set up your machine to build things with Nix, following the Plutus README (make sure to set up the binary cache!).

To enter a development environment, simply open a terminal on the project's root and run:

  • nix develop .#onchain for the onchain part of the project (plutarch)
  • nix develop .#offchain for the offchain part of the project
  • nix develop .#tooling to be dropped into a generic tooling flake that provides formatters/ linters/ ...

It is strongly recommend to use direnv which allows you to use your preferred shell. Once installed, just run:

$ echo "use flake .#tooling" > .envrc # Or manually add "use flake .#tooling" in .envrc if you already have one
# ^ in the root directory of the project 
$ direnv allow

$ echo "use flake .#onchain" > .envrc 
# ^ in the onchain directory of the project (and in the same way for the offchain project)
$ direnv allow

and you'll have a working development environment for now and the future whenever you enter the corresponding directory.

The build should not take too long if you correctly set up the binary cache. If it starts building GHC, stop and setup the binary cache.

Afterwards, the command cabal build from the terminal should work (if cabal couldn't resolve the dependencies, run cabal update and then cabal build).

Also included in the environment is a working Haskell Language Server you can integrate with your editor. See here for instructions.

To build the project with nix, run:

  • nix build .#"cardano-dex-contracts-onchain:lib:cardano-dex-contracts-onchain" for the onchain part
  • nix build .#"cardano-dex-contracts-offchain:lib:cardano-dex-contracts-offchain" for the offchain part

cardano-dex-contracts's People

Contributors

bromel777 avatar gusevtimofey avatar mangoiv avatar oskin1 avatar yasha-black 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cardano-dex-contracts's Issues

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.