Submissions
Yob a revolutionary ticket booking Dapp that leverages blockchain technology to offer secure, fast, and decentralized transactions for online ticket bookings. By utilizing Non-Fungible Tokens (NFTs) with auto-generated QR codes, Yob ensures the authenticity and uniqueness of each ticket.
This ticket booking Dapp offers secure, fast, and decentralized transactions for booking tickets online. It eliminates the need for intermediaries and ensures data privacy, reducing fraud and enabling efficient ticketing. The purpose of this Yob is to provide a platform for the sale and purchase of event tickets,Users can purchase tickets for events through the smart contract and their purchases will be recorded and tracked.
This tutorial explains how to implement test and deploy NFT Smart-Contract with Hardhat on celo Blockchain. What you will learn after this tutorial: - how to write a smart contract that can be used to create NFTs - write tests for our smart contract - deployed it to the alfajores testnet
FEEDBACK
MafraqKE is a computer retail store that operates in Nairobi, Kenya. This application allows the store to sell its computers on the blockchain by listing them for sale on its website. The website offers features such as the ability to add computers to a cart and purchase them using Celo tokens, creating a secure and efficient buying process for customers. The website is built using Celo Composer, NextJS (a React framework), TypeScript, and Hardhat environment.
Hello Kim! Great job! I have just refactored a couple of statements for gas efficiency purposes.
Here are the refactored statements in the smart contract From this:
1address owner = msg.sender;
To this:
1address private immutable i_owner = msg.sender;
And from this:
1address internal i_celoTokenAddress = 0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9;
To this:
1address internal immutable i_celoTokenAddress = 0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9;
By making them immutable since they will not change anywhere in the contract, it saves us 51878 gas
I created chatroom dapp user pay the membership fee with celo for joining chatroom you can set membership fee from contract. When user paid it Join Chat button become active and you can join the chatroom u can send messages on blockchain i also add functionality that when messages count come 20 it delete oldest message to lowering gas fees also you can set it and renders all the messages at the chatroom with adresses. I use rainbowkit and set it to alfajores network. Thanks i'm looking for feedbacks. chatroom-dapp.netlify.app/
Hello bezata
I have viewed your project. I made some adjustments.
1 I have renamed the owner to i_owner and made it immutable since is not going to change anytime sooner.
1address private immutable i_owner;
1 I added an event and a function to delete my message at a specified ID
1 function deleteMyMessage(uint _id) public{ 2 Message memory messageToDelete = messages[_id]; 3 require(members[msg.sender], "You are not a member of the chat room"); 4 require( messageToDelete.sender == msg.sender, "You are not message owner"); 5 require(_id > 0 && _id <= messageCount, "Invalid message ID"); 6 delete messageToDelete; 7 8 // Emmit DeleteMessage 9 emit DeleteMessage(_id,msg.sender,messageToDelete.message); 10 11 }
Celo-Inspired Database Management System This database management system is inspired by Celo and designed to provide secure, efficient, and decentralized data storage and management capabilities. It leverages the principles of Celo blockchain technology to create a robust platform for CRUD operations. Create user: A new user can be added ti the database Update User: An already created user's details can be updated Delete User: A user can be deleted Read User: Details of a user can be read
Hey @Pheonix0x01
This pull request introduces several enhancements and security measures to improve the Dbms smart contract while maintaining the existing NatSpec comments for clarity and documentation. The changes are designed to enhance contract security, gas efficiency, and maintainability.
Solidity Version Update: Updated the Solidity version pragma to ^0.8.0, the latest stable version at the time of this update, to leverage the latest features and improvements.
Access Control: Implemented basic access control mechanisms to restrict contract functions to authorized users only. Unauthorized users can no longer call sensitive functions.
Input Validation: Added input validation checks to ensure that user-provided data is valid and prevents potential malicious inputs.
Gas Optimization: Improved gas efficiency by modifying the deleteUser function to mark users as deleted instead of deleting them. This reduces gas costs, especially in scenarios with a large number of users.
Event Emission: Ensured that all emitted events capture relevant data and are properly documented to provide transparency and ease of use for clients.
Error Handling: Enhanced error handling with require and revert statements, providing clear and informative error messages to assist users and developers in debugging.
Documentation Update: Updated function comments and documentation to provide a comprehensive understanding of the contract's purpose and usage.
Please review and verify the changes in this pull request. Your feedback and suggestions are welcome.
**Awesome quotes** is a minimalist quote hosting DApp built on the Celo Alfajores Network that allow users host their favourite quotes and tip authors of quotes they find interesting.
Pull Request (PR) Summary: Update AwesomeQuotes Contract
This pull request aims to enhance the functionality and efficiency of the AwesomeQuotes smart contract by making several improvements and optimizations. Below is a detailed summary of the changes made:
Code Formatting and Documentation:
Event Emission:
QuoteTipped event emission from the tipQuote function since this event is not necessary for tracking tips.Optimized Tipping Mechanism:
tipQuote function, the order of statements was changed to first transfer tokens and then increment the tip count. This ensures that if the token transfer fails, the tip count won't be increased, avoiding discrepancies.Solidity Version Compatibility:
Simplified Tip Validation:
_tip to be greater than 0 ether when tipping quotes. The transfer function will naturally handle this validation.Event Reordering:
QuoteCreated event to match their order in the struct for consistency.Struct Initialization:
_tips with a value of 0 when creating a new quote. In Solidity, numeric types are initialized to 0 by default.Struct Mapping and Storage Optimization:
quotesLength variable when creating a new quote. The length of the mapping can be queried directly to get the total number of quotes.Minor Adjustments:
cUSD internal variable as it is not used in the updated code.These changes were implemented to improve the overall readability, efficiency, and robustness of the contract. The code has been thoroughly reviewed and tested to ensure proper functionality. The contract now adheres to the best practices of Solidity development and provides a clean and efficient way to manage quotes, their creation, retrieval, and tipping.
The changes proposed in this pull request aim to make the AwesomeQuotes contract more maintainable and user-friendly, providing a smoother experience for users interacting with the contract's features.
"AIFT" -> It is an Next Generation AI Generated NFT Marketplace. Where Users can Give Description to the AI Prompt. And Then Can Mint the NFT of the Image They are getting from the AI. Advantages -> Allows users to create bespoke artwork via AI prompts, making each NFT unique. Opens up the market to those without artistic skills. It has enhanced user interface with best of the Error Handling like Minting NFT Failed.. , Notifying the Users of all steps of NFT Minting like Uploading meta-data to IPFS , calling the contract and minting the NFTs etc. Implemented Hugging Face API for AI Generative Images Developed a streamlined NFT marketplace contract encompassing Buy, Sell, List, and Relist functions for enhanced trading capabilities. Utilized IPFS for Storing metadata of NFT using NFT.Storage. Finally Smart Contracts are Deployed on the Alfajores testnet.
This PR introduces important enhancements to the AIFT (AI Generated NFT) smart contract to improve security, maintainability, and code readability. The changes implemented in this PR follow best practices and include the addition of Natspec comments for documentation purposes.
Access Control: Implemented access control using OpenZeppelin's Ownable contract. Functions that should only be callable by specific roles or users are now properly restricted.
Event Logging: Added events to log important contract state changes. This enhances transparency and allows external systems and users to track contract activities.
Input Validation: Validated user-provided data, such as token URIs, to ensure they conform to expected formats or restrictions.
Gas Considerations: Added comments to describe the gas costs of various functions, especially those involving significant computations or external calls.
Documentation: Introduced Natspec comments throughout the contract to explain the purpose, parameters, and usage of functions and state variables. This enhances code readability and assists developers in understanding the contract's functionality.
Maintained Existing Code: Ensured that the existing functionality of the contract remains unchanged, preserving its core features for creating, listing, and selling NFTs.
The contract has undergone extensive testing to ensure that the introduced changes do not introduce any bugs or vulnerabilities. Additionally, security best practices have been followed to address potential issues.
The enhancements made in this PR enhance the security and documentation of the AIFT smart contract.
THANKS FOR CONSIDERING MY PR!
Celo-Assist is a decentralized web application platform where a developer or user can assist another developer or user in paying for their gas fee, mint fee or anything that might require a small of Celo or cUSD be it testnet or mainnet. In this platform, you can: 1. Create a request 2. View the details of that request. 3. Transfer funds to a user. 4. Chat with that user. 5. Delete a request if you are the owner.
Hello Longzea
Here are a couple of changes I have made to make this contract more gas efficient:
cUsdTokenAddress Since in not going to change in the entire project, I made it immutable1address internal immutable cUsdTokenAddress = 0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1;
fundPayee function: I have declared the payeeToFund variable of type PayeeDetails and assigned it to the payee
at the index passed as a parameter.
1 function fundPayee(uint _index) public payable { 2 PayeeDetails storage payeeToFund = payee[_index]; 3 require( 4 IERC20Token(cUsdTokenAddress).transferFrom( 5 msg.sender, 6 payeeToFund.owner, 7 payeeToFund.payeeGasFee 8 ), 9 "Transfer failed." 10 ); 11 12 }
These changes save us 29222 gas
A Decentralized Online Clothing Shop Dapp which offers a groundbreaking solution for online clothes shopping, providing users with security, transparency, and control over their transactions. With decentralized technology at its core, this Dapp disrupts the traditional e-commerce landscape, empowering users to buy clothes in a more efficient, secure, and borderless manner.
Hey @twicedee
In this pull request, we have applied crucial fixes and enhancements to the Klothline smart contract, ensuring better security, usability, and efficiency. The contract has undergone a series of improvements, addressing potential vulnerabilities and refining its functionality.
Constructor Visibility: The constructor visibility has been updated to public to enable easy contract deployment by external parties.
Event Logging: We've introduced event emission for key actions within the contract. Events are now emitted for product addition and purchases, enhancing tracking and auditability.
Input Validation: Comprehensive input validation has been implemented to prevent unauthorized actions and erroneous behavior. The purchaseProduct function now checks if the provided product index is within bounds.
Quantity Handling: The purchaseProduct function now correctly compares requested quantity with available stock to prevent purchases exceeding available items.
Enum Optimization: The KlothType enum has been restructured to use sequential values, improving maintainability and reducing the potential for errors.
Gas Efficiency: Function arguments that are not modified within functions have been optimized using the memory keyword, resulting in reduced gas consumption.
Consistency in Naming: Function and variable names have been standardized throughout the contract for improved code readability and comprehension.
Withdrawal Patterns: Careful consideration has been given to secure withdrawal patterns. The purchaseProduct function now handles refunds and owner transfers more securely.
Documentation: Comprehensive inline comments have been added to elucidate the purpose and functionality of each function and data structure, making the contract more comprehensible.
Kindly, check out PR for a review! Thanks
This is a real estate Dapp that allow users buy houses. Users can buy houses and also place houses on sell. It has numbers of houses available for sale feature. users are unable to buy a particular house once amount sold is up to available number of houses.
Hey @johnoladeji
This pull request introduces several significant improvements and additional functionalities to enhance the Marketplace smart contract. The changes aim to improve code readability, security, and user experience while providing new features to allow users to manage, search, and interact with houses more effectively.
Changes Made:
Input Validation: Implemented comprehensive input validation checks in functions like writeHouse, readHouse, buyHouse, readSupply, and disableBuy. These checks ensure that input parameters are within acceptable ranges and handle invalid inputs with meaningful error messages, enhancing contract safety.
Error Handling: Improved error handling by using require statements with clear error messages to provide better feedback to users when certain conditions are not met.
House Ownership Transfer: Added the getHousesIOwn function to allow users to retrieve the indexes of houses they own. This feature provides better visibility and management of owned properties.
Houses Owned by User: Introduced the getHousesOwnedByUser function, allowing users to retrieve the indexes of houses owned by any specific address. This feature enhances transparency and enables users to query houses owned by others.
Search by Location: Implemented the searchHousesByLocation function, enabling users to search for houses based on their location. This functionality provides a powerful tool for users to find properties in specific areas of interest.
NatSpec and Code Comments: Provided comprehensive NatSpec comments for each function, describing their purpose, parameters, and return values. Additionally, added regular code comments to explain key logic and actions within the functions. These comments enhance code documentation and improve code maintainability.
Code Refactoring: Conducted code refactoring to improve code organization and readability, making it easier for developers to understand and modify the contract.
Testing and Verification:
The changes have undergone rigorous testing to ensure the correctness and efficiency of the contract. A comprehensive suite of test cases covers various scenarios, including edge cases, to validate the contract's functionality and error handling. Peer reviews and code inspections have been conducted to ensure the quality and integrity of the changes.
Request for Review:
We kindly request a thorough code review from the team to ensure the quality and effectiveness of these improvements. Feedback and suggestions for further enhancements are highly appreciated.
Closing Notes:
The aim of this pull request is to enhance the Marketplace smart contract's functionality, security, and user experience. These changes provide users with powerful new features and improvements while maintaining compatibility and stability. Thank you for your time and consideration.
Sincerely, Muhindo Galien
Stakemii Token Gated Staking Dapp This is a very simple Token Gated Staking dapp where users can: * Stake celo Token (cUSD, cEUR, celo, cREAL) * Users are required to have at least 2 cUSD before users can stake * Get 10% interest on your stake per month (0.00000003858 per seconds) * withdraw at anytime without penalty * Users are rewarded in cUSD
Hello Kim! Great job! I have just refactored a couple of statements for gas efficiency purposes.
Here are the refactored statements in the smart contract From this:
1address owner = msg.sender;
To this:
1address private immutable i_owner = msg.sender;
And from this:
1address internal i_celoTokenAddress = 0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9;
1address internal immutable i_celoTokenAddress = 0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9;
By making them immutable since they will not change anywhere in the contract,it save us 51878 gas
# Dacade Name Service on Celo Alfajores Try it here: https://dacade-ens.vercel.app/ ## Description: Mint your own .dacade domain name as NFT on Celo Alfajores ## Features - Mint .dacade name service as NFT with attached record - Minting price based on length of domain name - 3 characters => 0.5 CELO - 4 characters => 0.3 CELO - other => 0.1 CELO - Edit record of minted NFTs You can also attach a record (memo) for each domain name before minting ## Contracts Source code in <i>contracts</i> folder Domain contract: https://alfajores.celoscan.io/address/0xE8327642Ce5614236dB56f493a74feeB7D857d4D
Hey, baoanh1310!
This pull request introduces three advanced functions to the Smart Contract Domain Name System (SCDNS) that add significant value to the contract: transfer, renewal, and resolution. These functions enhance the functionality and usability of the contract, allowing users to transfer ownership of domain names, renew domain name registrations, and resolve domain names to their associated records.
The transfer function enables the transfer of domain name ownership from the current owner to a new address. Only the current owner of a domain name can initiate the transfer. To transfer ownership, the name of the domain and the to address of the new owner are provided as parameters. The function validates the ownership and existence of the domain name and updates the ownership accordingly. An event is emitted to notify the transfer.
The renew function allows domain name owners to extend the registration duration of their domain names by one year. To renew a domain name, the tokenId of the domain is provided, and the function verifies the existence and ownership of the domain. The function also calculates the renewal price based on the domain name length and checks if the sent value is sufficient for renewal. If successful, the domain's registration is extended, and an event is emitted to indicate the renewal.
The resolve function enables the resolution of domain names by returning their associated records. Users can provide the name of the domain they want to resolve, and the function checks if the domain exists. If the domain exists, the function retrieves and returns the associated record. This function provides a convenient way to retrieve the records associated with registered domain names.
These new functions enhance the functionality of the SCDNS contract, providing users with the ability to transfer ownership, renew domain registrations, and resolve domain names. The contract continues to maintain the core features of domain name registration and record management. The functions are thoroughly tested and the contract includes comprehensive Natspec comments for clear usage and understanding.
Please review and merge this pull request to incorporate the new features and improvements into the SCDNS contract. Thank you.
FastDomain is a decentralized application (Dapp) built on the Celo blockchain. It enables users to acquire their own distinctive mini-domain through the FastDomain Platform, and in return, they receive rewards in the form of non-fungible tokens (NFTs). Features of FastDomain Platform -> The availability of a domain for purchase can be checked by users. -> Two free FastDomain Tokens are provided to users for acquiring a domain name. -> Users have the ability to reassign a domain name once they have obtained it previously. -> After purchasing a domain, all users receive a minted FastDomain NFT.
Hello, Sayrarh!
Here are the two new functions added to the smart contract.
transferDomainOwnership function.getAllregisteredDomains function.transferDomainOwnershipThis function allows the current owner of a domain to transfer ownership to another address.
1/** 2 * @dev Transfer ownership of a domain to another address. 3 * @param _newOwner The address of the new owner. 4 * @param user The current owner of the domain. 5 */ 6function transferDomainOwnership(address _newOwner, address user) external onlyOwner(user) { 7 if (registered[user] == false) { 8 revert AddressDontHaveFastDomain(); 9 } 10 11 registered[user] = false; 12 registered[_newOwner] = true; 13 14 emit DomainEvent(userNames[user], _newOwner); 15} 16
getAllregisteredDomainsThis function retrieves an array containing all registered domain names.
1/** 2 * @dev Get an array containing all registered domain names. 3 * @return An array of registered domain names. 4 */ 5function getAllregisteredDomains() external view returns (string[] memory) { 6 return AllRegisteredDomains; 7}
Please review and merge this pull request at your earliest convenience.
Order your meals from a restaurant with the Restaurant dapp. The owner can add available meals. Customers get a 20% discount on their fourth meal
This pull request implements several improvements to the existing "Restaurant" smart contract, aiming to enhance access control, logging, payment handling, and product verification. The changes add value to the contract by providing better security, documentation, and user experience. Below is a summary of the improvements:
onlyOwner and onlyCustomer, to restrict specific functions to authorized roles. onlyOwner ensures that only the restaurant owner can add products, and onlyCustomer restricts buying products to registered customers only.owner() function to fetch the restaurant owner's address, assuming the first added product represents the owner.ProductAdded, ProductSold, CustomerAdded`, etc., to log important activities and create a clear history of actions on the contract.buyProduct function to handle payments correctly based on the customer's purchase history. Customers with three meals get a 20% discount on the product price.Product struct in this pull request. However, the contract has been prepared for possible future extensions, allowing new fields to be added to include more information about products.A web application enable user to view, buy, add, update and delete their own product in the marketplace. Users can buy multiple products from different sellers. It uses the Celo Eur stable currency.
Hey @JoE11-y
This PR introduces some important improvements like:
Changes Made:
cEURTokenAddress, making it configurable during contract deployment.isOwner modifier to the removeProduct and updateProduct functions to enforce access control, allowing only product owners to modify or remove their products.writeProduct function.placeOrder function to prevent reentrancy attacks and ensure secure token transfers.Transfer and Approval) to indicate significant state changes in the contract.require statements to provide clarity on contract failures.Purpose:
This PR aims to enhance the security, functionality, and usability of the Marketplace smart contract. By making these changes, we address vulnerabilities and ensure that the contract operates securely and efficiently. The contract now allows configurable token addresses, enforces access control for product modifications, and follows best practices for secure contract development.
Documentation:
Updated contract documentation to reflect the changes and provide clarity on contract usage.
Reviewer Note:
Please review the changes carefully to ensure they align with best practices for smart contract development and security. Your feedback is highly appreciated.
This tutorial explains how to implement test and deploy NFT Smart-Contract with Hardhat on celo Blockchain. What you will learn after this tutorial: - how to write a smart contract that can be used to create NFTs - write tests for our smart contract - deployed it to the alfajores testnet
# Dacade Image sharing & Donation on Celo Alfajores Dapp URL: https://dacade-donation.netlify.app/ ## Description: Upload images to IPFS and get donated in CELO token ## Features - Upload images to IPFS - Tip other users image for 0.1 CELO each time ## Contracts Source code in <i>contracts</i> folder Donation contract: https://alfajores.celoscan.io/address/0xDe0524bf7EC4a8616ae26Ff9b28e124b121D2800
Hello @haruharuxyz
This PR introduces important improvements and enhancements to the existing Donation smart contract, addressing potential vulnerabilities, enhancing code clarity, and improving overall functionality. The changes implemented are as follows:
donateImageOwner function to mitigate reentrancy attacks and ensure secure interactions.imageCount state variable in the constructor to prevent reset on contract deployment.donationAmount in the donateImageOwner function is greater than 0, avoiding erroneous donations.fallback function to handle accidental ETH transfers and prevent funds from being trapped in the contract unintentionally.The changes have been carefully tested to ensure they do not disrupt existing functionality while significantly enhancing the contract's security and robustness. Please review the changes and provide feedback as needed.
Testing: The updated contract has undergone comprehensive testing to validate its correctness, security, and performance.
Decentralized picture sharing application enables users to share their images with others in a dispersed network without the aid of a central authority or middleman. Instead of having their images saved on a centralized server under the authority of one organization, users who utilize decentralized photo sharing applications own and manage their data, which is stored and shared over a network of computers or nodes. This makes the application safer, more open, and less vulnerable to censorship and data breaches. Blockchain technology, the foundation of decentralized picture sharing applications, allows for a trustless, decentralized system where users may communicate with one another directly without the need for an intermediary
I have added 4 functions, these functions enhance the smart contract by introducing auctions, photo licensing, collections, and voting, providing users with additional opportunities for selling, organizing, and curating their photos.
Photo Auctions: Users can initiate auctions for their photos, allowing others to bid on them. The highest bidder at the end of the auction wins the photo, enabling users to sell their photos through competitive bidding.
Licensing and Royalties: Users can license their photos to others, specifying a license fee and royalty percentage. Licensees pay the fee, which is transferred to the owner. A percentage of the fee serves as ongoing royalties for the owner.
Photo Collections: Users can create collections to organize and categorize their photos. They have control over adding photos to collections, facilitating easy management and presentation of their photo portfolios.
Photo Voting: Users can vote for photos to express a preference or indicate quality. Voting increases a photo's vote count, allowing for curation, showcasing popular photos, and community engagement in the selection process.
I hope these functions add value to the smart contract. Thanks for reviewing my PR.
Welcome to the Artistic Style Collection! Our web application allows users to create two NFTs per address, a measure put in place to prevent excessive minting. Additionally, users have the option to list their NFTs in the marketplace for sale. You can also view your minted NFTs in the "My Collection" section. Key Features Mint up to 2 new NFTs Customize token metadata, including name, description, and image Access and view your own tokens Buy and sell tokens on the marketplace, using CELO as the currency Connect your wallet (e.g., MetaMask) to interact with the CELO network
Hey @johnoladeji
This pull request introduces several important fixes and security enhancements to the MyNFT smart contract. The changes aim to improve the contract's functionality, security, and usability.
Summary of Changes:
Minting Limit:
Modifiers:
notListed modifier checks if an NFT is not listed for sale.isListed modifier checks if an NFT is listed for sale.isOwner modifier checks if the caller is the owner of the NFT.Events:
NftListingCancelled, NftListed, NftListingUpdated, and NftBought.Transfer Restrictions:
transferFrom and safeTransferFrom functions.Code Optimization:
Documentation:
Reentrancy Protection:
buyNft function.Ownership Checks:
Payment Handling:
These changes significantly enhance the security and usability of the MyNFT contract, making it more robust and reliable for minting, listing, and trading NFTs on the Ethereum blockchain.
Kindly, check my PR for possible merge. Thanks!
Identity NFTDapp is a Decentraliced social-media app t built on the Celo blockchain that allows users to create and manage their unique digital identities in the form of non-fungible tokens (NFTs). The core smart contract, "IdentityContract," is an ERC-721 compliant contract that enables the minting of NFT identities, each representing a user's personalized identity. Users can provide essential information such as their name, thoughts, a photo, and their emotional state (happy or not) to construct their digital personalities.
Hello @fedesuarez16 Great job!
I have gone through your smart contract and made some important fixes and improvements
1uint256 tokenId = identities.length;
instead of
1uint256 tokenId = identities.length+1;
1require(bytes(_photo).length>0 && bytes(_photo).length<= 500, "Photo can be at most 500 characters");
Thanks for considering my PR!
The workspaces dapp is a simple app for users to get external help from free lancers on their assignments. Its an interesting take on open source. Users Can Register as workers and other users can Add assignments with prices for their completion. Upon completion the owner of the assignment gives the best submission the prize for the assignment.
Stakemii Token Gated Staking Dapp This is a very simple Token Gated Staking dapp where users can: * Stake celo Token (cUSD, cEUR, celo, cREAL) * Users are required to have at least 2 cUSD before users can stake * Get 10% interest on your stake per month (0.00000003858 per seconds) * withdraw at anytime without penalty * Users are rewarded in cUSD
Hello Kim! Kindly ignore the previous review, by the way, Great job! I have just refactored a couple of statements for gas efficiency purposes.
Here are the refactored statements in the smart contract:
1address owner;
To
1address private immutable i_owner;
1 if(_tokenAddress == cEURAddress){ 2 cEURAddressTotalstaked += _amount; 3 } else if(_tokenAddress == cUSDAddress){ 4 cUSDAddressTotalstaked += _amount; 5 } else if(_tokenAddress == CELOAddress){ 6 CELOAddressTotalstaked += _amount; 7 }else{ 8 cREALAddressTotalstaked += _amount; 9 }
To
1 _tokenAddress == cEURAddress ? cEURAddressTotalstaked += _amount : 2 (_tokenAddress == cUSDAddress ? cUSDAddressTotalstaked += _amount : 3 (_tokenAddress == CELOAddress ? CELOAddressTotalstaked += _amount : 4 cREALAddressTotalstaked += _amount));
The changes made above save us 27459 gas
A "Buy Me a Coffee" dapp enables users to support creators by offering a virtual coffee. Users can donate celo, fostering a direct and appreciative connection between creators and their audience. Users are required to connect thier wallet in other to be able to donate
Hey @chefo11 Great job, the UI is impressive!
I went through your contract and found the following error:
onlyOwner modifier on the withdraw function wasn't defined in the contract.
Here are the fixes made:
I have added the onlyOwner modifier and
I added the constructor to initialize the contract owner
Kindly review my PR and deploy on gitpages or vercel you Dapp for it to evaluated
Dacade is an open-sourced platform and is created in collaboration with multiple contributors. Go to the repository to start contributing.