<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nikhil Siripurapu</title>
    <description>The latest articles on DEV Community by Nikhil Siripurapu (@nikhil_siripurapu_f15241e).</description>
    <link>https://dev.to/nikhil_siripurapu_f15241e</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3982973%2F08bec4ca-08ce-40c6-ad74-3f31f10ad986.png</url>
      <title>DEV Community: Nikhil Siripurapu</title>
      <link>https://dev.to/nikhil_siripurapu_f15241e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nikhil_siripurapu_f15241e"/>
    <language>en</language>
    <item>
      <title>Inside SCAI Lucky Loop: Building a Provably Fair Daily Lottery as a Telegram Mini App</title>
      <dc:creator>Nikhil Siripurapu</dc:creator>
      <pubDate>Fri, 10 Jul 2026 11:03:04 +0000</pubDate>
      <link>https://dev.to/nikhil_siripurapu_f15241e/building-a-fair-telegram-mini-app-lottery-with-react-express-solidity-and-erc-20-rewards-234p</link>
      <guid>https://dev.to/nikhil_siripurapu_f15241e/building-a-fair-telegram-mini-app-lottery-with-react-express-solidity-and-erc-20-rewards-234p</guid>
      <description>&lt;p&gt;&lt;em&gt;Technical breakdown of the architecture, authentication flow, and verifiable randomness behind **SCAI Lucky Loop&lt;/em&gt;&lt;em&gt;—a coin-based daily lottery built during my Web3 internship at **EtherAuthority&lt;/em&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Over the past few months, I've been building &lt;strong&gt;SCAI Lucky Loop&lt;/strong&gt;: a daily, coin-based lottery delivered as a &lt;strong&gt;Telegram Mini App&lt;/strong&gt; (with a browser fallback), where players earn in-app coins, purchase ticket slots, and withdraw eligible winnings as &lt;strong&gt;LLT&lt;/strong&gt;, an ERC-20 token deployed on &lt;strong&gt;SCAI Mainnet&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Rather than focusing on the user experience, this article explains the engineering decisions behind the application: authentication, backend architecture, commit–reveal randomness, and the trust model that makes the system verifiable.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎥 Project Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Watch SCAI Lucky Loop in action:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vimeo.com/1215772223" rel="noopener noreferrer"&gt;https://vimeo.com/1215772223&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Technology Stack &amp;amp; Deployment
&lt;/h2&gt;

&lt;p&gt;The project is split into three independently deployable components.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;th&gt;Deployment&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Frontend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;React + Vite client, Telegram integration, wallet connection&lt;/td&gt;
&lt;td&gt;Vercel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Backend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Express API, SQLite database, cron jobs, withdrawals&lt;/td&gt;
&lt;td&gt;Render&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Smart Contracts&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LLT ERC-20 contract, Hardhat tests&lt;/td&gt;
&lt;td&gt;SCAI Mainnet&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The frontend is built using &lt;strong&gt;React 18&lt;/strong&gt;, &lt;strong&gt;TypeScript&lt;/strong&gt;, and &lt;strong&gt;Vite&lt;/strong&gt;, while the backend runs on &lt;strong&gt;Express.js&lt;/strong&gt; with &lt;strong&gt;SQLite&lt;/strong&gt; acting as the system of record for users, tickets, draws, referrals, and withdrawals.&lt;/p&gt;

&lt;p&gt;Wallet connectivity is handled using &lt;strong&gt;Reown AppKit&lt;/strong&gt; with the &lt;strong&gt;Ethers adapter&lt;/strong&gt;, configured exclusively for &lt;strong&gt;SCAI Mainnet (Chain ID 34).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One important architectural decision is that &lt;strong&gt;ticket purchases are currently off-chain.&lt;/strong&gt; Players spend in-app coins rather than sending blockchain transactions. Wallets are connected only when withdrawing LLT rewards. This separation significantly reduces gas costs and simplifies the user experience while still enabling blockchain payouts.&lt;/p&gt;




&lt;h1&gt;
  
  
  Authentication
&lt;/h1&gt;

&lt;p&gt;The application supports two independent authentication mechanisms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Telegram Mini App Authentication
&lt;/h2&gt;

&lt;p&gt;The primary authentication flow is native to Telegram.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Telegram launches the Mini App.&lt;/li&gt;
&lt;li&gt;The client receives &lt;code&gt;window.Telegram.WebApp.initData&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The frontend sends the signed payload to the backend.&lt;/li&gt;
&lt;li&gt;The backend verifies Telegram's signature using the bot token.&lt;/li&gt;
&lt;li&gt;If valid, the backend creates (or loads) the user and returns a JWT.&lt;/li&gt;
&lt;li&gt;Future requests authenticate using the JWT.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The important security boundary is the &lt;strong&gt;server-side verification&lt;/strong&gt; of Telegram's signed payload. Simply copying the JSON payload is insufficient because the signature cannot be forged without Telegram's secret.&lt;/p&gt;

&lt;p&gt;This prevents ordinary browser sessions from impersonating Telegram users.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wallet-Only Authentication
&lt;/h2&gt;

&lt;p&gt;To support users outside Telegram, I also implemented wallet-based login.&lt;/p&gt;

&lt;p&gt;Instead of relying on Telegram identity:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The backend generates a unique nonce.&lt;/li&gt;
&lt;li&gt;The wallet signs that nonce.&lt;/li&gt;
&lt;li&gt;The backend verifies the signature using &lt;code&gt;ethers.verifyMessage()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A JWT session is issued.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Supporting this required modifying the database schema so &lt;code&gt;telegram_id&lt;/code&gt; became nullable while ensuring every account contains at least one valid identity through database constraints.&lt;/p&gt;

&lt;p&gt;Additionally, every authenticated request reloads the user directly from SQLite instead of trusting cached JWT information. This ensures administrative changes, bans, or balance updates take effect immediately.&lt;/p&gt;




&lt;h1&gt;
  
  
  Verifiable Randomness with Commit–Reveal
&lt;/h1&gt;

&lt;p&gt;Lottery systems often ask users to trust that draws are random.&lt;/p&gt;

&lt;p&gt;Lucky Loop instead uses a &lt;strong&gt;commit–reveal&lt;/strong&gt; mechanism that allows anyone to independently verify every draw.&lt;/p&gt;

&lt;p&gt;Before ticket sales close:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The backend generates a cryptographically secure 32-byte random seed.&lt;/li&gt;
&lt;li&gt;The SHA-256 hash of that seed is published immediately.&lt;/li&gt;
&lt;li&gt;The seed itself remains secret.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once ticket sales end:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The original seed is revealed.&lt;/li&gt;
&lt;li&gt;SHA-256 is computed again.&lt;/li&gt;
&lt;li&gt;The first four bytes become an unsigned integer.&lt;/li&gt;
&lt;li&gt;That integer is reduced using modulo arithmetic against the number of tickets.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the hash was published beforehand, the backend cannot secretly generate multiple seeds after ticket sales close until it finds a favorable winner.&lt;/p&gt;

&lt;p&gt;Either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the revealed seed matches the published hash,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it doesn't.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no middle ground.&lt;/p&gt;




&lt;h2&gt;
  
  
  Public Verification
&lt;/h2&gt;

&lt;p&gt;Lucky Loop exposes a public verification endpoint.&lt;/p&gt;

&lt;p&gt;Given a draw date, anyone can independently verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the published commitment hash,&lt;/li&gt;
&lt;li&gt;the revealed seed,&lt;/li&gt;
&lt;li&gt;the computed winning ticket,&lt;/li&gt;
&lt;li&gt;and the recorded winner.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No trust in the backend is required—the mathematics speaks for itself.&lt;/p&gt;




&lt;h2&gt;
  
  
  Handling Zero-Ticket Draws
&lt;/h2&gt;

&lt;p&gt;One interesting production issue appeared during testing.&lt;/p&gt;

&lt;p&gt;Originally, a draw record only existed if someone purchased a ticket.&lt;/p&gt;

&lt;p&gt;On days with zero ticket sales:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;no draw record existed,&lt;/li&gt;
&lt;li&gt;the scheduled draw job executed,&lt;/li&gt;
&lt;li&gt;the cron process failed because there was nothing to draw.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fix was straightforward.&lt;/p&gt;

&lt;p&gt;When ticket sales close, the scheduler now creates an empty draw if one does not already exist.&lt;/p&gt;

&lt;p&gt;This allows every scheduled draw to execute successfully—even if nobody played that day.&lt;/p&gt;




&lt;h1&gt;
  
  
  Admin System
&lt;/h1&gt;

&lt;p&gt;Administrative privileges are determined through three independent mechanisms.&lt;/p&gt;

&lt;p&gt;An account becomes an administrator if &lt;strong&gt;any&lt;/strong&gt; of the following is true:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Telegram ID exists inside &lt;code&gt;ADMIN_TELEGRAM_IDS&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Wallet address exists inside &lt;code&gt;ADMIN_WALLET_ADDRESSES&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Database column &lt;code&gt;is_admin&lt;/code&gt; is true&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Environment variables provide the initial bootstrap administrator.&lt;/p&gt;

&lt;p&gt;After that, existing administrators can promote or demote users directly from the admin panel without redeploying the backend.&lt;/p&gt;

&lt;p&gt;This avoids the common problem of requiring infrastructure changes whenever administrator access changes.&lt;/p&gt;




&lt;h1&gt;
  
  
  LLT Withdrawals
&lt;/h1&gt;

&lt;p&gt;Blockchain interaction occurs only during withdrawals.&lt;/p&gt;

&lt;p&gt;The process is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connect wallet.&lt;/li&gt;
&lt;li&gt;Switch to SCAI Mainnet.&lt;/li&gt;
&lt;li&gt;Submit withdrawal.&lt;/li&gt;
&lt;li&gt;Backend validates:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;minimum coin balance,&lt;/li&gt;
&lt;li&gt;referral requirements,&lt;/li&gt;
&lt;li&gt;withdrawal eligibility.

&lt;ol&gt;
&lt;li&gt;Backend signs an LLT transaction using the server payout wallet.&lt;/li&gt;
&lt;li&gt;Transaction hash and explorer link are returned.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The payout wallet is the application's most sensitive secret.&lt;/p&gt;

&lt;p&gt;It is stored securely using Render environment secrets and is never exposed to the frontend.&lt;/p&gt;

&lt;p&gt;A critical distinction when building Vite applications is remembering that &lt;strong&gt;every environment variable beginning with &lt;code&gt;VITE_&lt;/code&gt; becomes public inside the browser bundle.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Private keys should never appear there.&lt;/p&gt;




&lt;h1&gt;
  
  
  Future Improvements
&lt;/h1&gt;

&lt;p&gt;The next major milestone is replacing off-chain ticket purchases with native SCAI payments.&lt;/p&gt;

&lt;p&gt;Doing so would move the entire lottery lifecycle onto the blockchain rather than only withdrawals.&lt;/p&gt;

&lt;p&gt;Other planned improvements include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;migrating from SQLite to PostgreSQL,&lt;/li&gt;
&lt;li&gt;replacing local rate limiting with Redis,&lt;/li&gt;
&lt;li&gt;supporting horizontal backend scaling,&lt;/li&gt;
&lt;li&gt;expanding transparency around draw verification.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Building SCAI Lucky Loop taught me considerably more than writing React components or Solidity contracts.&lt;/p&gt;

&lt;p&gt;It required thinking carefully about authentication boundaries, backend trust, scheduled systems, wallet integration, cryptographic randomness, and operational edge cases that only appear after deployment.&lt;/p&gt;

&lt;p&gt;The commit–reveal pattern ended up being one of the most valuable engineering techniques I implemented. It's relatively simple to build, easy for users to verify independently, and significantly increases trust in any application that depends on server-generated randomness.&lt;/p&gt;

&lt;p&gt;If you're building a Telegram Mini App, a Web3 application, or any system where fairness matters, I highly recommend considering commit–reveal as part of your design.&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;🎥 &lt;a href="https://vimeo.com/1215772223" rel="noopener noreferrer"&gt;https://vimeo.com/1215772223&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;SCAI Lucky Loop's smart contract has been audited by EtherAuthority. This project was built during my Web3 internship at EtherAuthority.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;#React #TypeScript #ExpressJS #Solidity #Ethereum #Web3 #Blockchain #TelegramMiniApps #SmartContracts #Cryptography #OpenSource #SCAI #EtherAuthority&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>web3</category>
      <category>react</category>
    </item>
    <item>
      <title>🔒 Building a Full-Stack DeFi Staking Platform on SecureChain AI — A Week 4 Web3 Internship Training Journey</title>
      <dc:creator>Nikhil Siripurapu</dc:creator>
      <pubDate>Sat, 13 Jun 2026 16:59:52 +0000</pubDate>
      <link>https://dev.to/nikhil_siripurapu_f15241e/building-a-full-stack-defi-staking-platform-on-securechain-ai-a-week-4-web3-internship-journey-32ik</link>
      <guid>https://dev.to/nikhil_siripurapu_f15241e/building-a-full-stack-defi-staking-platform-on-securechain-ai-a-week-4-web3-internship-journey-32ik</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Staking is one of the most widely used mechanisms in DeFi — deposit tokens, earn yield over time, withdraw whenever you want. It sounds simple, but building one correctly means getting the token approval flow, the reward math, and the live dashboard data all working together without confusing the user at any step.&lt;/p&gt;

&lt;p&gt;For Week 4 of my Web3 internship at Ether Authority, I built a complete, production-ready &lt;strong&gt;DeFi Staking Platform&lt;/strong&gt; from scratch — smart contracts, frontend, and a live deployment on the SecureChain AI (SCAI) Mainnet.&lt;/p&gt;

&lt;p&gt;🌐 &lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://de-fi-staking-platform-vert.vercel.app" rel="noopener noreferrer"&gt;https://de-fi-staking-platform-vert.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;💻 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/feudcommon/DeFi-staking-platform" rel="noopener noreferrer"&gt;https://github.com/feudcommon/DeFi-staking-platform&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1gxzvzd38dre1q3gul61.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1gxzvzd38dre1q3gul61.png" alt=" " width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Smart Contracts
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. ERC20Token (STK)&lt;/strong&gt;&lt;br&gt;
An ERC-20 token with a built-in faucet. Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Public faucet (&lt;code&gt;faucet()&lt;/code&gt;) — any wallet claims 100 STK, enforced with a 24-hour cooldown per address&lt;/li&gt;
&lt;li&gt;Owner-only minting — used by the staking contract to mint reward tokens directly to users on claim&lt;/li&gt;
&lt;li&gt;Packed faucet storage — &lt;code&gt;faucetAmount&lt;/code&gt; and &lt;code&gt;faucetCooldown&lt;/code&gt; are both &lt;code&gt;uint128&lt;/code&gt;, packed into a single storage slot to save gas on every faucet read&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. StakingContract&lt;/strong&gt;&lt;br&gt;
The core of the platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stake any amount of STK with no minimum&lt;/li&gt;
&lt;li&gt;Token-weighted, time-based rewards — yield accrues continuously based on stake size and a basis-points APR&lt;/li&gt;
&lt;li&gt;No lock-up period — withdraw staked tokens at any time&lt;/li&gt;
&lt;li&gt;Reward snapshot pattern — every stake, withdraw, or claim first snapshots pending rewards via an &lt;code&gt;updateReward&lt;/code&gt; modifier, so yield is always calculated up to the exact second&lt;/li&gt;
&lt;li&gt;Faucet passthrough (&lt;code&gt;claimFaucet()&lt;/code&gt;) — lets users claim free STK directly from the staking interface without touching the token contract separately&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Frontend Features
&lt;/h2&gt;

&lt;p&gt;Built with React + TypeScript + Ethers.js v6:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatic MetaMask integration — connects to SCAI Mainnet, prompts users to switch if on the wrong network&lt;/li&gt;
&lt;li&gt;Live dashboard — staked amount, available rewards, APR, APY, and wallet balance, all pulled from a single &lt;code&gt;getDashboardData()&lt;/code&gt; call&lt;/li&gt;
&lt;li&gt;Auto-approval flow — &lt;code&gt;approve()&lt;/code&gt; is called automatically before staking, so users never see a confusing failed transaction&lt;/li&gt;
&lt;li&gt;Multi-wallet support — MetaMask, WalletConnect, and Coinbase Wallet via RainbowKit&lt;/li&gt;
&lt;li&gt;Transaction hash links — every stake, withdraw, and claim links directly to the block explorer&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Tech Stack
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Smart Contracts&lt;/td&gt;
&lt;td&gt;Solidity ^0.8.19&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Development&lt;/td&gt;
&lt;td&gt;Hardhat&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;td&gt;React 18, TypeScript, Ethers.js v6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wallet Connectivity&lt;/td&gt;
&lt;td&gt;RainbowKit, Wagmi, WalletConnect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Vercel (frontend), SCAI Mainnet (contracts)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  Deployed Contract Addresses (SCAI Mainnet — Chain ID: 34)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Contract&lt;/th&gt;
&lt;th&gt;Address&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ERC20Token (STK)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x822Bc4Be4e784e0a9b78d92Fa2c79cF1E471512e&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StakingContract&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x530944aC3cb1A8AC17Ca11b90EB17D90c5d5bE78&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All contracts are verified on the SecureChain Explorer.&lt;/p&gt;


&lt;h2&gt;
  
  
  How to Run Locally
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Clone the repo&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/feudcommon/DeFi-staking-platform.git
&lt;span class="nb"&gt;cd &lt;/span&gt;DeFi-staking-platform
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install dependencies&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Start the dev server&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;The app opens at &lt;code&gt;http://localhost:3000&lt;/code&gt;. Connect a wallet, switch to SCAI Mainnet, claim STK from the faucet, and start staking.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Learnings
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The &lt;code&gt;approve&lt;/code&gt; → &lt;code&gt;stake&lt;/code&gt; two-step is where most dApp UX breaks.&lt;/strong&gt; Checking the existing allowance first and only prompting for approval when needed turns two confusing transactions into one smooth click.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Struct packing saves real gas at scale.&lt;/strong&gt; Packing &lt;code&gt;lastUpdateTime&lt;/code&gt;, &lt;code&gt;stakedSince&lt;/code&gt;, and a reserved field into a single storage slot means every stake and withdraw call writes less data on-chain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A public faucet is essential for review.&lt;/strong&gt; Letting anyone claim test tokens directly, with a simple cooldown, means reviewers and new users never have to ask for funds manually before trying the platform.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basis points avoid floating-point math entirely.&lt;/strong&gt; Storing the reward rate as BPS instead of a percentage keeps reward calculations precise and avoids decimal handling issues that Solidity doesn't support natively.&lt;/p&gt;




&lt;h2&gt;
  
  
  Acknowledgements
&lt;/h2&gt;

&lt;p&gt;Massive thanks to the Ether Authority team for designing such a structured, hands-on internship program. Building and shipping a real project every week is the fastest way to grow as a Web3 developer.&lt;/p&gt;

&lt;h1&gt;
  
  
  Web3 #Blockchain #Ethereum #ReactJS #SmartContracts #SCAI #Internship #Solidity #SecureChainAI #EtherAuthority #DeFi #Staking #OpenSource #Hardhat #Vercel
&lt;/h1&gt;

</description>
      <category>web3</category>
      <category>ai</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
