-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
I am trying to allow users sponsor gas in usdc/my community erc20 token but it still keeps using gas from the eth i sent earlier and not usdc
const chain = base;
const ZERODEV_RPC = `https://rpc.zerodev.app/api/v3/${
import.meta.env.VITE_ZERO_DEV_APP_ID
}/chain/${chain.id}`;
const entryPoint = getEntryPoint("0.7");
const paymasterClient = createZeroDevPaymasterClient({
chain,
transport: http(ZERODEV_RPC),
});
const createOrder = async (serviceName: string, approvedAmount: number) => {
const { kernelClient } = useQuiverStore.getState();
const data = encodeFunctionData({
abi: QuiverPayManagerABI,
functionName: "createOrder",
args: [approvedAmount, serviceName],
});
const userOpHash = await kernelClient.sendUserOperation({
callData: await kernelClient.account.encodeCalls([
await getERC20PaymasterApproveCall(paymasterClient, {
gasToken: TA,
approveAmount: parseEther("0.0035"),
entryPoint,
}),
{
to: CA,
value: BigInt(0),
data: data,
},
]),
});
await kernelClient.waitForUserOperationReceipt({
hash: userOpHash,
timeout: 1000 * 15,
});
};
``
Metadata
Metadata
Assignees
Labels
No labels