When I execute the following function in UniswapV2Library.getReserves(address factory, address tokenA, address tokenB) it returns Error: Transaction reverted: function returned an unexpected amount of data
Take note factory is Sushiswap factory address, token0 and token1 are 1INCH and WETH token addresses respectively on mainnet.
_Error: Transaction reverted: function returned an unexpected amount of data
at FlashloanArbitrage.getReserves (contracts/UniswapV2Library.sol:74)
at FlashloanArbitrage.getAmountsIn (contracts/UniswapV2Library.sol:124)
at FlashloanArbitrage.uniswapV2Call (contracts/FlashloanArbitrage.sol:110)
at . (0x86f518368e0d49d5916e2bd9eb162e9952b7b04d)
at FlashloanArbitrage.startArbitrage (contracts/FlashloanArbitrage.sol:50)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at EthModule._estimateGasAction (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\provider\modules\eth.ts:429:7)
at HardhatNetworkProvider._sendWithLogging (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:139:22)
at HardhatNetworkProvider.request (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:116:18)
at JsonRpcHandler._handleRequest (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\jsonrpc\handler.ts:188:20)
at JsonRpcHandler._handleSingleRequest (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\jsonrpc\handler.ts:167:17)
at Server.JsonRpcHandler.handleHttp (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\nodemodules\hardhat\src\internal\hardhat-network\jsonrpc\handler.ts:52:21)
Hello,
When I execute the following function in UniswapV2Library.getReserves(address factory, address tokenA, address tokenB) it returns Error: Transaction reverted: function returned an unexpected amount of data Take note
factory
is Sushiswap factory address,token0
andtoken1
are 1INCH and WETH token addresses respectively on mainnet.(reserve0, reserve1,) = IUniswapV2Pair(pairForSushiswap(factory, token0, token1)).getReserves();
_Error: Transaction reverted: function returned an unexpected amount of data at FlashloanArbitrage.getReserves (contracts/UniswapV2Library.sol:74) at FlashloanArbitrage.getAmountsIn (contracts/UniswapV2Library.sol:124) at FlashloanArbitrage.uniswapV2Call (contracts/FlashloanArbitrage.sol:110) at. (0x86f518368e0d49d5916e2bd9eb162e9952b7b04d)
at FlashloanArbitrage.startArbitrage (contracts/FlashloanArbitrage.sol:50)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at EthModule._estimateGasAction (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\provider\modules\eth.ts:429:7)
at HardhatNetworkProvider._sendWithLogging (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:139:22)
at HardhatNetworkProvider.request (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:116:18)
at JsonRpcHandler._handleRequest (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\jsonrpc\handler.ts:188:20)
at JsonRpcHandler._handleSingleRequest (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\node_modules\hardhat\src\internal\hardhat-network\jsonrpc\handler.ts:167:17)
at Server.JsonRpcHandler.handleHttp (C:\Samuel\Blockchain\Flashloan-arbitrage-bot-uniswapV2_hardhat\nodemodules\hardhat\src\internal\hardhat-network\jsonrpc\handler.ts:52:21)
Any clues please?