CharlesWang Profile picture
Jul 8 1 tweets 2 min read Read on X
Permit2 in simple terms

@Uniswap 's Permit2 is a new permissioning system that allows users to approve token spending permissions to smart contracts in a completely new way.

Here's how Permit2 works:

User Permissions: Instead of approving specific token amounts to individual smart contracts, users grant permissions to a central Permit2 contract, the first step is to allow the permit address to spend your tokens:

Permissions can be granted to specific smart contracts or to any contract that supports Permit2.

Signature-Based Approvals: When a user wants to interact with a smart contract that requires token spending, they don't need to make a separate approval transaction.

Instead, the user signs a message off-chain using their private key, granting permission to the smart contract to spend a specific amount of tokens on their behalf.
The signed message includes details such as the token address, the amount to be spent, and the smart contract address.

Smart Contract Interaction: When a smart contract wants to spend tokens on behalf of a user, it calls the Permit2 contract with the user's signed message.
The Permit2 contract verifies the signature and checks if the user has granted sufficient permissions to the smart contract.

If the permissions are valid, the Permit2 contract transfers the specified amount of tokens from the user's address to the smart contract.

The Permit2 contract is so to speak just a spender contract that transfers tokens away from users to a target, expected the signature is valid.Image
Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with CharlesWang

CharlesWang Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(