Skip to content
On this page

Expressions โ€‹

Like most languages, SmartPy has expressions.

For example, self.data.x represents the contract storage field x and 2 represents the number 2, whereas
self.data.xย +ย 2 represents their sum.

Inside a contract, when we write:

python
y = self.data.x + 2

We declare y as an alias the SmartPy expression self.data.xย +ย 2.