password
private variable
contract Vault { bool public locked; @> bytes32 private password; constructor(bytes32 _password) { locked = true; password = _password; } function unlock(bytes32 _password) public { if (password == _password) { locked = false; } } }
contract addess
storage layout
cast commands
cast storage --rpc-url $SEPOLIA_RPC_URL --etherscan-api-key $ETHERSCAN_API_KEY CONTRACT_ADDRESS SLOT_NUMBER
Go to Etherscan and search for contract address
Etherscan
contract address
Copy and explore the TNX hash from internal transactions
TNX hash from internal transactions
state
storage value
Nice point here, private in Solidity means visibility not secrecy, love the practical cast tip, how many devs still stash secrets on chain?