oliviera9 on add-polygon-oar
oliviera9 on master
feat: add Polygon mainnet OAR Merge pull request #111 from pr… (compare)
oliviera9 on add-polygon-oar
feat: add Polygon mainnet OAR (compare)
oliviera9 on add-bsc-oar
oliviera9 on master
feat: add BSC mainnet OAR Merge pull request #107 from ol… (compare)
oliviera9 on add-polygon-oar
feat: add Polygon mainnet OAR (compare)
oliviera9 on add-bsc-oar
feat: add BSC mainnet OAR (compare)
oliviera9 on add-polygon-oar
feat: add Polygon mainnet OAR (compare)
oliviera9 on add-polygon-oar
feat: add Polygon mainnet OAR (compare)
@coiny123 if you use the random datasource and shown in the examples it should work fine, what happened on rinkeby exactly? Did you not get the callback or did it fail? Can you share a link to your querying tx please so that we can have a look?
@oraclize-support thank you i figured it out...i needed eth in the deployed smart contract address lol (sorry im new to solidity)
@oraclize-support cool thank you so much. abit of background we are developing an NFT game and need random number for the minting process. chainlink is out of the question so thankfully there is this option which i think is way better than using block difficulty/hash/timestamp
a few more questions
in randomexample.sol which should be the variables to change in the contract, assuming i need a number between 1 to 1000? is it only the ceiling variable? i suppose we don't mess with these two?
uint256 constant MAX_INT_FROM_BYTE = 256;
uint256 constant NUM_RANDOM_BYTES_REQUESTED = 7;
opensea NFT contracts now uses ^0.8.0. can we just change the version number in the contract? will the wolfram/ledger method API work or are there any potential issues?
@oraclize-support just tested things on Kovan and it looks like the API is partially working.
The provable_query function which doesn't take a timestamp as parameter: provable_query("URL", "https://foobar.com") is working fine, the callback gets executed without issues instantly.
However, trying to schedule the query into the future by taking a look at the current epoch (https://www.epochconverter.com/) and adding a few minutes to it, that's when the callback fails to execute. I can replicate this on every single testnet, and it kind of discourages me to try things in the mainnet with real money at the moment.
Contract code: https://pastebin.com/DjRhrkZG
Etherscan: https://kovan.etherscan.io/address/0x1d5E0B25A60B6dE63e44457290c8ef50a2189f3c
The 2 successful callbacks were executed by calling provable_query without any timestamp. The unsuccessful call due to lack of funds was also logged correctly, but no logs for the scheduled callback can be seen.
Do you have any idea as to why only scheduled calls to Provable could be failing?
pragma solidity >= 0.5.0 < 0.6.0;
import "github.com/provable-things/ethereum-api/provableAPI_0.5.sol";
contract YoutubeViews is usingProvable {
string public viewsCount;
event LogYoutubeViewCount(string views);
event LogNewProvableQuery(string description);
function __callback(
bytes32 _myid,
string memory _result
)
public
{
require(msg.sender == provable_cbAddress());
viewsCount = _result;
emit LogYoutubeViewCount(viewsCount);
// Do something with viewsCount, like tipping the author if viewsCount > X?
}
function update()
public
payable
{
emit LogNewProvableQuery("Provable query was sent, standing by for the answer...");
provable_query("URL", 'html(https://www.youtube.com/watch?v=9bZkp7q19f0).xpath(//*[contains(@class, "watch-view-count")]/text())');
}
constructor()
public
{
update()
}
}
@gwills:[matrix.org](http://matrix.org) probably remix doesn't support github sym link anymore. Try to replace the import string with the following one:
import "github.com/provable-things/ethereum-api/provableAPI_0.5.sol";
This should compile fine