@ethereumjs/tx v5.4.0
EOA Code Transaction (EIP-7702) (outdated)
This release introduces support for a non-final version of EIP-7702 EOA code transactions, see PR #3470. This tx type allows to run code in the context of an EOA and therefore extend the functionality which can be "reached" from respectively integrated into the scope of an otherwise limited EOA account.
The following is a simple example how to use an EOACodeEIP7702Transaction
with one autorization list item:
// ./examples/EOACodeTx.ts
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { EOACodeEIP7702Transaction } from '@ethereumjs/tx'
import type { PrefixedHexString } from '@ethereumjs/util'
const ones32 = `0x${'01'.repeat(32)}` as PrefixedHexString
const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Cancun, eips: [7702] })
const tx = EOACodeEIP7702Transaction.fromTxData(
{
authorizationList: [
{
chainId: '0x1',
address: `0x${'20'.repeat(20)}`,
nonce: ['0x1'],
yParity: '0x1',
r: ones32,
s: ones32,
},
],
},
{ common }
)
console.log(
`EIP-7702 EOA code tx created with ${tx.authorizationList.length} authorization list item(s).`
)
Note: Things move fast with EIP-7702
and the released implementation is based on this commit and therefore already outdated. An up-to-date version will be released along our breaking release round planned for early September 2024.
Verkle Updates
Other Features
- Extend
BlobEIP4844Transaction.networkWrapperToJson()
to also include the 4844 fields, PR #3365 - Stricter prefixed hex typing, PRs #3348, #3427 and #3357 (some changes removed in PR #3382 for backwards compatibility reasons, will be reintroduced along upcoming breaking releases)
Bugfixes
- Fix bug in generic error message regarding chain ID reporting, PR #3386