Skip to content
FTFoodTrace
ProductHow it worksFor businessesTrust & Evidence
Sign in

Save an email on this device. FoodTrace does not use a password, and a wallet is still required for studio verification and inventory changes.

Choose a wallet

FoodTrace uses the wallet you pick. Lookup works without one. A wallet is used to sign studio verification, appeals, and business inventory.

WalletConnect and the Reown modal need NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID. Installed EIP-1193 wallets such as MetaMask, Rabby, Coinbase Wallet, OKX Wallet, Trust Wallet, and Brave Wallet can still connect.

Menu
ProductHow it worksFor businessesTrust & EvidenceLookupHistoryAlertsInventorySettings

Choose a wallet

FoodTrace uses the wallet you pick. Lookup works without one. A wallet is used to sign studio verification, appeals, and business inventory.

WalletConnect and the Reown modal need NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID. Installed EIP-1193 wallets such as MetaMask, Rabby, Coinbase Wallet, OKX Wallet, Trust Wallet, and Brave Wallet can still connect.

LookupHistoryAlertsInventorySettings

Documentation

How FoodTrace works

FoodTrace collects recall evidence and asks the GenLayer Intelligent Contract to evaluate it. It is not a food-safety authority.

Architecture

User input → FoodTrace frontend → Evidence collection → GenLayer Intelligent Contract → Evidence evaluation → Finalized result → Evidence and transaction displayed to the user

Why GenLayer

A private server can change a stored result later. GenLayer fetches the same public evidence URLs inside the Intelligent Contract and stores the verdict with the request id. FoodTrace shows a result as finalized only after that stored verdict is read back.

Network and contract

Network
GenLayer Studio Next
Chain ID
61997
Contract
0x3973d96145dBe83d61b36C86266D758dD3655a14
Explorer
https://explorer-studio-dev.genlayer.com

The contract class is FoodTrace, policy foodtrace-v1. A check sends submit_verification_request with the product, lot, expiration, region, evidence hash, and one to six https evidence URLs.

How a check is evaluated

  1. Enter the product at /lookup. A wallet is not required.
  2. FoodTrace reads the configured sources. The fictional demo catalog is labeled Fictional Demo Data.
  3. The server submits those public evidence URLs to the contract. The contract renders each page and compares barcode, lot, name, and brand.
  4. The server stores the transaction as SUBMITTED, then PENDING while consensus runs. Opening the result reads the explorer and get_verification_result. A transaction id alone is not a finalized result.
  5. The page then shows the classification, confidence, network, chain id, contract, transaction, evaluation id, explorer link, evidence hash, timestamp, and source excerpts.

Conflicting sources

When a matched recall and a matched clearance are both present, FoodTrace keeps both excerpts and labels the check CONFLICTING_SOURCES. The contract returns CONFLICTING_INFORMATION when both sides match strongly and the clearance comes from an official-priority host. Pages on this site are not FDA, USDA, or CDC, so the contract can store RECALL_FOUND while the page still shows the disagreement. The contract verdict and the FoodTrace label are both shown.

Verification statuses

  • SUBMITTED — the contract call was sent and the transaction id is stored. The page still says Pending.
  • PENDING — GenLayer verification: Pending. The evidence evaluation is still being processed.
  • FINALIZED — GenLayer verification: Finalized. The explorer transaction succeeded and get_verification_result returned this request.
  • FAILED — GenLayer verification: Failed. The evidence could not be finalized. The saved reason is shown, and the page can retry.
  • UNAVAILABLE — the RPC, explorer, signer, or contract call could not be completed. The saved reason is shown. Retry later.

The result page polls every few seconds for up to 30 minutes from the latest submission and continues after a refresh. A retry stores a new evaluation and starts that window again. A transaction the explorer still shows as in progress stays Pending and becomes FAILED after 30 minutes, with the saved reason shown. A missing transaction id, or an explorer and RPC that cannot be reached, becomes UNAVAILABLE after 10 minutes. A temporary RPC or fee-simulation failure is retried. An older in-progress observation cannot replace a row that is already FINALIZED.

Demo data and live data

Demo products are fictional. Their pages say Fictional Demo Data — not an official recall notice. If openFDA is off, the result says Live government source: Not configured. A demo source is never presented as a government authority.

Reviewer demos: Demo recall, exact lot; Demo, no matching recall; Demo conflicting sources; Demo expired date. Each button fills the form. Submit it, then wait on the result page until the status leaves Pending.

Environment variables

  • FOODTRACE_GENLAYER_MODE — studio in production. mock stays local and is not described as finalized.
  • NEXT_PUBLIC_GENLAYER_NETWORK, NEXT_PUBLIC_GENLAYER_RPC_URL, NEXT_PUBLIC_FOODTRACE_CONTRACT_ADDRESS
  • NEXT_PUBLIC_APP_URL — public https origin used for evidence links.
  • TURSO_DATABASE_URL and TURSO_AUTH_TOKEN — production database. Local SQLite uses DATABASE_URL.
  • FOODTRACE_GENLAYER_SIGNER_PRIVATE_KEY — server-only signer. Never NEXT_PUBLIC.
  • FOODTRACE_SESSION_SECRET, FOODTRACE_OPENFDA_ENABLED, FOODTRACE_MANUFACTURER_API_URL, FOODTRACE_RETAILER_API_URL, FOODTRACE_ADMIN_TOKEN

Example finalized check

This spinach demo was read back from the contract after the transaction finalized. It is fictional demo data, not a government recall.

Result
https://foodtrace-six.vercel.app/results/lk_f955826a00bb43188b3a129dd663847d
Classification
EXACT_RECALL_MATCH
Contract verdict
RECALL_FOUND
Evaluation ID
ftv_f8a28a3d728f48b1973d3d509d985354
Transaction
https://explorer-studio-dev.genlayer.com/tx/0xcec7487e75b3a4e6e8512ca48d2161ef4b4bf1e911ca5e3a43cbdb754d42c353

Reproduce a verification

  1. Open /lookup and choose a demo scenario.
  2. Submit the form. The server stores the lookup and submits submit_verification_request.
  3. Open the result. While it says Pending, the evaluation is still being processed.
  4. When it says Finalized, use the explorer link. The transaction id and evaluation id on the page are the ones stored for that request.

Known limitations

  • Live government, manufacturer, and retailer APIs are not enabled until their environment variables are set.
  • The contract gives hosts other than FDA, USDA, and CDC priority 6. A fictional clearance on this site can therefore be stored as RECALL_FOUND.
  • Studio Next can reset. A finalized result is proof of that transaction, not a permanent public registry.
  • No finalized appeal transaction is recorded.
  • FoodTrace does not guarantee that a product is safe to eat.

FoodTrace

Recall and batch checks with the evidence left visible.

Product

  • Check a product
  • How it works
  • History

Businesses

  • Inventory
  • Alerts
  • Settings

Documentation

  • Documentation
  • Privacy
  • Terms
  • Safety disclaimer

Social

Social profiles are not connected.

Network status: GenLayer Studio Next is configured for verification.