January 2019
Beginner to intermediate
372 pages
11h 17m
English
First, we will create a simple Python script that returns a concatenated string to greet the user:
from boa.builtins import concat
def main(name):
return concat("Hello ", name)
The contract script uses the concat method provided by boa to concatenate two strings. Every smart contract should have a function called main, which will be the entry point. The smart contract needs to be compiled into byte code, which can be executed in the NeoVM. The contract can be compiled by the neo-python shell using the neo-boa compiler as follows:
build hello.py test 07 07 False False Alice
The build command is supplied with a test argument to test the sample outcome. The code immediately after the test flag represents the data ...