Coder Social home page Coder Social logo

contract-catalogue's Introduction

LIGO-FA (tokens)

ligo-fa is a collection of FA2 (TZIP-12) implementations written in LIGO

It provides 3 types of asset contracts:

  1. NFT: This contract implements the FA2 interface for NFT(non-fungible-token) where a token can belong to only one address at a time (1:1)
  2. Single Asset./lib/fa2/asset/single_asset.mligo): This is an implementation of Single Asset Token where a different amount of single token can belong to multiple addresses at a time (1:n)
  3. Multi Asset: This is an implementation of Multi Asset Token where there are many tokens (available in different amounts) and they can belong to multiple addresses (m:n)

Development

To compile the contracts to Michelson , run

make compile

Tests

A makefile is provided to launch tests.

$ make test

The tests are available in ./test/fa2 directory, there is also an example of mutation testing

Deploy

A TypeScript program for deployment is provided to originate the smart contract. This deployment script relies on .env file which provides the RPC node url and the deployer public and private key. (example .env file)

$ make test

Usage

  1. To install this package, run ligo install ligo-fa.
  2. In order originate the FA2 contracts from another contract you can use the CREATE_CONTRACT Michelcon instruction like this
    ...
    let create_my_contract : lambda_create_contract =
        [%Michelson ( {| { 
                UNPAIR ;
                UNPAIR ;
                CREATE_CONTRACT 
    #include "ligo-fa/compiled/fa2/nft/NFT_mligo.tz"  
                ;
                PAIR } |})] in
    ...

contract-catalogue's People

Contributors

callistonianembrace avatar d-plaindoux avatar frankhillard avatar laucans avatar melwyn95 avatar nigro64 avatar pewulfman avatar zamrokk avatar

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.