Skip to content

tellor-io/SampleLayerUser

Repository files navigation

Sample Projects Using Tellor Layer

This repository provides various examples of sample code that uses Tellor. Note that there are different checks and best practices depending on the specific use case and user profile. The examples specified in this repo are:

  • Price feeds
  • Slow data (e.g. the CPI thats updated monthly)
  • Prediction Markets
  • Tellor as a fallback to a centralized oracle
  • Reading from another EVM chain
  • YOLO User - a baseline oracle user that just verifies the data is valid tellor data

For more in-depth information about Tellor, check out our documentation.

How to use

1. Clone project and install dependencies

git clone https://github.com/tellor-io/SampleLayerUser.git

hardhat:

cd SampleLayerUser
npm i

2. Architecture and Overview

Using tellor layer is simple:

  • Have a bridge contract on the chain you want to use (TellorDataBridge). There should already be a live bridge for most users, but if you're working with a new chain, feel free to reach out if you want us to deploy it!
  • Request data from the tellor chain (via a tip)
  • a few seconds later, grab a proof of the verified data from the tellor layer chain. Can be found here explorer.tellor.io/oracle-bridge
  • submit the data proof to your contract to update your contract with oracle data.

For more advanced users, if you have further questions or if you want to run a reporter yourself, please head to docs.tellor.io/layer-docs

3. To run tests:

Hardhat:

npx hardhat test

4. Deployment:

Configure your network

Configure your network in your hardhat.config with the correct network/gas settings.

Setup Config Variables

Setup config variables relevant to your setup. The default variables are for INFURA_API_KEY, ETHERSCAN_API_KEY, TESTNET_PK, and MAINNET_PK:

npx hardhat vars set INFURA_API_KEY

Then, in scripts/DeploySampleMVPUser.js, change the dataBridgeAddress to correspond to the correct address corresponding to your deployment network https://docs.tellor.io/tellor/the-basics/contracts-reference. Change the queryId to the correct queryId for the data you want to read. Change the NODE_URL to the correct value for your deployment network.

Next run:

npx hardhat run scripts/DeploySampleMVPUser.js --network <my_network>

Maintainers

@themandalore
@brendaloya

How to Contribute

Check out our issues log here on Github out in our Discord

Contributors

This repository is maintained by the Tellor team - www.tellor.io

Copyright

Tellor Inc. 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors