Skip to content

Commit

Permalink
nit update.
Browse files Browse the repository at this point in the history
  • Loading branch information
ckartik committed Mar 7, 2024
1 parent 48edd9c commit f0ea08a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions contracts/BidderRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ contract BidderRegistry is IBidderRegistry, Ownable, ReentrancyGuard {

BidState memory bidState = BidPayment[commitmentDigest];
require(bidState.state == State.PreConfirmed, "The bid was not preconfirmed");
uint256 amt = bidState.bidAmt;
uint256 decayedAmt = ( bidState.bidAmt * residualBidAfterDecay * PRECISION) / PERCENT;

uint256 feeAmt = (decayedAmt * uint256(feePercent) * PRECISION) / PERCENT;
Expand All @@ -184,13 +183,13 @@ contract BidderRegistry is IBidderRegistry, Ownable, ReentrancyGuard {
providerAmount[provider] += amtMinusFeeAndDecay;

// Ensures the bidder gets back the bid amount - decayed reward given to provider and protocol
bidderPrepaidBalances[bidState.bidder] += amt - decayedAmt;
bidderPrepaidBalances[bidState.bidder] += bidState.bidAmt - decayedAmt;

// TODO(@ckartik): Ensure we throughly test this flow
BidPayment[commitmentDigest].state = State.Withdrawn;
BidPayment[commitmentDigest].bidAmt = 0;

emit FundsRetrieved(commitmentDigest, amt);
emit FundsRetrieved(commitmentDigest, decayedAmt);
}

/**
Expand Down

0 comments on commit f0ea08a

Please sign in to comment.