Create Gasless Links
We even support creating links where we sponsor the gas!
Gasless Depositing
Gasless depositing works via EIP-3009. USDC supports EIP-3009.
Gasless Depositing Happens in 3 steps
1. Create Payload & Message
Create a payload to submit to the Peanut Smart Contract. This involves an EIP-712 message to be signed in the user's wallet (this is not a transaction, just a signature).
The EIP-712 message will approve the token via EIP-3009 to be pulled from the user by Peanut Protocol.
2. Sign the Message
There should be a method in your wallet API called signTypedData
. Use it to sign the message
obtained in the previous step.
3. Execute the Deposit
Execute the gasless deposit via Peanut's API.
And that's it! Congrats! Your user just sent some tokens without paying for gas!
3.2 Advanced. Execute the Tx by Yourself
If you want to execute the gasless deposit via your own relayer instead of using Peanut's. There is a helpful function for you! It computes the to
address and calldata (called data
).
Simply sign it with your relaying wallet and execute!
Last updated