Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: smajbr on April 10, 2019, 12:16:32 PM



Title: How Data Feed in smart contract?
Post by: smajbr on April 10, 2019, 12:16:32 PM
Hello everyone, I'm needing your help: D

How can I get the ETH price data in my contract in solidity language?

I tested chainlink, until I got the testnet price, but I could not get the price to my contract.

I would get the price every time someone send or withdraw features.
Can anyone help?

Thank you.


Title: Re: How Data Feed in smart contract?
Post by: magpie_lover on April 10, 2019, 03:44:13 PM
Hello everyone, I'm needing your help: D

How can I get the ETH price data in my contract in solidity language?

I tested chainlink, until I got the testnet price, but I could not get the price to my contract.

I would get the price every time someone send or withdraw features.
Can anyone help?

Thank you.

Since this is a programming related question you'll need to ask this in Stack Overflow or some other forums related to Solidity programming. Btw, have you looked at Oraclize (http://www.oraclize.it/)?  Smart contracts interact with the outside world through oracles and Oraclize is a provider. They have published code for sample apps on their Github. For example, here is the Kraken Cryptocurrency Price Tracker sample app (https://github.com/oraclize/ethereum-examples/blob/master/solidity/KrakenPriceTicker.sol)


Title: Re: How Data Feed in smart contract?
Post by: bitmover on April 10, 2019, 06:39:25 PM
Smart contracts interact with the outside world through oracles and Oraclize is a provider. They have published code for sample apps on their Github. For example, here is the Kraken Cryptocurrency Price Tracker sample app (https://github.com/oraclize/ethereum-examples/blob/master/solidity/KrakenPriceTicker.sol)

He tested with chainlink, which is also an Oracle. I believe itīs more developed, as it has already launched a testnet and is now around40 rank on CMC.

But i believe itīs still soon for this kind of use...


Title: Re: How Data Feed in smart contract?
Post by: Bitcotalk on April 13, 2019, 05:53:38 AM
Hello everyone, I'm needing your help: D

How can I get the ETH price data in my contract in solidity language?

I tested chainlink, until I got the testnet price, but I could not get the price to my contract.

I would get the price every time someone send or withdraw features.
Can anyone help?
I don't understand what you are trying to say, how can you get the price of eth writing a smart contract when the price of a coin is not embedded in the code of the coin but rather in the exchange were they are being traded. So what you need to do is to is to call Api from this exchange where ethereum is traded, you can try making use of coinbase because there is no way to call the price of eth from a contract code.


Title: Re: How Data Feed in smart contract?
Post by: smajbr on April 18, 2019, 06:47:41 AM

Oops, thanks for the answers, I got through contractfiat he gives me the ETHUSD price per hour.
for now is good, since the contract guarantees the price. Closed cap
Thanks for your help.