I have several questions regarding contract abstraction
contract A {
address owner;
uint randomVariable;
function A(uint _randomVariable) {
owner = msg.sender;
randomVariable = _randomVariable;
}
}
contract B is A {
address owner;
uint randomVariable2;
function B(uint _randomVariable2) {
owner = msg.sender;
randomVariable2 = _randomVariable2;
}
function changeOwner(address _newOwner) {
owner = _newOwner;
}
}
1 how does this exactly work? In the end A and B are the same Contract called B right? Because they get deployed at the same address right?
2 How are the variables treated in this contract? we have two variables called owner which get set to the same address. is this the same variable? what happens if we change the owner in contract B
3 how does the call of the constructor behave? When I create the contract, do I call the constructor seperately or is it merged and I have to pass the first and second random variable?