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 {
...
}
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communitySo 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.