<?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 Emmanuel Okeke on Medium]]></title>
        <description><![CDATA[Stories by Emmanuel Okeke on Medium]]></description>
        <link>https://medium.com/@emma.onyedika.okeke?source=rss-e5d151e56c0b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*eiCN_S0Aq3wdsXo0</url>
            <title>Stories by Emmanuel Okeke on Medium</title>
            <link>https://medium.com/@emma.onyedika.okeke?source=rss-e5d151e56c0b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 14:40:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emma.onyedika.okeke/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[KooPaa: Revolutionizing Community-Driven Savings with Blockchain Technology]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/koopaa-revolutionizing-community-driven-savings-with-blockchain-technology-d0cee3bcbffa?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0cee3bcbffa</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Fri, 15 Aug 2025 10:12:53 GMT</pubDate>
            <atom:updated>2025-08-15T10:12:53.519Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*prwFvIkXun79X1l64gurYQ.jpeg" /></figure><p>The traditional Ajo system, which has been a vital part of financial practices in many African communities, allows people to save collectively and access lump-sum payouts in rotation. This community-driven savings model fosters trust, camaraderie, and mutual financial support, especially in areas with limited access to formal banking services. However, while the Ajo system has served many communities for generations, it is often constrained by a lack of transparency, potential for fraud, and difficulty in managing funds at scale.</p><p><strong>KooPaa</strong> offers a decentralized solution to these traditional savings systems by bringing the Ajo model onto the blockchain. By leveraging Solana’s blockchain technology, KooPaa enables individuals to create or join rotating savings groups with complete transparency, trustless coordination, and automated payouts, all facilitated through smart contracts.</p><p>The platform empowers users to save together and receive lump sum payouts while ensuring that everything is managed in a secure, transparent, and decentralized manner. The beauty of KooPaa lies in its ability to modernize a deeply rooted cultural savings system, bringing it into the world of decentralized finance (DeFi) and offering a much-needed alternative to traditional banking for unbanked and underbanked individuals.</p><p>KooPaa is a decentralized savings platform inspired by the Ajo system, combining community-driven financial practices with blockchain technology. By allowing users to contribute periodically and then take turns receiving lump-sum payouts, KooPaa offers an automated, trustless, and transparent system for managing savings.</p><p><strong>The Problem KooPaa Solves</strong></p><p>While the Ajo system has worked well in many communities for generations, it is not without its challenges. The lack of transparency and accountability in traditional savings groups is a significant problem. In some cases, the person managing the pool of funds can mismanage or even embezzle the money, leading to mistrust and failure of the savings group. Furthermore, the system is largely informal, which makes it difficult to scale beyond local communities or to access cross-border financial systems.</p><p>For many people, particularly those in developing countries, access to formal financial institutions remains a challenge. The World Bank estimates that around 1.7 billion adults globally are unbanked, with the majority living in developing countries. Without access to banks or credit, these individuals are often excluded from traditional financial services such as loans, savings accounts, and insurance.</p><p>KooPaa provides a decentralized solution that eliminates the risks of fraud and mismanagement by using blockchain technology. By automating the entire process through smart contracts, KooPaa ensures that all transactions are transparent, verifiable, and trustless. This provides a higher level of security for users, allowing them to save money and receive lump-sum payouts without the concerns of mismanagement or fraud that often plague informal savings groups.</p><p>Additionally, KooPaa brings a level of scalability to the Ajo model. Instead of being limited to small, local groups, KooPaa’s blockchain-based platform allows users from anywhere in the world to participate in savings groups. This opens up the possibility for individuals in rural or underserved areas to access the benefits of group savings, regardless of where they live.</p><p><strong>How KooPaa Works</strong></p><p>KooPaa is built on the Solana blockchain, which provides fast and low-cost transactions. The platform allows users to create or join rotating savings groups, where members contribute a fixed amount periodically (weekly, biweekly, or monthly) and take turns receiving a lump sum payout.</p><ul><li>Creating or Joining a Group:<br> Users can either create their own savings group or join an existing one. When creating a group, the group’s organizer sets the parameters, such as the contribution amount, payout frequency, and the number of participants. This provides flexibility to adapt the system to different user needs, whether the group is small or large.</li><li>Smart Contract Automation:<br> KooPaa leverages smart contracts to automate the entire savings process. Once the group’s parameters are set, the smart contract takes over, ensuring that contributions are made on time and payouts are distributed automatically. Smart contracts ensure that everything runs according to the rules, without any need for a central authority or intermediary.</li><li>Periodic Contributions:<br> Every participant in the group makes their regular contributions, which are pooled together in a secure, decentralized manner. Since everything is recorded on the blockchain, each participant can verify that their contributions are accounted for, ensuring full transparency.</li><li>Rotating Payout System:<br> KooPaa’s rotating payout system is a key feature that mirrors the traditional Ajo model. At regular intervals, one member of the group receives the lump-sum payout. The payout rotates so that each member receives their turn. This ensures that everyone in the group has the opportunity to receive a larger sum of money at different times, based on the group’s agreement.</li><li>Transparency and Trust:<br> Blockchain’s immutable nature ensures that every contribution and payout is recorded and cannot be altered. Participants can track their contributions, monitor the overall balance of the group, and verify the payouts. This transparency builds trust among group members, as they can easily verify that the process is being handled fairly and without manipulation.</li><li>Low Transaction Fees:<br> Built on the Solana blockchain, KooPaa benefits from the blockchain’s low transaction fees and fast processing times. This makes it affordable for users to participate in the system, even in regions where access to banking is limited or financial transactions are expensive.</li><li>Security and Privacy:<br> KooPaa prioritizes the security and privacy of its users. By using Solana’s high-performance blockchain, users can trust that their data is securely stored and their transactions are protected from fraud. Furthermore, since KooPaa is decentralized, no central authority controls the funds, reducing the risk of financial mismanagement or fraud.</li></ul><p><strong>Key Features of KooPaa</strong></p><p>KooPaa offers several key features that make it stand out in the world of decentralized finance and savings:</p><ul><li>Decentralized and Trustless:<br> The heart of KooPaa’s platform is its decentralization. By using blockchain technology and smart contracts, KooPaa removes the need for intermediaries or trusted third parties. This ensures that the process is transparent and secure, while also removing the potential for fraud or mismanagement that can occur in traditional savings systems.</li><li>Rotating Savings Model:<br> KooPaa mimics the traditional Ajo system by allowing members to contribute periodically and take turns receiving lump-sum payouts. This model is both familiar and effective, especially for people who are used to informal savings systems but are looking for a more secure, scalable alternative.</li><li>Automated Contributions and Payouts:<br> Using smart contracts, KooPaa automates the entire process, ensuring that contributions are made on time and payouts are distributed according to the agreed-upon schedule. This eliminates the need for manual intervention and reduces the chances of human error.</li><li>Cross-Border Accessibility:<br> One of KooPaa’s major advantages is its ability to serve people globally. Since it is built on blockchain technology, users from different parts of the world can participate in the same savings group without having to worry about geographical limitations, currencies, or the inefficiencies of traditional banking systems.</li><li>User-Friendliness:<br> KooPaa is designed to be user-friendly and accessible to people with varying levels of technical knowledge. The platform’s simple interface allows users to join or create savings groups, track their contributions, and receive payouts with minimal effort.</li><li>Low-Cost Participation:<br> KooPaa’s use of the Solana blockchain ensures that transaction costs are kept low, making it affordable for individuals from lower-income backgrounds to participate in community savings groups. This reduces the barriers to entry and allows even the unbanked to benefit from the platform.</li></ul><p><strong>Real-World Use Cases for KooPaa</strong></p><p>KooPaa’s decentralized savings model has far-reaching implications for various groups and regions. Let’s explore some real-world use cases where KooPaa can have a significant impact:</p><ul><li>Community-Based Savings Groups:<br> In many parts of the world, informal savings groups — like those based on the Ajo model — are the primary means for people to save and access lump sums of money. However, these groups often suffer from issues like mismanagement and lack of accountability. KooPaa provides a decentralized solution that ensures the entire process is automated and transparent, making it safer and more efficient for communities to save together.</li><li>Unbanked and Underbanked Individuals:<br> According to the World Bank, nearly 1.7 billion people worldwide remain unbanked. For these individuals, access to savings accounts, loans, and financial services is limited or nonexistent. KooPaa provides an alternative to traditional banking by offering a secure, decentralized savings platform that doesn’t require users to have a bank account or access to formal financial institutions.</li><li>Cross-Border Savings and Remittances:<br> One of the challenges faced by people in developing countries is the high cost and slow speed of international money transfers. KooPaa allows people to join savings groups across borders and receive payouts in a timely, cost-effective manner. By using Solana’s blockchain, KooPaa ensures fast, low-cost transactions that help mitigate the challenges associated with remittances.</li><li>Micro-Savings for Low-Income Households:<br> Many low-income households struggle to save money due to a lack of formal banking options and high living costs. KooPaa provides a platform that enables micro-savings, where individuals can contribute small amounts regularly and receive larger sums when it’s their turn. This encourages a culture of savings, helping users to build up a financial cushion over time.</li></ul><p><strong>The Future of KooPaa and Decentralized Savings</strong></p><p>KooPaa is still in its early stages, but its potential is enormous. As blockchain technology continues to evolve, the platform will likely incorporate more advanced features, such as enhanced analytics for group management, better integration with DeFi protocols, and improved mobile accessibility. The platform may also expand to include new types of savings models, such as emergency funds, group insurance, or investment pools, further empowering users to manage their finances in innovative ways.</p><p>With the rise of decentralized finance, KooPaa is well-positioned to play a key role in the future of savings and financial inclusion. As more people around the world begin to embrace blockchain technology, KooPaa’s unique take on community-driven savings will be instrumental in creating a more inclusive and transparent financial system.</p><p><strong>Conclusion</strong></p><p>KooPaa is a groundbreaking platform that takes the traditional Ajo savings system to the next level by utilizing the power of blockchain technology. By automating contributions and payouts through smart contracts, KooPaa ensures that savings groups are managed with complete transparency, security, and efficiency. The platform’s decentralized nature eliminates the need for intermediaries and fosters trust among participants, making it easier for individuals to save and receive lump-sum payouts.</p><p>As the world continues to shift toward decentralized finance, KooPaa provides a critical solution for the unbanked and underbanked, allowing people to engage in financial activities without relying on traditional banking systems. With its innovative features and scalable model, KooPaa is helping to democratize access to savings and financial services for millions of people worldwide.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0cee3bcbffa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chatter: Revolutionizing Messaging and Payments]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/chatter-revolutionizing-messaging-and-payments-568eb41ba900?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/568eb41ba900</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Fri, 15 Aug 2025 09:47:51 GMT</pubDate>
            <atom:updated>2025-08-15T09:47:51.628Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*HRQPtKJlC6LHmLDVir6sbA.png" /></figure><p>In today’s world, messaging platforms have become the backbone of communication and commerce. Across the globe, especially in emerging markets, more than 80% of commerce occurs through messaging apps such as WhatsApp, Facebook Messenger, and Telegram. These platforms have long been central to social interactions, but despite their widespread use, they still suffer from a significant gap when it comes to integrating payments seamlessly within these conversations.</p><p>For sellers, the process of conducting business via messaging apps is cumbersome. Buyers often need to leave the conversation to make payments, sellers must ask for bank account details or payment links, and there’s often no immediate confirmation of a completed transaction. This fragmentation leads to a lack of trust, delayed payments, and ghosted deals, making it difficult to scale businesses and drive smooth commerce.</p><p>Enter <strong>Chatter</strong>, a platform that revolutionizes this experience by turning messaging conversations into fully integrated storefronts. By enabling payments to happen within the same messaging interface, Chatter eliminates the need for app switching and allows merchants to accept stablecoin payments in real time. With Chatter, buying and selling through messaging apps becomes frictionless, secure, and trustworthy — paving the way for faster, more effective transactions, especially in the rapidly growing markets of Africa, Asia, and Latin America.</p><p><strong>The Problem Chatter Solves</strong></p><p>In emerging markets, the fragmented payment systems hinder the growth of small businesses and disrupt the flow of online commerce. While messaging platforms have been widely adopted for personal and business communication, the lack of a seamless payment solution limits their full potential. Sellers often need to manually provide their payment information, and buyers are forced to leave the conversation to make the payment, which adds time and complexity to the process.</p><p>This issue is compounded by the lack of trust in informal transactions. The absence of secure, instant payment methods means that buyers and sellers often face delays in confirming whether a transaction has occurred. Many businesses, especially small and informal ones, struggle to accept payments securely, while buyers may be hesitant to commit to a deal due to the fear of fraud or payment failure.</p><p>Chatter solves this issue by embedding payment functionality directly into the messaging conversation, providing a streamlined, real-time payment solution. Payments are handled instantly and securely, without the need for third-party apps, account sharing, or long waiting times. With Chatter, users don’t have to leave the app to verify a transaction, and both parties receive immediate payment confirmation.</p><p>For emerging market businesses that rely on mobile messaging to conduct commerce, this is a game-changer. The integration of payments directly into the messaging flow eliminates barriers and enhances trust, making it easier for small businesses to thrive and for customers to complete transactions.</p><p><strong>How Chatter Works</strong></p><p>Chatter seamlessly integrates payments directly into the messaging flow, allowing buyers and sellers to conduct transactions within their preferred messaging apps. Here’s a deeper look at how the platform works:</p><ul><li>Simple Messaging and Payment Flow:<br>After the seller and buyer agree on the terms of the sale, Chatter’s interface allows the seller to display product listings, prices, and descriptions within the messaging conversation. This eliminates the need for external links and keeps the entire purchase process within the same app. When the buyer is ready to make a purchase, they can initiate payment without leaving the chat window.</li><li>Payment with Stablecoins:<br> Chatter uses stablecoins — cryptocurrencies that are pegged to a stable asset like the U.S. dollar (USDT, USDC, DAI) — to ensure predictable value during transactions. This makes stablecoins ideal for commerce, as users don’t have to worry about volatility. Payments are handled instantly, and the transaction is verified in real time using blockchain technology.</li><li>No App Switching Required:<br> Unlike traditional e-commerce platforms or third-party payment services that require users to switch between apps to complete payments, Chatter operates directly within messaging platforms. Users simply interact with the merchant, choose their desired product or service, and complete the transaction — all without ever leaving the conversation.</li><li>Instant Transaction Confirmation:<br> Once the payment is processed, both the buyer and seller receive an instant transaction confirmation within the chat. This significantly reduces the time it takes to confirm a sale, addresses concerns around trust, and provides immediate proof of payment.</li><li>Security and Transparency:<br> Leveraging blockchain technology, Chatter ensures that all payments are secure, transparent, and irreversible once completed. The immutability of the blockchain guarantees that the transaction data cannot be tampered with, while its transparent nature allows both parties to track the entire transaction history.</li><li>Custom Storefronts:<br> Chatter enables merchants to create a digital storefront within the messaging app itself. Sellers can upload product listings, images, and descriptions, allowing buyers to browse available products directly in the chat window. This feature streamlines the e-commerce experience, giving businesses a cost-effective solution for running their own online stores within existing messaging apps.</li><li>Rewards and Loyalty Programs:<br> Merchants can create and offer loyalty programs or rewards within the messaging interface. This integration is designed to encourage repeat business and increase sales. For instance, businesses can issue discount codes directly in the chat or reward customers with points or special offers for every transaction made.</li></ul><p><strong>Key Features of Chatter</strong></p><p>Chatter’s innovative approach to integrated payments comes with a host of unique features that distinguish it from traditional e-commerce platforms and payment systems. Some of the key features include:</p><ul><li>Integrated Payment Processing in Messaging Apps:<br> Chatter’s ability to seamlessly embed payment processing within messaging apps removes the friction that typically occurs with external payment systems. Buyers and sellers can communicate, negotiate, and complete transactions all within the same interface. This user-friendly experience enhances convenience for both parties, encouraging more transactions.</li><li>Instant, Trustless Payments:<br> Payments are processed in real time using stablecoins, which ensures that both the buyer and seller can immediately verify the transaction. This removes uncertainty and helps build trust between users — key factors in ensuring higher transaction success rates.</li><li>Seamless Multi-Platform Support:<br> Chatter supports multiple popular messaging apps, including WhatsApp, Facebook Messenger, and Telegram. This flexibility allows users to continue using the platforms they’re already familiar with while enjoying the added benefits of integrated payments.</li><li>User-Friendly Interface:<br> The platform is designed to be as simple and intuitive as possible, meaning users don’t need to have any experience with cryptocurrency or blockchain to complete transactions. Chatter hides the complexity of crypto payments, offering users a smooth, familiar experience that feels like using a standard e-commerce platform.</li><li>Customizable Merchants’ Storefronts:<br> Chatter allows merchants to create digital storefronts within the messaging app, making it easy to showcase products, offer promotions, and manage transactions directly from the messaging interface.</li><li>Multi-Currency Support:<br> While Chatter focuses on stablecoins, the platform also supports multiple currencies, ensuring that users in different regions can transact in their local stablecoin equivalents, promoting global reach and inclusivity.</li><li>Integration of Rewards and Loyalty Programs:<br> Merchants can offer rewards, discounts, or loyalty points to incentivize repeat purchases, creating a more engaged customer base. This feature helps businesses retain customers and increase lifetime value.</li><li>Cost-Effective for Merchants:<br> Chatter is designed to be a cost-effective solution for merchants, especially small businesses and informal sellers. There are no heavy fees associated with the platform, which means merchants can keep more of the profits from their sales.</li></ul><p><strong>Real-World Use Cases</strong></p><p>Chatter’s ability to integrate payments directly into messaging apps has a wide range of practical applications. Below are some real-world use cases that highlight the platform’s impact:</p><ul><li>Small Business Payments:<br> Many small businesses in emerging markets already rely heavily on messaging apps to communicate with customers and handle sales. However, without integrated payments, these businesses struggle with the fragmented nature of the process. With Chatter, small businesses can now accept payments directly in the messaging app, reducing the friction of the sales process and improving conversion rates. Sellers no longer need to wait for manual bank transfers or payment verification, allowing them to complete transactions faster and more securely.</li><li>Freelance Transactions:<br> Freelancers around the world often face difficulties when it comes to receiving payments. Cross-border payments can take days to clear, and traditional payment systems can be expensive and unreliable. Chatter allows freelancers to receive instant payments in stablecoins, reducing the waiting period and eliminating the need for expensive intermediaries. This allows freelancers to be paid promptly and continue working without delay.</li><li>E-Commerce in Developing Markets:<br> E-commerce in developing markets often faces hurdles such as limited payment options, low trust in online transactions, and delays in payment processing. Chatter addresses these challenges by providing an easy-to-use, trustworthy platform for both merchants and buyers. It allows businesses to accept payments in stablecoins, which ensures a reliable store of value and quick transaction confirmation. This opens up the opportunity for e-commerce to flourish in markets where it may have otherwise been difficult to establish.</li><li>Charitable Donations:<br> Charities and non-profit organizations often use social media and messaging platforms to engage with donors. However, the lack of integrated payment solutions has created a barrier for many individuals who want to make contributions. Chatter solves this by integrating donation payment systems directly into the messaging flow, making it easier for people to donate to causes they care about in real time.</li></ul><p><strong>Broader Impact on Financial Inclusion</strong></p><p>Chatter’s integration of payments into messaging platforms has the potential to transform financial inclusion on a global scale. For millions of individuals in emerging markets who don’t have access to traditional banking services, Chatter provides a way to participate in the digital economy by leveraging the mobile phones they already use.</p><p>By using stablecoins, Chatter offers a decentralized, transparent, and accessible alternative to traditional banking and payment systems. For regions with unstable currencies and high inflation rates, stablecoins provide an opportunity to store value without worrying about devaluation. Furthermore, Chatter’s ability to integrate with existing messaging apps ensures that users can engage in commerce without needing to adopt new platforms or learn complicated technical systems.</p><p>Chatter has the power to bring millions of unbanked people into the global financial system by simplifying payments, making transactions secure and instantaneous, and empowering small businesses and entrepreneurs to scale their operations.</p><p><strong>Future Developments</strong></p><p>As Chatter continues to grow, there are many exciting developments on the horizon. Future updates may include expanded support for additional cryptocurrencies, advanced analytics and marketing tools for merchants, the introduction of cross-border payment solutions, and deeper integration with e-commerce platforms. With the rapid adoption of cryptocurrencies in emerging markets, Chatter’s continued innovation will ensure that it remains at the forefront of the messaging and payments revolution.</p><p><strong>Conclusion</strong></p><p>Chatter is transforming the way we conduct commerce in messaging apps by simplifying and securing the payment process. By integrating stablecoin payments directly into conversations, Chatter enhances trust, reduces friction, and makes transactions faster and more efficient. With its user-friendly interface, real-time payment confirmations, and the ability to create digital storefronts within messaging apps, Chatter is poised to redefine the future of e-commerce in emerging markets.</p><p>By making payments seamless, accessible, and secure, Chatter empowers users and businesses to thrive in the digital economy. As it continues to evolve and scale, Chatter will remain a powerful tool for driving financial inclusion and transforming the way people engage in digital commerce.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=568eb41ba900" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NECTARFI: Simplifying Stablecoin Transactions for Everyone]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/nectarfi-simplifying-stablecoin-transactions-for-everyone-e1dd36b4d85d?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1dd36b4d85d</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Fri, 15 Aug 2025 09:20:56 GMT</pubDate>
            <atom:updated>2025-08-15T09:20:56.193Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*htu-fDUxPIObQ1C8oeqGGg.jpeg" /></figure><p>The cryptocurrency market has experienced immense growth in the last decade, and among the many innovations within the space, stablecoins stand out as a critical development. These digital assets, which are pegged to the value of stable assets like fiat currencies, have gained traction due to their ability to offer price stability in contrast to the volatility often associated with traditional cryptocurrencies such as Bitcoin and Ethereum. However, while stablecoins provide a solution for volatility, the user experience in the broader cryptocurrency ecosystem can still be overwhelming for many, particularly for those in emerging markets who are looking for simple, accessible, and reliable financial tools.</p><p><strong>NECTARFI</strong> is a platform built with the mission to simplify stablecoin use and make it more accessible to everyone, especially in regions where access to banking is limited or traditional financial systems are unreliable. NECTARFI allows users to receive, save, and spend stablecoins in a way that is intuitive and seamless, enabling a wider audience to engage with decentralized finance (DeFi) without requiring technical expertise or experience with complex blockchain concepts. Through NECTARFI, users can take advantage of the benefits of stablecoins and DeFi — such as faster transactions, lower fees, and the ability to hedge against inflation — without encountering the typical barriers to entry that come with blockchain platforms.</p><p>This platform is poised to play a crucial role in the global shift toward digital finance, offering a straightforward interface and focusing on user experience, all while leveraging the power and security of blockchain technology. By simplifying the process of dealing with stablecoins, NECTARFI provides individuals from all walks of life the opportunity to manage their money more effectively, thus contributing to greater financial inclusion, especially in developing countries.</p><p><strong>The Problem NECTARFI Solves</strong></p><p>Stablecoins are often touted as the solution to cryptocurrency volatility, but for most individuals in emerging markets, the real problem is not just the price fluctuation of digital assets but the complexity of using blockchain platforms. While stablecoins are a great alternative to traditional money in unstable economies or high-inflation regions, the complexity of interacting with blockchain wallets, understanding public and private keys, and navigating decentralized exchanges creates a significant barrier for the average user.</p><p>Furthermore, even though stablecoins offer stability, most platforms that facilitate stablecoin transactions remain too complicated for users with little or no experience in cryptocurrency. In many cases, the average user finds themselves unsure of how to move assets from one platform to another, manage wallets, or even convert crypto to local currency, which limits the practical use of digital assets.</p><p>Moreover, financial exclusion continues to be a problem in many developing countries. While mobile phone usage has risen rapidly in these regions, traditional banking services remain unavailable or unreliable for large portions of the population. According to the World Bank, approximately 1.7 billion adults globally remain unbanked, with many of them living in areas with unreliable financial systems. These individuals have no access to the benefits of traditional banking, such as savings accounts, loans, and credit, further perpetuating inequality.</p><p>NECTARFI addresses these issues head-on. By simplifying the process of receiving, saving, and spending stablecoins, the platform gives unbanked and underbanked populations the ability to safely store value, make payments, and engage in a decentralized financial system without needing a bank account. For users in volatile economies, NECTARFI’s ability to offer financial services on a blockchain-based platform is an opportunity to participate in a global economy, free from the limitations of local financial systems.</p><p><strong>How NECTARFI Works</strong></p><p><strong>NECTARFI</strong> was built with the user in mind, offering a platform that minimizes friction and allows individuals to use stablecoins effortlessly. The platform streamlines every part of the stablecoin experience, from the moment a user first receives their coins to when they decide to spend them.</p><ol><li>Receiving Stablecoins:</li></ol><p>One of the key features of NECTARFI is the ability for users to receive stablecoins easily. Whether it’s for business transactions, cross-border payments, or personal transfers, the platform allows users to accept payments in stablecoins with minimal effort. By simply sharing their wallet address or scanning a QR code, users can receive funds directly into their NECTARFI wallet, where they will be converted into the stablecoin of their choice (e.g., USDT, USDC, or DAI).</p><p>The platform ensures that receiving stablecoins is as seamless as possible, making it an ideal solution for freelancers, small businesses, and individuals who rely on digital transactions. This is especially important in regions where people are turning to cryptocurrencies as a more stable alternative to their national currencies, which may suffer from high inflation or other economic challenges.</p><p>2. Saving with Stablecoins:<br> NECTARFI provides a solution for users who wish to save their funds securely. Unlike traditional savings accounts, which often offer low interest rates and are subject to inflation, stablecoins can be stored on the platform with the added benefit of passive income through yield-bearing opportunities.</p><p>Users can save their stablecoins within the NECTARFI ecosystem and participate in decentralized finance (DeFi) protocols without needing a deep understanding of how DeFi works. NECTARFI integrates with lending platforms and liquidity pools that offer competitive rates for users to earn rewards on their savings. These options provide a practical solution for individuals looking to preserve their wealth while simultaneously growing it in a decentralized, low-risk environment.</p><p>Additionally, for those in emerging markets with limited access to traditional savings accounts, NECTARFI offers a unique opportunity to engage in a savings system that does not rely on banks or intermediaries, making it a more inclusive financial solution.</p><p>3. Spending Stablecoins:<br> NECTARFI also enables users to spend their stablecoins in real-world transactions, bridging the gap between the digital and physical economies. Whether shopping online or paying for everyday services, NECTARFI simplifies the process of spending stablecoins.</p><p>The platform’s partnership with merchants and service providers allows users to spend their stablecoins in exchange for goods and services, both online and offline. NECTARFI ensures that the process of converting digital assets into real-world value is seamless and convenient. This feature is crucial for individuals who want to use their stablecoins as part of their everyday lives, such as paying bills, purchasing groceries, or even supporting family members abroad with remittances.</p><p>The integration of stablecoins with merchant services also facilitates cross-border payments without the high fees typically associated with remittance services. Users can easily send stablecoins to family members in other countries, knowing that the funds will arrive quickly and securely without the need for expensive intermediaries.</p><p>4. Security and Privacy:<br> With the rise of digital financial solutions, security is always a major concern. NECTARFI places a strong emphasis on user security, utilizing advanced cryptographic methods and blockchain technology to protect users’ assets. By integrating multi-signature wallets, biometric authentication, and encryption, NECTARFI ensures that user funds are safe from theft and fraud.</p><p>As a decentralized platform, NECTARFI also adheres to the core principles of blockchain: transparency, immutability, and security. All transactions made on the platform are recorded on the blockchain, providing users with a transparent and verifiable record of their financial activities. Moreover, NECTARFI does not store sensitive user data on centralized servers, ensuring that personal information remains private and secure.</p><p><strong>User Experience: The NECTARFI Platform</strong></p><p>The NECTARFI platform has been designed to be as simple and intuitive as possible. Whether you’re a novice or an experienced crypto user, the interface is easy to navigate, making it possible for anyone to get started. Upon logging in, users are presented with a clean dashboard that shows their balance, recent transactions, and available services.</p><p>For beginners, NECTARFI includes a comprehensive onboarding guide that walks users through the entire process of setting up their wallet, receiving stablecoins, saving them, and using them for transactions. This guide helps eliminate the technical barriers that often prevent new users from engaging with decentralized finance.</p><p>For more experienced users, NECTARFI offers advanced features such as smart contract integrations, staking options, and access to DeFi protocols. These features are designed with simplicity in mind, allowing users to participate in DeFi markets without the need to manually interact with complex smart contracts or decentralized exchanges.</p><p>By prioritizing a straightforward user experience, NECTARFI ensures that users from all backgrounds — regardless of their technical know-how — can comfortably navigate the platform.</p><p><strong>Global Reach and Impact</strong></p><p>While NECTARFI was initially developed with emerging markets in mind, its user-friendly interface, security features, and low barrier to entry make it a viable platform for anyone interested in using stablecoins. The platform’s ability to bridge the gap between decentralized finance and traditional financial services makes it ideal for regions that have been underserved by banks.</p><p>Financial inclusion is one of the most pressing issues facing the global economy today, and NECTARFI’s innovative approach to simplifying access to stablecoins helps ensure that individuals in developing countries have the tools they need to participate in the digital economy. In countries where traditional banks are scarce or inefficient, NECTARFI provides a reliable alternative for securely saving and spending money, fostering greater economic participation.</p><p><strong>The Future of NECTARFI and DeFi</strong></p><p>Looking to the future, NECTARFI aims to expand its features and offerings, continuing to adapt to the needs of its growing user base. With the DeFi space constantly evolving, NECTARFI will continue to integrate with new decentralized finance protocols and add additional stablecoin assets to give users more flexibility in managing their funds.</p><p>By providing a stable and simple interface for users to engage with stablecoins, NECTARFI is well-positioned to become a major player in the decentralized finance movement. As more individuals from emerging markets begin to see the value in stablecoins and decentralized financial tools, NECTARFI’s influence is expected to grow, helping users worldwide take control of their financial futures.</p><h4>Conclusion</h4><p>NECTARFI is revolutionizing the way people receive, save, and spend stablecoins. By simplifying the process of engaging with decentralized finance, NECTARFI is helping individuals in emerging markets navigate the complexities of cryptocurrency and blockchain. Whether used for savings, payments, or remittances, NECTARFI offers a secure and user-friendly platform that brings the benefits of blockchain to everyone, regardless of their technical expertise.</p><p>Through its focus on simplicity, security, and financial inclusion, NECTARFI is setting the stage for a more inclusive, decentralized financial system that empowers people to take control of their financial lives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1dd36b4d85d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extended Perpetuals Deep Dive: StarkNet’s Next-Gen Perps Protocol]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/extended-perpetuals-deep-dive-starknets-next-gen-perps-protocol-d2bae4370aa8?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2bae4370aa8</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 06:59:59 GMT</pubDate>
            <atom:updated>2025-07-24T07:11:25.845Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5-E0Cah1mAbDz1Hv4m_Ug.jpeg" /></figure><h3>Introduction</h3><p>Perpetual futures (“perps”) dominate DeFi trading volume, but existing solutions face trade-offs between decentralization, scalability, and user experience. Extended, originally built on StarkEx, is migrating to public StarkNet, positioning itself as a high-performance, low-fee perpetuals exchange with deep liquidity and novel features.</p><p>This deep dive explores:</p><ul><li>Why Extended is moving to StarkNet and the benefits for traders.</li><li>Key differentiators vs. dYdX, GMX, and Hyperliquid.</li><li>Roadmap &amp; future products (e.g., cross-margin, composability).</li><li>Team &amp; backers (StarkWare affiliation, funding).</li><li>Growth metrics &amp; adoption drivers.</li><li>Risks &amp; opportunities in StarkNet’s evolving ecosystem.</li></ul><h3>Why Extended is Migrating to Public StarkNet</h3><ol><li><strong>From StarkEx (Private) → StarkNet (Public)</strong></li></ol><ul><li>StarkEx (used by dYdX v3) offers high throughput but is application-specific (limited composability).</li><li>StarkNet is a general-purpose ZK-rollup, enabling:</li></ul><p>✅ Native DeFi integrations (lending, options, NFT perps).<br>✅ Permissionless innovation (anyone can build on top).<br>✅ Lower fees at scale (shared sequencer efficiency).</p><p>2. Benefits for Traders</p><p>✅ Cheaper trades (vs. Ethereum L1 or even Arbitrum/Optimism).<br>✅ Better liquidity (cross-protocol composability).<br>✅ Self-custody (non-custodial, unlike CEX perps).</p><h3>Extended vs. Competitors: How It Stacks Up</h3><p><a href="https://hackmd.io/@wScw-5_uTpmnJaHwkzunXg/r1q1u8yDex">Extended Comparison - HackMD</a></p><p>Key Takeaway: Extended combines low fees, high leverage, and StarkNet’s composability, making it a strong contender against incumbents.</p><h3>Extended’s Product Suite &amp; Roadmap</h3><p><strong>Current Offerings</strong></p><ul><li>Perpetual swaps (BTC, ETH, major altcoins).</li><li>Low-latency trading (StarkNet’s sequencer advantage).</li><li>Self-custodial wallets (Argent, Braavos support).</li></ul><p><strong>Upcoming Features (2024–2025)</strong></p><ul><li>Cross-margin trading (capital efficiency).</li><li>Isolated markets (exotic perps, e.g., NFTs, memecoins).</li><li>LP incentives (liquidity mining programs).</li><li>StarkNet-native integrations (e.g., lending protocols).</li></ul><h3>Team &amp; Backers</h3><ul><li>Built by StarkWare alumni, leveraging deep expertise in ZK-proofs.</li><li>Backed by StarkNet ecosystem grants (potential airdrop?).</li><li>Advisors from top trading firms (suggesting institutional interest).</li></ul><h3>Growth Metrics &amp; Adoption Drivers</h3><ul><li>TVL: Early but growing (watch for liquidity mining launch).</li><li>Volume: Expected to rise as StarkNet activity increases.</li><li>Key Catalysts:</li></ul><p>✅ StarkNet’s “Quantum Leap” upgrade (lower latency).</p><p>✅ More bridges (e.g., native USDC).</p><p>✅ Institutional onboarding (if compliance features added).</p><h3>Risks &amp; Challenges</h3><p>1. StarkNet Adoption Risk<br><em>If StarkNet fails to attract users, Extended’s growth stalls.</em></p><p>2. Competition from dYdX v4<br><em>dYdX’s Cosmos move could fragment liquidity.</em></p><p>3. Smart Contract Risk<br><em>New codebase → needs rigorous audits.</em></p><p>4. Regulatory Uncertainty<br><em>Perps face scrutiny (e.g., CFTC lawsuits).</em></p><h3>Opportunities</h3><p>✅ First-mover advantage on StarkNet.<br>✅ Composability (e.g., collateralized perps via lending protocols).<br>✅ Potential token launch (liquidity incentives).</p><h3>Tokenomics (Speculative)</h3><p><em>If Extended launches a token, expect:</em></p><ul><li>Governance (fee adjustments, listings).</li><li>Fee sharing (staking rewards).</li><li>Liquidity mining (boost TVL).</li></ul><h3>Conclusion: Why Extended Could Win</h3><p>Extended’s migration to StarkNet unlocks:<br>✔ Cheaper, faster trades than Ethereum L1 or even dYdX.<br>✔ Deep DeFi integrations (unlike isolated competitors).<br>✔ High leverage + Central Limit Order Book (CLOB) liquidity (unlike AMM-based GMX).</p><p>Final Verdict: If StarkNet grows, Extended could become a top-3 perps DEX.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2bae4370aa8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Dive into Ekubo AMM: A Next-Generation DEX on Starknet]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/deep-dive-into-ekubo-amm-a-next-generation-dex-on-starknet-06ed971f4237?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/06ed971f4237</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Wed, 23 Jul 2025 22:28:25 GMT</pubDate>
            <atom:updated>2025-07-23T22:28:25.839Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*w2v7BQlwgIxDUBdYuPwulw.png" /></figure><p>The foundation of DeFi is made up of decentralized exchanges (DEXs), which facilitate price discovery, liquidity provisioning, and permissionless trading. But scalability, capital efficiency, and flexibility are issues for traditional Automated Market Makers (AMMs) like Uniswap, especially in new L2 ecosystems like Starknet.</p><p>Built on top of Starknet, Ekubo is a next-generation AMM that aims to overcome these constraints by utilizing Starknet’s low fees and fast throughput while incorporating cutting-edge features like permissionless pool creation, gas-efficient swaps, and focused liquidity.</p><p><strong>This in-depth investigation looks at:</strong></p><ul><li>The issues that Ekubo seeks to resolve</li><li>Important growth indicators and factors influencing adoption</li><li>Advantages over Uniswap and other AMMs</li><li>Team and supporters</li><li>Opportunities and hazards</li><li>Tokenomics, if relevant</li></ul><p>Ekubo Resolves Issues 1. Gas Efficiency &amp; Scalability<br> Compared to Ethereum L1, Starknet’s ZK-rollup architecture allows for less expensive transactions. Ekubo takes advantage of this by streamlining swap execution and cutting down on gas expenses for LPs and traders.</p><p>2. Concentrated Liquidity (on Starknet, similar to Uniswap v3)<br> Ekubo improves capital efficiency and decreases slippage by enabling liquidity providers (LPs) to concentrate capital within specific price ranges, in contrast to conventional AMMs (such as Uniswap v2).</p><p>3. Creation of Permissionless Pools<br> Ekubo promotes quicker innovation and the development of specialized markets by allowing anyone to implement new trading pairs without obtaining governance clearance.</p><p>4. Resistance to MEV<br> A significant problem with Ethereum L1 is front-running, which is lessened by Starknet’s sequencer. Ekubo efficiently batches transactions to further reduce MEV.</p><p><strong>Ekubo vs. Competitors: How Does It Stack Up?</strong></p><p><a href="https://hackmd.io/@wScw-5_uTpmnJaHwkzunXg/BkkB2R0Ixg">Ekubo Comparison - HackMD</a></p><p><strong>Growth Indicators and Adoption Factors</strong><br><em>Even though Ekubo is relatively new, adoption may be influenced by a number of factors:</em></p><ul><li>The growing ecology of Starknet (e.g., forthcoming dApps, gaming initiatives).</li><li>Programs for incentive liquidity (should Ekubo launch a token).</li><li>Connectivity to Starknet wallets (Argent, Braavos).</li><li>less expensive than Ethereum L1 and even other L2s.</li></ul><p><em>Current stats (as of latest data):</em></p><ul><li>TVL: Growing but still in its infancy (exact figures to be determined).</li><li>As more people join Starknet, the trading volume is probably going to rise.</li><li>Unique pools: Experimentation is encouraged by the permissionless concept.</li></ul><p><strong>Team and Supporters:</strong></p><p>Nethermind, a top blockchain engineering company renowned for its work on Ethereum clients and Starknet technology, is the developer of Ekubo. Ekubo has a solid technical base thanks to Nethermind’s proficiency in scaling solutions.</p><p><em>Possible supporters:</em></p><ul><li>The Starknet Foundation provides indirect assistance through ecological grants.</li><li>Current partners of Nethermind, such as the Ethereum Foundation.</li></ul><p><strong>Hazards and Difficulties</strong></p><p>1. Adoption Risk of Starknet:<br> Ekubo’s expansion may halt if Starknet is unable to draw users.</p><p>2. Uniswap v3 may eventually deploy on Starknet, posing a danger due to competition from established AMMs.</p><p>3. Risk of Smart Contracts:<br> Since Ekubo is a new procedure, it must pass stringent audits.</p><p>4. Uncertainty in Tokenomics:<br> There isn’t an official token yet, but it might affect liquidity incentives.</p><p><strong>Possible Possibilities</strong></p><ul><li>Advantage of being the first to market as a concentrated liquidity AMMon Starknet.</li><li>Collaborations with Starknet DeFi (e.g., NFT marketplaces, lending protocols).</li><li>A possible token launch or airdrop to raise money.</li></ul><p><strong>Tokenomics (Conjectural)</strong></p><p><em>Ekubo may use models such as these if it introduces a token:</em></p><ul><li>UNI (Uniswap): Fee-sharing plus governance.</li><li>CRV (Curve): Vote-escrowed rewards, or Ve-tokenomics.</li></ul><p><strong>Potential distribution</strong></p><ul><li>Rewards for liquidity mining</li><li>Allocations of developers and teams</li><li>Treasury of the community</li></ul><p><strong>Conclusion: The Significance of Ekubo</strong></p><p>By combining: <br> ✔ Uniswap v3-level capital efficiency <br> ✔ Starknet’s scalability advantages, Ekubo is positioned to become the top AMM on Starknet.<br> ✔ Innovation without permission</p><p>Even if there are challenges (such as competition and adoption), Ekubo’s technological underpinnings and Starknet’s projected expansion make it an interesting project to follow.</p><p>Final Verdict:: If Starknet’s ecosystem grows, it has a high chance of ranking among the top three AMMs in the L2 landscape.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06ed971f4237" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starknet Cairo Cross Contract Interaction]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/starknet-cairo-cross-contract-interaction-7808fc61c4a3?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7808fc61c4a3</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Sat, 14 Dec 2024 18:27:14 GMT</pubDate>
            <atom:updated>2024-12-14T18:27:14.705Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdCwPwP0JEYDOV0ctIT6uw.jpeg" /></figure><p>In StarkNet and Cairo, cross-contract interactions allow one contract to call functions from another deployed contract. This is a crucial part of building decentralized applications (dApps) that rely on modular, composable smart contract architectures. In this article we would implement and understand cross-contract interactions on StarkNet using Cairo. For the case would use a Vault contract and an ERC20 contract. The Vault contract is a contract that performs 3 basic things, deposit fund, withdraw funds and check balance of the vault.</p><p><strong>Here is the basic ERC20.</strong></p><pre>use core::starknet::ContractAddress;<br><br>#[starknet::interface]<br>pub trait IERC20&lt;TContractState&gt; {<br>    fn get_name(self: @TContractState) -&gt; ByteArray;<br>    fn get_symbol(self: @TContractState) -&gt; ByteArray;<br>    fn get_decimals(self: @TContractState) -&gt; u8;<br>    fn get_total_supply(self: @TContractState) -&gt; u256;<br>    fn balance_of(self: @TContractState, account: ContractAddress) -&gt; u256;<br>    fn allowance(self: @TContractState, owner: ContractAddress, spender: ContractAddress) -&gt; u256;<br>    fn transfer(ref self: TContractState, recipient: ContractAddress, amount: u256);<br>    fn transfer_from(<br>        ref self: TContractState, sender: ContractAddress, recipient: ContractAddress, amount: u256<br>    );<br>    fn approve(ref self: TContractState, spender: ContractAddress, amount: u256);<br>    fn increase_allowance(ref self: TContractState, spender: ContractAddress, added_value: u256);<br>    fn decrease_allowance(<br>        ref self: TContractState, spender: ContractAddress, subtracted_value: u256<br>    );<br>    fn mint(ref self: TContractState, account: ContractAddress, amount: u256);<br>}<br><br>#[starknet::contract]<br>pub mod ERC20 {<br>    use starknet::event::EventEmitter;<br>    use super::IERC20;<br>    use super::ContractAddress;<br>    use starknet::storage::{Map, StorageMapReadAccess, StorageMapWriteAccess};<br>    const TOTAL_SUPPLY: u256 = 100_000_000;<br>    const DECIMALS: u8 = 18;<br>    #[storage]<br>    struct Storage {<br>        //name of the token<br>        name: ByteArray,<br>        //token symbol<br>        symbol: ByteArray,<br>        //token decimals e.g 18<br>        decimals: u8,<br>        //token max supply<br>        total_supply: u256,<br>        //balances of each user<br>        balances: Map::&lt;ContractAddress, u256&gt;,<br>        // allownaces for third party contracts<br>        allowances: Map::&lt;(ContractAddress, ContractAddress), u256&gt;,<br>    }<br>    #[constructor]<br>    fn constructor(ref self: ContractState, name: ByteArray, symbol: ByteArray) {<br>        self.name.write(name);<br>        self.symbol.write(symbol);<br>        self.total_supply.write(TOTAL_SUPPLY);<br>        self.decimals.write(DECIMALS);<br>    }<br>    #[event]<br>    #[derive(Drop, starknet::Event)]<br>    pub enum Event {<br>        Transfer: Transfer,<br>        Approval: Approval,<br>    }<br>    #[derive(Drop, starknet::Event)]<br>    pub struct Transfer {<br>        pub from: ContractAddress,<br>        pub to: ContractAddress,<br>        pub value: u256,<br>    }<br>    #[derive(Drop, starknet::Event)]<br>    pub struct Approval {<br>        pub owner: ContractAddress,<br>        pub spender: ContractAddress,<br>        pub value: u256,<br>    }<br>    #[external(v0)]<br>    impl ERC20IMPL of super::IERC20&lt;ContractState&gt; {<br>        // create token for testing<br>        fn mint(ref self: ContractState, account: ContractAddress, amount: u256) {<br>            self.balances.write(account, amount)<br>        }<br>        //get the name of the contract<br>        fn get_name(self: @ContractState) -&gt; ByteArray {<br>            self.name.read()<br>        }<br>        //get the symbol of the contract<br>        fn get_symbol(self: @ContractState) -&gt; ByteArray {<br>            self.symbol.read()<br>        }<br>        //get the decimals<br>        fn get_decimals(self: @ContractState) -&gt; u8 {<br>            self.decimals.read()<br>        }<br>        //get the max/total supply<br>        fn get_total_supply(self: @ContractState) -&gt; u256 {<br>            self.total_supply.read()<br>        }<br>        // get the balance of a contract<br>        fn balance_of(self: @ContractState, account: ContractAddress) -&gt; u256 {<br>            self.balances.read(account)<br>        }<br><br>        //transfer a token to a recipient<br>        fn transfer(ref self: ContractState, recipient: ContractAddress, amount: u256) {<br>            let sender = starknet::get_caller_address();<br>            self.transfer_from(sender, recipient, amount)<br>        }<br>        //transfer with two argument sender and recipient<br>        fn transfer_from(<br>            ref self: ContractState,<br>            sender: ContractAddress,<br>            recipient: ContractAddress,<br>            amount: u256<br>        ) {<br>            //get the address of the person calling the contract<br>            let caller = starknet::get_caller_address();<br><br>            let sender_balance = self.balances.read(sender);<br>            let recipient_balance = self.balances.read(recipient);<br>            assert!(sender_balance &gt;= amount, &quot;ERROR: INSUFFICIENT BALANCE&quot;);<br>            if (caller != sender) {<br>                assert!(self.allowances.read((sender, caller)) &gt;= amount, &quot;ERROR: UNAUTHORISED&quot;);<br>            }<br>            self.balances.write(sender, sender_balance - amount);<br>            self.balances.write(recipient, recipient_balance + amount);<br><br>            self.emit(Transfer { from: caller, to: recipient, value: amount });<br>        }<br><br>        // approve a contract to spend your token<br>        fn approve(ref self: ContractState, spender: ContractAddress, amount: u256) {<br>            let caller = starknet::get_caller_address();<br>            let allowed_person = (caller, spender);<br>            let previous_allowance = self.allowances.read(allowed_person);<br>            self.allowances.write(allowed_person, previous_allowance + amount);<br>            self.emit(Approval { owner: caller, spender, value: amount });<br>        }<br><br>        //Increases the allowance<br>        fn increase_allowance(<br>            ref self: ContractState, spender: ContractAddress, added_value: u256<br>        ) {<br>            let caller = starknet::get_caller_address();<br>            let allowed_person = (caller, spender);<br>            let previous_allowance = self.allowances.read(allowed_person);<br>            self.allowances.write(allowed_person, previous_allowance + added_value);<br>            self.emit(Approval { owner: caller, spender, value: added_value });<br>        }<br>        //reduces the allowance<br>        fn decrease_allowance(<br>            ref self: ContractState, spender: ContractAddress, subtracted_value: u256<br>        ) {<br>            let caller = starknet::get_caller_address();<br>            let allowed_person = (caller, spender);<br>            let previous_allowance = self.allowances.read(allowed_person);<br>            self.allowances.write(allowed_person, previous_allowance - subtracted_value);<br>            self.emit(Approval { owner: caller, spender, value: subtracted_value });<br>        }<br>        //gets the amount a third party contract is allowed to spend<br>        fn allowance(<br>            self: @ContractState, owner: ContractAddress, spender: ContractAddress<br>        ) -&gt; u256 {<br>            self.allowances.read((owner, spender))<br>        }<br>    }<br>}</pre><p><strong>Here is the Vault contract. This contract is broken down line by line how the Vault contract interacts with the ERC20 contract.</strong></p><pre>// Cross contract interactions. This is a basic cross contract interaction.<br>// The Vault contract accessing the erc20 contract.<br>// The Vault contract makes use of the functions of the erc20 contract<br><br>// import ContractAddress module<br>use core::starknet::ContractAddress;<br><br>// interface of Vault Contracts<br>#[starknet::interface]<br>pub trait IVault&lt;TContractState&gt; {<br>    fn deposit(<br>        ref self: TContractState, token_address: ContractAddress, amount: u256<br>    ); // for fund deposit <br>    fn withdraw(<br>        ref self: TContractState, token_address: ContractAddress, amount: u256<br>    ); // for fund withdrawal<br>    fn balance(<br>        self: @TContractState, token_address: ContractAddress, amount: u256<br>    ) -&gt; u256; // check account balance<br>}<br><br>// Vault Contract<br>#[starknet::contract]<br>pub mod Vault {<br>    // import Vault Interface<br>    use super::IVault;<br>    // import ERC20 module, ERC20 Dispatcher &amp; ERc20 DispatcherTrait for CROSS CONTRACT INTERACTION<br>    use super::erc20::{IERC20Dispatcher, IERC20DispatcherTrait};<br>    // import ContractAddress module, get caller address module &amp; <br>    // Mapping module for reading and writing to storage<br>    use core::starknet::{<br>        ContractAddress, get_caller_address,<br>        storage::{Map, StorageMapReadAccess, StorageMapWriteAccess}<br>    };<br><br>    // map user address, token address to an ammount<br>    #[storage]<br>    struct Storage {<br>        balance: Map&lt;(ContractAddress, ContractAddress), u256&gt;,<br>    }<br><br>    #[event]<br>    #[derive(Drop, starknet::Event)]<br>    enum Event {}<br><br>    #[abi(embed_v0)]<br>    // implement the interface<br>    impl VaultImpl of IVault&lt;ContractState&gt; {<br>        // this function deposites funds into the vault<br>        fn deposit(ref self: ContractState, token_address: ContractAddress, amount: u256) {<br>            //get caller of the contract<br>            let caller = get_caller_address();<br>            // connect to erc20<br>            let token_dispatcher = IERC20Dispatcher {<br>                contract_address: token_address // accessing the ERC20 interfaces<br>            };<br>            // Check if amount is greater than zero<br>            assert(amount &gt; 0, &#39;amount should be more than zero&#39;);<br>            // transfer funds from the caller &amp; amount of funds to be transferred<br>            token_dispatcher.transfer(caller, amount);<br>            // get current balance in the vault<br>            let current_balance = self.balance.read((caller, token_address));<br>            // write the balance to the storage (state)<br>            // ie mapping the caller address and token address to an amount<br>            self.balance.write((caller, token_address), current_balance + amount);<br>        }<br><br>        // this function withdraws funds from the vault<br>        fn withdraw(ref self: ContractState, token_address: ContractAddress, amount: u256) {<br>            let caller = get_caller_address(); // get the caller (owner) of the contract<br>            // connect to erc20<br>            let erc20_dispatcher = IERC20Dispatcher {<br>                contract_address: token_address // accessing the ERC20 interfaces<br>            };<br>            // caller withdraws an amount of token from the vault<br>            erc20_dispatcher.transfer(caller, amount);<br>            // check the current balance in the vault<br>            let current_balance = self.balance.read((caller, token_address));<br>            // write the balance to the storage (state)<br>            // ie mapping the caller address and token address to an amount<br>            self.balance.write((caller, token_address), current_balance - amount);<br>        }<br><br>        // this function get the balance of the vault<br>        fn balance(self: @ContractState, token_address: ContractAddress, amount: u256) -&gt; u256 {<br>            // gets the caller contract address<br>            let caller = get_caller_address();<br>            // gets the current balance of the vault<br>            self.balance.read((caller, token_address))<br>        }<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7808fc61c4a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing openzeppelin components in Starknet Cairo contracts: A Beginners Giude]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/implementing-openzeppelin-components-in-starknet-cairo-contracts-a-beginners-giude-4a5517e3bd32?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a5517e3bd32</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Sat, 14 Dec 2024 10:01:32 GMT</pubDate>
            <atom:updated>2024-12-14T10:01:32.579Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdCwPwP0JEYDOV0ctIT6uw.jpeg" /></figure><p>OpenZeppelin is a well-established library in the blockchain space, known for its battle-tested smart contract components. With the rise of Starknet, a ZK-rollup layer 2 solution built on Cairo, OpenZeppelin has extended its offerings to support this emerging ecosystem. OpenZeppelin components for Starknet enable developers to write secure and modular Cairo contracts, paving the way for efficient and scalable decentralized applications (dApps).</p><p><strong>Why OpenZeppelin for Starknet?</strong><br>- Modularity: Reusable building blocks for common functionalities.<br>- Security: Pre-audited components to reduce vulnerabilities.<br>- Productivity: Faster development cycles with ready-to-use modules.</p><p>In this article we would implement the openzeppelin Ownable and ERC20 component in a smart contract. First I create a folder, openzeppelin_implementation and cd into that folder. Open the folder in a terminal. I run scarb init on the terminal. Then open the folder in VS Code. <br>Go to the scarb.toml file, under [dependencies] paste:<br>openzeppelin = { git = “<a href="https://github.com/OpenZeppelin/cairo-contracts.git">https://github.com/OpenZeppelin/cairo-contracts.git</a>&quot;, tag = “v0.17.0” }<br>Create a file gida_token.cairo and add the module to the lib.cairo</p><pre><br><br>#[starknet::interface] // interface of GidaToken<br>pub trait IGidaToken&lt;TContractState&gt; {<br>    fn mint(ref self: TContractState, amount: u256);<br>}<br><br>#[starknet::contract]<br>pub mod GidaToken {<br>    use super::IGidaToken; // import the interface<br>    use openzeppelin::access::ownable::OwnableComponent; // import ownable component<br>    use openzeppelin::token::erc20::{ERC20HooksEmptyImpl, ERC20Component}; // import erc20 component<br>    use starknet::{ContractAddress, get_caller_address}; // import module for contract address<br>    use core::num::traits::Zero; // import module for working with is_Zero()<br><br>    component!(<br>        path: ERC20Component, storage: erc20, event: ERC20Event<br>    ); // erc20 component path macro<br>    component!(<br>        path: OwnableComponent, storage: ownable, event: OwnableEvent<br>    ); // ownable component path macro<br><br>    // mixin for internal implementation for ERC20<br>    #[abi(embed_v0)]<br>    impl ERC20MixinImpl = ERC20Component::ERC20MixinImpl&lt;ContractState&gt;;<br>    impl ERC20InternalImpl = ERC20Component::InternalImpl&lt;ContractState&gt;;<br>    // mixin for internal implementation for Ownable<br>    #[abi(embed_v0)]<br>    impl OwnableMixinImpl = OwnableComponent::OwnableMixinImpl&lt;ContractState&gt;;<br>    impl OwnableInternalImpl = OwnableComponent::InternalImpl&lt;ContractState&gt;;<br><br>    // custom errors<br>    pub mod Errors {<br>        pub const NOT_OWNER: felt252 = &#39;Caller is not the owner&#39;;<br>        pub const ZERO_ADDRESS_CALLER: felt252 = &#39;Caller is the zero address&#39;;<br>    }<br><br>    // component interaction with contract storage<br>    #[storage]<br>    struct Storage {<br>        owner: ContractAddress,<br>        #[substorage(v0)]<br>        erc20: ERC20Component::Storage, // ERC20 storage<br>        #[substorage(v0)]<br>        ownable: OwnableComponent::Storage, // Ownable storage<br>    }<br><br>    // component interaction with contract event<br>    #[event]<br>    #[derive(Drop, starknet::Event)]<br>    enum Event {<br>        #[flat]<br>        ERC20Event: ERC20Component::Event, // ERC20 events<br>        #[flat]<br>        OwnableEvent: OwnableComponent::Event, // Ownable events<br>    }<br><br>    #[constructor]<br>    fn constructor(ref self: ContractState, owner: ContractAddress) {<br>        // the token is been initialized: token name: GIDA_TOKEN, token symbol: GIDA<br>        self.erc20.initializer(&quot;GidaToken&quot;, &quot;GIDA&quot;);<br>        // the owner is been initialized as owner<br>        self.ownable.initializer(owner); // initializer function is the component internal function<br>    }<br><br>    #[abi(embed_v0)]<br>    // implement the GidaToken interface<br>    impl GidaTokenImpl of IGidaToken&lt;ContractState&gt; {<br>        fn mint(ref self: ContractState, amount: u256){<br>            // get the caller address<br>            let caller: ContractAddress = get_caller_address(); <br>            // get the owner address<br>            let owner: ContractAddress = self.owner.read();<br>            // check caller is NOT zero address<br>            assert(!caller.is_zero(), Errors::ZERO_ADDRESS_CALLER);<br>            // confirm caller is owner<br>            assert(caller == owner, Errors::NOT_OWNER);<br>            // mint some token amount to the owner.<br>            // the openzeppelin mint function is implemented<br>            self.erc20.mint(owner, amount);<br>        }<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a5517e3bd32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Starknet Cairo Components in a Contract: A beginners Guide]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/implementing-starknet-cairo-components-in-a-contract-a-beginners-guide-d768889a8f9c?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d768889a8f9c</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Fri, 06 Dec 2024 19:26:28 GMT</pubDate>
            <atom:updated>2024-12-06T19:28:27.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdCwPwP0JEYDOV0ctIT6uw.jpeg" /></figure><p>In this article we look at how components can be used in a contracts. This article is a follow up of my former article, Starknet Cairo Components: A beginners Guide, <a href="https://medium.com/@emma.onyedika.okeke/starknet-cairo-components-a-beginners-guide-162aedf97003">https://medium.com/@emma.onyedika.okeke/starknet-cairo-components-a-beginners-guide-162aedf97003</a><br>I would write two programs, the first is an ownable contract and the second is an ownable_counter contract. In the ownable_counter i dive deep showing how the ownable contract is been implemented the contract.</p><p><strong>We first have to understand what are Starknet Cairo Components?</strong><br>Starknet Cairo components provide a powerful way to create modular, reusable building blocks that can enhance contract functionality across different projects.</p><p><strong>An ownable component</strong><br>This Ownable component implements a simple ownership system that can be embedded into other contracts. Here’s the ownable component:</p><pre>use core::starknet::{ContractAddress, get_caller_address};<br><br>#[starknet::interface]<br>pub trait IOwnable&lt;TContractState&gt; {<br>    fn transfer_ownership(ref self: TContractState, new_owner: ContractAddress);<br>    fn owner(self: @TContractState) -&gt; ContractAddress;<br>    fn renounce_ownership(ref self: TContractState);<br>}<br><br>// Error messages<br>pub mod Errors {<br>    pub const ZERO_ADDRESS_OWNER: felt252 = &#39;Owner cannot be address zero&#39;;<br>    pub const ZERO_ADDRESS_CALLER: felt252 = &#39;Caller cannot be address zero&#39;;<br>    pub const NOT_OWNER: felt252 = &#39;Caller not owner&#39;;<br>}<br><br>#[starknet::component] // use this attribute to decorate a component<br>pub mod ownable_component {<br>    use super::IOwnable;<br>    use super::{<br>        ContractAddress, get_caller_address<br>    }; // import contract address &amp; caller address modules<br>    use core::num::traits::Zero; // import modules for working with is.zero()<br>    use super::Errors;<br><br>    #[storage] // storage stores the owner<br>    struct Storage {<br>        owner: ContractAddress,<br>    }<br><br>    #[event] // event that would emit ownership has been transferred<br>    #[derive(Drop, starknet::Event)]<br>    pub enum Event {<br>        OwnershipTransferred: OwnershipTransferred,<br>    }<br><br>    #[derive(Drop, starknet::Event)]<br>    struct OwnershipTransferred { // ownerShipTransferred struct<br>        previous_owner: ContractAddress,<br>        new_owner: ContractAddress<br>    }<br><br>    // Ownable Implementation. External interaction of the component<br>    // This makes it publically accessible to external contracts<br>    #[embeddable_as(Ownable)]<br>    impl OwnableImpl&lt;<br>        TContractState, +HasComponent&lt;TContractState&gt;<br>    &gt; of super::IOwnable&lt;ComponentState&lt;TContractState&gt;&gt; {<br>        // This function reads the state to get the owner<br>        fn owner(self: @ComponentState&lt;TContractState&gt;) -&gt; ContractAddress {<br>            self.owner.read()<br>        }<br>        // This transfers ownership from previous owner to a new owner.<br>        fn transfer_ownership(<br>            ref self: ComponentState&lt;TContractState&gt;, new_owner: ContractAddress<br>        ) {<br>            assert(<br>                !new_owner.is_zero(), Errors::ZERO_ADDRESS_CALLER<br>            ); // ensure new owner is NOT address zero<br>            self.assert_only_owner(); // implementing internal function, assert_only_owner<br>            self<br>                ._transfer_ownership(<br>                    new_owner<br>                ); // implemting the internal function, _transfer_ownership<br>        }<br>        fn renounce_ownership(ref self: ComponentState&lt;TContractState&gt;) {<br>            self.assert_only_owner(); // implementing internal function, assert_only_owner<br>            self<br>                ._transfer_ownership(<br>                    Zero::zero()<br>                ); // implementing the internal function, _transfer_ownership<br>        }<br>    }<br><br>    // This is for the internal implementation of the component<br>    #[generate_trait]<br>    pub impl InternalImpl&lt;<br>        TContractState, +HasComponent&lt;TContractState&gt;<br>    &gt; of InternalTrait&lt;TContractState&gt; {<br>        // sets the initial owner<br>        fn initializer(ref self: ComponentState&lt;TContractState&gt;, owner: ContractAddress) {<br>            self._transfer_ownership(owner);<br>        }<br>        // the function transfers ownership from previous owner to new owner<br>        fn _transfer_ownership(<br>            ref self: ComponentState&lt;TContractState&gt;, new_owner: ContractAddress<br>        ) {<br>            let previous_owner: ContractAddress = self.owner.read(); // get the previous owner<br>            self.owner.write(new_owner); // writes the new owner to the state<br>            self<br>                .emit(<br>                    OwnershipTransferred { previous_owner: previous_owner, new_owner: new_owner }<br>                ); //emits OwnershipTransferred events<br>        }<br>        // this function strictly ensures that ony the owner has rights<br>        fn assert_only_owner(self: @ComponentState&lt;TContractState&gt;) {<br>            let owner: ContractAddress = self.owner.read(); // get owner contract address<br>            let caller: ContractAddress = starknet::get_caller_address(); // gets caller address<br>            assert(caller == owner, Errors::NOT_OWNER); //ensures caller is the owner<br>            assert(<br>                !caller.is_zero(), Errors::ZERO_ADDRESS_OWNER<br>            ); // ensures caller is not address zero<br>        }<br>    }<br>}</pre><p><strong>An ownable_counter contract</strong><br>This contract simply increases, decreases and checks balance of amount amount. We implement the ownable component in this contract.</p><pre>#[starknet::interface] // interface<br>pub trait IOwnableCounter&lt;TContractState&gt; {<br>    fn increment(ref self: TContractState, count: u256);<br>    fn decrement(ref self: TContractState, count: u256);<br>    fn get_count(self: @TContractState) -&gt; u256;<br>}<br><br>#[starknet::contract] // contract<br>pub mod OwnableCounter {<br>    use ownable_component::InternalTrait;<br>    use super::IOwnableCounter; // import the inteface<br>    use component_interaction::component::ownable_component; // import the component<br>    use core::starknet::ContractAddress; // import the contract address<br>    use core::starknet::storage::{<br>        StoragePointerReadAccess, StoragePointerWriteAccess<br>    }; // import storage modules: ead-only &amp; write-only access<br><br>    // component macro/function specifing the path, storage &amp; events.<br>    // This line is essential in creating a reusable piece of functionality within the contract.<br>    component!(path: ownable_component, storage: ownable, event: OwnableEvent);<br><br>    #[abi(embed_v0)] // instructs compiler how to generate the contract&#39;s interface<br>    // handles public-facing ownership operations<br>    impl OwnableImpl =<br>        ownable_component::Ownable&lt;ContractState&gt;;<br>    // deals with internal ownership checks and modifications.<br>    impl OwnableInternalImpl = ownable_component::InternalImpl&lt;ContractState&gt;;<br><br>    #[storage] // storage<br>    struct Storage {<br>        counter: u256,<br>        #[substorage(v0)]<br>        ownable: ownable_component::Storage, // ownable component in storage<br>    }<br><br>    #[event]<br>    #[derive(Drop, starknet::Event)]<br>    enum Event {<br>        OwnableEvent: ownable_component::Event, // ownable component in event<br>    }<br><br>    // owner: ContractAddress: This parameter represents the address of the owner when the contract<br>    // is deployed.<br>    #[constructor]<br>    fn constructor(ref self: ContractState, owner: ContractAddress) {<br>        // The constructor initializes the ownership of the contract with the specified owner.<br>        self.ownable.initializer(owner); // component&#39;s initializer function been implemented.<br>    }<br><br>    // Main functions of the contract<br>    #[abi(embed_v0)]<br>    impl OwnableCounterImpl of IOwnableCounter&lt;ContractState&gt; {<br>        fn increment(ref self: ContractState, count: u256) {<br>            self.ownable.assert_only_owner(); // component&#39;s assert_only function been implemented.<br>            let current_count: u256 = self.counter.read();<br>            self.counter.write(current_count + count);<br>        }<br>        fn decrement(ref self: ContractState, count: u256) {<br>            self.ownable.assert_only_owner(); // component&#39;s assert_only function been implemented.<br>            let current_count: u256 = self.counter.read();<br>            self.counter.write(current_count + count);<br>        }<br>        fn get_count(self: @ContractState) -&gt; u256 {<br>            self.counter.read()<br>        }<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d768889a8f9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starknet Cairo Components: A beginners Guide]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/starknet-cairo-components-a-beginners-guide-162aedf97003?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/162aedf97003</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Fri, 06 Dec 2024 13:55:42 GMT</pubDate>
            <atom:updated>2024-12-06T13:58:32.700Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdCwPwP0JEYDOV0ctIT6uw.jpeg" /></figure><p><strong>What are Starknet Cairo Components?</strong><br>Starknet Cairo components provide a powerful way to create modular, reusable building blocks that can enhance contract functionality across different projects.They allow developers to:</p><ul><li>Extend contract functionality without reimplementing common logic<br>- Create modular, Lego-like building blocks for smart contracts<br>- Reuse proven primitives across different contracts</li></ul><p>Components cannot be declared or deployed independently — their logic becomes part of the contract bytecode they’re embedded in. They contain storage, events, and functions similar to contracts. Components have an interface that defines external-facing methods accessible via the dispatcher pattern. They can depend on other components by restricting their generic parameters.</p><p>In this article we would dive deep and dissect a basic component. Lets look at a basic Ownable component. Ownable component implements a simple ownership system that can be embedded into other contracts. Here’s the ownable component:</p><pre>use core::starknet::{ContractAddress, get_caller_address};<br><br>#[starknet::interface]<br>pub trait IOwnable&lt;TContractState&gt; {<br>    fn transfer_ownership(ref self: TContractState, new_owner: ContractAddress);<br>    fn owner(self: @TContractState) -&gt; ContractAddress;<br>    fn renounce_ownership(ref self: TContractState);<br>}<br><br>// Error messages<br>pub mod Errors {<br>    pub const ZERO_ADDRESS_OWNER: felt252 = &#39;Owner cannot be address zero&#39;;<br>    pub const ZERO_ADDRESS_CALLER: felt252 = &#39;Caller cannot be address zero&#39;;<br>    pub const NOT_OWNER: felt252 = &#39;Caller not owner&#39;;<br>}<br><br>#[starknet::component] // use this attribute to decorate a component<br>pub mod ownable_component {<br>    use super::IOwnable;<br>    use super::{<br>        ContractAddress, get_caller_address<br>    }; // import contract address &amp; caller address modules<br>    use core::num::traits::Zero; // import modules for working with is.zero()<br>    use super::Errors;<br><br>    #[storage] // storage stores the owner<br>    struct Storage {<br>        owner: ContractAddress,<br>    }<br><br>    #[event] // event that would emit ownership has been transferred<br>    #[derive(Drop, starknet::Event)]<br>    pub enum Event {<br>        OwnershipTransferred: OwnershipTransferred,<br>    }<br><br>    #[derive(Drop, starknet::Event)]<br>    struct OwnershipTransferred { // ownerShipTransferred struct<br>        previous_owner: ContractAddress,<br>        new_owner: ContractAddress<br>    }<br><br>    // Ownable Implementation. External interaction of the component<br>    // This makes it publically accessible to external contracts<br>    #[embeddable_as(Ownable)]<br>    impl OwnableImpl&lt;<br>        TContractState, +HasComponent&lt;TContractState&gt;<br>    &gt; of super::IOwnable&lt;ComponentState&lt;TContractState&gt;&gt; {<br>        // This function reads the state to get the owner<br>        fn owner(self: @ComponentState&lt;TContractState&gt;) -&gt; ContractAddress {<br>            self.owner.read()<br>        }<br>        // This transfers ownership from previous owner to a new owner.<br>        fn transfer_ownership(<br>            ref self: ComponentState&lt;TContractState&gt;, new_owner: ContractAddress<br>        ) {<br>            assert(<br>                !new_owner.is_zero(), Errors::ZERO_ADDRESS_CALLER<br>            ); // ensure new owner is NOT address zero<br>            self.assert_only_owner(); // implementing internal function, assert_only_owner<br>            self<br>                ._transfer_ownership(<br>                    new_owner<br>                ); // implemting the internal function, _transfer_ownership<br>        }<br>        fn renounce_ownership(ref self: ComponentState&lt;TContractState&gt;) {<br>            self.assert_only_owner(); // implementing internal function, assert_only_owner<br>            self<br>                ._transfer_ownership(<br>                    Zero::zero()<br>                ); // implementing the internal function, _transfer_ownership<br>        }<br>    }<br><br>    // This is for the internal implementation of the component<br>    #[generate_trait]<br>    pub impl InternalImpl&lt;<br>        TContractState, +HasComponent&lt;TContractState&gt;<br>    &gt; of InternalTrait&lt;TContractState&gt; {<br>        // sets the initial owner<br>        fn initializer(ref self: ComponentState&lt;TContractState&gt;, owner: ContractAddress) {<br>            self._transfer_ownership(owner);<br>        }<br>        // the function transfers ownership from previous owner to new owner<br>        fn _transfer_ownership(<br>            ref self: ComponentState&lt;TContractState&gt;, new_owner: ContractAddress<br>        ) {<br>            let previous_owner: ContractAddress = self.owner.read(); // get the previous owner<br>            self.owner.write(new_owner); // writes the new owner to the state<br>            self<br>                .emit(<br>                    OwnershipTransferred { previous_owner: previous_owner, new_owner: new_owner }<br>                ); //emits OwnershipTransferred events<br>        }<br>        // this function strictly ensures that ony the owner has rights<br>        fn assert_only_owner(self: @ComponentState&lt;TContractState&gt;) {<br>            let owner: ContractAddress = self.owner.read(); // get owner contract address<br>            let caller: ContractAddress = starknet::get_caller_address(); // gets caller address<br>            assert(caller == owner, Errors::NOT_OWNER); //ensures caller is the owner<br>            assert(<br>                !caller.is_zero(), Errors::ZERO_ADDRESS_OWNER<br>            ); // ensures caller is not address zero<br>        }<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=162aedf97003" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Starknet and the Cairo ERC20 Token for Beginners]]></title>
            <link>https://medium.com/@emma.onyedika.okeke/understanding-starknet-and-the-cairo-erc20-token-for-beginners-93445f40996d?source=rss-e5d151e56c0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/93445f40996d</guid>
            <dc:creator><![CDATA[Emmanuel Okeke]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 13:13:03 GMT</pubDate>
            <atom:updated>2024-12-05T13:13:03.199Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdCwPwP0JEYDOV0ctIT6uw.jpeg" /></figure><p>Blockchain technology is evolving rapidly, and Ethereum’s scalability challenges have given rise to solutions like Layer 2 networks, which improve transaction speed and reduce costs. Starknet, one of the most promising Layer 2 solutions, is powered by ZK-Rollups (Zero-Knowledge Rollups). It enables developers to write efficient, secure, and scalable smart contracts using its programming language, Cairo. If you’re new to Starknet and want to understand how to create a basic ERC20 token, this guide will take you through the basics step-by-step.</p><p><strong>What is Starknet?</strong><br>Starknet is a permissionless Layer 2 network built on Ethereum. It uses ZK-Rollup technology to bundle multiple transactions into a single proof, reducing the computational load on the Ethereum mainnet. This makes transactions faster and more affordable while inheriting Ethereum’s security.</p><p><strong>What is Cairo?</strong><br>Cairo is a programming language designed specifically for writing scalable applications on Starknet. Unlike Solidity, which is used on Ethereum, Cairo is optimized for ZK-Rollups, enabling developers to create efficient and high-performance smart contracts.</p><p><strong>What is an ERC20 Token?</strong><br>An ERC20 token is a standard for creating fungible tokens on Ethereum and its compatible ecosystems. It defines a set of rules that tokens must follow, ensuring interoperability and ease of integration.</p><p><strong>Key Functions of an ERC20 Token:</strong><br>- totalSupply: Returns the total supply of tokens.<br>- balanceOf(address): Returns the token balance of an address.<br>- transfer(address, amount): Transfers tokens to another address.<br>- approve(address, amount): Approves another address to spend tokens on the owner’s behalf.<br>- transferFrom(address, address, amount): Facilitates token transfers by an approved address.<br>- allowance(address, address): Checks the remaining approved tokens that an address can spend.</p><p>In this article we would look at more key functions of ERC20 token.</p><pre>use starknet::ContractAddress; // import contract address<br><br>#[starknet::interface] // interface of the ERC20 token<br>pub trait IERC20&lt;TContractState&gt; {<br>    fn get_name(self: @TContractState) -&gt; ByteArray;<br>    fn get_symbol(self: @TContractState) -&gt; ByteArray;<br>    fn get_decimals(self: @TContractState) -&gt; u8;<br>    fn get_total_supply(self: @TContractState) -&gt; u256;<br>    fn balance_of(self: @TContractState, account: ContractAddress) -&gt; u256;<br>    fn allowance(self: @TContractState, owner: ContractAddress, spender: ContractAddress) -&gt; u256;<br>    fn transfer(ref self: TContractState, recipient: ContractAddress, amount: u256);<br>    fn transfer_from(<br>        ref self: TContractState, sender: ContractAddress, recipient: ContractAddress, amount: u256<br>    );<br>    fn approve(ref self: TContractState, spender: ContractAddress, amount: u256);<br>    fn increase_allowance(ref self: TContractState, spender: ContractAddress, added_value: u256);<br>    fn decrease_allowance(<br>        ref self: TContractState, spender: ContractAddress, subtracted_value: u256<br>    );<br>    fn mint(ref self: TContractState, account: ContractAddress, amount: u256);<br>}<br><br>#[starknet::contract] // Contract<br>pub mod ERC20 {<br>    use starknet::event::EventEmitter; // import for events emission<br>    use super::IERC20; // import the interface<br>    use super::ContractAddress; // import the contract address<br>    use starknet::storage::{<br>        Map, StorageMapReadAccess, StorageMapWriteAccess<br>    }; // import mapping, read &amp; write access to storage<br>    const TOTAL_SUPPLY: u256 = 100_000_000; // total supply of token<br>    const DECIMALS: u8 = 18; // decimal of token<br><br>    #[storage]<br>    struct Storage {<br>        //name of the token<br>        name: ByteArray,<br>        //token symbol<br>        symbol: ByteArray,<br>        //token decimals e.g 18<br>        decimals: u8,<br>        //token max supply<br>        total_supply: u256,<br>        //balances of each user mapped to an amount<br>        balances: Map::&lt;ContractAddress, u256&gt;,<br>        // allownaces for third party contracts mapped to an amount<br>        allowances: Map::&lt;(ContractAddress, ContractAddress), u256&gt;,<br>    }<br><br>    #[constructor] // Initializes these parameters on deployment<br>    fn constructor(ref self: ContractState, name: ByteArray, symbol: ByteArray) {<br>        self.name.write(name); // toke name<br>        self.symbol.write(symbol); // token symbol<br>        self.total_supply.write(TOTAL_SUPPLY); // token total supply<br>        self.decimals.write(DECIMALS); // token symbol<br>    }<br><br>    #[event]<br>    #[derive(Drop, starknet::Event)]<br>    pub enum Event { // events that gets emitted once transfer or approval is made<br>        Transfer: Transfer,<br>        Approval: Approval,<br>    }<br>    #[derive(Drop, starknet::Event)]<br>    pub struct Transfer { // transfer struct<br>        pub from: ContractAddress, // address of the spender<br>        pub to: ContractAddress, // address of the reciever<br>        pub value: u256,<br>    }<br>    #[derive(Drop, starknet::Event)]<br>    pub struct Approval { // approval struct<br>        pub owner: ContractAddress, // owner address<br>        pub spender: ContractAddress, // spender address<br>        pub value: u256, // amount to authorized to spend<br>    }<br>    #[abi(embed_v0)]<br>    impl ERC20IMPL of super::IERC20&lt;ContractState&gt; {<br>        // create token for testing<br>        fn mint(ref self: ContractState, account: ContractAddress, amount: u256) {<br>            self.balances.write(account, amount)<br>        }<br>        //get the name of the contract<br>        fn get_name(self: @ContractState) -&gt; ByteArray {<br>            self.name.read()<br>        }<br>        //get the symbol of the contract<br>        fn get_symbol(self: @ContractState) -&gt; ByteArray {<br>            self.symbol.read()<br>        }<br>        //get the decimals<br>        fn get_decimals(self: @ContractState) -&gt; u8 {<br>            self.decimals.read()<br>        }<br>        //get the max/total supply<br>        fn get_total_supply(self: @ContractState) -&gt; u256 {<br>            self.total_supply.read()<br>        }<br>        // get the balance of a contract<br>        fn balance_of(self: @ContractState, account: ContractAddress) -&gt; u256 {<br>            self.balances.read(account)<br>        }<br><br>        //transfer a token to a recipient<br>        fn transfer(ref self: ContractState, recipient: ContractAddress, amount: u256) {<br>            let sender = starknet::get_caller_address(); // get sender&#39;s address<br>            self.transfer_from(sender, recipient, amount) // execute transfer_from function<br>        }<br>        //transfer with two argument sender and recipient.<br>        //this function allows tokens to be transferred by third party<br>        fn transfer_from(<br>            ref self: ContractState,<br>            sender: ContractAddress,<br>            recipient: ContractAddress,<br>            amount: u256<br>        ) {<br>            //get the address of the person calling the contract<br>            let caller = starknet::get_caller_address();<br>            // get the balance of the sender<br>            let sender_balance = self.balances.read(sender);<br>            // get recipient address<br>            let recipient_balance = self.balances.read(recipient);<br>            // check sender balance is equal to or more tham amount<br>            assert!(sender_balance &gt;= amount, &quot;ERROR: INSUFFICIENT BALANCE&quot;);<br><br>            // checks the address executing this function is not same as sender<br>            // this ensures that the caller has been authorized to spend tokens on behalf of spender<br>            if (caller != sender) {<br>                // gets the amount a third party contract is allowed to spend<br>                // and checks its equal to or greater than the amount<br>                assert!(self.allowances.read((sender, caller)) &gt;= amount, &quot;ERROR: UNAUTHORISED&quot;);<br>            }<br>            self<br>                .balances<br>                .write(<br>                    sender, sender_balance - amount<br>                ); // write to storage the sender &amp; updated balance<br>            self<br>                .balances<br>                .write(<br>                    recipient, recipient_balance + amount<br>                ); // write to storage the recipient &amp; update balance<br><br>            self<br>                .emit(<br>                    Transfer { from: caller, to: recipient, value: amount }<br>                ); // emit transfer event (caller, recipient, amount)<br>        }<br><br>        // approve a contract to spend your token<br>        fn approve(ref self: ContractState, spender: ContractAddress, amount: u256) {<br>            let caller =<br>                starknet::get_caller_address(); // the address of the caller of the function<br>            let allowed_persons = (caller, spender); // persons allowed to call the function<br>            let previous_allowance = self<br>                .allowances<br>                .read(allowed_persons); // get the previous allowance of the allowed persons<br>            self<br>                .allowances<br>                .write(<br>                    allowed_persons, previous_allowance + amount<br>                ); // write to storage update current allowance &amp; allowed persons<br>            self<br>                .emit(<br>                    Approval { owner: caller, spender, value: amount }<br>                ); // emit the caller, sender &amp; amount<br>        }<br><br>        //Increases the allowance<br>        fn increase_allowance(<br>            ref self: ContractState, spender: ContractAddress, added_value: u256<br>        ) {<br>            let caller = starknet::get_caller_address(); // get caller address<br>            let allowed_person = (caller, spender); // persons allowed to call the function<br>            let previous_allowance = self.allowances.read(allowed_person); // previous allowance<br>            self<br>                .allowances<br>                .write(<br>                    allowed_person, previous_allowance + added_value<br>                ); // write to storage allowed persons &amp; allowance update<br>            self<br>                .emit(<br>                    Approval { owner: caller, spender, value: added_value }<br>                ); // emit approval event<br>        }<br>        //reduces the allowance<br>        fn decrease_allowance(<br>            ref self: ContractState, spender: ContractAddress, subtracted_value: u256<br>        ) {<br>            let caller = starknet::get_caller_address(); // get caller address<br>            let allowed_person = (caller, spender); // persons  allowed to call the function<br>            let previous_allowance = self<br>                .allowances<br>                .read(allowed_person); // get the previous allowance balance<br>            self<br>                .allowances<br>                .write(<br>                    allowed_person, previous_allowance - subtracted_value<br>                ); // write to storage allowed persons &amp; allowance update<br>            self<br>                .emit(<br>                    Approval { owner: caller, spender, value: subtracted_value }<br>                ); // emit approval event<br>        }<br>        //gets the amount a third party contract is allowed to spend<br>        fn allowance(<br>            self: @ContractState, owner: ContractAddress, spender: ContractAddress<br>        ) -&gt; u256 {<br>            self.allowances.read((owner, spender))<br>        }<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93445f40996d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>