Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 23 21:52

    D-Nice on master

    chore(ci): improve pipeline Merge pull request #97 from pro… (compare)

  • Jul 23 21:51
    D-Nice closed #97
  • Jul 23 21:51
    D-Nice commented #97
  • Jul 23 21:51
    D-Nice assigned #97
  • Jul 23 21:51
    D-Nice opened #97
  • Jul 23 21:44

    D-Nice on ci-streamline

    chore(ci): improve pipeline (compare)

  • Jul 23 20:01

    D-Nice on ci-streamline

    chore(ci): improve pipeline (compare)

  • Jul 23 19:37

    D-Nice on ci-streamline

    tmp ci test (compare)

  • Jul 23 19:37

    D-Nice on ci-streamline

    tmp ci test (compare)

  • Jul 23 19:35

    D-Nice on ci-streamline

    tmp ci test (compare)

  • Jul 23 19:35

    D-Nice on ci-streamline

    tmp ci test (compare)

  • Jul 23 19:34

    D-Nice on ci-streamline

    (compare)

  • Jul 23 19:33

    D-Nice on ci

    (compare)

  • Jul 23 17:39

    D-Nice on api-symlink

    (compare)

  • Jul 23 17:39

    D-Nice on master

    fix: broken api symlink Merge pull request #96 from pro… (compare)

  • Jul 23 17:39
    D-Nice closed #96
  • Jul 23 16:32

    D-Nice on ci

    (compare)

  • Jul 23 15:24

    D-Nice on ci

    test commit (compare)

  • Jul 22 22:10
    D-Nice assigned #96
  • Jul 22 22:10
    D-Nice review_requested #96
donz
@donz28321342_twitter
Do you mean this check?
Oraclize Support
@oraclize-support
@donz283213342_twitter - no, it would be a check of your own writing that would allow you to handle the case where no _result is returned in the case of an error, so that you could handle it accordingly.
donz
@donz28321342_twitter
I have try many times but get the same error
is that all because of no _result?
Oraclize Support
@oraclize-support

@donz283213342_twitter - you will keep getting that same error, because the _result that's being returned is currently an empty string due to an ongoing issue on our end.

The other suggestion was simply to add in a check to handle such an eventuality accordingly by checking for an emptry string in your smart-contract's __callback

donz
@donz28321342_twitter
You will fix that soon,right?
Oraclize Support
@oraclize-support
@donz283213342_twitter: absolutely, we're sorry for the current inconvenience and will update in here and on the status page as soon as the service returns to normal.
donz
@donz28321342_twitter
Got it, thanks
Tiago Bértolo
@bertolo1988
@oraclize-support something wrong with your service? It worked well on Ropsten in remix, on mainnet it fails. https://etherscan.io/tx/0xd9ea710de04be0480e1658e8eb3a23ee0097b0c8a3516bc1ad4c74a03a56fe80
How does cbAddress get initialized?
Oraclize Support
@oraclize-support
@bertolo1988 there are some service issues we are experiencing and being worked on, as posted a few posts before this one, which is trackable via the service page.
Oraclize Support
@oraclize-support

as a quick note, it affects the random ds specifically.

Another note about your contract, you should be using the onlyProvable(or onlyProvable depending on API) modifier instead, instead of manually trying to check the cbAddress, as that doesn't actually return an address, but instead a bool as to whether the sender and tx orginator are in fact the same and a provable callback address

Tiago Bértolo
@bertolo1988
Contract is deployed already. Is the change very significant?
During compilation and deployment, how does the oraclize Class know where your service is deployed?
Oraclize Support
@oraclize-support

@bertolo1988 best case the contract doesn't work properly, worst case, its funds become exploitable. The code change is minimal work, but has a major footprint potential.

It utilizes a long deployed contract (several years) called the OracleAddressResolver whose address is hardcoded, which simply contains the address of the latest Provable Connector and, which is essentially the on-chain logic or class. All the underlying mechanisms are open-sourced for this

Tiago Bértolo
@bertolo1988
Allright, I will change. Thanks.
marcos-iov
@marcos-iov

Another note about your contract, you should be using the onlyProvable(or onlyProvable depending on API) modifier instead, instead of manually trying to check the cbAddress, as that doesn't actually return an address, but instead a bool as to whether the sender and tx orginator are in fact the same and a provable callback address

Are you saying this line doesn't work? if (msg.sender != provable_cbAddress()) revert();

That's on the example contract on https://docs.provable.xyz/#ethereum-quick-start
Oraclize Support
@oraclize-support

Hi @marcos-iov - nope, you have it correctly, though now in our github examples we drop the explicit if & revert() in favour of the neater require(msg.sender == provable_cbAddress());.

You can see them all here: github.com/provable-things/ethereum-examples

Tiago Bértolo
@bertolo1988
Tiago Bértolo
@bertolo1988
@oraclize-support any change I have to do in the code to update to provable? My code doesn't seem to be working in Ropsten. SStatus says Ropsten is operational. Code: https://gist.github.com/bertolo1988/1b0c695386cb049ee094b0d2ee9a1129
All I did was replace oraclize with provable.
grandmullah
@grandmullah
Hey @oraclize-support how long does it take to spin up computational data source
Oraclize Support
@oraclize-support
@grandmullah - it's very fast, but we don't have an exact number - why do you ask?
@bertolo1988 - it looks as though your updated contract is correctly done - how is it not working?
Tiago Bértolo
@bertolo1988
@oraclize-support I made an experiment. I added a simple event such as: event logDebugString(address indexed _from, string output);
And changed my callback to:
    function __callback( bytes32 _queryId, string memory _result, bytes memory _proof ) public {
        emit logDebugString(msg.sender, 'here1');
        require(msg.sender == provable_cbAddress());
         emit logDebugString(msg.sender, 'here2');
        require(ongoingBets[_queryId].sender != address(0x0) , 'query does not exist');
         emit logDebugString(msg.sender, 'here3');
        if(provable_randomDS_proofVerify__returnCode( _queryId, _result, _proof) != 0){
            emit logDebugString(msg.sender, 'here4');
            revert();
        } else {
            emit logDebugString(msg.sender, 'here5');
            uint ceiling = (MAX_INT_FROM_BYTE ** NUM_RANDOM_BYTES_REQUESTED) - 1;
            emit logDebugString(msg.sender, 'here6');
            uint randomNumber = uint(keccak256(abi.encodePacked(_result))) % ceiling;
            uint spin = (randomNumber % 100) + 1;
            emit logDebugString(msg.sender, 'here6');
            Bet memory bet = ongoingBets[_queryId];
            if(spin < bet.spinUnder){
                addAmountToUser(bet.sender, bet.prize);
            }
            emit logBetSuccess(bet.sender, spin, bet.spinUnder, bet.stake, bet.prize, bet.payout, balances[bet.sender]);
            delete ongoingBets[_queryId];
        }
    }
Deposited, did setup everything as expected.
Placed a bet, everything went well until the callback.
No logDebugString events were received.
Something is not right.
Oraclize Support
@oraclize-support
@bertolo1988 your contract on first glance appares to look correct. As we had mentioned earlier, the Random Datasource service which you are attempting to use, is currently down for us, and we are working on getting it back up, and will report in this channel when it is, you can also track the status on status.provable.xyz
Tiago Bértolo
@bertolo1988
oh
so that is it?
:D
I was going to ask you next if provable_randomDS_proofVerify__returnCode( _queryId, _result, _proof) != 0 is working cause it seems its not!
Oraclize Support
@oraclize-support
Yes, for now you can presume it's not on your end, as the Random Datasource is down, so it would be expected that your contract won't work. We're also taking measures to ensure it doesn't happen in the future.
Tiago Bértolo
@bertolo1988
PErfect, thanks. I was getting crazy.
<3
Do you want me to make a PR to update your randomSource example?
Oraclize Support
@oraclize-support
Apologies for the inconvenience, but on the bright side your code seems okay
Tiago Bértolo
@bertolo1988
Yes.
You have been amazing, thanks.
Oraclize Support
@oraclize-support
If you would like yes, contributions are always welcome
Tiago Bértolo
@bertolo1988
(on not so positive not i spent 100$ with some error on mainnet)
(didn't even see it go, jeez)
Oraclize Support
@oraclize-support
sorry to hear, albeit we will attempt to run recoveries on any such queries that were done and can be rebroadcasted with valid random input
Tiago Bértolo
@bertolo1988