Check that init doesn't read or write the state

This commit is contained in:
Ulf Norell
2019-05-13 17:51:47 +02:00
parent 6bd2b7c483
commit 74d4048d9f
3 changed files with 75 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
contract BadInit =
type state = int
function new_state(n) = state + n
stateful function roundabout(n) = put(n)
stateful function set_state(n) = roundabout(n)
stateful function init() =
set_state(4)
new_state(0)
state + state