From f0ea08a1141d18b5b1858d5cf39bd97a3d528df8 Mon Sep 17 00:00:00 2001 From: Kartik Chopra Date: Thu, 7 Mar 2024 13:44:14 -0500 Subject: [PATCH] nit update. --- contracts/BidderRegistry.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contracts/BidderRegistry.sol b/contracts/BidderRegistry.sol index 3aef48e..1ee7317 100644 --- a/contracts/BidderRegistry.sol +++ b/contracts/BidderRegistry.sol @@ -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; @@ -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); } /**