Skip to content

Hardhat artifacts and viem #5066

Discussion options

You must be logged in to vote

Yes, in the end I used wagmi-cli with this wagmi.config.ts, you'd need to update the paths to your own. Then you can import the generated abi with viem

import {defineConfig} from '@wagmi/cli';
import {hardhat} from '@wagmi/cli/plugins';

export default defineConfig({
  // using abi instead of generated to avoid being ignored by git
  out: `generated/abis.ts`,
  plugins: [
    hardhat({
      artifacts: `../contracts/artifacts/src`,
      exclude: ['**/test'],
      project: '../contracts',
    }),
  ],
});

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
6 replies
@schaable
Comment options

schaable Apr 5, 2024
Collaborator

@josemarinas
Comment options

@schaable
Comment options

schaable Apr 8, 2024
Collaborator

@josemarinas
Comment options

@schaable
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@josemarinas
Comment options

Answer selected by josemarinas
@sshmaxime
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants