Skip to content

Commit

Permalink
evm: fix eip3074 AUTH check (#3432)
Browse files Browse the repository at this point in the history
  • Loading branch information
jochem-brouwer authored May 16, 2024
1 parent bc648e7 commit cfe942e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/evm/src/opcodes/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,16 @@ export const handlers: Map<number, OpHandler> = new Map([
}

const expectedAddress = new Address(setLengthLeft(bigIntToBytes(authority), 20).slice(-20))
const accountNonce = (
(await runState.stateManager.getAccount(expectedAddress)) ?? new Account()
).nonce
const account = (await runState.stateManager.getAccount(expectedAddress)) ?? new Account()

if (account.isContract()) {
// EXTCODESIZE > 0
runState.stack.push(BIGINT_0)
runState.auth = undefined
return
}

const accountNonce = account.nonce

const invokedAddress = setLengthLeft(runState.interpreter._env.address.bytes, 32)
const chainId = setLengthLeft(bigIntToBytes(runState.interpreter.getChainId()), 32)
Expand Down

0 comments on commit cfe942e

Please sign in to comment.