[SUGGESTION OF FIX] "TypeError: customChains is not iterable" When verifying contract.
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- javascript, typescript
- 领域
- blockchain, devtools
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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: [],
},
- 主要语言
- JavaScript
- 星标
- 1.3k
- 派生
- 510
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
smartcontractkit/hardhat-starter-kit 的其他 Issue
-
难度 5/5 一周以上 新手友好度 1/100
-
难度 4/5 3-5 天 新手友好度 35/100
smartcontractkit/hardhat-starter-kit#197 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
smartcontractkit/hardhat-starter-kit#190 · 4 条评论 ·
-
难度 3/5 1-2 天 新手友好度 25/100
smartcontractkit/hardhat-starter-kit#188 · 1 条评论 ·
-
Duplicate definition of Transfer可能重新可做 @andrejrakic 于 970 天前认领,目前没有进行中的 PR。 未关闭
smartcontractkit/hardhat-starter-kit#182 · 2 条评论 · 已指派 1 人 ·
查看 smartcontractkit/hardhat-starter-kit 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
githubnext/gh-aw-workshop#6247 ·
维护者通常 1 天内回复
-
good first issue type/ci
难度 2/5 1-3 小时 新手友好度 81/100
c-w-z/commit-decision-record#20 ·
维护者通常 1 天内回复
-
channels:add check:passed
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
web-platform-tests/wpt#65844 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
JuliusBrussee/caveman#1606 ·
维护者通常 1 天内回复