Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrust committed Sep 26, 2024
1 parent c144243 commit a63abfb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions contracts/StorageContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,11 @@ abstract contract StorageContract is DecentralizedKV, ReentrancyGuardTransient {
if (updatePrepaidTime) {
prepaidLastMineTime = _minedTs;
}
if (prepaidAmountSaved > 0) {
accPrepaidAmount += prepaidAmountSaved;
}
accPrepaidAmount += treasuryReward;
accPrepaidAmount += prepaidAmountSaved + treasuryReward;
// Update mining info.
MiningLib.update(infos[_shardId], _minedTs, _diff);

require(treasuryReward + minerReward <= address(this).balance, "StorageContract: not enough balance");
require(minerReward <= address(this).balance, "StorageContract: not enough balance");
// Actually `transfer` is limited by the amount of gas allocated, which is not sufficient to enable reentrancy attacks.
// However, this behavior may restrict the extensibility of scenarios where the receiver is a contract that requires
// additional gas for its fallback functions of proper operations.
Expand Down

0 comments on commit a63abfb

Please sign in to comment.