How to deploy a smart contract on CENNZnet

Anne Patterson
CENNZnet
Published in
2 min readJun 24, 2019

To stay up-to-date on the progress of Centrality’s ecosystem, follow us on Twitter and our Telegram Announcements channel, plus join our community on Centrality’s Official Telegram, Instagram, Reddit and Facebook.

Learn the basics with our Spin2Win tutorial

Deploying a smart contract has previously been a complicated and lengthy process, often involving a steep learn curve or prior experience in blockchain. We’ve made it accessible to create a smart contract through our Spin2Win tutorial. The tutorial takes you through the basics of deploying a smart contract and serves as the basis for creating your own DApp. As a bonus, you’ll also have a chance to receive free tokens!

Anyone can create a smart contract which, essentially, is publicly verifiable code stored on the blockchain. Because it’s open source and everyone can see the code, smart contracts enable you to build decentralised protocols.

Smart contracts that are deployed on CENNZnet are written in Rust, compiled in Web Assembly and connect to the CENNZnet Runtime. You’ll need to pay gas fees for execution, storage and memory costs.

What’s the Spin to Win game?

Spin2Win is a game where you pay to play using CENNZ tokens. Players have a chance to win a prize, depending on where the wheel stops.

You sign in with SingleSource to access the SingleSource wallet from SpinToWin. Upon spinning the wheel, the SpinToWin DApp will call the Spin2Win smart contract in the background, which written in code to randomly allocate rewards in the form of CENNZ tokens. The smart contract then deposits these tokens back into your wallet. It is the code that governs how the spin happens and how it’s deposited into the wallet — no one else controls these functions.

The advantage of using your SingleSource account to receive rewards is that you don’t need to implement a new wallet to use this app.

How to use the tutorial

Accompanying the game is a tutorial for you to deploy your own smart contract. Once you get the basics, you’ll be able to apply what you’ve learned and create a DApp. Consider it a starting point to get your creativity and problem-solving skills going!

Download the Spin to Win tutorial here.

To stay up-to-date on the progress of Centrality’s ecosystem, follow us on Twitterand ourTelegram Announcements channel, plus join our community on Centrality’s Official Telegram, Instagram, Reddit and Facebook.

--

--