Skip to content

VIP: Use uint256 for public array getters #1983

@iamdefinitelyahuman

Description

@iamdefinitelyahuman

Simple Summary

When an array is declared public, the generated getter should accept uint256 instead of int128 in order to handle the lookups.

Motivation

We do not allow array lookups with negative numbers, so the use of int128 is unintuitive.

Specification

As an example, the following variable:

foo: public(address[3])

Should produce a getter with the following signature:

def foo(arg0: uint256) -> address: constant

Backwards Compatibility

This is not a breaking change, but it does amount to a deviation in expected behavior.

Dependencies

Not dependent, but related to #1979

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