我已经按照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...
我似乎找不到关于此的任何其他信息。