Similar code to this works in other contracts, but not this one. I'm getting a gas error: "errored: Error: gas required exceeds allowance or always failing transaction".
I've narrowed it down to the line causing the problem. What is wrong with this call, and is there any way to get a more descriptive error?
contract GuessTheRandomNumberChallenge {
uint8 answer;
function GuessTheRandomNumberChallenge() public payable {
require(msg.value == 1 ether);
}
function guess(uint8 n) public payable {
require(msg.value == 1 ether);
//do stuff
}
}
GuessTheRandomNumberChallenge public handle;
constructor() public payable {
handle = GuessTheRandomNumberChallenge(0x123123mycontractaddress);
}
function check() public {
handle.guess.value(1 ether)(83); //PROBLEM LINE
}