Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a simple Crowdfunding contract example #60

Closed
coxmars opened this issue Dec 11, 2024 · 46 comments · Fixed by #83
Closed

Implement a simple Crowdfunding contract example #60

coxmars opened this issue Dec 11, 2024 · 46 comments · Fixed by #83
Assignees
Labels
difficult: medium enhancement New feature or request ODHack11 This issue will be available ONLY during the ODHack11

Comments

@coxmars
Copy link
Contributor

coxmars commented Dec 11, 2024

Implement Simple Crowdfunding System

Objective

Create a contract that allows users to raise funds for a project with a target amount and deadline.

Basic Features

  • Create campaign with funding goal and deadline
  • Allow contributions
  • Automatically end campaign at deadline
  • Return funds if goal is not met
  • Transfer funds to creator if goal is met

Technical Considerations

  • Safe timestamp handling
  • Automatic refund system
  • Track contributions per address
  • Campaign states (Active, Successful, Failed)

Documentation

📜 Additional Notes

Do not apply until the ODHack begins.
Read our guidelines before applying.

@danielcdz danielcdz added ODHack11 This issue will be available ONLY during the ODHack11 and removed actual: 3 labels Dec 11, 2024
@dlaciport
Copy link

Hi, can I work on this issue @coxmars, I have experience in Cairo and worked on various projects(Shinigami, Art-peace,...)

@aradix16
Copy link
Contributor

Hi ! I've already contributed to this project during ODHack10 and would love to keep learning Cairo by working on this issue.
During ODHack, I implemented a fibonacci example in Cairo and also coded an ERC721 contract for another project, so I'm confident I could implement this crowdfunding contract in a few days.
Thanks!

@anonfedora
Copy link

anonfedora commented Dec 12, 2024

I'm Anonfedora, a full stack Blockchain developer, proficient in Cairo, Rust, Nestjs, testing frameworks (Backend heavy)...

  1. Campaign Structure: Define a struct to store campaign details (creator, funding goal, deadline, contributions, and state).
  2. Will ceate Campaign contract: Implement a function to initialize campaigns with a funding goal, deadline, and creator address.
  3. Contribute: Allow users to send funds, track contributions per address, and update the campaign's total funds.
  4. End Campaign: Implement a function to check the deadline, mark campaigns as successful/failed, and handle fund transfers or refunds.
  5. State and Safety: Use enums for campaign states, and ensure secure handling of timestamps and fund transfers using checks and safe math practices and write unit tests for the functions.
    ETA: 72 HOURS

@manlikeHB
Copy link
Contributor

Hi, I am a returning contributor and a Cairo Developer with great experience contributing to lots of amazing Cairo projects. can I work on this?

@ChrisFernandezVivas
Copy link

hi , im from dojo coding ETA 2 days

how to solve?

1- define the crowdfunding your goal , your owner, your investor etc
2- create several functions like deposit Monet, withdraw funds
3- function to know when the objective has been achieved the crodwnfunding end campaign
4- function for automatic refund if the goal is not reach
5- try compile
6-search bugs

@jaiminRaiyani
Copy link

Would love to tackle this!

@beeguy74
Copy link

beeguy74 commented Dec 12, 2024

Hi, I am a beginner Cairo developer from Paris.
I closed one task on 10 ODHACK for ByteBeasts.
My approach
I will use the realization of a crowdfunding contract from starknet-by-example.
it already fits your requirements except for the Campaign states. I will add the necessary functionality.
And I'll cover my work with tests.

I don't promise to finish the issue quickly because your project is new to me =)
But I intend to do a decent job and at least do the draft PR within 48 hours.
Could I try solving this?

@BrunoAmbricca
Copy link
Contributor

I would like to work on this issue

@jimenezz22
Copy link
Contributor

Hi, I’d like to work on this issue! I’m member of Dojo Coding Community and I have extensive experience working with Cairo, including contributions to projects like CairoLint, utilizing Dojo Engine to create on-chain games at ByteBuilders, completing Cairo-based quests with Node Guardians, and teaching a Cairo class at a Starknet bootcamp

My Approach:

  1. Campaign Creation
    • Implement a function to create campaigns with parameters for the funding goal and deadline.
    • Store essential details such as the campaign creator, target amount, deadline, and initial state (Active).
  2. Contributions
    • Add a function to allow users to contribute to a campaign.
    • Track contributions by address using a mapping, ensuring each contributor's balance is updated accurately.
    • Update the total amount pledged after each contribution.
  3. Campaign End
    • Implement logic to automatically evaluate the campaign state at the deadline:
      • Successful: If the goal is met, transfer the funds to the campaign creator and update the state to Successful.
      • Failed: If the goal is not met, update the state to Failed and allow contributors to claim refunds.
  4. Refunds
    • Create a function to enable contributors to withdraw their pledged funds if the campaign is in the Failed state.
    • Ensure refunds are processed safely and the contributor's balance is reset after withdrawal.
  5. Technical Considerations
    • Use Cairo's native time handling for accurate and safe deadline management.
    • Introduce events to log key actions (e.g., contributions, refunds, campaign success).
    • Ensure gas efficiency and safe interaction patterns by designing the contract logic to minimize state reads/writes.

Additional Value:

I will also write a comprehensive suite of tests to validate all functionalities of the contract, covering both unit and integration tests. This will ensure the contract operates as intended under various scenarios, including edge cases.

ETA: 3 days maximum in the worst case scenario.

@wheval
Copy link
Contributor

wheval commented Dec 12, 2024

May I be assigned to this?

@1nonlypiece
Copy link
Contributor

Hi,
I’d like to work on this issue as I have experience with Cairo and building on StarkNet, including writing and optimizing smart contracts.

ETA:
I estimate completing this task in about 12-24 hours. Let me know if I can get started!

@SoarinSkySagar
Copy link
Contributor

May I work on this issue @danielcdz?

eta: 3 days

@NueloSE
Copy link

NueloSE commented Dec 12, 2024

May I take care of this?

@mimiprosper
Copy link
Contributor

I would like to take this task. Am a web 2 frontend developer, a technical writer, a solidity smart contract developer/auditor and a cairo smart contract developer. Am a graduate of Starknet Cairo Bootcamp. I have successfully done tasks assigned to me in OnlyDust.
If assigned this i would complete it within 2 days.

Here are some articles i have written: https://medium.com/@emma.onyedika.okeke

@casweeney
Copy link

I have supper experience with Crowd funding smart contracts.

About me:

I am a software engineer with strong technical skills and expertise in writing complex scalable applications. I have written and tested some advanced Cairo and Solidity smart contracts like building and testing the Synthetix staking contract using Cairo: https://github.com/casweeney/cairo-synthentix-staking

I have contributed to some groundbreaking protocols like Hyperbridge: https://github.com/polytope-labs/hyperbridge/graphs/contributors and my GitHub account has a lot of proof of work.

Leveraging on my skills and experience, I am confident in my ability to tackle new challenges and also solve complex technical issues.

Tackling this issue:

  • I will scaffold a new project then I will set up the interfaces
  • I will create a struct Campaign that holds all the campaign properties.
  • I will create all necessary functions as specified above as entry points to interact with the campaign contract.

ETA: 10 - 12 hours max

@GideonBature
Copy link
Contributor

May I be assigned to this?

My name is Gideon Bature, a Software Engineer, I have experience working with Cairo, I have written various contracts on Starknet using Cairo. If given the opportunity, I will send my first PR within 72 hours.

Thank you!

@Michaelkingsdev
Copy link

I'd love to work on this!

@Supa-mega
Copy link

Can I handle this task?

@emarc99
Copy link
Contributor

emarc99 commented Dec 12, 2024

I have done this contract in Solidity multiple times, it would be great to conver4t to cairo code and learn as well. ETA 2 days, will write tests as well.

@3th-Enjay
Copy link

I’d like to work on this.

@zintarh
Copy link

zintarh commented Dec 12, 2024

Can I handle this task?

@beeguy74
Copy link

Hi, I am a beginner Cairo developer from Paris.
I closed one task on 10 ODHACK for ByteBeasts.
I will check the existing ERC crowdfunding smart-contracts to implement a robust version of the contract for you.
I don't promise to finish the issue quickly because your project is new to me =)
But I intend to do a decent job and at least do the draft PR within 48 hours.
Could I try solving this?

@ryzen-xp
Copy link

Hi, I am a proficient blockchain developer, expert in Cairo, Rust, Solidity, Aptos, and web development. I have contributed to projects like Chainevents and Arkprojects ,sunshine lab etc.
I can implement the Simple Crowdfunding contract, ensuring all basic features like campaign creation, contributions, automatic deadline handling, and fund transfers or refunds. Please assign this issue to me.

Thank you!

@Akshola00
Copy link

Hello, I'm Akinshola Akinniyi, a smart contract developer with expertise in StarkNet and Cairo. After completing the Cairo Basecamp, I gained a strong understanding of decentralized applications and have contributed to multiple projects on OnlyDust, focusing on smart contract development and optimization.

I would love to take on the task of implementing a simple crowdfunding system. With my experience in developing smart contracts, I am confident in creating a contract that handles campaign creation, contributions, automatic deadline management, and funds transfer or refund, ensuring the system works smoothly. Please assign me this task—I look forward to contributing to the project!

@trashcancries
Copy link

May I work on this issue @danielcdz?

eta: 3 days

@ShantelPeters
Copy link
Contributor

Mind if I take this issue?

@omsant02
Copy link

omsant02 commented Dec 12, 2024

i would like to take this issue

Here's my implementation plan:

-Create a simplified version of the Campaign struct with essential fields (creator,
goal, deadline, token address, pledges tracking)
-Implement main functions based on the reference implementation: pledge(),
unpledge(), claim(), and refund()
-Add state management (Active/Successful/Failed) using get_block_timestamp()
-Use ERC20 token integration for handling contributions
-Implement pledge tracking using similar but simplified storage pattern from the
reference

I'll keep it educational by removing complex features like upgradability and components, while maintaining core functionality and proper security checks. I'll also provide documentation following starknet-by-example's format.

ETA : 1 day

@Bosun-Josh121
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged:

software engineering background, backend & smart contract dev with contributions on OD(https://app.onlydust.com/u/Bosun-Josh121) looking to make first contribution on this project

How I plan on tackling this issue:
accept contributions, track donations by address, automatically close campaigns at the deadline, refund contributors if the goal is not met, and transfer funds to the campaign creator if the target is achieved, ensuring secure timestamp handling and reliable state management as outlined in StarkNet by Example: Crowdfunding.

work on feedback & recommendation ensuring contact. Can deliver within a day upon assignment

@Jagadeeshftw
Copy link

Hello @coxmars ,

I’d love to work on this issue as I have strong experience in developing secure and efficient smart contracts using Cairo and deploying them on StarkNet.

My Approach:

  1. I’ll implement a simple crowdfunding contract that allows users to create campaigns with a funding goal and deadline.
  2. The contract will allow contributions, handle automatic refunds if the goal is not met, and transfer funds to the creator if the goal is achieved, tracking contributions by address.

Please assign this to me, and I’ll ensure to deliver a robust and high-quality PR within 12-24 hours.

@tasneemtoolba
Copy link

I'm a full-stack developer who recently shifted to web3, and trying so hard to gain experience in smart contracts!! I do a small experience writing smart contracts in Solidity and Cairo!, looking forward to work on this task!!

@ikezuby2012
Copy link

Hello, my name is nnubia nzube, I'm a full-stack developer with nearly 4 years of experience working with JavaScript, TypeScript, Express.js, and recently exploring Cairo for blockchain development. I’m passionate about building robust and scalable applications while ensuring clean and maintainable code.

i would like to take this issue

@suhas-sensei
Copy link

Could I try solving this? I'll implement a Starknet crowdfunding contract with secure funds management, deadline tracking, and automatic refund logic.
Having experience with Starknet development and financial contracts, I'll ensure proper state transitions and contribution tracking while implementing comprehensive refund mechanisms.
ETA : 48-70hrs

@nonso7
Copy link

nonso7 commented Dec 12, 2024

I am very confident building this type of contracts. Can I attempt this issue?

@michojekunle
Copy link

Could I try solving this?

@Birdmannn
Copy link

Hi Dev, can I handle this task?

@Nityam573
Copy link

Could I try solving this?

@0xprivateChaos
Copy link
Contributor

Hi, I'm Aman, and I'd like to work on this issue.

My plan:

  1. Implement create_campaign() for users to set funding goals and deadlines.
  2. Add contribute() to track contributions per address.
  3. Handle campaign states (Active, Successful, Failed) based on deadlines and funding goals.
  4. Create refund() for contributors if the goal is unmet and withdraw() for creators if successful.
  5. Ensure safe timestamp handling and robust access control.

@Emmanex01
Copy link

Emmanex01 commented Dec 13, 2024

Could I try solving this?
Hi, I'm Emmanuel Tochukwu, a Software Engineer with hands-on experience in Cairo, Typescript, Javascript. I’ve successfully created several contracts on Starknet using these technology. Given the opportunity, I’ll ensure my first PR is submitted within 72 hours.

Thank you!

@savagechucks
Copy link

Yo, my name's Isaac. I'm a frontend dev. I'm a new contributor... I'd appreciate it if I'd be given the chance to try out this issue
ETA: 2days

@blessingbytes
Copy link

pls, i would love to tackle this issue

@olisaagbafor
Copy link

May I take care of this?

@Dorcas18
Copy link

I’m interested in this one.

@DADADAVE80
Copy link

Can I handle this task?

@ekumamatthew
Copy link

I’d like to help with this.

@Pvsaint
Copy link

Pvsaint commented Dec 13, 2024

Could I grab this task? I'm a front-end and smart contract developer proficient in react js, next js, solidity and cairo

@sandragcarrillo
Copy link

Hi, I would love to get assigned to this issue.

I have been learning Cairo for the past 4 months, learning while writing technical content useful for other new devs. This would be an amazing opportunity to keep improving my skills.

ETA: 1-2 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficult: medium enhancement New feature or request ODHack11 This issue will be available ONLY during the ODHack11
Projects
None yet
Development

Successfully merging a pull request may close this issue.