admin管理员组文章数量:1356877
TypeScript with Ethers Version [email protected]
Hello !!
Error: "missing revert data in call exception; Transaction reverted without a reason string"
El Error se produce en la funcion "V2Router.getAmountsOut"
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 );
const amountsOut = await V2Router.getAmountsOut(1000, [tokenIn, tokenOut]);
if (!amountsOut || amountsOut.length !== 2) {
return getBigNumber(0); }
return amountsOut[1]; };
Log:
[WARN] error - Error en GetPrice: missing revert data in call exception; Transaction reverted without a reason string
Similars: .js/discussions/2849
TypeScript with Ethers Version [email protected]
Hello !!
Error: "missing revert data in call exception; Transaction reverted without a reason string"
El Error se produce en la funcion "V2Router.getAmountsOut"
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 );
const amountsOut = await V2Router.getAmountsOut(1000, [tokenIn, tokenOut]);
if (!amountsOut || amountsOut.length !== 2) {
return getBigNumber(0); }
return amountsOut[1]; };
Log:
[WARN] error - Error en GetPrice: missing revert data in call exception; Transaction reverted without a reason string
Similars: https://github./ethers-io/ethers.js/discussions/2849
Share Improve this question asked Jul 5, 2022 at 17:47 Julio SardaJulio Sarda 291 gold badge1 silver badge4 bronze badges2 Answers
Reset to default 5The result of calling a function that existed in the ABI I was using, but not in the actual contract deployed on the Blockchain. In other words, I supplied the wrong contract address when I created the contract using new ethers.Contract(address, ABI, signer)
One of the cause may be the Rpc Endpoint, try changing your rpc endpoint to the API_KEY only. Like your Your URL would be something like "https://eth-goerli.g.alchemy./v2/YOUR_API_KEY", try it only with YOUR_API_KEY.
This also happens when wrong arguments are passed in your contract methods. Refer to this answer for more info
本文标签: javascriptError quotmissing revert data in call exceptionquot with ethers569Stack Overflow
版权声明:本文标题:javascript - Error: "missing revert data in call exception" with ethers5.6.9 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744045079a2581372.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论