Coder Social home page Coder Social logo

crowdy's Introduction

cgapp logo
Crowdy

Crowdy is a crowd funding smart contract based on Ethereum blockchain, built with solidity and HardHat(for Testing and deployment).

maintained license

Contract Address

0x352CfCce7e597eC550990e888aA738fa2149fceA

Verify on Etherscan


๐Ÿ“ƒ Table of contents

๐Ÿ”ง Tech Stack

Solidity hardhat Infura vercel

๐Ÿ“ฅ Installation

  • Start by cloning the repo with following command
git clone https://github.com/akashvaghela09/crowdy.git

๐Ÿ”— Setup Backend

go to the backend folder and install dependencies

cd backend && npm install

Create environment variables inside .env file as mentioned below

SEPOLIA_RPC_URL
ETHERSCAN_API_KEY
PRIVATE_KEY

๐Ÿค– Commands

  • Start local hardhat node
npx hardhat node
  • Compile contracts
npx hardhat compile
  • Run tests
npx hardhat test
  • Run coverage
npx hardhat coverage
  • Deploy contracts to local hardhat node
npm run deploy-local
  • Deploy contracts to sepolia testnet
npm run deploy-sepolia
  • Verify contracts on sepolia testnet
npm run verify-sepolia

Technical Details

Feature Details
Programming Language Solidity
Version 0.8.9
Contract CrowdFunding
License MIT
Description A smart contract for crowdfunding projects.

Variables

Variable Description
nextId ID for the next project.
totalFundingRaised Total amount of funding raised.
dayCount The current day count.
owner The owner of the contract.
fundingRecords Mapping of Funding struct to their IDs.

Structs

Struct Description
Funding Struct for storing project details, including ID, title, target amount, collected amount, deadline, status, and contributors.
Contributor Struct for storing contributor details, including refund ID and funded amount.

Events

Event Description
newProjectAdded Broadcast that new projects is added.
contributionAdded Broadcast that contributions is added.
projectClosed Broadcast that projects is now closed.
refundTransferred Broadcast that refunds has transferred.

Modifiers

Modifier Description
checkIfOwner() Checks if the caller is the contract owner.
checkIfReceiver() Checks if the caller is not the receiver of the funding.
checkIfOpen() Checks if the funding project is open.
checkFundingAmount() Checks if the funding amount is valid.
checkIfValid() Checks if the funding project is valid (not paused).

Functions

Function Description
addForFunding() Adds a new project for funding.
contribute() Contributes funds to a project.
refundFunds() Refunds funds to contributors for a specific project.
pauseFunding() Pauses funding for a specific project.
updateCounter() Update day count.
getProjectData() Retrieves the data of a specific project.
getAllProjectsData() Retrieves the data of all projects.
totalProjects() Retrieves the total number of projects.
getTotalFundRaised() Retrieves the total amount of funding raised.

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป Contributor

๐Ÿ“ฉ Contact Me ๐Ÿ‘‡

GitHub Linkedin Twitter

crowdy's People

Contributors

akashvaghela09 avatar

Stargazers

Savjit Thoriya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.