Crowdy
Crowdy is a crowd funding smart contract based on Ethereum blockchain, built with solidity and HardHat(for Testing and deployment).
0x352CfCce7e597eC550990e888aA738fa2149fceA
Verify on Etherscan
Start by cloning the repo with following command
git clone https://github.com/akashvaghela09/crowdy.git
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
Deploy contracts to local hardhat node
Deploy contracts to sepolia testnet
Verify contracts on sepolia testnet
Feature
Details
Programming Language
Solidity
Version
0.8.9
Contract
CrowdFunding
License
MIT
Description
A smart contract for crowdfunding projects.
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.
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.
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.
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).
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.