0

The solidity documentation says that

Everything that is inside a contract is visible to all external observers. Making something private only prevents other contracts from accessing and modifying the information, but it will still be visible to the whole world outside of the blockchain.

What does this boil down to? Of course that the node running code involving a private member knows its type and value and that given the contract address you could get this info as well. But is there anything more to this transparency? I guess that in order to find anything else about the private member you would have to do some serious reverse engineering (assuming that you do not have an ABI).

0

You are correct. Only public members are part of the contract ABI. You can call public functions and query the value of public variables.

On the other side private functions cannot be called directly, the function dispatcher will not find then and it will call to the fallback function if exists.

Private variables have space reserved in the contract storage, but cannot be read directly because the public getter is not generated. But if you know the position in the storage you can access the value with web3.eth.getStorageAt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.