@@ -5,7 +5,6 @@ use reth_primitives::{Address, U256};
5
5
use starknet:: core:: utils:: cairo_short_string_to_felt;
6
6
use starknet_api:: { core:: Nonce , state:: StorageKey } ;
7
7
use starknet_crypto:: { poseidon_permute_comp, Felt } ;
8
-
9
8
use crate :: evm_sequencer:: constants:: storage_variables:: {
10
9
ACCOUNT_BYTECODE_LEN , ACCOUNT_CODE_HASH , ACCOUNT_EVM_ADDRESS , ACCOUNT_IS_INITIALIZED ,
11
10
ACCOUNT_NONCE , ACCOUNT_STORAGE , ACCOUNT_VALID_JUMPDESTS ,
@@ -90,11 +89,9 @@ impl KakarotAccount {
90
89
starknet_storage!( ACCOUNT_EVM_ADDRESS , evm_address) ,
91
90
starknet_storage!( ACCOUNT_IS_INITIALIZED , 1u8 ) ,
92
91
starknet_storage!( ACCOUNT_BYTECODE_LEN , code. len( ) as u32 ) ,
92
+ starknet_storage!( ACCOUNT_NONCE , nonce) ,
93
93
] ;
94
94
95
- // Write the nonce of the account is written to storage after each tx.
96
- storage. append ( & mut vec ! [ starknet_storage!( ACCOUNT_NONCE , nonce) ] ) ;
97
-
98
95
// Initialize the bytecode storage var.
99
96
let mut bytecode_storage = pack_byte_array_to_starkfelt_array ( code)
100
97
. enumerate ( )
@@ -104,9 +101,9 @@ impl KakarotAccount {
104
101
105
102
// Initialize the code hash var
106
103
let account_is_empty =
107
- code. is_empty ( ) && nonce == Felt :: from ( 0 ) && balance == U256 :: from ( 0 ) ;
104
+ code. is_empty ( ) && nonce == Felt :: ZERO && balance == U256 :: ZERO ;
108
105
let code_hash = if account_is_empty {
109
- U256 :: from ( 0 )
106
+ U256 :: ZERO
110
107
} else if code. is_empty ( ) {
111
108
U256 :: from_be_slice ( KECCAK_EMPTY . as_slice ( ) )
112
109
} else {
0 commit comments