Expand for images and click to enlarge
Expand for images and click to enlarge

Billing
Because you’re receiving the ERC20 tokens back, CDP will meter all the token transfers, and bill you at the end of the month similar to the regular sponsored gas flow (based on the USD value of the ERC20 at the time your wallet receives). This gives you the flexibility to decide what to do with the tokens. The Paymaster’s regular 7% service fee applies to this volume and is factored into the ERC20 quote your users receive and accept. Note: existing Paymaster specific CDP credits continue to apply for regular sponsored Paymaster volume but not ERC20 Paymaster volume.Configuring your policy
To allows your users to pay their gas in an ERC20 token, your policy needs to be configured to reject regular sponsorship. This allows you to configure customizations such as- Fully sponsor 3 UserOperations per user per day - any additional UserOperations will require users to pay using ERC20 token
- Fully sponsor UserOperations up to $1 per week - any additional UserOperations will require users to pay using ERC20 token
- Never fully sponsor any UserOperations - all UserOperations will require users to pay using an ERC20 token
Per User Address Max to .01.
We also recommend creating a separate project to test your ERC20 custom flows so it doesn’t affect any existing regular sponsorship flows that you have.
Expand for images and click to enlarge
Expand for images and click to enlarge

Integration guide & code examples
The ERC20 Paymaster fits seamlessly into any existing regular sponsored Paymaster integration. The only difference is that you need to configure your smart wallet toapprove our Paymaster contract to spend your user’s ERC20 tokens.
- Paymaster Contract Address (Sepolia):
0x709a4bae3db73a8e717aefca13e88512f738b27f - Paymaster Contract Address (Mainnet):
0x2FAEB0760D4230Ef2aC21496Bb4F0b47D634FD4c
index.js in the Paymaster quickstart guide. The only difference is that we added an approve function call to the calls field.
allowance before adding the additional ERC20 approve function call. This will save on gas costs for your users as our Paymaster is already allowed to spend their funds.
Specification
The CDP ERC20 Paymaster uses bothpm_getPaymasterStubData and pm_getPaymasterData JSON-RPC requests specified by ERC-7677 and an additional API pm_getAcceptedPaymentTokens. We step through each request and response below.
pm_getPaymasterStubData and pm_getPaymasterData
- The paymaster will use the specified ERC20 for payment if specified in the 7677 context field under
erc20. - Upon rejection / failure the paymaster should return a
datafield in the JSONRPC response which could be used to approve the paymaster and includes:
acceptedTokensarray which is a struct including the token addresspaymasterAddressfield which is the paymaster address which will perform the token transfers.
- Upon success the paymaster will return a
tokenPaymentfield in the result. This includes:
tokenAddressaddress of the token used for paymentmaxFeethe maximum fee to show in the UIdecimalsdecimals to use in the UInamename of the token
Request
This is a standard V0.6 Entrypoint request example with the additional context for the specified token to be used.Response
Successful response:pm_getAcceptedPaymentTokens
pm_getAcceptedPaymentTokens returns an array of tokens the paymaster will accept for payment.
The request contains the entrypoint and the chain id with optional context.
Request
Response
Troubleshooting
request denied - max address sponsorship value reached 0x4D44afB8D98c9984F381E60Ac855D89C73f40e45 and sender can not pay with an accepted ERC20”
The first part of the error signifies why the regular fully sponsored transaction was not accepted. This is to be expected. However, if the “sender can not pay with an accepted ERC20”, check to make sure that the user has enough ERC20 tokens in their wallet to pay for the gas and your wallet approved our Paymaster to spend those tokens.