โ† Back to list

๐Ÿš€ From Permit to EIP-7702: Modern Patterns for One-Step ERC-20 Approve & Transfers

One of the biggest friction points in ERCโ€‘20 token usage is the two-step approve + transfer flow. EIP-7702 is the true game changer!

cladjules ยท 2025-12-08 05:03 ยท 0 claps ยท 2.4 min read
#web3 #solidity #hard-hat #erc-7702 #blockchain
Open on Medium โ†—
Wiki topics: CRY ยท Crypto & Web3

๐Ÿš€ From Permit to EIP-7702: Modern Patterns for One-Step ERC-20 Approve & Transfers

One of the biggest friction points in ERCโ€‘20 token usage is the two-step approve + transfer flow. EIP-7702 is the true game changer!

Most ERCโ€‘20 interactions require users to first call approve() and then transferFrom(). This is clunky, doubles gas fees, and creates a bad UX.

Fortunately, modern patterns let you collapse this into a single user interaction. Below, Iโ€™ll walk through three practical approaches โ€” all implemented and tested in my GitHub repo so your dApp can transfer tokens in one smooth flow.

In my example, we have a Staking Vault that would perform transferFrom in behalf of the user to lock some ERC-20 tokens in the vault, which would need to be approved ahead.

1. Permit (EIPโ€‘2612)

A standardised way for users to sign an off-chain approval that a contract executes on-chain. Eliminates the need for a separate approve() transaction, instead you would use permit.

How it works:

  1. The user signs a typed data permit off-chain and call a gas-less permit.
  2. The contract executes transferFrom() in a single transaction.

Example:

IERC20Permit(token).permit(
    msg.sender,
    address(this),
    amount,
    deadline,
    v, r, s
);
IERC20(token).transferFrom(msg.sender, address(this), amount);
const signature = await user.signTypedData({ /* domain, Permit type */ });
await token.permit(owner, vault.address, amount, deadline, v, r, s);
await vault.deposit(token.address, amount);

โšก Pros:

  • Single transaction for the user
  • No on-chain approval needed

โš  Cons:

  • Only works with tokens that implement EIPโ€‘2612

2. ERCโ€‘1363: Transfer with Callback

ERCโ€‘1363 extends ERCโ€‘20 with extra callback functions, letting the receiving contract react immediately when tokens arrive:

  • transferAndCall
  • approveAndCall

Instead of calling approve() and transferFrom(), the receiving contract executes logic in a callback (onApprovalReceived or onTransferReceived).

Example:

token.approveAndCall(stakingVault, amount, data);
token.transferAndCall(stakingVault, amount, data);

The receiving contract implementing IERC1363Receiver and IERC1363Spender gets an immediate callback:

onApprovalReceived(...)
onTransferReceived(...)

โšก Pros:

  • Single transaction for the user
  • Automatically triggers contract logic

โš  Cons:

  • Requires a modified token supporting ERCโ€‘1363
  • Not compatible with legacy tokens

๐ŸŒŸ 3. The Game changer โ€” EIPโ€‘7702 (EOA Delegation)

Allows an externally owned account (EOA) to temporarily delegate execution to a batch contract, running multiple calls atomically (e.g., approve + transferFrom).

How it works:

  1. The EOA signs a delegation authorization (EIPโ€‘7702).
  2. A single transaction executes approve + deposit in one atomic operation with a deployed batch contract.
  3. Works with any ERCโ€‘20 token, including legacy ones.

Example:

const tx = {
  to: eoaAddress,
  data: encodeFunctionData(BatchExecutor, "executeBatch", [
    [token, vault],
    [0, 0],
    [approveCalldata, depositCalldata]
  ]),
  authorizationList: [signedAuthorization],
};

โšก Pros:

  • Works with all ERCโ€‘20 tokens
  • No token upgrade needed
  • Keeps the same EOA address
  • Atomic single transaction

โš  Cons:

  • Requires network support for EIPโ€‘7702

๐Ÿ“Š Comparison Table

๐Ÿ“ Conclusion

You no longer have to force users through a clunky two-step ERCโ€‘20 approval flow.

Whether your token supports EIPโ€‘2612, you can use ERCโ€‘1363 callbacks, or you rely on a batch executor with EIPโ€‘7702, each pattern lets you collapse approve + transfer into a single, smooth experience.

Letโ€™s connect

If youโ€™re exploring options for your smart contracts or want to create a new dApp, Iโ€™d love to chat.

๐Ÿ“Œ Check out my Github repo for working contracts and tests: https://github.com/cladjules/evm-experiment-approve-transfer

๐Ÿ“Œ Want advice or personalised guidance? Letโ€™s connect: https://linktr.ee/julien.a


๋ฉ”ํƒ€๋ฐ์ดํ„ฐ
post_id
4be9b0c17bbe
slug
how-to-perform-approve-send-for-erc-20-tokens-in-one-flow-4be9b0c17bbe
url
https://medium.com/@cladjules/how-to-perform-approve-send-for-erc-20-tokens-in-one-flow-4be9b0c17bbe
canonical_url
https://medium.com/@cladjules/how-to-perform-approve-send-for-erc-20-tokens-in-one-flow-4be9b0c17bbe
author_url
https://medium.com/@cladjules
status
ok
fetched_at
2026-08-02 21:20:52