user-avatar
u
ujay
Joined
icon image
Celo Community
154 REP
22 Feedbacks
0 predaji zadatka

FEEDBACK

Submitted

Introducing the Decentralized Voting System: A Celo blockchain-powered solution for transparent and secure voting. The smart contract (Voting.sol) manages elections, while the user-friendly web interface enables easy participation

14Points
5 Feedbacks
154 REP
Feedback

Hello GillianMasija, Your provided code seems to be well-structured and comprehensive. However, I'll make some suggestions for improvement:

  1. Clarify Celo Account Setup: In the "Getting Started" section, where you mention setting up a Celo account and obtaining a private key, it might be helpful to include a brief overview or link to a tutorial on how users can create a Celo account and ensure the security of their private key. This can be crucial for users who are new to Celo.

  2. Consistent Naming Conventions: Ensure consistent naming conventions throughout your code. For example, you use both startElection and vote as function names. While this might be intentional, consider making the names more distinct or providing clear documentation on their purpose.

  3. Explicit Instructions for Deployment Script: When explaining the deployment script (deploy.js), explicitly state that users need to replace your_private_key with their actual private key. Providing a reminder about the importance of keeping the private key secure is also beneficial.

  4. Interactive HTML Elements: Consider adding some user prompts or feedback messages in the HTML file, especially after users perform actions like starting a new election, voting, or retrieving results. This can enhance the user experience.

  5. Error Handling in Frontend: In the JavaScript file (app.js), improve error handling by displaying meaningful messages to users in case of failures. This will help users understand what went wrong and how to rectify it.

  6. Documenting the Smart Contract: Consider adding comments or documentation within the smart contract (Voting.sol) to explain the purpose of each function and any relevant considerations for developers who may review or modify the contract.

  7. Security Considerations: Include a section on security considerations. Emphasize the importance of secure coding practices, handling private keys responsibly, and potential security risks in a decentralized application.

  8. Testing Considerations: Provide guidance on testing strategies for both the smart contract and the frontend application. Encourage users to test thoroughly on the Celo testnet before deploying on the mainnet.

  9. GitHub Repository README Enhancements: In the GitHub repository README, consider adding a table of contents, a brief description of each section, and instructions for contributors who might want to contribute to or run the project locally.

  10. License Information: Consider adding a license file to your GitHub repository to specify how others can use, modify, and distribute your code.

These are general suggestions, and you can adjust them based on the specific needs and audience of your tutorial.

18.75 cUSD
18.75 REP
Submitted

Add Tasks: Users can input tasks and add them to their list. Remove Tasks: Each task can be deleted from the list. Mark as Complete: Users can toggle tasks to indicate completion. Technologies Used: React: For building the user interface. CSS: For styling the application. Git and GitHub: For version control and project collaboration.

0Points
1 Feedbacks
154 REP
Feedback

Hello, your github link is broken/wrong. Kindly update the correct link

658 REP
Submitted

Swappy is a web application that enables users to swap sneakers with other users in the marketplace. I had a lot of fun using Celo Composer. This involves features that: 1. Allows users to list their sneakers 2. Swap their sneakers for other sneakers 3. View swap requests

72Points
2 Feedbacks
154 REP
Feedback

Hello Nahss, I made some improvements to your submission in a PR. Here are the improvements.

  1. Hardcoded project ID: The projectId variable is hardcoded in the code, which could expose it to potential attackers if the code is not properly secured. It's recommended to store the project ID in a secure environment, such as an environment variable, and access it using a secure mechanism.

  2. Potential for type errors: The chains and publicClient variables are declared without explicit types, which could lead to type errors if they are used in a way that is incompatible with their actual types. It's recommended to explicitly declare the types of these variables to improve type safety and prevent potential errors.

  3. Unhandled errors: The code does not explicitly handle errors that might occur, such as errors connecting to the wallet or errors from the wagmiConfig provider. It's recommended to implement proper error handling to gracefully handle potential errors and provide informative feedback to the user.

  4. Potential for injection attacks: The appName property in the connectors function is directly constructed from the document title, which could potentially allow for injection attacks if the document title is manipulated. It's recommended to sanitize and validate the input before using it to construct the appName property.

  5. Unnecessary coolMode prop: The coolMode prop is set to true for the RainbowKitProvider, but there is no indication that this prop is actually used or has any effect in the provided code. It's recommended to either remove the coolMode prop or provide documentation on its usage and purpose.

  6. Missing dependency versions: The code does not specify the versions of the imported dependencies, such as @celo/rainbowkit-celo/chains, @celo/rainbowkit-celo/lists, @rainbow-me/rainbowkit, and wagmi. It's recommended to specify dependency versions to ensure compatibility and avoid potential conflicts.

  7. Unclear error handling for toast: The toast component is used to display messages, but there is no clear handling for potential errors that might occur when interacting with the toast component. It's recommended to implement proper error handling to prevent unexpected behavior or crashes.

FIXES

  1. Secure Project ID Handling:

    • Removed the hardcoded project ID and added a check for its existence in the environment variables. Threw an error if it's missing.
  2. Type Declarations:

    • Added explicit type declarations for chains and publicClient to enhance type safety.
  3. Error Handling:

    • Wrapped the main rendering logic in a try-catch block to handle potential errors and provide informative feedback.
  4. Sanitization for appName:

    • Removed the dynamic construction of the appName from the document title to prevent potential injection attacks. Instead, set it directly to "Swappy Marketplace." Added a comment suggesting validation if necessary.
  5. Unused coolMode Prop:

    • Removed the coolMode prop from the RainbowKitProvider as it was not clear if it had any purpose in the provided code.
  6. Dependency Versions:

    • Added import statements for Chain and ConnectorConfig from "wagmi" to address any potential type errors.
  7. Error Handling for toast:

    • Added a try-catch block around the rendering of the app to handle potential errors, including those related to the toast component.
Submitted

Car Rent DApp! This decentralized application (DApp) is designed for car rental ventures, providing a streamlined process for users to hire cars. Car owners can set their hire rates, and the admin plays a crucial role in approving suitable cars for hire, ensuring the company's image is protected. Features User-Friendly Interface Car Listing: Car owners can list their vehicles for hire as well end user Deployed contract wallet address which is where the admin approves and rejects cars that are not suitable for the company Transaction History Users can view their previous transactions with address they have transact with Real-time Availability-Instant updates on car availability, users can check if a particular car is currently on hire Payment Handling: Secure payment processing, users can only hire a car if the previous user has completed the payment. hosted: https://carrent-dapp.vercel.app/ demo: https://youtu.be/vVF20V4rN2Y

14Points
5 Feedbacks
154 REP
Feedback

Hello Amity, i made some improvement and fixes to your submission in a PR.

The Readme file lacked the appriopriate explanation for the tutorial so i made a more robust tutorial in the new Readme file.

Explanation of Changes In The Smart Contract:

  1. Access Control:

    • Implemented onlyAdmin and onlyCarOwner modifiers for proper access control.
    • Admin can change the car status, and only the car owner can add rents or pay rent.
  2. Reentrancy Vulnerability:

    • Moved the update of the paid flag before transferring the payment to address the reentrancy vulnerability.
  3. Car Availability Check:

    • Added a check in the addRent function to ensure that the car is available for rent.
  4. Event Logging:

    • Introduced events for significant actions, providing a better way to track contract activities.
  5. Unused Variable Removal:

    • Removed the unused variable rentCar for clarity.
  6. Gas Cost Optimization:

    • Optimized getCar and getRent functions for gas efficiency.
  7. Additional Security Considerations:

    • Added the Pausable contract from OpenZeppelin for emergency stopping capability.
  8. Additional Recommendations:

    • Included a constructor to initialize the cUsdToken address.
    • Used OpenZeppelin's Ownable and Pausable for enhanced security features.
18.75 cUSD
18.75 REP
Submitted

I have created a tutorial for art marketplace explain every concept of creating an art marketplace.

14Points
2 Feedbacks
154 REP
Feedback

Hello, i made some changes and improvements to your submission. Here's a breakdown of the changes made in the new code:

General:

  • Access Control Modifiers: The new code introduces modifiers onlyOwner and validArtId to restrict access to certain functions and ensure valid artwork IDs are used.

Specific Changes:

  • Constructor: No changes.
  • Structs: No changes to field names, but consider using more descriptive names in the future.
  • Mappings: No changes.
  • Events: No changes to event names or arguments, but consider using more descriptive variable names within events.
  • uploadArtwork: No significant changes, but function names are now more descriptive.
  • getArtDetails: Added validArtId modifier.
  • deleteArt: Added onlyOwner and validArtId modifiers, and uses delete arts[_artId] directly for deletion.
    • Note: While deletion efficiency is improved, reentrancy vulnerability remains in buyArt.
  • buyArt: Added validArtId modifier, but still vulnerable to reentrancy attacks.
  • addComment: Added validArtId modifier and requires comment content to be non-empty.
  • getComments: Added validArtId modifier.
  • addLike: Added validArtId modifier.

Additional Considerations:

  • The new code addresses typos present in the first version.
  • Security improvements are made with access control modifiers, but reentrancy vulnerability remains in buyArt.
  • Code readability could be further improved with more descriptive variable names and comments.
  • Error handling and unit testing are still recommended for a robust contract.
7.5 cUSD
7.5 REP
Submitted

CeduChain is an onchain schooling system built on Celo, it revolutionizes the traditional schooling system by decentralizing the learning process, empowering participants, and fostering a global learning community where knowledge is freely shared and accessible to all.

16Points
2 Feedbacks
154 REP
Feedback

Your github link is broken

0.25 REP
Submitted

created a celo tutorial on payment system

15Points
1 Feedbacks
154 REP
Feedback

Hello, i made some improvements to your submission. Here are some corrections and improvements to ensure best practices, remove bugs, and clarify explanations in your Celo smart contract tutorial:

Corrections and Improvements

  1. Grammar and Typo Fixes:

    • Correct spelling errors such as "for mor info" to "for more info".
    • Consistent use of capitalization and punctuation for headers and sentences.
    • Change "visit celo" to "visit Celo's official website".
  2. Content Formatting:

    • Improve the structure by using clear subheadings, bullet points, and proper code formatting.
    • Ensure all code blocks are properly indented and labeled for clarity.
  3. Use Correct Descriptions:

    • In the pragma solidity explanation:
      • Remove redundancy: "pragma solidity ^0.8.0" does not specify minimum and maximum versions separately. Instead, it's a directive that specifies compatibility with versions 0.8.0 and above.
    • Correct the explanation of the IERC20Token interface to be more concise and accurate.
  4. Clarify Terms and Concepts:

    • Correct the description of the IERC20 interface and its purpose.
    • Clarify what the Employee struct represents and the purpose of each field.
    • Correct the description of the mapping and provide a better explanation of its use case.
  5. Best Practices for Solidity Development:

    • Replace hardcoded addresses like 0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1 with a more generic placeholder or explanation (e.g., “address obtained from the wallet”).
    • Ensure that your code checks for potential issues like overflows or token approval management.
    • Use safeTransferFrom instead of transferFrom to handle failures gracefully (if using OpenZeppelin's SafeERC20 library).
  6. Additional Checks and Security Improvements:

    • Add require statements to validate that _tokenAddress is a contract address.
    • When using external calls (e.g., token transfers), check for their return values or use safer libraries like OpenZeppelin's SafeERC20.
    • Update the description of onlyOwner to mention that it restricts function access to the contract owner.
  7. Code Enhancements:

    • Correct minor bugs and improve function logic:
      • Ensure that functions like removeEmployee and payAllEmployees handle edge cases, such as arrays becoming empty or handling insufficient token balances properly.
  8. Update Full Code Block:

    • Ensure the full code example reflects best practices:
      • Include comments and documentation strings (using triple slashes ///) for function descriptions.
      • Ensure that contract functions are correctly organized, modular, and maintainable.
7.5 cUSD
7.5 REP
Submitted

Building a Decentralized Lottery on the CELO Blockchain: From Smart Contract Development to Deployment

14Points
3 Feedbacks
154 REP
Feedback

Hello Bodman, I've made some improvements to your submission in a PR.

Changes Made in the Tutorial:

  1. Gas Optimization:

    • Suggested a payout mechanism that transfers a specific percentage of the contract balance.
    • Mentioned the possibility of introducing tiered prizes based on participant contributions.
  2. Reentrancy Attacks:

    • Pointed out the vulnerability in the endRound function.
    • Advised using reentrancy protection mechanisms like checks-effects-interactions or the Solidity reentrancy guard modifier.
  3. Randomness Generation:

    • Discussed the limitation of using keccak256 for randomness.
    • Proposed using Chainlink's Verifiable Random Function (VRF) for more secure and unpredictable random numbers.
  4. Event Logs:

    • Suggested additional events for better transparency and tracking, such as RoundStarted, PlayerEntered, and RoundEnded.
  5. Clarifications:

    • Questioned the rationale behind the minimum player threshold of 1.
    • Suggested explaining the reasoning in comments or code documentation.
  6. Additional Points:

    • Advised against hardcoding the round duration and proposed making it a deploy-time parameter or allowing the manager to modify it.
    • Proposed combining the restricted and roundActive modifiers into a single modifier for better code simplicity.
    • Suggested adding comments throughout the code for better understanding and maintainability.
  7. Typos and Code Style:

    • Fixed missing semicolon in the startNewRound function.
    • Replaced hours with 24 * 3600 for consistent time units.
    • Corrected the order of emitting the LotteryWinner event in the endRound function.
    • Noted the incorrect link in the Deployment to Remix section.
    • Suggested more descriptive variable names (e.g., roundDuration).
    • Advised adding consistent whitespace around operators and after commas for better code formatting.
  8. Miscellaneous:

    • Ensured the restricted modifier checks for an active round.
    • Clarified that the code in Section 3 is a complete, modified version of the original code.
Submitted

In this article, I provided a structured guide on deploying, debugging, and monitoring a Solidity smart contract on the Celo blockchain.

14Points
3 Feedbacks
154 REP
Feedback

I've reviewed the code and the accompanying guide, and I have not identified any errors in the code itself. The code appears to be well-structured and follows best practices for writing Solidity smart contracts.

However, I do have a few recommendations for improving the clarity and completeness of the guide:

  1. Code Comments: While the code is clear, adding comments to explain the purpose of functions, variables, and complex logic can enhance readability, especially for those who are new to Solidity.

  2. Deployment Script: In the deployment script, it would be helpful to include comments explaining each step, such as deploying the contract and setting its initial parameters. This will assist readers in understanding the deployment process.

  3. Error Handling: It's beneficial to include information on error handling strategies, such as how to handle deployment failures or transaction reverts. This can help developers anticipate and address potential issues.

  4. Security Considerations: Mentioning common security considerations, such as using the latest version of Solidity, conducting security audits, and following best practices like the OpenZeppelin library, would be valuable for developers aiming to deploy secure contracts.

  5. Testing: Consider including information on how to write and run tests for the smart contract. Testing is a crucial part of the development process, and guidance on this topic can be beneficial.

  6. Gas Costs: Discuss gas costs and optimization techniques, especially in the context of Celo, where gas costs can impact contract interactions significantly.

Overall, the code itself appears sound, but enhancing the guide with the above suggestions can make it more comprehensive and helpful to developers.

18.75 cUSD
18.75 REP
254 REP
Submitted

# This tutorial guides you through the process of building a decentralized crowdfunding platform on the Celo blockchain. After completing this tutorial, you will learn: - How to set up a project with Celo’s ContractKit library. - The fundamentals of Celo’s crowdfunding system and its importance. - How to fetch real-time information from the blockchain. - How to ensure reliability and security in your platform. - How to define, query, and fulfill data requests in smart contracts. - How to test and validate your platform. - How to handle and verify data from oracles.

14Points
3 Feedbacks
154 REP
Feedback

Hello Spydiecy, i made some few improvements and fixes to your submission. Here is the information on what has been changed:

  1. Consistent Terminology:

    • Ensured consistent terminology throughout the tutorial, using "Celo blockchain crowdfunding" consistently.
  2. Code Comments:

    • Suggested the addition of comments in the code snippets to explain specific sections or functions, enhancing readability for beginners.
  3. Completed Placeholder in Smart Contract:

    • Removed the placeholder comment in the Crowdfunding.sol smart contract and provided a basic structure with a note to add implementation for key functions.
  4. Deployment Instructions:

    • Emphasized the importance of more detailed deployment instructions, especially for beginners, and suggested mentioning the tools or services needed for deployment.
  5. Security Considerations:

    • Emphasized the importance of security in smart contract development and suggested adding a section on best practices for writing secure smart contracts.
  6. Testing Section:

    • Suggested elaboration on the testing process for the smart contract and server, including examples of test cases for reliability and correctness.
  7. Formatting and Styling:

    • Emphasized the need for consistent formatting and styling throughout the tutorial, including headings, subheadings, and code formatting.
  8. Interactive Elements:

    • Suggested adding interactive elements or challenges throughout the tutorial to engage readers and reinforce their understanding.
18.75 cUSD
18.75 REP
18 REP
Submitted

WEB3 is revolutionary in every manner, except for how it expects you to go and check again and again for simple things instead of delivering important notifications and alerts right to you like every app in WEB2 land does. This leads to bad UX and forces people to open these apps again and again just to check what's changed while they were away. CPNS is here to change that. https://cpns-dashboard.web.app/

12Points
2 Feedbacks
154 REP
Feedback

Hello i made some improvements and changes to your submission. Here's a review of your Solidity contract, PushNotifications, along with suggestions for improvements and fixes:

Issues and Fixes

  1. Unused and Extraneous Code:

    • Remove the stray q character in the code.
    1// Remove the following line 2q
  2. Outdated Solidity Version Directive:

    • The pragma directive for the Solidity compiler version is commented out. It should be uncommented and potentially updated.
    1// Uncomment and update the pragma directive 2pragma solidity >=0.4.22 <0.9.0;
  3. Using ABIEncoderV2:

    • The pragma experimental ABIEncoderV2 directive is now fully integrated and no longer experimental. However, you may need it for older versions of Solidity.
    1// If using Solidity >= 0.8.0, you can remove this line 2// pragma experimental ABIEncoderV2;
  4. Event Parameter Order:

    • Consider reordering parameters for the events to group related fields together, which can improve readability.
  5. Channel Management:

    • The createChannel function can be simplified using the constructor for Channel.
    1function createChannel( 2 string memory _name, 3 string memory _description, 4 string memory _iconHash, 5 string memory _badgeHash 6) public returns (uint256) { 7 channels.push(Channel({ 8 name: _name, 9 description: _description, 10 iconHash: _iconHash, 11 badgeHash: _badgeHash, 12 admin: msg.sender, 13 subscribers: new address 14 })); 15 return channels.length; // returns the new length of channels array 16}
  6. Subscription Management:

    • Optimize unsubscribe function to avoid unnecessary variable usage.
    1function unsubscribe(uint256 _channel) public returns (bool){ 2 require(_channel < channels.length, "channel does not exist"); 3 require(subscriptions[msg.sender][_channel] == true, "You should be subscribed already"); 4 5 subscriptions[msg.sender][_channel] = false; 6 Channel storage channel = channels[_channel]; 7 uint256 length = channel.subscribers.length; 8 for (uint256 i = 0; i < length; i++) { 9 if (channel.subscribers[i] == msg.sender) { 10 // Move the last element into the place to delete 11 channel.subscribers[i] = channel.subscribers[length - 1]; 12 channel.subscribers.pop(); // Remove the last element 13 break; 14 } 15 } 16 return true; 17}
  7. Security:

    • Ensure access control checks are consistent and clear.
    1function notifyOneInChannel( 2 address _recipient, 3 uint256 _channel, 4 string memory _title, 5 string memory _action, 6 string memory _body, 7 string memory _imageHash, 8 bool _privateNotification 9) public returns (bool) { 10 require(_channel < channels.length, "channel does not exist"); 11 Channel memory channel = channels[_channel]; 12 if (_privateNotification) { 13 require(channel.admin == msg.sender, "Private notification can only be sent by the admin."); 14 } else { 15 require(channel.admin == msg.sender || pushAccess[_channel][msg.sender], "Only admin or authorized addresses can send public notifications."); 16 } 17 require(subscriptions[_recipient][_channel], "Recipient must be subscribed to the channel."); 18 emit NotifyOneInChannel(_recipient, _channel, _title, _action, _body, _imageHash, _privateNotification); 19 return true; 20}
  8. Gas Optimization:

    • Use memory for struct and array copies only when necessary to save gas.
    1function notifyAllInChannel( 2 uint256 _channel, 3 string memory _title, 4 string memory _action, 5 string memory _body, 6 string memory _imageHash 7) public returns (bool) { 8 require(_channel < channels.length, "channel does not exist"); 9 Channel storage channel = channels[_channel]; 10 require(channel.admin == msg.sender || pushAccess[_channel][msg.sender], "Only admin or authorized addresses can send notifications."); 11 emit NotifyAllInChannel(_channel, _title, _action, _body, _imageHash); 12 return true; 13}

Additional Improvements

  1. Documentation:

    • Add NatSpec comments to document each function, event, and the contract itself.
    1/// @title Push Notifications Contract 2/// @notice This contract allows creation and management of notification channels 3/// @dev All function calls are currently implemented without side effects
  2. Function Visibility:

    • Explicitly declare visibility for all state variables and functions. It improves clarity and security.
    1Channel[] public channels; // public visibility 2 3// Ensure all functions have visibility modifiers (public, internal, etc.)
  3. Error Messages:

    • Make error messages more descriptive.
    1require(_channel < channels.length, "Channel does not exist."); 2require(subscriptions[msg.sender][_channel] != true, "Already subscribed.");
  4. Modularity:

    • Consider breaking down larger functions into smaller, more manageable functions if they become too complex.
Submitted

I built a hotel room marketplace that allows users to be able to make reservations to nice hotels for their trips. Users pay the booking price for the hotel room and the amount is usually calculated by the number of nights the user wishes to stay in the hotel.

95Points
2 Feedbacks
154 REP
Feedback

Hello, I've gone through your submissions and i made some new improvements and corrections to the smart contract. Below are the changes made

  • I added a check in the ''endReservation'- function to ensure that only the owner or the current reserved address can end a reservation.

  • I adjusted the calculation of 'bookingFee' and 'totalFee' to prevent overcharging the reservation fee.

  • I modified the ownership check in the 'endReservation'' function to ensure that the caller is indeed the owner of the room.

-Also I changed the 'currentReservedTo' value to address(0) when the reservation ends, and the 'currentBookingFee' is reset to 0.

with these changes I'm optimistic your marketplace contract will be more secure. do have a great day

Submitted

website url : https://celo-dao-ten.vercel.app/ CELODAO is a platform that enables decentralized governance and operation of organizations that is built on CELO blockchain. It allows users to become stakeholders by contributing a certain amount of resources. Stakeholders within the DAO have the ability to raise proposals, which are then voted upon by other stakeholders. The voting period for each proposal is stipulated to be 5 minutes. Once the voting period ends, payment is made to the beneficiary by the deployer(address) if the number of upvotes exceeds the number of downvote. However, it's important to note that only the deployer account has the authority to process payments within the DAO. It is important to note that, nobody can make proposal unless they are stakeholders.

16Points
3 Feedbacks
154 REP
Feedback

Hello blockend_dev, I've gone through your submission and i made some improvement to your contract. Below are the changes made in the PR.

  1. Modifier Names and Usage:

In the modifiers stakeholderOnly, contributorOnly, and onlyDeployer, the string parameter should be named message for consistency. While using msg.sender in the onlyDeployer modifier is fine, it might be more secure to have a more detailed authentication process, like implementing OpenZeppelin's Ownable pattern, especially for crucial operations like payments.

  1. Visibility Level of Functions:

Ensure that the functions have the correct visibility level. For instance, pay function can be private as it's used internally.

  1. Error Handling:

Consider using specific error messages for better debugging and understanding. Potential Reentrancy Vulnerability:

ReentrancyGuard is being used, but ensure that no state changes occur after interacting with external contracts. Double-check to prevent potential reentrancy issues.

  1. Gas Limitation:

The contract's functionality might become limited due to the block gas limit. Consider implementing a way to paginate the returned data for proposals and votes if the contract is expected to handle a large volume of data.

  1. Use of revert:

The use of revert for handling errors might be excessive. Consider using require statements with specific error messages for better clarity.

  1. Gas Costs and External Calls:

Gas costs might escalate due to the external calls (pay) and storage operations. Ensure there's enough gas allocated to these functions.

  1. Security for Double Voting:

The handleVoting function checks for double voting but uses a storage mapping stakeholderVotes. It's important to secure this data against potential attacks and ensure there are no vulnerabilities related to this mapping.

  1. Gas Limit and Loops:

Be cautious about loops and gas limits in functions like getAllProposals. If the number of proposals grows, the loop might reach the block gas limit, making the function unusable.

Submitted

I built the marketplace that allows user to view, buy, add, delete their products in the marketplace. I added a new feature that allows the marketplace to keep track of user transactions done on the marketplace.

79Points
2 Feedbacks
154 REP
Feedback

Hello, i just made some corrections and comments to your 'useContractWrite.ts' under 'react-app' folder. Below are the corrections made To improve the code's readability, I defined a constant GAS_LIMIT for the gas limit. Additionally, I fixed a type issue by casting the address as a string with the "0x" prefix within backticks. To make the code more understandable, I added comments that explain the code's purpose and how the functions are used. Finally, I used 'console.error' for error handling to make errors more prominent in the console output.

14 REP
Submitted

# CRUZZER NFTs ## Live Link https://cruzzer.vercel.app/ ## Overview **CRUZZER NFTs** is a PoC NFT marketplace smart contract and decentralised application that allow users to perform the following: - Mint Custom NFTs - Put up Minted NFTs for sale - Buy NFTs from other users of the application ## Functionalities, Structures and Setup ### Structures 1. NFTDetails A struct for holding associated details of a particular NFT ```solidity struct NFTDetails { address payable owner; bool forSale; uint price; uint tokenId; string name; string desc; string tokenURI; } ``` 2. minted An array of NFTDetails objects ```solidity NFTDetails[] minted ``` ### Functionalities 1. **mintToken** - **functionality**: Mints a new NFT and transfers it to the address of the user - **params**: name, desc and \_tokenURI - **returns**: NFTDetails 2. **makeNFTSellable** - **functionality**: makes an NFT sellable buy transfering ownership to the contract's address - **params**: tokenId and price - **returns**: NFTDetails 3. **makeNFTNonSellable** - **functionality**: makes an NFT non-sellable buy transfering ownership from the contract's address back to the user who created it. - **params**: tokenId - **returns**: NFTDetails 4. **buyNFT** - **functionality**: buys an NFT from the marketplace buy transferring its ownership to the caller and transferring CELO (the attached price) to the address of the NFT creator. - **params**: tokenId 5. **getNFTs** - **functionality**: get all the minted NFTs - **returns**: NFTDetails[] (an array of NFTDetails objects) ### Setup 1. Installation: run `pnpm i` in the `nft` directory to install required dependencies 2. Compilation: run `pnpm exec hardhat compile` 3. Testing: run `pnpm exec hardhat test` 4. Deployment: run `pnpm exec hardhat run ignition/module/Cruzzer.ts` for local deployment and `pnpm exec hardhat run --network alfajores ignition/module/Cruzzer.ts` for deployment on Celo's Alfajores' testnet. ## User Interface The user interface has been developed with a JavaScript framework, Next.js v14 and helper libraries mainly - **RainbowKit** and **TransactQuery** for wallet connections - **Wagmi** for contract interaction (send read and write transactions) - **Viem** for utilities and interfaces (parsing and formatting ether, etc) ### Pages - **Home**: Provides a welcome screen and overview of the DApp - **Minter**: Provides a form for minting NFTs - **Bazaar**: Provides a marketplace for viewing, buying and setting minted NFTs as "for sale" or "not for sale" ### Setup 1. Installation: run `pnpm i` in the `dapp` directory to install required dependencies 2. Local deployment: run `pnpm dev` to use the DApp in the development. 3. Production deployment: run `pnpm build` and follow the instructions for your preferred hosting platform to host the DApp and use it in live mode.

16Points
2 Feedbacks
154 REP
Feedback

Hello, i made some improvements and changes to your submission. 1. Reentrancy Attack:

  • The buyNFT, placeBid, and endAuction functions are now marked with nonReentrant from the ReentrancyGuard contract, preventing reentrancy attacks.

2. Missing Functionality:

  • A withdrawFunds function is added, allowing the owner to withdraw accumulated funds from NFT sales.

3. Additional Considerations:

  • Access Control: The contract inherits from Ownable, allowing the owner to restrict certain functions using modifiers like onlyOwner.
  • Events: The NFTAction event now emits only essential information about the action (owner, forSale, price, tokenId).
  • ERC721Enumerable: The contract inherits from ERC721Enumerable for efficient iteration over all NFTs.
  • Royalty: A royalty system is implemented where a portion of the sale price goes to the original creator.

4. Additional Notes:

  • The createNFTDetails function is removed as it's no longer needed since the details are directly constructed in the minting functions.
  • The getNextTokendId function is also removed as the nextTokenId variable now serves the same purpose.
  • The batchMintToken function is partially implemented but requires further logic to complete the minting process in a loop.

This improved code addresses the previous vulnerabilities and offers additional functionalities for a more robust and secure NFT marketplace.

7.5 cUSD
7.5 REP
Submitted

Celo DID App is a decentralized identity is nice and responsive application built on the Celo blockchain. It allows users to manage their identities securely on the blockchain.

15Points
2 Feedbacks
154 REP
Feedback

Hello Bodman, i made some changes and improvements to your submission in a PR.

Here are the changes made in the new code:

  1. Array Index Issue:

    • In the getAllIdentities function, the loop now starts from 0 to fix the off-by-one error.
  2. Gas Optimization:

    • The identityCount variable is now declared as uint256 public identityCount; to automatically generate a getter function.
  3. Security:

    • Modified the modifiers (onlyIdentityOwner, onlyVerifier, onlyRevoker, and onlyDeleter) to accept the identity owner as a parameter to avoid potential issues with msg.sender value being changed within the function execution.
  4. Documentation:

    • Although not explicitly shown in the code, I recommend adding or improving comments and documentation to explain the purpose and usage of the contract, functions, and modifiers.
  5. Gas Costs:

    • The code structure and gas efficiency considerations were mentioned, but the specific implementation details depend on the specific use case and requirements.
  6. Input Validation:

    • Added additional input validation for the age parameter to ensure it's greater than zero.
  7. Minor Improvements:

    • Improved the consistency of variable types by using uint256 consistently.
    • Adjusted the loop condition in the getAllIdentities function.
18.75 cUSD
18.75 REP
Submitted

By leveraging the power of the Celo blockchain, I've created a platform that is transparent, secure, and efficient. The app allows users to create fundraising campaigns, set donation targets, and accept donations from around the world using Celo's native asset. One of the key benefits of the app is the ability to track the flow of funds in real-time. The Celo blockchain's decentralized ledger ensures that all transactions are recorded and verified, providing donors with greater confidence that their donations are being used for their intended purpose. By creating a transparent and secure platform for fundraising, I've opened up new opportunities for people to raise funds and make a difference in the world. Link of DApp: https://dacade-gof-fund-me3.vercel.app/

0Points
5 Feedbacks
154 REP
Feedback

Here are some potential issues that I noticed in the code:

  1. Possible integer overflow in the contribute function: The contribute function accepts an amount parameter of type uint256. However, there are no checks to ensure that the amount entered does not cause an integer overflow. This can result in unexpected behavior, and in some cases, it can allow an attacker to steal funds from the contract.

  2. The GoalReached event does not include the amountRaised parameter: The GoalReached event is emitted when the funding goal is reached. However, the event does not include the amountRaised parameter, which would be useful information to include in the event log.

  3. Lack of access control: There are no access controls in the contract, meaning that anyone can call the contribute function and withdraw funds from the contract. This could be a potential security issue, as it allows anyone to drain the funds from the contract.

  4. No mechanism to withdraw funds: Currently, there is no way for the owner of the contract to withdraw the funds. This could be a problem if the contract receives a large amount of donations and the owner needs to withdraw them.

  5. The totalDonations variable is redundant: The contract already has an amountRaised variable that tracks the total amount of funds raised. The totalDonations variable is redundant and can be removed.

  6. The constructor function does not set the owner variable: The constructor function sets the funding goal and the deadline, but it does not set the owner variable. This means that there is no way to determine who the owner of the contract is.

  7. The contribute function does not check for the funding goal: The contribute function accepts donations even after the funding goal has been reached. This means that the contract can receive more funds than necessary, which could be a problem if the owner wants to refund the excess funds to the donors.

Submitted

The CeloNFT is an NFT marketplace for minting, buying, and selling Non-Fungible Tokens (NFTs) built on celo blockchain. It allows users to mint new NFTs with associated metadata, list them for sale, purchase NFTs, and retrieve information about NFTs. website url : https://celo-nft-marketplace-phi.vercel.app/ USAGE FUNCTION Deploy the smart contract to the Celo or alfajores testnet. Call the createToken function to mint a new NFT and associate it with metadata. Call the sellNFT function to list an NFT for sale, transferring ownership upon successful purchase. Use the allNfts function to retrieve information about all NFTs on the marketplace. Use the singleNFT function to retrieve information about a specific NFT. Use the userNfts function to retrieve information about all NFTs owned by the caller. The user interface is being developed using a common JavaScript framework built on top of React, specifically Next.js.

14Points
8 Feedbacks
154 REP
Feedback

Hello Blockend_dev

I created a PR to fix some potential bugs and errors in your project. Below are the improvements and corrections made

  1. The createNFT() function is not marked as internal. This means that anyone can call this function, even though it should only be called internally by the contract. This could be a security risk, as it would allow malicious users to create NFTs and set their prices arbitrarily.

  2. The sellNFT() function does not check if the sender actually owns the NFT they are trying to sell. This means that anyone could call this function to sell an NFT that they don't own, which could lead to fraud.

  3. The allNfts() function returns an array of all NFTs, even those that have already been sold. This could be confusing for users, as it would make it look like they can still purchase NFTs that are no longer available.

  4. The userNfts() function is not very efficient. It iterates over all NFTs and checks if each one is owned by the sender. This could be slow for contracts with a large number of NFTs.

Here are some suggestions for fixing these bugs and errors:

  1. Mark the createNFT() function as internal. This will prevent anyone from calling this function except for other functions within the contract.

  2. Add a check to the sellNFT() function to make sure that the sender actually owns the NFT they are trying to sell. This can be done by using the ownerOf() function from the ERC721 contract.

  3. Only return NFTs that have not yet been sold in the allNfts() function. This can be done by checking the sold field of each NFT.

  4. Use a more efficient algorithm to retrieve all NFTs owned by a user in the userNfts() function. One way to do this is to use a mapping to track which NFTs are owned by each user.

In addition to the above, I would also added some additional security checks to the contract, such as:

Check the msg.value in the sellNFT() function to make sure that it is equal to the price of the NFT. This will prevent users from sending too much or too little money when purchasing an NFT.

Check the return value of the call() function in the sellNFT() function to make sure that the payment to the seller was successful. This will prevent fraud in case the seller's address is no longer valid.

Submitted

# Faucet FCT Token Dapp ## Link to the dapp https://dacade-faucet-101.vercel.app/ ## Feature You can claim 50 FCT token each day for each address ## Contracts FCT Token Contract: 0x16289662Ad77589eEDE7F4a4AB8e660e475c790C Faucet Contract: 0x3a86071F4470eF6Fa1734c59FC3ea76e191e6486

20Points
2 Feedbacks
154 REP
Feedback

Hello Oxjackcorote, I made some improvements and fixes to your submission in a PR. Changes made:

  • Reordered modifiers and events for clarity.
  • Changed nextAccessTime to lastAccessTime to better reflect its purpose.
  • Added reentrancy protection to requestTokens by checking the balance before and after state changes.
  • Modified lock time calculation in setLockTime to ensure a valid lock time duration.
  • Updated the withdraw function to check for a positive balance before transferring tokens.
  • Made the owner variable public for transparency.
18.75 cUSD
18.75 REP
Submitted

This an Artisan market place where users can: Hire and sell their artisan skill products on the celo Blockchain. Apply a coupon code to get discount of 30%. View an artisan details.

15Points
2 Feedbacks
154 REP
Feedback

Hello Kencodes, I have made some changes and improvements to your smart contract in a PR. Below is the modifications made.

  1. the Potential Reentrancy Vulnerability: The hireArtisan and hireArtisanForDiscount functions do not include reentrancy protection, making the contract vulnerable to reentrancy attacks. The contract now uses OpenZeppelin's Ownable for access control and ReentrancyGuard to prevent reentrancy attacks. The contract is now more secure and easier to manage. Only the owner can control the contract, and it's protected from reentrancy attacks.

  2. No Input Validation: The contract does not perform any input validation for parameters passed to functions, leaving it susceptible to malicious or erroneous inputs. The owner can set the token address using the 'setTokenAddress' function.

  3. Lack of Access Control: The contract allows anyone to add artisans and hire them. In a real-world application, you'd likely want to implement access control to restrict certain functions to authorized users only. Artisans must have a price greater than zero before being added to the marketplace.

  4. No Event for Artisan Creation: There is no event emitted when a new artisan is added to the marketplace, making it harder for external applications to track changes in the marketplace. Events are emitted when artisans are added or hired, making it easier to track changes and interactions with the contract.

  5. Improved Transfer Efficiency: Token transfers are now handled by a single function, reducing code duplication and improving efficiency.

18.75 cUSD
18.75 REP
Submitted

Meet Deadstreet ,a decentralized pastebin service leveraging the Celo blockchain for secure, anonymous, and immutable text storage. Easily create and share text snippets with a decentralized network ensuring privacy and reliability. You can test it on minipay (test page option) (developer options +testnet must be on). for metamask you need to be connected to celo testnet alfajores network. to test it the link is .https://deadstreet.vercel.app/

17Points
1 Feedbacks
154 REP
Feedback

Hello, i made some improvements and changes to your submission.

Improvements:

  • Error Handling:
    • executeContractMethod handles potential errors during contract method calls.
    • Individual functions handle invalid inputs and ownership checks before interacting with the contract.
    • Event listeners handle potential errors during event subscription.
  • Security Considerations:
    • Input validation for functions like createPaste, deletePaste, and updatePaste prevents invalid data from reaching the contract.
    • Ownership checks in deletePaste and updatePaste restrict unauthorized actions.
  • Code Readability and Maintainability:
    • Clear function names and comments improve code understanding.
    • executeContractMethod abstracts error handling and gas estimation logic.
    • Additional functions like updatePaste demonstrate extensibility.
  • Functionality:
    • updatePaste allows modifying existing paste content with ownership checks.

Overall, the code demonstrates significant improvements in error handling, security considerations, readability, and functionality compared to the previous version.

Submitted

I added some features to Celo Marketplace, now users can see that a product is available for purchase or not in the main page and they can purchase a product more than once in one purchase.

80Points
4 Feedbacks
154 REP
Feedback

Hi Salai,

I reviewed your project and found some errors and bugs. I made corrections and improvements in a PR. Here are the changes:

Renamed the variable "purchaseTx" to "createProductTx" in the handleCreateProduct function to match the name of the writeProduct function.

Added a check in the addProduct function to verify if the user is connected to the wallet before adding a product to the marketplace.

Added a check in the addProduct function to ensure that the user has enough cUSD before adding a product to the marketplace.

Fixed the declaration of the productPriceInWei variable by passing a string argument instead of a number.

Set the displayBalance state to true by default, as the user's cUSD balance should be displayed by default.

Also, I made changes related to initializing productPrice and productSupply as strings, ensuring that createProductTx matches the function name, and checking if the user is connected before adding a product.