workshops icon indicating copy to clipboard operation
workshops copied to clipboard

HH700: Artifact for contract "MinimalForwarder" not found

Open kylemantesso opened this issue 3 years ago • 3 comments

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 avatar Oct 25 '22 20:10 kylemantesso

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],
    },

  }
};

kylemantesso avatar Oct 25 '22 21:10 kylemantesso

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

jnuno98 avatar Jan 04 '23 13:01 jnuno98

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!

vicentemunozlh avatar Jan 04 '23 19:01 vicentemunozlh