Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support type 4 transactions (#5285)
## Explanation Support EIP-7702 / type 4 transactions including `authorizationList` via the `TransactionController`. Specifically: - Upgrade `ethereumjs/tx` and `ethereumjs/common`. - Add `setCode` to `TransactionEnvelopeType`. - Add `authorizationList` to `TransactionParams`. - Complete and sign all authorizations using `KeyringController` before signing transaction. - Prevent type 4 transactions if origin is not `ORIGIN_METAMASK`. - Validate `authorizationList` property before approval request. - Centralise prepare and serialization logic into `prepare.ts` utils. - Encapsulate all EIP-7702 specific logic in new `eip7702.ts` util. _Currently using a local messenger action type for the signing. To be replaced once available in the `KeyringController`._ ## References Fixes [#4095](MetaMask/MetaMask-planning#4095) ## Changelog ### `@metamask/transaction-controller` - **ADDED**: Add `setCode` to `TransactionEnvelopeType`. - **ADDED**: Add `authorizationList` to `TransactionParams`. - **CHANGED**: Bump `ethereumjs/tx` to `^5.4.0`. - **CHANGED**: Bump `ethereumjs/common` to `^4.4.0`. ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
- Loading branch information