Skip to main content


Question 1#

What notions are defined inside the smart contract?

Question 2#

What is returned by the execution of a smart contract?

Question 3#

What can you do with the SmartPy online editor?

Question 4#

What is a SmartPy smart contract?

Question 5#

What is the correct way to add an integer x initialized to 0 to the storage?

Question 6#

What is true about the definition of entrypoints with SmartPy?

Question 7#

What is true about tests and scenarios with SmartPy?

Question 8#

What is true about types with SmartPy?

Question 9 and 10#

For the next two questions let's consider the following piece of code:

class Hello(sp.Contract):
def __init__(self):
self.init(x = 0)
def set_x(newX):
# Todo: set x from the storage to newX

What is the correct way to set x from the storage to newX.

What is the correct way to modify the code to check that newX is greater than 0 for the entrypoint set_x? (If not, we want the entrypoint invocation to fail and return an error message.)

Last updated on by Aymeric BETHENCOURT