Skip to content

Commit

Permalink
correct mistake in default aa logic
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed Jun 11, 2024
1 parent c09a558 commit 281a123
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/decommit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,34 @@ impl WorldDiff {
}
};

let try_default_aa = if is_kernel(u256_into_address(address)) {
None
} else {
Some(default_aa_code_hash)
};

// The address aliasing contract implements Ethereum-like behavior of calls to EOAs
// returning successfully (and address aliasing when called from the bootloader).
// It makes sense that unconstructed code is treated as an EOA but for some reason
// a constructor call to constructed code is also treated as EOA.
if is_constructed == is_constructor_call || code_info == U256::zero() {
if is_kernel(u256_into_address(address)) {
return None;
} else {
default_aa_code_hash
match code_info_bytes[0] {
1 => {
if is_constructed == is_constructor_call {
try_default_aa?
} else {
code_info_bytes
}
}
} else {
match code_info_bytes[0] {
1 => code_info_bytes,
2 => {
2 => {
if is_constructed == is_constructor_call {
try_default_aa?
} else {
is_evm = true;
evm_interpreter_code_hash
}
_ => return None,
}
_ if code_info == U256::zero() => try_default_aa?,
_ => return None,
}
};

Expand Down

0 comments on commit 281a123

Please sign in to comment.