Skip to content

Commit

Permalink
Refactoring validate nonce in validation.cairo
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerson2102 committed Sep 28, 2024
1 parent ad1fff8 commit 6f3b58f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/evm/src/backend/validation.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ pub fn validate_eth_tx(kakarot_state: @KakarotCore::ContractState, tx: Transacti
// Validate nonce
let starknet_caller_address = get_caller_address();
let account = IAccountDispatcher { contract_address: starknet_caller_address };
assert(account.get_nonce() == tx.nonce(), 'Invalid nonce');
let eth_address = account.get_evm_address();
let nonce = kakarot_state.eth_get_transaction_count(eth_address);
assert(nonce == tx.nonce(), 'Invalid nonce');

// Validate gas
let gas_limit = tx.gas_limit();
Expand Down

0 comments on commit 6f3b58f

Please sign in to comment.