当前位置: 首页 > 知识库问答 >
问题:

“path”参数的类型必须为string。接收未定义。无法验证1个合同

锺离声
2023-03-14

我正在将智能合约部署到Rinkeby网络,然后尝试用

truffle run verify IzoneMember --network rinkeby

但是它不起作用,并继续显示此消息,但是我已经安装了松露验证插件,反应脚本和cucumber。

PS C:\Users\dohva\Documents\Github Repo\NFT\truffle-starter-kit> truffle run verify IzoneMember --network rinkeby
Verifying IzoneMember
The "path" argument must be of type string. Received undefined
Failed to verify 1 contract(s): IzoneMember

这是我的package.json

{
  "name": "@chainlink/box",
  "version": "0.6.0",
  "description": "A Chainlink example in a Truffle box",
  "scripts": {
    "compile": "npx truffle compile",
    "console:dev": "npx truffle console --network cldev",
    "console:kovan": "npx truffle console --network kovan",
    "depcheck": "echo '@chainlink/box' && depcheck --ignore-dirs=build/contracts || true",
    "solhint": "solhint ./contracts/**/*.sol",
    "lint": "yarn solhint",
    "migrate:dev": "npx truffle migrate --reset --network cldev",
    "migrate:kovan": "npx truffle migrate --network kovan",
    "test": "npx truffle test"
  },
  "license": "MIT",
  "dependencies": {
    "@chainlink/contracts": "^0.1.9",
    "@cucumber/cucumber": "^7.3.1",
    "@openzeppelin/contracts": "^3.4.1",
    "@truffle/hdwallet-provider": "^1.4.2",
    "bip39": "^3.0.4",
    "cucumber": "^7.0.0-rc.0",
    "dotenv": "^8.6.0",
    "react-scripts": "^4.0.3",
    "web3": "^1.4.0"
  },
  "devDependencies": {
    "@chainlink/belt": "^0.0.3",
    "@chainlink/test-helpers": "0.0.5",
    "@openzeppelin/test-helpers": "^0.5.10",
    "chai": "^4.3.0",
    "depcheck": "^1.3.1",
    "solhint": "^3.3.2",
    "truffle": "^5.3.1",
    "truffle-plugin-verify": "^0.5.11"
  },
  "resolutions": {
    "**/minimist": "^0.2.1",
    "**/node-fetch": "^2.6.1",
    "**/yargs-parser": "^13.1.2",
    "**/mem": "^4.0.0"
  },
  "react-scripts": "^4.0.3"
}

这是我的truffle-config.js

const HDWalletProvider = require('@truffle/hdwallet-provider')
require('dotenv').config()

const mnemonic = process.env.MNEMONIC
const url = process.env.RINKEBY_RPC_URL

module.exports = {
  networks: {
    rinkeby: {
      provider: () =>
        new HDWalletProvider({
          mnemonic: process.env.MNEMONIC,
          providerOrUrl: "https://rinkeby.infura.io/v3/dd2fabf723e1433ba4a9339cae33afa6",
          numberOfAddresses: 1,
          shareNonce: true,
        }),
      network_id: '4',
    },
    development: {
      host: 'localhost',
      port: 7545,
      network_id: '*', // Match any network id
    },
    mainnet: {
      provider: () => {
        return new HDWalletProvider(process.env.MAINNET_MNEMONIC, process.env.MAINNET_RPC_URL)
      },
      network_id: '1',
      skipDryRun: true,
    },
  },
  compilers: {
    solc: {
      version: "^0.6.6",
      }
  },
  api_keys: {
    etherscan: "52NGDWZMANK51AXZ6ST3Z9PQS97WZP8X15"
  },
  plugins: [
    'truffle-plugin-verify'
  ]
}

共有1个答案

罗翰
2023-03-14

对我来说,我有进口合同,例如,

../node_modules/@openzeppelin

我删除了。/node\u模块/,并将其修复

 类似资料: