Testing out oraclize for a smart contract.
function __callback(bytes32 _myid, string result) public {
if (msg.sender != oraclize_cbAddress()) revert();
// emit LogOraclizeID(bytes32ToString(_myid));
// string memory number = result[0].data;
emit LogQueryEvent("Are we firing here boys?");
emit LogRandomNumber(result);
}
// This is NOT truly random. Just a proxy for basic testing.
function random() public payable returns (uint) {
if (oraclize_getPrice("WolframAlpha") > address(this).balance) {
emit LogQueryEvent("Please send some ETH along to make transaction.");
} else {
// string memory numTokensToString = uint2str(tokens.length);
// string memory queryString = "random number between 0 and ".toSlice().concat(numTokensToString.toSlice());
// oraclize_query("WolframAlpha", "random number between 0 and 2");
emit LogQueryEvent("Oraclize query was sent, standing by for the answer..");
oraclize_query("WolframAlpha", "random number between 0 and 2");
}
// return uint(keccak256(abi.encodePacked(block.difficulty, now, tokens.length)));
}
Trying to improve randomness on a particular contract. The __callback doesn't appear to fire. Testing this in remix.
Is this an issue with how I'm setting up the call, or a limitation of remix?