2

Is there any way to have an abstract base contract with an abstract function which gets implemented in a derived contract by a property (and not a function)?

e.g. the following attempts failed:

contract Base {
    //function f() public returns (uint256);
    function f() external view returns (uint256); // also not working
}

contract Derived is Base {
    uint256 public f;
}

In all cases Derived is still abstract because it does not implement f from the Base contract although the ABI is identical. A typical scenario is e.g. a tokens which implements the ERC20 interface an totalSupply might just be implemented with a property and not a getter and a property (in most simple cases that would suffice).

0

Known issue

This is a known problem, with an open issue in the solidity bug tracker.

Please see: https://github.com/ethereum/solidity/issues/3514

| improve this answer | |

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.