Skip to main content

Developing Smart Contract on the NEO Blockchain (ep5) - Deploying a NEP-5 Smart Contract (part 2)

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

submitted by /u/willchen319
[link] [comments]

Popular posts from this blog

Commoditizing the world

Let's discuss commodities; With the latest Enron situation, it is important to understand the way things work. A commodity is anything useful, especially a transportable agricultural product or mining product. This comes from the Latin word "commoditas" meaning roughly advantage, convenience. So then what is a commodity? Well we consider Gold, Silver, wheat, corn, pork bellies, coffee, etc all commodities. If you look in the back of the WSJ or Investors Business Daily you will see a listing of all the commodities traded on the commodities exchange. Enron made some errors no doubt, but let's not judge all commodity markets in haste. Commodity trading works best when there is a stable instrument of trade. Sometimes the instrument of trade is actually the commodity. If you looked most countries of the world today you would find that there are three basic instruments of trade; money, as in currency, precious metals and gems, drugs; like cocaine, opium, and

6 Incredible Benefits Of the Cryptocurrency

Over the past few years, people have been talking a lot about cryptocurrency. At first, this business sounded scary but people started developing trust in it. You may have heard of Ether and Bitcoin. They both are crypto currencies and use the Blockchain Technology for highest security possible. Nowadays, these currencies are available in several types. Let's know more about it. How Can cryptocurrency help you? As far as fraud is concerned, this type of currency can't be faked as it's in digital form and can't be reversed or counterfeited unlike the credit cards. Immediate settlement Buying real property involves third parties, such as lawyers and notary. So, delays can occur and extra costs may incur. On the other hand, Bitcoin contracts are designed and enforced in order to include or exclude third parties. The transactions are quick and settlements can be made instantly. Lower fees Typically, there is no transaction fee if you want to exchange Bitcoin or any other cu

Combining Forex Trading With Gold Trading

Combining forex trading with gold trading can be highly lucrative. If you have been following gold prices, you must know that gold prices have reached their historical peak in the recent times. Gold prices recently broke the historical barrier of $ 1,000 per ounce and now hovering around $ 1,150 per ounce. Market is anticipating a US Dollar depreciation. Whenever, the markets become jittery, investors start buying gold as a hedge against the US Dollar. Last year, after the stock market crash, many investors started investing in gold as a safe haven against the turmoil in the financial markets. Gold and US Dollar have an inverse correlation relationship. Gold and US Dollar are almost near perfect mirror image of each other. US Dollar depreciation during the global financial uncertainty has been the primary reason for the gold appreciation as it is viewed as the ultimate form of money. Gold is also seen as the primary safe haven commodity. Countries like China, Russia and I