Sunday, June 15, 2025
Blockchain Viral
  • Home
  • Viral Videos
  • Viral News
  • Cryptocurrency Marketcap
No Result
View All Result
Blockchain Viral
  • Home
  • Viral Videos
  • Viral News
  • Cryptocurrency Marketcap
No Result
View All Result
Blockchain Viral
No Result
View All Result
Home Crypto News

Why swapping token to token uses both ERC-20 approve() and EIP-2612 permit()?

Blockchain Viral by Blockchain Viral
2 months ago
in Crypto News
0
Why swapping token to token uses both ERC-20 approve() and EIP-2612 permit()?
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter



https://preview.redd.it/sj78j9ut26ve1.png?width=601&format=png&auto=webp&s=ef8dfd77030c36f67507d96ea5b1d485f21eca80

I'm learning smart contracts. As my knowledge, there are two ways to delegate token to others:

1) use an ERC-20 approve(), sign and broadcast the transaction

2) use an EIP-712 offline signature, give the signature to others, when they want to spend my token, they may use permit() and broadcast my signature

But when I tried to use uniswap or pancake to swap some token to another token, I found I have to sign for three times:

1) sign an approve() and broadcast it (for example, as https://basescan.org/tx/0x92deddfa4655d4699f61bfb2140331988b9a283dff54e4ffda984f916460d1d1)

2) sign an permit offlinely

3) sign an swap transaction (for example, https://basescan.org/tx/0x8c66fe05c339ae53a6b3fd26705f76773ae1fc4a965a24949659bcd033fcdf91) and this transaction seems to be used my signature in step 2

My questions are:

1) Why I need to sign a permit after I had already used approve() to give access to my token?

2) Why the swap transaction is broadcasted by my address, rather than the swap contract address?

Thank you for reading my questions!

submitted by /u/Coconut_Usual [comments]



Source link

Tags: ApproveEIP2612ERC20permitswappingtoken
Previous Post

The Intersection of AI and Web3: Smarter Decentralized Applications

Next Post

Pacific Spirit: Vinyl Meets Code in a Groundbreaking Generative Drop on Art Blocks | NFT CULTURE | NFT News | Web3 Culture | NFTs & Crypto Art

Next Post
FAILED LAUNCH BUT WE WILL PUMP HARD!!!!

FAILED LAUNCH BUT WE WILL PUMP HARD!!!!

Channels

Advertise Here?

Blockchain Viral

Blockchain Viral brings you the latest in crypto news and trends, featuring top YouTube videos from leading crypto influencers. Stay informed on blockchain updates, market insights, and everything happening in the world of cryptocurrency

  • About Us
  • Advertise with Us
  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact Us

Copyright © 2024 Blockchain Viral.
Blockchain Viral is not responsible for the content of external sites.

No Result
View All Result
  • Home
  • Viral Videos
  • Viral News
  • Cryptocurrency Marketcap

Copyright © 2024 Blockchain Viral.
Blockchain Viral is not responsible for the content of external sites.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In