📥 7702 Continued... - May 22nd 2025


This weeks newsletter is slightly later than normal. Better late than never!

EIP-7702 continued...

Last week, I explored how EIP-7702 enables sponsored transactions, a long-awaited Ethereum feature. This week, I’m continuing that exploration, now from the Foundry side. Foundry recently introduced new cheatcodes that make it much easier to experiment with EIP-7702:

  • signDelegation - Sign an EIP-7702 authorization for delegation
  • attachDelegation - Designate the next call as an EIP-7702 transaction.
  • signAndAttachDelegation - Sign an EIP-7702 authorization and designate the next call as an EIP-7702 transaction.

I was able to get their demo working, but when I tried to write my own using an Anvil backend, I ran into an issue (see: Github).

Playing around with EIP-7702 has taught me a few things:

  1. When using a delegated contract, any function calls will have 'address(this)' set to the EOA’s address. If you don’t implement proper access controls on these functions, anyone could potentially act as the EOA. For example, if there are tokens held in an ERC20 contract at the EOA’s address, and your contract exposes a function that allows arbitrary token transfers, those funds could be easily drained by anyone calling that function.
  2. When delegating an EOA to a contract, it's essential to carefully design the contract’s initialization. Delegation targets should rely on initializer functions (not constructors), and these must be protected with strict access controls to prevent unauthorized re-initialization. Improperly secured initializers can allow attackers to hijack the contract or alter critical settings. Ensure the initializer is callable only once and only by the intended party.
  3. If you ever want to redelegate to new code at your EOA’s address, it’s much easier if all previous delegations used unstructured, non-conflicting storage layouts. This approach prevents storage collisions and ensures your new contract logic can safely interact with existing data.

Once I sort out the Foundry issue, I’ll drop some code on GitHub for you to poke around.

See you next Thursday!

Got thoughts on this week’s newsletter? Reply to this email or DM me. I’d love to hear from you!

Disclaimer: The views and opinions expressed in this newsletter are my own and do not reflect those of my employer or any affiliated organizations. Nothing in this publication constitutes financial, legal, or investment advice.

Blaine Malone

Read more from Blaine Malone

⛽ 7702 Gas Sponsorship Over the weekend I explored EIP-7702 by writing a minimal implementation that stripped transaction creation back to its fundamentals. While Viem does a great job abstracting the low-level details, I wanted to understand exactly what was happening under the hood. You can check out the code here. What did I learn? Once delegated, the code is fixed at the EOA unless it's explicitly re-delegated (requires re-signing auth list entry). Type 4 transactions include an...

Live Streaming This week I tried out a different format: I went live. Finding the time to record well-scripted videos is tough when you have a full-time job, so I wanted to dip my toes into the streaming ecosystem. To start, I went live on Twitter. The first stream was simple. I wasn’t on camera myself. I streamed a video of my Pectra countdown timer, which I had vibe-coded earlier in the week. malone @blainemalone the wait is nearly over... https://x.com/i/broadcasts/1PlKQMZwlnNKE x.com...

Pectra Mainnet Accouncement Episode 2 of the Craic Overflow podcast is out now. I kept this week’s check-in short and sweet, covering the latest Ethereum blog post on the eagerly awaited Pectra upgrade You can watch it on X or Youtube. malone @blainemalone Slightly different format this week: in the 2nd @craicoverflow pod, I break down what to look forward to in the upcoming @ethereum Pectra Mainnet release, scheduled for May 7. 00:00 - Intro 00:09 - The Pectra Network Upgrade 00:39 - From...