How to Deploy a Smart Contract on VeChain with Bare Hands.
Hello! Welcome to this part of the universe that we lazy engineers try to deploy a smart contract on VeChain without any special tools.
Tell your fellow engineers about these tricks and let’s build on VeChain right now!
Old Days of Deployment
In the good old days, developers on the blockchain face several critical components to deploy and fine-tune their smart contracts:
- A piece of source code of Solidity.
- A compiler to turn source code into byte code.
- A small utility program to deploy the byte code onto test-net.
- Another small utility program to interact with the deployed contract.
Although briefly described above, the whole process is not an easy-to-go process since we lack tools to help us and the setup cost of those tools are high, just to mention a few:
solcthe compiler on the computer.
web3to deploy the contract.
- Or plugin
web3 gearto deploy the contract.
- Setup a test-net connection, or spin up your own blockchain node to connect to.
- Write another small utility program to call the functions on the smart contract to observe the final result.
Deployments are not meant to be that tedious and can be done via a more graphics-oriented way. Just a few clicks and you are good to go!
A Shortcut: VeChain Inspector
The truth about fast deployment on VeChain is:
You don’t need to write a line of code for tools, all can be done in browsers!
The appeal is quite simple and straight-forward:
I am a developer and want to fast test out my precious “smart contract” as below, what should I do?
hello.sol is our source code.
First, compile in the
remix browser IDE, go to:
and open the file editor and put in our
hello.sol right away!
Then from the left panel, add a compiler, and hit the compile button!
Simple and easy, so far so good.
Now we can retrieve the artifacts that we have compiled from the source code, the byte code (which is what we will deploy onto the test-net) and the ABI (the map of source code if we want to interact with the contract).
Remember how painful it is to deploy by hand? How the tools fall apart when we connect them together? Remember how long it takes to sync before the test-net is useable?
All are gone and I introduce to you a swift sword for doing it:
Inspectorapp in the Sync browser.
In case you haven’t downloaded the Sync browser, get it from here: https://env.vechain.org/
Sync browser is really useful as it already contains functions of: wallets, networks and lightweight utility programs developed by other developers.
Great, now we click open the Sync browser and find the
Inspector app down below there. (Link: https://inspector.vecha.in/)
Since we haven’t deployed the contract yet, we copy-paste the byte code and hit the deploy button!
Soon enough, the tool will do the job for you and show you where it is deployed (contract address).
For example, my smart contract is deployed on the address of:
As for now, we haven’t programmed a line of code and yet we have deployed the smart contract successfully.
Now we use the ABI we copied earlier to establish a graphic interface to access it. Click the “+” button on the right and create a new smart contract interface.
Fill in the name you want to call it, fill in the ABI JSON and with a simple click of “add” you get an interface!
Great, now it is the time to interact with it. Click on the card, and you will be presented with all the “read” and “write” methods that can be called on the smart contract.
If you are new to VeChain development and simply want to test out an idea that you’ve written in Solidity, you can now use
Inspector tool as the primary tool to simplify your life. The cost of the tool/network establishment is very low and can be done with just a few clicks!