Skip to content

VIP: Make the type argument in method_id optional #1980

@iamdefinitelyahuman

Description

@iamdefinitelyahuman

Simple Summary

method_id's second argument (the output type) should be optional with a default of bytes[4].

Motivation

  • Generating a 4 byte function selector is by far the most common use-case for this method
  • The 32 byte flavor is just as easily achieved using keccak256

Specification

method_id(method, output_type=bytes[4]) → Union[bytes[4], bytes32]

output_type may still be given as a positional arg so that this is not a breaking change.

Backwards Compatibility

No issues.

Copyright

Copyright and related rights waived via CC0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions