Skip to content

Commit

Permalink
change var name to local
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCardinalError committed Sep 20, 2023
1 parent c3d4aa8 commit 20aa63e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/PostageStamp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ contract PostageStamp is AccessControl, Pausable {
*/
function expireLimited(uint256 limit) public {
// the lower bound of the normalised balance for which we will check if batches have expired
uint256 leb = lastExpiryBalance;
uint256 _lastExpiryBalance = lastExpiryBalance;
uint256 i;
for (i; i < limit; ) {
if (isBatchesTreeEmpty()) {
Expand Down Expand Up @@ -430,7 +430,7 @@ contract PostageStamp is AccessControl, Pausable {
validChunkCount -= batchSize;
// since the batch expired _during_ the period we must add
// remaining normalised payout for this batch only
pot += batchSize * (batch.normalisedBalance - leb);
pot += batchSize * (batch.normalisedBalance - _lastExpiryBalance);
tree.remove(fbi, batch.normalisedBalance);
delete batches[fbi];

Expand All @@ -443,15 +443,15 @@ contract PostageStamp is AccessControl, Pausable {
// multiplied by the remaining total valid chunk count
// to the pot for the period since the last expiry

if (lastExpiryBalance < leb) {
if (lastExpiryBalance < _lastExpiryBalance) {
revert TotalOutpaymentDecreased();
}

// then, for all batches that have _not_ expired during the period
// add the total normalised payout of all batches
// multiplied by the remaining total valid chunk count
// to the pot for the period since the last expiry
pot += validChunkCount * (lastExpiryBalance - leb);
pot += validChunkCount * (lastExpiryBalance - _lastExpiryBalance);
}

/**
Expand Down

0 comments on commit 20aa63e

Please sign in to comment.