Given:
contract A {
address owner;
function A() { owner = msg.sender; }
}
contract B is A {
string greeting;
function B(string _greeting) { greeting = _greeting; }
}
- When I deploy my contract, I want to make sure that
owneris initialized. Do I need to call the parent constructor inB's constructor to initialize the valueownerinAlike so:function B (string _greeting) A(msg.sender) { greeting = _greeting; }, or can I just leave it as is above (it will initialize the values ofAautomatically, by automatically callingA()? - Does
Bneed its own address, or will it just useA's as its own?