I would like to have a single owner across the parent contract and child contracts that this parent creates. However, when the child contract is created, it redeploys the library and uses the parent contract as the msg.sender. This makes sense, but I was wondering if there is a way to use the parents library instead of deploying a new instance of it.
contract Owned {
address public owner;
function Owned() public {
owner = msg.sender;
}
}
contract A is Owned{
B b;
function A() {
b = new B();
}
}
// This contract deploys another Owned library with contract A as the owner
contract B is Owned {
address parent;
function B() {
parent = msg.sender;
}
}