ethereum / act

Smart contract specification language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

State var can be used to initialize itself

leonardoalt opened this issue · comments

commented
constructor of LValue
interface constructor()

creates

    uint x := x
    
invariants

    x == 0

This is accepted by parse/type/prove.

The invariant is false (any expression you put there), since I guess x is unconstrained initially.

I guess this should be disallowed in general?

commented

I think lets just disallow storage references on the RHS of assignment expressions in the creates block for now, we can reindtroduce them later (probably with some kind of cycle detection?)

Yeah, that sounds reasonable. A variable on RHS in the constructor would always be empty, anyway