Переглянути джерело

fix: syncswap fix approve amount

wren 1 рік тому
батько
коміт
6f455da801
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      js-runtime/src/script/zksync2/sync/swapUsdcForEth.js

+ 1 - 1
js-runtime/src/script/zksync2/sync/swapUsdcForEth.js

@@ -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));