circle-info
This is the first version of our Documentation, it will be improved and extended soon.
Page cover

Working with Asset IDs

Asset IDs in IFÁ Labs are fixed, unique bytes32 identifiers used to reference specific price feeds (e.g., USDT/USD, CNGN/USD) in the onchain oracle contract. This design ensures consistency, gas efficiency, and collision resistance.

How Asset IDs Are Generated

Asset IDs are created by hashing the asset symbol string using keccak256, the EVM's native hashing function.

bytes32 assetId = keccak256(abi.encodePacked("USDT/USD"));

This produces a deterministic 32-byte value that serves as the key in the oracle's storage mapping.

Why keccak256?

  • Collision-resistant → Virtually impossible for two different symbols to produce the same ID.

  • Gas-efficient → Native opcode in the EVM.

  • Standard practice → Aligns with common patterns (e.g., ERC-20 symbol lookups).

Supported Asset IDs

Here are the current asset IDs (identical across all supported networks):

Asset
Asset ID

USDT/USD

0x6ca0cef6107263f3b09a51448617b659278cff744f0e702c24a2f88c91e65a0d

USDC/USD

0xf989296bde68043d307a2bc0e59de3445defc5f292eb390b80d78162c8a6b13d

ETH/USD

0x8c3fb07cab369fe230ca4e45d095f796c4c1a30131f1799766d4fec5ee1325c0

CNGN/USD

0x83a18c73cf75a028a24b79cbedb3b8d8ba363b748a3210ddbcaa95eec3b87b3a

BRZ/USD

0xbc60b55b031dce1ee5679098bf2f35d66a94a566124e2b233324d2bafcc6d5b5

Best Practice: Store these as bytes32 constant in your contracts to avoid runtime computation.

bytes32 public constant USDT_ASSET_ID = 0x6ca0cef6107263f3b09a51448617b659278cff744f0e702c24a2f88c91e65a0d;

Generating New Asset IDs (For Testing or Requests)

If you're requesting a new feed or testing locally:

New assets are added by the IFÁ Labs team based on demand — contact us for requests.

Next: Explore Gas Optimization Tips to make your integrations efficient.

Last updated

Was this helpful?