1

I have contract that return random numbers using oraclize.it deployed to Ropsten. I am running local node using Parity and connected Remix to it. Contract deployed by Remix and when I making transfer it works correectly (transactions 0xe364fa6e75e8dee7bea419345c8d28a5f1cabbb1192fff5aaffd77d3eae710af and 0x93a85b04e1c02020e96f3d2c17efa5457d7a27de7e2c7cc931320cf8f3842733 for instance). But when I trying to send money using Parity web ui it always failed with meaningless "Bad instruction" error (in Parity I see "transaction may be run out of gas" error).

How it could be at least debugged? Because I am totally stuck why it works by one transfer way and does not - by another.

UPD: The same issue with Mist. I found that Remix and console web3 performs function call, not funds transfer. Exactly this breaks the contract.

Here is contract source:

pragma solidity ^0.4.0;

import "./oraclizeAPI_0.4.sol";

contract GetRandom is usingOraclize {
    event newRandomNumber(bytes);
    event numbers(uint n1, uint n2, uint n3);

    function GetRandom() {
        oraclize_setProof(proofType_Ledger);
    }

    function __callback(bytes32 _queryId, string _result, bytes _proof) oraclize_randomDS_proofVerify(_queryId, _result, _proof) {
        // if we reach this point successfully, it means that the attached authenticity proof has passed!
        if (msg.sender != oraclize_cbAddress()) throw;

        bytes memory n = bytes(_result);

        numbers(uint(n[0]), uint(n[1]), uint(n[2]));
        newRandomNumber(n);
    }

    function update() payable {
        uint N = 3; // number of random bytes we want the datasource to return
        uint delay = 0; // number of seconds to wait before the execution takes place
        uint callbackGas = 200000; // amount of gas we want Oraclize to set for the callback function

        // this function internally generates the correct oraclize_query and returns its queryId
        bytes32 queryId = oraclize_newRandomDSQuery(delay, N, callbackGas);
    }
}
  • 1
    You do not have to create the same question again, you can edit your question to add more details. – Ismael Jul 16 '17 at 2:02