dappuniversity / price-bot

397 stars 392 forks source link

Error: Returned values aren't valid #3

Closed codemedici closed 3 years ago

codemedici commented 3 years ago
Listening on 5000
Checking prices...
Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.
    at ABICoder.decodeParameters (/Users/codeme/code/defi/node_modules/web3-eth-abi/src/index.js:338:15)
    at Contract._decodeMethodReturn (/Users/codeme/code/defi/node_modules/web3-eth-contract/src/index.js:572:22)
    at Method.outputFormatter (/Users/codeme/code/defi/node_modules/web3-eth-contract/src/index.js:935:42)
    at Method.formatOutput (/Users/codeme/code/defi/node_modules/web3-core-method/src/index.js:169:54)
    at sendTxCallback (/Users/codeme/code/defi/node_modules/web3-core-method/src/index.js:653:33)
    at onJsonrpcResult (/Users/codeme/code/defi/node_modules/web3-core-requestmanager/src/index.js:179:9)
    at XMLHttpRequest.request.onreadystatechange (/Users/codeme/code/defi/node_modules/web3-providers-http/src/index.js:111:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/codeme/code/defi/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
    at XMLHttpRequest._setReadyState (/Users/codeme/code/defi/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
    at XMLHttpRequest._onHttpResponseEnd (/Users/codeme/code/defi/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
    at IncomingMessage.<anonymous> (/Users/codeme/code/defi/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
    at IncomingMessage.emit (events.js:333:22)
    at endReadableNT (_stream_readable.js:1201:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
^C

The line causing the error is this: const exchangeAddress = await uniswapFactoryContract.methods.getExchange(outputTokenAddress).call() Is there a mismatch between the ABI and the bytecode?

codemedici commented 3 years ago

My bad I was using the Ropsten infura endpoint rather than mainnet