Skip to content

Debugging Guide

Constance Shi edited this page Dec 11, 2020 · 9 revisions

Error:

Returned values aren't valid, did it run Out of Gas?

Solution:

  • Make sure the USDC_CONTRACT_ADDRESS in your .env file matches the network in the Metamask extension. For example, if Metamask is set to Ropsten then USDC_CONTRACT_ADDRESS should be the address for the USDC contract on Ropsten (and the same for mainnet). A future solution for this could be to programmatically set the Metamask network.

Metamask Error:

Error in contract code

Solution:

  • Try lowering the gas price
  • Check that the balance of USDC in the accounts is greater than the amount you are trying to transfer/burn if applicable
  • Check that the amount you are trying to mint is lower than the minter allowance if applicable

Metamask Error: Transaction failed

Solution:

  • Verify that the contract is not paused
  • Verify that the address performing the transaction is not blacklisted and has the correct permissions

Error: /accounts or /transactions page loads infinitely

Solution:

  • These pages take a bit longer to load (30 seconds to two minutes on mainnet) due to many transactions and accounts. This is due to web3 limitations with traversing many blocks to find the most recent 10k transactions/accounts, and then any additional processing like fetching the corresponding ages in parallel. This could potentially be improved with indexers like Google BigQuery in the future, but BigQuery also does not support Ethereum Ropsten or many other chains.
  • If the page still doesn't load after a few minutes, try refreshing the page.

Error: Unexpected end of JSON or other JSON errors

Solution:

  • npm update so that all modules, especially algosdk, are installed
  • Ensure you have 3 variables in .env: GOOGLE_APPLICATION_CREDENTIALS, USDC_CONTRACT_ADDRESS, and PURESTAKE_API_KEY (if using Algorand)
  • Ensure you have the correct and complete google-credentials.json file

Clone this wiki locally