Vyper: VIP: String type

Created on 21 Jan 2019  路  4Comments  路  Source: vyperlang/vyper

Simple Summary

Add string type so that the context is clearer in web3, etc.

Abstract

Add string type so that the context is clearer in web3, etc.
Like bytes type, add string[N] type in contracts and string in the ABIs.

Motivation

For now, bytes is the substitute for string in Solidity (e.g. #1209) but it's not clear that they are intended to be read as a string or a byte array. Let's use a new type string for such cases.

Specification

At EVM-level, string[N] is the same with bytes[N] but length or index access are not allowed like Solidity. In the ABI, the type is represented as string.

# ERC20
name: public(string[5])
symbol: public(string[40])

Backwards Compatibility

This is backwards compatibile.

Dependencies

N/A

Copyright

Copyright and related rights waived via CC0

Approved Discussion

Most helpful comment

@nrryuya this actually what I am planning to work on next, so good timing :)

All 4 comments

@nrryuya this actually what I am planning to work on next, so good timing :)

We seem to already have a VIP for this: https://github.com/ethereum/vyper/issues/358 :)

We seem to already have a VIP for this: #358 :)

Wow! Long time ago!

Implemented, part of Beta-8 release :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fubuloubu picture fubuloubu  路  3Comments

jakerockland picture jakerockland  路  4Comments

haydenadams picture haydenadams  路  3Comments

pipermerriam picture pipermerriam  路  3Comments

ben-kaufman picture ben-kaufman  路  3Comments