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

refactor(SellMembershipAuthority): remove outdated logic related to refunds #356

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions contracts/authorities/SellPartyCardsAuthority.sol
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ contract SellPartyCardsAuthority {
SaleState memory state = _validateContribution(party, saleId, gateData);

uint96 contributionToTransfer;
(votingPower, contribution, contributionToTransfer, ) = _processContribution(
(votingPower, contributionToTransfer, ) = _processContribution(
party,
saleId,
state,
Expand Down Expand Up @@ -494,7 +494,6 @@ contract SellPartyCardsAuthority {
uint96 contributionToTransfer;
(
votingPowers[i],
contributions[i],
contributionToTransfer,
state.totalContributions
) = _processContribution(party, saleId, state, contributions[i]);
Expand Down Expand Up @@ -523,12 +522,7 @@ contract SellPartyCardsAuthority {
uint96 contribution
)
private
returns (
uint96 votingPower,
uint96 contributionUsed,
uint96 contributionToTransfer,
uint96 totalContributions
)
returns (uint96 votingPower, uint96 contributionToTransfer, uint96 totalContributions)
{
totalContributions = state.totalContributions;
uint96 maxTotalContributions = state.maxTotalContributions;
Expand All @@ -545,6 +539,11 @@ contract SellPartyCardsAuthority {
revert SaleInactiveError();
}

// Check that the contribution amount is at or above the minimum.
if (contribution < minContribution) {
revert OutOfBoundsContributionsError(contribution, minContribution);
}

// Check that the contribution amount is at or below the maximum.
uint96 maxContribution = state.maxContribution;
if (contribution > maxContribution) {
Expand All @@ -569,17 +568,6 @@ contract SellPartyCardsAuthority {
}
}

// Check that the contribution amount is at or above the minimum. This
// is done after `amount` is potentially reduced if refunding excess
// contribution.
if (contribution < minContribution) {
revert OutOfBoundsContributionsError(contribution, minContribution);
}

// Return contribution amount used after refund and including amount
// used for funding split. Will be emitted in `MintedFromSale` event.
contributionUsed = contribution;

// Subtract split from contribution amount if applicable.
address payable fundingSplitRecipient = state.fundingSplitRecipient;
uint16 fundingSplitBps = state.fundingSplitBps;
Expand Down
Loading