At the moment of writing this documentation, Chain contract supports only numeric (
FCD are part of the consensus mechanism, that means they are verified by validators and once they are submitted to
Chain, there is no need for any additional verification.
There is limited number of FCD, they are chosen based on validators configuration and usually they aim to be most popular, most wanted data... first class data :)
FCD, similar to Layer2 Data, are
key->value pairs. In order to get the value you looking for, you need to know the key. FCD are stored with a timestamp, so L1 applications can access it and check if this FCD is up to date or not.
Chain Contract stores only latest values. That means when new consensus happens, values are overwritten.
FCD can be added and removed over time
Your contract should always check the timestamp of the selected FCD to ensure it's in your acceptable range.
There are few reasons:
- If validators can't agree on a value during the consensus round, this particular key-value pair will not be included in this round of updates, and so the value for this particular key will not be updated (timestamp will be old / remain unchanged)
- This is configurable and configuration can change
That's why you should always check the timestamp for the FCD you are using and decide if data is fresh enough for your purpose.
FCDs are configurable and can change over time. The full list of FCD keys can be retrieved from our API with the
Updated about 1 year ago