Vyper: Circumventing `@constant` with multiple return values and tuple assignment

Created on 9 Nov 2019  路  1Comment  路  Source: vyperlang/vyper

Modifying state is not allowed in @constant functions, but you can bypass the check by using multiple return values:

x: public(uint256)

@private
@constant
def returnTwo() -> (uint256, uint256):
    return 1, 2

@public
@constant
def foo():
    a: uint256 = 0
    a, self.x = self.returnTwo() # BUG
Easy Pickings bug

Most helpful comment

Meeting Notes: fix it.

>All comments

Meeting Notes: fix it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fubuloubu picture fubuloubu  路  3Comments

ben-kaufman picture ben-kaufman  路  4Comments

ben-kaufman picture ben-kaufman  路  4Comments

haydenadams picture haydenadams  路  3Comments

travs picture travs  路  3Comments