solidity
                                
                                
                                
                                    solidity copied to clipboard
                            
                            
                            
                        Include enums in the ABI
For a while internal types are exposed in the ABI, which can be used to do type checking stricter than the encoding allows.
Such an example when enums are used in an interface (see #595):
      {
        "indexed": false,
        "internalType": "enum I.MyEnum",
        "name": "b",
        "type": "uint8"
      }
The proposal is to include a new entry in the ABI for enums:
{
  "type": "enum",
  "name": "MyEnum",
  "min": 0,
  "max": max
}
The min is hardcoded at 0 as enums are encoded as uint8 currently, but leaving the field for future compatibility.
I think we should use the type field only for things that also appear in the signature. If you want to look up additional information for the type, I think you should use the AST instead.
This issue has been marked as stale due to inactivity for the last 90 days. It will be automatically closed in 7 days.
Hi everyone! This issue has been automatically closed due to inactivity. If you think this issue is still relevant in the latest Solidity version and you have something to contribute, feel free to reopen. However, unless the issue is a concrete proposal that can be implemented, we recommend starting a language discussion on the forum instead.