【问题标题】:Uniswap v3 Deploy Hardhat Plugin fails - uniswap-v3-deploy-pluginUniswap v3 部署安全帽插件失败 - uniswap-v3-deploy-plugin
【发布时间】:2021-12-14 00:38:51
【问题描述】:

我已经按照 https://www.youtube.com/watch?v=cZ7QMmm7hJc 中的部署步骤进行了基于 Hardhat 的 Uniswap v3 开发设置。

https://github.com/Uniswap/hardhat-plugin-deploy-v3

在创建新项目时:

npm init
npm add --save-dev hardhat
npx hardhat - select create an empty config file
npm install --save-dev @nomiclabs/hardhat-ethers

// add: require("uniswap-v3-deploy-plugin"); to hardhat.config.js
// add: require("@nomiclabs/hardhat-ethers"); to hardhat.config.js

我遇到的第一个问题是我必须将 Node 降级到 v16.3.1。

npx hardhat - 我在可用任务中看到“deploy-uniswap”

npx hardhat deploy-uniswap 导致一个充满字节码和一些额外细节的严重错误:

...3000706000a", code=INVALID_ARGUMENT, version=contracts/5.5.0)
    at Logger.makeError (C:\DEV\uniswap-example2\node_modules\@ethersproject\logger\src.ts\index.ts:225:28)
    at Logger.throwError (C:\DEV\uniswap-example2\node_modules\@ethersproject\logger\src.ts\index.ts:237:20)
    at Logger.throwArgumentError (C:\DEV\uniswap-example2\node_modules\@ethersproject\logger\src.ts\index.ts:241:21)
    at new ContractFactory (C:\DEV\uniswap-example2\node_modules\@ethersproject\contracts\src.ts\index.ts:1162:20)
    at UniswapV3Deployer.deployContract (C:\DEV\uniswap-example2\node_modules\uniswap-v3-deploy-plugin\src\deployer\UniswapV3Deployer.ts:139:21)
    at UniswapV3Deployer.deployPositionDescriptor (C:\DEV\uniswap-example2\node_modules\uniswap-v3-deploy-plugin\src\deployer\UniswapV3Deployer.ts:112:24)
    at Function.deploy (C:\DEV\uniswap-example2\node_modules\uniswap-v3-deploy-plugin\src\deployer\UniswapV3Deployer.ts:27:47)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at runNextTicks (node:internal/process/task_queues:65:3)
    at listOnTimeout (node:internal/timers:526:9) {
  reason: 'invalid bytecode',
  code: 'INVALID_ARGUMENT',
  argument: 'bytecode',
  value: '0x60c06040523480156100105760008...

我似乎找不到任何其他信息。

【问题讨论】:

  • ElHaix 你的案子解决了吗?
  • 还没有。我提出了这个并分支到了相关的开发路径。

标签: npx hardhat uniswap


【解决方案1】:

uniswap/v3-periphery 中有一些重大变化,我通过覆盖 package.json 中的依赖项解决了它:

"overrides": {
  "@uniswap/v3-periphery": "1.0.1"
}

关于覆盖的详细信息是here

【讨论】:

    猜你喜欢
    • 2022-10-26
    • 2022-11-04
    • 2022-08-29
    • 2023-01-05
    • 2022-07-29
    • 2022-10-22
    • 2021-10-01
    • 2022-07-11
    • 2021-11-18
    相关资源
    最近更新 更多