My deployed contract called successfully only by "function invocation" through web3 or Remix. But it always failed when I sending funds to the contract.
I thought that only requirement that contract has payable
function but maybe it is not enough?
Contract looks like:
contract GetRandom is usingOraclize {
event newRandomNumber(bytes);
function GetRandom() {
oraclize_setProof(proofType_Ledger);
update();
}
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;
newRandomNumber(bytes(_result));
}
function update() payable {
uint N = 7; // 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);
}
}