<?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: Pari Tomar</title>
    <description>The latest articles on DEV Community by Pari Tomar (@paritomarrr).</description>
    <link>https://dev.to/paritomarrr</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%2F865601%2Fffaac44a-9ff4-42dc-803a-74b93b0baefd.jpeg</url>
      <title>DEV Community: Pari Tomar</title>
      <link>https://dev.to/paritomarrr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paritomarrr"/>
    <language>en</language>
    <item>
      <title>Web3 Development: Learn what is ETH2.0 and how it impacts you</title>
      <dc:creator>Pari Tomar</dc:creator>
      <pubDate>Tue, 28 Jun 2022 04:15:11 +0000</pubDate>
      <link>https://dev.to/buildbear/web3-development-learn-what-is-eth20-and-how-it-impacts-you-1iin</link>
      <guid>https://dev.to/buildbear/web3-development-learn-what-is-eth20-and-how-it-impacts-you-1iin</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EGVLm5-S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rsu2hyr87cd68i97hd9p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EGVLm5-S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rsu2hyr87cd68i97hd9p.png" alt="Image description" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TL;DR&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ETH2.0 is a phased release&lt;/li&gt;
&lt;li&gt;Current merge is only a PoW to PoS move&lt;/li&gt;
&lt;li&gt;PoS’s primary benefit: No more energy wasted by uncle blocks&lt;/li&gt;
&lt;li&gt;Planned for 2023: Sharding&lt;/li&gt;
&lt;li&gt;Sharding is likely to have a huge impact on our development practices&lt;/li&gt;
&lt;li&gt;Finally: Notes from Consensus 2022 in Austin, Texas (Read below)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ethereum, the most popular blockchain platform, has been planning a major software update for a long while. This update is known as ETH2.0.&lt;/p&gt;

&lt;p&gt;There are a 1000+ articles on what and why about this ETH2.0, but after scanning through them for a day, we figured the current state of our understanding was ‘unconfirmed’. If you are in the same boat, then welcome to our dumb-friendly and easy-to-get-a-grip article on ETH2.0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PoW to PoS (you already knew about this)&lt;/strong&gt;&lt;br&gt;
We are quite confident that you already know that ETH2.0 is a transition from a proof-of-work consensus mechanism to a proof-of-stake model. A quick refresher:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Oj789bhp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uuttd5xyra8w4qcppi9x.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Oj789bhp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uuttd5xyra8w4qcppi9x.jpeg" alt="Image description" width="700" height="786"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the ground zero set-up; let’s understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;about the Merge&lt;/li&gt;
&lt;li&gt;why it is such a big deal for Web3 space, and&lt;/li&gt;
&lt;li&gt;most importantly why should you care about this at all&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How does Ethereum work currently?&lt;/strong&gt;&lt;br&gt;
We all know that the current Ethereum Mainnet runs on the proof-of-work, aka PoW architecture; this is the same as the other largest blockchain network BitCoin. To not bore you to death, we are skipping the nuances of PoW and focusing on the most important lesson learned from PoW:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As the number of transactions in the blockchain increase, the computational power required to confirm the transactions also increases, which leads to higher power consumption.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While you will read almost everywhere that this “HIGH” energy consumption is ‘the’ problem, we will shout out loud that NO, it is not ‘the’ problem (unpopular opinion). ‘The’ main issue is the uncle blocks. Now again, we are choosing to not bore you to death with the nuance of uncle blocks, but cutting the story to the point:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Uncle blocks (or Ommer) are created when two or more miners create blocks at nearly the same time. Only one block can be mined and accepted as canonical on the blockchain. The others are uncle blocks, which are not included but still provide a reward to their miners for the work done&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;source: &lt;em&gt;&lt;a href="https://info.etherscan.com/"&gt;https://info.etherscan.com/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In short, these ‘mining’ efforts are “wasted”. Let us repeat this: “wasted”.&lt;/p&gt;

&lt;p&gt;It is the energy consumption in the rat race of mining that is ‘the’ energy guzzler.&lt;/p&gt;

&lt;p&gt;Now that we have understood the villain in the story. Let’s introduce the hero: &lt;strong&gt;ETH 2.0 or The Merge.&lt;/strong&gt; 🦸&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I know what ETH2.0 is; tell me something that I do not know!&lt;/strong&gt; 🙀&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Main:&lt;/strong&gt; Energy efficiency, less computational work = less energy used (our knight in shining armor)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Others:&lt;/strong&gt; Lower barriers to entry (that’s not to say that just anyone can be a validator, but it is better)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Others:&lt;/strong&gt; Reduced centralization, tied in with the last point, easier entry means higher decentralization&lt;/li&gt;
&lt;li&gt;**Others: **Security is increased as 51% of attacks are more expensive&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Power Ranger&lt;/strong&gt;&lt;br&gt;
Currently, Ethereum uses &lt;strong&gt;113 terawatt-hours of electricity per year&lt;/strong&gt;. That is as much as what the Netherlands consumes in a year.&lt;/p&gt;

&lt;p&gt;According to Digiconomist, a single Ethereum transaction can consume as much power as an average US household uses in more than a week.&lt;/p&gt;

&lt;p&gt;This has become a huge concern for the people as it has started showing its impact on the environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Power Power Power!&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tbO6uXZS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78plu7vs6oxnvvtnjmvd.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tbO6uXZS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78plu7vs6oxnvvtnjmvd.gif" alt="Image description" width="640" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is estimated the PoS will use 99.5% less energy than PoW.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mZt3tPib--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xluobimr9gm5g9bqd1lc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mZt3tPib--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xluobimr9gm5g9bqd1lc.png" alt="Image description" width="680" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is it; literally, that is the BIGGEST benefit of the merge that happened on Ropsten. See here 👉 Link&lt;/p&gt;

&lt;p&gt;No. You were not.&lt;/p&gt;

&lt;p&gt;ETH2.0 is a colloquial term and is used to represent one more BIG change: Sharding. Sharding is a technically heavy topic. In a one-liner, sharding is the ability to run a “chain of chains”. Zilliqa (based on our limited knowledge) was the &lt;a href="https://kba.ai/zilliqa-the-first-sharded-public-blockchain/#:~:text=Zilliqa%20is%20the%20first-ever,via%20refining%20the%20attribute-Scalability."&gt;first blockchain to execute sharding&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Try to bask in the light of this image to imagine how sharding looks like&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qoiZFVuW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8gzvhnb8rpmf4asrddl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qoiZFVuW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8gzvhnb8rpmf4asrddl.png" alt="Image description" width="510" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;source: Link&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So what is the status of sharding?&lt;/strong&gt;&lt;br&gt;
Being your friend, we suggest you do not hold your breath for this. This is planned for somewhere in 2023.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should I care about sharding?&lt;/strong&gt;&lt;br&gt;
Yes. Sharding is expected to have a huge impact on our development practices. So keep an eye out for that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits of sharding?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Higher throughput: which means the time taken to process transactions will be way lesser than the current 13 secs (average)&lt;/li&gt;
&lt;li&gt;Reduction in Gas Costs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Impact of ETH2.0 on Mining and Markets&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;We all know that mining is an income generation venue. At present, a miner gets &lt;strong&gt;2 ether per block plus all the priority fees contained in the block&lt;/strong&gt;. Based on our research we found that per day the number of ETH mined and provided to miners is north of 12,000+ ETH.&lt;/p&gt;

&lt;p&gt;On the basis that all of this ETH arrives at the exchanges for liquidation, there will be sell pressure every single day.&lt;/p&gt;

&lt;p&gt;Based on this &lt;a href="https://twitter.com/korpi87/status/1534232705319063553"&gt;source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We require around $10M of new money every day to keep the price flat. Therefore, after the Merge, the value will be reduced to $8M for existing holders to sell their ETH to prevent the price from going up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yaIQq4l6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hwmsbfnulq7x193inb63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yaIQq4l6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hwmsbfnulq7x193inb63.png" alt="Image description" width="482" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UNzfaMSD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fc5xpnw51aiyay3yp8k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UNzfaMSD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fc5xpnw51aiyay3yp8k.png" alt="Image description" width="700" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you again &lt;a href="https://twitter.com/korpi87"&gt;Korpi&lt;/a&gt; for this insight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;As a Web3 developer, what impacts me?&lt;/strong&gt;&lt;br&gt;
The current PoW to PoS has minimal impact. The block time is expected to be shortened from 13 seconds per block to 12 seconds.&lt;/p&gt;

&lt;p&gt;As a result, smart contracts that use block production speed as a measure of time will run one second faster after the Merge takes place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is that it?&lt;/strong&gt;&lt;br&gt;
No. Read the sharding portion above again. With sharding, a lot of changes are expected. But we just don’t know what all of these are yet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does this change mean for the newcomers?&lt;/strong&gt;&lt;br&gt;
For the newcomers to this space, this represents the best opportunity to jump in and start participating.&lt;/p&gt;

&lt;p&gt;It’ll be cheaper to start a DAO or launch a project. Or, if you’re more interested in contributing to the network as a validator, the new mechanism is making it even easier for you to participate with reduced hardware requirements.&lt;/p&gt;

&lt;p&gt;If you were concerned about the environmental impact of blockchain technologies, the reduced impact of the second-largest blockchain in existence is being cut so you can feel maybe a twinge less guilty about using it (if you’re in the category you should also check out this article).&lt;/p&gt;

&lt;p&gt;Or, if you’re a security skeptic then maybe you might be feeling unsure about this. After all, PoS is less tested under the heat of battle than PoW.&lt;/p&gt;

&lt;p&gt;On the other hand, ETH 2.0 was designed with security at the forefront of consideration; requiring a minimum of 16,384 validators, &lt;a href="https://decrypt.co/10093/vitalik-buterin-proof-of-stake-will-make-ethereum-safer"&gt;Vitalik is pretty confident in it as well&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This number of validators certainly seems like it’s enough to adequately call it decentralized and the cost of a &lt;a href="https://www.investopedia.com/terms/1/51-attack.asp"&gt;51% attack&lt;/a&gt; against the network would cost many billions of dollars in staked ETH.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notes from Consensus 2022 in Austin, Texas&lt;/strong&gt;&lt;br&gt;
Members of the core team that were at Consensus 2022 participated in a panel about the ETH merge and I was able to pull two major areas to highlight from this.&lt;/p&gt;

&lt;p&gt;First, regarding the frustrations voiced over the continual setbacks in finalizing the merge, the team pressed on the need for patience as research takes time to conduct and test. With security and stability being vital to the success of the merge, the team is taking the precautions necessary. If something does go wrong during the merging process the team will stop the merge and postpone it again.&lt;/p&gt;

&lt;p&gt;Secondly, when the issue of centralization was pressed the team responded that the update will effectively break up the Ethereum mining cartels that have dominated the market, leading to greater decentralization. Further, staked ETH centralization is a problem that will need to be solved by a combination of human and technical methods. Every layer of the ecosystem will have to continue to grow to mitigate the centralization of ETH.&lt;/p&gt;

&lt;p&gt;Authors (open to feedback): 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/msbivens_"&gt;Mike Bivens&lt;/a&gt;, &lt;a href="https://twitter.com/tomarpari90"&gt;Pari Tomar&lt;/a&gt; and &lt;a href="https://twitter.com/amateurdev2"&gt;Amateur-Dev&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hardhat or Truffle? As a beginner blockchain developer, which one do I pick</title>
      <dc:creator>Pari Tomar</dc:creator>
      <pubDate>Thu, 02 Jun 2022 13:40:32 +0000</pubDate>
      <link>https://dev.to/buildbear/hardhat-or-truffle-as-a-beginner-blockchain-developer-which-one-do-i-pick-2djc</link>
      <guid>https://dev.to/buildbear/hardhat-or-truffle-as-a-beginner-blockchain-developer-which-one-do-i-pick-2djc</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IS9Q7-_i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d7u0vqbwd7cysni1074a.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IS9Q7-_i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d7u0vqbwd7cysni1074a.jpeg" alt="Image description" width="700" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a blockchain developer’s life, one of the major pain point is to find the best-suited framework or tool for him/her. People spend days or weeks finding the right tool for them.  &lt;/p&gt;

&lt;p&gt;Similarly, in the Blockchain world, one of the major debate is on choosing between Hardhat or Truffle. &lt;/p&gt;

&lt;p&gt;These development environments help developers to manage many of the tasks that are inherent to developing decentralized applications and smart contracts. &lt;/p&gt;

&lt;p&gt;If you just starting out your career in the blockchain world and, just like us, albeit sometime back, are wondering which one to choose: Hardhat or Truffle, then you’re at the right place!! 🥳🥳   In the below paragraphs, we have discussed both these frameworks and have proceeded further to do a small comparison of sorts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hardhat Tool
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3m2blvh4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s9cx0vx00rc40xmqy22y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3m2blvh4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s9cx0vx00rc40xmqy22y.png" alt="Image description" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hardhat is an &lt;em&gt;Ethereum development environment&lt;/em&gt; for developers that allows performing frequent tasks. &lt;/p&gt;

&lt;p&gt;Other than just deploying and running tests, Hardhat also provides some more features that make it more powerful and unique. &lt;/p&gt;

&lt;p&gt;Let's consider these features one by one.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hardhat Network&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hardhat comes built-in with &lt;strong&gt;Hardhat Network&lt;/strong&gt;, a local Ethereum network node designed for development providing multiple features like automated error messages, mainnet forking, and, mining modes. &lt;/p&gt;

&lt;p&gt;So if you’re using Hardhat, then by default you’re already using Hardhat Network. It mines a block with each transaction that it receives, in order and with no delay.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Plugins&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next up is Plugins. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Plugins,&lt;/em&gt; in simpler words, are extensions that can be loaded on a program to improve its functionality. &lt;/p&gt;

&lt;p&gt;There are &lt;strong&gt;30+ plugins&lt;/strong&gt; used in development with Hardhat which is why it is considered the &lt;em&gt;backbone of Hardhat.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;We have listed some of the popular plugins below with their functionalities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://hardhat.org/plugins/nomiclabs-hardhat-ethers.html"&gt;@nomiclabs/hardhat-ethers&lt;/a&gt;:&lt;/strong&gt; It allows developers to inject ethers.js into the &lt;em&gt;Hardhat Runtime Environment.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://hardhat.org/plugins/nomiclabs-hardhat-waffle.html"&gt;@nomiclabs/hardhat-waffle&lt;/a&gt;:&lt;/strong&gt; It allows you to add a Waffle-compatible provider to the Hardhat Runtime Environment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html"&gt;@nomiclabs/hardhat-etherscan&lt;/a&gt;:&lt;/strong&gt; It automatically verifies contracts on Etherscan&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.npmjs.com/package/hardhat-gas-reporter"&gt;hardhat-gas-reporter&lt;/a&gt;:&lt;/strong&gt; Gas reporter helps to acknowledge the gas usage per unit test and average gas usage per method.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Testing&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hardhat provides a very simple procedure for testing smart contracts, providing developers to write automated tests when building smart contracts. &lt;/p&gt;

&lt;p&gt;Hardhat provides great &lt;a href="https://hardhat.org/tutorial/testing-contracts.html"&gt;documentation&lt;/a&gt; for understanding testing methods with Hardhat.&lt;/p&gt;

&lt;p&gt;If you’re new to Hardhat Testing, try our &lt;em&gt;previous &lt;a href="https://medium.com/uv-labs/creating-and-deploying-your-first-smart-contract-466b4d4784e2"&gt;article&lt;/a&gt;&lt;/em&gt; to get a better understanding of Hardhat Testing. &lt;/p&gt;

&lt;h3&gt;
  
  
  The Universe of Truffle Tools
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XHLseZ21--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhvcio3fwqxiswf6peyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XHLseZ21--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhvcio3fwqxiswf6peyp.png" alt="Image description" width="800" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like Hardhat, Truffle is also a development environment dedicated to Ethereum blockchain. &lt;/p&gt;

&lt;p&gt;Truffle is a highly popular development framework and provides a large community behind the tool.&lt;/p&gt;

&lt;p&gt;For decentralized applications development, the developer uses &lt;em&gt;Truffle Suite&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The Truffle Suite is an &lt;strong&gt;ecosystem&lt;/strong&gt; for Web3 development that consists of three different tools: &lt;strong&gt;Truffle, Ganache,&lt;/strong&gt; and &lt;strong&gt;Drizzle&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aL-icPBO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jwpt3apxumwqw5ukdtjh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aL-icPBO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jwpt3apxumwqw5ukdtjh.png" alt="Image description" width="800" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Truffle:&lt;/strong&gt; It is a development environment that uses the EVM for smart contract development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ganache:&lt;/strong&gt; Ganache is a tool used to set up your own local Ethereum blockchain that you can use to deploy and test your smart contracts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other than that, Ganache enables developers to avoid paying unnecessary gas fees during the developing process. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Drizzle:&lt;/strong&gt; Drizzle is a collection of frontend libraries with a Redux store as its basis.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With this, the frontend development becomes a lot easier for the developers. &lt;/p&gt;

&lt;p&gt;Truffle offers several different features like: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Smart Contract Management:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Truffle helps you manage the artifacts of the smart contracts so that you can focus on the other parts of the development process and spend less time on the file organization.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scriptable Migration and Deployment:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With Truffle, you can write deployment scripts that allow you to account for the fact that your Dapps will change over time. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Powerful Interactive Console:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Truffle provides 2 different consoles to choose the best tool for your needs. &lt;/p&gt;

&lt;p&gt;(A) Truffle Console: A basic interactive console connecting to any Ethereum client.  To launch the console, use the &lt;code&gt;truffle console&lt;/code&gt; command.  When you load the console, you'll immediately see the following prompt:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F94FOH1m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a3rx693qksvnj2bn0cyk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F94FOH1m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a3rx693qksvnj2bn0cyk.png" alt="Image description" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Truffle console will let you connect with the contracts deployed on the EVM client and interact with the contracts in a manner similar to the one that you would use through javascript.&lt;/p&gt;

&lt;p&gt;(B) Truffle Develop: An interactive console that also spawns a development blockchain. It serves the same purpose as the &lt;code&gt;hardhat node&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can simply launch the Truffle Develop by using the &lt;code&gt;truffle develop&lt;/code&gt; command&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YGkUoZ36--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6bq19l4a7mme6ghc8oe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YGkUoZ36--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6bq19l4a7mme6ghc8oe.png" alt="Image description" width="800" height="659"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Truffle Dashboard&lt;/strong&gt;: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Recently, Truffle has introduced &lt;em&gt;Truffle Dashboard,&lt;/em&gt; providing an easier way to use your existing Metamask wallet for your deployments and transactions.  Using Truffle Dashboard is not only easy but is a plug and play.  You can use the Truffle Dashboard inside any Hardhat projects also. Truffle has provided great &lt;a href="https://trufflesuite.com/docs/truffle/getting-started/using-the-truffle-dashboard/"&gt;documentation&lt;/a&gt; to follow along and use Truffle Dashboard in your project.&lt;/p&gt;

&lt;h1&gt;
  
  
  Which one is more powerful?
&lt;/h1&gt;

&lt;p&gt;Let us compare some of their features and get a final answer to our question!! 💪&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Debugging
&lt;/h3&gt;

&lt;p&gt;Solidity is hard to debug. You just get an error message when something breaks and more often than not, it is painful to debug what exactly went wrong. &lt;/p&gt;

&lt;p&gt;Thankfully, &lt;strong&gt;Hardhat&lt;/strong&gt; introduced something known as the &lt;a href="https://hardhat.org/tutorial/debugging-with-hardhat-network.html#solidity-console-log"&gt;console.log&lt;/a&gt; feature for Solidity. &lt;/p&gt;

&lt;p&gt;So you can simply import the console plugin and can use it inside your functions. &lt;/p&gt;

&lt;p&gt;This is what it looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H_ESLOn9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pg0hxkthq9yfhxp3z387.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H_ESLOn9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pg0hxkthq9yfhxp3z387.png" alt="Image description" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add some &lt;code&gt;console.log&lt;/code&gt; inside the function&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ECB31mie--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3kmlhcv2d46n7u41qfb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ECB31mie--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3kmlhcv2d46n7u41qfb.png" alt="Image description" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The logging output will show when you run your tests:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UQd8t4eD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3mw0afhw46l1idsgpra.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UQd8t4eD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3mw0afhw46l1idsgpra.png" alt="Image description" width="800" height="616"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The EVM created by hardhat specifically supports this feature and hence is native to Hardhat Node. This feature alone is a heavy pro for Hardhat.&lt;/p&gt;

&lt;p&gt;On the other hand, Truffle has been improving its &lt;a href="https://trufflesuite.com/docs/truffle/getting-started/using-the-truffle-debugger/#using-the-truffle-debugger"&gt;debugger&lt;/a&gt; and it also has some plugins for it but Hardhat is considered a more easier and powerful tool used for debugging. &lt;/p&gt;

&lt;h3&gt;
  
  
  2. Libraries (Ethers and Web3)
&lt;/h3&gt;

&lt;p&gt;Hardhat uses ethersjs by default but can be easily modified to use &lt;a href="https://hardhat.org/plugins/nomiclabs-hardhat-web3.html#hardhat-web3"&gt;Web3&lt;/a&gt;. Whereas, Truffle uses Web3 as default plugin for development. &lt;/p&gt;

&lt;p&gt;You can also use Etherjs with Truffle but it is considered to be trickier and hard to implement. &lt;/p&gt;

&lt;p&gt;While ethers-js and web3-js are similar, there is a very high uptick in the number of developers using ethers-js as default; this should presumably give you some hint on what you could / should consider for developing.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Local Ethereum Network node
&lt;/h3&gt;

&lt;p&gt;Hardhat comes inbuilt with &lt;a href="https://www.notion.so/local-Ethereum-network-node-7f385e90d47f4911aee1fcc90aee32d5"&gt;Hardhat Node&lt;/a&gt;. However, it does not have a GUI for developers to see account info in real-time. &lt;/p&gt;

&lt;p&gt;Truffle, on the other hand, uses &lt;a href="https://trufflesuite.com/ganache/"&gt;Ganache&lt;/a&gt; which has to be set up separately. However, it comes with both a CLI and a GUI version allowing flexibility for the developer.&lt;/p&gt;

&lt;p&gt;If you prefer the GUI you should choose Ganache.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Deployment
&lt;/h3&gt;

&lt;p&gt;For deploying a contract, Hardhat uses basic javascript scripts to &lt;a href="https://hardhat.org/guides/deploying.html#deploying-your-contracts"&gt;deploy&lt;/a&gt;, so it’s easier to get started with it and is relatively simple to use.&lt;/p&gt;

&lt;p&gt;Whereas, Truffle uses a &lt;a href="https://trufflesuite.com/docs/truffle/getting-started/running-migrations/#running-migrations"&gt;&lt;em&gt;migration-based&lt;/em&gt;&lt;/a&gt; deployment procedure (&lt;em&gt;which are js files themselves, but have a sequential order of execution)&lt;/em&gt; which is a bit more complicated for a beginner, but can be helpful in the long term keeping in mind that your deployment needs might change in the future.&lt;/p&gt;

&lt;p&gt;But for ease of getting started with deployment, hardhat definitely takes the prize.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Testing
&lt;/h3&gt;

&lt;p&gt;To perform various tests, both Truffle and Hardhat use the Chai assertion library and Mocha as their testing framework but hardhat also includes &lt;a href="https://getwaffle.io/"&gt;waffle&lt;/a&gt;.  They’re both strong when it comes to testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Statistics
&lt;/h3&gt;

&lt;p&gt;Before Hardhat was launched, Web3 was the most popular framework for testing out smart contracts. &lt;/p&gt;

&lt;p&gt;Later on, now you can see that the trend changes over time, and Hardhat has gained more popularity as compared Truffle. &lt;/p&gt;

&lt;p&gt;According to the NPMJS Statistics, Truffle has almost 30k weekly downloads. Whereas, Hardhat has around 86k weekly downloads, which is twice as compared Truffle’s. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sXVO-awv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zojv9o2xkir9sr3l9rup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sXVO-awv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zojv9o2xkir9sr3l9rup.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Community
&lt;/h3&gt;

&lt;p&gt;Truffle’s &lt;a href="https://github.com/orgs/trufflesuite/discussions"&gt;Github&lt;/a&gt; community is quite active and helpful, whereas Hardhat provides a &lt;a href="https://discord.com/invite/TETZs2KK4k"&gt;Discord server&lt;/a&gt; for their community support.  It must be noted that the entire Truffle offering is supported by Consensys and hence you can expect a “support helpdesk” treatment.  Hardhat too is developed and managed through an organization: the Nomic Foundation and has an amazing and equally good support system through its discord server.&lt;/p&gt;

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

&lt;p&gt;It is really hard to say which is the best. The choice of Truffle vs Hardhat comes down to one’s own preferences and use cases, as they both are two powerful tools.&lt;/p&gt;

&lt;p&gt;If you’re absolutely new to both frameworks, then you should definitely explore both of them and decide which one is the best for ‘you’.&lt;/p&gt;

&lt;p&gt;However, we hope this article was able to give you an insight into the differences between them and was able to help you to find which one to use. &lt;/p&gt;

&lt;p&gt;Tell us which framework do you prefer over the other by tagging us on Twitter at &lt;a href="https://twitter.com/uv_labs"&gt;@uv_labs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give us a clap if you liked our work.&lt;/p&gt;

&lt;p&gt;Authors (open to feedback): 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/u/130345445971?source=post_page-----5311a13d173-----------------------------------"&gt;Pari Tomar&lt;/a&gt;, &lt;a href="https://medium.com/@mayonfrancis"&gt;Mayon Francis&lt;/a&gt; and &lt;a href="https://medium.com/u/9cd26cbd96b9?source=post_page-----5311a13d173-----------------------------------"&gt;Amateur-Dev&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How can you become a Blockchain Developer in 2022</title>
      <dc:creator>Pari Tomar</dc:creator>
      <pubDate>Tue, 24 May 2022 14:26:20 +0000</pubDate>
      <link>https://dev.to/buildbear/how-can-you-become-a-blockchain-developer-in-2022-15ng</link>
      <guid>https://dev.to/buildbear/how-can-you-become-a-blockchain-developer-in-2022-15ng</guid>
      <description>&lt;p&gt;We all agree that ‘Blockchain’ is in trend these days. &lt;/p&gt;

&lt;p&gt;Apart from its value add as a technology, it is now also one of the most promising and demanding areas in the software development domain. &lt;/p&gt;

&lt;p&gt;If you are thinking to work on building your career in the Blockchain aka Web3 space, congratulations you are on the right path.  If you are still considering and are also thinking on how can you build a career in the Blockchain space, specifically, as a developer, read along.&lt;/p&gt;

&lt;p&gt;Trust us. Anyone and Everyone can become a blockchain developer, once you put your heart and mind to it.  If you put in the right amount of effort, we kid you not, you should be able to start your career in the blockchain before the end of 2022!!!&lt;/p&gt;

&lt;h3&gt;
  
  
  Reasons why one should become a Blockchain Developer
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Less competition in the Job Market&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are still not many Blockchain developers out there. Interested developers started to learn the concepts and apply their knowledge to space from 2016. Therefore, you will not have lots of competitors in the blockchain area.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Higher Salaries&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are thousands of active projects in the space but on the other hand, there are very few expert developers in the space. This means that if you are an expert blockchain developer in 2022, you will have endless opportunities. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Running Personal Blockchain Projects&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a Blockchain developer, you will be able to design, develop, test and deploy various solutions in the future as a 100% personal project. &lt;/p&gt;

&lt;p&gt;In this article, we’re going to create the most productive roadmap to becoming a Blockchain Developer. &lt;/p&gt;

&lt;p&gt;“Becoming a Blockchain Developer” won’t be just about smart contracts, it’s also about deployment and testing, and sometimes the front-end is included too. &lt;/p&gt;

&lt;p&gt;So without wasting any more minutes let’s just begin with our Roadmap! ⭐&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Web Development as a Prerequisite
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_qU9zdOu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/550/1%2AzehgNOkFECgOxv_soHFj_w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_qU9zdOu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/550/1%2AzehgNOkFECgOxv_soHFj_w.png" alt="Untitled" width="550" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First of all, in order to create attractive &lt;em&gt;decentralized applications&lt;/em&gt;, you’ll have to learn Web Development and programming of the apps as a prerequisite. &lt;/p&gt;

&lt;p&gt;Web Development is crucial because most organizations require blockchain developers to create apps that people with no or minimal knowledge of blockchain could use. &lt;/p&gt;

&lt;p&gt;Thus, here are some &lt;strong&gt;resources&lt;/strong&gt; for learning &lt;strong&gt;Web Development&lt;/strong&gt; in 2022:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/"&gt;FreeCodeCamp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.udemy.com/course/the-web-developer-bootcamp/"&gt;The Web Developer Bootcamp 2022&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/channel/UCqrILQNl5Ed9Dz6CGMyvMTQ"&gt;Clever Programmer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codecademy.com/"&gt;Codecademy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn"&gt;MDN Web Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These resources will help to get a great understanding of Web Development and its functionalities. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. Basics of Blockchain
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YwigcFjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2AdphZA0_htevMFzdvSSJ-WA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YwigcFjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2AdphZA0_htevMFzdvSSJ-WA.png" alt="Untitled" width="700" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you know how the back-end and the front-end work simultaneously in any application. &lt;/p&gt;

&lt;p&gt;Next up, you will have to understand the &lt;em&gt;Basics of Blockchain.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Understanding the Terminologies like:&lt;/p&gt;

&lt;p&gt;(A) &lt;strong&gt;Distributed&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(B) &lt;strong&gt;Mining&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(C) &lt;strong&gt;Node&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(D) &lt;strong&gt;Merkle Tree&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;and many more&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To understand the Basics of Blockchain, the following are some resources that would help you out: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/c/Savjee"&gt;Simply Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=YrHCD7nx29o"&gt;Dapp University&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/swlh/a-simple-guide-to-understanding-blockchain-8dd09356b153#:~:text=Blockchain%20is%20an%20immutable%2C%20distributed,assets%20using%20a%20secure%20algorithm."&gt;A Simple Guide to Understanding Blockchain&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before diving into various programming languages, it is important for us to understand how the Blockchain is working which will make it easier for us to understand the further steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Ethereum Blockchain
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OCO5Gy5X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2ADYXtk4er7zADr2-is38GEg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OCO5Gy5X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2ADYXtk4er7zADr2-is38GEg.png" alt="Untitled" width="700" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although there are several types of Blockchain Platforms like &lt;strong&gt;IBM&lt;/strong&gt; and &lt;strong&gt;Hyperledger Fabric&lt;/strong&gt;. But we are going to use the &lt;strong&gt;Ethereum blockchain&lt;/strong&gt; because Ethereum is one of the oldest and most established blockchain platforms. &lt;/p&gt;

&lt;p&gt;For a general overview of how Ethereum works, you can use the following resources provided by its official website hosts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=WSN5BaCzsbo"&gt;Decentralizing Everything with Ethereum’s Vitalik Buterin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://onezero.medium.com/why-decentralization-matters-5e3f79f7638e"&gt;Why Decentralization Matters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@virgilgr/ethereum-is-game-changing-technology-literally-d67e01a01cf8"&gt;Ethereum is game-changing technology, literally.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These resources are full of lots of beginner-friendly content. So you may find them helpful. &lt;/p&gt;

&lt;h2&gt;
  
  
  4. What is a Smart Contract?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Smart Contract&lt;/strong&gt; is simply a program that runs on the Ethereum blockchain. They are a type of Ethereum account. &lt;/p&gt;

&lt;p&gt;This means they have a balance and they can send transactions over the network. &lt;/p&gt;

&lt;p&gt;If you're just getting started or looking for a less technical introduction, we recommend  &lt;a href="https://ethereum.org/en/smart-contracts/"&gt;introduction to smart contracts&lt;/a&gt; article to you. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kI2jKlSw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2A_T__w6_tS6WQ10JA36lMLA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kI2jKlSw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2A_T__w6_tS6WQ10JA36lMLA.png" alt="Untitled" width="700" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ethereum has developer-friendly languages for writing smart contracts, such as: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solidity&lt;/li&gt;
&lt;li&gt;Vyper&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Solidity&lt;/em&gt;&lt;/strong&gt; is considered the most popular language for writing smart contracts. &lt;/p&gt;

&lt;p&gt;If you’re new to the language the &lt;a href="https://solidity.readthedocs.io/en/latest/introduction-to-smart-contracts.html"&gt;official Solidity documentation&lt;/a&gt; is a good resource to have handy. &lt;/p&gt;

&lt;p&gt;You can also learn the language by playing &lt;a href="https://cryptozombies.io/"&gt;Crypto Zombies&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Or learn by implementing using some of our articles: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/uv-labs/creating-and-deploying-your-first-smart-contract-466b4d4784e2"&gt;Creating and Deploying your first Smart Contract&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/uv-labs/fork-the-f-ing-ethereum-blockchain-transfer-tokens-from-vitaliks-account-46d408f7356c"&gt;Fork 🍴 the F*ing Ethereum Blockchain! Transfer tokens from Vitalik’s Account ;)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Frameworks for Ethereum Blockchain
&lt;/h2&gt;

&lt;p&gt;Next up, there are a few popular frameworks that are generally used by blockchain engineers. &lt;/p&gt;

&lt;p&gt;Some of them are:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--StrZRu_4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/600/1%2AGCQ37ftMcupSVT47ERPEfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--StrZRu_4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/600/1%2AGCQ37ftMcupSVT47ERPEfw.png" alt="Untitled" width="600" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://hardhat.org/"&gt;Hardhat&lt;/a&gt;: &lt;strong&gt;Hardhat&lt;/strong&gt; is a development tool used to compile, deploy, test and debug your Ethereum software.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It helps developers manage and automate the recurring tasks that are inherent to the process of building smart contracts and dapps. &lt;/p&gt;

&lt;p&gt;Hardhat is one of the most popular tools used by the Blockchain developer. &lt;/p&gt;

&lt;p&gt;If you’re new to Hardhat, read their &lt;a href="https://hardhat.org/getting-started/"&gt;Documentation&lt;/a&gt; where they have explained everything about it from scratch. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S5QgRH_R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/285/1%2ArI80y1dI0fjm1tJYgChmWA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S5QgRH_R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/285/1%2ArI80y1dI0fjm1tJYgChmWA.png" alt="Untitled" width="285" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://trufflesuite.com/"&gt;Truffle&lt;/a&gt;: &lt;strong&gt;Truffle&lt;/strong&gt; is an alternative to Hardhat. And it is not only used as a development tool but also used for built-in smart contract compilation, providing an interactive console for direct contract information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read Truffle’s &lt;a href="https://trufflesuite.com/docs/truffle/quickstart/"&gt;documentation&lt;/a&gt; to know more about it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l4XDa88I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2AG3UDvct36VNDr8nB6UDJag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l4XDa88I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2AG3UDvct36VNDr8nB6UDJag.png" alt="Untitled" width="700" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Brownie: Brownie is a framework that builds applications for the EVM but is Python-based, meaning it supports the programming language Vyper, a Python smart contract language.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Brownie also supports Solidity. &lt;/p&gt;

&lt;p&gt;It handles deployment, and testing and also supports a mainnet fork. &lt;/p&gt;

&lt;p&gt;Read their &lt;a href="https://eth-brownie.readthedocs.io/en/stable/"&gt;documentation&lt;/a&gt; where they have explained it thoroughly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--opE2jGaC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2AKaCOPwG4Z6MOdhHEhpsLZA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--opE2jGaC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2AKaCOPwG4Z6MOdhHEhpsLZA.png" alt="Untitled" width="700" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.openzeppelin.com/contracts"&gt;Openzeppelin&lt;/a&gt;: Openzeppelin is a toolkit with plugins that help build smart contracts faster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To use any of the smart contracts in Openzeppelin, you must import them into your own smart contract. &lt;/p&gt;

&lt;p&gt;It is one of the most popular plugins used by blockchain developers. &lt;/p&gt;

&lt;h2&gt;
  
  
  6. Tools that’ll help you grow as a Blockchain Developer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://geth.ethereum.org/"&gt;Geth&lt;/a&gt;: &lt;strong&gt;Geth or Go-Ethereum&lt;/strong&gt; has 3 interfaces that we use for blockchain development:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;JSON-RPC server&lt;/em&gt;,  an &lt;em&gt;interactive console&lt;/em&gt;, and &lt;em&gt;Command-Line&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Although it comes with built-in access to testnet &lt;strong&gt;Rinkeby,&lt;/strong&gt; it also allows users to network a local cluster of nodes to create their own Ethereum network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--US6Fhp8j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2ABVkejWdpQe7CvFKahxckHw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--US6Fhp8j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2ABVkejWdpQe7CvFKahxckHw.png" alt="ethereum.png" width="700" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MetaMask: &lt;strong&gt;MetaMask&lt;/strong&gt; is a browser plugin that serves as an Ethereum wallet. It allows users to store &lt;strong&gt;Ether&lt;/strong&gt; and other &lt;strong&gt;ERC-20 tokens&lt;/strong&gt;, enabling them to make transactions to any Ethereum address.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can download the Metamask extension using &lt;a href="https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en"&gt;this&lt;/a&gt; link. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--59aJkUsP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2AUPh4aQSZB58gJjDsiVtcpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--59aJkUsP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2AUPh4aQSZB58gJjDsiVtcpg.png" alt="MetaMask_Fox.svg.png" width="700" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remix IDE: &lt;strong&gt;Remix IDE&lt;/strong&gt; is an open-source web and desktop application. Remix is used for the entire journey of contract development with Solidity language as well as a playground for learning and teaching Ethereum.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jZuGTQLX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2A3yi13FShd3OE5-7Tv7hfoA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jZuGTQLX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2A3yi13FShd3OE5-7Tv7hfoA.png" alt="Untitled" width="700" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node as a Service: &lt;strong&gt;Node service providers&lt;/strong&gt; run distributed node clients behind the scenes for you, so you don’t have to. These services typically provide an API key that you can use to write to and read from the blockchain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is a huge debate on whether we should run our own node or use a provider. To know more about it, read our article: *&lt;strong&gt;&lt;em&gt;&lt;a href="https://medium.com/uv-labs/web3-should-i-use-infura-alchemy-or-run-a-node-5311a13d173"&gt;Web3: Should I use Infura / Alchemy or Run a Node?&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;*&lt;/p&gt;

&lt;p&gt;Popular Node Services are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.alchemy.com/"&gt;Alchemy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ankr.com/"&gt;Ankr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blockdaemon.com/?gclid=CjwKCAjw4ayUBhA4EiwATWyBrmH1kPF88PZoYij-caf9bmzdtfncq73lvhz9RnmfZJQhcyEbAW9CiRoCSewQAvD_BwE"&gt;BlockDaemon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://infura.io/"&gt;Infura&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://moralis.io/"&gt;Moralis&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Out of all these node providers, &lt;strong&gt;Alchemy&lt;/strong&gt; is one of the most popular node providers used by blockchain developers. &lt;/p&gt;

&lt;p&gt;You can read more about Alchemy &lt;a href="https://ethereum.org/en/developers/tutorials/getting-started-with-ethereum-development-using-alchemy/"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. IPFS
&lt;/h2&gt;

&lt;p&gt;Ethereum can be used in code storage in all smart contracts. But is not designed for storing a large amount of data. For this reason, we need a different methodology to store a large amount of data in a decentralized way. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wEJhg8Ka--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2Al_mNm4h8Yk82EZIIi0D_gA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wEJhg8Ka--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/700/1%2Al_mNm4h8Yk82EZIIi0D_gA.png" alt="Untitled" width="700" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hence, IPFS is a &lt;strong&gt;distributed system&lt;/strong&gt; for storing and accessing files, websites, applications, and data. &lt;br&gt;
To persist data on IPFS we have to work with a pinning service, which will ‘pin’ your data for you. &lt;/p&gt;

&lt;p&gt;Moreover, there are various pinning services that exist to store data on IPFS like &lt;a href="https://www.pinata.cloud/"&gt;Pinata&lt;/a&gt;, &lt;a href="http://Web3.storage"&gt;Web3.storage&lt;/a&gt;, and Infura. &lt;/p&gt;

&lt;h2&gt;
  
  
  8. Practice has the man / woman perfect
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Rwg1zmP4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://miro.medium.com/max/700/1%2AWgv2LRuY83DtInyG8RaoIw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rwg1zmP4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://miro.medium.com/max/700/1%2AWgv2LRuY83DtInyG8RaoIw.gif" alt="pmp-800x600.gif" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best way to understand anything is by implementing it. &lt;/p&gt;

&lt;p&gt;Therefore, here are a few &lt;a href="https://medium.com/uv-labs"&gt;tutorials&lt;/a&gt; for the people who are new to the Blockchain Domain. &lt;/p&gt;

&lt;p&gt;You can follow along with these tutorials and can add them to your resume and can land into a Great Job!! 😀&lt;/p&gt;

&lt;p&gt;Tell us how do you think about this Roadmap by tagging us on Twitter at  &lt;a href="https://twitter.com/uv_labs"&gt;@uv_labs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give us a clap if you liked our work.&lt;/p&gt;

&lt;p&gt;Authors (open to feedback): 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/u/9cd26cbd96b9?source=post_page-----5311a13d173-----------------------------------"&gt;Amateur-Dev&lt;/a&gt; and &lt;a href="https://medium.com/u/130345445971?source=post_page-----5311a13d173-----------------------------------"&gt;Pari Tomar&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Fork 🍴 the F*ing Ethereum Blockchain! Transfer tokens from Vitalik’s Account ;)</title>
      <dc:creator>Pari Tomar</dc:creator>
      <pubDate>Sat, 21 May 2022 05:18:09 +0000</pubDate>
      <link>https://dev.to/buildbear/fork-the-fing-ethereum-blockchain-transfer-tokens-from-vitaliks-account--3kfe</link>
      <guid>https://dev.to/buildbear/fork-the-fing-ethereum-blockchain-transfer-tokens-from-vitaliks-account--3kfe</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Creating a copy of something that already exists is known as &lt;strong&gt;Forking&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In Blockchain, forking the Ethereum mainnet (or for that matter any testnet) locally means having a copy of the main Ethereum blockchain running on our local computer. &lt;em&gt;Pro tip: there is literally 0 sense for you to fork a testnet; should you think otherwise; let us know.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When we fork 🍴 the mainnet, we have the current state of the blockchain running locally on our system, including all contracts deployed on it and all transactions performed on it.&lt;/p&gt;

&lt;p&gt;💣 we have the F*ing mainnet right in our local node; isn’t that 🆒 ?&lt;/p&gt;

&lt;h3&gt;
  
  
  Why do we need forking?
&lt;/h3&gt;

&lt;p&gt;When working on projects requires interaction with contracts that are already deployed on the mainnet (and obviously the state that they have), forking the mainnet is practically the ONLY feasible option .&lt;/p&gt;

&lt;p&gt;Honestly, we have 2 options for testing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating a mock which executes all the necessary functions of already deployed smart contracts. (But this will not potentially give you the same state.)
OR&lt;/li&gt;
&lt;li&gt;Forking the mainnet.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Creating a mock contract is not the best option because of the following reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rewriting the existing contract for testing is not such a great practice; also, sometimes it is not one contract but a suite of contracts; and&lt;/li&gt;
&lt;li&gt;Executing multiple transactions in order to create the same state in our mock environment is really really difficult! &lt;em&gt;Trust us, it is really difficult!&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hardhat and its relationship with Forking
&lt;/h3&gt;

&lt;p&gt;Hardhat allows us to fork the mainnet by updating a few lines of code in our &lt;em&gt;config file.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In order to get a better grip on mainnet forking, let us run you through an example, in which we will fork the mainnet and transfer Vitalik’s UNI token to our address 😉 .&lt;/p&gt;

&lt;p&gt;💻 Let’s dive into the coding! 💻&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Create a project and initialize it
&lt;/h3&gt;

&lt;p&gt;Use the following commands on your CLI to initialize your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir Mainnet-Forking &amp;amp;&amp;amp; cd Mainnet-Forking
npm init -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install the required dependencies for the project, run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save hardhat @nomiclabs/hardhat-ethers @nomiclabs/hardhat-waffle ethers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Initialize your Hardhat project
&lt;/h3&gt;

&lt;p&gt;To initialize your Hardhat project, run &lt;code&gt;npx hardhat&lt;/code&gt; command in your CLI, and create an empty &lt;em&gt;config.js&lt;/em&gt; file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Customize your hardhat.config.js file
&lt;/h3&gt;

&lt;p&gt;We can start an instance of Hardhat Network that forks mainnet. This means that it will simulate having the same state as mainnet, but it will work as a local development network and will allow us to interact with the deployed protocols and test interactions locally.&lt;/p&gt;

&lt;p&gt;To execute that update the &lt;em&gt;hardhat.config.js&lt;/em&gt; to as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VdnbOlRa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/720/1%2APfKENDxVMU6M46kdq6NQ2A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VdnbOlRa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/720/1%2APfKENDxVMU6M46kdq6NQ2A.png" alt="https://cdn-images-1.medium.com/max/720/1*PfKENDxVMU6M46kdq6NQ2A.png" width="720" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: Replace the &lt;code&gt;&amp;lt;key&amp;gt;&lt;/code&gt; component of the URL with your personal &lt;a href="https://www.alchemy.com/"&gt;Alchemy&lt;/a&gt; API key. Also, adding &lt;code&gt;blockNumber&lt;/code&gt;is optional, but recommended&lt;/p&gt;

&lt;p&gt;We recommend Alchemy, because we will need to access a node with archival data for this, and Alchemy provides a free plan for it.&lt;/p&gt;

&lt;p&gt;Hardhat allows you to specify a block number. This means that the state of the chain will act as if we were at that given block.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Create a Transfer script
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create a new folder&lt;code&gt;scripts&lt;/code&gt; in your root directory, and then create a file inside it, named &lt;code&gt;transfer.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create an async function, &lt;code&gt;main&lt;/code&gt;, and define the ABI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ABI or Application Binary Interface defines the methods and structures that you can simply use to interact with that binary contract.&lt;/p&gt;

&lt;p&gt;Use the following code in your &lt;em&gt;transfer.js&lt;/em&gt; script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function main() {
const abi = [
// Read-Only Functions
"function balanceOf(address owner) view returns (uint256)",
    // Authenticated Functions
"function transfer(address to, uint amount) returns (boolean)",
   ];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Magic Time 💫
&lt;/h3&gt;

&lt;p&gt;Now, we’re going to customize the Hardhat Network’s behavior with the help of &lt;code&gt;hardhat_impersonateAccount&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can impersonate an address and use some tokens from that address to test your function. In other words, it allows us to act as if we were the owner of the given account.&lt;/p&gt;

&lt;p&gt;Hardhat has provided great documentation on &lt;code&gt;impersonateAccount&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For our transfer script, we’ll be impersonating &lt;a href="https://etherscan.io/address/0xab5801a7d398351b8be11c439e05c5b3259aec9b"&gt;Vitalik’s address&lt;/a&gt; 😎&lt;/p&gt;

&lt;p&gt;Use the following code to impersonate his account and assign it as the signer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const vitalik_address = "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B";
const uniToken_address = "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984";
const my_address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
    // impersonating vitalik's account
    await hre.network.provider.request({
        method: "hardhat_impersonateAccount",
        params: [vitalik_address],
    });

    const signer = await ethers.getSigner(
        vitalik_address
    );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we’ll create an abstraction of the UNI &lt;a href="https://etherscan.io/address/0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"&gt;contract&lt;/a&gt; in order to use the transfer function.&lt;/p&gt;

&lt;p&gt;In order to execute the transfer function, we need to provide two arguments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the address to which we need to transfer the amount&lt;/li&gt;
&lt;li&gt;and, the amount we want to transfer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// uniswap contract
const uniToken = new ethers.Contract(
        uniToken_address,
        abi,
        signer
    );
const vitalik_Balance = (await uniToken.balanceOf(vitalik_address)).toString()

await uniToken.transfer(
        my_address,
        ethers.BigNumber.from(vitalik_Balance)
    );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we have defined the variable &lt;strong&gt;vitalik_Balance&lt;/strong&gt; which stores the total balance of the UNI token in his wallet. Therefore, we’ll be transferring his entire balance to our account.&lt;/p&gt;

&lt;p&gt;To check the balance of UNI Token, in your account, after the transaction is done, add the below code to your &lt;em&gt;transfer.js.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// uniswap contract
if ((await uniToken.balanceOf(my_address) == vitalik_Balance)) {
        console.log(`Wohoo!! You now have ${ethers.utils.formatEther(vitalik_Balance)} UNI Tokens!`)
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then call the main function.&lt;/p&gt;

&lt;p&gt;Your final &lt;strong&gt;&lt;em&gt;transfer.js&lt;/em&gt;&lt;/strong&gt; should look similar to:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9I8QWKKc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/720/1%2AhE99sqsFdjn7DfPlpfIH9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9I8QWKKc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/720/1%2AhE99sqsFdjn7DfPlpfIH9w.png" alt="https://cdn-images-1.medium.com/max/720/1*hE99sqsFdjn7DfPlpfIH9w.png" width="720" height="836"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s time to run the script!!! 🥳&lt;/p&gt;

&lt;p&gt;Open your CLI and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat run scripts/transfer.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Within a few seconds, you should see the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xA6e4LQz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/720/1%2A3QMv8ns0S6frQYwpSOHqWA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xA6e4LQz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/720/1%2A3QMv8ns0S6frQYwpSOHqWA.png" alt="https://cdn-images-1.medium.com/max/720/1*3QMv8ns0S6frQYwpSOHqWA.png" width="720" height="31"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CLI Showing UNI Tokens&lt;/p&gt;

&lt;p&gt;You can see that we got a balance of 1615.57647 UNI Tokens in our account (1615576470000000000000 wei, converted to ethers).&lt;/p&gt;

&lt;p&gt;Isn’t this amazing!? How we impersonated Vitalik’s account and transferred the token to our address!&lt;/p&gt;

&lt;p&gt;In the next article, we’ll continue with mainnet forking and will try swapping the tokens using Hardhat!&lt;/p&gt;

&lt;p&gt;Don’t worry, if you get any error messages, you can ask us by tagging &lt;a href="https://twitter.com/uv_labs"&gt;@uv_labs&lt;/a&gt; on Twitter.&lt;/p&gt;

&lt;p&gt;Again, all the code that we just ran through is over here 👉 &lt;a href="https://github.com/UV-Labs/Tutorials"&gt;Github repository&lt;/a&gt;. Do give us a star, and clap if you liked our work.&lt;/p&gt;

&lt;p&gt;Authors (open to feedback): 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/u/9cd26cbd96b9?source=post_page-----5311a13d173-----------------------------------"&gt;Amateur-Dev&lt;/a&gt; and &lt;a href="https://medium.com/u/130345445971?source=post_page-----5311a13d173-----------------------------------"&gt;Pari Tomar&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Learn how to sell your NFTs at the best price using the Dutch Auction Model</title>
      <dc:creator>Pari Tomar</dc:creator>
      <pubDate>Sat, 21 May 2022 04:54:37 +0000</pubDate>
      <link>https://dev.to/buildbear/learn-how-to-sell-your-nfts-at-the-best-price-using-the-dutch-auction-model-2bm7</link>
      <guid>https://dev.to/buildbear/learn-how-to-sell-your-nfts-at-the-best-price-using-the-dutch-auction-model-2bm7</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wUMLHmno--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3200/1%2AJG2HcV65O76B_6hNxXMhcQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wUMLHmno--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3200/1%2AJG2HcV65O76B_6hNxXMhcQ.jpeg" alt="" width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Auctions are a popular method to sell out the NFT collection drops at the best price possible.&lt;/p&gt;

&lt;p&gt;There are a couple of auction techniques present in order to sell your NFT collection, but Dutch Auction is different from other techniques and is used more often.&lt;/p&gt;

&lt;p&gt;Unlike a regular auction, in Dutch Auction, prices start very high and then slowly drop at predetermined time intervals.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nfQmFO3a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AHx2YI00OefWtBY6oND57oQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nfQmFO3a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AHx2YI00OefWtBY6oND57oQ.png" alt="" width="700" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In simpler words, in a Dutch Auction, the price of an NFT starts at an initial price (ceiling) and drops by a fixed amount periodically (eg. 0.1 ETH every 10 min) until it hits the lowest price it can go (the resting price)&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Dutch Auction is so popular?
&lt;/h2&gt;

&lt;p&gt;One of the reasons can be linked to the gas wars on the blockchain.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Gas wars&lt;/em&gt; are the spike in the blockchain gas fees that occurs when a high volume of transactions is initiated around the same time on blockchains like Ethereum, which has a low transaction throughput.&lt;/p&gt;

&lt;p&gt;The Dutch auction style is used to redirect the excess minting fee from the miners towards the artists or channeled to fund specific charities or a community DAO.&lt;/p&gt;

&lt;p&gt;So without anymore time, let’s write the Dutch Auction smart contract to sell our NFT!&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites:
&lt;/h2&gt;

&lt;p&gt;In order to mint our NFT and sell it using Dutch Auction, we are going to create an NFT contract using one of our previous articles, and copy the contract from there.&lt;/p&gt;

&lt;p&gt;Refer to this &lt;a href="https://medium.com/uv-labs/dude-i-just-deployed-my-own-nft-wt-f-9ef91c778af"&gt;article&lt;/a&gt; or &lt;a href="https://github.com/UV-Labs/Tutorials"&gt;github&lt;/a&gt; repo to get the NFT smart contract.&lt;/p&gt;

&lt;p&gt;Create a new file in your &lt;a href="https://remix.ethereum.org/#optimize=false&amp;amp;runs=200&amp;amp;evmVersion=null&amp;amp;version=soljson-v0.8.7+commit.e28d00a7.js"&gt;Remix IDE&lt;/a&gt; named as NFT.sol and paste the contract we used above.&lt;/p&gt;

&lt;p&gt;Now we are good to go!&lt;/p&gt;

&lt;p&gt;Let’s do some Dutch Auction 😎&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Write our Smart Contract
&lt;/h2&gt;

&lt;p&gt;Create a new solidity file in your Remix IDE and name it as DutchAuction.sol&lt;/p&gt;

&lt;p&gt;Create an IERC-721 interface and then initialize your Dutch Auction contract.&lt;/p&gt;

&lt;p&gt;Use the following code for reference:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IERC721 {
    function transferFrom(
        address _from,
        address _to,
        uint _nftId
    ) external;
}
contract DutchAuction { }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Once you’ve initialized your contract, we are going to define some variables that we have to use in our contract.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First, we are going to define the duration of the auction. That means the auction for the NFT will be expired after that duration. And we will define the duration for 2 days.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next, we need to store the address of the NFT and its ID. Therefore, we will use IERC721 interface to store the NFT.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We made this variable &lt;strong&gt;&lt;em&gt;immutable&lt;/em&gt;&lt;/strong&gt; so that its value does not change once the contract is deployed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Then, we going to store the address of the seller. Thus we will define the variable &lt;em&gt;seller&lt;/em&gt; which will be storing the seller’s address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Dutch Auction needs a starting price. So we are going to define a variable startingPrice&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We also need the timestamp of when the auction starts and when the auction ends. Therefore, we will define 2 variables, startAt and expiresAt which will store the respective values.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Lastly, we will define the discountRate. DiscountRate will determine the rate at which the price decrements, starting from the startingPrice.&lt;/p&gt;

&lt;p&gt;uint private constant DURATION = 2 days;&lt;br&gt;
IERC721 public immutable nft;&lt;br&gt;
uint public immutable nftId;&lt;br&gt;
address public immutable seller;&lt;br&gt;
uint public immutable startingPrice;&lt;br&gt;
uint public immutable startAt;&lt;br&gt;
uint public immutable expiresAt;&lt;br&gt;
uint public immutable discountRate;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, we will initialize these state variables in a constructor.&lt;/p&gt;

&lt;p&gt;Inside it, we are going to pass in the &lt;em&gt;_startingPrice, _discountRate, _nft,&lt;/em&gt; and &lt;em&gt;_nftId.&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;constructor(
        uint _startingPrice,
        uint _discountRate,
        address _nft,
        uint _nftId
    ) { }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Inside the constructor, we will set the seller to the deployer of this contract. And once the NFT will be sold, we need to transfer the ETH to the seller, therefore we will make it &lt;em&gt;payable.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;seller = payable(msg.sender);&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We will take the input from the user to get the &lt;em&gt;startingPrice, discountRate, startAt and expireAt&lt;/em&gt;. So, we will write it as:&lt;/p&gt;

&lt;p&gt;startingPrice = _startingPrice;&lt;br&gt;
discountRate = _discountRate;&lt;br&gt;
startAt = block.timestamp;&lt;br&gt;
expiresAt = block.timestamp + DURATION;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We will also check whether the price of the NFT is always greater than zero or not.&lt;/p&gt;

&lt;p&gt;_startingPrice &amp;gt;= _discountRate * DURATION, "Starting Price is less than the discount offered"&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;_discountRate * DURATION is the maximum amount of price deduction that is applied to the startingPrice&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Lastly, we set the NFT using the input. So we can say:&lt;/p&gt;

&lt;p&gt;nft = IERC721(_nft);&lt;br&gt;
nftId = _nftId;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now since our constructor is complete.&lt;/p&gt;

&lt;p&gt;Next, we’re going to define 2 functions that we will be using further: &lt;strong&gt;&lt;em&gt;currentPrice()&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;buyNow()&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;strong&gt;currentPrice()&lt;/strong&gt;, we will know the price of the NFT at that particular instance of time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For that, we will write:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function currentPrice() public view returns (uint) {
        uint timeElapsed = block.timestamp - startAt;
        uint discount = discountRate * timeElapsed;
        return startingPrice - discount;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Next, using the &lt;strong&gt;buyNow()&lt;/strong&gt; function, the user will be able to buy the NFT.&lt;/p&gt;

&lt;p&gt;function buy() external payable {&lt;br&gt;
        require(block.timestamp &amp;lt; expiresAt, "Auction expired! :(");&lt;br&gt;
        uint price = currentPrice();&lt;br&gt;
        require(msg.value &amp;gt;= price, "ETH is less than the price");&lt;br&gt;
        nft.transferFrom(seller, msg.sender, nftId);&lt;br&gt;
        selfdestruct(seller);&lt;br&gt;
    }&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this function, first, we’ll check whether the auction is expired or not.&lt;/p&gt;

&lt;p&gt;If the auction is not expired, then we will get the current price and store it inside the price variable using the currentPrice function.&lt;/p&gt;

&lt;p&gt;Next, we will check that the amount we have sent is greater than or equal to the price.&lt;/p&gt;

&lt;p&gt;Once we know that the msg.sender has sent enough ETH to buy the NFT, we will transfer the ownership of the NFT using the 3 parameters: &lt;em&gt;seller, msg.sender, nftId.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Last but not the least, we have used the &lt;strong&gt;selfdestruct()&lt;/strong&gt; function to close the auction. Therefore, we will pass the seller address inside the function.&lt;/p&gt;

&lt;p&gt;Guess what?&lt;/p&gt;

&lt;p&gt;We have completed our Dutch Auction Smart Contract!! 🎊&lt;/p&gt;

&lt;p&gt;Your contract should look like this 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y1n55C0X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4712/1%2ArrFkB_XHgY2c2ZSZvWC1Ow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y1n55C0X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4712/1%2ArrFkB_XHgY2c2ZSZvWC1Ow.png" alt="" width="800" height="847"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we’re going to test our Dutch Auction smart contract by selling our NFT. 😮&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Mint our NFT using its tokenURI
&lt;/h2&gt;

&lt;p&gt;Remember we created a file NFT.sol at the first place of this article?&lt;/p&gt;

&lt;p&gt;Now we will deploy that NFT and then call the mint function using its tokenURI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q4oKNurP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3840/1%2A1-ywhFH1VTV0_7e1plgyCw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q4oKNurP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3840/1%2A1-ywhFH1VTV0_7e1plgyCw.png" alt="" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we have minted our demo NFT. Next we are going to deploy our Dutch Auction contract.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Deploy the Dutch Auction contract
&lt;/h2&gt;

&lt;p&gt;Compile the Dutch Auction contract and then deploy it.&lt;/p&gt;

&lt;p&gt;There are some parameters we have to pass in order to deploy our contract.&lt;/p&gt;

&lt;p&gt;We will get the &lt;strong&gt;startingPrice&lt;/strong&gt; to &lt;em&gt;1000000,&lt;/em&gt; &lt;strong&gt;discountRate&lt;/strong&gt; at 1*,* the &lt;strong&gt;address&lt;/strong&gt; of the NFT which we deployed just a while before and lastly, &lt;strong&gt;we have to provide the ***tokenId&lt;/strong&gt;* which is equal to &lt;em&gt;1.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once you’ve added the parameters, hit the Deploy button to deploy our contract.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OAAzoNRB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AxwZQ6TUhwrkxLzixnWh7dA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OAAzoNRB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AxwZQ6TUhwrkxLzixnWh7dA.png" alt="" width="381" height="888"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once our Dutch Auction contract is deployed. Next thing we’re going to do is approve the Dutch Auction to spend our NFT.&lt;/p&gt;

&lt;p&gt;For that, we will open our NFT under Deployed Contracts and execute the approve function.&lt;/p&gt;

&lt;p&gt;We need to pass the Dutch Auction’s deployed address and the tokenId of the NFT to run the approve function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--70WlU1r9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AgY-EgFjN7BycIb0mJ_UPJA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--70WlU1r9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AgY-EgFjN7BycIb0mJ_UPJA.png" alt="" width="371" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So now our DUTCH AUCTION HAS STARTED!!&lt;/p&gt;

&lt;p&gt;To check whether the Dutch Auction has started or not, open the deployed Dutch Auction contract and run the currentPrice function several times. You’ll notice everytime you run the function, you’re getting a decremented price value.&lt;/p&gt;

&lt;p&gt;Now its time to sell our NFT.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Sell our NFT using Dutch Auction contract
&lt;/h2&gt;

&lt;p&gt;First, run the &lt;em&gt;currentPrice&lt;/em&gt; function and copy the price value.&lt;/p&gt;

&lt;p&gt;And then switch to some other account, from which you want to buy the NFT and paste the price value under the &lt;em&gt;value&lt;/em&gt; option.&lt;/p&gt;

&lt;p&gt;And then run the &lt;em&gt;buyNow&lt;/em&gt; function.&lt;/p&gt;

&lt;p&gt;GUESS WHAT!?&lt;/p&gt;

&lt;p&gt;You just sold your NFT using Dutch Auction!! 😍&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QShXxsIy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AmGjGpmTTNepV1Xxutt22UQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QShXxsIy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AmGjGpmTTNepV1Xxutt22UQ.gif" alt="" width="500" height="900"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you go back to your NFT contract and run the &lt;em&gt;ownerOf&lt;/em&gt; function, you can see the owner of the contract is updated.&lt;/p&gt;

&lt;p&gt;And this is how we can sell our NFT using the Dutch Auction!!!&lt;/p&gt;

&lt;p&gt;If you liked the article, do give us a clap. 👏&lt;/p&gt;

&lt;p&gt;And don’t worry, if you get any error message, you can ask us by tagging &lt;a href="https://twitter.com/uv_labs"&gt;@uv_labs&lt;/a&gt; on Twitter.&lt;/p&gt;

&lt;p&gt;Authors (open to feedback): 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/u/9cd26cbd96b9?source=post_page-----5311a13d173-----------------------------------"&gt;Amateur-Dev&lt;/a&gt; and &lt;a href="https://medium.com/u/130345445971?source=post_page-----5311a13d173-----------------------------------"&gt;Pari Tomar&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
