Truth.Farm Documentation
Learn how to integrate and build with the crowdsourced oracle. Start with the quickstart or browse topics on the left.
Featured
Quickstart
A minimal path to integrate the crowdsourced oracle. Keep this page as your entry point; jump into detailed pages only when needed.
Requirements
- Network: BNB Chain (BSC) Mainnet (Chain ID: 56)
- RPC: https://bsc-dataseed.bnbchain.org
- Node 18+ (recommended)
- ethers v6
- Contract addresses:
- Oracle:
0xFA4595F636887CA28FCA3260486e44fdcc8c8A71 - Token:
0x948d7a6f18511df422184360d1cd5d56f5be4444
- Oracle:
1) Install
pnpm add ethers
# or
npm i ethers
2) Connect (read-only)
import { JsonRpcProvider, Contract } from 'ethers'
import OracleArtifact from '../../artifacts/contracts/FarmTruth.sol/DecentralizedOracle.json'
const provider = new JsonRpcProvider('https://bsc-dataseed.bnbchain.org')
const ORACLE_ADDRESS = '0xFA4595F636887CA28FCA3260486e44fdcc8c8A71'
const oracle = new Contract(ORACLE_ADDRESS, (OracleArtifact as any).abi, provider)
// Optional: ensure the address has code
const code = await provider.getCode(ORACLE_ADDRESS)
if (!code || code === '0x') throw new Error('No bytecode at ORACLE_ADDRESS')
For signing transactions (browser/server), attach a signer. See JS Setup
3) Approvals
The oracle pulls ERC‑20 tokens on create/vote. For allowance patterns, see:
4) Core actions (where to go next)
Edge cases and listing:
5) Smart contract integration
Building on-chain? Start here: