Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evm: fix eip3074 AUTH check #3432

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading