How it works
Instead of the developer sponsoring gas, the user pays for gas in an ERC20 token:- User approves the Paymaster to spend their tokens
- User submits a transaction
- Paymaster takes tokens from the user and pays gas in ETH
- Transaction executes
When to use this
Supported tokens
Additional tokens coming soon.
Implementation
The key requirement is ensuring the user has approved the Paymaster to spend their tokens. Include an approval in your transaction batch if the allowance is insufficient.The approval is included in the same batch as your main transaction. This ensures the user only signs once, and the approval + transaction execute atomically.
Paymaster contract address
Users must approve the Paymaster contract to spend their tokens. This is the address that will transfer tokens from the user’s wallet as payment for gas.This address is returned in the
paymasterAddress field of error responses when approval is insufficient, so you can also discover it dynamically.RPC methods
CDP Paymaster implements the following methods for ERC20 gas payments:pm_getAcceptedPaymentTokens
Returns the tokens the Paymaster accepts for payment. Request:pm_getPaymasterData with ERC20 context
To request ERC20 payment, include the token address in the context field: Request:tokenPayment field showing the fee details:
Comparison: Sponsorship vs ERC20 payments
Next steps
- Gas sponsorship quickstart — Developer-paid gas
- Paymaster FAQs — Common questions
- Base Account documentation — Additional context on ERC20 gas payments