<?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>Forem: Neelansh Mathur</title>
    <description>The latest articles on Forem by Neelansh Mathur (@neelansh15).</description>
    <link>https://forem.com/neelansh15</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%2F478725%2F76193c6d-b4b7-4af1-afae-0daa288f088d.jpg</url>
      <title>Forem: Neelansh Mathur</title>
      <link>https://forem.com/neelansh15</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/neelansh15"/>
    <language>en</language>
    <item>
      <title>The end, and the beginning! (Polygon Fellowship Finale)</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Thu, 18 Aug 2022 16:26:00 +0000</pubDate>
      <link>https://forem.com/neelansh15/the-end-and-the-beginning-polygon-fellowship-finale-3ada</link>
      <guid>https://forem.com/neelansh15/the-end-and-the-beginning-polygon-fellowship-finale-3ada</guid>
      <description>&lt;p&gt;gm &lt;/p&gt;

&lt;p&gt;8 weeks of concentrated effort into the Polygon Fellowship finally concluded with a banger of a week at the Polygon HackerHouse in Bangalore. ✨&lt;/p&gt;

&lt;p&gt;This has been a defining experience in both my personal and work life, and I can't wait to tell you about it!&lt;/p&gt;




&lt;p&gt;Being in the Beginner Track, I was first educated about common concepts in web3 for a couple of weeks while I develop or start developing my final project's idea.&lt;/p&gt;

&lt;p&gt;Here's how the 8 weeks were structured:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Intro to Blockchain and web3 🌱&lt;/li&gt;
&lt;li&gt;Smart Contracts 😎&lt;/li&gt;
&lt;li&gt;DeFi 📈&lt;/li&gt;
&lt;li&gt;Infrastructure and Storage 💿&lt;/li&gt;
&lt;li&gt;DAOs 👨‍👩‍👧‍👦&lt;/li&gt;
&lt;li&gt;NFTs and the Metaverse 🎮&lt;/li&gt;
&lt;li&gt;Project R&amp;amp;D 💪🏻&lt;/li&gt;
&lt;li&gt;✨ Polygon HackerHouse ✨&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I made blog posts at the end of each week, covering what I learnt in that week. They are available on my Dev.to profile.&lt;/p&gt;

&lt;p&gt;There were many mentors to assist us, and a mentor was assigned to a group of 5-6 people each. My mentor is &lt;a href="https://twitter.com/musingsondefi"&gt;Leibing Guo&lt;/a&gt; from CovalentHQ, and he was very excited to hear about our ideas and progress!&lt;/p&gt;

&lt;p&gt;Every week was exciting! It was filled with interesting assignments and speaker sessions and the fellows would help each other out frequently as we all learn and grow together.&lt;/p&gt;

&lt;p&gt;The speaker sessions were from Industry Experts from various domains in web3 and some were our mentors themselves!&lt;br&gt;
The knowledge they imparted to us is very valuable and it helped me down the road when I was making my final project.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Project 🌿
&lt;/h2&gt;

&lt;p&gt;All the knowledge culminated into me deciding that my value lies in the Creator Economy, but not directly. I had wanted to develop something similar to the &lt;a href="https://lens.xyz"&gt;Lens Protocol&lt;/a&gt; so badly and did like 30-40% of the work on a mobile app.&lt;br&gt;
But then I realised at the HackerHouse that what I am doing isn't necessarily valuable. Why would I want to reinvent the wheel and compete with something that has no issues whatsoever and has a large community backing? Just because I need to make a project? Nah.&lt;/p&gt;

&lt;p&gt;I pivoted.&lt;/p&gt;

&lt;p&gt;I found out that the Lens Protocol actually has a very good system of modules that I can use to implement the functionality I initially thought would be my differentiating factor. &lt;br&gt;
I named the project &lt;strong&gt;Pollen&lt;/strong&gt;. Pollen Social, Pollen Modules, Pollen Protocol, etc. Lens Protocol's theme is flowers and gardens. So "Pollen" would be what spreads the reach of the flower to distant lands! 😌&lt;/p&gt;

&lt;p&gt;Everything on Lens is an NFT. You follow somebody, you get their follow NFT. You publish a post, that is an NFT. You comment on a post, you guessed it, it's an NFT!&lt;/p&gt;

&lt;p&gt;With this comes the potential to have custom logic. For example, before giving a user a Follow NFT, a creator could have a condition that the user should hold a certain NFT, say Bored Apes, otherwise they can't follow the creator.&lt;/p&gt;

&lt;p&gt;The possibilities are endless! But my time and energy isn't, so I created a suite of &lt;strong&gt;seven&lt;/strong&gt; modules that would be simple and standard. These would be basic modules that the people using Lens would definitely want but is not there right now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QHLEhJ1G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8g9mco8po790qtxhxzhm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QHLEhJ1G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8g9mco8po790qtxhxzhm.png" alt="Pollen Modules - Seven Modules for the Lens Protocol by Neelansh Mathur" width="880" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are extension modules for logic on Follow and Reference.&lt;br&gt;
Reference Modules basically have logic related to comments or reposts. In my case I enabled giving rewards on repost.&lt;/p&gt;

&lt;p&gt;I essentially wanted to build an OpenZeppelin for Lens. Here are the hosted docs: &lt;a href="http://pollenprotocol.surge.sh/"&gt;http://pollenprotocol.surge.sh/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also received positive feedback from the founder of Lens Protocol and Aave himself :)&lt;/p&gt;

&lt;h2&gt;
  
  
  The Polygon HackerHouse
&lt;/h2&gt;

&lt;p&gt;Finally, the day was here! I'll say this straight-off, meeting someone offline is NOT the same as meeting them online. With all the fellows here, about 50 of them combining Beginner and Buidler Tracks, it felt like this is where I belonged XD.&lt;/p&gt;

&lt;p&gt;I got to interact and truly know the other fellows and I feel like I have made friends for life :)&lt;/p&gt;

&lt;p&gt;The HackerHouse was in a crazy luxurious 5-star hotel in Bangalore and we lived in suites like the Kings and Queens that we are 👑.&lt;/p&gt;

&lt;p&gt;Every day was packed with in-person events in a beautifully decorated event hall. Prominent people like the founders and devs of Quickswap, Biconomy, etc. gave talks and this was huge for us.&lt;br&gt;
Because after the events we were able to sit with them for lunch, dinner or in general and discuss various topics and also get feedback on our projects!&lt;/p&gt;

&lt;p&gt;It's like getting life advice from the gods themselves XD 🌤&lt;/p&gt;

&lt;p&gt;At the end of the hackerhouse, I gave my presentation. I was a bit nervous but when you go up to the stage and you know what you're doing, everything just flows effortlessly! 🎉&lt;br&gt;
I forgot to mention, I was also loaded with Shwags from the Devfolio and Polygon organizing teams. It's like we were getting goodies EVERY DAY! YAY!&lt;/p&gt;

&lt;p&gt;There was a grand After-Party planned by Devfolio where we had a blast and met some more people from the web3 space as it was open to VCs, builders and the like.&lt;/p&gt;




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

&lt;p&gt;It was an unforgettable experience. The connections I made and the project itself got me ahead in ways I couldn't have imagined before. I was a fan of Polygon before but now I can't stop buidling 🔥🔥🔥! &lt;/p&gt;

&lt;p&gt;Special thanks to the Devfolio team because I saw first-hand how hard they worked to keep the experience smooth for us fellows, so kudos to them!&lt;/p&gt;

&lt;p&gt;Not a day shall pass when I don't miss the HackerHouse and the people there, but life goes on. And my life has been made significantly better by Devfolio x Polygon :')&lt;/p&gt;

&lt;p&gt;gn&lt;/p&gt;

</description>
      <category>web3</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>career</category>
    </item>
    <item>
      <title>Top 3 Play-to-Earn Games on the Blockchain to Check Out</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Sun, 24 Jul 2022 18:25:00 +0000</pubDate>
      <link>https://forem.com/neelansh15/top-3-play-to-earn-games-on-the-blockchain-to-check-out-kpe</link>
      <guid>https://forem.com/neelansh15/top-3-play-to-earn-games-on-the-blockchain-to-check-out-kpe</guid>
      <description>&lt;p&gt;&lt;a href="https://polygon.technology/polygon-fellowship/"&gt;Part of Polygon Fellowship 2022 Week 6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;gm&lt;/p&gt;

&lt;p&gt;Gaming &amp;amp; The Metaverse have become some of the top movers in the Blockchain space.&lt;br&gt;
Just looking at the &lt;a href="https://coinmarketcap.com/view/gaming/"&gt;Market Capitalization&lt;/a&gt; alone, we can imagine how big the industry actually is.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O_24Euer--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fak3pvqu2fyotb3n2hwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O_24Euer--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fak3pvqu2fyotb3n2hwl.png" alt="Screenshot of Blockchain Gaming Tokens Market Cap" width="880" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some of them are super famous like Axie Infinity, one of the pioneers of gaming on the blockchain. Others like Decentraland, Gala and Sandbox also have huge communities and have been on the news multiple times.&lt;/p&gt;

&lt;p&gt;Let's review some of them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gala Platform
&lt;/h3&gt;

&lt;p&gt;The native token is GALA.&lt;br&gt;
It has launched more than 10 games on its &lt;a href="https://app.gala.games/games"&gt;platform&lt;/a&gt;, some of which are under development, in beta or releasing soon. They are continuously developing more games for people to enjoy and earn from.&lt;br&gt;
It gives its payments in Gala Coin and some special rewards are in the form of NFTs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.gala.games/games/spider-tanks"&gt;Spider Tanks&lt;/a&gt; is a game I found interesting. It is a tank warfare game and it is out in Beta already.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--48JOwv0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xpv2rjqimyb7ycs6zl1k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--48JOwv0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xpv2rjqimyb7ycs6zl1k.png" alt="Spider Tanks NFTs on Gala" width="880" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Items have a variety of rarities: Common, Uncommon, Rare, Epic, Legendary and Ancient. &lt;br&gt;
They are essentially ERC1155 NFTs with varying levels of supply that you can own a quantity of.&lt;/p&gt;

&lt;p&gt;Overall, I loved their release video and the graphics but wasn't able to play the game, I guess I need to buy one of the Tank NFTs or the game isn't open to all yet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decentraland
&lt;/h3&gt;

&lt;p&gt;The native token is MANA (and LAND).&lt;br&gt;
Decentraland is more then just a blockchain gaming platform. It is a Metaverse platform for 3D Virtual Reality content where any user can spend and earn MANA.&lt;br&gt;
MANA is burned to get &lt;strong&gt;LAND&lt;/strong&gt; NFTs which are ERC-721 tokens.&lt;/p&gt;

&lt;p&gt;In this Metaverse, you can buy LAND which is 16 x 16 meters in size just like you would in the real world. Once you purchase your land, it has a fixed place and it can be resold like normal NFTs.&lt;br&gt;
Not just for fun, but LAND has grown to be a huge investment as its price now verses when it was launched is significantly higher.&lt;/p&gt;

&lt;p&gt;LAND owners can do anything they want with their land and can create anything. There are games being developed in parts of Decentraland which provide incentives you would expect from a play-to-earn blockchain game, but Decentralized largely remains a Metaverse platform with infinite potential.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Sandbox
&lt;/h3&gt;

&lt;p&gt;The native token is SAND.&lt;br&gt;
Like Decentraland, it is a Metaverse + Gaming platform and is based on Ethereum. The biggest backing it has is that of Binance and the fact that it was launched way back in 2012 and is thriving today says something about the ecosystem, which is stable and growing.&lt;/p&gt;

&lt;p&gt;Like in Decentraland, Sandbox users can buy &lt;em&gt;parcels&lt;/em&gt; with crypto which equate to 1 LAND token which is 96 sq. metre in size. &lt;br&gt;
Players can utilize this land to build whatever they want including games for others to play.&lt;br&gt;
Players are rewarded for collecting resources, rewards and whatever system the game developer chooses to have.&lt;/p&gt;

&lt;p&gt;The Sandbox team itself has sponsored development of many games, although like Gala many are in developement or in Beta.&lt;br&gt;
Some are in Open Beta and more are expected to release to the wider public soon.&lt;/p&gt;

&lt;p&gt;Unlike Decentraland, Sandbox also has ASSET NFT tokens in addition to LAND, which serve as collectibles in the Sandbox Marketplace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lxq73vh8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4b8wgg3rupt55h9tet2s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lxq73vh8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4b8wgg3rupt55h9tet2s.png" alt="Sandbox LAND NFTs on Opensea" width="880" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One more interesting thing about Sandbox is that even developers can directly earn, by just creating digital assets (ASSETs) and selling them on the Marketplace for other developers to use.&lt;br&gt;
There are tools provided like the Voxel Editor and GameMaker which make game development on Sandbox easier.&lt;/p&gt;




&lt;p&gt;As more games come out of open beta, I presume the values of all these impressive blockchains will increase and the platform will be more widely used by everyday internet users.&lt;/p&gt;

&lt;p&gt;Until then, I'll keep a look out for these and if you find any interesting games on the blockchain, I'm down!&lt;/p&gt;

&lt;p&gt;gn&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>The Bankless DAO - Polygon Week 5</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Sun, 17 Jul 2022 17:59:35 +0000</pubDate>
      <link>https://forem.com/neelansh15/the-bankless-dao-polygon-week-5-4n4d</link>
      <guid>https://forem.com/neelansh15/the-bankless-dao-polygon-week-5-4n4d</guid>
      <description>&lt;p&gt;&lt;a href="https://polygon.technology/polygon-fellowship/"&gt;Part of Week 5: DAOs of Polygon Fellowship 2022&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Week 5 is learning about Communities, DAOs, Social Tokens, etc.&lt;/p&gt;

&lt;p&gt;The Bankless movement aims to onboard beginners to the world of crypto through Media, Collaborations, Communities and Simpler Finance tools.&lt;/p&gt;

&lt;p&gt;Here is a short presentation on &lt;a href="https://www.bankless.community/"&gt;The Bankless DAO&lt;/a&gt; I created:&lt;br&gt;
&lt;a href="https://docs.google.com/presentation/d/1TVf7wl-uOI80paKUK0G-n8ljKjVXxji4_m0BNAouZBo/edit?usp=sharing"&gt;https://docs.google.com/presentation/d/1TVf7wl-uOI80paKUK0G-n8ljKjVXxji4_m0BNAouZBo/edit?usp=sharing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DAOs are still an interesting topic for me, especially Social DAOs and Media DAOs.&lt;/p&gt;

&lt;p&gt;I also created &lt;a href="https://app.uniswap.org/#/pool/3602?chain=polygon_mumbai"&gt;my own Liquidity pool&lt;/a&gt; on Uniswap v3 on Polygon Testnet and received an NFT for my pair. Uniswap v3 is VERY different from Uniswap v2 and I think I need to explore v3 very soon.&lt;/p&gt;

&lt;p&gt;I have covered my experience with Uniswap v2 in previous weeks which you can check out too. Primarily, this has been my github repo for smart contract interaction with Uniswap v2:&lt;br&gt;
&lt;a href="https://github.com/neelansh15/Uniswapper"&gt;https://github.com/neelansh15/Uniswapper&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See you all next week!&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>ethereum</category>
      <category>web3</category>
      <category>community</category>
    </item>
    <item>
      <title>Decentralized Social Network, Subgraphs, IPFS - Polygon Week 4</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Sun, 10 Jul 2022 18:22:00 +0000</pubDate>
      <link>https://forem.com/neelansh15/decentralized-social-network-subgraphs-ipfs-polygon-week-4-1ci2</link>
      <guid>https://forem.com/neelansh15/decentralized-social-network-subgraphs-ipfs-polygon-week-4-1ci2</guid>
      <description>&lt;p&gt;Part of &lt;a href="https://polygon.technology/polygon-fellowship/"&gt;Polygon Fellowship 2022&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;gm&lt;/p&gt;

&lt;p&gt;It's been a crazy week. The craziest, in fact, relative to the previous weeks. This week was all about exploring web3 &lt;strong&gt;Infrastructure &amp;amp; Storage&lt;/strong&gt; using IPFS, Alchemy, Pinata, TheGraph Protocol, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  Social Media Dapp
&lt;/h3&gt;

&lt;p&gt;Let's start with the heavy hitter.&lt;br&gt;
The biggest assignment in this week was to build a full-stack Decentralized Social Media App with our own hint of creativity.&lt;/p&gt;

&lt;p&gt;The assignment on Polygon Academy is given here: &lt;a href="https://academy.polygon.technology/module-8-wizard-challenge/final-asssignment"&gt;https://academy.polygon.technology/module-8-wizard-challenge/final-asssignment&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The statement says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Submit a full stack social media dapp as your final assignment. &lt;br&gt;
The dapp lets a user post and receive images to an anonymous network of contributors. There will be a feed of all images. &lt;br&gt;
No need to add extra functionality like likes and comments, just basic push-pull data submission. Use ethereum to point to images and store them on IPFS. Use polygon as an L2 for this. Submit your assignment below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is what I think the normal approach will be:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Accept image, title, description, etc. and store this metadata on IPFS&lt;/li&gt;
&lt;li&gt;Store the IPFS URLs of posts in a Smart Contract per user, maybe in an array&lt;/li&gt;
&lt;li&gt;Query this array of urls to get user's posts&lt;/li&gt;
&lt;li&gt;(Optional) Use Subgraphs or Moralis to index these posts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This works. But I had been thinking about creating Posts as NFTs in some way, inspired by reading about the &lt;a href="http://lens.xyz/"&gt;Lens Protocol&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, here is my ingenious approach!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ERC1155 ProfileHub creates a ProfileNFT for a user (Token + another ERC1155 contract)&lt;/li&gt;
&lt;li&gt;Store user's post image on IPFS&lt;/li&gt;
&lt;li&gt;Store user's post metadata on IPFS with the image URL from previous step. Metadata is according to the OpenSea Standards.&lt;/li&gt;
&lt;li&gt;ERC1155 ProfileNFT's Mint function can be called by the user with the IPFS URL of the NFT as argument.&lt;/li&gt;
&lt;li&gt;Indexing is not directly necessary as many services already index NFTs on OpenSea! 🌊&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So in this approach, There is a central &lt;strong&gt;ProfileHub&lt;/strong&gt; collection which mints a Profile Token and creates another collection called &lt;strong&gt;ProfileNFT&lt;/strong&gt; for each user.&lt;/p&gt;

&lt;p&gt;Flow: &lt;br&gt;
ProfileHub Collection =&amp;gt; ProfileNFT Token + ProfileNFT Contract&lt;br&gt;
ProfileNFT Contract = User's Posts as Tokens with Traits&lt;/p&gt;

&lt;p&gt;The benefits of this approach is that you can view your posts even on OpenSea! It has all the advantages of a regular NFT.&lt;/p&gt;
&lt;h3&gt;
  
  
  IPFS
&lt;/h3&gt;

&lt;p&gt;There are multiple ways to upload an image to IPFS. You can do it either manually or programatically.&lt;br&gt;&lt;br&gt;
I decided to create an API using NodeJS and Fastify that accepts user's image and uploads it to IPFS using Pinata's Node SDK.&lt;br&gt;
It seems a bit overkill but I had to create this for my Social Media Dapp anyways so it can be reused now.&lt;/p&gt;

&lt;p&gt;A MAJOR issue I had was with taking user's image. Normally, multipart images work with frameworks like Express and Fastify, but here the issue was that even after getting the image, Pinata's SDK wasn't accepting the file Buffer 😵‍💫&lt;br&gt;
After a LOT of hours of on-and-off debugging, I found out that there is a small hack we need to do to the file's &lt;code&gt;Readable&lt;/code&gt; Stream to make it work with Pinata.&lt;br&gt;
I wonder why nobody has covered this at all. I only found this out from a stackoverflow question that was not that much related to my problem.&lt;/p&gt;

&lt;p&gt;The overall code (which I turned into an NFT creation tool for my social dapp later on) uploads an image to IPFS, then uploads the metadata with image url to IPFS to serve as an NFT.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;No image file&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;if&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="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;name&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="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;description&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="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Missing name or description fields&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;readableStream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Readable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toBuffer&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

    &lt;span class="c1"&gt;// IMPORTANT: This is the only fix for Pinata to work. It needs a 'path' property in the Readable Stream&lt;/span&gt;
    &lt;span class="c1"&gt;// @ts-ignore&lt;/span&gt;
    &lt;span class="nx"&gt;readableStream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;filename&lt;/span&gt;

    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imageResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pinata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pinFileToIPFS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;readableStream&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imageURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;BASE_GATEWAY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;imageResult&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;IpfsHash&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;name&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="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;description&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="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;imageURL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;external_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://github.com/neelansh15&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;attributes&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="na"&gt;trait_type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Likes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="na"&gt;display_type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;date&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;trait_type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Posted on&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pinata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pinJSONToIPFS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nftURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;BASE_GATEWAY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;IpfsHash&lt;/span&gt;

        &lt;span class="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;nftURL&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the BASE_GATEWAY is &lt;code&gt;https://gateway.pinata.cloud/ipfs/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Welp, many more things to come. Especially the Social Media Dapp, an idea I plan to expand upon in the future.&lt;/p&gt;

&lt;p&gt;gn&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>DeFi &amp; LoanShark - Polygon Week 3</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Sun, 03 Jul 2022 21:06:44 +0000</pubDate>
      <link>https://forem.com/neelansh15/defi-polygon-week-3-2oa7</link>
      <guid>https://forem.com/neelansh15/defi-polygon-week-3-2oa7</guid>
      <description>&lt;p&gt;Part of &lt;a href="https://polygon.technology/polygon-fellowship/"&gt;Polygon Fellowship 2022&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;gm&lt;/p&gt;

&lt;p&gt;Decentralized Finance (DeFi) has been the most interesting topic in blockchain not just for me but for many folks, simply because it provides a new way of dealing with finances that we never saw before.&lt;/p&gt;

&lt;p&gt;In this post, I'll share what I created in the DeFi space as part of my fellowship and a brief about my research into some interesting topics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Borrowing Dapp
&lt;/h2&gt;

&lt;p&gt;The base for this project was &lt;a href="https://academy.polygon.technology/module-6-warrior-challenge/midterm-assignment-2"&gt;an assignment in Polygon Academy&lt;/a&gt;. The assignment merely gives us the statement:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Build a borrowing dapp that let's a user submit Ether to a smart contract as collateral and receive stablecoin as a loan. Have this be a web interface with text field input and a button to submit. Get creative!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As you can see, there is a very basic problem statement given, which leaves us with a lot of room for creativity!&lt;/p&gt;

&lt;p&gt;So let's think of a smart contract that loans a certain stablecoin at a fixed ratio in return for Ether/Matic. Then when the user has to repay, a small &lt;code&gt;fee&lt;/code&gt; will be taken from the Ether that will be returned to the user.&lt;br&gt;
This ratio and fee can be updated by the owner.&lt;/p&gt;

&lt;p&gt;What I also thought is, why not let the stablecoin be changed? But then, the existing loans should have been repaid.&lt;br&gt;
So, we can introduce another functionality that is whether the loan contract is &lt;code&gt;active&lt;/code&gt; or not. If it is not active, borrowing won't take place but user's can repay their stablecoin to get back the ether.&lt;/p&gt;

&lt;p&gt;I am calling this contract &lt;strong&gt;LoanShark&lt;/strong&gt;. If you have played GTA Vice City you will be very familiar with this 🙂&lt;/p&gt;

&lt;p&gt;For my smart contract example, I have chosen to create my own ERC20 token called SharkUSDC/sUSDC.&lt;br&gt;
I thought of creating my own stablecoin for this exercise, but decided against it for now. I think it would be a good future prospect, so definitely check out my upcoming posts!&lt;/p&gt;

&lt;p&gt;Also, since you can use any ERC20 token, you can set an actual stablecoin for loans and then transfer the coins to the contract and it will be operational.&lt;br&gt;
With this approach, the drawback in my current iteration of code is that since the supply is not in our control, anyone can repay a lot of stablecoin to get ether since a mapping is not there. This can be an upgrade soon.&lt;/p&gt;
&lt;h3&gt;
  
  
  Challenges
&lt;/h3&gt;

&lt;p&gt;There were a lot of issues to deal with on the Smart Contract side of things.&lt;/p&gt;

&lt;p&gt;First of all, there was a problem with multiplication when I was calculating the amount for borrow/repay. Multiplying two &lt;code&gt;uint256&lt;/code&gt; variables results in 10&lt;sup&gt;18&lt;/sup&gt; being multiplied twice. This cost me a lot of time to figure out. To solve it I just divided the final result once by 10&lt;sup&gt;18&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;The second issue is something I haven't been able to resolve yet. I tried verifying my contract by using &lt;a href="https://hardhat.org/plugins/nomiclabs-hardhat-etherscan#tasks"&gt;Hardhat's Verify Task&lt;/a&gt; which always works. It worked for my ERC20 token but didn't work for my LoanShark contract.&lt;br&gt;
LoanShark takes three things in its constructor:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stablecoin address&lt;/li&gt;
&lt;li&gt;Ratio&lt;/li&gt;
&lt;li&gt;Fee
Address is passed as a string, and fee is passed as 0. All good, they all work. But then ratio cannot be zero. And to pass it as "1" for One-to-One ETH-Stablecoin mapping, I have to multiply it with 10&lt;sup&gt;18&lt;/sup&gt; so that it is stored correctly. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This didn't work on the command line. Can't pass this large of a value. &lt;/p&gt;

&lt;p&gt;Then I came across &lt;a href="https://hardhat.org/plugins/nomiclabs-hardhat-etherscan#complex-arguments"&gt;a hardhat article&lt;/a&gt; that describes how we can pass complex arguments for verification.&lt;br&gt;
We can pass arguments by exporting it from an &lt;code&gt;arguments.js&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;An Example is my own &lt;code&gt;arguments.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;parseEther&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ethers/lib/utils&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0x1AfE5e07f6c6f092494DA8423708c412939B6906&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;parseEther&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unfortunately, for whatever reason, this was passed to Etherscan but did not get verified. 😞&lt;/p&gt;

&lt;p&gt;I'll update if this issue is resolved, but this is heartbreaking. I need to see the green tick of my verified contract on etherscan. ✅&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: It got verified! The fix was to convert the BigNumber returned from &lt;code&gt;parseEther&lt;/code&gt; to a string with the &lt;code&gt;toString&lt;/code&gt; method of BigNumber. Passing the value as a string myself didn't work, but this did.&lt;br&gt;
You can access the verified contract at: &lt;a href="https://goerli.etherscan.io/address/0x2162Ba3A993BC8442CEE02340693D1818bbB6826"&gt;https://goerli.etherscan.io/address/0x2162Ba3A993BC8442CEE02340693D1818bbB6826&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;p&gt;Check out the site at &lt;a href="http://loanshark2.surge.sh"&gt;http://loanshark2.surge.sh&lt;/a&gt;.&lt;br&gt;
Devfolio project: &lt;a href="https://devfolio.co/projects/loanshark-cd70"&gt;https://devfolio.co/projects/loanshark-cd70&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Uniswapper
&lt;/h2&gt;

&lt;p&gt;In my post about Week 2, I mentioned that I had been working on &lt;strong&gt;Uniswapper&lt;/strong&gt;, my contract that handles swapping by using Uniswap's contracts. I fiddled with it a bit more in the Add Liquidity part and got it to work perfectly as I wanted:&lt;br&gt;
Deposit just ETH and it will split evenly and add liquidity.&lt;/p&gt;

&lt;p&gt;A problem before which I didn't think would happen is leftover tokens. I read and understood that in some uniswap functions if you provided say more ETH than necessary for the transaction, it will refund that ETH back to the user. But here the user is the Smart Contract and not the actual user, so we need to refund both the ETH and the Tokens in case this happens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chainlink
&lt;/h2&gt;

&lt;p&gt;In the DeFi world, everything runs around the price of assets. Oracles (plural, not the company) are used to get price data on-chain or off-chain. &lt;br&gt;
A widely-used protocol is the Oracle Chainlink which brings off-chain data to the blockchain. So you can actually compare prices with real-world values like fiat currencies USD/EUR and actual listed stocks.&lt;/p&gt;

&lt;p&gt;You can use Oracle's &lt;code&gt;latestAnswer&lt;/code&gt; variable in their &lt;code&gt;PriceConsumerV3&lt;/code&gt; contracts by calling it from the frontend or from your Solidity Smart Contracts.&lt;br&gt;&lt;br&gt;
There have a great tutorial &lt;a href="https://docs.chain.link/docs/get-the-latest-price/"&gt;here&lt;/a&gt; if you want a quickstart.&lt;/p&gt;

&lt;p&gt;My implementation is here: &lt;a href="https://github.com/neelansh15/Chainlink-Price-Consumer"&gt;https://github.com/neelansh15/Chainlink-Price-Consumer&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Research Topic
&lt;/h2&gt;

&lt;p&gt;We had to research on an assigned web3 project. My assigned project is &lt;a href="https://polymarket.com/"&gt;Polymarket&lt;/a&gt;, a decentralized betting and information platform. I might create a separate post for that, so stay tuned!&lt;/p&gt;

&lt;p&gt;gn&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Deadman's Switch, Uniswapper - Polygon Week 2</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Mon, 27 Jun 2022 15:13:57 +0000</pubDate>
      <link>https://forem.com/neelansh15/deadmans-switch-uniswapper-polygon-week-2-b5m</link>
      <guid>https://forem.com/neelansh15/deadmans-switch-uniswapper-polygon-week-2-b5m</guid>
      <description>&lt;p&gt;gm&lt;/p&gt;

&lt;p&gt;Part of my journey at the &lt;a href="https://polygon.technology/polygon-fellowship/"&gt;Polygon Fellowship 2022&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Blockchain is an interesting piece of technology. The theme for this week was &lt;strong&gt;Smart Contracts&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Smart Contracts are the backbone of the Ethereum ecosystem. All the business logic of your application is written in Smart Contracts cannot be modified after being deployed. (&lt;a href="https://docs.openzeppelin.com/contracts/4.x/api/proxy"&gt;Proxies&lt;/a&gt; are a small exception).&lt;/p&gt;

&lt;p&gt;Let's explore what I built.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Deadman's Switch
&lt;/h2&gt;

&lt;p&gt;The name is very badass 😂. Reminds me of the movie Pirates of the Caribbean: Dead men tell no tales. 🏴‍☠️. &lt;/p&gt;

&lt;p&gt;What happens if a smart contract is holding funds, but the owner of the fund dies or is unable to access their wallet for whatever reason?&lt;br&gt;&lt;br&gt;
A deadman's switch requires that the owner calls the &lt;code&gt;still_alive&lt;/code&gt; function periodically at a set interval, say every 10 blocks.&lt;br&gt;&lt;br&gt;
If the owner hasn't called &lt;code&gt;still_alive&lt;/code&gt; when they should have, then the &lt;code&gt;rescueFunds&lt;/code&gt; function can be called that will transfer all the funds in the contract (like Ether) to a preset &lt;code&gt;emergency address&lt;/code&gt;.&lt;br&gt;
This ensures that funds are not forever locked in the contract.&lt;/p&gt;

&lt;p&gt;You can check out my implementation of the Deadman's Switch at my Github repository: &lt;a href="https://github.com/neelansh15/Deadmans-Switch"&gt;https://github.com/neelansh15/Deadmans-Switch&lt;/a&gt;.&lt;br&gt;
It is deployed on Goerli at &lt;a href="https://goerli.etherscan.io/address/0x8C51Aec2eAf32852DeD8D89a75Ffd499ed7E7547"&gt;https://goerli.etherscan.io/address/0x8C51Aec2eAf32852DeD8D89a75Ffd499ed7E7547&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Uniswapper
&lt;/h2&gt;

&lt;p&gt;I wanted to learn more about the DeFi ecosystem, and what better way to start than with Uniswap! The pioneer in this space.&lt;br&gt;
I took ETH &amp;amp; USDC as a good starting pair and was able to do a couple of things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get ETH-USDC pair data using UniswapV2Factory and UniswapV2Pair&lt;/li&gt;
&lt;li&gt;Swap ETH for USDC using UniswapV2Router&lt;/li&gt;
&lt;li&gt;Add Liquidity to ETH-USDC, with a twist. Instead of providing both the tokens, you just have to send ETH and the contract will calculate the required USDC amount from the reserves data, swap ETH for the required USDC and then add liquidity to the Uniswap V2 Pool of ETH-USDC.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;More Uniswap functionality can be added and I will redeploy as that happens. &lt;br&gt;
Check out the code that makes it possible: &lt;a href="https://github.com/neelansh15/Uniswapper"&gt;https://github.com/neelansh15/Uniswapper&lt;/a&gt;&lt;br&gt;
Deployed at: &lt;a href="https://goerli.etherscan.io/address/0xF5ca8778edab3C08897791A37c03AE0ccE525115"&gt;https://goerli.etherscan.io/address/0xF5ca8778edab3C08897791A37c03AE0ccE525115&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bridging Tokens
&lt;/h2&gt;

&lt;p&gt;You can actually bridge your ERC20 tokens from Goerli to Polygon Testnet or from Polygon Mainnet to Ethereum by using the &lt;a href="https://mapper.polygon.technology"&gt;Polygon PoS bridge&lt;/a&gt;!&lt;br&gt;
What it allows you to do is submit your ERC20 token on say Goerli, and it will map it to the Polygon Testnet so that your tokens can be bridged between the two chains!&lt;br&gt;&lt;br&gt;
I created an ERC20 token called HILL and I am waiting for the approval from Polygon. According to their site, it usually takes 3 days to a week to approve it. &lt;br&gt;
Hopefully mine is done soon!&lt;/p&gt;

&lt;p&gt;I also learnt about DeFi in a session hosted by the Devfolio and Polygon teams. In fact, that is what the contents of next week is going to be! Very excited to learn more about the DeFi ecosystem and build on top of it.  &lt;/p&gt;

&lt;p&gt;gn&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>ethereum</category>
      <category>web3</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How is building in web3 different from building in web2?</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Mon, 27 Jun 2022 14:24:06 +0000</pubDate>
      <link>https://forem.com/neelansh15/how-is-building-in-web3-different-from-building-in-web2-359n</link>
      <guid>https://forem.com/neelansh15/how-is-building-in-web3-different-from-building-in-web2-359n</guid>
      <description>&lt;p&gt;Part of my learning process at the &lt;a href="https://polygon.technology/polygon-fellowship/"&gt;Polygon Fellowship 2022&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most of you are familiar with apps being built with a frontend and backend, using the countless languages and frameworks out there.&lt;br&gt;&lt;br&gt;
What is up with web3? What exactly is the &lt;strong&gt;technological&lt;/strong&gt; difference in web2 and web3? Let's explore that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Paradigm of web2 vs web3
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Frontend
&lt;/h3&gt;

&lt;p&gt;web3 doesn't reinvent the internet. In fact, it supplements it. You still need a website, UI design and other frontend principles in order to use Decentralized Applications (Dapps).&lt;/p&gt;

&lt;p&gt;The difference is in the new concept of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Wallet Connection (Ex: &lt;a href="https://metamask.io/"&gt;MetaMask&lt;/a&gt;, &lt;a href="https://walletconnect.com/"&gt;WalletConnect&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Smart Contract Interaction (Ex: &lt;a href="https://docs.ethers.io/v5/"&gt;EthersJS&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Handling wallet and transaction states&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You may have also noticed a trend in many dApps, especially Decentralized Finance (DeFi) apps, they have:&lt;br&gt;
1) Central Card Layout&lt;br&gt;
2) Gradient cards, backgrounds&lt;/p&gt;

&lt;p&gt;It is hard to trace back exactly who started this, but &lt;a href="https://app.uniswap.org"&gt;Uniswap&lt;/a&gt; is the pioneer that may have popularized this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Backend
&lt;/h3&gt;

&lt;p&gt;Think of the backend components in web2. API routes, databases, server-side processing, etc. They are what you start working on when you create, say, a social media app, an e-commerce site, etc.&lt;br&gt;&lt;br&gt;
Now in web3, you have the blockchain technology as your backend. Your data will directly or indirectly come from smart contracts instead of APIs and Databases.&lt;br&gt;&lt;br&gt;
The Smart Contracts handle all the business logic and some amount of storage. For large storage, &lt;a href="https://ipfs.io/"&gt;IPFS&lt;/a&gt; can be used.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does blockchain tech replace the backend?&lt;/strong&gt;&lt;br&gt;
Absolutely...Not 👀&lt;br&gt;
As I said, web3 is an addition, supplementary and will not replace existing tech.&lt;br&gt;&lt;br&gt;
In major blockchain applications, getting data from smart contracts can cost time and sometimes fail if the RPC is unresponsive. You would still want a database and API to query data collected from smart contracts from, say, events.&lt;br&gt;&lt;br&gt;
Examples: &lt;a href="https://thegraph.com/"&gt;The Graph&lt;/a&gt;, &lt;a href="https://moralis.io/"&gt;Moralis&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;The database doesn't have to be centralized, there are decentralized solutions available too. &lt;/p&gt;

&lt;p&gt;Going forward, you can learn solidity from the official docs or check out free courses from &lt;a href="https://buildspace.so/"&gt;Buildspace&lt;/a&gt; and &lt;a href="https://cryptozombies.io/"&gt;CryptoZombies&lt;/a&gt;.&lt;/p&gt;

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

&lt;p&gt;There are conceptual differences in building blockchain applications, but it cannot exist without the existing infrastructure of web2. It is an interesting piece of technology which I think is unlocking new ways we look at governance, money and decentralization.&lt;/p&gt;

&lt;p&gt;Follow me to get updated on my blockchain journey as part of the Polygon Fellowship 2022 :)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>blockchain</category>
      <category>polygon</category>
    </item>
    <item>
      <title>What I learnt from my first week of Polygon Fellowship</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Sat, 18 Jun 2022 18:10:49 +0000</pubDate>
      <link>https://forem.com/neelansh15/what-i-learnt-from-my-first-week-of-polygon-fellowship-382l</link>
      <guid>https://forem.com/neelansh15/what-i-learnt-from-my-first-week-of-polygon-fellowship-382l</guid>
      <description>&lt;p&gt;It is interesting what all can happen in such a short time. In half a month, I have completely switched tracks over to the world of web3.&lt;br&gt;
Started as a freelance frontend developer for a blockchain company a year ago, picked up some solidity and made a few interesting projects.&lt;/p&gt;

&lt;p&gt;On 28th and 29th May, I attended the &lt;a href="http://warpspeed.devfolio.co/"&gt;Warpspeed&lt;/a&gt; hackathon, met some really cool people and &lt;a href="https://devfolio.co/projects/crossfire-477e"&gt;won a prize&lt;/a&gt; while I was at it.  &lt;/p&gt;

&lt;p&gt;After that, I applied for the fellowship and in a few days I get to know that I am accepted!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I didn't choose web3, web3 chose me&lt;br&gt;
&lt;em&gt;Me, probably&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The first week is the learning phase where we start with the very basic concepts of blockchain development. &lt;br&gt;
I'm here to share with you what I learnt from some of the workshops held by mentors from Polygon, what I learned from the assignments and beyond.&lt;/p&gt;

&lt;p&gt;Let's start.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Block Explorers&lt;/strong&gt; 🧭&lt;br&gt;
Every blockchain has its own block explorer which helps with tracking and providing information about transactions.&lt;br&gt;&lt;br&gt;
For example, look at this transaction on polygonscan, a block explorer for Polygon: &lt;a href="https://polygonscan.com/tx/0xa464f99be231de2637fe4d9d66d8c06ec4805c099fcb0d0f4e37b5960d861da2"&gt;https://polygonscan.com/tx/0xa464f99be231de2637fe4d9d66d8c06ec4805c099fcb0d0f4e37b5960d861da2&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mP2ljIbY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kh5ni8bn21j0yp4zp2go.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mP2ljIbY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kh5ni8bn21j0yp4zp2go.png" alt="Transaction on Polygon for Adding Liquidity on Quickswap" width="880" height="539"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, I am adding USDT and USDC to a liquidity pool on Quickswap (I'll talk about Quickswap in a while), and I can see the &lt;strong&gt;transaction hash&lt;/strong&gt;, &lt;strong&gt;gas fees&lt;/strong&gt;, &lt;strong&gt;tokens transferred&lt;/strong&gt;, &lt;strong&gt;token action&lt;/strong&gt; and much more!&lt;br&gt;&lt;br&gt;
Polygonscan is useful for understanding what a transaction did on the blockchain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decentralized Exchanges (DEXs)&lt;/strong&gt; 💸&lt;br&gt;
A DEX is similar to a centralized exchange like Binance or Coinbase. It facilitates the management of assets on the blockchain.&lt;br&gt;&lt;br&gt;
A common theme you will see across some of the DEXes like &lt;a href="https://app.uniswap.org/"&gt;Uniswap&lt;/a&gt;, &lt;a href="https://quickswap.exchange/#/swap"&gt;Quickswap&lt;/a&gt; or &lt;a href="https://exchange.dfyn.network/#/swap"&gt;Dfyn&lt;/a&gt; is that the Swap page is always the first.  &lt;/p&gt;

&lt;p&gt;Swapping allows you to exchange an existing ERC20 token for another one. For example, you can swap your MATIC for USDT, WBTC, etc.&lt;br&gt;
The conversion rate is determined by the DEX and varies from one DEX to another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Liquidity Pools&lt;/strong&gt; 🐳&lt;br&gt;
For swapping to take place, there has to be a pool where both of these assets are present in sufficient amounts. If you're swapping USDT for USDC, there should be a USDT-USDC pool on the DEX you're using that can take your USDT and give you USDC.  &lt;/p&gt;

&lt;p&gt;But where does the liquidity in the pool come from?  &lt;/p&gt;

&lt;p&gt;The answer is that users provide the liquidity. When you swap, a small fee is deducted which goes towards paying the people who provided liquidity in the pool.&lt;br&gt;
You can become a &lt;strong&gt;liquidity provider&lt;/strong&gt; too and earn just by supplying your idle tokens to a pool!&lt;/p&gt;

&lt;p&gt;How much fees a user gets for providing liquidity depends on their share in the pool. Go back to the transaction I shared above in the block explorer section, you will see that I get &lt;strong&gt;UNI-V2&lt;/strong&gt; tokens in return for my deposited USDT &amp;amp; USDC. These are called &lt;strong&gt;Liquidity Pool Tokens&lt;/strong&gt; or LP tokens or LPTs. They represent the shares you have in the pool.  &lt;/p&gt;

&lt;p&gt;Example of a pool I provided liquidity to on &lt;a href="https://quickswap.exchange/#/pool"&gt;Quickswap&lt;/a&gt;:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--egvmoLQS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5mjv28fwixrhptam8808.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--egvmoLQS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5mjv28fwixrhptam8808.png" alt="Quickswap Manage USDC-USDT liquidity pool" width="880" height="761"&gt;&lt;/a&gt; &lt;br&gt;
You can see that Quickswap charges &lt;code&gt;0.25%&lt;/code&gt; fees on swaps and passes it onto the liquidity providers. This may vary depending on different DEXes.&lt;/p&gt;

&lt;p&gt;After you have your LP tokens, you can invest in various instruments like farms or staking to further increase your returns. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Writing a Smart Contract&lt;/strong&gt; 📄&lt;br&gt;
The task was to write a simple hello world contract, taken from the tutorial by the Ethereum foundation, and deploy it on the Goerli Testnet.&lt;br&gt;
I have used hardhat and solidity before, so this was a breeze. The smart contract would store a string message and be able to update the message.  &lt;/p&gt;

&lt;p&gt;I would recommend following the official tutorial by the Ethereum Foundation if this is new to you: &lt;a href="https://ethereum.org/en/developers/tutorials/hello-world-smart-contract/"&gt;https://ethereum.org/en/developers/tutorials/hello-world-smart-contract/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Minting an NFT&lt;/strong&gt; 🦄&lt;br&gt;
I have written a separate article on minting NFTs on Opensea: &lt;a href="https://dev.to/neelansh15/how-to-mint-an-nft-on-opensea-in-5-minutes-36c3"&gt;https://dev.to/neelansh15/how-to-mint-an-nft-on-opensea-in-5-minutes-36c3&lt;/a&gt;  &lt;/p&gt;




&lt;p&gt;This wraps up the assignments part. There were sessions held by mentors from Polygon who shared valuable insights, some of which I'll share in brief.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quadratic Funding&lt;/strong&gt; 📈&lt;br&gt;
This is related to raising funds. Suppose you're raising funds and a company is matching the donations made by the public.&lt;/p&gt;

&lt;p&gt;The grants by company is calculated according to a given formula. The practical impact of this is that more preference is given to a project which raises say $1000 from 100 people than a project that raises $1000 from 20 people.&lt;br&gt;
This is great because more number of people want the first project to succeed and naturally it should be given a higher grant.&lt;/p&gt;

&lt;p&gt;Great article for reference and implementation example: &lt;a href="https://devfolio.co/blog/experiments-with-inout7/"&gt;https://devfolio.co/blog/experiments-with-inout7/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Americana.af&lt;/strong&gt;&lt;br&gt;
Link: &lt;a href="https://americana.af/"&gt;https://americana.af/&lt;/a&gt;&lt;br&gt;
This is a project that aims to turn real-world items into NFTs. These real-world items can then be bought and sold as NFTs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dynamic NFTs&lt;/strong&gt;&lt;br&gt;
NFTs (Non fungible tokens) have traits like Color, Background, Health, etc. In a normal world, static NFTs are just fine. But there are many cases where a dynamic nft is needed.  &lt;/p&gt;

&lt;p&gt;The best example is web3 games. Say your character is an NFT which has health, power, age, etc. These traits will change as you progress in the game and thus need to be dynamic.&lt;/p&gt;

&lt;p&gt;This also brings me to the next topic: Upgradable Smart Contracts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Upgradable Smart Contracts&lt;/strong&gt;&lt;br&gt;
I had an idea about this once that what if we redirect a smart contract to a new one in order to update the code like we can do in web2.&lt;br&gt;
Turns out, the concept of upgradable smart contracts by using Proxies exists! I haven't implemented it but I found the openzepplin docs to be of great help: &lt;a href="https://docs.openzeppelin.com/learn/upgrading-smart-contracts"&gt;https://docs.openzeppelin.com/learn/upgrading-smart-contracts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DAOs (Decentralized Autonomous Organizations)&lt;/strong&gt;&lt;br&gt;
DAOs are the standard for governance on the blockchain. Every DAO has a fixed set of rules that govern the decision-making of the organization, including how the voting takes place.&lt;/p&gt;

&lt;p&gt;In a DAO, people who hold the tokens of that DAO are assigned some voting power. It can be in a static 1:1 ratio (1 token = 1 vote) or it can be derived from a formula or it can be mapped according to how long the user has been holding the token.&lt;/p&gt;

&lt;p&gt;Proposals are created in these DAOs which decide the direction that it should take, according to its community members.&lt;/p&gt;

&lt;p&gt;Once a proposal has been voted upon, the results are automatically calculated and the verdict is produced.&lt;/p&gt;

&lt;p&gt;Example DAO: &lt;a href="https://uniswap.org/governance"&gt;https://uniswap.org/governance&lt;/a&gt;&lt;br&gt;
You can create DAOs for Non-profits here :) =&amp;gt; &lt;a href="http://lowpoly.surge.sh/"&gt;http://lowpoly.surge.sh/&lt;/a&gt;&lt;br&gt;
It is a project I made in college with my teammates.&lt;/p&gt;




&lt;p&gt;I think I've covered the major topics that I recall. There are other smaller topics worth checking out like Infura/Alchemy and RPC endpoints, zkrollup, How Polygon works (layer, settlement, etc.), IPFS, Filecoin, etc.&lt;/p&gt;

&lt;p&gt;This week has been phenomenal. I've learned quite a few things, interacted with mentors from Polygon and interacted with fellow members of the fellowship.&lt;/p&gt;

&lt;p&gt;Looking forward to learning more and reporting next week. ✨&lt;/p&gt;

&lt;p&gt;The journey has just begun! 🚀&lt;/p&gt;

</description>
      <category>ethereum</category>
      <category>polygon</category>
      <category>web3</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>How to Create an NFT on OpenSea in 5 minutes</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Thu, 16 Jun 2022 09:11:59 +0000</pubDate>
      <link>https://forem.com/neelansh15/how-to-mint-an-nft-on-opensea-in-5-minutes-36c3</link>
      <guid>https://forem.com/neelansh15/how-to-mint-an-nft-on-opensea-in-5-minutes-36c3</guid>
      <description>&lt;p&gt;gm&lt;/p&gt;

&lt;p&gt;So, you have an image and you want to convert it into an NFT, maybe to explore what it is all about or to sell it for profit.&lt;/p&gt;

&lt;p&gt;I'm Neelansh, currently a part of the Polygon Fellowship program of 2022. I am documenting what I am learning and sharing it with the community 💜.&lt;/p&gt;

&lt;p&gt;Let's start.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;You need to have MetaMask or a similar ethereum wallet first. You can get one as a chrome / firefox extension here: &lt;a href="https://metamask.io/"&gt;https://metamask.io/&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
It is also available as a mobile app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect Wallet to Opensea
&lt;/h3&gt;

&lt;p&gt;Go to &lt;a href="https://opensea.io/"&gt;https://opensea.io/&lt;/a&gt; and connect your MetaMask wallet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Collection on Opensea
&lt;/h3&gt;

&lt;p&gt;Before minting an NFT, you need to create a collection in which the NFT will reside.&lt;/p&gt;

&lt;p&gt;Go to &lt;a href="https://opensea.io/collections"&gt;https://opensea.io/collections&lt;/a&gt; and click create collection.&lt;br&gt;&lt;br&gt;
You only need to set three things:&lt;br&gt;&lt;br&gt;
Logo image, Name and the Blockchain.&lt;/p&gt;

&lt;p&gt;Set the logo image to anything, you can use your NFT image here as well.&lt;br&gt;
Change the blockchain to &lt;strong&gt;Polygon&lt;/strong&gt; as it is &lt;em&gt;way&lt;/em&gt; cheaper than Ethereum to Mint and move assets around.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--263L6Wqg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6wavvtlavy8mr8ks3w0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--263L6Wqg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6wavvtlavy8mr8ks3w0.png" alt="Opensea Create Collection Page" width="880" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;It is optional, but you might want to look at the &lt;strong&gt;Creator Earnings&lt;/strong&gt; too and add a percentage and your wallet address (which you can get from MetaMask) to collect Royalty fees whenever someone resells your NFT.  &lt;/p&gt;

&lt;p&gt;It is also a good idea to add more token payment options, like &lt;strong&gt;USDC on Polygon&lt;/strong&gt; which many people use and will make it easier to buy your NFT.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iY2o9YGj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6jp8mvgkbzz2oesdink.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iY2o9YGj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6jp8mvgkbzz2oesdink.png" alt="Opensea Collection Info Blockchain, Creator Fees and Payment Tokens" width="880" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once this is filled, click Create and your first collection is made! 🎉&lt;/p&gt;

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

&lt;p&gt;But it looks quite empty right now. Let's fix that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating an NFT on Opensea
&lt;/h3&gt;

&lt;p&gt;Click create in the Navbar.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qzpPrS6M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rpsn5g49895osfknl73u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qzpPrS6M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rpsn5g49895osfknl73u.png" alt="Opensea Navbar Create ListItem" width="880" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upload your image, give it a nice name and change the blockchain to &lt;strong&gt;Polygon&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
You can leave all the other details out if you don't intend to use them. We just want a basic NFT.&lt;/p&gt;

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

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

&lt;p&gt;Click create, complete the captcha and you're done!&lt;br&gt;&lt;br&gt;
You have just minted your very own NFT on the Polygon Blockchain 🥳&lt;/p&gt;

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

&lt;p&gt;My NFT looks like a Cadbury Chocolate Wrapper XD.&lt;/p&gt;

&lt;p&gt;There are a lot of customizations and features you can add to your future NFTs. Read up more about Traits and different types of NFTs.&lt;/p&gt;

&lt;p&gt;You can put your current NFT up for selling right away as well.&lt;/p&gt;

&lt;p&gt;Thank you for reading, let me know if you have any questions and I'd be happy to answer them!&lt;br&gt;
Right now I do feel like eating chocolate, so brb :)&lt;/p&gt;

&lt;p&gt;gn&lt;/p&gt;

</description>
      <category>opensea</category>
      <category>nft</category>
      <category>blockchain</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>How to Create your own Token on the Ethereum Blockchain</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Thu, 23 Sep 2021 16:20:18 +0000</pubDate>
      <link>https://forem.com/neelansh15/how-to-create-your-own-token-on-the-ethereum-blockchain-44il</link>
      <guid>https://forem.com/neelansh15/how-to-create-your-own-token-on-the-ethereum-blockchain-44il</guid>
      <description>&lt;p&gt;Learn the basics of Solidity and HardHat while creating &lt;strong&gt;your very own&lt;/strong&gt; transferrable token on the Ethereum Blockchain!&lt;/p&gt;

&lt;p&gt;In this article, you will learn how to use  &lt;a href="https://hardhat.org" rel="noopener noreferrer"&gt;HardHat&lt;/a&gt;  and write a simple  &lt;a href="https://soliditylang.org" rel="noopener noreferrer"&gt;Solidity&lt;/a&gt; contract to deploy your custom Token.&lt;/p&gt;

&lt;p&gt;Before we start, let's look at the basic terms.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Smart Contract&lt;/strong&gt;: A program on the blockchain&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Solidity&lt;/strong&gt;: The language to write smart contracts with. If you know JavaScript or similar languages, you'll be very comfortable writing Solidity&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Environment for writing Smart Contracts
&lt;/h3&gt;

&lt;p&gt;There are just three basic steps for creating any smart contract:&lt;br&gt;
&lt;strong&gt;Write, Compile&lt;/strong&gt; and &lt;strong&gt;Deploy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We have multiple options to choose from for the environment. The most popular ones are  &lt;a href="https://www.trufflesuite.com" rel="noopener noreferrer"&gt;Truffle&lt;/a&gt;  and  &lt;a href="https://hardhat.org" rel="noopener noreferrer"&gt;HardHat&lt;/a&gt;. They both help with writing, compiling, and deploying our smart contracts to the blockchain.  &lt;/p&gt;

&lt;p&gt;We shall be using &lt;strong&gt;HardHat&lt;/strong&gt; since it is very easy to get started with. Their docs are very concise, so I would recommend giving it a read.&lt;/p&gt;
&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://nodejs.org" rel="noopener noreferrer"&gt;NodeJS&lt;/a&gt; + npm installed. I am using &lt;code&gt;v14.17.6&lt;/code&gt; LTS.&lt;/p&gt;
&lt;h3&gt;
  
  
  Steps
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Initialize npm project&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Create a new directory and run &lt;code&gt;npm init -y&lt;/code&gt; to initialize a new npm project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install HardHat&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save-dev hardhat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Install hardhat as a dev dependency. Now we can access the hardhat command-line tools with &lt;code&gt;npx hardhat [command]&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create empty configuration file&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Run &lt;code&gt;npx hardhat&lt;/code&gt; and select the option to &lt;em&gt;Create an empty hardhat.config.js file&lt;/em&gt;.&lt;br&gt;
The reason for starting with an empty config is that the Hardhat flow is really simple and starting with a boilerplate might leave out valuable insights.&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632333589429%2FqIQ0kTAnE.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632333589429%2FqIQ0kTAnE.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install required dependencies&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
To install the other dependencies, run&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This command can be found on  &lt;a href="https://hardhat.org/getting-started/" rel="noopener noreferrer"&gt;HardHat's official docs&lt;/a&gt;  also.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Writing the smart contract&lt;/strong&gt;
Create a directory called &lt;em&gt;contracts&lt;/em&gt;, and inside it create a file called &lt;em&gt;Token.sol&lt;/em&gt;. Your structure would be &lt;code&gt;/contracts/Token.sol&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;HardHat knows to look inside the &lt;code&gt;/contracts&lt;/code&gt; directory for your smart contracts. &lt;code&gt;.sol&lt;/code&gt; is the file extension for the Solidity programming language.  &lt;/p&gt;

&lt;p&gt;Open &lt;code&gt;Token.sol&lt;/code&gt; in your code editor. If you're using VS Code you will need the &lt;strong&gt;solidity&lt;/strong&gt; extension by &lt;em&gt;Juan Blanco&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Before writing the code (which is short and sweet btw), let's go over the concept of the Token you are about to create:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each token has a &lt;strong&gt;name&lt;/strong&gt;, &lt;strong&gt;symbol&lt;/strong&gt;, &lt;strong&gt;total supply&lt;/strong&gt; and &lt;strong&gt;owner&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;owner&lt;/strong&gt; is the account that will initially be used to deploy the contract. This will be your personal  &lt;a href="https://metamask.io" rel="noopener noreferrer"&gt;MetaMask&lt;/a&gt; (Recommended) or other crypto wallets.
It will hold all of the fixed supply of tokens which can then be distributed to others.&lt;/li&gt;
&lt;li&gt;We will need Key-Value pair mappings to store token balances for each address.&lt;/li&gt;
&lt;li&gt;We will need two basic functions, one to allow transfers between accounts and one to check the balance of an individual account.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keeping all of these things in mind, let's start by writing the contract itself.  &lt;/p&gt;
&lt;h3&gt;
  
  
  Writing the Token Code
&lt;/h3&gt;

&lt;p&gt;The first line of every solidity file will specify the version of solidity to use for the compiler.&lt;br&gt;&lt;br&gt;
My compiler uses &lt;code&gt;0.8.7&lt;/code&gt; at the time of this writing, and I'm updating the same in the hardhat config since that has a previous version written by default instead of my compiler's latest version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Token.sol
pragma solidity ^0.8.7;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Contract and variables
&lt;/h4&gt;

&lt;p&gt;Next, keeping the conceptual points in mind, we will declare a contract that looks like a JS/TS class declaration and define the variables inside it. Notice how the code is very similar to JavaScript or TypeScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pragma solidity ^0.8.7;

contract Token{
    string public name = "Neelansh Manifesto Token";
    string public symbol = "NMT";
    address public owner;
    uint public totalSupply = 1000000;
    mapping(address =&amp;gt; uint) balances;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can define your own name and symbol for the token. Don't use special characters like a quotation mark.&lt;br&gt;&lt;br&gt;
The total supply is being defined as 1 million, or 1,000,000.&lt;br&gt;&lt;br&gt;
&lt;em&gt;string&lt;/em&gt; and &lt;em&gt;uint&lt;/em&gt; data types are self-explanatory. The address data type stores the hexadecimal address of a crypto wallet.  &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;mapping&lt;/strong&gt; type is also very simple. It is like an object in JavaScript and maps addresses to their corresponding integer token balances.&lt;br&gt;
It's javascript equivalent would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;balances&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Address (assume integer) mapped to token balance&lt;/span&gt;
    &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5000&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Constructor
&lt;/h4&gt;

&lt;p&gt;Every contract once deployed on the blockchain lives in there forever.&lt;br&gt;&lt;br&gt;
So the contract is initialized only once, and that is when the constructor is called. All we need the constructor to do is set the owner of the contract and assign the total supply of coins to the owner.  &lt;/p&gt;

&lt;p&gt;Since you will be deploying using your personal MetaMask account, your account will be the owner and hold all the tokens.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;constructor(){
        owner = msg.sender;
        balances[msg.sender] = totalSupply;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;msg.sender&lt;/code&gt; is the address of the contract or wallet that is executing the transaction and is automatically injected in every contract.&lt;/p&gt;

&lt;h4&gt;
  
  
  Functions
&lt;/h4&gt;

&lt;p&gt;We need to write functions to transfer tokens between accounts and get the balance of an individual account. The functions are again similar to JS/TS except for some differences which are out of scope for this article.  &lt;/p&gt;

&lt;p&gt;The complete code will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pragma solidity ^0.8.7;

contract Token{
    string public name = "Neelansh Manifesto Token";
    string public symbol = "NMT";
    address public owner;
    uint public totalSupply = 1000000;
    mapping(address =&amp;gt; uint) balances;

    constructor(){
        owner = msg.sender;
        balances[msg.sender] = totalSupply;
    }

    function transfer(address to, uint amount) external {
        require(balances[msg.sender] &amp;gt;= amount, 'Not enough tokens');
        // Deduct from sender, Add to receiver 
        balances[msg.sender] -= amount;
        balances[to] += amount;
    }

    function balanceOf(address account) external view returns (uint) {
        return balances[account];
    }

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Compiling Contract
&lt;/h3&gt;

&lt;p&gt;Once you've saved your contract, it's time to compile it for deployment.&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 compile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632342438602%2FXrUHgtjVb.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632342438602%2FXrUHgtjVb.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing
&lt;/h3&gt;

&lt;p&gt;It is almost always required to write JavaScript tests for your contracts, but we'll skip it otherwise this article may as well be a book 📖&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration before Deployment
&lt;/h3&gt;

&lt;p&gt;Before you deploy, you need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Private Key of your account from MetaMask.
Click on the three-dot menu and go to &lt;strong&gt;Account Details &amp;gt; Export Private Key&lt;/strong&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632342901590%2FIlZk0p--7.png" alt="Screenshot 2021-09-23 at 2.04.20 AM.png"&gt;
&lt;/li&gt;
&lt;li&gt;API URL from  &lt;a href="https://infura.io" rel="noopener noreferrer"&gt;Infura&lt;/a&gt;
Create an account on infura.io. Create a new project, go to settings, change the endpoint to &lt;strong&gt;Rinkeby&lt;/strong&gt; and copy the HTTPS endpoint URL.&lt;/li&gt;
&lt;/ol&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632343045907%2FdpLokQviz.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632343045907%2FdpLokQviz.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now in your &lt;code&gt;hardhat.config.js&lt;/code&gt; file, use the private key and API URL like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
 * @type import('hardhat/config').HardhatUserConfig
 */&lt;/span&gt;

&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@nomiclabs/hardhat-waffle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;API_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://rinkeby.infura.io/v3/74685a5d02de4ec9b17b6fee80738970&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PRIVATE_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR_PRIVATE_KEY&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;solidity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.8.7&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;
    &lt;span class="na"&gt;rinkeby&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;API_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`0x&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PRIVATE_KEY&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&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="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Be sure to replace the API URL and private key with your own.&lt;br&gt;&lt;br&gt;
We are adding &lt;code&gt;0x&lt;/code&gt; before the private key to make it a hexadecimal address. The account you used for the private key will deploy the contract and our constructor will add the token balance to it.&lt;br&gt;&lt;br&gt;
The &lt;code&gt;require&lt;/code&gt; for hardhat-waffle injects &lt;strong&gt;ethers&lt;/strong&gt; into our scripts, which is a JS library we need for our deployment script.&lt;/p&gt;

&lt;p&gt;Now we are ready to deploy! 🥳&lt;/p&gt;
&lt;h3&gt;
  
  
  Deploying the Token
&lt;/h3&gt;

&lt;p&gt;We need a short script to help us deploy our contract. Create a file called &lt;code&gt;deploy.js&lt;/code&gt; in a new folder called &lt;code&gt;scripts/&lt;/code&gt; and write the following code into it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="c1"&gt;// Not necessary, but just to see the account deploying from&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;deployer&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getSigners&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Deploying contracts with the account&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;deployer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;deployer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBalance&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Account balance&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

    &lt;span class="c1"&gt;// Main stuff&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ethers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContractFactory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Deployment address: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&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;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Final
&lt;/h4&gt;

&lt;p&gt;To &lt;strong&gt;finally&lt;/strong&gt; deploy your token, run&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/deploy.js --network rinkeby
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632343924364%2FmOdq1CqTN.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632343924364%2FmOdq1CqTN.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our token has been deployed! But hold on, we still need to see it in MetaMask. Copy the deployment address and &lt;strong&gt;store it somewhere&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding our Token to MetaMask
&lt;/h2&gt;

&lt;p&gt;Go to MetaMask and the assets tab. At the very bottom, click on &lt;strong&gt;Add Token&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
Paste in the deployment address of your token as the &lt;em&gt;Token Contract Address&lt;/em&gt;, it should automatically fetch the symbol of your token! 💯  &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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632344362394%2FJp3W6isDYP.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632344362394%2FJp3W6isDYP.png" alt="image.png"&gt;&lt;/a&gt;&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632344388570%2FHHlXKFZfs.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632344388570%2FHHlXKFZfs.png" alt="image.png"&gt;&lt;/a&gt;&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632344423622%2FNRO_esKMe.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1632344423622%2FNRO_esKMe.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;YAYYY! Your token is deployed &lt;strong&gt;and&lt;/strong&gt; visible in MetaMask! You can send these tokens to your friends and family and have fun with your very own token on the blockchain! 🎉🎉🎉🎉🎉&lt;/p&gt;

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

&lt;p&gt;This was a very simple token. There are standards like the ERC-20 token standard upon which most serious tokens are based upon, so that would be a good topic to learn after this.  &lt;/p&gt;

&lt;p&gt;I am no blockchain expert, but I am sharing the knowledge I gain as I go along my journey 😄&lt;/p&gt;

&lt;p&gt;If you face any errors let me know either here or on Twitter &lt;a href="https://twitter.com/mneelansh15" rel="noopener noreferrer"&gt;@mneelansh15&lt;/a&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>solidity</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>How to Make a Scrollable List in HTML &amp; CSS</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Tue, 24 Aug 2021 13:02:24 +0000</pubDate>
      <link>https://forem.com/neelansh15/how-to-make-a-scrollable-list-in-html-css-30el</link>
      <guid>https://forem.com/neelansh15/how-to-make-a-scrollable-list-in-html-css-30el</guid>
      <description>&lt;p&gt;So you are making an application and have a huge list displayed on let's say a modal or popup. You've seen it so many times, how do you make the list scrollable as you please? The answer is just two lines of CSS.&lt;/p&gt;

&lt;p&gt;The concept is to set a fixed height and set overflow to either scroll or auto.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: This article covers how to make the list scrollable, not the list itself. You can find the code for the list in the Github repository mentioned in this article.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, observe what happens when you use the below code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;height&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;300&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;overflow-y&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;auto&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YVTH0pMN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1629806770610/gb-txjMEp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YVTH0pMN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1629806770610/gb-txjMEp.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you have fewer elements than the max display capacity of the list, it'll still take up the rest of the space as it has a fixed height.&lt;/p&gt;

&lt;p&gt;So, the best way then is to use &lt;code&gt;max-height&lt;/code&gt; so that we remove any unnecessary space.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;max-height&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;300&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;overflow-y&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;auto&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L1f835FH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1629806953815/VZcXC5sqe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L1f835FH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1629806953815/VZcXC5sqe.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And with multiple elements in the list:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NB5NkIo6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1629807056929/FGUm-hECn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NB5NkIo6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1629807056929/FGUm-hECn.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There you have it! A practical example explaining this basic concept.&lt;br&gt;&lt;br&gt;
Github repository: &lt;a href="https://github.com/neelansh15/css-listview"&gt;https://github.com/neelansh15/css-listview&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Example with VueJS and ChanceJS
&lt;/h2&gt;

&lt;p&gt;If you're wondering about the code behind the card and the data, then I've sprinkled some  &lt;a href="https://v3.vuejs.org/"&gt;Vue 3&lt;/a&gt;  in it along with  &lt;a href="https://chancejs.com/"&gt;ChanceJS &lt;/a&gt; and  &lt;a href="https://picsum.photos/"&gt;Lorem Picsum&lt;/a&gt;  for random name and image generation.&lt;br&gt;&lt;br&gt;
And of course a neat amount of simple CSS :) (available in the Github repository)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card-header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Contacts&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card-content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;v-for=&lt;/span&gt;&lt;span class="s"&gt;"(contact, i) in contacts"&lt;/span&gt; &lt;span class="na"&gt;:key=&lt;/span&gt;&lt;span class="s"&gt;"contact.name"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"contact"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;:src=&lt;/span&gt;&lt;span class="s"&gt;"contact.image"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"profile-image"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"names"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;{{contact.name}}&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"status"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ contact.status }}&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/vue@next"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"http://chancejs.com/chance.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="na"&gt;contacts&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="p"&gt;},&lt;/span&gt;
            &lt;span class="nx"&gt;mounted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Chance&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contacts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
                &lt;span class="k"&gt;for&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;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contacts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
                        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;chance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
                        &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Online&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Offline&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://picsum.photos/200?random=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;i&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="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clone, run the code and experiment if you want to!&lt;br&gt;&lt;br&gt;
If you want to learn how to make this from scratch or make another component from scratch, mention it in the comments or on my twitter!&lt;/p&gt;

&lt;p&gt;This article was really simple, but if need be I can cover more complex topics, all depending on what you want to learn about, so let me know in the comments!&lt;/p&gt;

&lt;p&gt;Made with 💖 by Neelansh Mathur ( &lt;a href="https://github.com/neelansh15"&gt;Github&lt;/a&gt; )&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>css3</category>
    </item>
    <item>
      <title>Blockchain in Javascript: Transfer Ether between Accounts</title>
      <dc:creator>Neelansh Mathur</dc:creator>
      <pubDate>Mon, 07 Jun 2021 09:19:33 +0000</pubDate>
      <link>https://forem.com/neelansh15/blockchain-in-javascript-transfer-ether-between-accounts-131h</link>
      <guid>https://forem.com/neelansh15/blockchain-in-javascript-transfer-ether-between-accounts-131h</guid>
      <description>&lt;p&gt;When I started learning about the Ethereum blockchain, the biggest &lt;strong&gt;eureka!&lt;/strong&gt; moment I had was when I sent Ether between two accounts. What is fascinating is the simplicity of doing so in Javascript!&lt;br&gt;
In this article you'll learn how you can do the same in like 2 min.&lt;/p&gt;
&lt;h2&gt;
  
  
  Initial Setup
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Test Ethereum Blockchain
&lt;/h3&gt;

&lt;p&gt;Ain't nobody gonna buy actual Ether for learning this. We need a test blockchain with test accounts, preferably preloaded with ether.&lt;br&gt;&lt;br&gt;
For this, you can use either a combination of infura.io (test blockchain) + Metamask.io (test/actual accounts) or the really simple &lt;strong&gt;Ganache&lt;/strong&gt; for both test blockchain + test accounts + test ether. You can install Ganache &lt;a href="https://www.trufflesuite.com/ganache" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When you run Ganache, it will look something like this:&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623039730997%2F5_SmWhh85.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623039730997%2F5_SmWhh85.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll get multiple accounts preloaded with 100 Ether each. I've made a few transactions already on my first two accounts hence the ether difference.  &lt;/p&gt;
&lt;h3&gt;
  
  
  NodeJS
&lt;/h3&gt;

&lt;p&gt;You can do what I'm about to show you even without NodeJS by using a CDN of the library we're using: &lt;strong&gt;web3&lt;/strong&gt;. See &lt;a href="https://web3js.readthedocs.io/en/v1.3.4/getting-started.html" rel="noopener noreferrer"&gt;https://web3js.readthedocs.io/en/v1.3.4/getting-started.html&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;But NodeJS makes things a bit simpler. And you can also add &lt;strong&gt;express&lt;/strong&gt; if you want to create an API.  &lt;/p&gt;

&lt;p&gt;If you want to follow along with the same code as mine, make sure you have NodeJS installed.&lt;/p&gt;
&lt;h2&gt;
  
  
  The good stuff
&lt;/h2&gt;

&lt;p&gt;Now that you have a test blockchain running with accounts overflowing with Ether, let's get down to business.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Initialize&lt;/strong&gt; a new javascript project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn init
or
npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and create a new file &lt;code&gt;main.js&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;We'll be using a library called &lt;a href="https://web3js.readthedocs.io/en/v1.3.4/getting-started.html" rel="noopener noreferrer"&gt;web3.js&lt;/a&gt;, which is the Javascript SDK for interacting with the Ethereum Blockchain. &lt;a href="https://docs.ethers.io/v5/" rel="noopener noreferrer"&gt;Ethers&lt;/a&gt; is an alternative.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install&lt;/strong&gt; the web3.js library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add web3
or
npm &lt;span class="nb"&gt;install &lt;/span&gt;web3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember your running Ganache instance? Copy the RPC URL which should be in the top bar. It'll mostly be &lt;em&gt;&lt;a href="http://127.0.0.1:7545" rel="noopener noreferrer"&gt;http://127.0.0.1:7545&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Moving forward
&lt;/h3&gt;

&lt;p&gt;In the &lt;code&gt;main.js&lt;/code&gt; file, we'll now require the &lt;code&gt;web3&lt;/code&gt; library and initialize a new object by passing the URL we got from Ganache.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Web3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;web3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;web3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Web3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://127.0.0.1:7545&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Select any two accounts from Ganache and store their addresses in two variables &lt;code&gt;from&lt;/code&gt; (The account we'll be sending ether from) and &lt;code&gt;to&lt;/code&gt; (The account we'll be sending ether to). Mine will be different than yours.  &lt;/p&gt;

&lt;p&gt;For simplicity, also create a variable named &lt;code&gt;value&lt;/code&gt; for storing the amount of ether to transfer. Let's say we want to transfer 1 ether, then the variable will look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;web3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toWei&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ether&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice we are using &lt;code&gt;web3.utils&lt;/code&gt; to convert &lt;strong&gt;1&lt;/strong&gt; ether to &lt;strong&gt;Wei&lt;/strong&gt;. &lt;strong&gt;Wei&lt;/strong&gt; is the smallest unit of Ethereum cryptocurrency. 1 ether is 10 to the power 18 times one Wei 🤯&lt;br&gt;&lt;br&gt;
We need to convert to Wei since the function we're about to use accepts values in Wei.&lt;/p&gt;

&lt;p&gt;We're going to simply call &lt;code&gt;web3.eth.sendTransaction&lt;/code&gt; and pass it the &lt;code&gt;from&lt;/code&gt; address, &lt;code&gt;to address&lt;/code&gt; and the value, and we're good to go!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;web3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;eth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendTransaction&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;to&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="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final code will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Web3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;web3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;web3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Web3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://127.0.0.1:7545&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Use your local Ganache accounts for this&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0x6056aD120bDC5a382A1E780fC5A4C1CDDbA98dF4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0x3168B2b9DEc1F8886bDbCf99359d7185652F1164&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;// Amount to transfer. Here, 1 ether&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;web3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toWei&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ether&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nx"&gt;web3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;eth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendTransaction&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;to&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="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when you run your code with &lt;code&gt;node main.js&lt;/code&gt;, it should return a transaction hash if the transfer was successful.&lt;br&gt;&lt;br&gt;
Check Ganache, it'll reflect the change and you've successfully made a transaction on the Ethereum 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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623042879984%2FBOhWaduDw.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1623042879984%2FBOhWaduDw.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>ethereum</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
