1

I understand that you "cannot define enums" in an interface contract; but, in the contract that I am working with, some of the function declarations require an enum type as an input or output parameter. The following will not compile.

interface Interface {
    enum EnumType { Option, OtherOption } 
    function initiateProvider(bytes32, EnumType, uint256, uint256);
    function getProvider(address, bytes32) view returns (EnumType, uint256, uint256);
}

Is it best to just define the enum in the contract and call it an abstract contract instead, or is there another way to do this?
Is there any real difference in it being an abstract contract vs an interface, or is this just a difference in terminology?

Your Answer

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

Browse other questions tagged or ask your own question.