Quellcode durchsuchen

fix: update bal before keeper payment (#2628)

Tejas Badadare vor 6 Monaten
Ursprung
Commit
928639193d
1 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen
  1. 4 3
      target_chains/ethereum/contracts/contracts/pulse/Scheduler.sol

+ 4 - 3
target_chains/ethereum/contracts/contracts/pulse/Scheduler.sol

@@ -768,12 +768,13 @@ abstract contract Scheduler is IScheduler, SchedulerState {
             revert InsufficientBalance();
         }
 
-        // Pay keeper and update status if successful
+        status.balanceInWei -= totalKeeperFee;
+        status.totalSpent += totalKeeperFee;
+
+        // Pay keeper and update status
         (bool sent, ) = msg.sender.call{value: totalKeeperFee}("");
         if (!sent) {
             revert KeeperPaymentFailed();
         }
-        status.balanceInWei -= totalKeeperFee;
-        status.totalSpent += totalKeeperFee;
     }
 }