Skip to content

Commit 422dca8

Browse files
fix: remove redundant access
1 parent 0551da5 commit 422dca8

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

target_chains/ethereum/contracts/contracts/pulse/Scheduler.sol

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,16 +524,17 @@ abstract contract Scheduler is IScheduler, SchedulerState {
524524
/// BALANCE MANAGEMENT
525525

526526
function addFunds(uint256 subscriptionId) external payable override {
527-
if (!_state.subscriptionParams[subscriptionId].isActive) {
528-
revert InactiveSubscription();
529-
}
530-
531527
SubscriptionParams storage params = _state.subscriptionParams[
532528
subscriptionId
533529
];
534530
SubscriptionStatus storage status = _state.subscriptionStatuses[
535531
subscriptionId
536532
];
533+
534+
if (!status.isActive) {
535+
revert InactiveSubscription();
536+
}
537+
537538

538539
// Check deposit limit for permanent subscriptions
539540
if (params.isPermanent && msg.value > MAX_DEPOSIT_LIMIT) {

target_chains/ethereum/contracts/contracts/pulse/SchedulerState.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ contract SchedulerState {
99
uint8 public constant MAX_PRICE_IDS_PER_SUBSCRIPTION = 255;
1010
/// Maximum number of addresses in the reader whitelist
1111
uint8 public constant MAX_READER_WHITELIST_SIZE = 255;
12-
/// Maximum deposit limit for permanent subscriptions in wei (100 ETH)
12+
/// Maximum deposit limit for permanent subscriptions in wei
1313
uint256 public constant MAX_DEPOSIT_LIMIT = 100 ether;
1414

1515
/// Maximum time in the past (relative to current block timestamp)

0 commit comments

Comments
 (0)