
Common Integration Errors
Developers integrating IFÁ Labs price feeds occasionally encounter issues. Below are the most common problems and their solutions.
1. "Asset not supported" or exists = false
exists = falseSymptoms:
getAssetInfo returns exists = false.
Causes & Fixes:
Wrong asset ID → Double-check against the Supported Assets table. Asset IDs are case-sensitive
bytes32values generated viakeccak256("SYMBOL/USD").Typo in hex string → Ensure no extra
0xor missing zeros (full 66 characters:0x+ 64 hex digits).Using an unsupported asset → Only listed stablecoins are available. Request new assets via our community channels.
2. Revert: "Price stale"
Symptoms: Your custom staleness check reverts.
Causes & Fixes:
Clock drift → Use
block.timestampconsistently (not offchain time).Too tight threshold → Stablecoins update dynamically, 1–4 hours is typical. Start with
MAX_STALENESS = 7200(2 hours) and tighten based on monitoring.Network congestion → Rare on Base, but temporary delays can occur. Implement graceful fallback (see Advanced Topics).
3. Incorrect Human-Readable Price
Symptoms: Price appears wildly off (e.g., 1e18 instead of ~1.00).
Causes & Fixes:
Forgot scaling → Always divide by
10 ** (-decimal). Most feeds usedecimal = -18.Signed/unsigned confusion → Cast
int256 pricetouint256only after confirming positive.Variable decimals → Some future assets may differ, always read
decimaldynamically.
4. Gas Issues or "Out of Gas"
Symptoms: Batch reads or complex logic hit gas limits.
Causes & Fixes:
Too many assets in one call → Limit batch size to ~10–20.
Unoptimized loops → Cache oracle address and IDs as
constant.Using mainnet RPC with low gas price → Base is cheap, but ensure sufficient priority fee.
5. Contract Not Verified on Explorer
Symptoms: "Contract source code not verified" on Basescan.
Causes & Fixes:
This is cosmetic, the deployed bytecode matches the audited source.
Verification is in progress or pending for testnets.
Quick Debug Checklist
Verify network (Mainnet vs. Sepolia).
Confirm oracle address matches your chain.
Log returned values (
price,decimal,lastUpdateTime,exists).Test on Base Sepolia first.
Most issues resolve with correct asset IDs and proper scaling.
Next: Error Code Reference, understanding revert messages.
Last updated
Was this helpful?

