The blockchain for data
Flare is a full-stack layer 1 solution designed for data intensive use cases.
Building with the best
FTSO
Enshrined Data Protocols
Fassets
FDC
Ethereum Virtual Machine
FlareStake
Fast
Decentralized
100 Data Providers3.3% maximum stake per data provider
Secure
Build on Flare
Leverage Flare’s full-stack data solutions in your decentralized application.
import "@flarenetwork/flare-periphery-contracts/flare/ContractRegistry.sol";
import "@flarenetwork/flare-periphery-contracts/flare/FtsoV2Interface.sol";
contract FtsoV2Consumer {
FtsoV2Interface internal ftsoV2;
function getFlrUsdPrice() external returns
(uint256 value, int8 decimals, uint64 timestamp) {
ftsoV2 = ContractRegistry.getFtsoV2();
bytes21 flrUsdId = 0x01464c522f55534400000000000000000000000000;
return ftsoV2.getFeedById(flrUsdId);
}
}import { Web3 } from "web3";
export async function main() {
const w3 = new Web3(RPC_URL);
const ftsov2 = new w3.eth.Contract(JSON.parse(ABI), FTSOV2_ADDRESS);
const flrUsdId = "0x01464c522f55534400000000000000000000000000";
const res = await ftsov2.methods.getFeedById().call();
console.log(
"Value: %s, Decimals: %s, Timestamp: %s", res["0"], res["1"], res["2"],
);
}import asyncio
from web3 import AsyncHTTPProvider, AsyncWeb3
async def main() -> None:
w3 = AsyncWeb3(AsyncHTTPProvider(RPC_URL))
ftsov2 = w3.eth.contract(address=FTSOV2_ADDRESS, abi=ABI)
flr_usd_id = "0x01464c522f55534400000000000000000000000000"
res = await ftsov2.functions.getFeedById(flr_usd_id).call()
print(f"Value: {res[0]}, Decimals: {res[1]}, Timestamp {res[2]}")use alloy::{providers::ProviderBuilder, sol};
use eyre::Result;
sol!(FtsoV2, "abi/FtsoV2.json");
#[tokio::main]
async fn main() -> Result<()> {
let data = FtsoV2::new(FTSOV2_ADDRESS, ProviderBuilder::new().on_http(RPC_URL))
.getFeedById("0x01464c522f55534400000000000000000000000000")
.call()
.await?;
println!("Value:{}, Decimals:{}, Timestamp{}", data._0, data._1, data._2);
Ok(())
}import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/ethclient"
)
func FtsoV2Consumer() {
client, _ := ethclient.Dial(RPC_URL)
ftsov2, _ := NewFtsoV2(FTSOV2_ADDRESS, client)
flrUsdId := "0x01464c522f55534400000000000000000000000000"
var res []interface{}
ftsov2.FtsoV2Caller.contract.Call(nil, &res, "getFeedById", flrUsdId)
println("Value:", res[0], "Decimals:", res[1], "Timestamp:", res[2])
}Community
ETHGlobal Brussels
Flare [Dev] Meetup: Bangalore Edition
Flare x Google Hackathon Berkeley
ETH London Hackathon
Korean Blockchain Week
ETH London Hackathon
ETHGlobal Brussels
Flare x Google Hackathon Berkeley
Flare x Google Hackathon Berkeley
Flare x Google Hackathon Berkeley
Flare x Google Hackathon Berkeley
ETHGlobal Brussels
Flare [Dev] Meetup: Bangalore Edition
Flare x Google Hackathon Berkeley
ETH London Hackathon
Korean Blockchain Week
ETH London Hackathon
ETHGlobal Brussels
Flare x Google Hackathon Berkeley
Flare x Google Hackathon Berkeley
Flare x Google Hackathon Berkeley
Flare x Google Hackathon Berkeley
Subscribe to the Flare Newsletter
Join over 30,000 Flare community members. Sign up to the Flare newsletter today to hear the latest on product releases, ecosystem announcements and global events.
Subscribe