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

denis-bogdanas picture denis-bogdanas  路  3Comments

lsaether picture lsaether  路  4Comments

fubuloubu picture fubuloubu  路  3Comments

jacqueswww picture jacqueswww  路  4Comments

robinsierra picture robinsierra  路  3Comments