Consider in a contract the payer intends to pay recipient ETH based on USD (ex. the salary is 1 USD but paid by ETH).

So, if today contract needs to know equivalent value of 1 ETH in USD exactly at time of payment.

For this, contract needs to access to some external sources to know the price of the day of ETH in USD.

I want to use ex. THIS WEB SITE as data-source. How can I fetch the price of ETH from this website as an ex. integer value ?

Is there a sample of such contract / data-source as an example ?

  • I think this sample contract: link does this query. – Questioner Aug 20 '18 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.