Let's assume the following:

  • There is a master contract A, an interface contract IB, and a slave contract B
  • A implements IB to allow upgrading B without redeploying A


Does IB need to have all functions of B, or only the ones used by A?

  • Interfaces don't implement contracts: contracts implement interfaces. What is the inheritance chain here? A->IB->B ? Seems odd and IB doesn't have to implement anything. Or is it an interface I with contracts A and B implementing I? What goes in I would be what you require both A and B to implement: A and B can each have extra functions. – eth Feb 10 '17 at 6:15

According to my experience in the following code


it is enough implementing those ones you are using. In the example:

/// ---- dataStorage interface
contract dataStorage {
    function getBalanceOf(address _account) constant returns (uint256 balance);
    function setBalanceOf(address _account, uint256 _value);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.