Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Qiang Zhu <[email protected]>
  • Loading branch information
syntrust and qzhodl authored Sep 24, 2024
1 parent 70937b7 commit b1e2dfc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contracts/StorageContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,13 @@ abstract contract StorageContract is DecentralizedKV, ReentrancyGuardTransient {
uint256 prepaidAmountCap =
STORAGE_COST * ((1 << SHARD_ENTRY_BITS) - kvEntryCount % (1 << SHARD_ENTRY_BITS));
if (prepaidAmountCap > prepaidAmount) {
prepaidAmountSaved = _paymentIn(prepaidAmountCap, prepaidLastMineTime, _minedTs)
if (prepaidLastMineTime < _minedTs) {
fullReward = _paymentIn(STORAGE_COST << SHARD_ENTRY_BITS, info.lastMineTime, _minedTs);
prepaidAmountIn = _paymentIn(prepaidAmount, prepaidLastMineTime, _minedTs);
if (prepaidAmountIn > fullReward - reward) {
prepaidAmountIn = fullReward - reward;
}
}
- _paymentIn(prepaidAmount, prepaidLastMineTime, _minedTs);
prepaidAmountCap = prepaidAmount;
}
Expand Down

0 comments on commit b1e2dfc

Please sign in to comment.