Try with this: pragma solidity ^0.5.1; contract MKotET1_12{ address payable king; uint public claimPrice = 100; function calculateCompensation() public returns(uint) {} function() external payable { if (msg.value < claimPrice) revert(); uint compensation = calculateCompensation(); (bool success, ) = king....


You are getting a reversion because a call returns two values and you are treating it as one. When performing king.call.value(compensation)(""), what you actually receive back is the success bool and the bytes response. As it stands, you are trying to check for the bool value, but ignoring the fact that it also returns a response. Your code should look as ...


You do not need to explicitly state the second variable declaration. You can write it as follows: (bool success, ) = king.call.value(compensation)(""); require(success);

Only top voted, non community-wiki answers of a minimum length are eligible