This episode 5 of how to start develop Smart Contract on NEO by our CTO, Dominic. Last article was part 1 of starting on a NEP5 smart contract. Dom shared about how to install neo-boa and fixed up a NEP-5 smart-contract to make it our own. We are now at part 2 for compile and deploy. You can see the full series at his Medium account.
----------------------------------------------------
Step 1: Compile the contract code
Open up a command prompt type
ubuntu
then
sudo -i
Continue on to...
cd neo-boa/ source venv/bin/activate cd ../smart-contract python3.6 compile.py
*upon completion you will see* ico_template.avm
Step 2: Import the contract — Using the same Ubuntu prompt:
cd ../neo-python source venv/bin/activate np-prompt -p
Now that you are in the NEO prompt, open your admin wallet: open wallet testWallet1
import contract ../smart-contract/ico_template.avm "" 0710 05 True False # Fill out the contract details [Contract Name] > nodis [Contract Version] > 1 [Contract Author] > nodis [Contract Email] > nodis [Contract Description] > nodis
Your contract is now on the blockchain!
Step 3: Deployment
Currently, the tokens are all locked up in the contract. Ultimately, we need to call...
deploy()
This is a function on the contract to transfer all the tokens to the admin wallet. Our first task is to find the hash of the contract.
contract search
https://i.redd.it/4wjufth3tsv11.png
in our case, the script hash is 0x3ffb8a621f461559a90943986bc813b8fcf6ac0a
Now type:
testinvoke deploy []
Input your password when prompted to invoke on the network.
Done! Check out your newfound wealth by typing...
wallet
BONUS command:
testinvoke name []
https://i.redd.it/btj60v3ktsv11.png
The value is in hex, we can use an online tool to decipher it. Ours says ‘Nodis Token’.
----------------------------------------------------
You can see my profile for a link to join our Telegram to learn more about our Nodis.io project!
Original content came from -> https://medium.com/coinmonks/deploying-a-nep-5-smart-contract-part-2-19aa8b598642
[link] [comments]