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.
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 ...
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).
I fiddled with code formatting in the original question. The first issue is this line:
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 ...
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 ...