I know that only the first call to oraclize_query is free but i don't know how to send the small fee requested. Can you give a code sample ?



Marco from Oraclize here.

The fee is taken automatically from the smart contract balance when you call oraclize_query. There are two possible cases then:

  • The smart contract has already the funds in its balance before oraclize_query gets called
  • The smart contract has zero balance, but then the transaction which execute the function with the oraclize_query call must carry some value to pay the fee. A reminder: the function then must have the payable modifier in order to be able to accept value.

You can see an example here

If you want to know exactly how much the call is going to cost you:

uint oraclizeFee = oraclize_getPrice(datasource)

where you specify the datasource from the list that you can find on the docs

If you have any more questions, feel free to ask also on our gitter channel

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.