# Tellor One-Stop Doc™ ![](https://i.imgur.com/oIXPj7S.jpg) ## The Ultimate Guide to hacking on Tellor <br> **ETHDenver 2023 Edition* *Hey Hackers! Welcome to your One-Stop Doc™ which includes everything you need to know about getting your project using Tellor’s oracle and ensuring you have an easy guided path to qualifying for a bounty.* ### Our bounties for EthDenver 2023: For the top 5 integrations that use Tellor, we are offering: 🎉 **$2,000** for integrations **& built on Gnosis Chain.** 🎉 **$1,000** for integrations on **any supported chain.** 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) ✅ Use the Tellor contracts to configure incentives for tipping/paying testnet reporters to provide your data - must submit a tx hash of this tip/payment. **OR** submit transaction using [Tellor Playground](https://docs.tellor.io/tellor/getting-data/reading-data/tellor-playground#overview) Refer to Hacker’s Guide to learn more. >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) This beginner's guide is here to showcase the ease with which one can get up and running with Tellor. One of the most basic use cases for oracles are data feeds. So let's start with Tellor's version of a simple data feed for testnet: NumericApiResponse. > NumericApiRespose is a [query type](https://docs.tellor.io/tellor/getting-data/introduction#some-quick-definitions-before-we-move-on) to report numerical values from any API to Tellor oracles. *Only use this query type for testnet, 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. - Walk through a simple example. - List out testnet addresses of networks you currently can test Tellor on. ## 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, along with a [video tutorial](https://youtu.be/1UMa9TACx48) to walk you through it: ```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)); } } ``` Once you've [deployed](https://github.com/tellor-io/UsingTellorDemo/blob/main/scripts/deploy.js) your contract, you can then get TRB from the [TRB Faucet](https://twitter.com/trbfaucet) and start tipping the reporters for your data **OR** submit transaction using [Tellor Playground](https://docs.tellor.io/tellor/getting-data/reading-data/tellor-playground#overview)! ### How to Tip via Etherscan: 1. call approve with the tip amount in the [token contract](https://docs.tellor.io/tellor/the-basics/contracts-reference) 1. call 'tip' in [autopay contract](https://goerli.etherscan.io/address/0x9BE9B0CFA89Ea800556C6efbA67b455D336db1D0#writeContract) <br>***Don't forget** to submit a link to your tip tx into the *#sponsor-tellor* channel in the ethglobal discord. This is will ensure you get a data reporter to respond to your request and additionally is a requirement for a prize. **OR** Set up a recurring feed for any of the [available prices](https://github.com/tellor-io/telliot-feeds/tree/main/src/telliot_feeds/feeds) using our ['Fund-a-Feed' front-end site.](https://fundafeed.tellor.io/) **OR** You can use this script to tip: https://github.com/tellor-io/simplefunding-script ## 🎉🎉🎉 *Congrats! you're now an official member of the Tellor User Family!* --- --- --- ## More Example Ideas * Create a Dynamic NFT that visually changes based on the price change of a cryptocurrency like **(Click [here](https://youtu.be/SNfkvbX-bH0) for a tutorial on how!)** * Build a DAO controlled governance contract that allows for gasless voting by the community using the [SnapShotVoteResults data type](https://github.com/tellor-io/dataSpecs/blob/main/types/Snapshot.md) to put snapshot.org votes on-chain * There’s no free lunch in crypto right? Create a contract that refunds gas using the [GasPriceOracle data type](https://github.com/tellor-io/dataSpecs/blob/main/types/GasPriceOracle.md) to users who transact to receive an airdrop! ### Need More Inspiration on what to build? Let's start with giving you an idea of what the Tellor oracle can provide…Anything! 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) <br> # **Extra Resources** * **Need something super custom?** [**You can generate your own custom query**](https://querybuilder.tellor.io/custom)! * **Want to try a different data type?** [**Check out the list of supported query types!**](https://github.com/tellor-io/dataSpecs/tree/main/types) * **[List of addresses of all the networks Tellor currently supports](https://docs.tellor.io/tellor/the-basics/contracts-reference)** * **For a more robust implementation of the Tellor oracle, check out the full list of available functions here: [Tellor Github](https://github.com/tellor-io/usingtellor/blob/master/README.md)** * **[Join our Discord]([here:](https://discord.gg/tellor))** * **[Follow us on Tewitter](https://twitter.com/wearetellor)**