currently, I'm practicing solidity. However, I'm a little confused about accessing a private variable in a contract.

For example here;

```
address private a;
address private b;
mapping (bytes32 => uint) public people;
mapping (bytes32 => mapping(address => uint)) public listOfEmp;
bytes32[] public list;
bytes32 private z;

```

I can access 'a' with

```
web3.eth.getStorageAt("0x501...", 0)

```

How can I access 'z' here? From a different contract.

Thank you
['https://Stackoverflow.com/questions/50493197', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6181020/']
You can access the storage of your contract even if it's private.

Try this:

```
web3.eth.getStorageAt("0x501...", 5)

```

If you want to access the map or array, check this document for layout of state variables: <https://solidity.readthedocs.io/en/v0.4.24/miscellaneous.html>

By the way, you should always use getProof to validate the value.
I don't believe you can. A private variable is meant to only be used within the contract in which it is defined.
See here: <http://solidity.readthedocs.io/en/v0.4.21/contracts.html>