Giter Site home page Giter Site logo

fassets's Introduction

FAsset contracts

Solidity contracts for Flare Labs FAsset system.

Overview

The FAsset contracts are used to mint assets on top of Flare (or Songbird). The system is designed to handle chains which don’t have (full) smart contract capabilities, although it can also work for smart contract chains. Initially, FAsset system will support assets XRP, BTC, DOGE, and LTC. Later we might add other blockchains.

The minted FAssets are secured by collateral, which is in the form of ERC20 tokens on Flare/Songbird chain and native tokens (FLR/SGB). The collateral is locked in contracts that guarantee that minted tokens can always be redeemed for underlying assets or compensated by collateral.

Two novel protocols, available on Flare and Songbird blockchains, enable the FAsset system to operate:

  • FTSO contracts which provide decentralised price feeds for multiple tokens.
  • Flare’s State Connector, which bridges payment data from any connected chain.

Development

Getting started

  1. Clone this repository.
  2. Run yarn.
  3. Compile the solidity code: yarn c.
  4. Run basic tests yarn testHH.

Flare-smart-contracts dependency

Currently, flare-smart-contracts dependency is obtained directly from git repository from a tag that supports the required functionality.

For development, it might be beneficial to directly use checked-out code of flare-smart-contracts. This can be done with yarn link:

  1. In flare-smart-contracts project folder run yarn link
  2. In fasset project folder run yarn link flare-smart-contracts

This creates softlink from node_modules/flare-smart-contracts to the flare-smart-contracts project folder.

For development in VSCode you might also find VSCode Workspace feature useful - it allows you to have multiple projects open in the same window (e.g. both fasset and flare-smart-contracts).

Testing

Note: be sure to compile (yarn c) after any solidity code changes or if starting a clean project as Typescript stubs need to be generated as part of the compilation.

Then one can run different types of tests.

  • yarn testHH - all tests in hardhat environment (includes following two types of tests).
  • yarn test_unit_hh - only unit tests in hardhat environment.
  • test_integration_hh - only integration tests in hardhat environment.

To check test coverage run yarn cov.

fassets's People

Contributors

kuco23 avatar bostjan-kovac avatar aljazs-flare avatar jeznaspianca avatar nejc-flare-network avatar jo-osko avatar ilandoron avatar urska-krivc 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.