Skip to content

Commit

Permalink
Update state.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
msinkec committed Jan 5, 2022
1 parent 715ee8d commit bfdf69d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions docs/state.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ For a contract to keep state and able to be called multiple times while carrying
State Decorator
===============
Declare any property that is part of the state with a decorator ``@state``.
The state property can be used the same way as a regular property.
The state property can be used the same way as a regular property. Note, that an explicit constructor definition isn't allowed when the contract contains state properties.

.. code-block:: solidity
contract Counter {
@state
int counter;
constructor(int counter) {
this.counter = counter;
}
}
Propagate the State
Expand Down Expand Up @@ -116,4 +113,4 @@ This does not apply to any non-public function, including constructors.
// OK: not a public function
return this.counter;
}
}
}

0 comments on commit bfdf69d

Please sign in to comment.