Skip to main content
CDP Paymaster supports ERC20 token gas payments, enabling users to pay for gas in tokens like USDC instead of ETH. This eliminates the need for users to hold native tokens while still covering their own transaction costs.

How it works

Instead of the developer sponsoring gas, the user pays for gas in an ERC20 token:
  1. User approves the Paymaster to spend their tokens
  2. User submits a transaction
  3. Paymaster takes tokens from the user and pays gas in ETH
  4. Transaction executes
This creates a “gasless” experience where users don’t need ETH, but they still pay for their own transactions using tokens they already have.

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:
Response:

pm_getPaymasterData with ERC20 context

To request ERC20 payment, include the token address in the context field: Request:
Successful response: The response includes a tokenPayment field showing the fee details:
Rejection response (insufficient allowance):

Comparison: Sponsorship vs ERC20 payments

Next steps