Usage
The Oracle maintains updates as a mapping, where each key maps to a Data struct containing the latest timestamp and value. Theupdates
mapping is a key-value store where:
- Key: A unique identifier, typically a string, representing the asset or data type (e.g., DIA/USD, BTC/USD).
- Value: A Data struct containing:
- key: The identifier of the data entry (redundant for reference but useful for integrity checks).
- timestamp: The timestamp of the latest update.
- value: The most recent value associated with the key.
DIAOracleSample
contract that consumes the BTC/USD
price feed:
DIA/USD
).