wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.19k stars 292 forks source link

extra hardhat.config network options ("deploy" field) #312

Open gtsui opened 2 years ago

gtsui commented 2 years ago

Describe the bug In the documentation its mentioned that extra network options are available in hardhat.config. Specifically, the "deploy" field which allows you to override the default deploy folder by network. However, this does not seem to work. It seems like that field is just ignored.

To Reproduce

My hardhat.config file:

module.exports = {
  solidity: {
    version: "0.8.9",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200
      }
    }
  },

  networks: {
    hardhat: {
      deploy: 'deploy/hardhat'
    },
  }
}

If I put my deploy scripts in the /deploy/hardhat/ folder and run npx hardhat deploy nothing happens. However, if I set the "deploy" field within the paths config to 'deploy/hardhat' then it does recognize my deploy scripts. So it seems like only the network specific deploy field is not working properly in my case.

versions

  "devDependencies": {
    "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.13",
    "@nomiclabs/hardhat-etherscan": "^3.0.3",
    "@nomiclabs/hardhat-waffle": "^2.0.3",
    "@openzeppelin/hardhat-upgrades": "^1.12.1",
    "@types/chai": "^4.3.1",
    "@types/mocha": "^9.1.0",
    "@types/node": "^17.0.25",
    "chai": "^4.3.6",
    "ethereum-waffle": "^3.4.0",
    "ethers": "^5.6.4",
    "hardhat": "^2.9.1",
    "hardhat-deploy": "^0.11.4",
    "hardhat-gas-reporter": "^1.0.7",
    "mocha": "^10.0.0",
    "ts-node": "^10.7.0",
    "typescript": "^4.6.3"
  },
  "dependencies": {
    "@openzeppelin/contracts": "^4.5.0",
    "dotenv": "^16.0.0",
    "solidity-docgen": "^0.6.0-beta.10"
  }

Additional context Add any other context about the problem here.