OpenZeppelin / workshops

Code and slides for OpenZeppelin Workshops
428 stars 277 forks source link

HH700: Artifact for contract "MinimalForwarder" not found #28

Open kylemantesso opened 1 year ago

kylemantesso commented 1 year ago

Running through the readme. for workshop 25, try to run yarn deploy and get this error

workshops/25-defender-metatx-api [master●] » yarn deploy      
yarn run v1.22.19
$ node scripts/deploy.js
HardhatError: HH700: Artifact for contract "MinimalForwarder" not found.
    at Artifacts._getArtifactPathFromFiles (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/node_modules/hardhat/internal/artifacts.js:264:19)
    at Artifacts._getArtifactPath (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/node_modules/hardhat/internal/artifacts.js:217:21)
    at async Artifacts.readArtifact (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/node_modules/hardhat/internal/artifacts.js:46:30)
    at async getContractFactoryByName (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/node_modules/@nomiclabs/hardhat-ethers/dist/src/helpers.js:49:22)
    at async main (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/scripts/deploy.js:19:21)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
kylemantesso commented 1 year ago

I had to bump the verison of solidity in the hardhat config to get this to work. It may be because there is a package-lock.json but the readme says to use yarn, so it may install a newer version as a dep.

hardhat.config.js

module.exports = {
  solidity: "0.8.9",
  networks: {
    local: {
      url: 'http://localhost:8545'
    },
    goerli: {
      url: 'https://rpc.goerli.mudit.blog',
      accounts: [process.env.PRIVATE_KEY],
    },

  }
};
jnuno98 commented 1 year ago

Even with that change I can't make it work. Should I bump solidity to a newer version?

vicentemunozlh commented 1 year ago

You should do what @kylemantesso said in the previous response (https://github.com/OpenZeppelin/workshops/issues/28#issuecomment-1291138261) and then compile!

yarn hardhat compile

Or at leas that worked for me. Then, if you are deploying the Forwarder/Registry contracts with your relayer you should found the relayer with goerli eth after compiling!