npm
plus the ethereum-bridge, so we'll look into that fix. Meanwhile, have you tried our examples that use truffle here: https://github.com/provable-things/ethereum-examples/tree/master/solidity/truffle-examples?
@oraclize-support I am trying the code from provable documentation
// SPDX-License-Identifier: GPL-3.0
pragma solidity > 0.6.1 < 0.7.0;
import "github.com/provable-things/ethereum-api/provableAPI_0.6.sol";
contract ExampleContract is usingProvable {
string public ETHUSD;
bytes32 public queryId;
event LogConstructorInitiated(string nextStep);
event LogPriceUpdated(string data,string price);
event LogNewProvableQuery(string description);
event LogCallbackCalled(string data);
constructor() public payable {
provable_setCustomGasPrice(10000000000);
emit LogConstructorInitiated("Constructor was initiated. Call 'updatePrice()' to send the Provable Query.");
}
function __callback(bytes32 myid, string memory result) public override {
emit LogCallbackCalled("Callback called");
if (msg.sender != provable_cbAddress()) revert();
ETHUSD = result;
emit LogPriceUpdated("Update done",result);
}
function updatePrice() public payable {
if (provable_getPrice("URL") > address(this).balance) {
emit LogNewProvableQuery("Provable query was NOT sent, please add some ETH to cover for the query fee");
} else {
emit LogNewProvableQuery("Provable query was sent, standing by for the answer..");
queryId = provable_query("URL", "json(https://api.pro.coinbase.com/products/ETH-USD/ticker).price");
}
}
}
The __callback function is not called on the rinkbey network and the queryId I am getting is showing does not exist on query status search.
@oraclize-support i've tried ropsten, kovan and goerli. Also, I verified and published code for ropsten. For more info, I've tried exec test-query on app.provable and get "timed out" after infinite loading.
https://ropsten.etherscan.io/tx/0x94047ac6b2beaa935a7532ee78d74e4299f58162931fe1b099764abcf73b366d
https://kovan.etherscan.io/tx/0xdc387864f34bcc04a6a63898149fbf15837604eaafdf600b1b72837de9be89fb
https://goerli.etherscan.io/tx/0x25d6af208316e8254f56a5bba3dc32615c4bfdd0a168dd50ee1c562a8eb2e541
@oraclize-support I have written the same thing which was in the documentation
function __callback(bytes32 myid, string memory result) public override {
emit LogCallbackCalled("Callback called");
if (msg.sender != provable_cbAddress()) revert();
ETHUSD = result;
emit LogPriceUpdated("Update done",result);
}
What's wrong in this code??