<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matej Yangwao</title>
    <description>The latest articles on DEV Community by Matej Yangwao (@yangwao).</description>
    <link>https://dev.to/yangwao</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F11600%2Ffea766de-b282-4ea5-b7d5-7931871a1679.png</url>
      <title>DEV Community: Matej Yangwao</title>
      <link>https://dev.to/yangwao</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yangwao"/>
    <language>en</language>
    <item>
      <title>How we are rewarding contributors to open-source NFT marketplace?</title>
      <dc:creator>Matej Yangwao</dc:creator>
      <pubDate>Wed, 23 Mar 2022 10:50:29 +0000</pubDate>
      <link>https://dev.to/yangwao/how-we-reward-contributors-to-open-source-nft-marketplace-29bn</link>
      <guid>https://dev.to/yangwao/how-we-reward-contributors-to-open-source-nft-marketplace-29bn</guid>
      <description>&lt;h2&gt;
  
  
  Foreword
&lt;/h2&gt;

&lt;p&gt;Once upon time, &lt;strong&gt;we wanted to build public good&lt;/strong&gt;, bit different and with shared ownership on top, from our craft between those who are contributing to our wholesome piece of work and helping us to render our vision true.&lt;/p&gt;

&lt;p&gt;We've thought it would be way different, if we build our craft best as open source. As we believe in &lt;a href="https://en.wikipedia.org/wiki/Win%E2%80%93win_game"&gt;positive sum games&lt;/a&gt;, shared wisdom, &lt;a href="https://en.wikipedia.org/wiki/Collaborative_innovation_network"&gt;collaborative work&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Collaborative_intelligence"&gt;collaborative intelligence&lt;/a&gt; we highly appreciate if we can be together on path with common shared goals. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Collaborative intelligence is a term used in several disciplines. In business it describes heterogeneous networks of people interacting to produce intelligent outcomes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Hz9eSSIU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jb40mx73k5tk0mlzgvfz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Hz9eSSIU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jb40mx73k5tk0mlzgvfz.png" alt="hyperstructure" width="723" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Paolo Soleri's "hyperstructure" in ground-level view. The figure to the right is the Empire State Building at the same scale.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We strongly believe providing something as public good would multiply our efforts and impact future for others, who come over and can build something really nice and help them be the next entrepreneur over weekend. That easy.&lt;/p&gt;

&lt;p&gt;Thanks to Github, we've enabled networked human groups to efficiently combine their knowledge, wisdom, insights, and intuitions into an emergent intelligence. This might be often referenced as &lt;strong&gt;hive mind&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Open source development could be started by anyone and anytime. What's make difference is cause, funding and coordination, in nutshell governance of development to drive without less friction and codebase evolution happen in particular pace.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it evolved
&lt;/h2&gt;

&lt;p&gt;Yet our biggest pain issue was &lt;strong&gt;coordination and how people are rewarded&lt;/strong&gt;. We identified this early and realised would be really great &lt;strong&gt;give people liquid reward -- money&lt;/strong&gt;. Fast as possible to drive positive reinforcement loop to come back and contribute again in short-time.&lt;/p&gt;

&lt;p&gt;That's seems has worked pretty well. Once we've started crossing &lt;strong&gt;100+ pull-requests on monthly basis&lt;/strong&gt; on average, we've hit over &lt;strong&gt;230 pull-requests merged in one month&lt;/strong&gt;. Simple superior effort, all &lt;strong&gt;16 people involved in 30 days&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P8d-211o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qt11o8v88lk0v1mmuydd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P8d-211o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qt11o8v88lk0v1mmuydd.png" alt="KodaDot_repository_pull_requests" width="880" height="697"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In retrospect, we've designed policy and rulesets. Crafted our &lt;a href="https://github.com/kodadot/nft-gallery/blob/main/CONTRIBUTING.md"&gt;Contributing Guidelines&lt;/a&gt; with standardised process how we do payouts. Sounds simple. On side line, delivering product with small revenue, traction and user base.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steep Achievement
&lt;/h2&gt;

&lt;p&gt;Seems innocent tactic results in steep adoption from open-source developers. In short we've opened flood gates for gig economy en masse. &lt;strong&gt;Hitting 160+ forks, 222 stars and over 70+ contributors in few weeks.&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Msl3Y54R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n6vrc9bklx5gkjsfb7oi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Msl3Y54R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n6vrc9bklx5gkjsfb7oi.png" alt="KodaDot_repository_stats" width="262" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How this happened that quickly? &lt;strong&gt;Consistence, dedication and compounding effect.&lt;/strong&gt; &lt;br&gt;
At start, it was quite slow and it has required to make room people to contribute. We done lots of brain dump, &lt;a href="https://github.com/kodadot/nft-gallery/issues/created_by/yangwao"&gt;like created 1k+ issues in our repository&lt;/a&gt; which we've found would be superior to have so developers has inspiration and they can go through loop of contributing, to bring their creativity. This &lt;strong&gt;flywheel  of contribution made it working&lt;/strong&gt;, it just took to pimp to it's best and being efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flywheel of contribution
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Discovery
&lt;/h3&gt;

&lt;p&gt;From perspective of newcomer, easy mode. Developer will &lt;a href="https://github.com/kodadot/nft-gallery/issues"&gt;find issues in our KodaDot repository&lt;/a&gt;, which has &lt;strong&gt;bounty levels from $100 ($) up to $1k ($$$$$)&lt;/strong&gt; plus we have labels based on priority. &lt;/p&gt;

&lt;p&gt;That helps a lot developer to gauge their interest whats is urgency for particular issue. Thats for brief start and issue discovery once developer has estimated their experience delivering fixed issue. Often is great for developer to ask to clarify what's needs to be done, so there is right alignment contribution made between those who created issue and who comes with resolved issue. &lt;/p&gt;

&lt;h3&gt;
  
  
  Life of pull-request
&lt;/h3&gt;

&lt;p&gt;Once pull-request is made against our &lt;code&gt;main&lt;/code&gt; branch, it's good to &lt;strong&gt;request code review from helpful folks&lt;/strong&gt;, who are longer period around our KodaDot codebase and seniors in code-quality to check on your code. Requirement of this is to see what have you contributed meets best code practice. Once you receive review, there are &lt;strong&gt;two frequent options&lt;/strong&gt;. Either you receive &lt;strong&gt;feedback with code suggestion&lt;/strong&gt; -- what you could done better which isn't inherently bad, yet it's different perspective, which most of cases drives higher code quality for others and other new comers&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sOvEMtIH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uush3qujblqeka6kxcy6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sOvEMtIH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uush3qujblqeka6kxcy6.png" alt="code_suggestion" width="789" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another option is &lt;strong&gt;simple approval&lt;/strong&gt;, which there is higher chance you receive, once you are familiar with our code base.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kav9o2-s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlth9kb94f4pwgkzqfhk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kav9o2-s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlth9kb94f4pwgkzqfhk.png" alt="pr_approval" width="400" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once someone made approval and done sort of static code analysis including our &lt;strong&gt;bunch of helpful dog robots&lt;/strong&gt; and intelligence which reviews your code if you did not accidentally break something&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b6HhkLL_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gnta19u0ps1ya36l0u63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b6HhkLL_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gnta19u0ps1ya36l0u63.png" alt="pull_requests_checks" width="858" height="249"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;you are entering very last stage of receiving reward for your amazing contribution paid to your wallet.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q4zUwsFf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qce220yhiww6rtaxpa1g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q4zUwsFf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qce220yhiww6rtaxpa1g.png" alt="reward" width="639" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's pretty much breakdown of stages how you can receive quick reward through contributing to open source. What's best on top, you are automatically &lt;strong&gt;eligible to be part of internal circle&lt;/strong&gt;, which opens doors to &lt;strong&gt;level up your coding skills&lt;/strong&gt;, &lt;strong&gt;fill your GitHub track record with legitimate open source web3 project&lt;/strong&gt;, participate in less-public discussions and on top &lt;strong&gt;accrue reputation reward&lt;/strong&gt;. That's our slow paced reward for those you are really like what we are doing and what opportunities we are giving away for others.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Leaderboard
&lt;/h2&gt;

&lt;p&gt;To create trust for incoming developers and show proof we've sent fair amounts of payments out there, &lt;strong&gt;over 20k$ in pull-requests and another 70k$ on side with on-chain proofs&lt;/strong&gt;, we've realised it would be amazing show super easy chart. &lt;/p&gt;

&lt;p&gt;To easy see, we sorted our rank by &lt;strong&gt;rewards received&lt;/strong&gt;. On side columns we've added amount per merged pull-requests, number of pull requests vs merged pull requests and charts goes on. &lt;/p&gt;

&lt;p&gt;Best takeaway, you can see yourself that &lt;a href="https://github.com/prachi00"&gt;prachi00&lt;/a&gt; &lt;strong&gt;as women developer&lt;/strong&gt;, she is on the top of our chart. This brings KodaDot open-source repository is not only dominated by males.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EgWDQTb5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jfikqp90nr6oh06tif3a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EgWDQTb5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jfikqp90nr6oh06tif3a.png" alt="kodadot_leaderboard" width="880" height="608"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/kodadot/nft-gallery/blob/main/LEADERBOARD.md"&gt;LEADERBOARD.md&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Flexibility of contributing
&lt;/h3&gt;

&lt;p&gt;Best of all, &lt;strong&gt;we don't hold anyone as contractor around to helping us on this. Anytime you can come and go, withdraw yourself anytime. You are pretty free.&lt;/strong&gt;&lt;br&gt;
We even break down potential thoughts what we guess developers keeps on coming.&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Kq4SxklE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o249h7d9wmqvld0bbitg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Kq4SxklE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o249h7d9wmqvld0bbitg.png" alt="bounties" width="660" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Few notable reasons are
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;size of reward - ranging from $50 up to $1k&lt;/li&gt;
&lt;li&gt;Flexibility - whenever you are available, you do PR.&lt;/li&gt;
&lt;li&gt;Belonging - Squad goals, we craft something unique together&lt;/li&gt;
&lt;li&gt;Challenging Puzzles - pushes you to learn something new and get reward&lt;/li&gt;
&lt;li&gt;Proof of Contribution to OSS - Whenever you will be looking for your next job, companies already referring to us&lt;/li&gt;
&lt;li&gt;Bug hunting - infinite challenges helping real-world codebase&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How we nurture connections between developers
&lt;/h2&gt;

&lt;p&gt;Now we are in stage, where coordination aka all-hands developer community calls happens on bi-weekly basis and people can drive development with their insights to make it better. We &lt;strong&gt;welcome everyone improving opinion as it contribute to wider wisdom and better market fit&lt;/strong&gt; of codebase one is making. We've found it as infinite universe what we can improve and &lt;strong&gt;we always enjoy what for one can be obvious solution, for other could be blind spot.&lt;/strong&gt; Maintaining peer-admiration and raising awareness in respectful way is key we build our ethos and soul.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gTDCE7d3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g5az51y5vokkx8l7tfd2.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gTDCE7d3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g5az51y5vokkx8l7tfd2.jpeg" alt="kodadot_developer_call" width="880" height="1965"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This open doors for anyone to participate from outside and making codebase improved by their perspective. &lt;strong&gt;We are trying to have warm, welcoming and inclusive culture, that's we are high on ethics.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bp4d9y----/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlgpamjvcbuime62xs9t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bp4d9y----/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlgpamjvcbuime62xs9t.png" alt="kodadot_ethics" width="880" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Okay what we are building
&lt;/h3&gt;

&lt;p&gt;You might question why we are doing this. We've realised hence &lt;strong&gt;our biggest goal is to driving experimental NFT landscape&lt;/strong&gt;, we can actually dog food ourselves with one experiment at a time. That's how we making this &lt;strong&gt;developer incentives real&lt;/strong&gt; and it's sort of our case to demonstrate it is already possible. To further extend KodaDot experiment, we are building it as scaffolding interface for others builders out there, who would like to build something on &lt;a href="https://twitter.com/metaprime_net"&gt;MetaPrime&lt;/a&gt; way faster with help of others. It's just matter of time, inspiration and experience gathering around to drive better NFT dapps further. &lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;More KodaDot is &lt;strong&gt;getting mature, more complex problems arising.&lt;/strong&gt; That's at some point we will getting someone making out of bounties which will act as their continuous payroll. With one detail, pay as you go. Once more these kind of people is onboard, &lt;strong&gt;more autonomy KodaDot as project will receive from it own founders.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In retrospect, having our &lt;strong&gt;async culture helps us a lot&lt;/strong&gt;. To drive our iterative evolution, we have lot of issues, really tons of issues, we've crossed &lt;strong&gt;issue total count 2500&lt;/strong&gt;, even mental issues after those issues (jk). &lt;/p&gt;

&lt;p&gt;We add there bounties to cover development of this monstrous machinery. We have &lt;strong&gt;over 50k$ in bounties&lt;/strong&gt; right now. We've managed to capture and create long &lt;a href="https://github.com/kodadot/nft-gallery/blob/main/CONTRIBUTING.md"&gt;contributing.md&lt;/a&gt; thanks to &lt;strong&gt;70+ contributors&lt;/strong&gt; as acts as our soft-smart-contract for contributing.&lt;/p&gt;

&lt;p&gt;If you are considering to contribute, best is to pick small and easy issue, &lt;strong&gt;&lt;a href="https://discord.gg/zvZnRbneNb"&gt;join our Discord&lt;/a&gt;&lt;/strong&gt; and let's chat further, there is lot of interesting puzzle you can help us to crack and &lt;strong&gt;being rewarded in form of money, experience and reputation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can take peak on our &lt;strong&gt;bi-weekly development digest we've called &lt;a href="https://docs.kodadot.xyz/meta-hours.html"&gt;Meta_Hours&lt;/a&gt;&lt;/strong&gt; which is often recorded and we are posting agenda ahead of event so anyone having question can well prepare.&lt;/p&gt;

&lt;p&gt;Our end game is goal that KodaDot will be where we are going is that being &lt;strong&gt;builders-owned marketplace engine&lt;/strong&gt; which will connects multi-chain future of NFTs ecosystems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Participate
&lt;/h3&gt;

&lt;p&gt;How you can engage and participate in our builders owned economy? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/kodadot/nft-gallery/discussions"&gt;Participate in Discussions&lt;/a&gt; with impactful suggestions&lt;/li&gt;
&lt;li&gt;Help with &lt;a href="https://github.com/kodadot/nft-gallery/issues/"&gt;coordinating issues and bi-linking them&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Create &lt;a href="https://github.com/kodadot/nft-gallery/pulls"&gt;pull-requests and get paid&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Help with &lt;a href="https://github.com/kodadot/nft-gallery/pulls"&gt;Code reviews&lt;/a&gt; (our current bottleneck)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Follow-up
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://twitter.com/kodadot"&gt;Follow on Twitter @KodaDot&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/kodadot"&gt;Read on Medium KodaDot&lt;/a&gt;&lt;br&gt;
&lt;a href="https://discord.gg/zvZnRbneNb"&gt;join our Discord&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Developing smart contracts with ink!</title>
      <dc:creator>Matej Yangwao</dc:creator>
      <pubDate>Wed, 16 Dec 2020 15:15:39 +0000</pubDate>
      <link>https://dev.to/yangwao/developing-smart-contracts-with-ink-4g72</link>
      <guid>https://dev.to/yangwao/developing-smart-contracts-with-ink-4g72</guid>
      <description>&lt;h2&gt;
  
  
  A little about my crypto journey.
&lt;/h2&gt;

&lt;p&gt;Back in early 2011, were having lectures about &lt;a href="https://en.wikipedia.org/wiki/Bitcoin" rel="noopener noreferrer"&gt;Bitcoin&lt;/a&gt; in our &lt;a href="https://sk.wikipedia.org/wiki/Progressbar" rel="noopener noreferrer"&gt;hackerspace Progressbar&lt;/a&gt;. Since then, I've gotten more interested in Bitcoin and more broadly blockchain tech. Later on, I followed the development of &lt;a href="https://en.wikipedia.org/wiki/Ethereum" rel="noopener noreferrer"&gt;Ethereum&lt;/a&gt;. I was interested in the &lt;a href="https://en.wikipedia.org/wiki/Ethereum#Platform" rel="noopener noreferrer"&gt;EVM&lt;/a&gt; which was invented with its own programming language called &lt;a href="https://en.wikipedia.org/wiki/Solidity" rel="noopener noreferrer"&gt;Solidity&lt;/a&gt;. Fast-forward, in 2017, &lt;a href="https://en.wikipedia.org/wiki/Gavin_Wood" rel="noopener noreferrer"&gt;Gavin Wood&lt;/a&gt; announced a project called &lt;a href="https://wiki.polkadot.network/" rel="noopener noreferrer"&gt;Polkadot&lt;/a&gt; along with &lt;a href="https://substrate.dev/docs/en/" rel="noopener noreferrer"&gt;Substrate&lt;/a&gt;, a framework for building application-specific chains. But that's just tech, you need soul to bring ecosystem, working around a common, shared goal. In Q2 2019, &lt;a href="https://messari.io/asset/edgeware/profile" rel="noopener noreferrer"&gt;Edgeware&lt;/a&gt; decided to build a smart contract blockchain using Substrate, seeding the community with a &lt;a href="https://blog.edgewa.re/full-details-on-the-edgeware-lockdrop/" rel="noopener noreferrer"&gt;lockdrop&lt;/a&gt;. In effect, the team exited to the community from day one. Most of the tokens were given to the community, which developed a great culture from the start—the community includes artists, builders, DAOs, DeFi and game developers. That's one thing that got me interested in Edgeware. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer, I'm chain-contractor for Edgeware and a member of &lt;a href="https://github.com/edgeware-builders/" rel="noopener noreferrer"&gt;Edgeware Builders Guild&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thanks to Edgeware Lockdrop, the chain have distribution among its believers.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5qe8wv3fga52160ujgmb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5qe8wv3fga52160ujgmb.png" alt="Token Allocation per Project"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Introducing Ink!
&lt;/h2&gt;

&lt;p&gt;Today, I'll be walking through ink!, a Rust-based embedded domain-specific language (&lt;a href="https://wiki.haskell.org/Embedded_domain_specific_language" rel="noopener noreferrer"&gt;eDSL&lt;/a&gt;) for writing Wasm smart contracts. I'm a smart contract developer at heart and this is just one piece of smart contract tooling that Edgeware provides. &lt;/p&gt;

&lt;p&gt;Because Substrate implements nearly all the code necessary to launch a working blockchain, including libp2p networking and PBFT consensus, Edgeware core developers get to focus on building create tooling for smart contract developers. They're working on C/C++/Rust smart contracts that can be compiled to WebAssembly (WASM). (Oh, you can also run Solidity-based smart contracts for the Ethereum Virtual Machine (EVM). I'll write about that later.) Onto the guts of ink!&lt;/p&gt;
&lt;h3&gt;
  
  
  ink! &lt;strong&gt;Contract Components&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;ink! should feel familiar to developers who have programmed using other modern smart contract languages. The skeleton of a contract has all of the same components that you might expect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Events&lt;/li&gt;
&lt;li&gt;Storage&lt;/li&gt;
&lt;li&gt;Deployment (Constructor) Function&lt;/li&gt;
&lt;li&gt;Public Functions&lt;/li&gt;
&lt;li&gt;Internal functions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In ink!, mutability and visibility are explicitly defined per contract function. In these functions, you gain access to a number of common Substrate types like &lt;code&gt;AccountId&lt;/code&gt;, &lt;code&gt;Balances&lt;/code&gt;, &lt;code&gt;Hash&lt;/code&gt;, etc. Additionally, you gain access to commonly used environment variable like the &lt;code&gt;caller&lt;/code&gt;, and more!&lt;/p&gt;
&lt;h1&gt;
  
  
  &lt;strong&gt;Design&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;The main goals of ink! are &lt;strong&gt;correctness, conciseness, and efficiency&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;ink! is designed to be as close to the Rust programming language as possible. The language uses &lt;a href="https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros" rel="noopener noreferrer"&gt;attribute macros&lt;/a&gt; to tag standard Rust structures into understandable contract components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#[ink(...)]
Copy

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because ink! follows Rust standards, tools like &lt;code&gt;rustfmt&lt;/code&gt; and &lt;code&gt;rust-analyzer&lt;/code&gt; already work out of the box.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Overflow Safety&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Being written in Rust, ink! can provide compile-time overflow/underflow safety. Using a Rust compiler configuration, you can specify whether you want to support overflowing math, or if you want contract execution to panic when overflows occur. No need to continually import "Safe Math" libraries, although Rust also provides &lt;a href="https://doc.rust-lang.org/std/primitive.u32.html" rel="noopener noreferrer"&gt;integrated checked, wrapped, and saturated math functions&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Test Environment&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;ink! provides a built in test environment that can be used to perform off-chain unit testing with the Rust framework. This makes it simple and easy to ensure that your contract code functions as expected, without the need for third party testing platforms.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;ink! vs Solidity&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Rust is an ideal smart contract language. It is type safe, memory safe, and free of undefined behaviors. It generates small binaries because it doesn’t include extra bloat, like a garbage collector, and advanced optimizations and tree shaking remove dead code. Through compiler flags, Rust can automatically protect against integer overflow.&lt;/p&gt;

&lt;p&gt;ink! chooses not to invent a new programming language, but rather adapt a subset of Rust to serve this purpose. As a result, you gain from all of the tooling and support available to the Rust ecosystem for free. In addition, as the language develops, ink! will automatically gain access to new features and functionality, improving how you can write smart contracts in the future.&lt;/p&gt;

&lt;p&gt;Here is a brief comparison of features between ink! and Solidity:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Virtual Machine&lt;/th&gt;
&lt;th&gt;Any Wasm VM&lt;/th&gt;
&lt;th&gt;EVM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Encoding&lt;/td&gt;
&lt;td&gt;Wasm&lt;/td&gt;
&lt;td&gt;EVM Byte Code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Language&lt;/td&gt;
&lt;td&gt;Rust&lt;/td&gt;
&lt;td&gt;Standalone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overflow Protection&lt;/td&gt;
&lt;td&gt;Enabled by default&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Constructor Functions&lt;/td&gt;
&lt;td&gt;Multiple&lt;/td&gt;
&lt;td&gt;Single&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tooling&lt;/td&gt;
&lt;td&gt;Anything that supports Rust&lt;/td&gt;
&lt;td&gt;Custom&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Versioning&lt;/td&gt;
&lt;td&gt;Semantic&lt;/td&gt;
&lt;td&gt;Semantic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Has Metadata?&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-File Project&lt;/td&gt;
&lt;td&gt;Planned&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage Entries&lt;/td&gt;
&lt;td&gt;Variable&lt;/td&gt;
&lt;td&gt;256 bits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Supported Types&lt;/td&gt;
&lt;td&gt;Docs&lt;/td&gt;
&lt;td&gt;Docs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Has Interfaces?&lt;/td&gt;
&lt;td&gt;Planned (Rust Traits)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Basic ink! contract - Flipper
&lt;/h2&gt;

&lt;p&gt;The ink CLI automatically generates the source code for the "Flipper" contract, which is about the simplest "smart" contract you can build. You can take a sneak peak as to what will come by looking at the source code here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="cp"&gt;#![cfg_attr(not(feature = "std"), no_std)]
&lt;/span&gt;
&lt;span class="nx"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;ink_lang&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nx"&gt;trait_definition&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;pub&lt;/span&gt; &lt;span class="nx"&gt;trait&lt;/span&gt; &lt;span class="nx"&gt;Flip&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;/// Creates a new flipper smart contract initialized with the given value.&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;init_value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Self&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;/// Flips the current value of the Flipper's bool.&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;flip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;mut&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;/// Returns the current value of the Flipper's bool.&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nx"&gt;contract&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;pub&lt;/span&gt; &lt;span class="nx"&gt;mod&lt;/span&gt; &lt;span class="nx"&gt;flipper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;use&lt;/span&gt; &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nx"&gt;Flip&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="nx"&gt;pub&lt;/span&gt; &lt;span class="nx"&gt;struct&lt;/span&gt; &lt;span class="nx"&gt;Flipper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;impl&lt;/span&gt; &lt;span class="nx"&gt;Flipper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;/// Creates a new flipper smart contract initialized to `false`.&lt;/span&gt;
        &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="nx"&gt;pub&lt;/span&gt; &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Self&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;Self&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Default&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;impl&lt;/span&gt; &lt;span class="nx"&gt;Flip&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;Flipper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;init_value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Self&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;Self&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;init_value&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;flip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;mut&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;ink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;bool&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;cfg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="nx"&gt;mod&lt;/span&gt; &lt;span class="nx"&gt;tests&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;use&lt;/span&gt; &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;default_works&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;flipper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Flipper&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="nx"&gt;assert_eq&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;flipper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;it_works&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;mut&lt;/span&gt; &lt;span class="nx"&gt;flipper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Flipper&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="c1"&gt;// Can call using universal call syntax using the trait.&lt;/span&gt;
            &lt;span class="nx"&gt;assert_eq&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Flipper&lt;/span&gt; &lt;span class="na"&gt;as&lt;/span&gt; &lt;span class="na"&gt;Flip&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;::get(&lt;span class="err"&gt;&amp;amp;&lt;/span&gt;flipper), false);
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Flipper&lt;/span&gt; &lt;span class="na"&gt;as&lt;/span&gt; &lt;span class="na"&gt;Flip&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;::flip(&lt;span class="err"&gt;&amp;amp;&lt;/span&gt;mut flipper);
            // Normal call syntax possible to as long as the trait is in scope.
            assert_eq!(flipper.get(), true);
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Flipper contract is nothing more than a bool which gets flipped from true to false through the flip() function.&lt;/p&gt;

&lt;h3&gt;
  
  
  Different Smart Contract Deployment
&lt;/h3&gt;

&lt;p&gt;Smart contract deployment on Edgeware is a little different than on traditional smart contract blockchains.&lt;/p&gt;

&lt;p&gt;Whereas a completely new blob of smart contract source code is deployed each time you push a contract on other platforms, Substrate optimizes this behavior. For example, the standard ERC20 token has been deployed to Ethereum thousands of times, sometimes only with changes to the initial configuration (through the Solidity &lt;code&gt;constructor&lt;/code&gt; function). Each of these instances takes up space on the blockchain equivalent to the contract source code size, even though no code was actually changed.&lt;/p&gt;

&lt;p&gt;In Edgeware, the contract deployment process is split into two halves:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Putting your code on the blockchain&lt;/li&gt;
&lt;li&gt;Creating an instance of your contract&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With this pattern, contract code like the ERC20 standard can be put on the blockchain a single time, but instantiated any number of times. No need to continually upload the same source code over and waste space on the blockchain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp7rc4wdd1laslx5v1661.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp7rc4wdd1laslx5v1661.jpeg" alt="Edgeware Builders Guild"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Treasury Funding - Construction Projects
&lt;/h2&gt;

&lt;p&gt;As part of &lt;a href="https://commonwealth.im/edgeware/discussions/wg-builders" rel="noopener noreferrer"&gt;Edgeware Builders Guild&lt;/a&gt;, we want to nurture healthy community builders and give opportunity to thrive through on-chain governance. If you're a builder, your project can be funded in various ways. The main way is through &lt;strong&gt;&lt;a href="https://github.com/edgeware-builders/construction-projects" rel="noopener noreferrer"&gt;treasury funding through construction projects&lt;/a&gt;.&lt;/strong&gt; Here, we are looking for particular interests like user interfaces, software development, system integration and research. The max amount of funding for technical grants is $100,000. Teams shouldn't seek to cover 100% of their early-stage funding via Edgeware grants alone. &lt;/p&gt;

&lt;p&gt;Teams can apply for grants more than once, but they need to complete the previous project (as described in their application) before receiving additional funds. &lt;a href="https://github.com/edgeware-builders/construction-projects#pencil-process" rel="noopener noreferrer"&gt;You can learn about process how to apply here&lt;/a&gt;. After your grant gets your project off the ground, you can apply to &lt;a href="https://www.notion.so/BuilDAO-Incubator-Paper-35d451f814014f9cbff96b6c8ab443a4" rel="noopener noreferrer"&gt;&lt;strong&gt;BuildDAO&lt;/strong&gt;&lt;/a&gt; an on-chain incubator. Apply with an idea, get $50k to seed your startup or protocol on Edgeware.&lt;/p&gt;

&lt;p&gt;You can review &lt;a href="https://docs.google.com/presentation/d/1bcPgZMTw_ppx35E41-DjJWnTjNQ3iV9E2UA0IjruDWI/edit?usp=sharing" rel="noopener noreferrer"&gt;Edgeware Developer Deck&lt;/a&gt;, &lt;a href="https://t.me/edg_developers" rel="noopener noreferrer"&gt;chat with guild members at Telegram&lt;/a&gt; and follow recent events among &lt;a href="https://twitter.com/edg_developers" rel="noopener noreferrer"&gt;Edgeware community developers&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Edgeware offers numerous opportunities to learn new language - &lt;strong&gt;ink!&lt;/strong&gt;, brew your own idea and &lt;strong&gt;get initial funding&lt;/strong&gt; to grow along with Edgeware community builders guild. If you are Solidity developer, it's worth noting that &lt;a href="https://contracts.edgewa.re/#/4/evm-introduction" rel="noopener noreferrer"&gt;Edgeware supports EVM as well&lt;/a&gt; so you can apply with your existing dApp in Solidity for funding too! Come over and &lt;a href="https://t.me/edg_developers" rel="noopener noreferrer"&gt;if you are curious to ask us questions at chat&lt;/a&gt; and let us know what you want to build and we can guide you through process to get funded.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.edgewa.re/" rel="noopener noreferrer"&gt;https://docs.edgewa.re&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://contracts.edgewa.re/#/" rel="noopener noreferrer"&gt;https://contracts.edgewa.re&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/edgeware-builders/construction-projects" rel="noopener noreferrer"&gt;https://github.com/edgeware-builders/construction-projects&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://substrate.dev/docs/en/knowledgebase/smart-contracts/" rel="noopener noreferrer"&gt;https://substrate.dev/docs/en/knowledgebase/smart-contracts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://linktr.ee/edg_developers" rel="noopener noreferrer"&gt;https://linktr.ee/edg_developers&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>solidity</category>
      <category>blockchain</category>
      <category>smartcontracts</category>
    </item>
  </channel>
</rss>
