2

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....


2

The EVM bytecode (compiled form) is available/observable to all users at all times. The data in contract states, including variables explicitly marked private, is available/observable to all users at all times. private describes visibility to other contracts but it is a misunderstanding to assume it implies protection for confidential information. ...


1

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 ...


1

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);


1

Since all of the eventinloop events will be emitted in a single transaction, you will see the list of all events in the single calc() transaction. There is no way to react to the first event in the loop, before the second loop is executed (as transactions are atomic, so all events are emitted in a single transaction).


1

I fiddled with code formatting in the original question. The first issue is this line: bal+n; It should be bal = bal + n; to do something, or the shorthand, bal += n; but we will still have a problem. What is n? That's the complaint. In C you send(n). n has meaning in that context but the variable name is not transmitted. It's an amount of ether ...


1

To add further information about this issue, need to check if proper events are emitted. Looking at ABI: https://api.etherscan.io/api?module=contract&action=getabi&address=0x93ed3fbe21207ec2e8f2d3c3de6e058cb73bc04d The ABI does not show emit'ted events. So I think the MANUAL PROCESS is required. Note that some popular ERC20-like tokens such as ...


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