Skip to content

Latest commit

 

History

History
179 lines (145 loc) · 5.31 KB

README.md

File metadata and controls

179 lines (145 loc) · 5.31 KB

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