Skip to content

Commit

Permalink
Hotfix state channel spent > total (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
nz-neooo authored May 7, 2024
1 parent be5a32a commit 2a38197
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions contracts/StateChannel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,7 @@ contract StateChannel is Initializable, OwnableUpgradeable {
require(isIndexer || isConsumer, 'G008');

// check state
bool allowState = query.spent >= state.spent && query.spent < state.total;
require(allowState, 'SC005');
require(query.spent >= state.spent, 'SC005');

// check sign
if (query.spent > 0) {
Expand Down Expand Up @@ -421,7 +420,7 @@ contract StateChannel is Initializable, OwnableUpgradeable {
require(msg.sender == state.indexer, 'G008');
}

// check count
// check state
require(query.spent >= state.spent, 'SC005');

// check sign
Expand Down

0 comments on commit 2a38197

Please sign in to comment.