Skip to content

Commit

Permalink
check if sufficient sale proceeds later
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 committed Jan 8, 2024
1 parent a1e0980 commit 348e285
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions contracts/authorities/BondingCurveAuthority.sol
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,7 @@ contract BondingCurveAuthority {
uint256 treasuryFee = (bondingCurvePrice * treasuryFeeBps) / BPS;
uint256 creatorFee = (bondingCurvePrice * (partyInfo.creatorFeeOn ? creatorFeeBps : 0)) /
BPS;

uint256 sellerProceeds = bondingCurvePrice - partyDaoFee - treasuryFee - creatorFee;
if (sellerProceeds < minProceeds) {
revert ExcessSlippage();
}

partyInfos[party].supply = partyInfo.supply - amount;

Expand Down Expand Up @@ -385,10 +381,15 @@ contract BondingCurveAuthority {
}
}

if (sellerProceeds < minProceeds) {
revert ExcessSlippage();
}

(success, ) = msg.sender.call{ value: sellerProceeds }("");
if (!success) {
revert EthTransferFailed();
}

partyDaoFeeClaimable += partyDaoFee.safeCastUint256ToUint96();

emit PartyCardsSold(
Expand Down

0 comments on commit 348e285

Please sign in to comment.