Order transactions are failing

Hi Community ,
I am trying multiCall to place multiple orders at the same time in MetaMask . The orders are getting placed , but its getting failed after some time . Iam not getting the error message too.
Iam using the goerli test network .
I have attached the code snippet below and the transaction reciept hash is
0x838983246d9ad43a6e37ef7f0397c88fb5afa4c59e912d7e27b49cbbbbf16a47

const V3SwapRouterAddress = "0xE592427A0AEce92De3Edee1F18E0157C05861564"; // 0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45
  const GETHADDRESS = "0x2142EA5a7A922a3F5A98A81567FA691187E550B1";
  const WETHAddress = "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6";
  const USDCAddress = "0x07865c6E87B9F70255377e024ace6630C1Eaa37F";
  const UNIADDRESS = "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984";
  const LINKADDRESS = "0x326C977E6efc84E512bB9C30f76E30c160eD06FB";
  console.log(
    V3SwapRouterABI.concat(PeripheryPaymentsABI).concat(MulticallABI)
  );
  const onLoads = async () => {
    const uniswapContractInstance = new ethers.Contract(
      V3SwapRouterAddress,
      V3SwapRouterABI.concat(PeripheryPaymentsABI).concat(MulticallABI)
    );

    const param1 = {
      tokenIn: WETHAddress,
      tokenOut: UNIADDRESS,
      fee: 3000,
      recipient: accounts,
      deadline: Math.floor(Date.now() / 1000) + 60 * 10,
      amountIn: ethers.utils.parseEther("0.0001"),
      amountOutMinimum: 0,
      sqrtPriceLimitX96: 0,
    };

    const a = uniswapContractInstance.interface.encodeFunctionData(
      "exactInputSingle",
      [param1]
    );

    const param2 = {
      tokenIn: WETHAddress,
      tokenOut: USDCAddress,
      fee: 3000,
      recipient: accounts,
      deadline: Math.floor(Date.now() / 1000) + 60 * 10,
      amountIn: ethers.utils.parseEther("0.0001"),
      amountOutMinimum: 0,
      sqrtPriceLimitX96: 0,
    };
    const b = uniswapContractInstance.interface.encodeFunctionData(
      "exactInputSingle",
      [param2]
    );
    const param3 = {
      tokenIn: WETHAddress,
      tokenOut: LINKADDRESS,
      fee: 3000,
      recipient: accounts,
      deadline: Math.floor(Date.now() / 1000) + 60 * 10,
      amountIn: ethers.utils.parseEther("0.0001"),
      amountOutMinimum: 0,
      sqrtPriceLimitX96: 0,
    };

    const c = uniswapContractInstance.interface.encodeFunctionData(
      "exactInputSingle",
      [param3]
    );

    const calls = [a, b, c];
    const multiCall = uniswapContractInstance.interface.encodeFunctionData(
      "multicall",
      [calls]
    );
    const targs = {
      to: V3SwapRouterAddress,
      from: accounts,
      data: multiCall,
      gasLimit: "210000",
  
    };
    // const a = await window.ethereum.request({ method: "eth_accounts" });
    // const account = window.ethereum._state?.accounts;
    const provider = await new ethers.providers.Web3Provider(window.ethereum);
    let check = await provider.getCode(V3SwapRouterAddress);
    console.log({ check });
    const signer = await provider.getSigner();
    console.log({ targs, provider, signer });
    const tx = await signer.sendTransaction(targs);
    console.log({ targs, provider });

    const reciept = await tx.wait();
    console.log({ reciept });
  };

Hello @Bejo_Jeffrin !
Welcome to MetaMask community )

Wrap the interaction with web3 and the contract in a try catch block and look in the developer console, there should be some error logs

1 Like

Hi @snwlprd.eth ,
Thanks for the quick response . Iam tried wrapping it in try catch block .


Iam getting CALL_EXCEPTION and reason as transaction failed . Can you please help me to resolve this issue

Try to remove from your code: gasLimit, deadline

1 Like

I tried it , iam getting a error saying cannot estimate gas . I cannot place the order

1 Like

@Bejo_Jeffrin

Linking this Github issue in case it helps:

1 Like

A post was split to a new topic: Assistance please

Hi @KBeeTheCapybara ,
I have sufficient Ether in my goerli test account to make the transaction .
Iam getting the issue while calling the method signer.estimateGasFee (txnObject) .

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.