Skip to content

Allow use of hex literals for uint types #4344

@Philogy

Description

@Philogy

Simple Summary

Vyper doesn't allow to do the following:

MY_CONSTANT: constant(uint128) = 0xffffffffffffffffffffffffffffffff

Sometimes it's more convenient/clear to use hex as literals for units, disallowing this seems unnecessary/is annoying.

Motivation

Make Vyper easier to use.

Specification

Remove this error and allowing casting of hex literals to uint types.

Backwards Compatibility

Backwards compatible because this was previously disallowed meaning no valid contracts contained this.

Dependencies

None.

References

None.

Copyright

Copyright and related rights waived via CC0

Metadata

Metadata

Assignees

No one assigned

    Labels

    VIP: DiscussionUsed to denote VIPs and more complex issues that are waiting discussion in a meeting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions