There are four types of access in solidity:
- public - can be used when contract was deployed, can be used in inherited contract
- external - can be used when contract was deployed , can NOT be used in inherited contract
- internal - can NOT be used when contract was deployed , can be used in inherited contract
- private - can NOT be used when contract was deployed, can NOT be used in inherited contract
pragma solidity ^0.8;
contract Parent {
bool internal internalProperty;
bool private privateProperty;
}
contract Child is Parent {
function foo() external {
// ok
internalProperty = true;
// error, not visible
privateProperty = true;
}
}