I have been trying to deploy and test the basic "SimpleDice" smart contract provided as an example from Oraclize.

I have had to adjust it to work with solidity 0.4.2 a bit, but maybe I am missing something, maybe Oraclize is bugging out.

The smart contract can be found here: https://testnet.etherscan.io/address/0xe1b0d1eecc126b96f94cf55e6cf525ccae4bf0d8

EDIT: I have also deployed a second contract at https://testnet.etherscan.io/address/0xe25229cc19b5044f7cbe0c20abf9972c77b1e36c with more balance, this fixes the invalid jumps however I STILL see no callbacks being executed

I have the following code (note, usingOraclize.sol is the file located at https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.4.sol ):

pragma solidity ^0.4.2;

import "usingOraclize.sol";

contract SimpleDice is usingOraclize {
    address owner;
    mapping (bytes32 => address) bets;

    function SimpleDice(){
        owner = msg.sender;

    function() payable {
        if (msg.sender != owner) throw;

    function __callback(bytes32 myid, string result) {
        if (msg.sender != oraclize_cbAddress()) throw;
        if (uint(bytes(result)[0]) - 48 > 3) {
            if (bets[myid].send(2 wei)) {

    function bet() payable {

    function rollDice() {
        bytes32 myid = oraclize_query("WolframAlpha", "random number between 1 and 6");
        bets[myid] = msg.sender;

    function kill(){
        if (msg.sender == owner) suicide(msg.sender);

This code compiles and deploys just fine. However notice the following issues:

1) The first time I call bet() it seems to work fine. HOWEVER as you may see, Oraclize never executed what it was supposed to and/or never called my __callback function

2) The subsequent times I call bet, the transaction fails with an "invalid jump destination"

3) The subsequent calls cost a lot of gas which is completely lost every time.

Does anyone have any idea what the heck is going on? thanks a lot!

3 Answers 3


Thomas from Oraclize here.

The issue was geth-related and being experienced on the Morden testnet only (events filters were all messed up - the exact issue in geth is still being investigated).

We have enabled parity-based events listeners on the testnet as well - all the pending queries have now been processed (including yours), my apologies for the delay.

  • It happens, thank you though! Good to know I'm not going entirely crazy yet ;-)
    – KennyV
    Commented Oct 21, 2016 at 9:15
  • Could this be happening right now with the Rinkeby network? I'm not getting a __callback trigger form my contract either : \
    – okwme
    Commented Oct 2, 2017 at 21:14

Did you send enough Ether with your request? The costs do apply to Morden as well!

I had similar problems and had to send about 1 ETH with my request (at least it worked then, less might have been enough, but 1 ETH worked always). Of course, I only did this in Morden.

  • This may have changed since then, this should be handled automatically, if you check out the internal transactions you'll see the fee being sent.
    – KennyV
    Commented Oct 20, 2016 at 15:04

Make the constructor payable too. Refer the following code.

constructor() public payable{
        owner = msg.sender;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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