yuichiroaoki / poly-flashloan-bot

Flashloan Bot on Polygon
https://yuichiroaoki.medium.com/flashloan-bot-on-polygon-part-2-3eae0ac33986?sk=80821da4ca1d0462c7c9ae617df56bdd
MIT License
302 stars 192 forks source link

Failed to estimate price: missing revert data in call exception !! #95

Closed JulioSarda closed 2 years ago

JulioSarda commented 2 years ago

Hi from Argentina again !! Error in "V2Router.getAmountsOut" and "quoterContract.callStatic.quoteExactInputSingle" too Failed to estimate price: missing revert data in call exception; Transaction reverted without a reason string Any suggestion Please ? Thanks !!

JulioSarda commented 2 years ago

Ethers Version ethers@5.6.9

Code: ... import * as UniswapV2Router from "../../../abis/UniswapV2Router02.json"; ... export const getPriceOnUniV2 = async ( tokenIn: string, tokenOut: string, amountIn: BigNumber, routerAddress: string ): Promise => {

const V2Router = new ethers.Contract( routerAddress, UniswapV2Router.abi, maticProvider );

errReport.warn("Luego Contrato Router");

errReport.warn("TokenIn: ",tokenIn)

errReport.warn("TokenOut: ",tokenOut)

errReport.warn("AmountIn: ",amountIn)

errReport.warn("Antes GetAmountsOut");

const amountsOut = await V2Router.getAmountsOut(1000, [tokenIn, tokenOut]);

errReport.warn("amountsOut; ",amountsOut);

errReport.warn("Luego GetAmountsOut");

if (!amountsOut || amountsOut.length !== 2) {

errReport.warn("Error GetAmountsOut");

return getBigNumber(0);

}

return amountsOut[1]; };

Log:

50:45.192] [WARN] error - Luego Contrato Router [2022-07-03T09:50:45.194] [WARN] error - TokenIn: 0x2791bca1f2de4661ed88a30c99a7a9449aa84174 [2022-07-03T09:50:45.194] [WARN] error - TokenOut: 0x8f3cf7ad23cd3cadbd9735aff958023239c6a063 [2022-07-03T09:50:45.194] [WARN] error - AmountIn: BigNumber { _hex: '0x04a817c800', _isBigNumber: true } [2022-07-03T09:50:45.194] [WARN] error - Antes GetAmountsOut [2022-07-03T09:50:47.098] [WARN] error - Error en GetPrice: missing revert data in call exception; Transaction reverted without a reason string [2022-07-03T09:

JulioSarda commented 2 years ago

I ressolve.

LordReya commented 1 year ago

I ressolve.

How did you resolve it? @JulioSarda