Consider the following file
contract A {
}
contract B{
}
contract C{
}
Is a file like that valid? Can a .sol file contain multiple contracts as above? If yes, which contract would the deploy address point to?
Now consider the following file
contract A{
}
contract B{
}
contract C is A, B {
}
contract D is A, B, C {
}
Solidity docs say,
When a contract inherits from other contracts, only a single contract is created on the blockchain, and the code from all the base contracts is compiled into the created contract.
So how does solidity identify which contract to compile the bytecode for, is it the most derived contract? If someone interacts with the deployed address, which contract would be serving them?