One Year Anniversary release

SmartPy Documentation

Private Entry Points

    @sp.private_entry_point
def edit_storage(self, params):
sp.verify(params.a > 12) # verify some invariant
self.data.set(params) # replace the complete storage

Custom Type Layouts

sp.set_record_layout(params, ("a", ("b", "c")))

Type Inference

Lambdas

    @sp.global_lambda
def square_root(x):
sp.verify(x >= 0)
y = sp.local('y', x)
sp.while y.value * y.value > x:
y.value = (x // y.value + y.value) // 2
sp.verify((y.value * y.value <= x)
& (x < (y.value + 1) * (y.value + 1)))
return y.value
f = sp.build_lambda(lambda x: x + 3)

Contract Explorer

Command Line Interface

sh <(curl -s https://SmartPy.io/SmartPyBasicDev/SmartPy.sh) local-install-dev ~

Former Versions

sh <(curl -s https://SmartPy.io/SmartPyBasicDev/SmartPy.sh) local-install-custom SmartPyBasicPrevDev20200305 ~

Data Type Layout

  • This mapping changed with this version. The new version is much better than what it used to be but it can be disconcerting.
  • There is now a way to explicitely determine the obtained geometry called layout. It is explained and demo’ed in the SmartPy reference manual https://smartpy.io/dev/reference.html#_records_and_variants.

--

--

--

An intuitive and effective smart contracts language and development platform for Tezos. In Python.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
SmartPy.io

SmartPy.io

An intuitive and effective smart contracts language and development platform for Tezos. In Python.

More from Medium

DAOs: What you probably didn’t know about them.

Major Reasons Why Enterprises Prefer EOS blockchain

What the Heck is Web3 Anyways?

TRX1 Dev Blog #17 (May 2022)