Chainlink interfaces allow real time data to be injected to a smart contract. A common use for this is to obtain the live trading price of a token. By using Chainlink's Aggregator V3 Interface we can extract the price out of a tuple to use in our code. However, as with many things in Solidity, we need to be careful abput the number of decimals in the returned value and be sure to convert it as necessary. The Goerli test net value returns with 8 decimals, so must be converted into wei or USD as appropriate.
Subscribe to:
Post Comments (Atom)
190: Sablier
The CodeHawks platform has an upcoming audit on the Sablier protocol, so I decided to read through the docs and familiarize myself with the...
-
The CodeHawks platform has an upcoming audit on the Sablier protocol, so I decided to read through the docs and familiarize myself with the...
-
The ZKasino project recently exit scammed over 33 million dollars worth of Ethereum. he recent debacle surrounding ZKasino offers valuable...
-
In addition to its native SDK, Hedera also supports smart contracts in a platform compatible with the Ethereum Virtual Machine. This allows ...
No comments:
Post a Comment