npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@flarenetwork/flare-periphery-contracts

v0.1.16

Published

Smart contracts for all Flare chains

Downloads

616

Readme

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.