如何使用 Chainlink Imports 验证通过 Remix 部署的合约?

Posted

技术标签:

【中文标题】如何使用 Chainlink Imports 验证通过 Remix 部署的合约?【英文标题】:How to verify contracts that were deployed through Remix using Chainlink Imports? 【发布时间】:2021-12-25 16:10:27 【问题描述】:

关于使用 Chainlink Imports 通过 Remix 部署的验证合约的建议?目前 BSCScan(我相信 Etherscan)有following limitation:

使用“导入”的合同需要将代码连接起来 到一个文件中,因为我们不支持在单独的文件中“导入”。

问题在于 VRFConsumerBase.sol 中还有其他导入。使连接过程有点繁琐。 I've done this following @Patrick Collins's video with Hardhat 很容易,但我正在使用的项目是在 Remix 中开发的。

【问题讨论】:

【参考方案1】:

不幸的是,这看起来像设计的那样工作。除非 etherscan/bsscan 等更改其流程,否则您要么必须手动添加大量代码。

作为替代方案,您可以将 remix 中的所有代码放入新的 Hardhat 项目中,然后使用 hardhat-etherscan 插件轻松验证合约

【讨论】:

以上是关于如何使用 Chainlink Imports 验证通过 Remix 部署的合约?的主要内容,如果未能解决你的问题,请参考以下文章

如何从 Chainlink 获取价格信息?

World Mobile与Chainlink达成战略技术合作

World Mobile与Chainlink达成战略技术合作

如何使用 Chainlink api 调用通过 api 从 json 返回中检索字符串值

Chainlink的77种用法

ESLint:如何使用“no-restricted-imports”限制某些路径但允许子路径?