Let’s take a look at our smart contract:
self.name = "Satoshi Nakamoto"
def change_name(new_name: bytes):
self.name = new_name
def say_hello() -> bytes:
return concat("Hello, ", self.name)
Take a look at the first line:
The array of bytes is basically a string. The variable called name has a type of array of bytes or string. Its visibility is public. If you want to set it to private, then just omit the public keyword, as follows:
Now, take a look at the next lines:
self.name = “Satoshi Nakamoto”
If you are coming from a Python background, then you will recognize the Python decorator function. There are four of these in Vyper:
- @public means you can execute this method as...