0

I'm trying to migrate a contract into a ganache chain. It needs to use Oraclize - in the end, the plan is to have a private chain using Oraclize via ethereum-bridge. However, truffle migrate fails with the message:

Error:  *** Deployment Failed ***

"VatValidator" hit a require or revert statement somewhere in its constructor. Try:
   * Verifying that your constructor params satisfy all require conditions.
   * Adding reason strings to your require statements.

    at /Users/alex/.nvm/versions/node/v10.15.3/lib/node_modules/truffle/build/webpack:/packages/truffle-deployer/src/deployment.js:364:1
    at process._tickCallback (internal/process/next_tick.js:68:7)

Here's the contract:

pragma solidity >=0.5.0;
import "./Oraclize.sol";

contract VatValidator is usingOraclize {

    string public isValid;

    event newOraclizeQuery(string description);
    event newVATResult(string price);


    constructor() public {
        // oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);
        OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
    }

    function __callback(bytes32 myid, string memory result, bytes memory proof) public {
        require (msg.sender != oraclize_cbAddress());
        isValid = result;
        emit newVATResult(isValid);
        update();
    }

    function update() public payable {

        emit newOraclizeQuery("Oraclize query was sent, standing by for the answer.");

        oraclize_query("URL", "json(http://url.com).valid",'{"arg1":"abc", "arg2":"def"}');

    }
}

I don't have any revert or assert statements at all in the constructor however.

5
  • Hi there. I haven't played around with Oraclize for a while, but from what I remember you'll need to use ethereum-bridge to give the Oraclize contract/API something to talk to. (github.com/oraclize/ethereum-bridge) That's assuming you haven't done so already. Apr 5, 2019 at 17:23
  • Actually that's my plan, just added in the question. Still no difference.
    – Alex
    Apr 5, 2019 at 17:24
  • That's annoying. Does it work if you use the Javascript VM in Remix, together with the Oraclize plugin (under Settings)? Apr 5, 2019 at 17:27
  • @Richard Yes, that works
    – Alex
    Apr 5, 2019 at 18:12
  • Do you have the bridge up and running before you try and migrate?
    – gskapka
    Apr 10, 2019 at 14:05

0

Your Answer

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

Browse other questions tagged or ask your own question.