This repository was archived by the owner on Jul 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
zkevm-circuits/src/evm_circuit/execution Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -468,16 +468,20 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
468
468
is_precompiled ( & tx. to_or_contract_addr ( ) ) || !callee_code_hash. is_zero ( ) ;
469
469
let caller_balance_sub_fee_pair = rws. next ( ) . account_balance_pair ( ) ;
470
470
let must_create = tx. is_create ( ) ;
471
+
472
+ let caller_balance_sub_value_pair = if !tx. value . is_zero ( ) {
473
+ rws. next ( ) . account_balance_pair ( )
474
+ } else {
475
+ ( zero, zero)
476
+ } ;
471
477
if !callee_exists && ( !tx. value . is_zero ( ) || must_create) {
472
478
callee_code_hash = rws. next ( ) . account_codehash_pair ( ) . 1 ;
473
479
}
474
- let mut caller_balance_sub_value_pair = ( zero, zero) ;
475
- let mut callee_balance_pair = ( zero, zero) ;
476
- if !tx. value . is_zero ( ) {
477
- caller_balance_sub_value_pair = rws. next ( ) . account_balance_pair ( ) ;
478
- callee_balance_pair = rws. next ( ) . account_balance_pair ( ) ;
480
+ let callee_balance_pair = if !tx. value . is_zero ( ) {
481
+ rws. next ( ) . account_balance_pair ( )
482
+ } else {
483
+ ( zero, zero)
479
484
} ;
480
-
481
485
self . begin_tx . assign ( region, offset, tx) ?;
482
486
self . tx . assign ( region, offset, tx) ?;
483
487
You can’t perform that action at this time.
0 commit comments