Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
rm must_create
Browse files Browse the repository at this point in the history
  • Loading branch information
ChihChengLiang committed Feb 22, 2024
1 parent 07ecfe0 commit af62f15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 8 additions & 1 deletion bus-mapping/src/circuit_input_builder/input_state_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,14 @@ impl<'a> CircuitInputStateRef<'a> {
value_prev: sender_balance_prev,
},
)?;
self.transfer_to(step, receiver, receiver_exists, opcode_is_create, value, true)?;
self.transfer_to(
step,
receiver,
receiver_exists,
opcode_is_create,
value,
true,
)?;

Ok(())
}
Expand Down
3 changes: 1 addition & 2 deletions zkevm-circuits/src/evm_circuit/execution/begin_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,13 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
let callee_exists =
is_precompiled(&tx.to_or_contract_addr()) || !callee_code_hash.is_zero();
let caller_balance_sub_fee_pair = rws.next().account_balance_pair();
let must_create = tx.is_create();

let caller_balance_sub_value_pair = if !tx.value.is_zero() {
rws.next().account_balance_pair()
} else {
(zero, zero)
};
if !callee_exists && (!tx.value.is_zero() || must_create) {
if !callee_exists && (!tx.value.is_zero() || tx.is_create()) {
callee_code_hash = rws.next().account_codehash_pair().1;
}
let callee_balance_pair = if !tx.value.is_zero() {
Expand Down

0 comments on commit af62f15

Please sign in to comment.