Tellor
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Tellor One-Stop Doc™ ## The Ultimate Guide to hacking on Tellor <br> **FVM 2023 Edition* *Hey Hackers! Welcome to your One-Stop Doc™ which includes everything you need to know about getting your hackathon project using Tellor’s oracle and ensuring you have an easy guided path to qualifying for a bounty.* ## Our bounties for FVM 2023: **Challenge:** Best use of Tellor oracle in your project built on FVM. Prize Pool: $2500 (Up to 10 best teams, capped at $1000 per team) To qualify: **Winners will need to meet these 2 requirements:** ✅ Submit link to deployed and verified contract that integrates the [ “usingTellor” npm package](https://github.com/tellor-io/usingtellor) ✅ Submit a transaction hash of a tip to incentivize a report. Use [our guide](https://hackmd.io/ZKCzPtsSQiW6hgzvTqjwvA?both#How-to-Tip-Reporters) to configure incentives for tipping/paying testnet reporters to provide your data. >The key take-away is that we want to see true usage of Tellor demonstrated by those two requirements. (Don’t worry, we’ll guide you through it!) ## Now...we build. ![](https://i.imgur.com/jqlEcWk.png) One of the most basic use cases for oracles are *spotPrice* feeds ( [see list of readily available prices](https://hackmd.io/FAR5-PIdTD-CgESSRWhR5A) ). So this guide will focus on that. However if you'd like to use Tellor for something that isn't a spot price or it happens to be an asset price not currently supported please use: *NumericApiResponse*. > NumericApiResponse is a [query type](https://docs.tellor.io/tellor/getting-data/introduction#some-quick-definitions-before-we-move-on) specifically for testing that reports numerical values from any API to Tellor oracles. *Only use this query type for testing, as data sources with single points-of-failure shouldn't be used in production.* ## In this tutorial we'll go over: - Setting up the initial toolkit you'll need to get up and running. - An example integration of Tellor. - Tipping to get a data report. ## UsingTellor The first thing you'll want to do is install the basic tools necessary for using Tellor as your oracle. Use [this package](https://github.com/tellor-io/usingtellor) to install the Tellor user contracts: `npm install usingtellor` Once installed, this will allow your contracts to inherit the functions from the ['UsingTellor'.](https://github.com/tellor-io/usingtellor) contract. Great! Now that you've got the tools ready, let's go through a simple exercise where we can retrieve the BTC/USD price : ### BTC/USD Price Example Inherit the UsingTellor contract, passing the Tellor address as a constructor argument, Here's an example contract & [github repo](https://github.com/tellor-io/sampleUsingTellor) to follow along with: ```solidity contract PriceContract is UsingTellor { uint256 public btcPrice; //This Contract now has access to all functions in UsingTellor constructor(address payable _tellorAddress) UsingTellor(_tellorAddress) {} function setBtcPrice() public { bytes memory _b = abi.encode("SpotPrice",abi.encode("btc","usd")); bytes32 _queryId = keccak256(_b); uint256 _timestamp; bytes memory _value; (_value, _timestamp) = getDataBefore(_queryId, block.timestamp - 15 minutes); require(_timestamp > 0, "No data exists"); require(block.timestamp - _timestamp < 24 hours, "Data is too old"); btcPrice = abi.decode(_value,(uint256)); } } ``` ## To experience using Tellor w/ a demo contract, [ watch this video tutorial.](https://www.twitch.tv/videos/1809935703) ## Tipping ### Testnet Tokens Once you've deployed your contract you'll need testnet tokens to tip reporters. You'll need Tellor Tributes (TRB) for this and of course the native token of your network. Here's how to get some: ### How to get Test TRB Use the faucet function on [playground's token contract](https://hyperspace.filfox.info/en/address/0xe7147C5Ed14F545B4B17251992D1DB2bdfa26B6d) [Click here](https://docs.tellor.io/tellor/the-basics/readme#need-testnet-tokens-trb) for more info ### How to Tip Reporters: Via block explorer: 1. call approve with the tip amount in the token contract * [Approve on Filecoin (Hyperspace) via remix](https://tellor.io/blog/how-to-create-token-approval-transactions-with-remix/) 2. call 'tip' in [autopay contract](https://docs.tellor.io/tellor/the-basics/contracts-reference) <br>***Don't forget** to include a link to your tip tx in the *read.me* of your submitted project. ## 🎉🎉🎉 *Congrats! you're now an official Tellor user!* ### Need Some Inspiration? Let's start with giving you an idea of what the Tellor oracle can provide…Anything! It just needs to be spec'd out. But here’s some highlights: * [Spot Prices](https://github.com/tellor-io/dataSpecs/blob/main/types/SpotPrice.md) * [TWAP](https://github.com/tellor-io/dataSpecs/blob/main/types/TWAP.md) * [Numeric API Responses ](https://github.com/tellor-io/dataSpecs/blob/main/types/NumericApiResponse.md) * [Random Number Generator](https://github.com/tellor-io/dataSpecs/blob/main/types/TellorRNG.md) * [Historical Gas price oracle](https://github.com/tellor-io/dataSpecs/blob/main/types/GasPriceOracle.md) * [SnapshotVoteResults](https://github.com/tellor-io/dataSpecs/blob/main/types/Snapshot.md) * [ChatGPT Responses](https://github.com/tellor-io/dataSpecs/blob/main/types/ChatGPTResponse.md) >Tellor is extremely flexible, here's a full list of custom query types users have put together in the past [here.](https://github.com/tellor-io/dataSpecs/tree/main/types) # **Extra Resources** * **[List of readily available prices](https://hackmd.io/FAR5-PIdTD-CgESSRWhR5A)** * **Tellor [Docs](https://docs.tellor.io)** * **[List of addresses of all the networks Tellor currently supports](https://docs.tellor.io/tellor/the-basics/contracts-reference)** * **Still have questions? Reach out to us in the #sponsor-tellor channel on the [#IPFS Discord](https://discord.gg/ipfs) or [Join the Tellor Discord](https://discord.gg/tellor)** * **[Follow us on Twitter](https://twitter.com/wearetellor)**

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully