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

feat: rage quit #219

Open
wants to merge 25 commits into
base: old-main
Choose a base branch
from
Open

feat: rage quit #219

wants to merge 25 commits into from

Conversation

addyxvii
Copy link

@addyxvii addyxvii commented Feb 13, 2023

Motivation

This feature gives a contributor to a party the ability to rage quit(withdraw 100% of their contribution) before a crowdfund is finalized.

Solution

A rageQuit function has been created that increases a new variable totalContributionsWithdrawn, and removes the _contributionsByContributor mapping for the user who quit. The function also returns the quitting user's total contribution from the crowdfund.

previousTotalContributionsWithdrawn has been added to the Contribution struct for proper accounting in the _getFinalContribution function

@height
Copy link

height bot commented Feb 13, 2023

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@addyxvii addyxvii changed the title Feat/rage quit feat: rage quit Feb 13, 2023
@0xble 0xble added feature Add functionality crowdfund Related to crowdfund labels Feb 13, 2023
@0xble
Copy link
Collaborator

0xble commented Feb 13, 2023

Thanks for this! I'll review this tomorrow

contracts/crowdfund/Crowdfund.sol Outdated Show resolved Hide resolved
contracts/crowdfund/Crowdfund.sol Outdated Show resolved Hide resolved
contracts/crowdfund/Crowdfund.sol Outdated Show resolved Hide resolved
contracts/crowdfund/Crowdfund.sol Outdated Show resolved Hide resolved
contracts/crowdfund/Crowdfund.sol Outdated Show resolved Hide resolved
contracts/crowdfund/Crowdfund.sol Outdated Show resolved Hide resolved
sol-tests/crowdfund/Crowdfund.t.sol Outdated Show resolved Hide resolved
sol-tests/crowdfund/Crowdfund.t.sol Outdated Show resolved Hide resolved
contracts/crowdfund/Crowdfund.sol Outdated Show resolved Hide resolved
contracts/crowdfund/Crowdfund.sol Outdated Show resolved Hide resolved
@addyxvii addyxvii requested a review from 0xble March 15, 2023 22:58
Copy link
Collaborator

@0xble 0xble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Just run yarn lint and commit changes to fix formatting. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crowdfund Related to crowdfund feature Add functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants