[SUGGESTION OF FIX] "TypeError: customChains is not iterable" When verifying contract.

Abierto
#140 3 comentarios 11 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
javascript, typescript

Línea de trabajo

Start at hardhat.config.ts around line 73 and review the etherscan configuration used by the verification commands shown in the issue. Run the TypeScript verification flow and the hardhat verify command on a configured network; done means both no longer fail with the reported customChains or verifyAllowedChains errors.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

PROBLEM

I get the next error when running 'verify' on typescript:

TypeError: customChains is not iterable
    at getEtherscanEndpoints (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/@nomiclabs/hardhat-etherscan/src/network/prober.ts:33:37)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Environment._runTaskDefinition (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at async Environment.run (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at async SimpleTaskDefinition.verifySubtask [as action] (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/@nomiclabs/hardhat-etherscan/src/index.ts:209:30)
    at async Environment._runTaskDefinition (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at async Environment.run (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at async verify (/Users/facundocastello/projects/hardhat-starter-kit/helper-functions.ts:46:9)
    at async Object.deployFunction [as func] (/Users/facundocastello/projects/hardhat-starter-kit/deploy/13_Deploy_BasicNFT.ts:30:9)
    at async DeploymentsManager.executeDeployScripts (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1220:22

another error that you can see for the same reason is when running yarn hardhat verify --network <NETWORK> <CONTRACT_ADDRESS> <CONSTRUCTOR_PARAMETERS> is the next one:

TypeError: Cannot read properties of undefined (reading 'map')
    at verifyAllowedChains (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/@nomiclabs/hardhat-etherscan/src/config.ts:20:53)
    at SimpleTaskDefinition.verify (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/@nomiclabs/hardhat-etherscan/src/index.ts:152:22)
    at Environment._runTaskDefinition (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:35)
    at Environment.run (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:25)
    at main (/Users/facundocastello/projects/hardhat-starter-kit/node_modules/hardhat/src/internal/cli/cli.ts:272:17)

the solution is the same one.

SOLUTION

The fix is to add customChains: [], afther the element on this line:
https://github.com/smartcontractkit/hardhat-starter-kit/blob/ca2bd3d1de672005c8db0fe747c659724e174a32/hardhat.config.ts#L73

so it will be like this

    etherscan: {
        // yarn hardhat verify --network <NETWORK> <CONTRACT_ADDRESS> <CONSTRUCTOR_PARAMETERS>
        apiKey: {
            polygon: POLYGONSCAN_API_KEY,
            goerli: ETHERSCAN_API_KEY,
        },
        customChains: [],
    },
Lenguaje dominante
JavaScript
Estrellas
1.3k
Forks
510
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de smartcontractkit/hardhat-starter-kit

Todos los issues de smartcontractkit/hardhat-starter-kit

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.