Integrate our Paymaster with a wide range of token choices into your dApp.
Last updated
Velocore provides free & easy paymaster implementation support and common reward pool benefits for partners to promote zkSyncEra's native AA feature.
Available tokens
As a Dex, we want to take over the inventory risk and add as many different tokens to the paymaster as possible.
Major tokens : USDT / USDC / DAI / wBTC
Proxy tokens whitelisted by MatterLabs
Partner protocol tokens
When you use the Velocore paymaster, your tokens will automatically be available for gas on all protocols that use our paymaster. We're stronger together.
How to integrate?
Follow this procedure from the official docs to change the paymaster param to be sent with the transaction when it's sent, and simply add the associated settings UI to make it usable.
import { Contract, Provider, types, utils, Wallet } from ‘zksync-web3’;
import { ethers } from ‘ethers’;
// Define the Paymaster address constant
const PAYMASTER_ADDRESS = ‘0x86E6Ab1950770e24035D1b3a5907C7D503d43B01’;
const provider = new Provider(RPC_URL);
const signer = new Wallet(PRIVATE_KEY, provider);
const contract = new Contract(CONTRACT_ADDRESS, CONTRACT_ABI, provider);
// Transaction methods: approve and swap
// Define the public address as ACCOUNT
const prepareContractTx = await contract.populateTransaction[method](...params, {
from: ACCOUNT,
});
// Estimating gas requirements for the transaction
const estimatedGas = await provider.estimateGas({ ...prepareContractTx, from: ACCOUNT });
const currentGasPrice = await provider.getGasPrice();
// Setting up parameters for the Paymaster
// ERC20 token address used to pay for gas
const paymasterSetup = utils.getPaymasterParams(PAYMASTER_ADDRESS, {
type: “ApprovalBased”,
TOKEN_ADDRESS,
minimalAllowance: ethers.BigNumber.from(1),
innerInput: new Uint8Array(),
});
prepareContractTx.customData = {
gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT,
paymasterSetup,
};
const transactionResult = await signer.sendTransaction({
...prepareContractTx,
maxFeePerGas: currentGasPrice,
maxPriorityFeePerGas: BigNumber.from(0),
gasLimit: estimatedGas,
});