Skip to content

Commit

Permalink
fix: throw if commit is not found (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sekhmet authored Aug 15, 2023
1 parent 82c1a45 commit 15d783d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion starknet/src/authenticators/eth_tx.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ mod EthTxAuthenticator {

fn consume_commit(ref self: ContractState, hash: felt252, sender_address: EthAddress) {
let committer_address = self._commits.read(hash);
assert(committer_address.is_zero(), 'Commit not found');
assert(!committer_address.is_zero(), 'Commit not found');
assert(committer_address == sender_address, 'Invalid sender address');
// Delete the commit to prevent replay attacks.
self._commits.write(hash, Zeroable::zero());
Expand Down

0 comments on commit 15d783d

Please sign in to comment.