GithubHelp home page GithubHelp logo

flare-solidity-periphery-package-mirror's Introduction

Flare periphery package for smart contract development

This package contains a collection of smart contracts deployed on the Flare, Coston2 (test network for Flare), Songbird and Coston (test network for Songbird) networks.

The intention of this package is to provide a set of interfaces for easier integration and development of smart contracts on Flare based networks. Interfaces in the most recent version of this package are the same as the ones deployed on the networks. This package exposes all public and most of the internal interfaces but does not expose any of the implementations. If you want to access the implementations, you can use the official Flare smart contracts repo.

The package functions similar to openzeppelin library packages and can easily be imported in nodejs based projects as well as directly in remix IDE.

Basic familiarity with the Flare network and EVM is assumed for use. For more information, please refer to the Flare Developer Hub. If you want a guided tutorial on EVM development and Flare focused smart contract development with this package, see the guide on Getting Started with Flare.

Package structure

Each of the networks has its own folder and subfolders for interfaces of specific flare based technologies. The folder structure is as follows:

├── coston
│   ├── distribution
│   ├── ftso
│   ├── governance
│   ├── inflation
│   ├── mockContracts
│   ├── stateConnector
│   └── util-contracts
├── coston2
│   ├── distribution
│   ├── ftso
│   ├── governance
│   ├── mockContracts
│   ├── stateConnector
│   └── util-contracts
├── examples
│   ├── coston
│   ├── coston2
│   ├── flare
│   └── songbird
├── flare
│   ├── distribution
│   ├── ftso
│   ├── governance
│   ├── mockContracts
│   ├── stateConnector
│   └── util-contracts
└── songbird
    ├── distribution
    ├── ftso
    ├── governance
    ├── inflation
    ├── mockContracts
    ├── stateConnector
    └── util-contracts

Example usages

I want to use the FTSO prices in my contract

You should use IFtsoRegistry (or IIFtsoRegistry) for simple price queries or IFtso (or IIFtso) for more advanced queries. The IFtsoRegistry interface is available in contracts/userInterfaces/IFtsoRegistry.sol and the IFtso interface is available in contracts/userInterfaces/IFtso.sol.

To use the interfaces deployed on Flare network, just import them in your contract source:

import { IPriceSubmitter } from "@flarenetwork/flare-periphery-contracts/flare/ftso/userInterfaces/IPriceSubmitter.sol";
import { IFtsoRegistry } from "@flarenetwork/flare-periphery-contracts/flare/ftso/userInterfaces/IFtsoRegistry.sol";

If you are using Foundry, you can install the interfaces with Forge and import them in your contract source:

import { IPriceSubmitter } from "flare-periphery-contracts/flare/ftso/userInterfaces/IPriceSubmitter.sol";
import { IFtsoRegistry } from "flare-periphery-contracts/flare/ftso/userInterfaces/IFtsoRegistry.sol";

Very simple contract that can consume the FTSO prices is shown in examples/networkName/SimpleFtsoExample.sol.

An example usage of the FTSO system to dynamically price token in a contract is showcased in examples/network/DynamicToken.sol with a more detailed explanation in the blogpost.

I want to confirm something using the attestation client

Coming soon.


You've got the tools, turn on your imagination and go, go and build something awesome

If you find any mistake or have any suggestions, please open an issue or contact us are directly.

Package is provided as is, without any warranty.

flare-solidity-periphery-package-mirror's People

Contributors

jo-osko avatar dineshpinto avatar uttam-singhh avatar

Watchers

 avatar Ilan Doron avatar Xavi Artigas avatar david pangerl 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.