So instead of doing something like:
contract Parent {
...
}
contract Child is Parent {
...
}
Can the Parent be declared referencing an already deployed contract?
contract Parent = 0x123123123...
contract Child is Parent {
...
}
So instead of doing something like:
contract Parent {
...
}
contract Child is Parent {
...
}
Can the Parent be declared referencing an already deployed contract?
contract Parent = 0x123123123...
contract Child is Parent {
...
}
No, the compiler cannot determine the ABI of the Parent contract from the bytecode on the blockchain, so this will not work.
Given that you might be able to repurpose an existing contract as described here I guess this might work with some work-arounds. I think this would be very interesting to explore but cannot give details.
https://docs.rulerprotocol.com/
This protocol continuously issues new tokens which have the same behavior (same functions), and only different names. In its implementation , it clones a parent token using library Clones, which interacts with the Ethereum Virtual Machine using inline assembly.