<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhishek Alimchandani on Medium]]></title>
        <description><![CDATA[Stories by Abhishek Alimchandani on Medium]]></description>
        <link>https://medium.com/@abhishekalimchandani1624?source=rss-416318902cd0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aOVZORQRDS9AUwv8B-PQ2A.png</url>
            <title>Stories by Abhishek Alimchandani on Medium</title>
            <link>https://medium.com/@abhishekalimchandani1624?source=rss-416318902cd0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 00:54:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhishekalimchandani1624/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How To Build a dApp in Three Steps Using Foundry]]></title>
            <link>https://medium.com/@abhishekalimchandani1624/how-to-build-a-dapp-in-three-steps-using-foundry-f04928a64286?source=rss-416318902cd0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f04928a64286</guid>
            <dc:creator><![CDATA[Abhishek Alimchandani]]></dc:creator>
            <pubDate>Fri, 02 May 2025 11:27:15 GMT</pubDate>
            <atom:updated>2025-05-06T16:14:28.941Z</atom:updated>
            <content:encoded><![CDATA[<p>Decentralized applications, or dApps, are applications that don’t rely on a centralized server or backend but instead make use of Web3 technologies such as <a href="https://chain.link/education-hub/blockchain">blockchains</a> and <a href="https://chain.link/education/blockchain-oracles">oracles</a> to contain their logic and backend functions, making them tamper-proof and secure.</p><p>In this technical tutorial, you’ll learn how to create a simple end-to-end dApp that allows the user to retrieve and store the current price of Ethereum in a smart contract. The <a href="https://github.com/pappas999/chainlink-dapp-tutorial">completed demo</a> can be found on GitHub.</p><h3>Requirements</h3><p>Please ensure you have the following installed:</p><ul><li><a href="https://nodejs.org/">NodeJS</a></li><li><a href="https://metamask.io/">MetaMask</a></li></ul><h3>What Is a Decentralized Application?</h3><p>A dApp has its backend code running on a blockchain, as opposed to a traditional application where the backend code runs on centralized servers. A dApp can have frontend code and user interfaces written in any language and deployed on any server or servers to interact with the backend logic.</p><p>Due to housing their backend logic in highly secure, tamper-proof <a href="https://chain.link/education/smart-contracts">smart contracts</a>, dApps enjoy many benefits not possible with traditional Web2 systems:</p><ul><li>Zero downtime</li><li>Enhanced privacy</li><li>Censorship resistance</li><li>Trust-minimized execution of logic</li></ul><p>However, these benefits also come with some drawbacks. Maintenance of dApps is more involved, as code deployed to the blockchain isn’t modifiable by default. There is also a performance overhead due to running the logic across a distributed network as opposed to a centralized server. In addition to this, user experience can also suffer due to the dApp user needing to go through the complexity of having a Web3 wallet and funding it with enough cryptocurrency to pay for transaction fees.</p><h3>Components of a dApp</h3><p>The components of a dApp can be split into three different categories: smart contracts, the frontend logic and user interface, and data storage.</p><h3>Smart Contracts</h3><p>Smart contracts store the business logic for a dApp along with the state of the application. This is the biggest difference between a dApp and a traditional web application, and what gives a dApp all the benefits mentioned above.</p><h3>Frontend/User Interface</h3><p>While the backend logic of a dApp requires a developer to write smart contract code to be deployed on a blockchain, the frontend or client side of a dApp can use standard web technologies such as HTML and JavaScript. This allows developers to use familiar tools, libraries, and frameworks. The client-side user interface is usually linked to the smart contracts via client-side libraries such as <a href="https://web3js.readthedocs.io/en/v1.7.4/">Web3.js</a> or <a href="https://docs.ethers.io/v5/">Ethers.js</a>, which are bundled with the frontend resources and sent to the browser together with the UI. Interactions with smart contracts such as signing messages and sending transactions to the smart contracts are usually conducted via a browser-based Web3 wallet, such as <a href="https://metamask.io/">MetaMask</a>.</p><h3>Data Storage</h3><p>Most applications need to store data, but due to the distributed nature of blockchains, storing large amounts of data on-chain is not feasible, and can get very expensive. This is why many dApps that need to store data make use of off-chain data storage services such as <a href="https://ipfs.io/">IPFS</a> or <a href="https://filecoin.io/">Filecoin</a>, leaving the blockchain to store crucial business logic and state only.</p><p>You can also use traditional cloud-based storage services. However, many developers choose decentralized options to maintain and extend the trust-minimized properties that a blockchain-powered dApp provides.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*swUWszz8H2e0wPNE.png" /></figure><p>Ethereum dApp Architecture. Source: <a href="https://www.preethikasireddy.com/post/the-architecture-of-a-web-3-0-application">The Architecture of a Web3 Application</a></p><p>Now that we know the components of a dApp, let’s go through an example of building a simple end-to-end example.</p><h3>Step One: Creating the Smart Contract</h3><p>The smart contract in our dApp will be a simple example used to look up data and reflect state changes on the blockchain. In this case, we will be looking up the value of ETH/USD using the <a href="https://data.chain.link/ethereum/mainnet/crypto-usd/eth-usd">ETH/USD Chainlink Data Feed</a> and then permanently storing the result in the smart contract.</p><p>The first step is to open up our docs and head to the <a href="https://docs.chain.link/docs/get-the-latest-price/">Using Data Feeds</a> page. From there you can copy the example source code and paste it into a new file in your IDE of choice (e.g. <a href="https://code.visualstudio.com/">Visual Code</a>), or you can press the “Open In Remix” button and work from the web version of Remix.</p><p>In this example, we’ll work with Visual Studio Code and <a href="https://book.getfoundry.sh/">Foundry</a>, a fast, portable, and modular Ethereum development toolkit written in Rust.</p><p>First, we’ll create a new directory structure for our dApp, with a backend folder for the smart contract code:</p><pre>mkdir chainlink-dapp-example<br>cd chainlink-dapp-example<br>mkdir backend</pre><p>Next, we’ll open the created directory for our dApp in our VS Code editor and then install Foundry</p><p>But before we install Foundry, we need to take a quick detour — <strong>Foundry is written in Rust</strong>, so having Rust installed on your system is a <strong>prerequisite</strong>. Without Rust, the Foundry tools won’t work properly.</p><p>Next, we’ll open the created directory for our dApp in our VS Code editor and setup the project in Foundry</p><pre>forge init</pre><h3>Install Chainlink Contracts</h3><p>Run the following command to install Chainlink’s Solidity contracts:</p><pre>forge install smartcontractkit/chainlink-brownie-contracts</pre><p>This will download Chainlink contracts into the lib/ folder.</p><p>Once this is done, we need to remove the following file</p><h3>1. Delete Unnecessary Files</h3><p>In your project, <strong>remove</strong> the following files:</p><ul><li>src/Counter.sol</li><li>script/Counter.s.sol</li><li>test/Counter.t.sol</li></ul><h3>2. Create a New Smart Contract</h3><ul><li>In the <strong>src</strong> folder, <strong>create a new file</strong> named PriceConsumerV3.sol.</li></ul><h3>3. Add the Chainlink Example Code</h3><ul><li>Open the <a href="https://docs.chain.link/data-feeds">Chainlink documentation</a> and <strong>copy the example code</strong> for the <strong>Price Consumer V3</strong> contract.</li><li>Paste the code into PriceConsumerV3.sol and <strong>save</strong> the file.</li></ul><p>In the sample code, you’ll see the demo contract already has a function getLatestPrice to lookup the current price of Ethereum on the Sepolia ETH/USD Data Feed.</p><pre>function getLatestPrice() public view returns (int) {<br>        (<br>            /*uint80 roundID*/,<br>            int price,<br>            /*uint startedAt*/,<br>            /*uint timeStamp*/,<br>            /*uint80 answeredInRound*/<br>        ) = priceFeed.latestRoundData();<br>        return price;</pre><p>We need to create a new variable and a new function to store this value on the smart contract. The first step is to create a new variable under the existing priceFeed one to store the price of Ethereum:</p><pre>int public storedPrice;</pre><p>Next, we need to create a new function that can be called by the dApp frontend. The function should look up the latest price of Ethereum by calling the existing getLatestPrice function. Then it should store the value in the new storedPrice parameter:</p><pre>function storeLatestPrice() external {<br>        storedPrice = getLatestPrice();<br>    }</pre><p>Your new contract should look like this:</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.20;<br><br>import {AggregatorV3Interface} from &quot;@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol&quot;;<br><br>contract PriceConsumerV3 {<br>    AggregatorV3Interface public priceFeed;<br><br>    int public storedPrice;<br><br>    constructor(address _priceFeed){<br>        priceFeed = AggregatorV3Interface(_priceFeed);<br>    }<br><br>    function getDecimals() public view returns(uint8){<br>        return priceFeed.decimals();<br>    }<br><br>    function getLatestPrice() public view returns(int){<br>        (,int256 price,,,) = priceFeed.latestRoundData();<br>        // return price / int(10 ** uint(priceFeed.decimals()));<br>        return price;<br>    }<br><br>    function getLatestStoredPrice() external returns(int){<br>        storedPrice = getLatestPrice();<br>        return storedPrice;<br>    }<br>}</pre><h3>Step Two: Deploying the Smart Contract</h3><p>Now you’re ready to compile and deploy your contract to the Sepolia test network. Be sure to <a href="https://faucets.chain.link/">fund your MetaMask wallet</a> with some Sepolia ETH first.</p><p>If you’re using Remix, you can compile and deploy your contract using the standard Remix process. If you’re using an IDE like Visual Studio Code, we recommend using Foundry to manage your contracts.</p><p>Next, replace the contents of your foundry.toml file with the following:</p><pre>[profile.default]<br>src = &quot;src&quot;<br>out = &quot;out&quot;<br>libs = [&quot;lib&quot;]<br><br>remappings = [&quot;@chainlink=lib/chainlink-brownie-contracts&quot;]<br><br>dotenv = &quot;.env&quot;<br># See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options</pre><p>The next step is to create a .env file in your backend folder. You then need to <a href="https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key">extract your Private Key from your Web3 wallet</a>, and paste it into the value section of the PRIVATE_KEY field in the .env file. Please ensure you are using a new Web3 wallet that doesn’t have any funds on mainnet.</p><p>Once this is done, you need to obtain an RPC endpoint to gain access to the Sepolia network. You can do this by pasting in the RPC URL in the SEPOLIA_RPC_URL field in the .env file. We recommend signing up for a free <a href="https://infura.io/">Infura</a> or <a href="https://www.alchemy.com/">Alchemy</a> account to get an RPC URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2K3Qhha81tE1W8wPDEnUPA.png" /></figure><p>The next step is to create a new file in the scripts folder named DeployPriceConsumer.s.sol to ensure it will deploy your new contract. Now we are going to write the Deploy script in solidity</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.20;<br><br>import {Script} from &quot;forge-std/Script.sol&quot;;<br>import {PriceConsumerV3} from &quot;../src/PriceConsumerV3.sol&quot;;<br><br>contract DeployPriceConsumerV3 is Script{<br>    function run() external{<br>        string memory fujiRpcURL = vm.envString(&quot;FUJI_RPC_URL&quot;);<br>        uint256 privateKey = vm.envUint(&quot;PRIVATE_KEY&quot;);<br><br>        vm.createSelectFork(fujiRpcURL);<br><br>        vm.startBroadcast(privateKey);<br>        new PriceConsumerV3(0x5498BB86BC934c8D34FDA08E81D444153d0D06aD); //Fuji AVAX/USD price Feed Address<br>        vm.stopBroadcast();   <br>    }<br>}</pre><p>You’re now ready to compile and deploy your smart contract to the Sepolia network using Foundry:</p><pre>forge compile<br>forge script script/DeployPriceConsumer.s.sol --broadcast</pre><p>You should see a message similar to the one below, showing the address on Sepolia that your smart contract was deployed to. Note this address down, we will need it for the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*76hcggkL7uQ79M1Li4zOTw.png" /></figure><p>Congratulations, you’re now ready to move onto the frontend part of your dApp!</p><h3>Step Three: Creating the Frontend Application</h3><p>The frontend logic and user interface of your dApp can be built using a wide variety of different frameworks.</p><p><a href="https://reactjs.org/">React</a> is one of the most popular JavaScript libraries for building feature-rich web user interfaces, and is therefore used by a lot of Web3 dApps. In addition to this, <a href="https://docs.ethers.io/v5/">Ethers.js</a> is a JavaScript library for connecting to and interacting with EVM-based blockchains and smart contracts. When you combine the two, you have a sensible starting point for building out the frontend of your dApp.</p><p>In this section, we’ll create a new React application using the <a href="https://create-react-app.dev/">create-react-app</a> boilerplate generator. Then we’ll introduce some off-chain logic that uses Ethers.js to connect the user interface with the deployed smart contract, giving us a full end-to-end dApp.</p><h3>Creating the React Application</h3><p>The first step for creating the frontend is to install and implement the create-react-app boilerplate project, then modify it to suit our dApp. The first step is to install the library into a new “frontend” folder:</p><pre>cd ..<br><br># Using npm<br>npx create-react-app frontend<br><br># Or using Yarn<br>yarn create react-app frontend<br><br>cd frontend</pre><p>Once this has completed, you should see a new “frontend” folder in your project with all the associated React code. Expand the “frontend” folder and perform the following actions:</p><ul><li>Delete /src/setupTests.js</li><li>Delete /src/ReportWebVitals.js</li><li>Delete /src/logo.svg</li><li>Delete /src/App.test.js</li><li>Delete /src/App.css</li></ul><p>We’re now almost ready to start modifying the React application code. But first, be sure to install the libraries for <a href="https://getbootstrap.com/">Bootstrap</a> and <a href="https://docs.ethers.io/v5/">Ethers.js</a>. Bootstrap is a popular frontend CSS framework that comes with React-friendly UI widgets with CSS styling applied, while Ethers.js allows us to connect our frontend to deployed smart contracts on the blockchain. Ensure these commands are run from within the “frontend” folder.</p><pre><br># Using npm<br>npm install bootstrap ethers@5.7.2 <br><br># Or with Yarn:<br>yarn add bootstrap ethers@5.7.2</pre><p>Now we’re ready to modify the React application code. Open up the App.js file in the /src/ folder and remove the contents. We will start building it from scratch.</p><p>Next, create a function called “App” and export it</p><pre>import React, { useState } from &quot;react&quot;;<br>import { ethers } from &quot;ethers&quot;;<br> <br>// Custom CSS styles<br>const styles = {<br>  container: {<br>    display: &quot;flex&quot;,<br>    alignItems: &quot;center&quot;,<br>    justifyContent: &quot;center&quot;,<br>    minHeight: &quot;100vh&quot;,<br>    backgroundColor: &quot;#f5f5f5&quot;,<br>    fontFamily: &quot;Arial, sans-serif&quot;,<br>  },<br>  card: {<br>    maxWidth: &quot;500px&quot;,<br>    width: &quot;90%&quot;,<br>    padding: &quot;20px&quot;,<br>    backgroundColor: &quot;white&quot;,<br>    borderRadius: &quot;8px&quot;,<br>    boxShadow: &quot;0 4px 6px rgba(0, 0, 0, 0.1)&quot;,<br>    margin: &quot;0 auto&quot;,<br>  },<br>  title: {<br>    fontSize: &quot;24px&quot;,<br>    fontWeight: &quot;bold&quot;,<br>    textAlign: &quot;center&quot;,<br>    marginBottom: &quot;20px&quot;,<br>    color: &quot;#333&quot;,<br>  },<br>  section: {<br>    marginBottom: &quot;24px&quot;,<br>  },<br>  sectionTitle: {<br>    fontSize: &quot;18px&quot;,<br>    fontWeight: &quot;bold&quot;,<br>    marginBottom: &quot;10px&quot;,<br>    color: &quot;#444&quot;,<br>  },<br>  priceDisplay: {<br>    padding: &quot;15px&quot;,<br>    backgroundColor: &quot;#f9f9f9&quot;,<br>    borderRadius: &quot;6px&quot;,<br>    textAlign: &quot;center&quot;,<br>  },<br>  price: {<br>    fontSize: &quot;18px&quot;,<br>    fontWeight: &quot;bold&quot;,<br>  },<br>  button: {<br>    backgroundColor: &quot;#3b82f6&quot;,<br>    color: &quot;white&quot;,<br>    border: &quot;none&quot;,<br>    padding: &quot;10px 16px&quot;,<br>    borderRadius: &quot;4px&quot;,<br>    cursor: &quot;pointer&quot;,<br>    fontSize: &quot;16px&quot;,<br>    fontWeight: &quot;bold&quot;,<br>    transition: &quot;background-color 0.2s&quot;,<br>  },<br>  buttonWrapper: {<br>    textAlign: &quot;center&quot;,<br>  },<br>};<br> <br>function App() {<br>  <br>}<br> <br>export default App;</pre><p>Now we’ll start filling out the contents of the “App” function. Add the following code to it. The code does the following:</p><ul><li>Sets up the storedPrice and setStoresPrice react hooks.</li><li>Creates a connection to your MetaMask Web3 wallet.</li><li>Sets the deployed smart contract address and ABI. Both are required by Ethers.js for us to interact with the deployed smart contract.</li><li>The smart contract address can be obtained from the deployment step earlier in this guide. Plug this value in place of the <strong>REPLACE_WITH_DEPLOYED_CONTRACT_ADDRESS</strong> string.</li><li>The smart contract ABI can be obtained from the /backend/out/contracts/backend/out/PriceConsumerV3.sol/backend/out/PriceConsumerV3.sol/PriceConsumerV3.json file, in the abi element. You can use a <a href="https://codebeautify.org/jsonminifier">code minifier</a> to format it in a better way for storing in your application.</li></ul><pre>  const [storedPrice, setStoredPrice] = useState(&quot;&quot;);<br>  const [account, setAccount] = useState(&quot;&quot;);<br> <br>  const provider = new ethers.providers.Web3Provider(window.ethereum);<br>  // provider.send(&quot;eth_requestAccounts&quot;,[]);<br>  const signer = provider.getSigner();<br>  const contractAddress = &quot;0x26Bc66C0C830Bf4b69e2B942A7339081EBfffd90&quot;;<br> <br>  const ABI =<br>    &#39;[{&quot;type&quot;:&quot;constructor&quot;,&quot;inputs&quot;:[{&quot;name&quot;:&quot;_priceFeed&quot;,&quot;type&quot;:&quot;address&quot;,&quot;internalType&quot;:&quot;address&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;},{&quot;type&quot;:&quot;function&quot;,&quot;name&quot;:&quot;getDecimals&quot;,&quot;inputs&quot;:[],&quot;outputs&quot;:[{&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;uint8&quot;,&quot;internalType&quot;:&quot;uint8&quot;}],&quot;stateMutability&quot;:&quot;view&quot;},{&quot;type&quot;:&quot;function&quot;,&quot;name&quot;:&quot;getLatestPrice&quot;,&quot;inputs&quot;:[],&quot;outputs&quot;:[{&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;int256&quot;,&quot;internalType&quot;:&quot;int256&quot;}],&quot;stateMutability&quot;:&quot;view&quot;},{&quot;type&quot;:&quot;function&quot;,&quot;name&quot;:&quot;getLatestStoredPrice&quot;,&quot;inputs&quot;:[],&quot;outputs&quot;:[{&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;int256&quot;,&quot;internalType&quot;:&quot;int256&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;},{&quot;type&quot;:&quot;function&quot;,&quot;name&quot;:&quot;priceFeed&quot;,&quot;inputs&quot;:[],&quot;outputs&quot;:[{&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;address&quot;,&quot;internalType&quot;:&quot;contract AggregatorV3Interface&quot;}],&quot;stateMutability&quot;:&quot;view&quot;},{&quot;type&quot;:&quot;function&quot;,&quot;name&quot;:&quot;storedPrice&quot;,&quot;inputs&quot;:[],&quot;outputs&quot;:[{&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;int256&quot;,&quot;internalType&quot;:&quot;int256&quot;}],&quot;stateMutability&quot;:&quot;view&quot;}]&#39;;<br> <br>  const contract = new ethers.Contract(contractAddress, ABI, signer); // Now we’ll create two functions to be used in our application:</pre><ul><li>getStoredPrice will connect to the deployed smart contract and obtain the current value of the storedPrice() getter function.</li><li>setNewPrice will call the deployed smart contract’s storeLatestPrice function, wait for the transaction to complete, then call the getStoredPrice function to retrieve the stored price in the smart contract.</li></ul><p>We’ll also add a call to getStoredPrice in our App function so that it will initially call the getter function on page load:</p><pre>const getStoredPrice = async () =&gt; {<br>    try {<br>      // Request account access<br>      const accounts = await window.ethereum.request({<br>        method: &quot;eth_requestAccounts&quot;,<br>      });<br> <br>      // Set the first account as the current account<br>      setAccount(accounts[0]);<br> <br>      const contractPrice = await contract.storedPrice();<br> <br>      setStoredPrice(parseInt(contractPrice) / 100000000);<br>    } catch (error) {<br>      console.log(&quot;getStoredPrice Error: &quot;, error);<br>    }<br>  };<br> <br>  async function updateNewPrice() {<br>    try {<br>      console.log(&quot;Calling storeLatestPrice...&quot;);<br>      const transaction = await contract.getLatestStoredPrice();<br>      console.log(&quot;Transaction hash:&quot;, transaction.hash);<br>      await transaction.wait();<br>      console.log(&quot;Transaction confirmed&quot;);<br>      await getStoredPrice();<br>    } catch (error) {<br>      console.log(&quot;updateNewPrice Error: &quot;, error);<br>      alert(error.message);<br>    }<br>  }<br> <br>  getStoredPrice().catch(console.error);</pre><p>In the above step here the reason behind dividing the <strong>contractPrice </strong>Chainlink feeds return prices as integers scaled by 1e8, so dividing by 100 000 000 shifts the decimal back to its readable position.<br>Solidity only supports integers — no native floating point — to keep on‑chain math deterministic and precise, so decimals are emulated with these scaled integers.</p><p>The final step in creating the frontend is for your application to return the JSX code for the browser to render. Paste in the following code at the bottom of your App function, under the getStorePrice() call. This code does the following:</p><ul><li>Returns a simple two-column grid layout.</li><li>The first column contains the currently stored ETH/USD price in the smart contract.</li><li>The second column contains a button that the user can use to interact with the smart contract and update the stored price. Pressing the button calls the setNewPrice function above.</li></ul><pre>return (<br>    &lt;div style={styles.container}&gt;<br>      &lt;div style={styles.card}&gt;<br>        &lt;div style={styles.accountDisplay}&gt;Connected: {account}&lt;/div&gt;<br> <br>        &lt;div style={styles.section}&gt;<br>          &lt;h3 style={styles.sectionTitle}&gt;Stored Price&lt;/h3&gt;<br>          &lt;div style={styles.priceDisplay}&gt;<br>            &lt;p style={styles.price}&gt;{storedPrice}&lt;/p&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br> <br>        &lt;div style={styles.section}&gt;<br>          &lt;h3 style={styles.sectionTitle}&gt;Update Price&lt;/h3&gt;<br>          &lt;div style={styles.buttonWrapper}&gt;<br>            &lt;button onClick={updateNewPrice} style={styles.button}&gt;<br>              Update<br>            &lt;/button&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br></pre><p>Your application is now ready. If required, you can compare your code to the <a href="https://github.com/pappas999/chainlink-dapp-tutorial">completed example</a> to ensure you’ve done everything correctly. Now you’re ready to run your dApp.</p><h3>Running Your dApp</h3><p>After ensuring you have all the files saved, start your dApp locally by running the following command from the frontend folder:</p><pre># Using npm<br>npm run start<br><br># Or using Yarn<br>yarn start</pre><p>After the application loads, a new window should appear in your browser displaying your dApp user interface. You should also receive a popup notification from MetaMask asking to connect your wallet to the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6C9BKVBYBccbaqcl.png" /></figure><p>React frontend.</p><p>After you verify that you’ve <a href="https://faucet.chain.link/">funded</a> your MetaMask account with some Sepolia ETH, click the “Update” button on the dApp UI to interact with your deployed smart contract on the Sepolia network. You should receive a notification from MetaMask asking you to confirm the transaction. After you complete this, within a few seconds, your dApp should automatically refresh, and the current price of Ethereum should appear in the “Stored Price” section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BI9EToD11z1Xc6wR.png" /></figure><p>React frontend showing Data Feed result.</p><p>Congratulations, you’ve now successfully created, deployed, and interacted with a simple dApp! In this guide, you’re just running the frontend locally on your computer, but if you want you can deploy it to a cloud-based server, or even decentralize the frontend too and deploy it to <a href="https://ipfs.io/">IPFS</a>! You can also play around with the application’s <a href="https://www.w3schools.com/css/">CSS</a> to change the look and feel of the user interface.</p><h3>📋 Summary</h3><p>Decentralized applications (dApps) are applications that replace traditional centralized backend server processing with Web3 technologies such as blockchains, smart contracts, and oracles.<br>This shift grants dApps unique benefits like <strong>enhanced security</strong>, <strong>zero downtime</strong>, and <strong>censorship resistance</strong> — properties that are not achievable with conventional web applications.</p><p>In this technical demonstration, we built a <strong>simple end-to-end dApp</strong> that:</p><ul><li><strong>Created a smart contract</strong> capable of obtaining the latest Ethereum price from the <strong>ETH/USD Chainlink Data Feed</strong>.</li><li><strong>Stored</strong> the latest price value <strong>on-chain</strong> within the smart contract state.</li><li><strong>Developed a frontend user interface</strong> using <strong>React</strong> and <strong>Ethers.js</strong>, enabling users to interact seamlessly with the deployed contract.</li></ul><blockquote>You can view the complete project repository here:</blockquote><blockquote><strong><em>🔗 GitHub Project:</em></strong><em> </em><a href="https://github.com/Abhishek-2416/Chainlink-Price-Feed-DApp"><em>Chainlink-Price-Feed-DApp</em></a></blockquote><blockquote><em>Special thanks to the </em><a href="https://chain.link/tutorials/how-to-build-a-dapp"><em>Chainlink blog tutorial: </em>How to Build a dApp</a><em> for providing the foundational guide and inspiration for this project.</em></blockquote><h3>🙌 Connect With Me!</h3><p>If you found this project helpful or would like to collaborate, feel free to reach out to me:</p><ul><li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/abhishek-alimchandani-55283b224?utm_source=share&amp;utm_campaign=share_via&amp;utm_content=profile&amp;utm_medium=ios_app">Abhishek Alimchandani</a></li><li><strong>Email:</strong> abhishekalimchandani1624@gmail.com</li><li><strong>GitHub:</strong> <a href="https://github.com/Abhishek-2416">github.com/Abhishek-2416</a></li></ul><p>I’m always open to feedback, projects, or just networking with fellow developers! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f04928a64286" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>