EVM Oracle
This page contains an overview over the different smart contract interfaces deployed by DIA.
DIA uses three different smart contracts for its oracles, depending on the use cases for each deployment. Its definitions are listed here. To learn how to access a foreign smart contract (such as our oracles) from your own smart contract, have a look at this tutorial.
You can request a custom oracle for your specific use case by submitting a CDR. Find out more here:
Request an oracleDIA Key-Value Oracle Contract V2
Key/Value oracle can be added as an interface in other contracts using all current Solidity versions with the visibility change of the getValue()
function from public
to external
.
The smart contract is audited and the audit can be found here:
To access the key-value oracle, you first need to know the key of the data you are interested in. On querying getValue(key)
, the oracle returns the latest value for that key and the timestamp of its last update. This key is a string and each update emits an event containing the key of the updated value.
Find out more about accessing the oracles with code samples and libraries in the following page:
Access the OracleThe response value is an integer in a fix comma format and the timestamp associated with each value is a Unix timestamp for the UTC timezone.
Gas Estimation
All DIA oracles use the go-ethereum gas estimation to estimate the gas costs for an update contract call. To ensure timely delivery of the transaction, the gas estimate is scaled to 110% of the original estimate.