Private → Can only be called from that particular contract. This is not private!!! > web3.eth.getStoragedAt(contract.address, slotsNum) Internal → Can be called from that contract and derived contracts. External → Can be called from external sources. Public → Can be called from everywhere.
This is not private!!!
A Quick Guide to Hack private variables in Solidity
if you want to understand the concept of “private”, you have to know what is storage ?
Virtual and Override
contract Parent {
uint u;
function Test() public virtual{
u = 1;
}
}
contract Child is Parent {
function Test() public override{
u = 2;
}
}