diff --git a/EIPS/eip-7637.md b/EIPS/eip-7637.md index ae9f8abe123ea..8bc356b8e0685 100644 --- a/EIPS/eip-7637.md +++ b/EIPS/eip-7637.md @@ -63,9 +63,12 @@ def extcodehash(evm: Evm) -> None: address = to_address(pop(evm.stack)) charge_gas(evm, GAS_CODE_HASH) account = get_account(evm.env.state, address) - codehash = U256.from_be_bytes(keccak256(account.code)) - if codehash == U256(hexstr="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"): + if account == EMPTY_ACCOUNT: codehash = U256(0) + else: + codehash = U256.from_be_bytes(keccak256(account.code)) + if codehash == U256(hexstr="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"): + codehash = U256(0) push(evm.stack, codehash) evm.pc += 1 ```