How to deploy your first VSC Hive Smart Contract
What to know:
- VSC Contracts are open and permissionless
- Code in any language; Starting with Assemblyscript with more in the future.
- Contract code is fully deterministic and can be tested easily in the local environment.
Useful Resources:
- peakd.com/@vsc.network
- https://vsc.eco
- https://vsc-eco.github.io/sdk/
Prerequisites
- NodeJS v18 or greater
- yarn (https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable)
- Git
- Visual Studio Code (optional; highly recommended)
Steps:
- git clone https://github.com/vsc-eco/contract-template
- yarn install
<fill out .env file>
- yarn asbuild:debug
- yarn test
- yarn deploy
▶️ 3Speak
0
0
0.000
My head is spinning... :-) I'm starting to understand but I have a long way to go before I'll actually understand the capabilities of real smart contracts on Hive.
🚀
Exciting to see the progress...
!discovery 35
This post was shared and voted inside the discord by the curators team of discovery-it
Join our Community and follow our Curation Trail
Discovery-it is also a Witness, vote for us here
Delegate to us for passive income. Check our 80% fee-back Program
Now all that was missing, was an actual Smart Contract :D
Well done!
This is exciting. A lot of authors have been saying that Hive badly needs Smart Contracts. Now that it's here, I hope we see a lot of improvement in the different apps, as well as get new ones.
Are there a list of Opcodes similar to the EVM?
VSC uses Webassembly. It does have an instruction set like EVM, but it is much more involved and supports multiple programming languages.
I'm just trying to wrap my head around it. I didn't have much time (or brainpower at the moment) to absorb the video.
So, distributed computation with an instruction set.
Yes, it's the standard Webassembly instruction set
No gas fees, but there will be an RC system in the future for lite accounts using staked HBD
Yes, contracts can revert execution and fail the transaction if required conditions are not met. We are still working on this functionality and the exact specifics but it will be available in the near future.
VSC smart contracts can written in any webassembly compatible programming language. Starting with Assemblyscript to Rust/golang in the future. A lot is similar in terms of expectations and semantics. If you have any specific questions that would be a more helpful comparison and breakdown of the two technologies.
Great to see the progress on this!
You mentioned something that I was thinking about. 2 people want to swap tokens. Both have to show the other what they are giving, and then both have to signify they are Ready, after seeing what each is giving the other. Then a Trade button, which each has to click on their side, does the actual swap. The smart contract is the "broker" or "escrow account" and allows both parties to know in advance what they are giving and getting.
Currently if I do this, one person has to "go first" and send their tokens to the other. Then the other person will hopefully send their tokens when they receive what they expected from the first person. I have no problem going first with people I know, but that limits the set of people you can swap with! Doing it via smart contract makes it trustless. But I guess you still have to trust the smart contract. :)
I'll take a look at your documentation and maybe try to make such a smart contract. I imagine others might also make the same, as it seems like a common thing t want to do, and hopefully pretty easy to code up.
Thanks for all your work and this informative video!
Feel free to reach out to us on discord if you have any questions!
Congrats guys amazing job👏
I already commented here about a token swap smart contract. How about a HBD Bond smart contract! Is it possible? Could ETH staking be the way to get the extra interest needed to entice someone to lock up their HBD longer for a higher interest rate? Could one smart contract on Hive do all that would be needed or would it have to interact with other smart contracts on ETH?
I was thinking about this, here:
https://peakd.com/lido/@dalz/a-look-at-the-lido-protocol-or-the-number-one-protocol-for-staking-ethereum-sbtvlf#@kenny-crane/re-dalz-sbugh6
HBD bond is entirely possible and in the near future we will support holding staked hbd directly within a smart contract. The problem is the L1 would offer the same return and only a 3.5 day lock period. The contract could theoretically set a very long lockup period, but it would make more sense for a user to still go to the L1 instead. As for ETH staking, that's not possible as Eth staking is heavily tied with running a validator and thus an inherent risk that the network cannot take on or maintain.
Thanks for this valuable information, I greatly appreciate your reply!
Hello vsc.network!
It's nice to let you know that your article won 🥇 place.
Your post is among the best articles voted 7 days ago by the @hive-lu | King Lucoin Curator by deepresearch
You and your curator receive 0.0260 Lu (Lucoin) investment token and a 14.91% share of the reward from Daily Report 263. Additionally, you can also receive a unique LUGOLD token for taking 1st place. All you need to do is reblog this report of the day with your winnings.
Buy Lu on the Hive-Engine exchange | World of Lu created by @szejq
STOP
or to resume write a wordSTART