|
@@ -19,7 +19,7 @@ router.post("/", async (req, res) => {
|
|
|
// const allowance = await usdc.allowance(signer.address, routerAddress);
|
|
|
let approveGas = 0;
|
|
|
// if (allowance <= 0) {
|
|
|
- const approveTx = await usdc.approve(routerAddress, 0xFFFFFFFF);
|
|
|
+ const approveTx = await usdc.approve(routerAddress, amountNumber);
|
|
|
await approveTx.wait();
|
|
|
const txReceipt = await provider.getTransactionReceipt(approveTx.hash);
|
|
|
approveGas = utils.formatEther((txReceipt.gasUsed * approveTx.gasPrice).toFixed(0));
|