ethereum/EIPs

ABI: 'byte' as an alias to 'bytes1'

axic opened this issue · 5 comments

axic commented

Latest Solidity has now an alias from byte to bytes1 ( https://solidity.readthedocs.org/en/latest/types.html ).

It would make sense including this alias in the ABI too, similarly how int and uint are an alias to int256 and uint256, respectively.

It seems logical and there are some demands for having it available too.

I support this.

uint does not exist as far as the ABI is concerned, it only knows about uint256.

axic commented

@chriseth it is an alias (e.g. uint is rewritten to uint256 before using in the ABI hashing):

uint, int: synonyms for uint256, int256 respectively (not to be used for computing the function selector).

Perhaps we should clarify what we mean when we say ABI. For me this is the way to encode and decode abstract mathematical objects (numbers, strings, ...) to sequences of bytes for use in contracts and a way to address a function of a contract given its name and type. The type of a function is again an abstract mathematical object. Both uint and uint256 are string representations of the 256-bit unsigned integer type, where the latter is its canonical representation, which has to be used when computing the hash of a named function type for means of addressing the function.

axic commented

Closing this as it seems to be well outdated.