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

feat: add optional signEip7702Authorization method to Keyring type #231

Merged
merged 4 commits into from
Feb 11, 2025

Conversation

jeffsmale90
Copy link
Contributor

@jeffsmale90 jeffsmale90 commented Feb 3, 2025

EIP-7702 defines a new struct Authorization which represents authority to set a pointer to a contract address at an EOA - effectively making the EOA perform as a smart contract.

This change adds an optional signEip7702Authorization method to the Keyring type which is implemented on @metamask/eth-simple-keyring and @metamask/eth-hd-keyring in MetaMask/accounts#182.

See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7702.md for details

@jeffsmale90 jeffsmale90 marked this pull request as draft February 10, 2025 21:08
@jeffsmale90 jeffsmale90 force-pushed the feat/7702-sign-authorization branch from 8b57894 to 16e4553 Compare February 10, 2025 21:26
@jeffsmale90 jeffsmale90 changed the base branch from main to revert/keyring_generic February 10, 2025 21:27
@jeffsmale90 jeffsmale90 marked this pull request as ready for review February 10, 2025 21:30
@ccharly ccharly changed the title Add optional signEIP7702Authorization method to Keyring type feat: add optional signEip7702Authorization method to Keyring type Feb 11, 2025
*/
signEip7702Authorization?(
address: Hex,
authorization: [chainId: number, contractAddress: Hex, nonce: number],
Copy link
Contributor

@ccharly ccharly Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have used @metamask/eth-sig-util here too, but that would pull a new dep and since we plan to move this type (Keyring) to accounts/keyring-utils, I think that's fine that we keep it as is.

ccharly
ccharly previously approved these changes Feb 11, 2025
ccharly pushed a commit that referenced this pull request Feb 11, 2025
Reverts the changes introduced by
#232 in order to allow
#231 to be released as a minor
update on the current published version without requiring a major
version bump.

This change will be re-introduced after release.
Base automatically changed from revert/keyring_generic to main February 11, 2025 10:32
@ccharly ccharly dismissed their stale review February 11, 2025 10:32

The base branch was changed.

@ccharly ccharly merged commit daa2270 into main Feb 11, 2025
18 checks passed
@ccharly ccharly deleted the feat/7702-sign-authorization branch February 11, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants