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.
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. – Richard Horrocks Apr 5 '19 at 17:23